diff --git a/apis/go.mod b/apis/go.mod index 0896f4664c1..dbc6fc1752f 100644 --- a/apis/go.mod +++ b/apis/go.mod @@ -5,28 +5,27 @@ go 1.26.0 toolchain go1.26.3 require ( - github.com/openshift/api v0.0.0-20260318185450-1f2fa3f09f4e - github.com/openshift/installer v1.4.22-ec5 - k8s.io/api v0.35.4 - k8s.io/apimachinery v0.35.4 + github.com/openshift/installer v1.5.0-alpha.1 + k8s.io/api v0.36.2 + k8s.io/apimachinery v0.36.2 ) require ( github.com/fxamacker/cbor/v2 v2.9.0 // indirect github.com/go-logr/logr v1.4.3 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/kr/text v0.2.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect + github.com/openshift/api v0.0.0-20260728120005-8ba0b25b0f29 github.com/x448/float16 v0.8.4 // indirect - go.yaml.in/yaml/v2 v2.4.3 // indirect - golang.org/x/net v0.55.0 // indirect - golang.org/x/text v0.37.0 // indirect + go.yaml.in/yaml/v2 v2.4.4 // indirect + golang.org/x/net v0.55.1-0.20260602153038-42abb857022c // indirect + golang.org/x/text v0.38.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect - k8s.io/klog/v2 v2.130.1 // indirect - k8s.io/kube-openapi v0.0.0-20260304202019-5b3e3fdb0acf // indirect - k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 // indirect + k8s.io/klog/v2 v2.140.0 // indirect + k8s.io/kube-openapi v0.0.0-20260519202549-bbf5c5577288 // indirect + k8s.io/utils v0.0.0-20260707023825-cf1189d6abe3 // indirect sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect sigs.k8s.io/randfill v1.0.0 // indirect - sigs.k8s.io/structured-merge-diff/v6 v6.3.1 // indirect + sigs.k8s.io/structured-merge-diff/v6 v6.4.0 // indirect ) diff --git a/apis/go.sum b/apis/go.sum index 06d19207564..b2ec651b789 100644 --- a/apis/go.sum +++ b/apis/go.sum @@ -1,4 +1,3 @@ -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= @@ -12,25 +11,19 @@ github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= 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/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= 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 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8= github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/openshift/api v0.0.0-20260318185450-1f2fa3f09f4e h1:n2fW82JRX5B/+eCULWIe06MAhJVaE8fUsvy0A0Gn9n4= -github.com/openshift/api v0.0.0-20260318185450-1f2fa3f09f4e/go.mod h1:pyVjK0nZ4sRs4fuQVQ4rubsJdahI1PB94LnQ8sGdvxo= -github.com/openshift/installer v1.4.22-ec5 h1:NG9X2iZG5mbUVZIBhpMtMrGNK7Tbm9dDGAI6aXh/QZc= -github.com/openshift/installer v1.4.22-ec5/go.mod h1:PbGvWlLRbmmSsaTQBAjhXPzliz9XJAYUdXcY0t/3UiY= +github.com/openshift/api v0.0.0-20260728120005-8ba0b25b0f29 h1:WrS2vkQtwJyo5xHJnJfjmHPDasdyKLKwojhMDV3tPto= +github.com/openshift/api v0.0.0-20260728120005-8ba0b25b0f29/go.mod h1:k6qH5QOVa5GDln2VVm8Jz4NV3Z7R2SATHFLwGS6Wh3M= +github.com/openshift/installer v1.5.0-alpha.1 h1:Vd+ZAiD6cV5h8fBTPvYnbq42KwScdzhHVF3RFhzHu0w= +github.com/openshift/installer v1.5.0-alpha.1/go.mod h1:K6syzgcjEQO7QymXOD/CnJTqNNrJVoBX3I1YecYmfck= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 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/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= -github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -39,34 +32,31 @@ github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= -go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0= -go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8= -golang.org/x/net v0.55.0 h1:bcvxaJn3e1U6InsFWt1JUq1aSjnRxLzT2rtD2KfkDF8= -golang.org/x/net v0.55.0/go.mod h1:L5U2KuzuOe1lY7Z+aWVIKK6qEeJXnXV9yzGA+WCHJww= -golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc= -golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +go.yaml.in/yaml/v2 v2.4.4 h1:tuyd0P+2Ont/d6e2rl3be67goVK4R6deVxCUX5vyPaQ= +go.yaml.in/yaml/v2 v2.4.4/go.mod h1:gMZqIpDtDqOfM0uNfy0SkpRhvUryYH0Z6wdMYcacYXQ= +golang.org/x/net v0.55.1-0.20260602153038-42abb857022c h1:hzdRVvjwthcq46T3ybsDtJpg1iZZaW3zik9P3tsYJeo= +golang.org/x/net v0.55.1-0.20260602153038-42abb857022c/go.mod h1:Mo4aFsyVPXieTwCJ1g83a3xU8RY7PkHFQqQ7pkWnuM0= +golang.org/x/text v0.38.0 h1:sXmwo9DwP3OK9EZ7PqAdaooSGozfl/3a6/xJcbzPRhE= +golang.org/x/text v0.38.0/go.mod h1:YXZt3QhHUKYT53r2lLKFIVi6Ao1jdzrTR/KQ09qyxF4= 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.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.35.4 h1:P7nFYKl5vo9AGUp1Z+Pmd3p2tA7bX2wbFWCvDeRv988= -k8s.io/api v0.35.4/go.mod h1:yl4lqySWOgYJJf9RERXKUwE9g2y+CkuwG+xmcOK8wXU= -k8s.io/apimachinery v0.35.4 h1:xtdom9RG7e+yDp71uoXoJDWEE2eOiHgeO4GdBzwWpds= -k8s.io/apimachinery v0.35.4/go.mod h1:NNi1taPOpep0jOj+oRha3mBJPqvi0hGdaV8TCqGQ+cc= -k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= -k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= -k8s.io/kube-openapi v0.0.0-20260304202019-5b3e3fdb0acf h1:btPscg4cMql0XdYK2jLsJcNEKmACJz8l+U7geC06FiM= -k8s.io/kube-openapi v0.0.0-20260304202019-5b3e3fdb0acf/go.mod h1:kdmbQkyfwUagLfXIad1y2TdrjPFWp2Q89B3qkRwf/pQ= -k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 h1:SjGebBtkBqHFOli+05xYbK8YF1Dzkbzn+gDM4X9T4Ck= -k8s.io/utils v0.0.0-20251002143259-bc988d571ff4/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/api v0.36.2 h1:TF6YDLIzKfccK7cq9YpTcGX8TJmEkHVRv78DM51fRYY= +k8s.io/api v0.36.2/go.mod h1:F4LbMO4brjZYh7yFkXWhynSvtB7YauxV4c+HHkNRGNg= +k8s.io/apimachinery v0.36.2 h1:0PE/W/WNy1UX61NLbXY5TMbJ6UwLL6E6lAPkYrKFxbQ= +k8s.io/apimachinery v0.36.2/go.mod h1:fvf/HOLXq9RId0rnDIbN1OEBvHXdQbLMM8nu0LcBUf4= +k8s.io/klog/v2 v2.140.0 h1:Tf+J3AH7xnUzZyVVXhTgGhEKnFqye14aadWv7bzXdzc= +k8s.io/klog/v2 v2.140.0/go.mod h1:o+/RWfJ6PwpnFn7OyAG3QnO47BFsymfEfrz6XyYSSp0= +k8s.io/kube-openapi v0.0.0-20260519202549-bbf5c5577288 h1:A7Lby6ekC6nv+6oO38huCMFBRP0Os+tIeq1GkwxOQes= +k8s.io/kube-openapi v0.0.0-20260519202549-bbf5c5577288/go.mod h1:V/QaCUYDa+0QpcHhVVc5l99Uz56wEMEXBSj9oCDkNDY= +k8s.io/utils v0.0.0-20260707023825-cf1189d6abe3 h1:jVkFFVfXdXP74B/zbO3hM3hpSFD0xvhQ5U686DPurkE= +k8s.io/utils v0.0.0-20260707023825-cf1189d6abe3/go.mod h1:M2s5JB1lIYP3jzZdorPLHXIPJzt9vv2muW5a6L9DtNM= sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg= sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU= sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= -sigs.k8s.io/structured-merge-diff/v6 v6.3.1 h1:JrhdFMqOd/+3ByqlP2I45kTOZmTRLBUm5pvRjeheg7E= -sigs.k8s.io/structured-merge-diff/v6 v6.3.1/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE= +sigs.k8s.io/structured-merge-diff/v6 v6.4.0 h1:qmp2e3ZfFi1/jJbDGpD4mt3wyp6PE1NfKHCYLqgNQJo= +sigs.k8s.io/structured-merge-diff/v6 v6.4.0/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE= sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs= sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4= diff --git a/apis/hive/v1/zz_generated.defaults.go b/apis/hive/v1/zz_generated.defaults.go deleted file mode 100644 index 88694caacb8..00000000000 --- a/apis/hive/v1/zz_generated.defaults.go +++ /dev/null @@ -1,17 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -// Code generated by defaulter-gen. DO NOT EDIT. - -package v1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// RegisterDefaults adds defaulters functions to the given scheme. -// Public to allow building arbitrary schemes. -// All generated defaulters are covering - they call all nested defaulters. -func RegisterDefaults(scheme *runtime.Scheme) error { - return nil -} diff --git a/apis/vendor/github.com/openshift/api/config/v1/doc.go b/apis/vendor/github.com/openshift/api/config/v1/doc.go index f994547583d..867a4f43f91 100644 --- a/apis/vendor/github.com/openshift/api/config/v1/doc.go +++ b/apis/vendor/github.com/openshift/api/config/v1/doc.go @@ -1,6 +1,7 @@ // +k8s:deepcopy-gen=package,register // +k8s:defaulter-gen=TypeMeta // +k8s:openapi-gen=true +// +k8s:openapi-model-package=com.github.openshift.api.config.v1 // +openshift:featuregated-schema-gen=true // +kubebuilder:validation:Optional diff --git a/apis/vendor/github.com/openshift/api/config/v1/register.go b/apis/vendor/github.com/openshift/api/config/v1/register.go index 222c7f0cc73..1f27d821aba 100644 --- a/apis/vendor/github.com/openshift/api/config/v1/register.go +++ b/apis/vendor/github.com/openshift/api/config/v1/register.go @@ -78,6 +78,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { &ClusterImagePolicyList{}, &InsightsDataGather{}, &InsightsDataGatherList{}, + &CRIOCredentialProviderConfig{}, + &CRIOCredentialProviderConfigList{}, ) metav1.AddToGroupVersion(scheme, GroupVersion) return nil diff --git a/apis/vendor/github.com/openshift/api/config/v1/types.go b/apis/vendor/github.com/openshift/api/config/v1/types.go index 3e17ca0ccb6..e7106ef7abc 100644 --- a/apis/vendor/github.com/openshift/api/config/v1/types.go +++ b/apis/vendor/github.com/openshift/api/config/v1/types.go @@ -284,7 +284,12 @@ type ClientConnectionOverrides struct { } // GenericControllerConfig provides information to configure a controller +// +// Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). +// +openshift:compatibility-gen:level=1 type GenericControllerConfig struct { + metav1.TypeMeta `json:",inline"` + // servingInfo is the HTTP serving information for the controller's endpoints ServingInfo HTTPServingInfo `json:"servingInfo"` diff --git a/apis/vendor/github.com/openshift/api/config/v1/types_apiserver.go b/apis/vendor/github.com/openshift/api/config/v1/types_apiserver.go index b8a4399dbc3..7de714ebfb6 100644 --- a/apis/vendor/github.com/openshift/api/config/v1/types_apiserver.go +++ b/apis/vendor/github.com/openshift/api/config/v1/types_apiserver.go @@ -209,7 +209,7 @@ type APIServerNamedServingCert struct { } // APIServerEncryption is used to encrypt sensitive resources on the cluster. -// +openshift:validation:FeatureGateAwareXValidation:featureGate=KMSEncryptionProvider,rule="has(self.type) && self.type == 'KMS' ? has(self.kms) : !has(self.kms)",message="kms config is required when encryption type is KMS, and forbidden otherwise" +// +openshift:validation:FeatureGateAwareXValidation:featureGate=KMSEncryption,rule="has(self.type) && self.type == 'KMS' ? has(self.kms) : !has(self.kms)",message="kms config is required when encryption type is KMS, and forbidden otherwise" // +union type APIServerEncryption struct { // type defines what encryption type should be used to encrypt resources at the datastore layer. @@ -238,14 +238,13 @@ type APIServerEncryption struct { // managing the lifecyle of the encryption keys outside of the control plane. // This allows integration with an external provider to manage the data encryption keys securely. // - // +openshift:enable:FeatureGate=KMSEncryptionProvider + // +openshift:enable:FeatureGate=KMSEncryption // +unionMember // +optional - KMS *KMSConfig `json:"kms,omitempty"` + KMS KMSPluginConfig `json:"kms,omitempty,omitzero"` } // +openshift:validation:FeatureGateAwareEnum:featureGate="",enum="";identity;aescbc;aesgcm -// +openshift:validation:FeatureGateAwareEnum:featureGate=KMSEncryptionProvider,enum="";identity;aescbc;aesgcm;KMS // +openshift:validation:FeatureGateAwareEnum:featureGate=KMSEncryption,enum="";identity;aescbc;aesgcm;KMS type EncryptionType string diff --git a/apis/vendor/github.com/openshift/api/config/v1/types_authentication.go b/apis/vendor/github.com/openshift/api/config/v1/types_authentication.go index 64d0f399b09..348ee040107 100644 --- a/apis/vendor/github.com/openshift/api/config/v1/types_authentication.go +++ b/apis/vendor/github.com/openshift/api/config/v1/types_authentication.go @@ -5,7 +5,7 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" // +genclient // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +openshift:validation:FeatureGateAwareXValidation:featureGate=ExternalOIDC;ExternalOIDCWithUIDAndExtraClaimMappings;ExternalOIDCWithUpstreamParity,rule="!has(self.spec.oidcProviders) || self.spec.oidcProviders.all(p, !has(p.oidcClients) || p.oidcClients.all(specC, self.status.oidcClients.exists(statusC, statusC.componentNamespace == specC.componentNamespace && statusC.componentName == specC.componentName) || (has(oldSelf.spec.oidcProviders) && oldSelf.spec.oidcProviders.exists(oldP, oldP.name == p.name && has(oldP.oidcClients) && oldP.oidcClients.exists(oldC, oldC.componentNamespace == specC.componentNamespace && oldC.componentName == specC.componentName)))))",message="all oidcClients in the oidcProviders must match their componentName and componentNamespace to either a previously configured oidcClient or they must exist in the status.oidcClients" +// +openshift:validation:FeatureGateAwareXValidation:featureGate=ExternalOIDC;ExternalOIDCWithUIDAndExtraClaimMappings;ExternalOIDCWithUpstreamParity;ExternalOIDCExternalClaimsSourcing,rule="!has(self.spec.oidcProviders) || self.spec.oidcProviders.all(p, !has(p.oidcClients) || p.oidcClients.all(specC, self.status.oidcClients.exists(statusC, statusC.componentNamespace == specC.componentNamespace && statusC.componentName == specC.componentName) || (has(oldSelf.spec.oidcProviders) && oldSelf.spec.oidcProviders.exists(oldP, oldP.name == p.name && has(oldP.oidcClients) && oldP.oidcClients.exists(oldC, oldC.componentNamespace == specC.componentNamespace && oldC.componentName == specC.componentName)))))",message="all oidcClients in the oidcProviders must match their componentName and componentNamespace to either a previously configured oidcClient or they must exist in the status.oidcClients" // Authentication specifies cluster-wide settings for authentication (like OAuth and // webhook token authenticators). The canonical name of an instance is `cluster`. @@ -91,6 +91,7 @@ type AuthenticationSpec struct { // +openshift:enable:FeatureGate=ExternalOIDC // +openshift:enable:FeatureGate=ExternalOIDCWithUIDAndExtraClaimMappings // +openshift:enable:FeatureGate=ExternalOIDCWithUpstreamParity + // +openshift:enable:FeatureGate=ExternalOIDCExternalClaimsSourcing // +optional OIDCProviders []OIDCProvider `json:"oidcProviders,omitempty"` } @@ -245,6 +246,36 @@ type OIDCProvider struct { // +optional // +openshift:enable:FeatureGate=ExternalOIDCWithUpstreamParity UserValidationRules []TokenUserValidationRule `json:"userValidationRules,omitempty"` + + // externalClaimsSources is an optional field that can be used to configure + // sources, external to the token provided in a request, in which claims + // should be fetched from and made available to the claim mapping process + // that is used to build the identity of a token holder. + // + // For example, fetching additional user metadata from an OIDC provider's UserInfo endpoint. + // + // When not specified, only claims present in the token itself will be available + // in the claim mapping process. + // + // When specified, at least one external claim source must be specified and no more than 5 + // sources may be specified. + // All external claim sources must have unique claim mappings. + // When an external source responds and resolves additional claims successfully, they will + // be made available as claims during the claim mapping process. + // Externally sourced claims with the same name as a claim existing within the token will + // overwrite the claim data from the token with the externally sourced information. + // If an external source does not respond, responds with an error, or the additional + // claim data cannot be resolved from the response successfully it will not be + // included in the claim data passed to the claim mapping process. + // + // +openshift:enable:FeatureGate=ExternalOIDCExternalClaimsSourcing + // + // +optional + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=5 + // +kubebuilder:validation:XValidation:rule="self.all(s, s.mappings.all(m, self.filter(s2, s2.mappings.exists(m2, m2.name == m.name)).size() == 1))",message="mapping names must be unique across all external claim sources." + // +listType=atomic + ExternalClaimsSources []ExternalClaimsSource `json:"externalClaimsSources,omitempty"` } // +kubebuilder:validation:MinLength=1 @@ -618,6 +649,7 @@ type OIDCClientReference struct { // +openshift:validation:FeatureGateAwareXValidation:featureGate=ExternalOIDC,rule="has(self.claim)",message="claim is required" // +openshift:validation:FeatureGateAwareXValidation:featureGate=ExternalOIDCWithUIDAndExtraClaimMappings,rule="has(self.claim)",message="claim is required" // +openshift:validation:FeatureGateAwareXValidation:featureGate=ExternalOIDCWithUpstreamParity,rule="has(self.claim) ? !has(self.expression) : has(self.expression)",message="precisely one of claim or expression must be set" +// +openshift:validation:FeatureGateAwareXValidation:featureGate=ExternalOIDCWithUpstreamParity,rule="has(self.expression) && size(self.expression) > 0 ? !has(self.prefixPolicy) || self.prefixPolicy != 'Prefix' : true",message="prefixPolicy must not be set to 'Prefix' when expression is set" type UsernameClaimMapping struct { // claim is an optional field that configures the JWT token claim whose value is assigned to the cluster identity field associated with this mapping. // claim is required when the ExternalOIDCWithUpstreamParity feature gate is not enabled. @@ -650,11 +682,9 @@ type UsernameClaimMapping struct { // Allowed values are 'Prefix', 'NoPrefix', and omitted (not provided or an empty string). // // When set to 'Prefix', the value specified in the prefix field will be prepended to the value of the JWT claim. - // // The prefix field must be set when prefixPolicy is 'Prefix'. - // + // Must not be set to 'Prefix' when expression is set. // When set to 'NoPrefix', no prefix will be prepended to the value of the JWT claim. - // // When omitted, this means no opinion and the platform is left to choose any prefixes that are applied which is subject to change over time. // Currently, the platform prepends `{issuerURL}#` to the value of the JWT claim when the claim is not 'email'. // @@ -684,7 +714,7 @@ type UsernameClaimMapping struct { // +enum type UsernamePrefixPolicy string -var ( +const ( // NoOpinion let's the cluster assign prefixes. If the username claim is email, there is no prefix // If the username claim is anything else, it is prefixed by the issuerURL NoOpinion UsernamePrefixPolicy = "" @@ -710,12 +740,14 @@ type UsernamePrefix struct { // PrefixedClaimMapping configures a claim mapping // that allows for an optional prefix. +// +openshift:validation:FeatureGateAwareXValidation:featureGate=ExternalOIDCWithUpstreamParity,rule="has(self.expression) && size(self.expression) > 0 ? (!has(self.prefix) || size(self.prefix) == 0) : true",message="prefix must not be set to a non-empty value when expression is set" type PrefixedClaimMapping struct { TokenClaimMapping `json:",inline"` // prefix is an optional field that configures the prefix that will be applied to the cluster identity attribute during the process of mapping JWT claims to cluster identity attributes. // - // When omitted (""), no prefix is applied to the cluster identity attribute. + // When omitted or set to an empty string (""), no prefix is applied to the cluster identity attribute. + // Must not be set to a non-empty value when expression is set. // // Example: if `prefix` is set to "myoidc:" and the `claim` in JWT contains an array of strings "a", "b" and "c", the mapping will result in an array of string "myoidc:a", "myoidc:b" and "myoidc:c". // @@ -734,10 +766,10 @@ type TokenValidationRuleType string const ( // TokenValidationRuleTypeRequiredClaim indicates that the token must contain a specific claim. // Used as a value for TokenValidationRuleType. - TokenValidationRuleTypeRequiredClaim = "RequiredClaim" + TokenValidationRuleTypeRequiredClaim TokenValidationRuleType = "RequiredClaim" // TokenValidationRuleTypeCEL indicates that the token validation is defined via a CEL expression. // Used as a value for TokenValidationRuleType. - TokenValidationRuleTypeCEL = "CEL" + TokenValidationRuleTypeCEL TokenValidationRuleType = "CEL" ) // TokenClaimValidationRule represents a validation rule based on token claims. @@ -830,3 +862,355 @@ type TokenUserValidationRule struct { // +kubebuilder:validation:MaxLength=256 Message string `json:"message,omitempty"` } + +// ExternalClaimsSource provides the configuration for a single external claim source. +type ExternalClaimsSource struct { + // authentication is an optional field that configures how the apiserver authenticates with an external claims source. + // When not specified, anonymous authentication is used which means no 'Authorization' header + // is sent in the HTTP request to fetch the external claims. + // + // +optional + Authentication ExternalSourceAuthentication `json:"authentication,omitzero"` + + // tls is an optional field that configures the http client TLS + // settings when fetching external claims from this source. + // + // When omitted, system default TLS settings will be used + // for fetching claims from the external source. + // + // +optional + TLS ExternalSourceTLS `json:"tls,omitzero"` + + // url is a required configuration of the URL + // for which the external claims are located. + // + // +required + URL SourceURL `json:"url,omitzero"` + + // mappings is a required list of the claim + // and response handling expression pairs + // that produces the claims from the external source. + // mappings must have at least 1 entry and must not exceed 16 entries. + // Entries must have a unique name across all external claim sources. + // + // +required + // +listType=map + // +listMapKey=name + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=16 + Mappings []SourcedClaimMapping `json:"mappings,omitempty"` + + // predicates is an optional list of constraints in + // which claims should attempt to be fetched from this + // external source. + // + // When omitted, claims are always fetched + // from this external source. + // + // When specified, all predicates must evaluate to 'true' + // before claims are attempted to be fetched from this external source. + // predicates must have at least 1 entry and must not exceed 16 entries. + // Entries must have unique expressions. + // + // +optional + // +listType=map + // +listMapKey=expression + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=16 + Predicates []ExternalSourcePredicate `json:"predicates,omitempty"` +} + +// ExternalSourceAuthenticationType is the type of authentication that should be used +// when fetching claims from an external source. +// +// +enum +// +kubebuilder:validation:Enum=RequestProvidedToken;ClientCredential +type ExternalSourceAuthenticationType string + +const ( + // ExternalSourceAuthenticationTypeRequestProvidedToken is an ExternalSourceAuthenticationType + // that represents that the token being evaluated for authentication + // should be used for authenticating with the external claims source. + // This is useful for scenarios where a token has multiple audiences + // and scopes so that it can be used to access both the cluster and + // the UserInfo endpoint that contains additional information about the + // user not present in the token. + ExternalSourceAuthenticationTypeRequestProvidedToken ExternalSourceAuthenticationType = "RequestProvidedToken" + + // ExternalSourceAuthenticationTypeClientCredential is an ExternalSourceAuthenticationType + // that represents that the authenticator should use the OAuth2 + // client credentials grant flow to obtain an access token for + // authenticating with the external claims source. + // This is useful for scenarios such as fetching user information + // from Microsoft's Graph API where a separate client credential + // is needed to access the API. + ExternalSourceAuthenticationTypeClientCredential ExternalSourceAuthenticationType = "ClientCredential" +) + +// ExternalSourceAuthentication configures how the apiserver should attempt +// to authenticate with an external claims source. +// +// +kubebuilder:validation:XValidation:rule="self.type == 'ClientCredential' ? has(self.clientCredential) : !has(self.clientCredential)",message="clientCredential is required when type is ClientCredential, and forbidden otherwise" +type ExternalSourceAuthentication struct { + // type is a required field that sets the type of + // authentication method used by the authenticator + // when fetching external claims. + // + // Allowed values are 'RequestProvidedToken' and 'ClientCredential'. + // + // When set to 'RequestProvidedToken', the authenticator will + // use the token provided to the kube-apiserver as part of the + // request to authenticate with the external claims source. + // + // When set to 'ClientCredential', the authenticator will + // use the configured client-id, client-secret, and token endpoint + // to fetch an access token using the OAuth2 client credentials grant + // flow. The fetched access token will then be used to authenticate + // with the external claims source. + // + // +required + Type ExternalSourceAuthenticationType `json:"type,omitempty"` + + // clientCredential configures the client credentials + // and token endpoint to use to get an access token. + // clientCredential is required when type is 'ClientCredential', and forbidden otherwise. + // + // +optional + ClientCredential ClientCredentialConfig `json:"clientCredential,omitzero"` +} + +// ExternalSourceTLS configures the TLS options that the apiserver uses as a client +// when making a request to the external claim source. +type ExternalSourceTLS struct { + // certificateAuthority is a required reference to a ConfigMap in the openshift-config + // namespace that contains the CA certificate to use to validate TLS connections with the external claims source. + // The key "ca-bundle.crt" must be present in the referenced ConfigMap and must contain the CA certificate to be used + // to verify the external source's TLS certificate. + // + // +required + CertificateAuthority ExternalSourceCertificateAuthorityConfigMapReference `json:"certificateAuthority,omitzero"` +} + +// ClientCredentialConfig configures the client credentials and token endpoint +// to use to get an access token via the OAuth2 client credentials grant flow. +type ClientCredentialConfig struct { + // clientID is a required client identifier to use during the OAuth2 client credentials flow. + // clientID must be at least 1 character in length, must not exceed 256 characters in length, + // and must only contain printable ASCII characters. + // + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=256 + // +kubebuilder:validation:XValidation:rule="self.matches('^[[:print:]]+$')",message="clientID must only contain printable ASCII characters" + ClientID string `json:"clientID,omitempty"` + + // clientSecret is a required reference to a Secret in the openshift-config namespace to be used + // as the client secret during the OAuth2 client credentials flow. + // + // The key 'client-secret' is used to locate the client secret data in the Secret. + // + // +required + ClientSecret ClientSecretSecretReference `json:"clientSecret,omitzero"` + + // tokenEndpoint is a required URL to query for an access token using + // the client credential OAuth2 flow. + // tokenEndpoint must be at least 1 character in length and must not exceed 2048 characters in length. + // tokenEndpoint must be a valid HTTPS URL. + // tokenEndpoint must have a host and a path. + // tokenEndpoint must not contain query parameters, fragments, + // or user information (e.g., "user:password@host"). + // + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=2048 + // +kubebuilder:validation:XValidation:rule="isURL(self)",message="tokenEndpoint must be a valid HTTPS url" + // +kubebuilder:validation:XValidation:rule="isURL(self) && url(self).getScheme() == 'https'",message="tokenEndpoint must be a valid HTTPS url" + // +kubebuilder:validation:XValidation:rule="isURL(self) && url(self).getHost() != ''",message="tokenEndpoint must have a hostname" + // +kubebuilder:validation:XValidation:rule="isURL(self) && url(self).getEscapedPath() != ''",message="tokenEndpoint must have a path" + // +kubebuilder:validation:XValidation:rule="isURL(self) && url(self).getQuery() == {}",message="tokenEndpoint must not have query parameters" + // +kubebuilder:validation:XValidation:rule="isURL(self) && self.find('#(.+)$') == ''",message="tokenEndpoint must not have a fragment" + // +kubebuilder:validation:XValidation:rule="isURL(self) && !self.matches('^https://[^/]+@.+$')",message="tokenEndpoint must not have user info" + TokenEndpoint string `json:"tokenEndpoint,omitempty"` + + // scopes is an optional list of OAuth2 scopes to request when obtaining + // an access token. + // + // If not specified, the token endpoint's default scopes + // will be used. + // + // When specified, there must be at least 1 entry and must not exceed 16 entries. + // Each entry must be at least 1 character in length and must not exceed 256 characters in length. + // Each entry must only contain printable ASCII characters, excluding spaces, double quotes and backslashes. + // Entries must be unique. + // + // +optional + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=16 + // +listType=set + Scopes []OAuth2Scope `json:"scopes,omitempty"` + + // tls is an optional field that allows configuring the TLS + // settings used to interact with the identity provider + // as an OAuth2 client. + // + // When omitted, system default TLS settings will be used + // for the OAuth2 client. + // + // +optional + TLS ExternalSourceTLS `json:"tls,omitzero"` +} + +// OAuth2Scope is a string alias that represents an OAuth2 Scope as defined by https://datatracker.ietf.org/doc/html/rfc6749#appendix-A.4 +// Must be at least 1 character in length, must not exceed 256 characters in length and must only contain printable ASCII characters, excluding spaces, double quotes and backslashes. +// +// +kubebuilder:validation:XValidation:rule="self.matches('^[!#-[\\\\]-~]+$')",message="scopes must only contain printable ASCII characters excluding spaces, double quotes and backslashes" +// +kubebuilder:validation:MinLength=1 +// +kubebuilder:validation:MaxLength=256 +type OAuth2Scope string + +// SourceURL configures the options used to build the URL that is queried for external claims. +type SourceURL struct { + // hostname is a required hostname for which the external claims are located. + // + // It must be a valid DNS subdomain name as per RFC1123. + // + // This means that it must start and end with a lowercase alphanumeric character, + // must only consist of lowercase alphanumeric characters, '-', and '.'. + // hostname may optionally specify a port in the format ':{port}'. + // If a port is specified it must not exceed 65535. + // + // hostname must be at least 1 character in length. + // When specifying a port, hostname must not exceed 259 characters in length. + // When not specifying a port, hostname must not exceed 253 characters in length. + // + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=259 + // +kubebuilder:validation:XValidation:rule="isURL('https://'+self)",message="hostname must be a valid hostname" + // +kubebuilder:validation:XValidation:rule="!format.dns1123Subdomain().validate(self.split(':')[0]).hasValue()",message="hostname before port must start and end with a lowercase alphanumeric character, and must only contain lowercase alphanumeric characters, '-' or '.'" + // +kubebuilder:validation:XValidation:rule="self.split(':').size() > 1 ? int(self.split(':')[1]) <= 65535 : true",message="port must not exceed 65535" + Hostname string `json:"hostname,omitempty"` + + // pathExpression is a required CEL expression that returns a list + // of string values used to construct the URL path. + // Claims from the token used for the request to the kube-apiserver + // are made available via the `claims` variable. + // expression must be at least 1 character in length and must not exceed 1024 characters in length. + // + // Values in the returned list will be joined with the hostname using a forward slash + // (`/`) as a separator. Values in the returned list do not need to include the forward slash. + // If a forward slash is included in a returned value, it will be encoded as `%2F`. + // + // Example of a static path configuration: + // + // pathExpression: ['realms', 'k8s', 'protocol', 'openid-connect', 'userinfo'] + // + // The above example would resolve to the path: '/realms/k8s/protocol/openid-connect/userinfo' + // + // Example of a dynamic path configuration: + // + // pathExpression: "['admin', 'realms', 'k8s', 'users'] + [claims.sub] + ['groups']" + // + // Assuming 'claims.sub' is set to '12345', the above example would resolve to the path: '/admin/realms/k8s/users/12345/groups' + // + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=1024 + PathExpression string `json:"pathExpression,omitempty"` +} + +// SourcedClaimMapping configures the mapping behavior for a single external claim +// from the response the apiserver received from the external claim source. +type SourcedClaimMapping struct { + // name is a required name of the claim that + // will be produced and made available during + // the claim-to-identity mapping process. + // name must consist of only lowercase alpha characters and underscores ('_'). + // name must be at least 1 character and must not exceed 256 characters in length. + // + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=256 + // +kubebuilder:validation:XValidation:rule="self.matches('^[a-z_]+$')",message="name must consist of only lowercase alpha characters and underscores" + Name string `json:"name,omitempty"` + + // expression is a required CEL expression that + // will produce a value to be assigned to the claim. + // The full response body from the request to the + // external claim source is provided via the + // `response.body` variable. + // + // The contents of the `response.body` variable varies based on the response received + // from the external source. It is the responsibility of those configuring + // this expression to understand what is returned from the external source. + // + // expression must be at least 1 character and must not exceed 1024 characters in length. + // + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=1024 + Expression string `json:"expression,omitempty"` +} + +// ExternalSourcePredicate configures a singular condition +// that must return true before the external source is queried +// to retrieve external claims. +type ExternalSourcePredicate struct { + // expression is a required CEL expression that + // is used to determine whether or not an external + // source should be used to fetch external claims. + // + // The expression must return a boolean value, + // where true means that the source should be consulted + // and false means that it should not. + // + // Claims from the token used for the request to the kube-apiserver + // are made available via the `claims` variable. + // + // The contents of the `claims` variable varies based on the claims that are + // present in the token being validated. It is the responsibility of those configuring this + // field to understand what claims the identity provider includes when issuing tokens. + // + // expression must be at least 1 character and must not exceed 1024 characters in length. + // + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=1024 + Expression string `json:"expression,omitempty"` +} + +// ExternalSourceCertificateAuthorityConfigMapReference is a reference to a ConfigMap in the openshift-config +// namespace that should be used for configuring the certificate authority to be +// used when sourcing claims from external sources. +type ExternalSourceCertificateAuthorityConfigMapReference struct { + // name is the required name of the ConfigMap that exists in the openshift-config namespace. + // The key "ca-bundle.crt" must be present and must contain the CA certificate to be used + // to verify the external source's TLS certificate. + // + // It must be at least 1 character in length, must not exceed 253 characters in length, + // must start and end with a lowercase alphanumeric character, and must only contain + // lowercase alphanumeric characters, '-' or '.'. + // + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=253 + // +kubebuilder:validation:XValidation:rule="!format.dns1123Subdomain().validate(self).hasValue()",message="name must start and end with a lowercase alphanumeric character, and must only contain lowercase alphanumeric characters, '-' or '.'" + Name string `json:"name,omitempty"` +} + +// ClientSecretSecretReference is a reference to a Secret in the openshift-config +// namespace that should be used for configuring the client secret to be +// used when sourcing claims from external sources with the client credential authentication flow. +type ClientSecretSecretReference struct { + // name is the required name of the Secret that exists in the openshift-config namespace. + // + // It must be at least 1 character in length, must not exceed 253 characters in length, + // must start and end with a lowercase alphanumeric character, and must only contain + // lowercase alphanumeric characters, '-' or '.'. + // + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=253 + // +kubebuilder:validation:XValidation:rule="!format.dns1123Subdomain().validate(self).hasValue()",message="name must start and end with a lowercase alphanumeric character, and must only contain lowercase alphanumeric characters, '-' or '.'" + Name string `json:"name,omitempty"` +} diff --git a/apis/vendor/github.com/openshift/api/config/v1/types_cluster_operator.go b/apis/vendor/github.com/openshift/api/config/v1/types_cluster_operator.go index 83230403893..e934e835505 100644 --- a/apis/vendor/github.com/openshift/api/config/v1/types_cluster_operator.go +++ b/apis/vendor/github.com/openshift/api/config/v1/types_cluster_operator.go @@ -160,8 +160,9 @@ const ( // is actively rolling out new code, propagating config changes (e.g, a version change), or otherwise // moving from one steady state to another. Operators should not report // Progressing when they are reconciling (without action) a previously known - // state. Operators should not report Progressing only because DaemonSets owned by them - // are adjusting to a new node from cluster scaleup or a node rebooting from cluster upgrade. + // state. Operators should not report Progressing only because resources owned by them, + // such as DaemonSets and Deployments, are adjusting to a new node from cluster scaleup + // or a node rebooting from cluster upgrade. // If the observed cluster state has changed and the component is // reacting to it (updated proxy configuration for instance), Progressing should become true // since it is moving from one steady state to another. diff --git a/apis/vendor/github.com/openshift/api/config/v1/types_cluster_version.go b/apis/vendor/github.com/openshift/api/config/v1/types_cluster_version.go index f8d45114a83..9cb85f4c003 100644 --- a/apis/vendor/github.com/openshift/api/config/v1/types_cluster_version.go +++ b/apis/vendor/github.com/openshift/api/config/v1/types_cluster_version.go @@ -18,7 +18,8 @@ import ( // +kubebuilder:object:root=true // +kubebuilder:subresource:status // +kubebuilder:resource:path=clusterversions,scope=Cluster -// +kubebuilder:validation:XValidation:rule="has(self.spec.capabilities) && has(self.spec.capabilities.additionalEnabledCapabilities) && self.spec.capabilities.baselineCapabilitySet == 'None' && 'marketplace' in self.spec.capabilities.additionalEnabledCapabilities ? 'OperatorLifecycleManager' in self.spec.capabilities.additionalEnabledCapabilities || (has(self.status) && has(self.status.capabilities) && has(self.status.capabilities.enabledCapabilities) && 'OperatorLifecycleManager' in self.status.capabilities.enabledCapabilities) : true",message="the `marketplace` capability requires the `OperatorLifecycleManager` capability, which is neither explicitly or implicitly enabled in this cluster, please enable the `OperatorLifecycleManager` capability" +// +openshift:validation:FeatureGateAwareXValidation:featureGate="";CRDCompatibilityRequirementOperator;ClusterAPIMachineManagement,rule="has(self.spec.capabilities) && has(self.spec.capabilities.additionalEnabledCapabilities) && self.spec.capabilities.baselineCapabilitySet == 'None' && 'marketplace' in self.spec.capabilities.additionalEnabledCapabilities ? 'OperatorLifecycleManager' in self.spec.capabilities.additionalEnabledCapabilities || (has(self.status) && has(self.status.capabilities) && has(self.status.capabilities.enabledCapabilities) && 'OperatorLifecycleManager' in self.status.capabilities.enabledCapabilities) : true",message="the `marketplace` capability requires the `OperatorLifecycleManager` capability, which is neither explicitly or implicitly enabled in this cluster, please enable the `OperatorLifecycleManager` capability" +// +openshift:validation:FeatureGateAwareXValidation:requiredFeatureGate=CRDCompatibilityRequirementOperator;ClusterAPIMachineManagement,rule="has(self.spec.capabilities) && has(self.spec.capabilities.additionalEnabledCapabilities) && 'ClusterAPI' in self.spec.capabilities.additionalEnabledCapabilities ? 'CompatibilityRequirements' in self.spec.capabilities.additionalEnabledCapabilities || (has(self.status) && has(self.status.capabilities) && has(self.status.capabilities.enabledCapabilities) && 'CompatibilityRequirements' in self.status.capabilities.enabledCapabilities) : true",message="the `ClusterAPI` capability requires the `CompatibilityRequirements` capability, which is neither explicitly or implicitly enabled in this cluster, please enable the `CompatibilityRequirements` capability" // +kubebuilder:printcolumn:name=Version,JSONPath=.status.history[?(@.state=="Completed")].version,type=string // +kubebuilder:printcolumn:name=Available,JSONPath=.status.conditions[?(@.type=="Available")].status,type=string // +kubebuilder:printcolumn:name=Progressing,JSONPath=.status.conditions[?(@.type=="Progressing")].status,type=string @@ -304,7 +305,10 @@ const ( ) // ClusterVersionCapability enumerates optional, core cluster components. -// +kubebuilder:validation:Enum=openshift-samples;baremetal;marketplace;Console;Insights;Storage;CSISnapshot;NodeTuning;MachineAPI;Build;DeploymentConfig;ImageRegistry;OperatorLifecycleManager;CloudCredential;Ingress;CloudControllerManager;OperatorLifecycleManagerV1 +// +openshift:validation:FeatureGateAwareEnum:featureGate="",enum=openshift-samples;baremetal;marketplace;Console;Insights;Storage;CSISnapshot;NodeTuning;MachineAPI;Build;DeploymentConfig;ImageRegistry;OperatorLifecycleManager;CloudCredential;Ingress;CloudControllerManager;OperatorLifecycleManagerV1 +// +openshift:validation:FeatureGateAwareEnum:featureGate=CRDCompatibilityRequirementOperator,enum=openshift-samples;baremetal;marketplace;Console;Insights;Storage;CSISnapshot;NodeTuning;MachineAPI;Build;DeploymentConfig;ImageRegistry;OperatorLifecycleManager;CloudCredential;Ingress;CloudControllerManager;OperatorLifecycleManagerV1;CompatibilityRequirements +// +openshift:validation:FeatureGateAwareEnum:featureGate=ClusterAPIMachineManagement,enum=openshift-samples;baremetal;marketplace;Console;Insights;Storage;CSISnapshot;NodeTuning;MachineAPI;Build;DeploymentConfig;ImageRegistry;OperatorLifecycleManager;CloudCredential;Ingress;CloudControllerManager;OperatorLifecycleManagerV1;CompatibilityRequirements;ClusterAPI +// +openshift:validation:FeatureGateAwareEnum:requiredFeatureGate=CRDCompatibilityRequirementOperator;ClusterAPIMachineManagement,enum=openshift-samples;baremetal;marketplace;Console;Insights;Storage;CSISnapshot;NodeTuning;MachineAPI;Build;DeploymentConfig;ImageRegistry;OperatorLifecycleManager;CloudCredential;Ingress;CloudControllerManager;OperatorLifecycleManagerV1;CompatibilityRequirements;ClusterAPI type ClusterVersionCapability string const ( @@ -425,6 +429,19 @@ const ( // Managers deployed on top of OpenShift. They help you to work with cloud // provider API and embeds cloud-specific control logic. ClusterVersionCapabilityCloudControllerManager ClusterVersionCapability = "CloudControllerManager" + + // ClusterVersionCapabilityCompatibilityRequirements manages the Compatibility + // Requirements operator which enforces CRD compatibility constraints via + // validating webhooks. + ClusterVersionCapabilityCompatibilityRequirements ClusterVersionCapability = "CompatibilityRequirements" + + // ClusterVersionCapabilityClusterAPI manages the Cluster API operator and + // controllers which provide forward-compatible machine management for + // OpenShift clusters. + // + // Note that Cluster API has a hard requirement on CompatibilityRequirements. + // CompatibilityRequirements cannot be disabled while Cluster API is enabled. + ClusterVersionCapabilityClusterAPI ClusterVersionCapability = "ClusterAPI" ) // KnownClusterVersionCapabilities includes all known optional, core cluster components. @@ -446,6 +463,8 @@ var KnownClusterVersionCapabilities = []ClusterVersionCapability{ ClusterVersionCapabilityCloudCredential, ClusterVersionCapabilityIngress, ClusterVersionCapabilityCloudControllerManager, + ClusterVersionCapabilityCompatibilityRequirements, + ClusterVersionCapabilityClusterAPI, } // ClusterVersionCapabilitySet defines sets of cluster version capabilities. @@ -644,6 +663,8 @@ var ClusterVersionCapabilitySets = map[ClusterVersionCapabilitySet][]ClusterVers ClusterVersionCapabilityCloudCredential, ClusterVersionCapabilityIngress, ClusterVersionCapabilityCloudControllerManager, + ClusterVersionCapabilityCompatibilityRequirements, + ClusterVersionCapabilityClusterAPI, }, } diff --git a/apis/vendor/github.com/openshift/api/config/v1/types_crio_credential_provider_config.go b/apis/vendor/github.com/openshift/api/config/v1/types_crio_credential_provider_config.go new file mode 100644 index 00000000000..3fe543aac84 --- /dev/null +++ b/apis/vendor/github.com/openshift/api/config/v1/types_crio_credential_provider_config.go @@ -0,0 +1,186 @@ +package v1 + +import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// CRIOCredentialProviderConfig holds cluster-wide singleton resource configurations for CRI-O credential provider, the name of this instance is "cluster". CRI-O credential provider is a binary shipped with CRI-O that provides a way to obtain container image pull credentials from external sources. +// For example, it can be used to fetch mirror registry credentials from secrets resources in the cluster within the same namespace the pod will be running in. +// CRIOCredentialProviderConfig configuration specifies the pod image sources registries that should trigger the CRI-O credential provider execution, which will resolve the CRI-O mirror configurations and obtain the necessary credentials for pod creation. +// Note: Configuration changes will only take effect after the kubelet restarts, which is automatically managed by the cluster during rollout. +// +// The resource is a singleton named "cluster". +// +// Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=criocredentialproviderconfigs,scope=Cluster +// +kubebuilder:subresource:status +// +openshift:api-approved.openshift.io=https://github.com/openshift/api/pull/2725 +// +openshift:file-pattern=cvoRunLevel=0000_10,operatorName=config-operator,operatorOrdering=01 +// +openshift:enable:FeatureGate=CRIOCredentialProviderConfig +// +openshift:compatibility-gen:level=1 +// +kubebuilder:validation:XValidation:rule="self.metadata.name == 'cluster'",message="criocredentialproviderconfig is a singleton, .metadata.name must be 'cluster'" +type CRIOCredentialProviderConfig struct { + metav1.TypeMeta `json:",inline"` + + // metadata is the standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + metav1.ObjectMeta `json:"metadata,omitzero"` + + // spec defines the desired configuration of the CRI-O Credential Provider. + // This field is required and must be provided when creating the resource. + // +required + Spec *CRIOCredentialProviderConfigSpec `json:"spec,omitempty,omitzero"` + + // status represents the current state of the CRIOCredentialProviderConfig. + // When omitted or nil, it indicates that the status has not yet been set by the controller. + // The controller will populate this field with validation conditions and operational state. + // +optional + Status CRIOCredentialProviderConfigStatus `json:"status,omitzero,omitempty"` +} + +// CRIOCredentialProviderConfigSpec defines the desired configuration of the CRI-O Credential Provider. +// +kubebuilder:validation:MinProperties=0 +type CRIOCredentialProviderConfigSpec struct { + // matchImages is a list of string patterns used to determine whether + // the CRI-O credential provider should be invoked for a given image. This list is + // passed to the kubelet CredentialProviderConfig, and if any pattern matches + // the requested image, CRI-O credential provider will be invoked to obtain credentials for pulling + // that image or its mirrors. + // Depending on the platform, the CRI-O credential provider may be installed alongside an existing platform specific provider. + // Conflicts between the existing platform specific provider image match configuration and this list will be handled by + // the following precedence rule: credentials from built-in kubelet providers (e.g., ECR, GCR, ACR) take precedence over those + // from the CRIOCredentialProviderConfig when both match the same image. + // To avoid uncertainty, it is recommended to avoid configuring your private image patterns to overlap with + // existing platform specific provider config(e.g., the entries from https://github.com/openshift/machine-config-operator/blob/main/templates/common/aws/files/etc-kubernetes-credential-providers-ecr-credential-provider.yaml). + // You can check the resource's Status conditions + // to see if any entries were ignored due to exact matches with known built-in provider patterns. + // + // This field is optional, the items of the list must contain between 1 and 50 entries. + // The list is treated as a set, so duplicate entries are not allowed. + // + // For more details, see: + // https://kubernetes.io/docs/tasks/administer-cluster/kubelet-credential-provider/ + // https://github.com/cri-o/crio-credential-provider#architecture + // + // Each entry in matchImages is a pattern which can optionally contain a port and a path. Each entry must be no longer than 512 characters. + // Wildcards ('*') are supported for full subdomain labels, such as '*.k8s.io' or 'k8s.*.io', + // and for top-level domains, such as 'k8s.*' (which matches 'k8s.io' or 'k8s.net'). + // A global wildcard '*' (matching any domain) is not allowed. + // Wildcards may replace an entire hostname label (e.g., *.example.com), but they cannot appear within a label (e.g., f*oo.example.com) and are not allowed in the port or path. + // For example, 'example.*.com' is valid, but 'exa*mple.*.com' is not. + // Each wildcard matches only a single domain label, + // so '*.io' does **not** match '*.k8s.io'. + // + // A match exists between an image and a matchImage when all of the below are true: + // Both contain the same number of domain parts and each part matches. + // The URL path of an matchImages must be a prefix of the target image URL path. + // If the matchImages contains a port, then the port must match in the image as well. + // + // Example values of matchImages: + // - 123456789.dkr.ecr.us-east-1.amazonaws.com + // - *.azurecr.io + // - gcr.io + // - *.*.registry.io + // - registry.io:8080/path + // + // +kubebuilder:validation:MaxItems=50 + // +kubebuilder:validation:MinItems=1 + // +listType=set + // +optional + MatchImages []MatchImage `json:"matchImages,omitempty"` +} + +// MatchImage is a string pattern used to match container image registry addresses. +// It must be a valid fully qualified domain name with optional wildcard, port, and path. +// The maximum length is 512 characters. +// +// Wildcards ('*') are supported for full subdomain labels and top-level domains. +// Each entry can optionally contain a port (e.g., :8080) and a path (e.g., /path). +// Wildcards are not allowed in the port or path portions. +// +// Examples: +// - "registry.io" - matches exactly registry.io +// - "*.azurecr.io" - matches any single subdomain of azurecr.io +// - "registry.io:8080/path" - matches with specific port and path prefix +// +// +kubebuilder:validation:MaxLength=512 +// +kubebuilder:validation:MinLength=1 +// +kubebuilder:validation:XValidation:rule="self != '*'",message="global wildcard '*' is not allowed" +// +kubebuilder:validation:XValidation:rule=`self.matches('^((\\*|[a-z0-9]([a-z0-9-]*[a-z0-9])?)(\\.(\\*|[a-z0-9]([a-z0-9-]*[a-z0-9])?))*)(:[0-9]+)?(/[-a-z0-9._/]*)?$')`,message="invalid matchImages value, must be a valid fully qualified domain name in lowercase with optional wildcard, port, and path" +type MatchImage string + +// +k8s:deepcopy-gen=true +// CRIOCredentialProviderConfigStatus defines the observed state of CRIOCredentialProviderConfig +// +kubebuilder:validation:MinProperties=1 +type CRIOCredentialProviderConfigStatus struct { + // conditions represent the latest available observations of the configuration state. + // When omitted, it indicates that no conditions have been reported yet. + // The maximum number of conditions is 16. + // Conditions are stored as a map keyed by condition type, ensuring uniqueness. + // + // Expected condition types include: + // "Validated": indicates whether the matchImages configuration is valid + // +optional + // +kubebuilder:validation:MaxItems=16 + // +kubebuilder:validation:MinItems=1 + // +listType=map + // +listMapKey=type + Conditions []metav1.Condition `json:"conditions,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// CRIOCredentialProviderConfigList contains a list of CRIOCredentialProviderConfig resources +// +// Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). +// +openshift:compatibility-gen:level=1 +type CRIOCredentialProviderConfigList struct { + metav1.TypeMeta `json:",inline"` + + // metadata is the standard list's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + metav1.ListMeta `json:"metadata"` + + Items []CRIOCredentialProviderConfig `json:"items"` +} + +const ( + // ConditionTypeValidated is a condition type that indicates whether the CRIOCredentialProviderConfig + // matchImages configuration has been validated successfully. + // When True, all matchImage patterns are valid and have been applied. + // When False, the configuration contains errors (see Reason for details). + // Possible reasons for False status: + // - ValidationFailed: matchImages contains invalid patterns + // - ConfigurationPartiallyApplied: some matchImage entries were ignored due to conflicts + ConditionTypeValidated = "Validated" + + // ReasonValidationFailed is a condition reason used with ConditionTypeValidated=False + // to indicate that the matchImages configuration contains one or more invalid registry patterns + // that do not conform to the required format (valid FQDN with optional wildcard, port, and path). + ReasonValidationFailed = "ValidationFailed" + + // ReasonConfigurationPartiallyApplied is a condition reason used with ConditionTypeValidated=False + // to indicate that some matchImage entries were ignored due to conflicts or overlapping patterns. + // The condition message will contain details about which entries were ignored and why. + ReasonConfigurationPartiallyApplied = "ConfigurationPartiallyApplied" + + // ConditionTypeMachineConfigRendered is a condition type that indicates whether + // the CRIOCredentialProviderConfig has been successfully rendered into a + // MachineConfig object. + // When True, the corresponding MachineConfig is present in the cluster. + // When False, rendering failed. + ConditionTypeMachineConfigRendered = "MachineConfigRendered" + + // ReasonMachineConfigRenderingSucceeded is a condition reason used with ConditionTypeMachineConfigRendered=True + // to indicate that the MachineConfig was successfully created/updated in the API server. + ReasonMachineConfigRenderingSucceeded = "MachineConfigRenderingSucceeded" + + // ReasonMachineConfigRenderingFailed is a condition reason used with ConditionTypeMachineConfigRendered=False + // to indicate that the MachineConfig creation/update failed. + // The condition message will contain details about the failure. + ReasonMachineConfigRenderingFailed = "MachineConfigRenderingFailed" +) diff --git a/apis/vendor/github.com/openshift/api/config/v1/types_dns.go b/apis/vendor/github.com/openshift/api/config/v1/types_dns.go index 06eb75ccf70..efbdc3ae547 100644 --- a/apis/vendor/github.com/openshift/api/config/v1/types_dns.go +++ b/apis/vendor/github.com/openshift/api/config/v1/types_dns.go @@ -134,7 +134,14 @@ type AWSDNSSpec struct { // privateZoneIAMRole contains the ARN of an IAM role that should be assumed when performing // operations on the cluster's private hosted zone specified in the cluster DNS config. // When left empty, no role should be assumed. - // +kubebuilder:validation:Pattern:=`^arn:(aws|aws-cn|aws-us-gov):iam::[0-9]{12}:role\/.*$` + // + // The ARN must follow the format: arn::iam:::role/, where: + // is the AWS partition (aws, aws-cn, aws-us-gov, or aws-eusc), + // is a 12-digit numeric identifier for the AWS account, + // is the IAM role name. + // + // +openshift:validation:FeatureGateAwareXValidation:featureGate="",rule=`matches(self, '^arn:(aws|aws-cn|aws-us-gov):iam::[0-9]{12}:role/.*$')`,message=`privateZoneIAMRole must be a valid AWS IAM role ARN in the format: arn::iam:::role/` + // +openshift:validation:FeatureGateAwareXValidation:featureGate=AWSEuropeanSovereignCloudInstall,rule=`matches(self, '^arn:(aws|aws-cn|aws-us-gov|aws-eusc):iam::[0-9]{12}:role/.*$')`,message=`privateZoneIAMRole must be a valid AWS IAM role ARN in the format: arn::iam:::role/` // +optional PrivateZoneIAMRole string `json:"privateZoneIAMRole"` } diff --git a/apis/vendor/github.com/openshift/api/config/v1/types_image.go b/apis/vendor/github.com/openshift/api/config/v1/types_image.go index 82f46c8b6c9..96fa349a671 100644 --- a/apis/vendor/github.com/openshift/api/config/v1/types_image.go +++ b/apis/vendor/github.com/openshift/api/config/v1/types_image.go @@ -165,20 +165,50 @@ type RegistryLocation struct { // +kubebuilder:validation:XValidation:rule="has(self.blockedRegistries) ? !has(self.allowedRegistries) : true",message="Only one of blockedRegistries or allowedRegistries may be set" type RegistrySources struct { // insecureRegistries are registries which do not have a valid TLS certificates or only support HTTP connections. + // Each entry must be a valid registry scope in the format hostname[:port][/path], + // optionally prefixed with "*." for wildcard subdomains (e.g., "*.example.com"). + // The hostname must consist of valid DNS labels separated by dots, where each label + // contains only alphanumeric characters and hyphens and does not start or end with a hyphen. + // Entries must not be empty, must not include tags (e.g., ":latest") or digests (e.g., "@sha256:..."), + // and must be at most 256 characters in length. The list may contain at most 1024 entries. // +optional // +listType=atomic + // +kubebuilder:validation:MaxItems=1024 + // +kubebuilder:validation:items:MinLength=1 + // +kubebuilder:validation:items:MaxLength=256 + // +kubebuilder:validation:items:XValidation:rule="self.matches('^\\\\*(?:\\\\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))+$|^((?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(?:(?:\\\\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))+)?(?::[0-9]+)?)(?:(?:/[a-z0-9]+(?:(?:(?:[._]|__|[-]*)[a-z0-9]+)+)?)+)?$')",message="each registry must be a valid hostname[:port][/path] or wildcard *.hostname format without tags or digests" InsecureRegistries []string `json:"insecureRegistries,omitempty"` // blockedRegistries cannot be used for image pull and push actions. All other registries are permitted. + // Each entry must be a valid registry scope in the format hostname[:port][/path], + // optionally prefixed with "*." for wildcard subdomains (e.g., "*.example.com"). + // The hostname must consist of valid DNS labels separated by dots, where each label + // contains only alphanumeric characters and hyphens and does not start or end with a hyphen. + // Entries must not be empty, must not include tags (e.g., ":latest") or digests (e.g., "@sha256:..."), + // and must be at most 256 characters in length. The list may contain at most 1024 entries. // // Only one of BlockedRegistries or AllowedRegistries may be set. // +optional // +listType=atomic + // +kubebuilder:validation:MaxItems=1024 + // +kubebuilder:validation:items:MinLength=1 + // +kubebuilder:validation:items:MaxLength=256 + // +kubebuilder:validation:items:XValidation:rule="self.matches('^\\\\*(?:\\\\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))+$|^((?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(?:(?:\\\\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))+)?(?::[0-9]+)?)(?:(?:/[a-z0-9]+(?:(?:(?:[._]|__|[-]*)[a-z0-9]+)+)?)+)?$')",message="each registry must be a valid hostname[:port][/path] or wildcard *.hostname format without tags or digests" BlockedRegistries []string `json:"blockedRegistries,omitempty"` // allowedRegistries are the only registries permitted for image pull and push actions. All other registries are denied. + // Each entry must be a valid registry scope in the format hostname[:port][/path], + // optionally prefixed with "*." for wildcard subdomains (e.g., "*.example.com"). + // The hostname must consist of valid DNS labels separated by dots, where each label + // contains only alphanumeric characters and hyphens and does not start or end with a hyphen. + // Entries must not be empty, must not include tags (e.g., ":latest") or digests (e.g., "@sha256:..."), + // and must be at most 256 characters in length. The list may contain at most 1024 entries. // // Only one of BlockedRegistries or AllowedRegistries may be set. // +optional // +listType=atomic + // +kubebuilder:validation:MaxItems=1024 + // +kubebuilder:validation:items:MinLength=1 + // +kubebuilder:validation:items:MaxLength=256 + // +kubebuilder:validation:items:XValidation:rule="self.matches('^\\\\*(?:\\\\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))+$|^((?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(?:(?:\\\\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))+)?(?::[0-9]+)?)(?:(?:/[a-z0-9]+(?:(?:(?:[._]|__|[-]*)[a-z0-9]+)+)?)+)?$')",message="each registry must be a valid hostname[:port][/path] or wildcard *.hostname format without tags or digests" AllowedRegistries []string `json:"allowedRegistries,omitempty"` // containerRuntimeSearchRegistries are registries that will be searched when pulling images that do not have fully qualified // domains in their pull specs. Registries will be searched in the order provided in the list. diff --git a/apis/vendor/github.com/openshift/api/config/v1/types_infrastructure.go b/apis/vendor/github.com/openshift/api/config/v1/types_infrastructure.go index 369ba1e7a00..c64a9fd927b 100644 --- a/apis/vendor/github.com/openshift/api/config/v1/types_infrastructure.go +++ b/apis/vendor/github.com/openshift/api/config/v1/types_infrastructure.go @@ -19,6 +19,7 @@ import ( // +kubebuilder:resource:path=infrastructures,scope=Cluster // +kubebuilder:subresource:status // +kubebuilder:metadata:annotations=release.openshift.io/bootstrap-required=true +// +openshift:validation:FeatureGateAwareXValidation:featureGate=MutableTopology,rule="!has(self.spec.controlPlaneTopology) || (has(oldSelf.spec.controlPlaneTopology) && self.spec.controlPlaneTopology == oldSelf.spec.controlPlaneTopology) || (has(self.status.controlPlaneTopology) && self.spec.controlPlaneTopology == self.status.controlPlaneTopology) || (has(self.status.controlPlaneTopology) && self.status.controlPlaneTopology == 'SingleReplica' && self.spec.controlPlaneTopology == 'HighlyAvailable')",message="spec.controlPlaneTopology must match status.controlPlaneTopology or be set to HighlyAvailable when status.controlPlaneTopology is SingleReplica" type Infrastructure struct { metav1.TypeMeta `json:",inline"` @@ -55,6 +56,21 @@ type InfrastructureSpec struct { // platformSpec holds desired information specific to the underlying // infrastructure provider. PlatformSpec PlatformSpec `json:"platformSpec,omitempty"` + + // controlPlaneTopology expresses the desired topology configuration for control nodes. + // + // When status.controlPlaneTopology is 'SingleReplica' and spec.controlPlaneTopology is set to 'HighlyAvailable', + // a transition will be triggered to reconfigure the cluster from SingleReplica to HighlyAvailable. + // + // When left blank or status.controlPlaneTopology and spec.controlPlaneTopology are the same value, + // no changes are required and no transitions will be triggered. + // + // This value may be set to match status.controlPlaneTopology regardless of the current value. + // + // +openshift:enable:FeatureGate=MutableTopology + // +kubebuilder:validation:Enum=HighlyAvailable;SingleReplica + // +optional + ControlPlaneTopology TopologyMode `json:"controlPlaneTopology,omitempty"` } // InfrastructureStatus describes the infrastructure the cluster is leveraging. @@ -102,11 +118,11 @@ type InfrastructureStatus struct { // and the operators should not configure the operand for highly-available operation // The 'External' mode indicates that the control plane is hosted externally to the cluster and that // its components are not visible within the cluster. + // The 'HighlyAvailableArbiter' mode indicates that the control plane will consist of 2 control-plane nodes + // that run conventional services and 1 smaller sized arbiter node that runs a bare minimum of services to maintain quorum. // +kubebuilder:default=HighlyAvailable - // +openshift:validation:FeatureGateAwareEnum:featureGate="",enum=HighlyAvailable;SingleReplica;External - // +openshift:validation:FeatureGateAwareEnum:featureGate=HighlyAvailableArbiter,enum=HighlyAvailable;HighlyAvailableArbiter;SingleReplica;External - // +openshift:validation:FeatureGateAwareEnum:featureGate=DualReplica,enum=HighlyAvailable;SingleReplica;DualReplica;External - // +openshift:validation:FeatureGateAwareEnum:requiredFeatureGate=HighlyAvailableArbiter;DualReplica,enum=HighlyAvailable;HighlyAvailableArbiter;SingleReplica;DualReplica;External + // +openshift:validation:FeatureGateAwareEnum:featureGate="",enum=HighlyAvailable;HighlyAvailableArbiter;SingleReplica;External + // +openshift:validation:FeatureGateAwareEnum:featureGate=DualReplica,enum=HighlyAvailable;HighlyAvailableArbiter;SingleReplica;DualReplica;External // +optional ControlPlaneTopology TopologyMode `json:"controlPlaneTopology"` @@ -194,6 +210,21 @@ const ( DNSRecordsTypeInternal DNSRecordsType = "Internal" ) +// VIPManagementType defines which mechanism manages the API and Ingress +// VIPs on an on-premise cluster. +// +kubebuilder:validation:Enum=Keepalived;BGP +// +enum +type VIPManagementType string + +const ( + // VIPManagementTypeKeepalived means the VIPs are managed by the default + // keepalived/VRRP mechanism. + VIPManagementTypeKeepalived VIPManagementType = "Keepalived" + // VIPManagementTypeBGP means the VIPs are advertised via BGP by kube-vip + // (Routing Table Mode) and frr-k8s running as static pods. + VIPManagementTypeBGP VIPManagementType = "BGP" +) + // PlatformType is a specific supported infrastructure provider. // +kubebuilder:validation:Enum="";AWS;Azure;BareMetal;GCP;Libvirt;OpenStack;None;VSphere;oVirt;IBMCloud;KubeVirt;EquinixMetal;PowerVS;AlibabaCloud;Nutanix;External type PlatformType string @@ -295,7 +326,8 @@ type ExternalPlatformSpec struct { // PlatformSpec holds the desired state specific to the underlying infrastructure provider // of the current cluster. Since these are used at spec-level for the underlying cluster, it // is supposed that only one of the spec structs is set. -// +kubebuilder:validation:XValidation:rule="!has(oldSelf.vsphere) && has(self.vsphere) ? size(self.vsphere.vcenters) < 2 : true",message="vcenters can have at most 1 item when configured post-install" +// +openshift:validation:FeatureGateAwareXValidation:featureGate="",rule="!has(oldSelf.vsphere) && has(self.vsphere) ? (has(self.vsphere.vcenters) && size(self.vsphere.vcenters) < 2) : true",message="vcenters can have at most 1 item when configured post-install" +// +openshift:validation:FeatureGateAwareXValidation:featureGate=VSphereMultiVCenterDay2,rule="oldSelf.?vsphere.vcenters.hasValue() ? self.?vsphere.vcenters.hasValue() : true",message="vcenters is required once set and cannot be removed" type PlatformSpec struct { // type is the underlying infrastructure provider for the cluster. This // value controls whether infrastructure automation such as service load @@ -643,7 +675,6 @@ type AzurePlatformStatus struct { // // +default={"dnsType": "PlatformDefault"} // +kubebuilder:default={"dnsType": "PlatformDefault"} - // +openshift:enable:FeatureGate=AzureClusterHostedDNSInstall // +optional CloudLoadBalancerConfig *CloudLoadBalancerConfig `json:"cloudLoadBalancerConfig,omitempty"` @@ -787,7 +818,6 @@ type GCPPlatformStatus struct { // // +default={"dnsType": "PlatformDefault"} // +kubebuilder:default={"dnsType": "PlatformDefault"} - // +openshift:enable:FeatureGate=GCPClusterHostedDNSInstall // +optional // +nullable CloudLoadBalancerConfig *CloudLoadBalancerConfig `json:"cloudLoadBalancerConfig,omitempty"` @@ -1059,6 +1089,21 @@ type BareMetalPlatformStatus struct { // +optional LoadBalancer *BareMetalPlatformLoadBalancer `json:"loadBalancer,omitempty"` + // vipManagement indicates which VIP management mechanism is active + // on this cluster. + // Allowed values are `Keepalived`, `BGP`, and omitted. + // Once set to a non-empty value, this field is immutable. + // When set to `BGP`, kube-vip (Routing Table Mode) and frr-k8s are + // deployed as static pods to advertise VIPs via BGP, replacing the + // default keepalived/VRRP mechanism. + // When set to `Keepalived`, the default keepalived-based VIP + // management is used. + // When omitted, the default keepalived-based VIP management is used. + // +kubebuilder:validation:XValidation:rule="oldSelf == '' || self == oldSelf",message="vipManagement is immutable once set" + // +openshift:enable:FeatureGate=BGPBasedVIPManagement + // +optional + VIPManagement VIPManagementType `json:"vipManagement,omitempty"` + // dnsRecordsType determines whether records for api, api-int, and ingress // are provided by the internal DNS service or externally. // Allowed values are `Internal`, `External`, and omitted. @@ -1408,6 +1453,9 @@ type VSpherePlatformFailureDomainSpec struct { ZoneAffinity *VSphereFailureDomainZoneAffinity `json:"zoneAffinity,omitempty"` // server is the fully-qualified domain name or the IP address of the vCenter server. + // This must match the server field of an entry in the vcenters list. + // The match is case-sensitive; the value must be specified exactly as it appears in the vcenters entry. + // The value must be between 1 and 255 characters long. // +required // +kubebuilder:validation:MinLength=1 // +kubebuilder:validation:MaxLength=255 @@ -1642,27 +1690,32 @@ type VSpherePlatformNodeNetworking struct { // use these fields for configuration. // +kubebuilder:validation:XValidation:rule="!has(oldSelf.apiServerInternalIPs) || has(self.apiServerInternalIPs)",message="apiServerInternalIPs list is required once set" // +kubebuilder:validation:XValidation:rule="!has(oldSelf.ingressIPs) || has(self.ingressIPs)",message="ingressIPs list is required once set" -// +kubebuilder:validation:XValidation:rule="!has(oldSelf.vcenters) && has(self.vcenters) ? size(self.vcenters) < 2 : true",message="vcenters can have at most 1 item when configured post-install" +// +openshift:validation:FeatureGateAwareXValidation:featureGate=VSphereMultiVCenterDay2,rule="!has(self.failureDomains) || size(self.failureDomains) == 0 || (has(self.vcenters) && self.failureDomains.all(fd, self.vcenters.exists(vc, vc.server == fd.server)))",message="all failure domains must have a corresponding vCenter entry" type VSpherePlatformSpec struct { // vcenters holds the connection details for services to communicate with vCenter. - // Currently, only a single vCenter is supported, but in tech preview 3 vCenters are supported. + // Up to 3 vCenters are supported. // Once the cluster has been installed, you are unable to change the current number of defined - // vCenters except in the case where the cluster has been upgraded from a version of OpenShift - // where the vsphere platform spec was not present. You may make modifications to the existing + // vCenters except when 1.) the cluster has been upgraded from a version of OpenShift + // where the vsphere platform spec was not present or 2.) in TechPreview you are able to add and + // remove vCenters but may not remove all vCenters. You may make modifications to the existing // vCenters that are defined in the vcenters list in order to match with any added or modified // failure domains. // --- // + If VCenters is not defined use the existing cloud-config configmap defined // + in openshift-config. - // +kubebuilder:validation:MinItems=0 + // +kubebuilder:validation:MinItems=1 // +kubebuilder:validation:MaxItems=3 - // +kubebuilder:validation:XValidation:rule="size(self) != size(oldSelf) ? size(oldSelf) == 0 && size(self) < 2 : true",message="vcenters cannot be added or removed once set" + // +openshift:validation:FeatureGateAwareXValidation:featureGate="",rule="size(self) != size(oldSelf) ? size(oldSelf) == 0 && size(self) < 2 : true",message="vcenters cannot be added or removed once set" + // +openshift:validation:FeatureGateAwareXValidation:featureGate=VSphereMultiVCenterDay2,rule="size(self) >= size(oldSelf) ? oldSelf.all(x, self.exists(y, y.server == x.server)) : true",message="Cannot add and remove vCenters at the same time" + // +openshift:validation:FeatureGateAwareXValidation:featureGate=VSphereMultiVCenterDay2,rule="size(self) < size(oldSelf) ? self.all(x, oldSelf.exists(y, y.server == x.server)) : true",message="Cannot add and remove vCenters at the same time" + // +kubebuilder:validation:XValidation:rule="self.all(x, self.exists_one(y, y.server == x.server))",message="vcenters must have unique server values" // +listType=atomic // +optional VCenters []VSpherePlatformVCenterSpec `json:"vcenters,omitempty"` // failureDomains contains the definition of region, zone and the vCenter topology. // If this is omitted failure domains (regions and zones) will not be used. + // Each failure domain's server must match the server field of an entry in the vcenters list. // +listType=map // +listMapKey=name // +optional diff --git a/apis/vendor/github.com/openshift/api/config/v1/types_ingress.go b/apis/vendor/github.com/openshift/api/config/v1/types_ingress.go index 26e0ebf2184..bb461e2f3e2 100644 --- a/apis/vendor/github.com/openshift/api/config/v1/types_ingress.go +++ b/apis/vendor/github.com/openshift/api/config/v1/types_ingress.go @@ -64,10 +64,12 @@ type IngressSpec struct { // To determine the set of configurable Routes, look at namespace and name of entries in the // .status.componentRoutes list, where participating operators write the status of // configurable routes. + // A maximum of 250 component routes may be configured. // +optional // +listType=map // +listMapKey=namespace // +listMapKey=name + // +kubebuilder:validation:MaxItems=250 ComponentRoutes []ComponentRouteSpec `json:"componentRoutes,omitempty"` // requiredHSTSPolicies specifies HSTS policies that are required to be set on newly created or updated routes @@ -164,6 +166,14 @@ const ( Classic AWSLBType = "Classic" ) +// LabelValue is the value part of a Kubernetes label. +// A label value must be either empty or 1-63 characters, consisting of +// alphanumeric characters, '-', '_', or '.', starting and ending with +// an alphanumeric character. +// +kubebuilder:validation:MaxLength=63 +// +kubebuilder:validation:XValidation:rule="!format.labelValue().validate(self).hasValue()",message="label values must be valid Kubernetes label values (at most 63 characters, alphanumeric, '-', '_', or '.', must start and end with alphanumeric)" +type LabelValue string + // ConsumingUser is an alias for string which we add validation to. Currently only service accounts are supported. // +kubebuilder:validation:Pattern="^system:serviceaccount:[a-z0-9]([-a-z0-9]*[a-z0-9])?:[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" // +kubebuilder:validation:MinLength=1 @@ -245,6 +255,32 @@ type ComponentRouteSpec struct { // the Secret specification for a serving certificate will not be needed. // +optional ServingCertKeyPairSecret SecretNameReference `json:"servingCertKeyPairSecret"` + + // labels defines additional labels to be applied to the route created + // for the component. These labels are used by the IngressController to + // determine which routes it should manage. Changing labels may cause the + // route to be reassigned to a different IngressController. + // When omitted, no additional labels are applied to the component route. + // When specified, labels must contain at least one entry, up to a maximum of 8. + // Label keys must be valid qualified names, consisting of a name segment and + // an optional prefix separated by a slash (/). The name segment must be at most + // 63 characters in length and must consist only of alphanumeric characters, + // dashes (-), underscores (_), and dots (.), and must start and end with + // alphanumeric characters. The prefix, if specified, must be a DNS subdomain: + // at most 253 characters in length, consisting of dot-separated segments where + // each segment starts and ends with an alphanumeric character. + // Label values must be either empty or 1-63 characters, consisting of + // alphanumeric characters, dashes (-), underscores (_), or dots (.), + // starting and ending with an alphanumeric character. + // Keys with the "kubernetes.io/", "k8s.io/", and "openshift.io/" prefixes are reserved and may not be used. + // +openshift:enable:FeatureGate=IngressComponentRouteLabels + // +optional + // +mapType=granular + // +kubebuilder:validation:MinProperties=1 + // +kubebuilder:validation:MaxProperties=8 + // +kubebuilder:validation:XValidation:rule="self.all(key, !format.qualifiedName().validate(key).hasValue())",message="label keys must be valid qualified names, consisting of an optional DNS subdomain prefix of up to 253 characters followed by a slash and a name segment of 1-63 characters, that consists only of alphanumeric characters, dashes, underscores, and dots, and must start and end with an alphanumeric character" + // +kubebuilder:validation:XValidation:rule="self.all(key, !key.startsWith('kubernetes.io/') && !key.startsWith('k8s.io/') && !key.startsWith('openshift.io/'))",message="kubernetes.io/, k8s.io/, and openshift.io/ prefixed label keys are reserved and may not be used" + Labels map[string]LabelValue `json:"labels,omitempty"` } // ComponentRouteStatus contains information allowing configuration of a route's hostname and serving certificate. diff --git a/apis/vendor/github.com/openshift/api/config/v1/types_kmsencryption.go b/apis/vendor/github.com/openshift/api/config/v1/types_kmsencryption.go index 3293204fa4e..0430a25cc30 100644 --- a/apis/vendor/github.com/openshift/api/config/v1/types_kmsencryption.go +++ b/apis/vendor/github.com/openshift/api/config/v1/types_kmsencryption.go @@ -1,55 +1,306 @@ package v1 -// KMSConfig defines the configuration for the KMS instance -// that will be used with KMSEncryptionProvider encryption -// +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'AWS' ? has(self.aws) : !has(self.aws)",message="aws config is required when kms provider type is AWS, and forbidden otherwise" +// KMSPluginConfig defines the configuration for the KMS instance +// that will be used with KMS encryption +// +kubebuilder:validation:XValidation:rule="self.type == 'Vault' ? has(self.vault) : !has(self.vault)",message="vault config is required when kms provider type is Vault, and forbidden otherwise" // +union -type KMSConfig struct { +type KMSPluginConfig struct { // type defines the kind of platform for the KMS provider. - // Available provider types are AWS only. + // Allowed values are Vault. + // When set to Vault, the plugin connects to a HashiCorp Vault server for key management. // // +unionDiscriminator // +required Type KMSProviderType `json:"type"` - // aws defines the key config for using an AWS KMS instance - // for the encryption. The AWS KMS instance is managed + // vault defines the configuration for the Vault KMS plugin. + // The plugin connects to a Vault Enterprise server that is managed // by the user outside the purview of the control plane. + // This field must be set when type is Vault, and must be unset otherwise. // // +unionMember // +optional - AWS *AWSKMSConfig `json:"aws,omitempty"` + Vault VaultKMSPluginConfig `json:"vault,omitempty,omitzero"` + + // --- TOMBSTONE --- + // aws was a field that allowed configuring AWS KMS. + // It was never implemented and has been removed. + // The field name is reserved to prevent reuse. + // + // +optional + // AWS *AWSKMSConfig `json:"aws,omitempty"` } -// AWSKMSConfig defines the KMS config specific to AWS KMS provider -type AWSKMSConfig struct { - // keyARN specifies the Amazon Resource Name (ARN) of the AWS KMS key used for encryption. - // The value must adhere to the format `arn:aws:kms:::key/`, where: - // - `` is the AWS region consisting of lowercase letters and hyphens followed by a number. - // - `` is a 12-digit numeric identifier for the AWS account. - // - `` is a unique identifier for the KMS key, consisting of lowercase hexadecimal characters and hyphens. +// --- TOMBSTONE --- +// AWSKMSConfig was a type for AWS KMS configuration that was never implemented. +// The type name is reserved to prevent reuse. +// +// type AWSKMSConfig struct { +// KeyARN string `json:"keyARN"` +// Region string `json:"region"` +// } + +// KMSProviderType is a specific supported KMS provider +// +kubebuilder:validation:Enum=Vault +type KMSProviderType string + +const ( + // VaultKMSProvider represents a supported KMS provider for use with HashiCorp Vault + VaultKMSProvider KMSProviderType = "Vault" + + // --- TOMBSTONE --- + // AWSKMSProvider was a constant for AWS KMS support that was never implemented. + // The constant name is reserved to prevent reuse. + // + // AWSKMSProvider KMSProviderType = "AWS" +) + +// VaultSecretReference references a secret in the openshift-config namespace. +type VaultSecretReference struct { + // name is the metadata.name of the referenced secret in the openshift-config namespace. + // The name must be a valid DNS subdomain name: it must contain no more than 253 characters, + // contain only lowercase alphanumeric characters, '-' or '.', and start and end with an alphanumeric character. // - // +kubebuilder:validation:MaxLength=128 // +kubebuilder:validation:MinLength=1 - // +kubebuilder:validation:XValidation:rule="self.matches('^arn:aws:kms:[a-z0-9-]+:[0-9]{12}:key/[a-f0-9-]+$')",message="keyARN must follow the format `arn:aws:kms:::key/`. The account ID must be a 12 digit number and the region and key ID should consist only of lowercase hexadecimal characters and hyphens (-)." + // +kubebuilder:validation:MaxLength=253 + // +kubebuilder:validation:XValidation:rule="!format.dns1123Subdomain().validate(self).hasValue()",message="name must be a valid DNS subdomain name: contain no more than 253 characters, contain only lowercase alphanumeric characters, '-' or '.', and start and end with an alphanumeric character" // +required - KeyARN string `json:"keyARN"` - // region specifies the AWS region where the KMS instance exists, and follows the format - // `--`, e.g.: `us-east-1`. - // Only lowercase letters and hyphens followed by numbers are allowed. + Name string `json:"name,omitempty"` +} + +// VaultConfigMapReference references a ConfigMap in the openshift-config namespace. +type VaultConfigMapReference struct { + // name is the metadata.name of the referenced ConfigMap in the openshift-config namespace. + // The name must be a valid DNS subdomain name: it must contain no more than 253 characters, + // contain only lowercase alphanumeric characters, '-' or '.', and start and end with an alphanumeric character. // - // +kubebuilder:validation:MaxLength=64 // +kubebuilder:validation:MinLength=1 - // +kubebuilder:validation:XValidation:rule="self.matches('^[a-z0-9]+(-[a-z0-9]+)*$')",message="region must be a valid AWS region, consisting of lowercase characters, digits and hyphens (-) only." + // +kubebuilder:validation:MaxLength=253 + // +kubebuilder:validation:XValidation:rule="!format.dns1123Subdomain().validate(self).hasValue()",message="name must be a valid DNS subdomain name: contain no more than 253 characters, contain only lowercase alphanumeric characters, '-' or '.', and start and end with an alphanumeric character" // +required - Region string `json:"region"` + Name string `json:"name,omitempty"` } -// KMSProviderType is a specific supported KMS provider -// +kubebuilder:validation:Enum=AWS -type KMSProviderType string +// VaultAuthentication defines the authentication method used to authenticate with Vault. +// +kubebuilder:validation:XValidation:rule="self.type == 'AppRole' ? has(self.appRole) : !has(self.appRole)",message="appRole config is required when authentication type is AppRole, and forbidden otherwise" +// +union +type VaultAuthentication struct { + // type defines the authentication method used to authenticate with Vault. + // Allowed values are AppRole. + // When set to AppRole, the plugin uses AppRole credentials to authenticate with Vault. + // + // +unionDiscriminator + // +required + Type VaultAuthenticationType `json:"type,omitempty"` + + // appRole defines the configuration for AppRole authentication. + // This field must be set when type is AppRole, and must be unset otherwise. + // + // +unionMember + // +optional + AppRole VaultAppRoleAuthentication `json:"appRole,omitzero"` +} + +// VaultAuthenticationType defines the authentication method type for Vault. +// +kubebuilder:validation:Enum=AppRole +type VaultAuthenticationType string const ( - // AWSKMSProvider represents a supported KMS provider for use with AWS KMS - AWSKMSProvider KMSProviderType = "AWS" + // VaultAuthenticationTypeAppRole represents AppRole authentication method. + VaultAuthenticationTypeAppRole VaultAuthenticationType = "AppRole" ) + +// VaultAppRoleAuthentication defines the configuration for AppRole authentication with Vault. +type VaultAppRoleAuthentication struct { + // secret references a secret in the openshift-config namespace containing + // the AppRole credentials used to authenticate with Vault. + // The referenced Secret must contain two keys: "role-id" for the AppRole Role ID and "secret-id" for the AppRole Secret ID. + // + // +required + Secret VaultSecretReference `json:"secret,omitzero"` +} + +// VaultKMSPluginConfig defines the KMS plugin configuration specific to Vault KMS +type VaultKMSPluginConfig struct { + // kmsPluginImage specifies the container image for the HashiCorp Vault KMS plugin. + // + // The image must be a fully qualified OCI image pull spec with a SHA256 digest. + // The format is: host[:port][/namespace]/name@sha256: + // where the digest must be 64 characters long and consist only of lowercase hexadecimal characters, a-f and 0-9. + // The total length must be between 75 and 447 characters. + // + // Short names (e.g., "vault-plugin" or "hashicorp/vault-plugin") are not allowed. + // The registry hostname must be included and must contain at least one dot. + // Image tags (e.g., ":latest", ":v1.0.0") are not allowed. + // + // Consult the OpenShift documentation for compatible plugin versions with your cluster version, + // then obtain the image digest for that version from HashiCorp's container registry. + // + // For disconnected environments, mirror the plugin image to an accessible registry + // and reference the mirrored location with its digest. + // + // +kubebuilder:validation:MinLength=75 + // +kubebuilder:validation:MaxLength=447 + // +kubebuilder:validation:XValidation:rule=`(self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))`,message="the OCI Image reference must end with a valid '@sha256:' suffix, where '' is 64 characters long" + // +kubebuilder:validation:XValidation:rule=`(self.split('@')[0].matches('^([a-zA-Z0-9-]+\\.)+[a-zA-Z0-9-]+(:[0-9]{2,5})?(/[a-zA-Z0-9-_.]+)+$'))`,message="the OCI Image name should follow the host[:port][/namespace]/name format, resembling a valid URL without the scheme. Short names are not allowed, the registry hostname must be included." + // +required + KMSPluginImage string `json:"kmsPluginImage,omitempty"` + + // vaultAddress specifies the address of the HashiCorp Vault instance. + // The value must be a valid HTTPS URL containing only scheme, host, and optional port. + // Paths, user info, query parameters, and fragments are not allowed. + // + // Format: https://hostname[:port] + // Example: https://vault.example.com:8200 + // + // The value must be between 1 and 512 characters. + // + // +kubebuilder:validation:XValidation:rule="isURL(self)",message="must be a valid URL" + // +kubebuilder:validation:XValidation:rule="isURL(self) && url(self).getScheme() == 'https'",message="must use the 'https' scheme" + // +kubebuilder:validation:XValidation:rule="isURL(self) && (url(self).getEscapedPath() == '' || url(self).getEscapedPath() == '/')",message="must not contain a path" + // +kubebuilder:validation:XValidation:rule="isURL(self) && url(self).getQuery() == {}",message="must not have a query" + // +kubebuilder:validation:XValidation:rule="self.find('#(.+)$') == ''",message="must not have a fragment" + // +kubebuilder:validation:XValidation:rule="self.find('@') == ''",message="must not have user info" + // +kubebuilder:validation:MaxLength=512 + // +kubebuilder:validation:MinLength=1 + // +required + VaultAddress string `json:"vaultAddress,omitempty"` + + // vaultNamespace specifies the Vault namespace where the Transit secrets engine is mounted. + // This is only applicable for Vault Enterprise installations. + // When this field is not set, no namespace is used. + // + // The value must be between 1 and 4096 characters. + // The namespace cannot end with a forward slash, cannot contain spaces, and cannot be one of the reserved strings: root, sys, audit, auth, cubbyhole, or identity. + // + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=4096 + // +kubebuilder:validation:XValidation:rule="!self.endsWith('/')",message="vaultNamespace cannot end with a forward slash" + // +kubebuilder:validation:XValidation:rule="!self.contains(' ')",message="vaultNamespace cannot contain spaces" + // +kubebuilder:validation:XValidation:rule="!(self in ['root', 'sys', 'audit', 'auth', 'cubbyhole', 'identity'])",message="vaultNamespace cannot be a reserved string (root, sys, audit, auth, cubbyhole, identity)" + // +optional + VaultNamespace string `json:"vaultNamespace,omitempty"` + + // vaultAuthNamespace specifies the Vault namespace to use for authentication. + // This is only applicable for Vault Enterprise installations where authentication + // and Transit operations may be in different namespaces. + // When this field is not set, the value of vaultNamespace is used for both + // authentication and Transit key operations. + // + // The value must be between 1 and 4096 characters. + // The namespace cannot end with a forward slash, cannot contain spaces, and cannot be one of the reserved strings: root, sys, audit, auth, cubbyhole, or identity. + // + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=4096 + // +kubebuilder:validation:XValidation:rule="!self.endsWith('/')",message="vaultAuthNamespace cannot end with a forward slash" + // +kubebuilder:validation:XValidation:rule="!self.contains(' ')",message="vaultAuthNamespace cannot contain spaces" + // +kubebuilder:validation:XValidation:rule="!(self in ['root', 'sys', 'audit', 'auth', 'cubbyhole', 'identity'])",message="vaultAuthNamespace cannot be a reserved string (root, sys, audit, auth, cubbyhole, identity)" + // +optional + VaultAuthNamespace string `json:"vaultAuthNamespace,omitempty"` + + // tls contains the TLS configuration for connecting to the Vault server. + // When this field is not set, system default TLS settings are used. + // +optional + TLS VaultTLSConfig `json:"tls,omitzero"` + + // authentication defines the authentication method used to authenticate with Vault. + // + // +required + Authentication VaultAuthentication `json:"authentication,omitzero"` + + // vaultKeyPath specifies the full path to the encryption key in Vault's Transit secrets engine, + // combining the Transit engine mount path and the key name separated by "/keys/". + // Format: /keys/ (e.g., transit/keys/my-key, myteam/transit/keys/production-key). + // + // The total path length must be between 8 and 1542 characters. + // The path cannot start or end with a forward slash, cannot contain consecutive forward slashes, + // must only contain RFC 3986 unreserved characters (alphanumeric, hyphen, period, underscore, tilde) + // and forward slashes as path separators, and must not contain "." or ".." path segments. + // The key name must start and end with an alphanumeric character or underscore, and may contain + // alphanumeric characters, underscores, hyphens, and periods in the middle. + // + // +kubebuilder:validation:MinLength=8 + // +kubebuilder:validation:MaxLength=1542 + // +kubebuilder:validation:XValidation:rule="!self.startsWith('/')",message="vaultKeyPath cannot start with a forward slash" + // +kubebuilder:validation:XValidation:rule="!self.endsWith('/')",message="vaultKeyPath cannot end with a forward slash" + // +kubebuilder:validation:XValidation:rule="!self.contains('//')",message="vaultKeyPath cannot contain consecutive forward slashes" + // +kubebuilder:validation:XValidation:rule="self.matches('^[a-zA-Z0-9._~/-]+$')",message="vaultKeyPath must only contain RFC 3986 unreserved characters (alphanumeric, hyphen, period, underscore, tilde) and forward slashes" + // +kubebuilder:validation:XValidation:rule="self.split('/').filter(s, s == '.' || s == '..').size() == 0",message="vaultKeyPath must not contain '.' or '..' path segments" + // +kubebuilder:validation:XValidation:rule=`self.matches('^[a-zA-Z0-9._~-]+(/[a-zA-Z0-9._~-]+)*/keys/[a-zA-Z0-9_]([a-zA-Z0-9_.-]*[a-zA-Z0-9_])?$')`,message="vaultKeyPath must follow the format /keys/ where the key name starts and ends with an alphanumeric character or underscore and may contain alphanumeric characters, underscores, hyphens, and periods" + // +required + VaultKeyPath string `json:"vaultKeyPath,omitempty"` + + // --- TOMBSTONE --- + // transitMount specifies the mount path of the Vault Transit engine. + // It has been replaced by vaultKeyPath which combines the mount and key into a single path. + // The field name is reserved to prevent reuse. + // + // The transit mount must be between 1 and 1024 characters, cannot start or + // end with a forward slash, cannot contain consecutive forward slashes, and + // must only contain RFC 3986 unreserved characters (alphanumeric, hyphen, + // period, underscore, tilde) and forward slashes as path separators. + // + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=1024 + // +kubebuilder:validation:XValidation:rule="!self.startsWith('/')",message="transitMount cannot start with a forward slash" + // +kubebuilder:validation:XValidation:rule="!self.endsWith('/')",message="transitMount cannot end with a forward slash" + // +kubebuilder:validation:XValidation:rule="!self.contains('//')",message="transitMount cannot contain consecutive forward slashes" + // +kubebuilder:validation:XValidation:rule="self.matches('^[a-zA-Z0-9._~/-]+$')",message="transitMount must only contain RFC 3986 unreserved characters (alphanumeric, hyphen, period, underscore, tilde) and forward slashes" + // +required + // TransitMount string `json:"transitMount,omitempty"` + + // --- TOMBSTONE --- + // transitKey specifies the name of the encryption key in Vault's Transit engine. + // This key is used to encrypt and decrypt data. + // It has been replaced by vaultKeyPath which combines the mount and key into a single path. + // The field name is reserved to prevent reuse. + // + // The transit key must be between 1 and 512 characters, cannot contain forward slashes, + // and must only contain alphanumeric characters, hyphens, periods, and underscores. + // + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=512 + // +kubebuilder:validation:XValidation:rule="!self.contains('/')",message="transitKey cannot contain forward slashes" + // +kubebuilder:validation:XValidation:rule="self.matches('^[a-zA-Z0-9._-]+$')",message="transitKey must only contain alphanumeric characters, hyphens, periods, and underscores" + // +required + // TransitKey string `json:"transitKey,omitempty"` +} + +// VaultTLSConfig contains TLS configuration for connecting to Vault. +// +kubebuilder:validation:MinProperties=1 +type VaultTLSConfig struct { + // caBundle references a ConfigMap in the openshift-config namespace containing + // the CA certificate bundle used to verify the TLS connection to the Vault server. + // The referenced ConfigMap must contain the CA bundle in the key "ca-bundle.crt". + // When this field is not set, the system's trusted CA certificates are used. + // + // The namespace for the ConfigMap is openshift-config. + // + // Example ConfigMap: + // apiVersion: v1 + // kind: ConfigMap + // metadata: + // name: vault-ca-bundle + // namespace: openshift-config + // data: + // ca-bundle.crt: | + // -----BEGIN CERTIFICATE----- + // ... + // -----END CERTIFICATE----- + // + // +optional + CABundle VaultConfigMapReference `json:"caBundle,omitzero"` + + // serverName specifies the Server Name Indication (SNI) to use when connecting to Vault via TLS. + // This is useful when the Vault server's hostname doesn't match its TLS certificate. + // When this field is not set, the hostname from vaultAddress is used for SNI. + // + // The value must be a valid DNS hostname: it must contain no more than 253 characters, + // contain only lowercase alphanumeric characters, '-' or '.', and start and end with an alphanumeric character. + // + // +kubebuilder:validation:MaxLength=253 + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:XValidation:rule="!format.dns1123Subdomain().validate(self).hasValue()",message="serverName must be a valid DNS hostname: contain no more than 253 characters, contain only lowercase alphanumeric characters, '-' or '.', and start and end with an alphanumeric character" + // +optional + ServerName string `json:"serverName,omitempty"` +} diff --git a/apis/vendor/github.com/openshift/api/config/v1/types_network.go b/apis/vendor/github.com/openshift/api/config/v1/types_network.go index fb8ed2fff74..80b022de9fd 100644 --- a/apis/vendor/github.com/openshift/api/config/v1/types_network.go +++ b/apis/vendor/github.com/openshift/api/config/v1/types_network.go @@ -86,6 +86,13 @@ type NetworkSpec struct { // // +optional NetworkDiagnostics NetworkDiagnostics `json:"networkDiagnostics"` + + // networkObservability is an optional field that configures network observability installation + // during cluster deployment (day-0). + // When omitted, unless this is a SNO cluster, network observability will be installed if not already present, after that, no action taken. + // +openshift:enable:FeatureGate=NetworkObservabilityInstall + // +optional + NetworkObservability NetworkObservabilitySpec `json:"networkObservability,omitempty,omitzero"` } // NetworkStatus is the current network configuration. @@ -304,3 +311,29 @@ type NetworkDiagnosticsTargetPlacement struct { // +listType=atomic Tolerations []corev1.Toleration `json:"tolerations"` } + +// NetworkObservabilityInstallationPolicy is an enumeration of the available network observability installation policies +// Valid values are "InstallAndEnable", "NoAction". +// +kubebuilder:validation:Enum=InstallAndEnable;NoAction +type NetworkObservabilityInstallationPolicy string + +const ( + // NetworkObservabilityInstallAndEnable means that network observability should be installed and enabled during cluster deployment + // Since this was explicitly set to install, if the user remove NetworkObservability, it will be installed again unless the value of InstallationPolicy is changed + NetworkObservabilityInstallAndEnable NetworkObservabilityInstallationPolicy = "InstallAndEnable" + // NetworkObservabilityNoAction means that nothing will be done regarding Network Observability + NetworkObservabilityNoAction NetworkObservabilityInstallationPolicy = "NoAction" +) + +// NetworkObservabilitySpec defines the configuration for network observability installation +type NetworkObservabilitySpec struct { + // installationPolicy controls whether network observability is installed during cluster deployment. + // Valid values are "InstallAndEnable" and "NoAction". + // When set to "InstallAndEnable", ensure that network observability will be installed and enabled on the cluster. If already installed, no action taken, but if it gets uninstalled, it will install it again. + // When set to "NoAction", nothing will be done regarding Network observability. + // During the installation of NetworkObservability, the platform checks for any existing manual installations. + // If a successful installation using the OLMv0 or OLMv1 API is detected, it will be used. + // If the platform cannot determine how the current version was installed, or if the existing installation is incomplete, the installation process will stop. + // +required + InstallationPolicy NetworkObservabilityInstallationPolicy `json:"installationPolicy,omitempty"` +} diff --git a/apis/vendor/github.com/openshift/api/config/v1/types_tlssecurityprofile.go b/apis/vendor/github.com/openshift/api/config/v1/types_tlssecurityprofile.go index 48657b08947..2e9be97aeb4 100644 --- a/apis/vendor/github.com/openshift/api/config/v1/types_tlssecurityprofile.go +++ b/apis/vendor/github.com/openshift/api/config/v1/types_tlssecurityprofile.go @@ -7,10 +7,16 @@ type TLSSecurityProfile struct { // type is one of Old, Intermediate, Modern or Custom. Custom provides the // ability to specify individual TLS security profile parameters. // - // The profiles are based on version 5.7 of the Mozilla Server Side TLS - // configuration guidelines. The cipher lists consist of the configuration's - // "ciphersuites" followed by the Go-specific "ciphers" from the guidelines. - // See: https://ssl-config.mozilla.org/guidelines/5.7.json + // The cipher and groups lists in these profiles are based on version 5.8 of the + // Mozilla Server Side TLS configuration guidelines. + // See: https://ssl-config.mozilla.org/guidelines/5.8.json + // + // The groups are listed in suggested preference order, with the most preferred group first. + // Note that not all platform components honor the ordering: Go-based components use Go's + // internal preference order and treat this list as a filter of allowed groups rather than + // an ordered preference. + // Note that X25519MLKEM768 is a post-quantum hybrid group that is not + // FIPS-approved and should be ignored by components running in FIPS mode. // // The profiles are intent based, so they may change over time as new ciphers are // developed and existing ciphers are found to be insecure. Depending on @@ -23,6 +29,10 @@ type TLSSecurityProfile struct { // old is a TLS profile for use when services need to be accessed by very old // clients or libraries and should be used only as a last resort. // + // The supported groups list includes by default the following groups + // in suggested preference order (ordering may not be honored by all implementations): + // X25519MLKEM768, X25519, secp256r1, secp384r1. + // // This profile is equivalent to a Custom profile specified as: // minTLSVersion: VersionTLS10 // ciphers: @@ -39,11 +49,14 @@ type TLSSecurityProfile struct { // - ECDHE-RSA-AES128-SHA256 // - ECDHE-ECDSA-AES128-SHA // - ECDHE-RSA-AES128-SHA + // - ECDHE-ECDSA-AES256-SHA384 + // - ECDHE-RSA-AES256-SHA384 // - ECDHE-ECDSA-AES256-SHA // - ECDHE-RSA-AES256-SHA // - AES128-GCM-SHA256 // - AES256-GCM-SHA384 // - AES128-SHA256 + // - AES256-SHA256 // - AES128-SHA // - AES256-SHA // - DES-CBC3-SHA @@ -56,6 +69,10 @@ type TLSSecurityProfile struct { // legacy clients and want to remain highly secure while being compatible with // most clients currently in use. // + // The supported groups list includes by default the following groups + // in suggested preference order (ordering may not be honored by all implementations): + // X25519MLKEM768, X25519, secp256r1, secp384r1. + // // This profile is equivalent to a Custom profile specified as: // minTLSVersion: VersionTLS12 // ciphers: @@ -75,7 +92,9 @@ type TLSSecurityProfile struct { // modern is a TLS security profile for use with clients that support TLS 1.3 and // do not need backward compatibility for older clients. - // + // The supported groups list includes by default the following groups + // in suggested preference order (ordering may not be honored by all implementations): + // X25519MLKEM768, X25519, secp256r1, secp384r1. // This profile is equivalent to a Custom profile specified as: // minTLSVersion: VersionTLS13 // ciphers: @@ -88,8 +107,11 @@ type TLSSecurityProfile struct { Modern *ModernTLSProfile `json:"modern,omitempty"` // custom is a user-defined TLS security profile. Be extremely careful using a custom - // profile as invalid configurations can be catastrophic. An example custom profile - // looks like this: + // profile as invalid configurations can be catastrophic. + // + // The supported groups list for this profile is empty by default. + // + // An example custom profile looks like this: // // minTLSVersion: VersionTLS11 // ciphers: @@ -142,6 +164,33 @@ const ( TLSProfileCustomType TLSProfileType = "Custom" ) +// TLSGroup is a supported group identifier that can be used in TLSProfile.Groups. +// There is a one-to-one mapping between these names and the group IDs defined +// in Go's crypto/tls package based on IANA's "TLS Supported Groups" registry: +// https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-8 +// Note that X25519MLKEM768 is a post-quantum hybrid group that is not +// FIPS-approved and should be ignored by components running in FIPS mode. +// +// +kubebuilder:validation:Enum=X25519;secp256r1;secp384r1;secp521r1;X25519MLKEM768;SecP256r1MLKEM768;SecP384r1MLKEM1024 +type TLSGroup string + +const ( + // TLSGroupX25519 represents X25519. + TLSGroupX25519 TLSGroup = "X25519" + // TLSGroupSecP256r1 represents P-256 (secp256r1). + TLSGroupSecP256r1 TLSGroup = "secp256r1" + // TLSGroupSecP384r1 represents P-384 (secp384r1). + TLSGroupSecP384r1 TLSGroup = "secp384r1" + // TLSGroupSecP521r1 represents P-521 (secp521r1). + TLSGroupSecP521r1 TLSGroup = "secp521r1" + // TLSGroupX25519MLKEM768 represents X25519MLKEM768. + TLSGroupX25519MLKEM768 TLSGroup = "X25519MLKEM768" + // TLSGroupSecP256r1MLKEM768 represents SecP256r1MLKEM768. + TLSGroupSecP256r1MLKEM768 TLSGroup = "SecP256r1MLKEM768" + // TLSGroupSecP384r1MLKEM1024 represents SecP384r1MLKEM1024. + TLSGroupSecP384r1MLKEM1024 TLSGroup = "SecP384r1MLKEM1024" +) + // TLSProfileSpec is the desired behavior of a TLSSecurityProfile. type TLSProfileSpec struct { // ciphers is used to specify the cipher algorithms that are negotiated @@ -155,6 +204,30 @@ type TLSProfileSpec struct { // and are always enabled when TLS 1.3 is negotiated. // +listType=atomic Ciphers []string `json:"ciphers"` + // groups is an optional, ordered field used to specify the supported groups (formerly known as + // elliptic curves) that are used during the TLS handshake. The order of the groups represents + // a suggested preference, with the most preferred group first. Note that not all platform + // components honor the ordering: Go-based components use Go's internal preference order and + // treat this list as a filter of allowed groups rather than an ordered preference. + // Operators may remove entries their operands do not support. + // + // When omitted, this means no opinion and the platform is left to choose reasonable defaults which are + // subject to change over time and may be different per platform component depending on the underlying TLS + // libraries they use. If specified, the list must contain at least one and at most 7 groups, + // and each group must be unique. + // + // For example, to use X25519 and secp256r1 (yaml): + // + // groups: + // - X25519 + // - secp256r1 + // + // +optional + // +listType=set + // +kubebuilder:validation:MaxItems=7 + // +kubebuilder:validation:MinItems=1 + // +openshift:enable:FeatureGate=TLSGroupPreferences + Groups []TLSGroup `json:"groups,omitempty"` // minTLSVersion is used to specify the minimal version of the TLS protocol // that is negotiated during the TLS handshake. For example, to use TLS // versions 1.1, 1.2 and 1.3 (yaml): @@ -187,16 +260,22 @@ const ( // TLSProfiles contains a map of TLSProfileType names to TLSProfileSpec. // -// These profiles are based on version 5.7 of the Mozilla Server Side TLS -// configuration guidelines. See: https://ssl-config.mozilla.org/guidelines/5.7.json +// The cipher and groups lists in these profiles are based on version 5.8 of the +// Mozilla Server Side TLS configuration guidelines. +// See: https://ssl-config.mozilla.org/guidelines/5.8.json // // Each Ciphers slice is the configuration's "ciphersuites" followed by the -// Go-specific "ciphers" from the guidelines JSON. +// "ciphers" from the guidelines JSON. +// +// Groups are listed in suggested preference order, though Go-based components may use +// their own internal ordering. TLSProfiles Old, Intermediate, Modern include by default +// the following groups: X25519MLKEM768, X25519, secp256r1, secp384r1 // // NOTE: The caller needs to make sure to check that these constants are valid // for their binary. Not all entries map to values for all binaries. In the case // of ties, the kube-apiserver wins. Do not fail, just be sure to include only -// valid entries and everything will be ok. +// valid entries and everything will be ok. In particular, X25519MLKEM768 is +// not FIPS-approved and must be omitted by components running in FIPS mode. var TLSProfiles = map[TLSProfileType]*TLSProfileSpec{ TLSProfileOldType: { Ciphers: []string{ @@ -213,15 +292,24 @@ var TLSProfiles = map[TLSProfileType]*TLSProfileSpec{ "ECDHE-RSA-AES128-SHA256", "ECDHE-ECDSA-AES128-SHA", "ECDHE-RSA-AES128-SHA", + "ECDHE-ECDSA-AES256-SHA384", + "ECDHE-RSA-AES256-SHA384", "ECDHE-ECDSA-AES256-SHA", "ECDHE-RSA-AES256-SHA", "AES128-GCM-SHA256", "AES256-GCM-SHA384", "AES128-SHA256", + "AES256-SHA256", "AES128-SHA", "AES256-SHA", "DES-CBC3-SHA", }, + Groups: []TLSGroup{ + TLSGroupX25519MLKEM768, + TLSGroupX25519, + TLSGroupSecP256r1, + TLSGroupSecP384r1, + }, MinTLSVersion: VersionTLS10, }, TLSProfileIntermediateType: { @@ -236,6 +324,12 @@ var TLSProfiles = map[TLSProfileType]*TLSProfileSpec{ "ECDHE-ECDSA-CHACHA20-POLY1305", "ECDHE-RSA-CHACHA20-POLY1305", }, + Groups: []TLSGroup{ + TLSGroupX25519MLKEM768, + TLSGroupX25519, + TLSGroupSecP256r1, + TLSGroupSecP384r1, + }, MinTLSVersion: VersionTLS12, }, TLSProfileModernType: { @@ -244,6 +338,12 @@ var TLSProfiles = map[TLSProfileType]*TLSProfileSpec{ "TLS_AES_256_GCM_SHA384", "TLS_CHACHA20_POLY1305_SHA256", }, + Groups: []TLSGroup{ + TLSGroupX25519MLKEM768, + TLSGroupX25519, + TLSGroupSecP256r1, + TLSGroupSecP384r1, + }, MinTLSVersion: VersionTLS13, }, } diff --git a/apis/vendor/github.com/openshift/api/config/v1/zz_generated.deepcopy.go b/apis/vendor/github.com/openshift/api/config/v1/zz_generated.deepcopy.go index 30b85b78e96..4b194b226a4 100644 --- a/apis/vendor/github.com/openshift/api/config/v1/zz_generated.deepcopy.go +++ b/apis/vendor/github.com/openshift/api/config/v1/zz_generated.deepcopy.go @@ -42,11 +42,7 @@ func (in *APIServer) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *APIServerEncryption) DeepCopyInto(out *APIServerEncryption) { *out = *in - if in.KMS != nil { - in, out := &in.KMS, &out.KMS - *out = new(KMSConfig) - (*in).DeepCopyInto(*out) - } + out.KMS = in.KMS return } @@ -148,7 +144,7 @@ func (in *APIServerSpec) DeepCopyInto(out *APIServerSpec) { *out = make([]string, len(*in)) copy(*out, *in) } - in.Encryption.DeepCopyInto(&out.Encryption) + out.Encryption = in.Encryption if in.TLSSecurityProfile != nil { in, out := &in.TLSSecurityProfile, &out.TLSSecurityProfile *out = new(TLSSecurityProfile) @@ -216,22 +212,6 @@ func (in *AWSIngressSpec) DeepCopy() *AWSIngressSpec { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSKMSConfig) DeepCopyInto(out *AWSKMSConfig) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSKMSConfig. -func (in *AWSKMSConfig) DeepCopy() *AWSKMSConfig { - if in == nil { - return nil - } - out := new(AWSKMSConfig) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AWSPlatformSpec) DeepCopyInto(out *AWSPlatformSpec) { *out = *in @@ -924,6 +904,115 @@ func (in *BuildSpec) DeepCopy() *BuildSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CRIOCredentialProviderConfig) DeepCopyInto(out *CRIOCredentialProviderConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + if in.Spec != nil { + in, out := &in.Spec, &out.Spec + *out = new(CRIOCredentialProviderConfigSpec) + (*in).DeepCopyInto(*out) + } + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CRIOCredentialProviderConfig. +func (in *CRIOCredentialProviderConfig) DeepCopy() *CRIOCredentialProviderConfig { + if in == nil { + return nil + } + out := new(CRIOCredentialProviderConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CRIOCredentialProviderConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CRIOCredentialProviderConfigList) DeepCopyInto(out *CRIOCredentialProviderConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]CRIOCredentialProviderConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CRIOCredentialProviderConfigList. +func (in *CRIOCredentialProviderConfigList) DeepCopy() *CRIOCredentialProviderConfigList { + if in == nil { + return nil + } + out := new(CRIOCredentialProviderConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CRIOCredentialProviderConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CRIOCredentialProviderConfigSpec) DeepCopyInto(out *CRIOCredentialProviderConfigSpec) { + *out = *in + if in.MatchImages != nil { + in, out := &in.MatchImages, &out.MatchImages + *out = make([]MatchImage, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CRIOCredentialProviderConfigSpec. +func (in *CRIOCredentialProviderConfigSpec) DeepCopy() *CRIOCredentialProviderConfigSpec { + if in == nil { + return nil + } + out := new(CRIOCredentialProviderConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CRIOCredentialProviderConfigStatus) DeepCopyInto(out *CRIOCredentialProviderConfigStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]metav1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CRIOCredentialProviderConfigStatus. +func (in *CRIOCredentialProviderConfigStatus) DeepCopy() *CRIOCredentialProviderConfigStatus { + if in == nil { + return nil + } + out := new(CRIOCredentialProviderConfigStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CertInfo) DeepCopyInto(out *CertInfo) { *out = *in @@ -956,6 +1045,45 @@ func (in *ClientConnectionOverrides) DeepCopy() *ClientConnectionOverrides { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClientCredentialConfig) DeepCopyInto(out *ClientCredentialConfig) { + *out = *in + out.ClientSecret = in.ClientSecret + if in.Scopes != nil { + in, out := &in.Scopes, &out.Scopes + *out = make([]OAuth2Scope, len(*in)) + copy(*out, *in) + } + out.TLS = in.TLS + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClientCredentialConfig. +func (in *ClientCredentialConfig) DeepCopy() *ClientCredentialConfig { + if in == nil { + return nil + } + out := new(ClientCredentialConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClientSecretSecretReference) DeepCopyInto(out *ClientSecretSecretReference) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClientSecretSecretReference. +func (in *ClientSecretSecretReference) DeepCopy() *ClientSecretSecretReference { + if in == nil { + return nil + } + out := new(ClientSecretSecretReference) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CloudControllerManagerStatus) DeepCopyInto(out *CloudControllerManagerStatus) { *out = *in @@ -1512,6 +1640,13 @@ func (in *ComponentOverride) DeepCopy() *ComponentOverride { func (in *ComponentRouteSpec) DeepCopyInto(out *ComponentRouteSpec) { *out = *in out.ServingCertKeyPairSecret = in.ServingCertKeyPairSecret + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(map[string]LabelValue, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } return } @@ -2103,6 +2238,35 @@ func (in *EtcdStorageConfig) DeepCopy() *EtcdStorageConfig { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalClaimsSource) DeepCopyInto(out *ExternalClaimsSource) { + *out = *in + in.Authentication.DeepCopyInto(&out.Authentication) + out.TLS = in.TLS + out.URL = in.URL + if in.Mappings != nil { + in, out := &in.Mappings, &out.Mappings + *out = make([]SourcedClaimMapping, len(*in)) + copy(*out, *in) + } + if in.Predicates != nil { + in, out := &in.Predicates, &out.Predicates + *out = make([]ExternalSourcePredicate, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalClaimsSource. +func (in *ExternalClaimsSource) DeepCopy() *ExternalClaimsSource { + if in == nil { + return nil + } + out := new(ExternalClaimsSource) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ExternalIPConfig) DeepCopyInto(out *ExternalIPConfig) { *out = *in @@ -2188,6 +2352,72 @@ func (in *ExternalPlatformStatus) DeepCopy() *ExternalPlatformStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalSourceAuthentication) DeepCopyInto(out *ExternalSourceAuthentication) { + *out = *in + in.ClientCredential.DeepCopyInto(&out.ClientCredential) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalSourceAuthentication. +func (in *ExternalSourceAuthentication) DeepCopy() *ExternalSourceAuthentication { + if in == nil { + return nil + } + out := new(ExternalSourceAuthentication) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalSourceCertificateAuthorityConfigMapReference) DeepCopyInto(out *ExternalSourceCertificateAuthorityConfigMapReference) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalSourceCertificateAuthorityConfigMapReference. +func (in *ExternalSourceCertificateAuthorityConfigMapReference) DeepCopy() *ExternalSourceCertificateAuthorityConfigMapReference { + if in == nil { + return nil + } + out := new(ExternalSourceCertificateAuthorityConfigMapReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalSourcePredicate) DeepCopyInto(out *ExternalSourcePredicate) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalSourcePredicate. +func (in *ExternalSourcePredicate) DeepCopy() *ExternalSourcePredicate { + if in == nil { + return nil + } + out := new(ExternalSourcePredicate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalSourceTLS) DeepCopyInto(out *ExternalSourceTLS) { + *out = *in + out.CertificateAuthority = in.CertificateAuthority + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalSourceTLS. +func (in *ExternalSourceTLS) DeepCopy() *ExternalSourceTLS { + if in == nil { + return nil + } + out := new(ExternalSourceTLS) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ExtraMapping) DeepCopyInto(out *ExtraMapping) { *out = *in @@ -2560,6 +2790,7 @@ func (in *GenericAPIServerConfig) DeepCopy() *GenericAPIServerConfig { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GenericControllerConfig) DeepCopyInto(out *GenericControllerConfig) { *out = *in + out.TypeMeta = in.TypeMeta in.ServingInfo.DeepCopyInto(&out.ServingInfo) out.LeaderElection = in.LeaderElection out.Authentication = in.Authentication @@ -3690,7 +3921,9 @@ func (in *IngressSpec) DeepCopyInto(out *IngressSpec) { if in.ComponentRoutes != nil { in, out := &in.ComponentRoutes, &out.ComponentRoutes *out = make([]ComponentRouteSpec, len(*in)) - copy(*out, *in) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } } if in.RequiredHSTSPolicies != nil { in, out := &in.RequiredHSTSPolicies, &out.RequiredHSTSPolicies @@ -3830,22 +4063,18 @@ func (in *IntermediateTLSProfile) DeepCopy() *IntermediateTLSProfile { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KMSConfig) DeepCopyInto(out *KMSConfig) { +func (in *KMSPluginConfig) DeepCopyInto(out *KMSPluginConfig) { *out = *in - if in.AWS != nil { - in, out := &in.AWS, &out.AWS - *out = new(AWSKMSConfig) - **out = **in - } + out.Vault = in.Vault return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KMSConfig. -func (in *KMSConfig) DeepCopy() *KMSConfig { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KMSPluginConfig. +func (in *KMSPluginConfig) DeepCopy() *KMSPluginConfig { if in == nil { return nil } - out := new(KMSConfig) + out := new(KMSPluginConfig) in.DeepCopyInto(out) return out } @@ -4283,6 +4512,22 @@ func (in *NetworkMigration) DeepCopy() *NetworkMigration { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkObservabilitySpec) DeepCopyInto(out *NetworkObservabilitySpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkObservabilitySpec. +func (in *NetworkObservabilitySpec) DeepCopy() *NetworkObservabilitySpec { + if in == nil { + return nil + } + out := new(NetworkObservabilitySpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NetworkSpec) DeepCopyInto(out *NetworkSpec) { *out = *in @@ -4302,6 +4547,7 @@ func (in *NetworkSpec) DeepCopyInto(out *NetworkSpec) { (*in).DeepCopyInto(*out) } in.NetworkDiagnostics.DeepCopyInto(&out.NetworkDiagnostics) + out.NetworkObservability = in.NetworkObservability return } @@ -4847,6 +5093,13 @@ func (in *OIDCProvider) DeepCopyInto(out *OIDCProvider) { *out = make([]TokenUserValidationRule, len(*in)) copy(*out, *in) } + if in.ExternalClaimsSources != nil { + in, out := &in.ExternalClaimsSources, &out.ExternalClaimsSources + *out = make([]ExternalClaimsSource, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } return } @@ -6187,6 +6440,38 @@ func (in *SignatureStore) DeepCopy() *SignatureStore { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SourceURL) DeepCopyInto(out *SourceURL) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SourceURL. +func (in *SourceURL) DeepCopy() *SourceURL { + if in == nil { + return nil + } + out := new(SourceURL) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SourcedClaimMapping) DeepCopyInto(out *SourcedClaimMapping) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SourcedClaimMapping. +func (in *SourcedClaimMapping) DeepCopy() *SourcedClaimMapping { + if in == nil { + return nil + } + out := new(SourcedClaimMapping) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Storage) DeepCopyInto(out *Storage) { *out = *in @@ -6245,6 +6530,11 @@ func (in *TLSProfileSpec) DeepCopyInto(out *TLSProfileSpec) { *out = make([]string, len(*in)) copy(*out, *in) } + if in.Groups != nil { + in, out := &in.Groups, &out.Groups + *out = make([]TLSGroup, len(*in)) + copy(*out, *in) + } return } @@ -6901,6 +7191,107 @@ func (in *VSpherePlatformVCenterSpec) DeepCopy() *VSpherePlatformVCenterSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VaultAppRoleAuthentication) DeepCopyInto(out *VaultAppRoleAuthentication) { + *out = *in + out.Secret = in.Secret + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VaultAppRoleAuthentication. +func (in *VaultAppRoleAuthentication) DeepCopy() *VaultAppRoleAuthentication { + if in == nil { + return nil + } + out := new(VaultAppRoleAuthentication) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VaultAuthentication) DeepCopyInto(out *VaultAuthentication) { + *out = *in + out.AppRole = in.AppRole + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VaultAuthentication. +func (in *VaultAuthentication) DeepCopy() *VaultAuthentication { + if in == nil { + return nil + } + out := new(VaultAuthentication) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VaultConfigMapReference) DeepCopyInto(out *VaultConfigMapReference) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VaultConfigMapReference. +func (in *VaultConfigMapReference) DeepCopy() *VaultConfigMapReference { + if in == nil { + return nil + } + out := new(VaultConfigMapReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VaultKMSPluginConfig) DeepCopyInto(out *VaultKMSPluginConfig) { + *out = *in + out.TLS = in.TLS + out.Authentication = in.Authentication + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VaultKMSPluginConfig. +func (in *VaultKMSPluginConfig) DeepCopy() *VaultKMSPluginConfig { + if in == nil { + return nil + } + out := new(VaultKMSPluginConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VaultSecretReference) DeepCopyInto(out *VaultSecretReference) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VaultSecretReference. +func (in *VaultSecretReference) DeepCopy() *VaultSecretReference { + if in == nil { + return nil + } + out := new(VaultSecretReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VaultTLSConfig) DeepCopyInto(out *VaultTLSConfig) { + *out = *in + out.CABundle = in.CABundle + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VaultTLSConfig. +func (in *VaultTLSConfig) DeepCopy() *VaultTLSConfig { + if in == nil { + return nil + } + out := new(VaultTLSConfig) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *WebhookTokenAuthenticator) DeepCopyInto(out *WebhookTokenAuthenticator) { *out = *in diff --git a/apis/vendor/github.com/openshift/api/config/v1/zz_generated.featuregated-crd-manifests.yaml b/apis/vendor/github.com/openshift/api/config/v1/zz_generated.featuregated-crd-manifests.yaml index 4b768c3898d..7707626383f 100644 --- a/apis/vendor/github.com/openshift/api/config/v1/zz_generated.featuregated-crd-manifests.yaml +++ b/apis/vendor/github.com/openshift/api/config/v1/zz_generated.featuregated-crd-manifests.yaml @@ -7,8 +7,8 @@ apiservers.config.openshift.io: Category: "" FeatureGates: - KMSEncryption - - KMSEncryptionProvider - TLSAdherence + - TLSGroupPreferences FilenameOperatorName: config-operator FilenameOperatorOrdering: "01" FilenameRunLevel: "0000_10" @@ -32,6 +32,7 @@ authentications.config.openshift.io: Category: "" FeatureGates: - ExternalOIDC + - ExternalOIDCExternalClaimsSourcing - ExternalOIDCWithUIDAndExtraClaimMappings - ExternalOIDCWithUpstreamParity FilenameOperatorName: config-operator @@ -69,6 +70,29 @@ builds.config.openshift.io: TopLevelFeatureGates: [] Version: v1 +criocredentialproviderconfigs.config.openshift.io: + Annotations: {} + ApprovedPRNumber: https://github.com/openshift/api/pull/2725 + CRDName: criocredentialproviderconfigs.config.openshift.io + Capability: "" + Category: "" + FeatureGates: + - CRIOCredentialProviderConfig + FilenameOperatorName: config-operator + FilenameOperatorOrdering: "01" + FilenameRunLevel: "0000_10" + GroupName: config.openshift.io + HasStatus: true + KindName: CRIOCredentialProviderConfig + Labels: {} + PluralName: criocredentialproviderconfigs + PrinterColumns: [] + Scope: Cluster + ShortNames: null + TopLevelFeatureGates: + - CRIOCredentialProviderConfig + Version: v1 + clusterimagepolicies.config.openshift.io: Annotations: {} ApprovedPRNumber: https://github.com/openshift/api/pull/2310 @@ -144,6 +168,9 @@ clusterversions.config.openshift.io: Capability: "" Category: "" FeatureGates: + - CRDCompatibilityRequirementOperator + - CRDCompatibilityRequirementOperator+ClusterAPIMachineManagement + - ClusterAPIMachineManagement - ClusterUpdateAcceptRisks - ClusterUpdatePreflight - ImageStreamImportMode @@ -206,7 +233,8 @@ dnses.config.openshift.io: CRDName: dnses.config.openshift.io Capability: "" Category: "" - FeatureGates: [] + FeatureGates: + - AWSEuropeanSovereignCloudInstall FilenameOperatorName: config-operator FilenameOperatorOrdering: "01" FilenameRunLevel: "0000_10" @@ -368,17 +396,16 @@ infrastructures.config.openshift.io: FeatureGates: - AWSClusterHostedDNSInstall - AWSDualStackInstall - - AzureClusterHostedDNSInstall - AzureDualStackInstall + - BGPBasedVIPManagement - DualReplica - DyanmicServiceEndpointIBMCloud - - GCPClusterHostedDNSInstall - - HighlyAvailableArbiter - - HighlyAvailableArbiter+DualReplica + - MutableTopology - NutanixMultiSubnets - OnPremDNSRecords - VSphereHostVMGroupZonal - VSphereMultiNetworks + - VSphereMultiVCenterDay2 FilenameOperatorName: config-operator FilenameOperatorOrdering: "01" FilenameRunLevel: "0000_10" @@ -400,7 +427,8 @@ ingresses.config.openshift.io: CRDName: ingresses.config.openshift.io Capability: "" Category: "" - FeatureGates: [] + FeatureGates: + - IngressComponentRouteLabels FilenameOperatorName: config-operator FilenameOperatorOrdering: "01" FilenameRunLevel: "0000_10" @@ -445,7 +473,8 @@ networks.config.openshift.io: CRDName: networks.config.openshift.io Capability: "" Category: "" - FeatureGates: [] + FeatureGates: + - NetworkObservabilityInstall FilenameOperatorName: config-operator FilenameOperatorOrdering: "01" FilenameRunLevel: "0000_10" diff --git a/apis/vendor/github.com/openshift/api/config/v1/zz_generated.model_name.go b/apis/vendor/github.com/openshift/api/config/v1/zz_generated.model_name.go new file mode 100644 index 00000000000..043c03ef5ef --- /dev/null +++ b/apis/vendor/github.com/openshift/api/config/v1/zz_generated.model_name.go @@ -0,0 +1,1566 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +// Code generated by codegen. DO NOT EDIT. + +package v1 + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in APIServer) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.APIServer" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in APIServerEncryption) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.APIServerEncryption" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in APIServerList) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.APIServerList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in APIServerNamedServingCert) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.APIServerNamedServingCert" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in APIServerServingCerts) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.APIServerServingCerts" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in APIServerSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.APIServerSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in APIServerStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.APIServerStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AWSDNSSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.AWSDNSSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AWSIngressSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.AWSIngressSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AWSPlatformSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.AWSPlatformSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AWSPlatformStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.AWSPlatformStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AWSResourceTag) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.AWSResourceTag" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AWSServiceEndpoint) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.AWSServiceEndpoint" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AcceptRisk) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.AcceptRisk" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AdmissionConfig) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.AdmissionConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AdmissionPluginConfig) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.AdmissionPluginConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AlibabaCloudPlatformSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.AlibabaCloudPlatformSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AlibabaCloudPlatformStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.AlibabaCloudPlatformStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AlibabaCloudResourceTag) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.AlibabaCloudResourceTag" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Audit) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.Audit" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AuditConfig) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.AuditConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AuditCustomRule) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.AuditCustomRule" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Authentication) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.Authentication" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AuthenticationList) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.AuthenticationList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AuthenticationSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.AuthenticationSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AuthenticationStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.AuthenticationStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AzurePlatformSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.AzurePlatformSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AzurePlatformStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.AzurePlatformStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AzureResourceTag) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.AzureResourceTag" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in BareMetalPlatformLoadBalancer) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.BareMetalPlatformLoadBalancer" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in BareMetalPlatformSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.BareMetalPlatformSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in BareMetalPlatformStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.BareMetalPlatformStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in BasicAuthIdentityProvider) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.BasicAuthIdentityProvider" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Build) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.Build" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in BuildDefaults) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.BuildDefaults" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in BuildList) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.BuildList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in BuildOverrides) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.BuildOverrides" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in BuildSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.BuildSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CRIOCredentialProviderConfig) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.CRIOCredentialProviderConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CRIOCredentialProviderConfigList) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.CRIOCredentialProviderConfigList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CRIOCredentialProviderConfigSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.CRIOCredentialProviderConfigSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CRIOCredentialProviderConfigStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.CRIOCredentialProviderConfigStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CertInfo) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.CertInfo" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ClientConnectionOverrides) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ClientConnectionOverrides" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ClientCredentialConfig) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ClientCredentialConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ClientSecretSecretReference) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ClientSecretSecretReference" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CloudControllerManagerStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.CloudControllerManagerStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CloudLoadBalancerConfig) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.CloudLoadBalancerConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CloudLoadBalancerIPs) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.CloudLoadBalancerIPs" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ClusterCondition) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ClusterCondition" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ClusterImagePolicy) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ClusterImagePolicy" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ClusterImagePolicyList) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ClusterImagePolicyList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ClusterImagePolicySpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ClusterImagePolicySpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ClusterImagePolicyStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ClusterImagePolicyStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ClusterNetworkEntry) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ClusterNetworkEntry" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ClusterOperator) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ClusterOperator" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ClusterOperatorList) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ClusterOperatorList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ClusterOperatorSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ClusterOperatorSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ClusterOperatorStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ClusterOperatorStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ClusterOperatorStatusCondition) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ClusterOperatorStatusCondition" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ClusterVersion) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ClusterVersion" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ClusterVersionCapabilitiesSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ClusterVersionCapabilitiesSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ClusterVersionCapabilitiesStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ClusterVersionCapabilitiesStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ClusterVersionList) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ClusterVersionList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ClusterVersionSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ClusterVersionSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ClusterVersionStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ClusterVersionStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ComponentOverride) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ComponentOverride" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ComponentRouteSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ComponentRouteSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ComponentRouteStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ComponentRouteStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ConditionalUpdate) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ConditionalUpdate" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ConditionalUpdateRisk) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ConditionalUpdateRisk" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ConfigMapFileReference) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ConfigMapFileReference" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ConfigMapNameReference) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ConfigMapNameReference" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Console) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.Console" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ConsoleAuthentication) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ConsoleAuthentication" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ConsoleList) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ConsoleList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ConsoleSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ConsoleSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ConsoleStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ConsoleStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Custom) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.Custom" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CustomFeatureGates) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.CustomFeatureGates" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CustomTLSProfile) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.CustomTLSProfile" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DNS) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.DNS" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DNSList) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.DNSList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DNSPlatformSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.DNSPlatformSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DNSSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.DNSSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DNSStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.DNSStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DNSZone) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.DNSZone" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DelegatedAuthentication) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.DelegatedAuthentication" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DelegatedAuthorization) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.DelegatedAuthorization" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DeprecatedWebhookTokenAuthenticator) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.DeprecatedWebhookTokenAuthenticator" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in EquinixMetalPlatformSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.EquinixMetalPlatformSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in EquinixMetalPlatformStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.EquinixMetalPlatformStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in EtcdConnectionInfo) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.EtcdConnectionInfo" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in EtcdStorageConfig) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.EtcdStorageConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ExternalClaimsSource) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ExternalClaimsSource" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ExternalIPConfig) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ExternalIPConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ExternalIPPolicy) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ExternalIPPolicy" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ExternalPlatformSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ExternalPlatformSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ExternalPlatformStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ExternalPlatformStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ExternalSourceAuthentication) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ExternalSourceAuthentication" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ExternalSourceCertificateAuthorityConfigMapReference) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ExternalSourceCertificateAuthorityConfigMapReference" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ExternalSourcePredicate) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ExternalSourcePredicate" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ExternalSourceTLS) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ExternalSourceTLS" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ExtraMapping) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ExtraMapping" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in FeatureGate) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.FeatureGate" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in FeatureGateAttributes) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.FeatureGateAttributes" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in FeatureGateDetails) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.FeatureGateDetails" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in FeatureGateList) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.FeatureGateList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in FeatureGateSelection) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.FeatureGateSelection" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in FeatureGateSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.FeatureGateSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in FeatureGateStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.FeatureGateStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in FeatureGateTests) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.FeatureGateTests" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in GCPPlatformSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.GCPPlatformSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in GCPPlatformStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.GCPPlatformStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in GCPResourceLabel) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.GCPResourceLabel" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in GCPResourceTag) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.GCPResourceTag" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in GatherConfig) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.GatherConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in GathererConfig) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.GathererConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Gatherers) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.Gatherers" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in GenericAPIServerConfig) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.GenericAPIServerConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in GenericControllerConfig) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.GenericControllerConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in GitHubIdentityProvider) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.GitHubIdentityProvider" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in GitLabIdentityProvider) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.GitLabIdentityProvider" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in GoogleIdentityProvider) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.GoogleIdentityProvider" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in HTPasswdIdentityProvider) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.HTPasswdIdentityProvider" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in HTTPServingInfo) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.HTTPServingInfo" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in HubSource) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.HubSource" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in HubSourceStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.HubSourceStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in IBMCloudPlatformSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.IBMCloudPlatformSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in IBMCloudPlatformStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.IBMCloudPlatformStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in IBMCloudServiceEndpoint) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.IBMCloudServiceEndpoint" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in IdentityProvider) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.IdentityProvider" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in IdentityProviderConfig) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.IdentityProviderConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Image) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.Image" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ImageContentPolicy) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ImageContentPolicy" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ImageContentPolicyList) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ImageContentPolicyList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ImageContentPolicySpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ImageContentPolicySpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ImageDigestMirrorSet) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ImageDigestMirrorSet" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ImageDigestMirrorSetList) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ImageDigestMirrorSetList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ImageDigestMirrorSetSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ImageDigestMirrorSetSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ImageDigestMirrorSetStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ImageDigestMirrorSetStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ImageDigestMirrors) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ImageDigestMirrors" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ImageLabel) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ImageLabel" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ImageList) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ImageList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ImagePolicy) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ImagePolicy" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ImagePolicyFulcioCAWithRekorRootOfTrust) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ImagePolicyFulcioCAWithRekorRootOfTrust" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ImagePolicyList) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ImagePolicyList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ImagePolicyPKIRootOfTrust) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ImagePolicyPKIRootOfTrust" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ImagePolicyPublicKeyRootOfTrust) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ImagePolicyPublicKeyRootOfTrust" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ImagePolicySpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ImagePolicySpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ImagePolicyStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ImagePolicyStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ImageSigstoreVerificationPolicy) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ImageSigstoreVerificationPolicy" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ImageSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ImageSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ImageStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ImageStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ImageTagMirrorSet) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ImageTagMirrorSet" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ImageTagMirrorSetList) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ImageTagMirrorSetList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ImageTagMirrorSetSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ImageTagMirrorSetSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ImageTagMirrorSetStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ImageTagMirrorSetStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ImageTagMirrors) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ImageTagMirrors" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Infrastructure) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.Infrastructure" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in InfrastructureList) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.InfrastructureList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in InfrastructureSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.InfrastructureSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in InfrastructureStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.InfrastructureStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Ingress) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.Ingress" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in IngressList) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.IngressList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in IngressPlatformSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.IngressPlatformSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in IngressSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.IngressSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in IngressStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.IngressStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in InsightsDataGather) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.InsightsDataGather" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in InsightsDataGatherList) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.InsightsDataGatherList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in InsightsDataGatherSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.InsightsDataGatherSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in IntermediateTLSProfile) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.IntermediateTLSProfile" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in KMSPluginConfig) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.KMSPluginConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in KeystoneIdentityProvider) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.KeystoneIdentityProvider" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in KubeClientConfig) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.KubeClientConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in KubevirtPlatformSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.KubevirtPlatformSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in KubevirtPlatformStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.KubevirtPlatformStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in LDAPAttributeMapping) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.LDAPAttributeMapping" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in LDAPIdentityProvider) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.LDAPIdentityProvider" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in LeaderElection) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.LeaderElection" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in LoadBalancer) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.LoadBalancer" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in MTUMigration) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.MTUMigration" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in MTUMigrationValues) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.MTUMigrationValues" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in MaxAgePolicy) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.MaxAgePolicy" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ModernTLSProfile) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ModernTLSProfile" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NamedCertificate) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.NamedCertificate" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Network) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.Network" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NetworkDiagnostics) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.NetworkDiagnostics" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NetworkDiagnosticsSourcePlacement) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.NetworkDiagnosticsSourcePlacement" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NetworkDiagnosticsTargetPlacement) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.NetworkDiagnosticsTargetPlacement" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NetworkList) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.NetworkList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NetworkMigration) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.NetworkMigration" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NetworkObservabilitySpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.NetworkObservabilitySpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NetworkSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.NetworkSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NetworkStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.NetworkStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Node) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.Node" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NodeList) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.NodeList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NodeSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.NodeSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NodeStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.NodeStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NutanixFailureDomain) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.NutanixFailureDomain" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NutanixPlatformLoadBalancer) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.NutanixPlatformLoadBalancer" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NutanixPlatformSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.NutanixPlatformSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NutanixPlatformStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.NutanixPlatformStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NutanixPrismElementEndpoint) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.NutanixPrismElementEndpoint" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NutanixPrismEndpoint) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.NutanixPrismEndpoint" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NutanixResourceIdentifier) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.NutanixResourceIdentifier" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OAuth) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.OAuth" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OAuthList) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.OAuthList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OAuthRemoteConnectionInfo) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.OAuthRemoteConnectionInfo" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OAuthSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.OAuthSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OAuthStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.OAuthStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OAuthTemplates) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.OAuthTemplates" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OIDCClientConfig) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.OIDCClientConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OIDCClientReference) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.OIDCClientReference" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OIDCClientStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.OIDCClientStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OIDCProvider) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.OIDCProvider" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ObjectReference) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ObjectReference" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OldTLSProfile) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.OldTLSProfile" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OpenIDClaims) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.OpenIDClaims" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OpenIDIdentityProvider) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.OpenIDIdentityProvider" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OpenStackPlatformLoadBalancer) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.OpenStackPlatformLoadBalancer" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OpenStackPlatformSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.OpenStackPlatformSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OpenStackPlatformStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.OpenStackPlatformStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OperandVersion) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.OperandVersion" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OperatorHub) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.OperatorHub" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OperatorHubList) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.OperatorHubList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OperatorHubSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.OperatorHubSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OperatorHubStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.OperatorHubStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OvirtPlatformLoadBalancer) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.OvirtPlatformLoadBalancer" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OvirtPlatformSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.OvirtPlatformSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OvirtPlatformStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.OvirtPlatformStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PKICertificateSubject) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.PKICertificateSubject" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PersistentVolumeClaimReference) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.PersistentVolumeClaimReference" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PersistentVolumeConfig) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.PersistentVolumeConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PlatformSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.PlatformSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PlatformStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.PlatformStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PolicyFulcioSubject) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.PolicyFulcioSubject" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PolicyIdentity) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.PolicyIdentity" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PolicyMatchExactRepository) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.PolicyMatchExactRepository" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PolicyMatchRemapIdentity) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.PolicyMatchRemapIdentity" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PolicyRootOfTrust) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.PolicyRootOfTrust" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PowerVSPlatformSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.PowerVSPlatformSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PowerVSPlatformStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.PowerVSPlatformStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PowerVSServiceEndpoint) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.PowerVSServiceEndpoint" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PrefixedClaimMapping) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.PrefixedClaimMapping" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ProfileCustomizations) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ProfileCustomizations" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Project) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.Project" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ProjectList) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ProjectList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ProjectSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ProjectSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ProjectStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ProjectStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PromQLClusterCondition) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.PromQLClusterCondition" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Proxy) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.Proxy" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ProxyList) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ProxyList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ProxySpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ProxySpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ProxyStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ProxyStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in RegistryLocation) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.RegistryLocation" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in RegistrySources) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.RegistrySources" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Release) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.Release" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in RemoteConnectionInfo) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.RemoteConnectionInfo" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in RepositoryDigestMirrors) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.RepositoryDigestMirrors" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in RequestHeaderIdentityProvider) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.RequestHeaderIdentityProvider" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in RequiredHSTSPolicy) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.RequiredHSTSPolicy" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Scheduler) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.Scheduler" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in SchedulerList) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.SchedulerList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in SchedulerSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.SchedulerSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in SchedulerStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.SchedulerStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in SecretNameReference) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.SecretNameReference" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ServingInfo) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.ServingInfo" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in SignatureStore) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.SignatureStore" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in SourceURL) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.SourceURL" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in SourcedClaimMapping) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.SourcedClaimMapping" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Storage) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.Storage" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in StringSource) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.StringSource" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in StringSourceSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.StringSourceSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in TLSProfileSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.TLSProfileSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in TLSSecurityProfile) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.TLSSecurityProfile" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in TemplateReference) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.TemplateReference" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in TestDetails) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.TestDetails" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in TestReporting) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.TestReporting" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in TestReportingSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.TestReportingSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in TestReportingStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.TestReportingStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in TokenClaimMapping) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.TokenClaimMapping" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in TokenClaimMappings) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.TokenClaimMappings" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in TokenClaimOrExpressionMapping) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.TokenClaimOrExpressionMapping" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in TokenClaimValidationCELRule) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.TokenClaimValidationCELRule" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in TokenClaimValidationRule) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.TokenClaimValidationRule" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in TokenConfig) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.TokenConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in TokenIssuer) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.TokenIssuer" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in TokenRequiredClaim) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.TokenRequiredClaim" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in TokenUserValidationRule) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.TokenUserValidationRule" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Update) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.Update" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in UpdateHistory) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.UpdateHistory" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in UsernameClaimMapping) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.UsernameClaimMapping" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in UsernamePrefix) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.UsernamePrefix" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in VSphereFailureDomainHostGroup) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.VSphereFailureDomainHostGroup" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in VSphereFailureDomainRegionAffinity) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.VSphereFailureDomainRegionAffinity" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in VSphereFailureDomainZoneAffinity) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.VSphereFailureDomainZoneAffinity" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in VSpherePlatformFailureDomainSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.VSpherePlatformFailureDomainSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in VSpherePlatformLoadBalancer) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.VSpherePlatformLoadBalancer" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in VSpherePlatformNodeNetworking) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.VSpherePlatformNodeNetworking" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in VSpherePlatformNodeNetworkingSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.VSpherePlatformNodeNetworkingSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in VSpherePlatformSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.VSpherePlatformSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in VSpherePlatformStatus) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.VSpherePlatformStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in VSpherePlatformTopology) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.VSpherePlatformTopology" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in VSpherePlatformVCenterSpec) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.VSpherePlatformVCenterSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in VaultAppRoleAuthentication) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.VaultAppRoleAuthentication" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in VaultAuthentication) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.VaultAuthentication" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in VaultConfigMapReference) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.VaultConfigMapReference" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in VaultKMSPluginConfig) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.VaultKMSPluginConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in VaultSecretReference) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.VaultSecretReference" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in VaultTLSConfig) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.VaultTLSConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in WebhookTokenAuthenticator) OpenAPIModelName() string { + return "com.github.openshift.api.config.v1.WebhookTokenAuthenticator" +} diff --git a/apis/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go b/apis/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go index a30061c252c..233971201c2 100644 --- a/apis/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go +++ b/apis/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go @@ -137,7 +137,7 @@ func (GenericAPIServerConfig) SwaggerDoc() map[string]string { } var map_GenericControllerConfig = map[string]string{ - "": "GenericControllerConfig provides information to configure a controller", + "": "GenericControllerConfig provides information to configure a controller\n\nCompatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).", "servingInfo": "servingInfo is the HTTP serving information for the controller's endpoints", "leaderElection": "leaderElection provides information to elect a leader. Only override this if you have a specific need", "authentication": "authentication allows configuration of authentication for the endpoints", @@ -388,6 +388,28 @@ func (AuthenticationStatus) SwaggerDoc() map[string]string { return map_AuthenticationStatus } +var map_ClientCredentialConfig = map[string]string{ + "": "ClientCredentialConfig configures the client credentials and token endpoint to use to get an access token via the OAuth2 client credentials grant flow.", + "clientID": "clientID is a required client identifier to use during the OAuth2 client credentials flow. clientID must be at least 1 character in length, must not exceed 256 characters in length, and must only contain printable ASCII characters.", + "clientSecret": "clientSecret is a required reference to a Secret in the openshift-config namespace to be used as the client secret during the OAuth2 client credentials flow.\n\nThe key 'client-secret' is used to locate the client secret data in the Secret.", + "tokenEndpoint": "tokenEndpoint is a required URL to query for an access token using the client credential OAuth2 flow. tokenEndpoint must be at least 1 character in length and must not exceed 2048 characters in length. tokenEndpoint must be a valid HTTPS URL. tokenEndpoint must have a host and a path. tokenEndpoint must not contain query parameters, fragments, or user information (e.g., \"user:password@host\").", + "scopes": "scopes is an optional list of OAuth2 scopes to request when obtaining an access token.\n\nIf not specified, the token endpoint's default scopes will be used.\n\nWhen specified, there must be at least 1 entry and must not exceed 16 entries. Each entry must be at least 1 character in length and must not exceed 256 characters in length. Each entry must only contain printable ASCII characters, excluding spaces, double quotes and backslashes. Entries must be unique.", + "tls": "tls is an optional field that allows configuring the TLS settings used to interact with the identity provider as an OAuth2 client.\n\nWhen omitted, system default TLS settings will be used for the OAuth2 client.", +} + +func (ClientCredentialConfig) SwaggerDoc() map[string]string { + return map_ClientCredentialConfig +} + +var map_ClientSecretSecretReference = map[string]string{ + "": "ClientSecretSecretReference is a reference to a Secret in the openshift-config namespace that should be used for configuring the client secret to be used when sourcing claims from external sources with the client credential authentication flow.", + "name": "name is the required name of the Secret that exists in the openshift-config namespace.\n\nIt must be at least 1 character in length, must not exceed 253 characters in length, must start and end with a lowercase alphanumeric character, and must only contain lowercase alphanumeric characters, '-' or '.'.", +} + +func (ClientSecretSecretReference) SwaggerDoc() map[string]string { + return map_ClientSecretSecretReference +} + var map_DeprecatedWebhookTokenAuthenticator = map[string]string{ "": "deprecatedWebhookTokenAuthenticator holds the necessary configuration options for a remote token authenticator. It's the same as WebhookTokenAuthenticator but it's missing the 'required' validation on KubeConfig field.", "kubeConfig": "kubeConfig contains kube config file data which describes how to access the remote webhook service. For further details, see: https://kubernetes.io/docs/reference/access-authn-authz/authentication/#webhook-token-authentication The key \"kubeConfig\" is used to locate the data. If the secret or expected key is not found, the webhook is not honored. If the specified kube config data is not valid, the webhook is not honored. The namespace for this secret is determined by the point of use.", @@ -397,6 +419,56 @@ func (DeprecatedWebhookTokenAuthenticator) SwaggerDoc() map[string]string { return map_DeprecatedWebhookTokenAuthenticator } +var map_ExternalClaimsSource = map[string]string{ + "": "ExternalClaimsSource provides the configuration for a single external claim source.", + "authentication": "authentication is an optional field that configures how the apiserver authenticates with an external claims source. When not specified, anonymous authentication is used which means no 'Authorization' header is sent in the HTTP request to fetch the external claims.", + "tls": "tls is an optional field that configures the http client TLS settings when fetching external claims from this source.\n\nWhen omitted, system default TLS settings will be used for fetching claims from the external source.", + "url": "url is a required configuration of the URL for which the external claims are located.", + "mappings": "mappings is a required list of the claim and response handling expression pairs that produces the claims from the external source. mappings must have at least 1 entry and must not exceed 16 entries. Entries must have a unique name across all external claim sources.", + "predicates": "predicates is an optional list of constraints in which claims should attempt to be fetched from this external source.\n\nWhen omitted, claims are always fetched from this external source.\n\nWhen specified, all predicates must evaluate to 'true' before claims are attempted to be fetched from this external source. predicates must have at least 1 entry and must not exceed 16 entries. Entries must have unique expressions.", +} + +func (ExternalClaimsSource) SwaggerDoc() map[string]string { + return map_ExternalClaimsSource +} + +var map_ExternalSourceAuthentication = map[string]string{ + "": "ExternalSourceAuthentication configures how the apiserver should attempt to authenticate with an external claims source.", + "type": "type is a required field that sets the type of authentication method used by the authenticator when fetching external claims.\n\nAllowed values are 'RequestProvidedToken' and 'ClientCredential'.\n\nWhen set to 'RequestProvidedToken', the authenticator will use the token provided to the kube-apiserver as part of the request to authenticate with the external claims source.\n\nWhen set to 'ClientCredential', the authenticator will use the configured client-id, client-secret, and token endpoint to fetch an access token using the OAuth2 client credentials grant flow. The fetched access token will then be used to authenticate with the external claims source.", + "clientCredential": "clientCredential configures the client credentials and token endpoint to use to get an access token. clientCredential is required when type is 'ClientCredential', and forbidden otherwise.", +} + +func (ExternalSourceAuthentication) SwaggerDoc() map[string]string { + return map_ExternalSourceAuthentication +} + +var map_ExternalSourceCertificateAuthorityConfigMapReference = map[string]string{ + "": "ExternalSourceCertificateAuthorityConfigMapReference is a reference to a ConfigMap in the openshift-config namespace that should be used for configuring the certificate authority to be used when sourcing claims from external sources.", + "name": "name is the required name of the ConfigMap that exists in the openshift-config namespace. The key \"ca-bundle.crt\" must be present and must contain the CA certificate to be used to verify the external source's TLS certificate.\n\nIt must be at least 1 character in length, must not exceed 253 characters in length, must start and end with a lowercase alphanumeric character, and must only contain lowercase alphanumeric characters, '-' or '.'.", +} + +func (ExternalSourceCertificateAuthorityConfigMapReference) SwaggerDoc() map[string]string { + return map_ExternalSourceCertificateAuthorityConfigMapReference +} + +var map_ExternalSourcePredicate = map[string]string{ + "": "ExternalSourcePredicate configures a singular condition that must return true before the external source is queried to retrieve external claims.", + "expression": "expression is a required CEL expression that is used to determine whether or not an external source should be used to fetch external claims.\n\nThe expression must return a boolean value, where true means that the source should be consulted and false means that it should not.\n\nClaims from the token used for the request to the kube-apiserver are made available via the `claims` variable.\n\nThe contents of the `claims` variable varies based on the claims that are present in the token being validated. It is the responsibility of those configuring this field to understand what claims the identity provider includes when issuing tokens.\n\nexpression must be at least 1 character and must not exceed 1024 characters in length.", +} + +func (ExternalSourcePredicate) SwaggerDoc() map[string]string { + return map_ExternalSourcePredicate +} + +var map_ExternalSourceTLS = map[string]string{ + "": "ExternalSourceTLS configures the TLS options that the apiserver uses as a client when making a request to the external claim source.", + "certificateAuthority": "certificateAuthority is a required reference to a ConfigMap in the openshift-config namespace that contains the CA certificate to use to validate TLS connections with the external claims source. The key \"ca-bundle.crt\" must be present in the referenced ConfigMap and must contain the CA certificate to be used to verify the external source's TLS certificate.", +} + +func (ExternalSourceTLS) SwaggerDoc() map[string]string { + return map_ExternalSourceTLS +} + var map_ExtraMapping = map[string]string{ "": "ExtraMapping allows specifying a key and CEL expression to evaluate the keys' value. It is used to create additional mappings and attributes added to a cluster identity from a provided authentication token.", "key": "key is a required field that specifies the string to use as the extra attribute key.\n\nkey must be a domain-prefix path (e.g 'example.org/foo'). key must not exceed 510 characters in length. key must contain the '/' character, separating the domain and path characters. key must not be empty.\n\nThe domain portion of the key (string of characters prior to the '/') must be a valid RFC1123 subdomain. It must not exceed 253 characters in length. It must start and end with an alphanumeric character. It must only contain lower case alphanumeric characters and '-' or '.'. It must not use the reserved domains, or be subdomains of, \"kubernetes.io\", \"k8s.io\", and \"openshift.io\".\n\nThe path portion of the key (string of characters after the '/') must not be empty and must consist of at least one alphanumeric character, percent-encoded octets, '-', '.', '_', '~', '!', '$', '&', ''', '(', ')', '*', '+', ',', ';', '=', and ':'. It must not exceed 256 characters in length.", @@ -445,12 +517,13 @@ func (OIDCClientStatus) SwaggerDoc() map[string]string { } var map_OIDCProvider = map[string]string{ - "name": "name is a required field that configures the unique human-readable identifier associated with the identity provider. It is used to distinguish between multiple identity providers and has no impact on token validation or authentication mechanics.\n\nname must not be an empty string (\"\").", - "issuer": "issuer is a required field that configures how the platform interacts with the identity provider and how tokens issued from the identity provider are evaluated by the Kubernetes API server.", - "oidcClients": "oidcClients is an optional field that configures how on-cluster, platform clients should request tokens from the identity provider. oidcClients must not exceed 20 entries and entries must have unique namespace/name pairs.", - "claimMappings": "claimMappings is a required field that configures the rules to be used by the Kubernetes API server for translating claims in a JWT token, issued by the identity provider, to a cluster identity.", - "claimValidationRules": "claimValidationRules is an optional field that configures the rules to be used by the Kubernetes API server for validating the claims in a JWT token issued by the identity provider.\n\nValidation rules are joined via an AND operation.", - "userValidationRules": "userValidationRules is an optional field that configures the set of rules used to validate the cluster user identity that was constructed via mapping token claims to user identity attributes. Rules are CEL expressions that must evaluate to 'true' for authentication to succeed. If any rule in the chain of rules evaluates to 'false', authentication will fail. When specified, at least one rule must be specified and no more than 64 rules may be specified.", + "name": "name is a required field that configures the unique human-readable identifier associated with the identity provider. It is used to distinguish between multiple identity providers and has no impact on token validation or authentication mechanics.\n\nname must not be an empty string (\"\").", + "issuer": "issuer is a required field that configures how the platform interacts with the identity provider and how tokens issued from the identity provider are evaluated by the Kubernetes API server.", + "oidcClients": "oidcClients is an optional field that configures how on-cluster, platform clients should request tokens from the identity provider. oidcClients must not exceed 20 entries and entries must have unique namespace/name pairs.", + "claimMappings": "claimMappings is a required field that configures the rules to be used by the Kubernetes API server for translating claims in a JWT token, issued by the identity provider, to a cluster identity.", + "claimValidationRules": "claimValidationRules is an optional field that configures the rules to be used by the Kubernetes API server for validating the claims in a JWT token issued by the identity provider.\n\nValidation rules are joined via an AND operation.", + "userValidationRules": "userValidationRules is an optional field that configures the set of rules used to validate the cluster user identity that was constructed via mapping token claims to user identity attributes. Rules are CEL expressions that must evaluate to 'true' for authentication to succeed. If any rule in the chain of rules evaluates to 'false', authentication will fail. When specified, at least one rule must be specified and no more than 64 rules may be specified.", + "externalClaimsSources": "externalClaimsSources is an optional field that can be used to configure sources, external to the token provided in a request, in which claims should be fetched from and made available to the claim mapping process that is used to build the identity of a token holder.\n\nFor example, fetching additional user metadata from an OIDC provider's UserInfo endpoint.\n\nWhen not specified, only claims present in the token itself will be available in the claim mapping process.\n\nWhen specified, at least one external claim source must be specified and no more than 5 sources may be specified. All external claim sources must have unique claim mappings. When an external source responds and resolves additional claims successfully, they will be made available as claims during the claim mapping process. Externally sourced claims with the same name as a claim existing within the token will overwrite the claim data from the token with the externally sourced information. If an external source does not respond, responds with an error, or the additional claim data cannot be resolved from the response successfully it will not be included in the claim data passed to the claim mapping process.", } func (OIDCProvider) SwaggerDoc() map[string]string { @@ -459,13 +532,33 @@ func (OIDCProvider) SwaggerDoc() map[string]string { var map_PrefixedClaimMapping = map[string]string{ "": "PrefixedClaimMapping configures a claim mapping that allows for an optional prefix.", - "prefix": "prefix is an optional field that configures the prefix that will be applied to the cluster identity attribute during the process of mapping JWT claims to cluster identity attributes.\n\nWhen omitted (\"\"), no prefix is applied to the cluster identity attribute.\n\nExample: if `prefix` is set to \"myoidc:\" and the `claim` in JWT contains an array of strings \"a\", \"b\" and \"c\", the mapping will result in an array of string \"myoidc:a\", \"myoidc:b\" and \"myoidc:c\".", + "prefix": "prefix is an optional field that configures the prefix that will be applied to the cluster identity attribute during the process of mapping JWT claims to cluster identity attributes.\n\nWhen omitted or set to an empty string (\"\"), no prefix is applied to the cluster identity attribute. Must not be set to a non-empty value when expression is set.\n\nExample: if `prefix` is set to \"myoidc:\" and the `claim` in JWT contains an array of strings \"a\", \"b\" and \"c\", the mapping will result in an array of string \"myoidc:a\", \"myoidc:b\" and \"myoidc:c\".", } func (PrefixedClaimMapping) SwaggerDoc() map[string]string { return map_PrefixedClaimMapping } +var map_SourceURL = map[string]string{ + "": "SourceURL configures the options used to build the URL that is queried for external claims.", + "hostname": "hostname is a required hostname for which the external claims are located.\n\nIt must be a valid DNS subdomain name as per RFC1123.\n\nThis means that it must start and end with a lowercase alphanumeric character, must only consist of lowercase alphanumeric characters, '-', and '.'. hostname may optionally specify a port in the format ':{port}'. If a port is specified it must not exceed 65535.\n\nhostname must be at least 1 character in length. When specifying a port, hostname must not exceed 259 characters in length. When not specifying a port, hostname must not exceed 253 characters in length.", + "pathExpression": "pathExpression is a required CEL expression that returns a list of string values used to construct the URL path. Claims from the token used for the request to the kube-apiserver are made available via the `claims` variable. expression must be at least 1 character in length and must not exceed 1024 characters in length.\n\nValues in the returned list will be joined with the hostname using a forward slash (`/`) as a separator. Values in the returned list do not need to include the forward slash. If a forward slash is included in a returned value, it will be encoded as `%2F`.\n\nExample of a static path configuration:\n\n pathExpression: ['realms', 'k8s', 'protocol', 'openid-connect', 'userinfo']\n\nThe above example would resolve to the path: '/realms/k8s/protocol/openid-connect/userinfo'\n\nExample of a dynamic path configuration:\n\n pathExpression: \"['admin', 'realms', 'k8s', 'users'] + [claims.sub] + ['groups']\"\n\nAssuming 'claims.sub' is set to '12345', the above example would resolve to the path: '/admin/realms/k8s/users/12345/groups'", +} + +func (SourceURL) SwaggerDoc() map[string]string { + return map_SourceURL +} + +var map_SourcedClaimMapping = map[string]string{ + "": "SourcedClaimMapping configures the mapping behavior for a single external claim from the response the apiserver received from the external claim source.", + "name": "name is a required name of the claim that will be produced and made available during the claim-to-identity mapping process. name must consist of only lowercase alpha characters and underscores ('_'). name must be at least 1 character and must not exceed 256 characters in length.", + "expression": "expression is a required CEL expression that will produce a value to be assigned to the claim. The full response body from the request to the external claim source is provided via the `response.body` variable.\n\nThe contents of the `response.body` variable varies based on the response received from the external source. It is the responsibility of those configuring this expression to understand what is returned from the external source.\n\nexpression must be at least 1 character and must not exceed 1024 characters in length.", +} + +func (SourcedClaimMapping) SwaggerDoc() map[string]string { + return map_SourcedClaimMapping +} + var map_TokenClaimMapping = map[string]string{ "": "TokenClaimMapping allows specifying a JWT token claim to be used when mapping claims from an authentication token to cluster identities.", "claim": "claim is an optional field for specifying the JWT token claim that is used in the mapping. The value of this claim will be assigned to the field in which this mapping is associated. claim must not exceed 256 characters in length. When set to the empty string `\"\"`, this means that no named claim should be used for the group mapping. claim is required when the ExternalOIDCWithUpstreamParity feature gate is not enabled.", @@ -550,7 +643,7 @@ func (TokenUserValidationRule) SwaggerDoc() map[string]string { var map_UsernameClaimMapping = map[string]string{ "claim": "claim is an optional field that configures the JWT token claim whose value is assigned to the cluster identity field associated with this mapping. claim is required when the ExternalOIDCWithUpstreamParity feature gate is not enabled. When the ExternalOIDCWithUpstreamParity feature gate is enabled, claim must not be set when expression is set.\n\nclaim must not be an empty string (\"\") and must not exceed 256 characters.", "expression": "expression is an optional CEL expression used to derive the username from JWT claims.\n\nCEL expressions have access to the token claims through a CEL variable, 'claims'.\n\nexpression must be at least 1 character and must not exceed 1024 characters in length. expression must not be set when claim is set.", - "prefixPolicy": "prefixPolicy is an optional field that configures how a prefix should be applied to the value of the JWT claim specified in the 'claim' field.\n\nAllowed values are 'Prefix', 'NoPrefix', and omitted (not provided or an empty string).\n\nWhen set to 'Prefix', the value specified in the prefix field will be prepended to the value of the JWT claim.\n\nThe prefix field must be set when prefixPolicy is 'Prefix'.\n\nWhen set to 'NoPrefix', no prefix will be prepended to the value of the JWT claim.\n\nWhen omitted, this means no opinion and the platform is left to choose any prefixes that are applied which is subject to change over time. Currently, the platform prepends `{issuerURL}#` to the value of the JWT claim when the claim is not 'email'.\n\nAs an example, consider the following scenario:\n\n `prefix` is unset, `issuerURL` is set to `https://myoidc.tld`,\n the JWT claims include \"username\":\"userA\" and \"email\":\"userA@myoidc.tld\",\n and `claim` is set to:\n - \"username\": the mapped value will be \"https://myoidc.tld#userA\"\n - \"email\": the mapped value will be \"userA@myoidc.tld\"", + "prefixPolicy": "prefixPolicy is an optional field that configures how a prefix should be applied to the value of the JWT claim specified in the 'claim' field.\n\nAllowed values are 'Prefix', 'NoPrefix', and omitted (not provided or an empty string).\n\nWhen set to 'Prefix', the value specified in the prefix field will be prepended to the value of the JWT claim. The prefix field must be set when prefixPolicy is 'Prefix'. Must not be set to 'Prefix' when expression is set. When set to 'NoPrefix', no prefix will be prepended to the value of the JWT claim. When omitted, this means no opinion and the platform is left to choose any prefixes that are applied which is subject to change over time. Currently, the platform prepends `{issuerURL}#` to the value of the JWT claim when the claim is not 'email'.\n\nAs an example, consider the following scenario:\n\n `prefix` is unset, `issuerURL` is set to `https://myoidc.tld`,\n the JWT claims include \"username\":\"userA\" and \"email\":\"userA@myoidc.tld\",\n and `claim` is set to:\n - \"username\": the mapped value will be \"https://myoidc.tld#userA\"\n - \"email\": the mapped value will be \"userA@myoidc.tld\"", "prefix": "prefix configures the prefix that should be prepended to the value of the JWT claim.\n\nprefix must be set when prefixPolicy is set to 'Prefix' and must be unset otherwise.", } @@ -986,9 +1079,47 @@ func (ConsoleStatus) SwaggerDoc() map[string]string { return map_ConsoleStatus } +var map_CRIOCredentialProviderConfig = map[string]string{ + "": "CRIOCredentialProviderConfig holds cluster-wide singleton resource configurations for CRI-O credential provider, the name of this instance is \"cluster\". CRI-O credential provider is a binary shipped with CRI-O that provides a way to obtain container image pull credentials from external sources. For example, it can be used to fetch mirror registry credentials from secrets resources in the cluster within the same namespace the pod will be running in. CRIOCredentialProviderConfig configuration specifies the pod image sources registries that should trigger the CRI-O credential provider execution, which will resolve the CRI-O mirror configurations and obtain the necessary credentials for pod creation. Note: Configuration changes will only take effect after the kubelet restarts, which is automatically managed by the cluster during rollout.\n\nThe resource is a singleton named \"cluster\".\n\nCompatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).", + "metadata": "metadata is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "spec": "spec defines the desired configuration of the CRI-O Credential Provider. This field is required and must be provided when creating the resource.", + "status": "status represents the current state of the CRIOCredentialProviderConfig. When omitted or nil, it indicates that the status has not yet been set by the controller. The controller will populate this field with validation conditions and operational state.", +} + +func (CRIOCredentialProviderConfig) SwaggerDoc() map[string]string { + return map_CRIOCredentialProviderConfig +} + +var map_CRIOCredentialProviderConfigList = map[string]string{ + "": "CRIOCredentialProviderConfigList contains a list of CRIOCredentialProviderConfig resources\n\nCompatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).", + "metadata": "metadata is the standard list's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", +} + +func (CRIOCredentialProviderConfigList) SwaggerDoc() map[string]string { + return map_CRIOCredentialProviderConfigList +} + +var map_CRIOCredentialProviderConfigSpec = map[string]string{ + "": "CRIOCredentialProviderConfigSpec defines the desired configuration of the CRI-O Credential Provider.", + "matchImages": "matchImages is a list of string patterns used to determine whether the CRI-O credential provider should be invoked for a given image. This list is passed to the kubelet CredentialProviderConfig, and if any pattern matches the requested image, CRI-O credential provider will be invoked to obtain credentials for pulling that image or its mirrors. Depending on the platform, the CRI-O credential provider may be installed alongside an existing platform specific provider. Conflicts between the existing platform specific provider image match configuration and this list will be handled by the following precedence rule: credentials from built-in kubelet providers (e.g., ECR, GCR, ACR) take precedence over those from the CRIOCredentialProviderConfig when both match the same image. To avoid uncertainty, it is recommended to avoid configuring your private image patterns to overlap with existing platform specific provider config(e.g., the entries from https://github.com/openshift/machine-config-operator/blob/main/templates/common/aws/files/etc-kubernetes-credential-providers-ecr-credential-provider.yaml). You can check the resource's Status conditions to see if any entries were ignored due to exact matches with known built-in provider patterns.\n\nThis field is optional, the items of the list must contain between 1 and 50 entries. The list is treated as a set, so duplicate entries are not allowed.\n\nFor more details, see: https://kubernetes.io/docs/tasks/administer-cluster/kubelet-credential-provider/ https://github.com/cri-o/crio-credential-provider#architecture\n\nEach entry in matchImages is a pattern which can optionally contain a port and a path. Each entry must be no longer than 512 characters. Wildcards ('*') are supported for full subdomain labels, such as '*.k8s.io' or 'k8s.*.io', and for top-level domains, such as 'k8s.*' (which matches 'k8s.io' or 'k8s.net'). A global wildcard '*' (matching any domain) is not allowed. Wildcards may replace an entire hostname label (e.g., *.example.com), but they cannot appear within a label (e.g., f*oo.example.com) and are not allowed in the port or path. For example, 'example.*.com' is valid, but 'exa*mple.*.com' is not. Each wildcard matches only a single domain label, so '*.io' does **not** match '*.k8s.io'.\n\nA match exists between an image and a matchImage when all of the below are true: Both contain the same number of domain parts and each part matches. The URL path of an matchImages must be a prefix of the target image URL path. If the matchImages contains a port, then the port must match in the image as well.\n\nExample values of matchImages: - 123456789.dkr.ecr.us-east-1.amazonaws.com - *.azurecr.io - gcr.io - *.*.registry.io - registry.io:8080/path", +} + +func (CRIOCredentialProviderConfigSpec) SwaggerDoc() map[string]string { + return map_CRIOCredentialProviderConfigSpec +} + +var map_CRIOCredentialProviderConfigStatus = map[string]string{ + "": "CRIOCredentialProviderConfigStatus defines the observed state of CRIOCredentialProviderConfig", + "conditions": "conditions represent the latest available observations of the configuration state. When omitted, it indicates that no conditions have been reported yet. The maximum number of conditions is 16. Conditions are stored as a map keyed by condition type, ensuring uniqueness.\n\nExpected condition types include: \"Validated\": indicates whether the matchImages configuration is valid", +} + +func (CRIOCredentialProviderConfigStatus) SwaggerDoc() map[string]string { + return map_CRIOCredentialProviderConfigStatus +} + var map_AWSDNSSpec = map[string]string{ "": "AWSDNSSpec contains DNS configuration specific to the Amazon Web Services cloud provider.", - "privateZoneIAMRole": "privateZoneIAMRole contains the ARN of an IAM role that should be assumed when performing operations on the cluster's private hosted zone specified in the cluster DNS config. When left empty, no role should be assumed.", + "privateZoneIAMRole": "privateZoneIAMRole contains the ARN of an IAM role that should be assumed when performing operations on the cluster's private hosted zone specified in the cluster DNS config. When left empty, no role should be assumed.\n\nThe ARN must follow the format: arn::iam:::role/, where: is the AWS partition (aws, aws-cn, aws-us-gov, or aws-eusc), is a 12-digit numeric identifier for the AWS account, is the IAM role name.", } func (AWSDNSSpec) SwaggerDoc() map[string]string { @@ -1165,9 +1296,9 @@ func (RegistryLocation) SwaggerDoc() map[string]string { var map_RegistrySources = map[string]string{ "": "RegistrySources holds cluster-wide information about how to handle the registries config.", - "insecureRegistries": "insecureRegistries are registries which do not have a valid TLS certificates or only support HTTP connections.", - "blockedRegistries": "blockedRegistries cannot be used for image pull and push actions. All other registries are permitted.\n\nOnly one of BlockedRegistries or AllowedRegistries may be set.", - "allowedRegistries": "allowedRegistries are the only registries permitted for image pull and push actions. All other registries are denied.\n\nOnly one of BlockedRegistries or AllowedRegistries may be set.", + "insecureRegistries": "insecureRegistries are registries which do not have a valid TLS certificates or only support HTTP connections. Each entry must be a valid registry scope in the format hostname[:port][/path], optionally prefixed with \"*.\" for wildcard subdomains (e.g., \"*.example.com\"). The hostname must consist of valid DNS labels separated by dots, where each label contains only alphanumeric characters and hyphens and does not start or end with a hyphen. Entries must not be empty, must not include tags (e.g., \":latest\") or digests (e.g., \"@sha256:...\"), and must be at most 256 characters in length. The list may contain at most 1024 entries.", + "blockedRegistries": "blockedRegistries cannot be used for image pull and push actions. All other registries are permitted. Each entry must be a valid registry scope in the format hostname[:port][/path], optionally prefixed with \"*.\" for wildcard subdomains (e.g., \"*.example.com\"). The hostname must consist of valid DNS labels separated by dots, where each label contains only alphanumeric characters and hyphens and does not start or end with a hyphen. Entries must not be empty, must not include tags (e.g., \":latest\") or digests (e.g., \"@sha256:...\"), and must be at most 256 characters in length. The list may contain at most 1024 entries.\n\nOnly one of BlockedRegistries or AllowedRegistries may be set.", + "allowedRegistries": "allowedRegistries are the only registries permitted for image pull and push actions. All other registries are denied. Each entry must be a valid registry scope in the format hostname[:port][/path], optionally prefixed with \"*.\" for wildcard subdomains (e.g., \"*.example.com\"). The hostname must consist of valid DNS labels separated by dots, where each label contains only alphanumeric characters and hyphens and does not start or end with a hyphen. Entries must not be empty, must not include tags (e.g., \":latest\") or digests (e.g., \"@sha256:...\"), and must be at most 256 characters in length. The list may contain at most 1024 entries.\n\nOnly one of BlockedRegistries or AllowedRegistries may be set.", "containerRuntimeSearchRegistries": "containerRuntimeSearchRegistries are registries that will be searched when pulling images that do not have fully qualified domains in their pull specs. Registries will be searched in the order provided in the list. Note: this search list only works with the container runtime, i.e CRI-O. Will NOT work with builds or imagestream imports.", } @@ -1567,6 +1698,7 @@ var map_BareMetalPlatformStatus = map[string]string{ "ingressIPs": "ingressIPs are the external IPs which route to the default ingress controller. The IPs are suitable targets of a wildcard DNS record used to resolve default route host names. In dual stack clusters this list contains two IPs otherwise only one.", "nodeDNSIP": "nodeDNSIP is the IP address for the internal DNS used by the nodes. Unlike the one managed by the DNS operator, `NodeDNSIP` provides name resolution for the nodes themselves. There is no DNS-as-a-service for BareMetal deployments. In order to minimize necessary changes to the datacenter DNS, a DNS service is hosted as a static pod to serve those hostnames to the nodes in the cluster.", "loadBalancer": "loadBalancer defines how the load balancer used by the cluster is configured.", + "vipManagement": "vipManagement indicates which VIP management mechanism is active on this cluster. Allowed values are `Keepalived`, `BGP`, and omitted. Once set to a non-empty value, this field is immutable. When set to `BGP`, kube-vip (Routing Table Mode) and frr-k8s are deployed as static pods to advertise VIPs via BGP, replacing the default keepalived/VRRP mechanism. When set to `Keepalived`, the default keepalived-based VIP management is used. When omitted, the default keepalived-based VIP management is used.", "dnsRecordsType": "dnsRecordsType determines whether records for api, api-int, and ingress are provided by the internal DNS service or externally. Allowed values are `Internal`, `External`, and omitted. When set to `Internal`, records are provided by the internal infrastructure and no additional user configuration is required for the cluster to function. When set to `External`, records are not provided by the internal infrastructure and must be configured by the user on a DNS server outside the cluster. Cluster nodes must use this external server for their upstream DNS requests. This value may only be set when loadBalancer.type is set to UserManaged. When omitted, this means the user has no opinion and the platform is left to choose reasonable defaults. These defaults are subject to change over time. The current default is `Internal`.", "machineNetworks": "machineNetworks are IP networks used to connect all the OpenShift cluster nodes.", } @@ -1737,9 +1869,10 @@ func (InfrastructureList) SwaggerDoc() map[string]string { } var map_InfrastructureSpec = map[string]string{ - "": "InfrastructureSpec contains settings that apply to the cluster infrastructure.", - "cloudConfig": "cloudConfig is a reference to a ConfigMap containing the cloud provider configuration file. This configuration file is used to configure the Kubernetes cloud provider integration when using the built-in cloud provider integration or the external cloud controller manager. The namespace for this config map is openshift-config.\n\ncloudConfig should only be consumed by the kube_cloud_config controller. The controller is responsible for using the user configuration in the spec for various platforms and combining that with the user provided ConfigMap in this field to create a stitched kube cloud config. The controller generates a ConfigMap `kube-cloud-config` in `openshift-config-managed` namespace with the kube cloud config is stored in `cloud.conf` key. All the clients are expected to use the generated ConfigMap only.", - "platformSpec": "platformSpec holds desired information specific to the underlying infrastructure provider.", + "": "InfrastructureSpec contains settings that apply to the cluster infrastructure.", + "cloudConfig": "cloudConfig is a reference to a ConfigMap containing the cloud provider configuration file. This configuration file is used to configure the Kubernetes cloud provider integration when using the built-in cloud provider integration or the external cloud controller manager. The namespace for this config map is openshift-config.\n\ncloudConfig should only be consumed by the kube_cloud_config controller. The controller is responsible for using the user configuration in the spec for various platforms and combining that with the user provided ConfigMap in this field to create a stitched kube cloud config. The controller generates a ConfigMap `kube-cloud-config` in `openshift-config-managed` namespace with the kube cloud config is stored in `cloud.conf` key. All the clients are expected to use the generated ConfigMap only.", + "platformSpec": "platformSpec holds desired information specific to the underlying infrastructure provider.", + "controlPlaneTopology": "controlPlaneTopology expresses the desired topology configuration for control nodes.\n\nWhen status.controlPlaneTopology is 'SingleReplica' and spec.controlPlaneTopology is set to 'HighlyAvailable', a transition will be triggered to reconfigure the cluster from SingleReplica to HighlyAvailable.\n\nWhen left blank or status.controlPlaneTopology and spec.controlPlaneTopology are the same value, no changes are required and no transitions will be triggered.\n\nThis value may be set to match status.controlPlaneTopology regardless of the current value.", } func (InfrastructureSpec) SwaggerDoc() map[string]string { @@ -1754,7 +1887,7 @@ var map_InfrastructureStatus = map[string]string{ "etcdDiscoveryDomain": "etcdDiscoveryDomain is the domain used to fetch the SRV records for discovering etcd servers and clients. For more info: https://github.com/etcd-io/etcd/blob/329be66e8b3f9e2e6af83c123ff89297e49ebd15/Documentation/op-guide/clustering.md#dns-discovery deprecated: as of 4.7, this field is no longer set or honored. It will be removed in a future release.", "apiServerURL": "apiServerURL is a valid URI with scheme 'https', address and optionally a port (defaulting to 443). apiServerURL can be used by components like the web console to tell users where to find the Kubernetes API.", "apiServerInternalURI": "apiServerInternalURL is a valid URI with scheme 'https', address and optionally a port (defaulting to 443). apiServerInternalURL can be used by components like kubelets, to contact the Kubernetes API server using the infrastructure provider rather than Kubernetes networking.", - "controlPlaneTopology": "controlPlaneTopology expresses the expectations for operands that normally run on control nodes. The default is 'HighlyAvailable', which represents the behavior operators have in a \"normal\" cluster. The 'SingleReplica' mode will be used in single-node deployments and the operators should not configure the operand for highly-available operation The 'External' mode indicates that the control plane is hosted externally to the cluster and that its components are not visible within the cluster.", + "controlPlaneTopology": "controlPlaneTopology expresses the expectations for operands that normally run on control nodes. The default is 'HighlyAvailable', which represents the behavior operators have in a \"normal\" cluster. The 'SingleReplica' mode will be used in single-node deployments and the operators should not configure the operand for highly-available operation The 'External' mode indicates that the control plane is hosted externally to the cluster and that its components are not visible within the cluster. The 'HighlyAvailableArbiter' mode indicates that the control plane will consist of 2 control-plane nodes that run conventional services and 1 smaller sized arbiter node that runs a bare minimum of services to maintain quorum.", "infrastructureTopology": "infrastructureTopology expresses the expectations for infrastructure services that do not run on control plane nodes, usually indicated by a node selector for a `role` value other than `master`. The default is 'HighlyAvailable', which represents the behavior operators have in a \"normal\" cluster. The 'SingleReplica' mode will be used in single-node deployments and the operators should not configure the operand for highly-available operation NOTE: External topology mode is not applicable for this field.", "cpuPartitioning": "cpuPartitioning expresses if CPU partitioning is a currently enabled feature in the cluster. CPU Partitioning means that this cluster can support partitioning workloads to specific CPU Sets. Valid values are \"None\" and \"AllNodes\". When omitted, the default value is \"None\". The default value of \"None\" indicates that no nodes will be setup with CPU partitioning. The \"AllNodes\" value indicates that all nodes have been setup with CPU partitioning, and can then be further configured via the PerformanceProfile API.", } @@ -2042,7 +2175,7 @@ var map_VSpherePlatformFailureDomainSpec = map[string]string{ "zone": "zone defines the name of a zone tag that will be attached to a vCenter cluster. The tag category in vCenter must be named openshift-zone.", "regionAffinity": "regionAffinity holds the type of region, Datacenter or ComputeCluster. When set to Datacenter, this means the region is a vCenter Datacenter as defined in topology. When set to ComputeCluster, this means the region is a vCenter Cluster as defined in topology.", "zoneAffinity": "zoneAffinity holds the type of the zone and the hostGroup which vmGroup and the hostGroup names in vCenter corresponds to a vm-host group of type Virtual Machine and Host respectively. Is also contains the vmHostRule which is an affinity vm-host rule in vCenter.", - "server": "server is the fully-qualified domain name or the IP address of the vCenter server.", + "server": "server is the fully-qualified domain name or the IP address of the vCenter server. This must match the server field of an entry in the vcenters list. The match is case-sensitive; the value must be specified exactly as it appears in the vcenters entry. The value must be between 1 and 255 characters long.", "topology": "topology describes a given failure domain using vSphere constructs", } @@ -2082,8 +2215,8 @@ func (VSpherePlatformNodeNetworkingSpec) SwaggerDoc() map[string]string { var map_VSpherePlatformSpec = map[string]string{ "": "VSpherePlatformSpec holds the desired state of the vSphere infrastructure provider. In the future the cloud provider operator, storage operator and machine operator will use these fields for configuration.", - "vcenters": "vcenters holds the connection details for services to communicate with vCenter. Currently, only a single vCenter is supported, but in tech preview 3 vCenters are supported. Once the cluster has been installed, you are unable to change the current number of defined vCenters except in the case where the cluster has been upgraded from a version of OpenShift where the vsphere platform spec was not present. You may make modifications to the existing vCenters that are defined in the vcenters list in order to match with any added or modified failure domains.", - "failureDomains": "failureDomains contains the definition of region, zone and the vCenter topology. If this is omitted failure domains (regions and zones) will not be used.", + "vcenters": "vcenters holds the connection details for services to communicate with vCenter. Up to 3 vCenters are supported. Once the cluster has been installed, you are unable to change the current number of defined vCenters except when 1.) the cluster has been upgraded from a version of OpenShift where the vsphere platform spec was not present or 2.) in TechPreview you are able to add and remove vCenters but may not remove all vCenters. You may make modifications to the existing vCenters that are defined in the vcenters list in order to match with any added or modified failure domains.", + "failureDomains": "failureDomains contains the definition of region, zone and the vCenter topology. If this is omitted failure domains (regions and zones) will not be used. Each failure domain's server must match the server field of an entry in the vcenters list.", "nodeNetworking": "nodeNetworking contains the definition of internal and external network constraints for assigning the node's networking. If this field is omitted, networking defaults to the legacy address selection behavior which is to only support a single address and return the first one found.", "apiServerInternalIPs": "apiServerInternalIPs are the IP addresses to contact the Kubernetes API server that can be used by components inside the cluster, like kubelets using the infrastructure rather than Kubernetes networking. These are the IPs for a self-hosted load balancer in front of the API servers. In dual stack clusters this list contains two IP addresses, one from IPv4 family and one from IPv6. In single stack clusters a single IP address is expected. When omitted, values from the status.apiServerInternalIPs will be used. Once set, the list cannot be completely removed (but its second entry can).", "ingressIPs": "ingressIPs are the external IPs which route to the default ingress controller. The IPs are suitable targets of a wildcard DNS record used to resolve default route host names. In dual stack clusters this list contains two IP addresses, one from IPv4 family and one from IPv6. In single stack clusters a single IP address is expected. When omitted, values from the status.ingressIPs will be used. Once set, the list cannot be completely removed (but its second entry can).", @@ -2151,6 +2284,7 @@ var map_ComponentRouteSpec = map[string]string{ "name": "name is the logical name of the route to customize.\n\nThe namespace and name of this componentRoute must match a corresponding entry in the list of status.componentRoutes if the route is to be customized.", "hostname": "hostname is the hostname that should be used by the route.", "servingCertKeyPairSecret": "servingCertKeyPairSecret is a reference to a secret of type `kubernetes.io/tls` in the openshift-config namespace. The serving cert/key pair must match and will be used by the operator to fulfill the intent of serving with this name. If the custom hostname uses the default routing suffix of the cluster, the Secret specification for a serving certificate will not be needed.", + "labels": "labels defines additional labels to be applied to the route created for the component. These labels are used by the IngressController to determine which routes it should manage. Changing labels may cause the route to be reassigned to a different IngressController. When omitted, no additional labels are applied to the component route. When specified, labels must contain at least one entry, up to a maximum of 8. Label keys must be valid qualified names, consisting of a name segment and an optional prefix separated by a slash (/). The name segment must be at most 63 characters in length and must consist only of alphanumeric characters, dashes (-), underscores (_), and dots (.), and must start and end with alphanumeric characters. The prefix, if specified, must be a DNS subdomain: at most 253 characters in length, consisting of dot-separated segments where each segment starts and ends with an alphanumeric character. Label values must be either empty or 1-63 characters, consisting of alphanumeric characters, dashes (-), underscores (_), or dots (.), starting and ending with an alphanumeric character. Keys with the \"kubernetes.io/\", \"k8s.io/\", and \"openshift.io/\" prefixes are reserved and may not be used.", } func (ComponentRouteSpec) SwaggerDoc() map[string]string { @@ -2205,7 +2339,7 @@ func (IngressPlatformSpec) SwaggerDoc() map[string]string { var map_IngressSpec = map[string]string{ "domain": "domain is used to generate a default host name for a route when the route's host name is empty. The generated host name will follow this pattern: \"..\".\n\nIt is also used as the default wildcard domain suffix for ingress. The default ingresscontroller domain will follow this pattern: \"*.\".\n\nOnce set, changing domain is not currently supported.", "appsDomain": "appsDomain is an optional domain to use instead of the one specified in the domain field when a Route is created without specifying an explicit host. If appsDomain is nonempty, this value is used to generate default host values for Route. Unlike domain, appsDomain may be modified after installation. This assumes a new ingresscontroller has been setup with a wildcard certificate.", - "componentRoutes": "componentRoutes is an optional list of routes that are managed by OpenShift components that a cluster-admin is able to configure the hostname and serving certificate for. The namespace and name of each route in this list should match an existing entry in the status.componentRoutes list.\n\nTo determine the set of configurable Routes, look at namespace and name of entries in the .status.componentRoutes list, where participating operators write the status of configurable routes.", + "componentRoutes": "componentRoutes is an optional list of routes that are managed by OpenShift components that a cluster-admin is able to configure the hostname and serving certificate for. The namespace and name of each route in this list should match an existing entry in the status.componentRoutes list.\n\nTo determine the set of configurable Routes, look at namespace and name of entries in the .status.componentRoutes list, where participating operators write the status of configurable routes. A maximum of 250 component routes may be configured.", "requiredHSTSPolicies": "requiredHSTSPolicies specifies HSTS policies that are required to be set on newly created or updated routes matching the domainPattern/s and namespaceSelector/s that are specified in the policy. Each requiredHSTSPolicy must have at least a domainPattern and a maxAge to validate a route HSTS Policy route annotation, and affect route admission.\n\nA candidate route is checked for HSTS Policies if it has the HSTS Policy route annotation: \"haproxy.router.openshift.io/hsts_header\" E.g. haproxy.router.openshift.io/hsts_header: max-age=31536000;preload;includeSubDomains\n\n- For each candidate route, if it matches a requiredHSTSPolicy domainPattern and optional namespaceSelector, then the maxAge, preloadPolicy, and includeSubdomainsPolicy must be valid to be admitted. Otherwise, the route is rejected. - The first match, by domainPattern and optional namespaceSelector, in the ordering of the RequiredHSTSPolicies determines the route's admission status. - If the candidate route doesn't match any requiredHSTSPolicy domainPattern and optional namespaceSelector, then it may use any HSTS Policy annotation.\n\nThe HSTS policy configuration may be changed after routes have already been created. An update to a previously admitted route may then fail if the updated route does not conform to the updated HSTS policy configuration. However, changing the HSTS policy configuration will not cause a route that is already admitted to stop working.\n\nNote that if there are no RequiredHSTSPolicies, any HSTS Policy annotation on the route is valid.", "loadBalancer": "loadBalancer contains the load balancer details in general which are not only specific to the underlying infrastructure provider of the current cluster and are required for Ingress Controller to work on OpenShift.", } @@ -2329,24 +2463,76 @@ func (Storage) SwaggerDoc() map[string]string { return map_Storage } -var map_AWSKMSConfig = map[string]string{ - "": "AWSKMSConfig defines the KMS config specific to AWS KMS provider", - "keyARN": "keyARN specifies the Amazon Resource Name (ARN) of the AWS KMS key used for encryption. The value must adhere to the format `arn:aws:kms:::key/`, where: - `` is the AWS region consisting of lowercase letters and hyphens followed by a number. - `` is a 12-digit numeric identifier for the AWS account. - `` is a unique identifier for the KMS key, consisting of lowercase hexadecimal characters and hyphens.", - "region": "region specifies the AWS region where the KMS instance exists, and follows the format `--`, e.g.: `us-east-1`. Only lowercase letters and hyphens followed by numbers are allowed.", +var map_KMSPluginConfig = map[string]string{ + "": "KMSPluginConfig defines the configuration for the KMS instance that will be used with KMS encryption", + "type": "type defines the kind of platform for the KMS provider. Allowed values are Vault. When set to Vault, the plugin connects to a HashiCorp Vault server for key management.", + "vault": "vault defines the configuration for the Vault KMS plugin. The plugin connects to a Vault Enterprise server that is managed by the user outside the purview of the control plane. This field must be set when type is Vault, and must be unset otherwise.", } -func (AWSKMSConfig) SwaggerDoc() map[string]string { - return map_AWSKMSConfig +func (KMSPluginConfig) SwaggerDoc() map[string]string { + return map_KMSPluginConfig } -var map_KMSConfig = map[string]string{ - "": "KMSConfig defines the configuration for the KMS instance that will be used with KMSEncryptionProvider encryption", - "type": "type defines the kind of platform for the KMS provider. Available provider types are AWS only.", - "aws": "aws defines the key config for using an AWS KMS instance for the encryption. The AWS KMS instance is managed by the user outside the purview of the control plane.", +var map_VaultAppRoleAuthentication = map[string]string{ + "": "VaultAppRoleAuthentication defines the configuration for AppRole authentication with Vault.", + "secret": "secret references a secret in the openshift-config namespace containing the AppRole credentials used to authenticate with Vault. The referenced Secret must contain two keys: \"role-id\" for the AppRole Role ID and \"secret-id\" for the AppRole Secret ID.", } -func (KMSConfig) SwaggerDoc() map[string]string { - return map_KMSConfig +func (VaultAppRoleAuthentication) SwaggerDoc() map[string]string { + return map_VaultAppRoleAuthentication +} + +var map_VaultAuthentication = map[string]string{ + "": "VaultAuthentication defines the authentication method used to authenticate with Vault.", + "type": "type defines the authentication method used to authenticate with Vault. Allowed values are AppRole. When set to AppRole, the plugin uses AppRole credentials to authenticate with Vault.", + "appRole": "appRole defines the configuration for AppRole authentication. This field must be set when type is AppRole, and must be unset otherwise.", +} + +func (VaultAuthentication) SwaggerDoc() map[string]string { + return map_VaultAuthentication +} + +var map_VaultConfigMapReference = map[string]string{ + "": "VaultConfigMapReference references a ConfigMap in the openshift-config namespace.", + "name": "name is the metadata.name of the referenced ConfigMap in the openshift-config namespace. The name must be a valid DNS subdomain name: it must contain no more than 253 characters, contain only lowercase alphanumeric characters, '-' or '.', and start and end with an alphanumeric character.", +} + +func (VaultConfigMapReference) SwaggerDoc() map[string]string { + return map_VaultConfigMapReference +} + +var map_VaultKMSPluginConfig = map[string]string{ + "": "VaultKMSPluginConfig defines the KMS plugin configuration specific to Vault KMS", + "kmsPluginImage": "kmsPluginImage specifies the container image for the HashiCorp Vault KMS plugin.\n\nThe image must be a fully qualified OCI image pull spec with a SHA256 digest. The format is: host[:port][/namespace]/name@sha256: where the digest must be 64 characters long and consist only of lowercase hexadecimal characters, a-f and 0-9. The total length must be between 75 and 447 characters.\n\nShort names (e.g., \"vault-plugin\" or \"hashicorp/vault-plugin\") are not allowed. The registry hostname must be included and must contain at least one dot. Image tags (e.g., \":latest\", \":v1.0.0\") are not allowed.\n\nConsult the OpenShift documentation for compatible plugin versions with your cluster version, then obtain the image digest for that version from HashiCorp's container registry.\n\nFor disconnected environments, mirror the plugin image to an accessible registry and reference the mirrored location with its digest.", + "vaultAddress": "vaultAddress specifies the address of the HashiCorp Vault instance. The value must be a valid HTTPS URL containing only scheme, host, and optional port. Paths, user info, query parameters, and fragments are not allowed.\n\nFormat: https://hostname[:port] Example: https://vault.example.com:8200\n\nThe value must be between 1 and 512 characters.", + "vaultNamespace": "vaultNamespace specifies the Vault namespace where the Transit secrets engine is mounted. This is only applicable for Vault Enterprise installations. When this field is not set, no namespace is used.\n\nThe value must be between 1 and 4096 characters. The namespace cannot end with a forward slash, cannot contain spaces, and cannot be one of the reserved strings: root, sys, audit, auth, cubbyhole, or identity.", + "vaultAuthNamespace": "vaultAuthNamespace specifies the Vault namespace to use for authentication. This is only applicable for Vault Enterprise installations where authentication and Transit operations may be in different namespaces. When this field is not set, the value of vaultNamespace is used for both authentication and Transit key operations.\n\nThe value must be between 1 and 4096 characters. The namespace cannot end with a forward slash, cannot contain spaces, and cannot be one of the reserved strings: root, sys, audit, auth, cubbyhole, or identity.", + "tls": "tls contains the TLS configuration for connecting to the Vault server. When this field is not set, system default TLS settings are used.", + "authentication": "authentication defines the authentication method used to authenticate with Vault.", + "vaultKeyPath": "vaultKeyPath specifies the full path to the encryption key in Vault's Transit secrets engine, combining the Transit engine mount path and the key name separated by \"/keys/\". Format: /keys/ (e.g., transit/keys/my-key, myteam/transit/keys/production-key).\n\nThe total path length must be between 8 and 1542 characters. The path cannot start or end with a forward slash, cannot contain consecutive forward slashes, must only contain RFC 3986 unreserved characters (alphanumeric, hyphen, period, underscore, tilde) and forward slashes as path separators, and must not contain \".\" or \"..\" path segments. The key name must start and end with an alphanumeric character or underscore, and may contain alphanumeric characters, underscores, hyphens, and periods in the middle.", +} + +func (VaultKMSPluginConfig) SwaggerDoc() map[string]string { + return map_VaultKMSPluginConfig +} + +var map_VaultSecretReference = map[string]string{ + "": "VaultSecretReference references a secret in the openshift-config namespace.", + "name": "name is the metadata.name of the referenced secret in the openshift-config namespace. The name must be a valid DNS subdomain name: it must contain no more than 253 characters, contain only lowercase alphanumeric characters, '-' or '.', and start and end with an alphanumeric character.", +} + +func (VaultSecretReference) SwaggerDoc() map[string]string { + return map_VaultSecretReference +} + +var map_VaultTLSConfig = map[string]string{ + "": "VaultTLSConfig contains TLS configuration for connecting to Vault.", + "caBundle": "caBundle references a ConfigMap in the openshift-config namespace containing the CA certificate bundle used to verify the TLS connection to the Vault server. The referenced ConfigMap must contain the CA bundle in the key \"ca-bundle.crt\". When this field is not set, the system's trusted CA certificates are used.\n\nThe namespace for the ConfigMap is openshift-config.\n\nExample ConfigMap:\n apiVersion: v1\n kind: ConfigMap\n metadata:\n name: vault-ca-bundle\n namespace: openshift-config\n data:\n ca-bundle.crt: |", + "serverName": "serverName specifies the Server Name Indication (SNI) to use when connecting to Vault via TLS. This is useful when the Vault server's hostname doesn't match its TLS certificate. When this field is not set, the hostname from vaultAddress is used for SNI.\n\nThe value must be a valid DNS hostname: it must contain no more than 253 characters, contain only lowercase alphanumeric characters, '-' or '.', and start and end with an alphanumeric character.", +} + +func (VaultTLSConfig) SwaggerDoc() map[string]string { + return map_VaultTLSConfig } var map_ClusterNetworkEntry = map[string]string{ @@ -2459,6 +2645,15 @@ func (NetworkMigration) SwaggerDoc() map[string]string { return map_NetworkMigration } +var map_NetworkObservabilitySpec = map[string]string{ + "": "NetworkObservabilitySpec defines the configuration for network observability installation", + "installationPolicy": "installationPolicy controls whether network observability is installed during cluster deployment. Valid values are \"InstallAndEnable\" and \"NoAction\". When set to \"InstallAndEnable\", ensure that network observability will be installed and enabled on the cluster. If already installed, no action taken, but if it gets uninstalled, it will install it again. When set to \"NoAction\", nothing will be done regarding Network observability. During the installation of NetworkObservability, the platform checks for any existing manual installations. If a successful installation using the OLMv0 or OLMv1 API is detected, it will be used. If the platform cannot determine how the current version was installed, or if the existing installation is incomplete, the installation process will stop.", +} + +func (NetworkObservabilitySpec) SwaggerDoc() map[string]string { + return map_NetworkObservabilitySpec +} + var map_NetworkSpec = map[string]string{ "": "NetworkSpec is the desired network configuration. As a general rule, this SHOULD NOT be read directly. Instead, you should consume the NetworkStatus, as it indicates the currently deployed configuration. Currently, most spec fields are immutable after installation. Please view the individual ones for further details on each.", "clusterNetwork": "IP address pool to use for pod IPs. This field is immutable after installation.", @@ -2467,6 +2662,7 @@ var map_NetworkSpec = map[string]string{ "externalIP": "externalIP defines configuration for controllers that affect Service.ExternalIP. If nil, then ExternalIP is not allowed to be set.", "serviceNodePortRange": "The port range allowed for Services of type NodePort. If not specified, the default of 30000-32767 will be used. Such Services without a NodePort specified will have one automatically allocated from this range. This parameter can be updated after the cluster is installed.", "networkDiagnostics": "networkDiagnostics defines network diagnostics configuration.\n\nTakes precedence over spec.disableNetworkDiagnostics in network.operator.openshift.io. If networkDiagnostics is not specified or is empty, and the spec.disableNetworkDiagnostics flag in network.operator.openshift.io is set to true, the network diagnostics feature will be disabled.", + "networkObservability": "networkObservability is an optional field that configures network observability installation during cluster deployment (day-0). When omitted, unless this is a SNO cluster, network observability will be installed if not already present, after that, no action taken.", } func (NetworkSpec) SwaggerDoc() map[string]string { @@ -3009,6 +3205,7 @@ func (OldTLSProfile) SwaggerDoc() map[string]string { var map_TLSProfileSpec = map[string]string{ "": "TLSProfileSpec is the desired behavior of a TLSSecurityProfile.", "ciphers": "ciphers is used to specify the cipher algorithms that are negotiated during the TLS handshake. Operators may remove entries that their operands do not support. For example, to use only ECDHE-RSA-AES128-GCM-SHA256 (yaml):\n\n ciphers:\n - ECDHE-RSA-AES128-GCM-SHA256\n\nTLS 1.3 cipher suites (e.g. TLS_AES_128_GCM_SHA256) are not configurable and are always enabled when TLS 1.3 is negotiated.", + "groups": "groups is an optional, ordered field used to specify the supported groups (formerly known as elliptic curves) that are used during the TLS handshake. The order of the groups represents a suggested preference, with the most preferred group first. Note that not all platform components honor the ordering: Go-based components use Go's internal preference order and treat this list as a filter of allowed groups rather than an ordered preference. Operators may remove entries their operands do not support.\n\nWhen omitted, this means no opinion and the platform is left to choose reasonable defaults which are subject to change over time and may be different per platform component depending on the underlying TLS libraries they use. If specified, the list must contain at least one and at most 7 groups, and each group must be unique.\n\nFor example, to use X25519 and secp256r1 (yaml):\n\n groups:\n - X25519\n - secp256r1", "minTLSVersion": "minTLSVersion is used to specify the minimal version of the TLS protocol that is negotiated during the TLS handshake. For example, to use TLS versions 1.1, 1.2 and 1.3 (yaml):\n\n minTLSVersion: VersionTLS11", } @@ -3018,11 +3215,11 @@ func (TLSProfileSpec) SwaggerDoc() map[string]string { var map_TLSSecurityProfile = map[string]string{ "": "TLSSecurityProfile defines the schema for a TLS security profile. This object is used by operators to apply TLS security settings to operands.", - "type": "type is one of Old, Intermediate, Modern or Custom. Custom provides the ability to specify individual TLS security profile parameters.\n\nThe profiles are based on version 5.7 of the Mozilla Server Side TLS configuration guidelines. The cipher lists consist of the configuration's \"ciphersuites\" followed by the Go-specific \"ciphers\" from the guidelines. See: https://ssl-config.mozilla.org/guidelines/5.7.json\n\nThe profiles are intent based, so they may change over time as new ciphers are developed and existing ciphers are found to be insecure. Depending on precisely which ciphers are available to a process, the list may be reduced.", - "old": "old is a TLS profile for use when services need to be accessed by very old clients or libraries and should be used only as a last resort.\n\nThis profile is equivalent to a Custom profile specified as:\n minTLSVersion: VersionTLS10\n ciphers:\n - TLS_AES_128_GCM_SHA256\n - TLS_AES_256_GCM_SHA384\n - TLS_CHACHA20_POLY1305_SHA256\n - ECDHE-ECDSA-AES128-GCM-SHA256\n - ECDHE-RSA-AES128-GCM-SHA256\n - ECDHE-ECDSA-AES256-GCM-SHA384\n - ECDHE-RSA-AES256-GCM-SHA384\n - ECDHE-ECDSA-CHACHA20-POLY1305\n - ECDHE-RSA-CHACHA20-POLY1305\n - ECDHE-ECDSA-AES128-SHA256\n - ECDHE-RSA-AES128-SHA256\n - ECDHE-ECDSA-AES128-SHA\n - ECDHE-RSA-AES128-SHA\n - ECDHE-ECDSA-AES256-SHA\n - ECDHE-RSA-AES256-SHA\n - AES128-GCM-SHA256\n - AES256-GCM-SHA384\n - AES128-SHA256\n - AES128-SHA\n - AES256-SHA\n - DES-CBC3-SHA", - "intermediate": "intermediate is a TLS profile for use when you do not need compatibility with legacy clients and want to remain highly secure while being compatible with most clients currently in use.\n\nThis profile is equivalent to a Custom profile specified as:\n minTLSVersion: VersionTLS12\n ciphers:\n - TLS_AES_128_GCM_SHA256\n - TLS_AES_256_GCM_SHA384\n - TLS_CHACHA20_POLY1305_SHA256\n - ECDHE-ECDSA-AES128-GCM-SHA256\n - ECDHE-RSA-AES128-GCM-SHA256\n - ECDHE-ECDSA-AES256-GCM-SHA384\n - ECDHE-RSA-AES256-GCM-SHA384\n - ECDHE-ECDSA-CHACHA20-POLY1305\n - ECDHE-RSA-CHACHA20-POLY1305", - "modern": "modern is a TLS security profile for use with clients that support TLS 1.3 and do not need backward compatibility for older clients.\n\nThis profile is equivalent to a Custom profile specified as:\n minTLSVersion: VersionTLS13\n ciphers:\n - TLS_AES_128_GCM_SHA256\n - TLS_AES_256_GCM_SHA384\n - TLS_CHACHA20_POLY1305_SHA256", - "custom": "custom is a user-defined TLS security profile. Be extremely careful using a custom profile as invalid configurations can be catastrophic. An example custom profile looks like this:\n\n minTLSVersion: VersionTLS11\n ciphers:\n - ECDHE-ECDSA-CHACHA20-POLY1305\n - ECDHE-RSA-CHACHA20-POLY1305\n - ECDHE-RSA-AES128-GCM-SHA256\n - ECDHE-ECDSA-AES128-GCM-SHA256", + "type": "type is one of Old, Intermediate, Modern or Custom. Custom provides the ability to specify individual TLS security profile parameters.\n\nThe cipher and groups lists in these profiles are based on version 5.8 of the Mozilla Server Side TLS configuration guidelines. See: https://ssl-config.mozilla.org/guidelines/5.8.json\n\nThe groups are listed in suggested preference order, with the most preferred group first. Note that not all platform components honor the ordering: Go-based components use Go's internal preference order and treat this list as a filter of allowed groups rather than an ordered preference. Note that X25519MLKEM768 is a post-quantum hybrid group that is not FIPS-approved and should be ignored by components running in FIPS mode.\n\nThe profiles are intent based, so they may change over time as new ciphers are developed and existing ciphers are found to be insecure. Depending on precisely which ciphers are available to a process, the list may be reduced.", + "old": "old is a TLS profile for use when services need to be accessed by very old clients or libraries and should be used only as a last resort.\n\nThe supported groups list includes by default the following groups in suggested preference order (ordering may not be honored by all implementations): X25519MLKEM768, X25519, secp256r1, secp384r1.\n\nThis profile is equivalent to a Custom profile specified as:\n minTLSVersion: VersionTLS10\n ciphers:\n - TLS_AES_128_GCM_SHA256\n - TLS_AES_256_GCM_SHA384\n - TLS_CHACHA20_POLY1305_SHA256\n - ECDHE-ECDSA-AES128-GCM-SHA256\n - ECDHE-RSA-AES128-GCM-SHA256\n - ECDHE-ECDSA-AES256-GCM-SHA384\n - ECDHE-RSA-AES256-GCM-SHA384\n - ECDHE-ECDSA-CHACHA20-POLY1305\n - ECDHE-RSA-CHACHA20-POLY1305\n - ECDHE-ECDSA-AES128-SHA256\n - ECDHE-RSA-AES128-SHA256\n - ECDHE-ECDSA-AES128-SHA\n - ECDHE-RSA-AES128-SHA\n - ECDHE-ECDSA-AES256-SHA384\n - ECDHE-RSA-AES256-SHA384\n - ECDHE-ECDSA-AES256-SHA\n - ECDHE-RSA-AES256-SHA\n - AES128-GCM-SHA256\n - AES256-GCM-SHA384\n - AES128-SHA256\n - AES256-SHA256\n - AES128-SHA\n - AES256-SHA\n - DES-CBC3-SHA", + "intermediate": "intermediate is a TLS profile for use when you do not need compatibility with legacy clients and want to remain highly secure while being compatible with most clients currently in use.\n\nThe supported groups list includes by default the following groups in suggested preference order (ordering may not be honored by all implementations): X25519MLKEM768, X25519, secp256r1, secp384r1.\n\nThis profile is equivalent to a Custom profile specified as:\n minTLSVersion: VersionTLS12\n ciphers:\n - TLS_AES_128_GCM_SHA256\n - TLS_AES_256_GCM_SHA384\n - TLS_CHACHA20_POLY1305_SHA256\n - ECDHE-ECDSA-AES128-GCM-SHA256\n - ECDHE-RSA-AES128-GCM-SHA256\n - ECDHE-ECDSA-AES256-GCM-SHA384\n - ECDHE-RSA-AES256-GCM-SHA384\n - ECDHE-ECDSA-CHACHA20-POLY1305\n - ECDHE-RSA-CHACHA20-POLY1305", + "modern": "modern is a TLS security profile for use with clients that support TLS 1.3 and do not need backward compatibility for older clients. The supported groups list includes by default the following groups in suggested preference order (ordering may not be honored by all implementations): X25519MLKEM768, X25519, secp256r1, secp384r1. This profile is equivalent to a Custom profile specified as:\n minTLSVersion: VersionTLS13\n ciphers:\n - TLS_AES_128_GCM_SHA256\n - TLS_AES_256_GCM_SHA384\n - TLS_CHACHA20_POLY1305_SHA256", + "custom": "custom is a user-defined TLS security profile. Be extremely careful using a custom profile as invalid configurations can be catastrophic.\n\nThe supported groups list for this profile is empty by default.\n\nAn example custom profile looks like this:\n\n minTLSVersion: VersionTLS11\n ciphers:\n - ECDHE-ECDSA-CHACHA20-POLY1305\n - ECDHE-RSA-CHACHA20-POLY1305\n - ECDHE-RSA-AES128-GCM-SHA256\n - ECDHE-ECDSA-AES128-GCM-SHA256", } func (TLSSecurityProfile) SwaggerDoc() map[string]string { diff --git a/apis/vendor/github.com/openshift/api/machine/v1/doc.go b/apis/vendor/github.com/openshift/api/machine/v1/doc.go index 7bd97c95072..ceddf5bd77c 100644 --- a/apis/vendor/github.com/openshift/api/machine/v1/doc.go +++ b/apis/vendor/github.com/openshift/api/machine/v1/doc.go @@ -1,6 +1,7 @@ // +k8s:deepcopy-gen=package,register // +k8s:defaulter-gen=TypeMeta // +k8s:openapi-gen=true +// +k8s:openapi-model-package=com.github.openshift.api.machine.v1 // +kubebuilder:validation:Optional // +groupName=machine.openshift.io diff --git a/apis/vendor/github.com/openshift/api/machine/v1/zz_generated.model_name.go b/apis/vendor/github.com/openshift/api/machine/v1/zz_generated.model_name.go new file mode 100644 index 00000000000..11bf44a9093 --- /dev/null +++ b/apis/vendor/github.com/openshift/api/machine/v1/zz_generated.model_name.go @@ -0,0 +1,211 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +// Code generated by codegen. DO NOT EDIT. + +package v1 + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AWSFailureDomain) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.AWSFailureDomain" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AWSFailureDomainPlacement) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.AWSFailureDomainPlacement" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AWSResourceFilter) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.AWSResourceFilter" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AWSResourceReference) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.AWSResourceReference" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AlibabaCloudMachineProviderConfig) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.AlibabaCloudMachineProviderConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AlibabaCloudMachineProviderConfigList) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.AlibabaCloudMachineProviderConfigList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AlibabaCloudMachineProviderStatus) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.AlibabaCloudMachineProviderStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AlibabaResourceReference) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.AlibabaResourceReference" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AzureFailureDomain) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.AzureFailureDomain" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in BandwidthProperties) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.BandwidthProperties" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ControlPlaneMachineSet) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.ControlPlaneMachineSet" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ControlPlaneMachineSetList) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.ControlPlaneMachineSetList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ControlPlaneMachineSetSpec) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.ControlPlaneMachineSetSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ControlPlaneMachineSetStatus) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.ControlPlaneMachineSetStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ControlPlaneMachineSetStrategy) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.ControlPlaneMachineSetStrategy" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ControlPlaneMachineSetTemplate) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.ControlPlaneMachineSetTemplate" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ControlPlaneMachineSetTemplateObjectMeta) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.ControlPlaneMachineSetTemplateObjectMeta" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DataDiskProperties) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.DataDiskProperties" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in FailureDomains) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.FailureDomains" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in GCPFailureDomain) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.GCPFailureDomain" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in LoadBalancerReference) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.LoadBalancerReference" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NutanixCategory) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.NutanixCategory" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NutanixFailureDomainReference) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.NutanixFailureDomainReference" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NutanixGPU) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.NutanixGPU" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NutanixMachineProviderConfig) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.NutanixMachineProviderConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NutanixMachineProviderStatus) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.NutanixMachineProviderStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NutanixResourceIdentifier) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.NutanixResourceIdentifier" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NutanixStorageResourceIdentifier) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.NutanixStorageResourceIdentifier" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NutanixVMDisk) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.NutanixVMDisk" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NutanixVMDiskDeviceProperties) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.NutanixVMDiskDeviceProperties" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NutanixVMStorageConfig) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.NutanixVMStorageConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OpenShiftMachineV1Beta1MachineTemplate) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.OpenShiftMachineV1Beta1MachineTemplate" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OpenStackFailureDomain) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.OpenStackFailureDomain" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PowerVSMachineProviderConfig) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.PowerVSMachineProviderConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PowerVSMachineProviderStatus) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.PowerVSMachineProviderStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PowerVSResource) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.PowerVSResource" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PowerVSSecretReference) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.PowerVSSecretReference" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in RootVolume) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.RootVolume" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in SystemDiskProperties) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.SystemDiskProperties" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Tag) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.Tag" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in VSphereFailureDomain) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1.VSphereFailureDomain" +} diff --git a/apis/vendor/github.com/openshift/api/machine/v1beta1/doc.go b/apis/vendor/github.com/openshift/api/machine/v1beta1/doc.go index e14fc64e329..5c992f6923e 100644 --- a/apis/vendor/github.com/openshift/api/machine/v1beta1/doc.go +++ b/apis/vendor/github.com/openshift/api/machine/v1beta1/doc.go @@ -1,6 +1,7 @@ // +k8s:deepcopy-gen=package,register // +k8s:defaulter-gen=TypeMeta // +k8s:openapi-gen=true +// +k8s:openapi-model-package=com.github.openshift.api.machine.v1beta1 // +kubebuilder:validation:Optional // +groupName=machine.openshift.io diff --git a/apis/vendor/github.com/openshift/api/machine/v1beta1/types_machineset.go b/apis/vendor/github.com/openshift/api/machine/v1beta1/types_machineset.go index be5476344b1..cbbe0b337ca 100644 --- a/apis/vendor/github.com/openshift/api/machine/v1beta1/types_machineset.go +++ b/apis/vendor/github.com/openshift/api/machine/v1beta1/types_machineset.go @@ -129,6 +129,14 @@ type MachineSetStatus struct { // observedGeneration reflects the generation of the most recently observed MachineSet. // +optional ObservedGeneration int64 `json:"observedGeneration,omitempty"` + // labelSelector is a label selector, in string format, for Machines corresponding to the MachineSet. + // It is exposed via the scale subresource as status.selector. + // When omitted, the MachineSet controller has not yet reconciled spec.selector into status.labelSelector. + // When present, it must not be empty and must not exceed 4096 characters. + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=4096 + // +optional + LabelSelector string `json:"labelSelector,omitempty"` // In the event that there is a terminal problem reconciling the // replicas, both ErrorReason and ErrorMessage will be set. ErrorReason // will be populated with a succinct value suitable for machine diff --git a/apis/vendor/github.com/openshift/api/machine/v1beta1/zz_generated.model_name.go b/apis/vendor/github.com/openshift/api/machine/v1beta1/zz_generated.model_name.go new file mode 100644 index 00000000000..fe84d447fd5 --- /dev/null +++ b/apis/vendor/github.com/openshift/api/machine/v1beta1/zz_generated.model_name.go @@ -0,0 +1,376 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +// Code generated by codegen. DO NOT EDIT. + +package v1beta1 + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AWSMachineProviderConfig) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.AWSMachineProviderConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AWSMachineProviderConfigList) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.AWSMachineProviderConfigList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AWSMachineProviderStatus) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.AWSMachineProviderStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AWSResourceReference) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.AWSResourceReference" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AddressesFromPool) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.AddressesFromPool" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AzureBootDiagnostics) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.AzureBootDiagnostics" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AzureCustomerManagedBootDiagnostics) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.AzureCustomerManagedBootDiagnostics" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AzureDiagnostics) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.AzureDiagnostics" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AzureMachineProviderSpec) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.AzureMachineProviderSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AzureMachineProviderStatus) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.AzureMachineProviderStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in BlockDeviceMappingSpec) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.BlockDeviceMappingSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CPUOptions) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.CPUOptions" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Condition) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.Condition" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ConfidentialVM) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.ConfidentialVM" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DataDisk) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.DataDisk" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DataDiskManagedDiskParameters) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.DataDiskManagedDiskParameters" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DedicatedHost) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.DedicatedHost" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DedicatedHostStatus) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.DedicatedHostStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DiskEncryptionSetParameters) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.DiskEncryptionSetParameters" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DiskSettings) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.DiskSettings" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DynamicHostAllocationSpec) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.DynamicHostAllocationSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in EBSBlockDeviceSpec) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.EBSBlockDeviceSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Filter) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.Filter" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in GCPDisk) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.GCPDisk" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in GCPEncryptionKeyReference) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.GCPEncryptionKeyReference" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in GCPGPUConfig) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.GCPGPUConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in GCPKMSKeyReference) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.GCPKMSKeyReference" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in GCPMachineProviderSpec) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.GCPMachineProviderSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in GCPMachineProviderStatus) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.GCPMachineProviderStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in GCPMetadata) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.GCPMetadata" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in GCPNetworkInterface) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.GCPNetworkInterface" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in GCPServiceAccount) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.GCPServiceAccount" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in GCPShieldedInstanceConfig) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.GCPShieldedInstanceConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in HostPlacement) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.HostPlacement" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Image) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.Image" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in LastOperation) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.LastOperation" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in LifecycleHook) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.LifecycleHook" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in LifecycleHooks) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.LifecycleHooks" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in LoadBalancerReference) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.LoadBalancerReference" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Machine) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.Machine" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in MachineHealthCheck) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.MachineHealthCheck" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in MachineHealthCheckList) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.MachineHealthCheckList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in MachineHealthCheckSpec) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.MachineHealthCheckSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in MachineHealthCheckStatus) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.MachineHealthCheckStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in MachineList) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.MachineList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in MachineSet) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.MachineSet" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in MachineSetList) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.MachineSetList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in MachineSetSpec) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.MachineSetSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in MachineSetStatus) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.MachineSetStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in MachineSpec) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.MachineSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in MachineStatus) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.MachineStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in MachineTemplateSpec) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.MachineTemplateSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in MetadataServiceOptions) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.MetadataServiceOptions" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NetworkDeviceSpec) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.NetworkDeviceSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NetworkSpec) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.NetworkSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OSDisk) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.OSDisk" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OSDiskManagedDiskParameters) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.OSDiskManagedDiskParameters" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ObjectMeta) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.ObjectMeta" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Placement) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.Placement" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ProviderSpec) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.ProviderSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ResourceManagerTag) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.ResourceManagerTag" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in SecurityProfile) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.SecurityProfile" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in SecuritySettings) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.SecuritySettings" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in SpotMarketOptions) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.SpotMarketOptions" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in SpotVMOptions) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.SpotVMOptions" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in TagSpecification) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.TagSpecification" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in TrustedLaunch) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.TrustedLaunch" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in UEFISettings) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.UEFISettings" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in UnhealthyCondition) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.UnhealthyCondition" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in VMDiskSecurityProfile) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.VMDiskSecurityProfile" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in VSphereDisk) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.VSphereDisk" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in VSphereMachineProviderSpec) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.VSphereMachineProviderSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in VSphereMachineProviderStatus) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.VSphereMachineProviderStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Workspace) OpenAPIModelName() string { + return "com.github.openshift.api.machine.v1beta1.Workspace" +} diff --git a/apis/vendor/github.com/openshift/api/machine/v1beta1/zz_generated.swagger_doc_generated.go b/apis/vendor/github.com/openshift/api/machine/v1beta1/zz_generated.swagger_doc_generated.go index 2c4a9030cc9..e686cad25a6 100644 --- a/apis/vendor/github.com/openshift/api/machine/v1beta1/zz_generated.swagger_doc_generated.go +++ b/apis/vendor/github.com/openshift/api/machine/v1beta1/zz_generated.swagger_doc_generated.go @@ -748,6 +748,7 @@ var map_MachineSetStatus = map[string]string{ "readyReplicas": "The number of ready replicas for this MachineSet. A machine is considered ready when the node has been created and is \"Ready\".", "availableReplicas": "The number of available replicas (ready for at least minReadySeconds) for this MachineSet.", "observedGeneration": "observedGeneration reflects the generation of the most recently observed MachineSet.", + "labelSelector": "labelSelector is a label selector, in string format, for Machines corresponding to the MachineSet. It is exposed via the scale subresource as status.selector. When omitted, the MachineSet controller has not yet reconciled spec.selector into status.labelSelector. When present, it must not be empty and must not exceed 4096 characters.", "errorReason": "In the event that there is a terminal problem reconciling the replicas, both ErrorReason and ErrorMessage will be set. ErrorReason will be populated with a succinct value suitable for machine interpretation, while ErrorMessage will contain a more verbose string suitable for logging and human consumption.\n\nThese fields should not be set for transitive errors that a controller faces that are expected to be fixed automatically over time (like service outages), but instead indicate that something is fundamentally wrong with the MachineTemplate's spec or the configuration of the machine controller, and that manual intervention is required. Examples of terminal errors would be invalid combinations of settings in the spec, values that are unsupported by the machine controller, or the responsible machine controller itself being critically misconfigured.\n\nAny transient errors that occur during the reconciliation of Machines can be added as events to the MachineSet object and/or logged in the controller's output.", "conditions": "conditions defines the current state of the MachineSet", "authoritativeAPI": "authoritativeAPI is the API that is authoritative for this resource. Valid values are MachineAPI, ClusterAPI and Migrating. This value is updated by the migration controller to reflect the authoritative API. Machine API and Cluster API controllers use this value to determine whether or not to reconcile the resource. When set to Migrating, the migration controller is currently performing the handover of authority from one API to the other.", diff --git a/apis/vendor/github.com/openshift/api/operator/v1/doc.go b/apis/vendor/github.com/openshift/api/operator/v1/doc.go index 3de961a7fc2..1aa50336ad6 100644 --- a/apis/vendor/github.com/openshift/api/operator/v1/doc.go +++ b/apis/vendor/github.com/openshift/api/operator/v1/doc.go @@ -1,6 +1,7 @@ // +k8s:deepcopy-gen=package,register // +k8s:defaulter-gen=TypeMeta // +k8s:openapi-gen=true +// +k8s:openapi-model-package=com.github.openshift.api.operator.v1 // +kubebuilder:validation:Optional // +groupName=operator.openshift.io diff --git a/apis/vendor/github.com/openshift/api/operator/v1/types.go b/apis/vendor/github.com/openshift/api/operator/v1/types.go index 3a2141abb98..599ceb03e10 100644 --- a/apis/vendor/github.com/openshift/api/operator/v1/types.go +++ b/apis/vendor/github.com/openshift/api/operator/v1/types.go @@ -266,6 +266,18 @@ type NodeStatus struct { // +required NodeName string `json:"nodeName"` + // nodeUID is the UID of the node. + // This field is used to detect that a node has been deleted and recreated + // with the same name. When the UID changes, it indicates the node is a + // new instance and the controller should treat this status entry as stale. + // When omitted, UID-based node replacement detection is not available + // for this entry. + // +kubebuilder:validation:MinLength=36 + // +kubebuilder:validation:MaxLength=36 + // +kubebuilder:validation:Format=uuid + // +optional + NodeUID string `json:"nodeUID,omitempty"` + // currentRevision is the generation of the most recently successful deployment. // Can not be set on creation of a nodeStatus. Updates must only increase the value. // +kubebuilder:validation:XValidation:rule="self >= oldSelf",message="must only increase" diff --git a/apis/vendor/github.com/openshift/api/operator/v1/types_authentication.go b/apis/vendor/github.com/openshift/api/operator/v1/types_authentication.go index 7cc22d1e4e3..55fc62a7915 100644 --- a/apis/vendor/github.com/openshift/api/operator/v1/types_authentication.go +++ b/apis/vendor/github.com/openshift/api/operator/v1/types_authentication.go @@ -33,6 +33,94 @@ type Authentication struct { type AuthenticationSpec struct { OperatorSpec `json:",inline"` + + // proxy configures proxy settings for outbound connections made + // by the authentication stack. When set, it replaces the + // cluster-wide proxy (proxy.config.openshift.io/cluster) + // entirely for authentication — individual fields are not + // inherited from the cluster-wide configuration. When omitted, + // the cluster-wide proxy is used if configured; otherwise no + // proxy is used. + // +openshift:enable:FeatureGate=AuthenticationComponentProxy + // +optional + Proxy AuthenticationProxyConfig `json:"proxy,omitzero"` +} + +// AuthenticationProxyConfig holds proxy configuration scoped to +// authentication components (the OAuth server and the cluster +// authentication operator). +// +kubebuilder:validation:MinProperties=1 +// +kubebuilder:validation:XValidation:rule="has(self.httpProxy) || has(self.httpsProxy)",message="at least one of httpProxy or httpsProxy must be specified" +type AuthenticationProxyConfig struct { + // httpProxy is the URL of the proxy for HTTP requests. + // Must be a valid URL with http or https scheme, a non-empty + // hostname, and no path, query parameters, or fragment. + // Userinfo (e.g. user:password@host) is allowed for proxy + // authentication. Maximum length is 2048 characters. + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=2048 + // +kubebuilder:validation:XValidation:rule="isURL(self)",message="httpProxy must be a valid URL" + // +kubebuilder:validation:XValidation:rule="!isURL(self) || url(self).getScheme() in ['http', 'https']",message="httpProxy must use http or https scheme" + // +kubebuilder:validation:XValidation:rule="!isURL(self) || size(url(self).getHostname()) > 0",message="httpProxy must contain a hostname" + // +kubebuilder:validation:XValidation:rule="!isURL(self) || url(self).getEscapedPath() == '' || url(self).getEscapedPath() == '/'",message="httpProxy must not contain a path" + // +kubebuilder:validation:XValidation:rule="!isURL(self) || url(self).getQuery().size() == 0",message="httpProxy must not contain query parameters" + // +kubebuilder:validation:XValidation:rule="!self.matches('.*#.*')",message="httpProxy must not contain a fragment" + // +optional + HTTPProxy string `json:"httpProxy,omitempty"` + + // httpsProxy is the URL of the proxy for HTTPS requests. + // Must be a valid URL with http or https scheme, a non-empty + // hostname, and no path, query parameters, or fragment. + // Userinfo (e.g. user:password@host) is allowed for proxy + // authentication. Maximum length is 2048 characters. + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=2048 + // +kubebuilder:validation:XValidation:rule="isURL(self)",message="httpsProxy must be a valid URL" + // +kubebuilder:validation:XValidation:rule="!isURL(self) || url(self).getScheme() in ['http', 'https']",message="httpsProxy must use http or https scheme" + // +kubebuilder:validation:XValidation:rule="!isURL(self) || size(url(self).getHostname()) > 0",message="httpsProxy must contain a hostname" + // +kubebuilder:validation:XValidation:rule="!isURL(self) || url(self).getEscapedPath() == '' || url(self).getEscapedPath() == '/'",message="httpsProxy must not contain a path" + // +kubebuilder:validation:XValidation:rule="!isURL(self) || url(self).getQuery().size() == 0",message="httpsProxy must not contain query parameters" + // +kubebuilder:validation:XValidation:rule="!self.matches('.*#.*')",message="httpsProxy must not contain a fragment" + // +optional + HTTPSProxy string `json:"httpsProxy,omitempty"` + + // noProxy is a list of hostnames and/or CIDRs and/or IPs for which + // the proxy should not be used. Must contain at least one entry + // when set. Each entry must be between 1 and 253 characters long + // and at most 64 entries are allowed. Duplicate + // entries are not permitted. Entries that are not valid hostnames, + // CIDRs, or IPs are silently ignored. Cluster-internal defaults + // (.cluster.local, .svc, 127.0.0.1, localhost) are always appended + // automatically and do not need to be included. + // +listType=set + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=64 + // +kubebuilder:validation:items:MinLength=1 + // +kubebuilder:validation:items:MaxLength=253 + // +optional + NoProxy []string `json:"noProxy,omitempty"` + + // trustedCA is a reference to a ConfigMap in the openshift-config + // namespace containing a CA certificate bundle under the key + // "ca-bundle.crt". This bundle is appended to the system trust store + // used by authentication components for proxy TLS connections. + // When omitted, only the system trust store is used. + // +optional + TrustedCA AuthenticationConfigMapReference `json:"trustedCA,omitzero"` +} + +// AuthenticationConfigMapReference references a ConfigMap in the +// openshift-config namespace. +type AuthenticationConfigMapReference struct { + // name is the metadata.name of the referenced ConfigMap. + // Must be a valid DNS subdomain name (RFC 1123): at most 253 + // characters, only lowercase alphanumeric characters, '-' or + // '.', starting and ending with an alphanumeric character. + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=253 + // +kubebuilder:validation:XValidation:rule="!format.dns1123Subdomain().validate(self).hasValue()",message="name must be a valid DNS subdomain name: contain no more than 253 characters, contain only lowercase alphanumeric characters, '-' or '.', and start and end with an alphanumeric character" + // +required + Name string `json:"name,omitempty"` } type AuthenticationStatus struct { @@ -49,6 +137,11 @@ type OAuthAPIServerStatus struct { // +optional // +kubebuilder:validation:Minimum=0 LatestAvailableRevision int32 `json:"latestAvailableRevision,omitempty"` + + // encryptionStatus contains status reports for the KMS plugin health and its key rotation. + // +optional + // +openshift:enable:FeatureGate=KMSEncryption + EncryptionStatus KMSEncryptionStatus `json:"encryptionStatus,omitempty,omitzero"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/apis/vendor/github.com/openshift/api/operator/v1/types_csi_cluster_driver.go b/apis/vendor/github.com/openshift/api/operator/v1/types_csi_cluster_driver.go index 53c71aabb65..fca2c808d34 100644 --- a/apis/vendor/github.com/openshift/api/operator/v1/types_csi_cluster_driver.go +++ b/apis/vendor/github.com/openshift/api/operator/v1/types_csi_cluster_driver.go @@ -21,6 +21,9 @@ import ( // +kubebuilder:subresource:status // +openshift:api-approved.openshift.io=https://github.com/openshift/api/pull/701 // +openshift:file-pattern=cvoRunLevel=0000_50,operatorName=csi-driver,operatorOrdering=01 +// +kubebuilder:validation:XValidation:rule="self.spec.?driverConfig.driverType.orValue('') == 'SecretsStore' ? self.metadata.name == 'secrets-store.csi.k8s.io' : true",message="driverType 'SecretsStore' requires metadata.name 'secrets-store.csi.k8s.io'" +// +kubebuilder:validation:XValidation:rule="self.metadata.name == 'secrets-store.csi.k8s.io' ? (!has(self.spec.driverConfig) || self.spec.driverConfig.driverType == 'SecretsStore') : true",message="metadata.name 'secrets-store.csi.k8s.io' requires driverType 'SecretsStore'" +// +kubebuilder:validation:XValidation:rule="oldSelf.spec.?driverConfig.?secretsStore.?tokenRequests.?type.orValue('') != 'Managed' || self.spec.?driverConfig.?secretsStore.?tokenRequests.?type.orValue('') == 'Managed'",message="tokenRequests type cannot be changed from Managed" // ClusterCSIDriver object allows management and configuration of a CSI driver operator // installed by default in OpenShift. Name of the object must be name of the CSI driver @@ -113,25 +116,27 @@ type ClusterCSIDriverSpec struct { } // CSIDriverType indicates type of CSI driver being configured. -// +kubebuilder:validation:Enum="";AWS;Azure;GCP;IBMCloud;vSphere +// +kubebuilder:validation:Enum="";AWS;Azure;GCP;IBMCloud;vSphere;SecretsStore type CSIDriverType string const ( - AWSDriverType CSIDriverType = "AWS" - AzureDriverType CSIDriverType = "Azure" - GCPDriverType CSIDriverType = "GCP" - IBMCloudDriverType CSIDriverType = "IBMCloud" - VSphereDriverType CSIDriverType = "vSphere" + AWSDriverType CSIDriverType = "AWS" + AzureDriverType CSIDriverType = "Azure" + GCPDriverType CSIDriverType = "GCP" + IBMCloudDriverType CSIDriverType = "IBMCloud" + VSphereDriverType CSIDriverType = "vSphere" + SecretsStoreDriverType CSIDriverType = "SecretsStore" ) // CSIDriverConfigSpec defines configuration spec that can be // used to optionally configure a specific CSI Driver. // +kubebuilder:validation:XValidation:rule="has(self.driverType) && self.driverType == 'IBMCloud' ? has(self.ibmcloud) : !has(self.ibmcloud)",message="ibmcloud must be set if driverType is 'IBMCloud', but remain unset otherwise" +// +kubebuilder:validation:XValidation:rule="has(self.driverType) && self.driverType == 'SecretsStore' ? has(self.secretsStore) : !has(self.secretsStore)",message="secretsStore must be set if driverType is 'SecretsStore', but remain unset otherwise" // +union type CSIDriverConfigSpec struct { // driverType indicates type of CSI driver for which the // driverConfig is being applied to. - // Valid values are: AWS, Azure, GCP, IBMCloud, vSphere and omitted. + // Valid values are: AWS, Azure, GCP, IBMCloud, vSphere, SecretsStore and omitted. // Consumers should treat unknown values as a NO-OP. // +required // +unionDiscriminator @@ -156,6 +161,10 @@ type CSIDriverConfigSpec struct { // vSphere is used to configure the vsphere CSI driver. // +optional VSphere *VSphereCSIDriverConfigSpec `json:"vSphere,omitempty"` + + // secretsStore is used to configure the Secrets Store CSI driver. + // +optional + SecretsStore SecretsStoreCSIDriverConfigSpec `json:"secretsStore,omitzero"` } // AWSCSIDriverConfigSpec defines properties that can be configured for the AWS CSI driver. @@ -163,7 +172,15 @@ type AWSCSIDriverConfigSpec struct { // kmsKeyARN sets the cluster default storage class to encrypt volumes with a user-defined KMS key, // rather than the default KMS key used by AWS. // The value may be either the ARN or Alias ARN of a KMS key. - // +kubebuilder:validation:Pattern:=`^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b|aws-iso-e|aws-iso-f):kms:[a-z0-9-]+:[0-9]{12}:(key|alias)\/.*$` + // + // The ARN must follow the format: arn::kms:::(key|alias)/, where: + // is the AWS partition (aws, aws-cn, aws-us-gov, aws-iso, aws-iso-b, aws-iso-e, aws-iso-f, or aws-eusc), + // is the AWS region, + // is a 12-digit numeric identifier for the AWS account, + // is the KMS key ID or alias name. + // + // +openshift:validation:FeatureGateAwareXValidation:featureGate="",rule=`matches(self, '^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b|aws-iso-e|aws-iso-f):kms:[a-z0-9-]+:[0-9]{12}:(key|alias)/.*$')`,message=`kmsKeyARN must be a valid AWS KMS key ARN in the format: arn::kms:::(key|alias)/` + // +openshift:validation:FeatureGateAwareXValidation:featureGate=AWSEuropeanSovereignCloudInstall,rule=`matches(self, '^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b|aws-iso-e|aws-iso-f|aws-eusc):kms:[a-z0-9-]+:[0-9]{12}:(key|alias)/.*$')`,message=`kmsKeyARN must be a valid AWS KMS key ARN in the format: arn::kms:::(key|alias)/` // +optional KMSKeyARN string `json:"kmsKeyARN,omitempty"` @@ -381,6 +398,158 @@ type VSphereCSIDriverConfigSpec struct { MaxAllowedBlockVolumesPerNode int32 `json:"maxAllowedBlockVolumesPerNode,omitempty"` } +// SecretsStoreCSIDriverConfigSpec defines properties that can be configured for the Secrets Store CSI driver. +// +kubebuilder:validation:MinProperties=1 +type SecretsStoreCSIDriverConfigSpec struct { + // secretRotation controls automatic secret rotation behavior. + // When omitted, secret rotation is enabled with a default poll interval of 2 minutes. + // +optional + SecretRotation SecretsStoreSecretRotation `json:"secretRotation,omitzero"` + + // tokenRequests controls service account token configuration for + // workload identity federation (WIF) with cloud providers. + // When omitted, the operator preserves any existing tokenRequests + // already configured on the CSIDriver object without modification. + // +optional + TokenRequests SecretsStoreTokenRequests `json:"tokenRequests,omitzero"` +} + +// TokenRequestsType determines how the operator manages the tokenRequests +// field on the storage.k8s.io CSIDriver object. +// +kubebuilder:validation:Enum=Managed;Unmanaged +type TokenRequestsType string + +const ( + // TokenRequestsManaged means the operator uses the audiences list + // as the sole source of truth for the CSIDriver.spec.tokenRequests field. + TokenRequestsManaged TokenRequestsType = "Managed" + + // TokenRequestsUnmanaged means the operator preserves any existing + // tokenRequests already configured on the CSIDriver object and does not + // overwrite them. + TokenRequestsUnmanaged TokenRequestsType = "Unmanaged" +) + +// SecretsStoreTokenRequests configures how service account tokens are +// provided to the Secrets Store CSI driver for workload identity federation. +// +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'Managed' ? has(self.managed) : !has(self.managed)",message="managed must be set when type is 'Managed', and must not be set otherwise" +// +union +type SecretsStoreTokenRequests struct { + // type determines how the operator manages tokenRequests on the CSIDriver object. + // When "Unmanaged", existing tokenRequests on the CSIDriver are preserved + // and the managed field is not used. + // When "Managed", the operator sets tokenRequests from the audiences + // specified in the managed field, replacing any previously configured values. + // Once set to "Managed", type cannot be reverted back to "Unmanaged". + // +unionDiscriminator + // +required + Type TokenRequestsType `json:"type,omitempty"` + + // managed holds configuration for operator-managed tokenRequests. + // Only valid when type is "Managed". + // +optional + Managed ManagedTokenRequests `json:"managed,omitzero"` +} + +// ManagedTokenRequests holds the configuration for operator-managed +// service account token requests. +// +kubebuilder:validation:MinProperties=1 +type ManagedTokenRequests struct { + // audiences specifies service account token audiences that kubelet will + // provide to the CSI driver during NodePublishVolume calls. These tokens + // enable workload identity federation (WIF) with cloud providers such as + // AWS, Azure, and GCP. + // When empty, the operator clears all tokenRequests from the CSIDriver object. + // +optional + // +listType=map + // +listMapKey=audience + // +kubebuilder:validation:MinItems=0 + // +kubebuilder:validation:MaxItems=10 + Audiences *[]SecretsStoreTokenRequest `json:"audiences,omitempty"` +} + +// SecretRotationType determines the secret rotation behavior for the +// Secrets Store CSI driver. +// +kubebuilder:validation:Enum=None;Custom +type SecretRotationType string + +const ( + // SecretRotationNone disables automatic secret rotation. Secrets are only + // fetched at initial pod mount time. + SecretRotationNone SecretRotationType = "None" + + // SecretRotationCustom enables automatic secret rotation with the + // configuration specified in the custom field. + SecretRotationCustom SecretRotationType = "Custom" +) + +// SecretsStoreSecretRotation configures the automatic secret rotation behavior +// for the Secrets Store CSI driver. +// +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'Custom' ? has(self.custom) : !has(self.custom)",message="custom must be set when type is 'Custom', and must not be set otherwise" +// +union +type SecretsStoreSecretRotation struct { + // type determines the secret rotation behavior. + // When "None", secret rotation is disabled and secrets are only fetched at + // initial pod mount time. + // When "Custom", secret rotation is enabled with the configuration specified + // in the custom field. + // +unionDiscriminator + // +required + Type SecretRotationType `json:"type,omitempty"` + + // custom holds the custom rotation configuration. + // Only valid when type is "Custom". + // +optional + Custom CustomSecretRotation `json:"custom,omitzero"` +} + +// CustomSecretRotation holds configuration for custom secret rotation behavior. +// +kubebuilder:validation:MinProperties=1 +type CustomSecretRotation struct { + // minimumRefreshAge is the minimum time in seconds between secret + // rotation attempts. Each time kubelet calls NodePublishVolume, the driver + // checks whether this interval has elapsed since the last successful provider + // call. If it has, the driver contacts the secret provider to fetch the latest + // secret values and updates the mounted volume. + // Setting this value below the kubelet syncFrequency (default: 1 minute) + // has no additional effect on the actual rotation cadence. + // Must be at least 1 second and no more than 31560000 seconds (~1 year). + // When omitted, this means no opinion and the platform is left to choose a + // reasonable default, which is subject to change over time. + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=31560000 + // +optional + MinimumRefreshAge int32 `json:"minimumRefreshAge,omitempty"` + + // --- TOMBSTONE --- + // rotationPollIntervalSeconds was the previous name for minimumRefreshAge. + // The field has been renamed to better reflect its semantics. + // The JSON key is reserved to prevent reuse. + // + // +optional + // RotationPollIntervalSeconds int32 `json:"rotationPollIntervalSeconds,omitempty"` +} + +// SecretsStoreTokenRequest specifies a service account token audience configuration +// for workload identity federation (WIF) with the Secrets Store CSI driver. +type SecretsStoreTokenRequest struct { + // audience is the intended audience of the service account token. + // An empty string means the issued token will use the kube-apiserver's default APIAudiences. + // +kubebuilder:validation:MinLength=0 + // +kubebuilder:validation:MaxLength=253 + // +required + Audience *string `json:"audience,omitempty"` + + // expirationSeconds is the requested duration of validity of the service account token. + // The token issuer may return a token with a different validity duration. + // When omitted, the token expiration is determined by the kube-apiserver. + // Must be at least 600 seconds (10 minutes) and no more than 315360000 seconds (~10 years). + // +kubebuilder:validation:Minimum=600 + // +kubebuilder:validation:Maximum=315360000 + // +optional + ExpirationSeconds int32 `json:"expirationSeconds,omitempty"` +} + // ClusterCSIDriverStatus is the observed status of CSI driver operator type ClusterCSIDriverStatus struct { OperatorStatus `json:",inline"` diff --git a/apis/vendor/github.com/openshift/api/operator/v1/types_etcd.go b/apis/vendor/github.com/openshift/api/operator/v1/types_etcd.go index 252f3b39905..f2f11310360 100644 --- a/apis/vendor/github.com/openshift/api/operator/v1/types_etcd.go +++ b/apis/vendor/github.com/openshift/api/operator/v1/types_etcd.go @@ -42,11 +42,11 @@ type EtcdSpec struct { HardwareSpeed ControlPlaneHardwareSpeed `json:"controlPlaneHardwareSpeed"` // backendQuotaGiB sets the etcd backend storage size limit in gibibytes. - // The value should be an integer not less than 8 and not more than 32. + // The value should be an integer not less than 8 and not more than 16. // When not specified, the default value is 8. // +kubebuilder:default:=8 // +kubebuilder:validation:Minimum=8 - // +kubebuilder:validation:Maximum=32 + // +kubebuilder:validation:Maximum=16 // +kubebuilder:validation:XValidation:rule="self>=oldSelf",message="etcd backendQuotaGiB may not be decreased" // +openshift:enable:FeatureGate=EtcdBackendQuota // +default=8 diff --git a/apis/vendor/github.com/openshift/api/operator/v1/types_ingress.go b/apis/vendor/github.com/openshift/api/operator/v1/types_ingress.go deleted file mode 100644 index d54352f2cee..00000000000 --- a/apis/vendor/github.com/openshift/api/operator/v1/types_ingress.go +++ /dev/null @@ -1,2244 +0,0 @@ -package v1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - - corev1 "k8s.io/api/core/v1" - - configv1 "github.com/openshift/api/config/v1" -) - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +kubebuilder:object:root=true -// +kubebuilder:subresource:status -// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.availableReplicas,selectorpath=.status.selector -// +kubebuilder:resource:path=ingresscontrollers,scope=Namespaced -// +openshift:api-approved.openshift.io=https://github.com/openshift/api/pull/616 -// +openshift:capability=Ingress -// +openshift:file-pattern=cvoRunLevel=0000_50,operatorName=ingress,operatorOrdering=00 - -// IngressController describes a managed ingress controller for the cluster. The -// controller can service OpenShift Route and Kubernetes Ingress resources. -// -// When an IngressController is created, a new ingress controller deployment is -// created to allow external traffic to reach the services that expose Ingress -// or Route resources. Updating this resource may lead to disruption for public -// facing network connections as a new ingress controller revision may be rolled -// out. -// -// https://kubernetes.io/docs/concepts/services-networking/ingress-controllers -// -// Whenever possible, sensible defaults for the platform are used. See each -// field for more details. -// -// Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). -// +openshift:compatibility-gen:level=1 -// +kubebuilder:validation:XValidation:rule="!has(self.spec.domain) || size('router-' + self.metadata.name + '.' + self.spec.domain) <= 253",message="The combined 'router-' + metadata.name + '.' + .spec.domain cannot exceed 253 characters" -type IngressController struct { - metav1.TypeMeta `json:",inline"` - - // metadata is the standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - metav1.ObjectMeta `json:"metadata,omitempty"` - - // spec is the specification of the desired behavior of the IngressController. - Spec IngressControllerSpec `json:"spec,omitempty"` - // status is the most recently observed status of the IngressController. - Status IngressControllerStatus `json:"status,omitempty"` -} - -// IngressControllerSpec is the specification of the desired behavior of the -// IngressController. -type IngressControllerSpec struct { - // domain is a DNS name serviced by the ingress controller and is used to - // configure multiple features: - // - // * For the LoadBalancerService endpoint publishing strategy, domain is - // used to configure DNS records. See endpointPublishingStrategy. - // - // * When using a generated default certificate, the certificate will be valid - // for domain and its subdomains. See defaultCertificate. - // - // * The value is published to individual Route statuses so that end-users - // know where to target external DNS records. - // - // domain must be unique among all IngressControllers, and cannot be - // updated. - // - // If empty, defaults to ingress.config.openshift.io/cluster .spec.domain. - // - // The domain value must be a valid DNS name. It must consist of lowercase - // alphanumeric characters, '-' or '.', and each label must start and end - // with an alphanumeric character and not exceed 63 characters. Maximum - // length of a valid DNS domain is 253 characters. - // - // The implementation may add a prefix such as "router-default." to the domain - // when constructing the router canonical hostname. To ensure the resulting - // hostname does not exceed the DNS maximum length of 253 characters, - // the domain length is additionally validated at the IngressController object - // level. For the maximum length of the domain value itself, the shortest - // possible variant of the prefix and the ingress controller name was considered - // for example "router-a." - // - // +kubebuilder:validation:MaxLength=244 - // +kubebuilder:validation:XValidation:rule="!format.dns1123Subdomain().validate(self).hasValue()",message="domain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character" - // +kubebuilder:validation:XValidation:rule="self.split('.').all(label, size(label) <= 63)",message="each DNS label must not exceed 63 characters" - // +optional - Domain string `json:"domain,omitempty"` - - // httpErrorCodePages specifies a configmap with custom error pages. - // The administrator must create this configmap in the openshift-config namespace. - // This configmap should have keys in the format "error-page-.http", - // where is an HTTP error code. - // For example, "error-page-503.http" defines an error page for HTTP 503 responses. - // Currently only error pages for 503 and 404 responses can be customized. - // Each value in the configmap should be the full response, including HTTP headers. - // Eg- https://raw.githubusercontent.com/openshift/router/fadab45747a9b30cc3f0a4b41ad2871f95827a93/images/router/haproxy/conf/error-page-503.http - // If this field is empty, the ingress controller uses the default error pages. - HttpErrorCodePages configv1.ConfigMapNameReference `json:"httpErrorCodePages,omitempty"` - - // replicas is the desired number of ingress controller replicas. If unset, - // the default depends on the value of the defaultPlacement field in the - // cluster config.openshift.io/v1/ingresses status. - // - // The value of replicas is set based on the value of a chosen field in the - // Infrastructure CR. If defaultPlacement is set to ControlPlane, the - // chosen field will be controlPlaneTopology. If it is set to Workers the - // chosen field will be infrastructureTopology. Replicas will then be set to 1 - // or 2 based whether the chosen field's value is SingleReplica or - // HighlyAvailable, respectively. - // - // These defaults are subject to change. - // - // +optional - Replicas *int32 `json:"replicas,omitempty"` - - // endpointPublishingStrategy is used to publish the ingress controller - // endpoints to other networks, enable load balancer integrations, etc. - // - // If unset, the default is based on - // infrastructure.config.openshift.io/cluster .status.platform: - // - // AWS: LoadBalancerService (with External scope) - // Azure: LoadBalancerService (with External scope) - // GCP: LoadBalancerService (with External scope) - // IBMCloud: LoadBalancerService (with External scope) - // AlibabaCloud: LoadBalancerService (with External scope) - // Libvirt: HostNetwork - // - // Any other platform types (including None) default to HostNetwork. - // - // endpointPublishingStrategy cannot be updated. - // - // +optional - EndpointPublishingStrategy *EndpointPublishingStrategy `json:"endpointPublishingStrategy,omitempty"` - - // defaultCertificate is a reference to a secret containing the default - // certificate served by the ingress controller. When Routes don't specify - // their own certificate, defaultCertificate is used. - // - // The secret must contain the following keys and data: - // - // tls.crt: certificate file contents - // tls.key: key file contents - // - // If unset, a wildcard certificate is automatically generated and used. The - // certificate is valid for the ingress controller domain (and subdomains) and - // the generated certificate's CA will be automatically integrated with the - // cluster's trust store. - // - // If a wildcard certificate is used and shared by multiple - // HTTP/2 enabled routes (which implies ALPN) then clients - // (i.e., notably browsers) are at liberty to reuse open - // connections. This means a client can reuse a connection to - // another route and that is likely to fail. This behaviour is - // generally known as connection coalescing. - // - // The in-use certificate (whether generated or user-specified) will be - // automatically integrated with OpenShift's built-in OAuth server. - // - // +optional - DefaultCertificate *corev1.LocalObjectReference `json:"defaultCertificate,omitempty"` - - // namespaceSelector is used to filter the set of namespaces serviced by the - // ingress controller. This is useful for implementing shards. - // - // If unset, the default is no filtering. - // - // +optional - NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty"` - - // routeSelector is used to filter the set of Routes serviced by the ingress - // controller. This is useful for implementing shards. - // - // If unset, the default is no filtering. - // - // +optional - RouteSelector *metav1.LabelSelector `json:"routeSelector,omitempty"` - - // nodePlacement enables explicit control over the scheduling of the ingress - // controller. - // - // If unset, defaults are used. See NodePlacement for more details. - // - // +optional - NodePlacement *NodePlacement `json:"nodePlacement,omitempty"` - - // tlsSecurityProfile specifies settings for TLS connections for ingresscontrollers. - // - // If unset, the default is based on the apiservers.config.openshift.io/cluster resource. - // - // Note that when using the Old, Intermediate, and Modern profile types, the effective - // profile configuration is subject to change between releases. For example, given - // a specification to use the Intermediate profile deployed on release X.Y.Z, an upgrade - // to release X.Y.Z+1 may cause a new profile configuration to be applied to the ingress - // controller, resulting in a rollout. - // - // +optional - TLSSecurityProfile *configv1.TLSSecurityProfile `json:"tlsSecurityProfile,omitempty"` - - // clientTLS specifies settings for requesting and verifying client - // certificates, which can be used to enable mutual TLS for - // edge-terminated and reencrypt routes. - // - // +optional - ClientTLS ClientTLS `json:"clientTLS"` - - // routeAdmission defines a policy for handling new route claims (for example, - // to allow or deny claims across namespaces). - // - // If empty, defaults will be applied. See specific routeAdmission fields - // for details about their defaults. - // - // +optional - RouteAdmission *RouteAdmissionPolicy `json:"routeAdmission,omitempty"` - - // logging defines parameters for what should be logged where. If this - // field is empty, operational logs are enabled but access logs are - // disabled. - // - // +optional - Logging *IngressControllerLogging `json:"logging,omitempty"` - - // httpHeaders defines policy for HTTP headers. - // - // If this field is empty, the default values are used. - // - // +optional - HTTPHeaders *IngressControllerHTTPHeaders `json:"httpHeaders,omitempty"` - - // httpEmptyRequestsPolicy describes how HTTP connections should be - // handled if the connection times out before a request is received. - // Allowed values for this field are "Respond" and "Ignore". If the - // field is set to "Respond", the ingress controller sends an HTTP 400 - // or 408 response, logs the connection (if access logging is enabled), - // and counts the connection in the appropriate metrics. If the field - // is set to "Ignore", the ingress controller closes the connection - // without sending a response, logging the connection, or incrementing - // metrics. The default value is "Respond". - // - // Typically, these connections come from load balancers' health probes - // or Web browsers' speculative connections ("preconnect") and can be - // safely ignored. However, these requests may also be caused by - // network errors, and so setting this field to "Ignore" may impede - // detection and diagnosis of problems. In addition, these requests may - // be caused by port scans, in which case logging empty requests may aid - // in detecting intrusion attempts. - // - // +optional - // +kubebuilder:default:="Respond" - HTTPEmptyRequestsPolicy HTTPEmptyRequestsPolicy `json:"httpEmptyRequestsPolicy,omitempty"` - - // tuningOptions defines parameters for adjusting the performance of - // ingress controller pods. All fields are optional and will use their - // respective defaults if not set. See specific tuningOptions fields for - // more details. - // - // Setting fields within tuningOptions is generally not recommended. The - // default values are suitable for most configurations. - // - // +optional - TuningOptions IngressControllerTuningOptions `json:"tuningOptions,omitempty"` - - // unsupportedConfigOverrides allows specifying unsupported - // configuration options. Its use is unsupported. - // - // +optional - // +nullable - // +kubebuilder:pruning:PreserveUnknownFields - UnsupportedConfigOverrides runtime.RawExtension `json:"unsupportedConfigOverrides"` - - // httpCompression defines a policy for HTTP traffic compression. - // By default, there is no HTTP compression. - // - // +optional - HTTPCompression HTTPCompressionPolicy `json:"httpCompression,omitempty"` - - // idleConnectionTerminationPolicy maps directly to HAProxy's - // idle-close-on-response option and controls whether HAProxy - // keeps idle frontend connections open during a soft stop - // (router reload). - // - // Allowed values for this field are "Immediate" and - // "Deferred". The default value is "Immediate". - // - // When set to "Immediate", idle connections are closed - // immediately during router reloads. This ensures immediate - // propagation of route changes but may impact clients - // sensitive to connection resets. - // - // When set to "Deferred", HAProxy will maintain idle - // connections during a soft reload instead of closing them - // immediately. These connections remain open until any of the - // following occurs: - // - // - A new request is received on the connection, in which - // case HAProxy handles it in the old process and closes - // the connection after sending the response. - // - // - HAProxy's `timeout http-keep-alive` duration expires. - // By default this is 300 seconds, but it can be changed - // using httpKeepAliveTimeout tuning option. - // - // - The client's keep-alive timeout expires, causing the - // client to close the connection. - // - // Setting Deferred can help prevent errors in clients or load - // balancers that do not properly handle connection resets. - // Additionally, this option allows you to retain the pre-2.4 - // HAProxy behaviour: in HAProxy version 2.2 (OpenShift - // versions < 4.14), maintaining idle connections during a - // soft reload was the default behaviour, but starting with - // HAProxy 2.4, the default changed to closing idle - // connections immediately. - // - // Important Consideration: - // - // - Using Deferred will result in temporary inconsistencies - // for the first request on each persistent connection - // after a route update and router reload. This request - // will be processed by the old HAProxy process using its - // old configuration. Subsequent requests will use the - // updated configuration. - // - // Operational Considerations: - // - // - Keeping idle connections open during reloads may lead - // to an accumulation of old HAProxy processes if - // connections remain idle for extended periods, - // especially in environments where frequent reloads - // occur. - // - // - Consider monitoring the number of HAProxy processes in - // the router pods when Deferred is set. - // - // - You may need to enable or adjust the - // `ingress.operator.openshift.io/hard-stop-after` - // duration (configured via an annotation on the - // IngressController resource) in environments with - // frequent reloads to prevent resource exhaustion. - // - // +optional - // +kubebuilder:default:="Immediate" - // +default="Immediate" - IdleConnectionTerminationPolicy IngressControllerConnectionTerminationPolicy `json:"idleConnectionTerminationPolicy,omitempty"` - - // closedClientConnectionPolicy controls how the IngressController - // behaves when the client closes the TCP connection while the TLS - // handshake or HTTP request is in progress. This option maps directly - // to HAProxy’s "abortonclose" option. - // - // Valid values are: "Abort" and "Continue". - // The default value is "Continue". - // - // When set to "Abort", the router will stop processing the TLS handshake - // if it is in progress, and it will not send an HTTP request to the backend server - // if the request has not yet been sent when the client closes the connection. - // - // When set to "Continue", the router will complete the TLS handshake - // if it is in progress, or send an HTTP request to the backend server - // and wait for the backend server's response, regardless of - // whether the client has closed the connection. - // - // Setting "Abort" can help free CPU resources otherwise spent on TLS computation - // for connections the client has already closed, and can reduce request queue - // size, thereby reducing the load on saturated backend servers. - // - // Important Considerations: - // - // - The default policy ("Continue") is HTTP-compliant, and requests - // for aborted client connections will still be served. - // Use the "Continue" policy to allow a client to send a request - // and then immediately close its side of the connection while - // still receiving a response on the half-closed connection. - // - // - When clients use keep-alive connections, the most common case for premature - // closure is when the user wants to cancel the transfer or when a timeout - // occurs. In that case, the "Abort" policy may be used to reduce resource consumption. - // - // - Using RSA keys larger than 2048 bits can significantly slow down - // TLS computations. Consider using the "Abort" policy to reduce CPU usage. - // - // +optional - // +kubebuilder:default:="Continue" - // +default="Continue" - ClosedClientConnectionPolicy IngressControllerClosedClientConnectionPolicy `json:"closedClientConnectionPolicy,omitempty"` -} - -// httpCompressionPolicy turns on compression for the specified MIME types. -// -// This field is optional, and its absence implies that compression should not be enabled -// globally in HAProxy. -// -// If httpCompressionPolicy exists, compression should be enabled only for the specified -// MIME types. -type HTTPCompressionPolicy struct { - // mimeTypes is a list of MIME types that should have compression applied. - // This list can be empty, in which case the ingress controller does not apply compression. - // - // Note: Not all MIME types benefit from compression, but HAProxy will still use resources - // to try to compress if instructed to. Generally speaking, text (html, css, js, etc.) - // formats benefit from compression, but formats that are already compressed (image, - // audio, video, etc.) benefit little in exchange for the time and cpu spent on compressing - // again. See https://joehonton.medium.com/the-gzip-penalty-d31bd697f1a2 - // - // +listType=set - MimeTypes []CompressionMIMEType `json:"mimeTypes,omitempty"` -} - -// CompressionMIMEType defines the format of a single MIME type. -// E.g. "text/css; charset=utf-8", "text/html", "text/*", "image/svg+xml", -// "application/octet-stream", "X-custom/customsub", etc. -// -// The format should follow the Content-Type definition in RFC 1341: -// Content-Type := type "/" subtype *[";" parameter] -// - The type in Content-Type can be one of: -// application, audio, image, message, multipart, text, video, or a custom -// type preceded by "X-" and followed by a token as defined below. -// - The token is a string of at least one character, and not containing white -// space, control characters, or any of the characters in the tspecials set. -// - The tspecials set contains the characters ()<>@,;:\"/[]?.= -// - The subtype in Content-Type is also a token. -// - The optional parameter/s following the subtype are defined as: -// token "=" (token / quoted-string) -// - The quoted-string, as defined in RFC 822, is surrounded by double quotes -// and can contain white space plus any character EXCEPT \, ", and CR. -// It can also contain any single ASCII character as long as it is escaped by \. -// -// +kubebuilder:validation:Pattern=`^(?i)(x-[^][ ()\\<>@,;:"/?.=\x00-\x1F\x7F]+|application|audio|image|message|multipart|text|video)/[^][ ()\\<>@,;:"/?.=\x00-\x1F\x7F]+(; *[^][ ()\\<>@,;:"/?.=\x00-\x1F\x7F]+=([^][ ()\\<>@,;:"/?.=\x00-\x1F\x7F]+|"(\\[\x00-\x7F]|[^\x0D"\\])*"))*$` -type CompressionMIMEType string - -// NodePlacement describes node scheduling configuration for an ingress -// controller. -type NodePlacement struct { - // nodeSelector is the node selector applied to ingress controller - // deployments. - // - // If set, the specified selector is used and replaces the default. - // - // If unset, the default depends on the value of the defaultPlacement - // field in the cluster config.openshift.io/v1/ingresses status. - // - // When defaultPlacement is Workers, the default is: - // - // kubernetes.io/os: linux - // node-role.kubernetes.io/worker: '' - // - // When defaultPlacement is ControlPlane, the default is: - // - // kubernetes.io/os: linux - // node-role.kubernetes.io/master: '' - // - // These defaults are subject to change. - // - // Note that using nodeSelector.matchExpressions is not supported. Only - // nodeSelector.matchLabels may be used. This is a limitation of the - // Kubernetes API: the pod spec does not allow complex expressions for - // node selectors. - // - // +optional - NodeSelector *metav1.LabelSelector `json:"nodeSelector,omitempty"` - - // tolerations is a list of tolerations applied to ingress controller - // deployments. - // - // The default is an empty list. - // - // See https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ - // - // +optional - // +listType=atomic - Tolerations []corev1.Toleration `json:"tolerations,omitempty"` -} - -// EndpointPublishingStrategyType is a way to publish ingress controller endpoints. -// +kubebuilder:validation:Enum=LoadBalancerService;HostNetwork;Private;NodePortService -type EndpointPublishingStrategyType string - -const ( - // LoadBalancerService publishes the ingress controller using a Kubernetes - // LoadBalancer Service. - LoadBalancerServiceStrategyType EndpointPublishingStrategyType = "LoadBalancerService" - - // HostNetwork publishes the ingress controller on node ports where the - // ingress controller is deployed. - HostNetworkStrategyType EndpointPublishingStrategyType = "HostNetwork" - - // Private does not publish the ingress controller. - PrivateStrategyType EndpointPublishingStrategyType = "Private" - - // NodePortService publishes the ingress controller using a Kubernetes NodePort Service. - NodePortServiceStrategyType EndpointPublishingStrategyType = "NodePortService" -) - -// LoadBalancerScope is the scope at which a load balancer is exposed. -// +kubebuilder:validation:Enum=Internal;External -type LoadBalancerScope string - -var ( - // InternalLoadBalancer is a load balancer that is exposed only on the - // cluster's private network. - InternalLoadBalancer LoadBalancerScope = "Internal" - - // ExternalLoadBalancer is a load balancer that is exposed on the - // cluster's public network (which is typically on the Internet). - ExternalLoadBalancer LoadBalancerScope = "External" -) - -// CIDR is an IP address range in CIDR notation (for example, "10.0.0.0/8" -// or "fd00::/8"). -// +kubebuilder:validation:Pattern=`(^(([0-9]|[0-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[0-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/([0-9]|[12][0-9]|3[0-2])$)|(^s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:)))(%.+)?s*(\/(12[0-8]|1[0-1][0-9]|[1-9][0-9]|[0-9]))$)` -// + --- -// + The regex for the IPv4 CIDR range was taken from other CIDR fields in the OpenShift API -// + and the one for the IPv6 CIDR range was taken from -// + https://blog.markhatton.co.uk/2011/03/15/regular-expressions-for-ip-addresses-cidr-ranges-and-hostnames/ -// + The resulting regex is an OR of both regexes. -type CIDR string - -// LoadBalancerStrategy holds parameters for a load balancer. -// +kubebuilder:validation:XValidation:rule="!has(self.scope) || self.scope != 'Internal' || !has(self.providerParameters) || !has(self.providerParameters.aws) || !has(self.providerParameters.aws.networkLoadBalancer) || !has(self.providerParameters.aws.networkLoadBalancer.eipAllocations)",message="eipAllocations are forbidden when the scope is Internal." -// +kubebuilder:validation:XValidation:rule=`!has(self.scope) || self.scope != 'Internal' || !has(self.providerParameters) || !has(self.providerParameters.openstack) || !has(self.providerParameters.openstack.floatingIP) || self.providerParameters.openstack.floatingIP == ""`,message="cannot specify a floating ip when scope is internal" -type LoadBalancerStrategy struct { - // scope indicates the scope at which the load balancer is exposed. - // Possible values are "External" and "Internal". - // - // +required - Scope LoadBalancerScope `json:"scope"` - - // allowedSourceRanges specifies an allowlist of IP address ranges to which - // access to the load balancer should be restricted. Each range must be - // specified using CIDR notation (e.g. "10.0.0.0/8" or "fd00::/8"). If no range is - // specified, "0.0.0.0/0" for IPv4 and "::/0" for IPv6 are used by default, - // which allows all source addresses. - // - // To facilitate migration from earlier versions of OpenShift that did - // not have the allowedSourceRanges field, you may set the - // service.beta.kubernetes.io/load-balancer-source-ranges annotation on - // the "router-" service in the - // "openshift-ingress" namespace, and this annotation will take - // effect if allowedSourceRanges is empty on OpenShift 4.12. - // - // +nullable - // +optional - // +listType=atomic - AllowedSourceRanges []CIDR `json:"allowedSourceRanges,omitempty"` - - // providerParameters holds desired load balancer information specific to - // the underlying infrastructure provider. - // - // If empty, defaults will be applied. See specific providerParameters - // fields for details about their defaults. - // - // +optional - ProviderParameters *ProviderLoadBalancerParameters `json:"providerParameters,omitempty"` - - // dnsManagementPolicy indicates if the lifecycle of the wildcard DNS record - // associated with the load balancer service will be managed by - // the ingress operator. It defaults to Managed. - // Valid values are: Managed and Unmanaged. - // - // +kubebuilder:default:="Managed" - // +required - // +default="Managed" - DNSManagementPolicy LoadBalancerDNSManagementPolicy `json:"dnsManagementPolicy,omitempty"` -} - -// LoadBalancerDNSManagementPolicy is a policy for configuring how -// ingresscontrollers manage DNS. -// -// +kubebuilder:validation:Enum=Managed;Unmanaged -type LoadBalancerDNSManagementPolicy string - -const ( - // ManagedLoadBalancerDNS specifies that the operator manages - // a wildcard DNS record for the ingresscontroller. - ManagedLoadBalancerDNS LoadBalancerDNSManagementPolicy = "Managed" - // UnmanagedLoadBalancerDNS specifies that the operator does not manage - // any wildcard DNS record for the ingresscontroller. - UnmanagedLoadBalancerDNS LoadBalancerDNSManagementPolicy = "Unmanaged" -) - -// ProviderLoadBalancerParameters holds desired load balancer information -// specific to the underlying infrastructure provider. -// +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'OpenStack' ? true : !has(self.openstack)",message="openstack is not permitted when type is not OpenStack" -// +union -type ProviderLoadBalancerParameters struct { - // type is the underlying infrastructure provider for the load balancer. - // Allowed values are "AWS", "Azure", "BareMetal", "GCP", "IBM", "Nutanix", - // "OpenStack", and "VSphere". - // - // +unionDiscriminator - // +required - Type LoadBalancerProviderType `json:"type"` - - // aws provides configuration settings that are specific to AWS - // load balancers. - // - // If empty, defaults will be applied. See specific aws fields for - // details about their defaults. - // - // +optional - AWS *AWSLoadBalancerParameters `json:"aws,omitempty"` - - // gcp provides configuration settings that are specific to GCP - // load balancers. - // - // If empty, defaults will be applied. See specific gcp fields for - // details about their defaults. - // - // +optional - GCP *GCPLoadBalancerParameters `json:"gcp,omitempty"` - - // ibm provides configuration settings that are specific to IBM Cloud - // load balancers. - // - // If empty, defaults will be applied. See specific ibm fields for - // details about their defaults. - // - // +optional - IBM *IBMLoadBalancerParameters `json:"ibm,omitempty"` - - // openstack provides configuration settings that are specific to OpenStack - // load balancers. - // - // If empty, defaults will be applied. See specific openstack fields for - // details about their defaults. - // - // +optional - OpenStack *OpenStackLoadBalancerParameters `json:"openstack,omitempty"` -} - -// LoadBalancerProviderType is the underlying infrastructure provider for the -// load balancer. Allowed values are "AWS", "Azure", "BareMetal", "GCP", "IBM", "Nutanix", -// "OpenStack", and "VSphere". -// -// +kubebuilder:validation:Enum=AWS;Azure;BareMetal;GCP;Nutanix;OpenStack;VSphere;IBM -type LoadBalancerProviderType string - -const ( - AWSLoadBalancerProvider LoadBalancerProviderType = "AWS" - AzureLoadBalancerProvider LoadBalancerProviderType = "Azure" - GCPLoadBalancerProvider LoadBalancerProviderType = "GCP" - OpenStackLoadBalancerProvider LoadBalancerProviderType = "OpenStack" - VSphereLoadBalancerProvider LoadBalancerProviderType = "VSphere" - IBMLoadBalancerProvider LoadBalancerProviderType = "IBM" - BareMetalLoadBalancerProvider LoadBalancerProviderType = "BareMetal" - AlibabaCloudLoadBalancerProvider LoadBalancerProviderType = "AlibabaCloud" - NutanixLoadBalancerProvider LoadBalancerProviderType = "Nutanix" -) - -// AWSLoadBalancerParameters provides configuration settings that are -// specific to AWS load balancers. -// +union -type AWSLoadBalancerParameters struct { - // type is the type of AWS load balancer to instantiate for an ingresscontroller. - // - // Valid values are: - // - // * "Classic": A Classic Load Balancer that makes routing decisions at either - // the transport layer (TCP/SSL) or the application layer (HTTP/HTTPS). See - // the following for additional details: - // - // https://docs.aws.amazon.com/AmazonECS/latest/developerguide/load-balancer-types.html#clb - // - // * "NLB": A Network Load Balancer that makes routing decisions at the - // transport layer (TCP/SSL). See the following for additional details: - // - // https://docs.aws.amazon.com/AmazonECS/latest/developerguide/load-balancer-types.html#nlb - // - // +unionDiscriminator - // +required - Type AWSLoadBalancerType `json:"type"` - - // classicLoadBalancerParameters holds configuration parameters for an AWS - // classic load balancer. Present only if type is Classic. - // - // +optional - ClassicLoadBalancerParameters *AWSClassicLoadBalancerParameters `json:"classicLoadBalancer,omitempty"` - - // networkLoadBalancerParameters holds configuration parameters for an AWS - // network load balancer. Present only if type is NLB. - // - // +optional - NetworkLoadBalancerParameters *AWSNetworkLoadBalancerParameters `json:"networkLoadBalancer,omitempty"` -} - -// AWSLoadBalancerType is the type of AWS load balancer to instantiate. -// +kubebuilder:validation:Enum=Classic;NLB -type AWSLoadBalancerType string - -const ( - AWSClassicLoadBalancer AWSLoadBalancerType = "Classic" - AWSNetworkLoadBalancer AWSLoadBalancerType = "NLB" -) - -// AWSSubnets contains a list of references to AWS subnets by -// ID or name. -// +kubebuilder:validation:XValidation:rule=`has(self.ids) && has(self.names) ? size(self.ids + self.names) <= 10 : true`,message="the total number of subnets cannot exceed 10" -// +kubebuilder:validation:XValidation:rule=`has(self.ids) && self.ids.size() > 0 || has(self.names) && self.names.size() > 0`,message="must specify at least 1 subnet name or id" -type AWSSubnets struct { - // ids specifies a list of AWS subnets by subnet ID. - // Subnet IDs must start with "subnet-", consist only - // of alphanumeric characters, must be exactly 24 - // characters long, must be unique, and the total - // number of subnets specified by ids and names - // must not exceed 10. - // - // +optional - // +listType=atomic - // +kubebuilder:validation:XValidation:rule=`self.all(x, self.exists_one(y, x == y))`,message="subnet ids cannot contain duplicates" - // + Note: Though it may seem redundant, MaxItems is necessary to prevent exceeding of the cost budget for the validation rules. - // +kubebuilder:validation:MaxItems=10 - IDs []AWSSubnetID `json:"ids,omitempty"` - - // names specifies a list of AWS subnets by subnet name. - // Subnet names must not start with "subnet-", must not - // include commas, must be under 256 characters in length, - // must be unique, and the total number of subnets - // specified by ids and names must not exceed 10. - // - // +optional - // +listType=atomic - // +kubebuilder:validation:XValidation:rule=`self.all(x, self.exists_one(y, x == y))`,message="subnet names cannot contain duplicates" - // + Note: Though it may seem redundant, MaxItems is necessary to prevent exceeding of the cost budget for the validation rules. - // +kubebuilder:validation:MaxItems=10 - Names []AWSSubnetName `json:"names,omitempty"` -} - -// AWSSubnetID is a reference to an AWS subnet ID. -// +kubebuilder:validation:MinLength=24 -// +kubebuilder:validation:MaxLength=24 -// +kubebuilder:validation:Pattern=`^subnet-[0-9A-Za-z]+$` -type AWSSubnetID string - -// AWSSubnetName is a reference to an AWS subnet name. -// +kubebuilder:validation:MinLength=1 -// +kubebuilder:validation:MaxLength=256 -// +kubebuilder:validation:XValidation:rule=`!self.contains(',')`,message="subnet name cannot contain a comma" -// +kubebuilder:validation:XValidation:rule=`!self.startsWith('subnet-')`,message="subnet name cannot start with 'subnet-'" -type AWSSubnetName string - -// GCPLoadBalancerParameters provides configuration settings that are -// specific to GCP load balancers. -type GCPLoadBalancerParameters struct { - // clientAccess describes how client access is restricted for internal - // load balancers. - // - // Valid values are: - // * "Global": Specifying an internal load balancer with Global client access - // allows clients from any region within the VPC to communicate with the load - // balancer. - // - // https://cloud.google.com/kubernetes-engine/docs/how-to/internal-load-balancing#global_access - // - // * "Local": Specifying an internal load balancer with Local client access - // means only clients within the same region (and VPC) as the GCP load balancer - // can communicate with the load balancer. Note that this is the default behavior. - // - // https://cloud.google.com/load-balancing/docs/internal#client_access - // - // +optional - ClientAccess GCPClientAccess `json:"clientAccess,omitempty"` -} - -// GCPClientAccess describes how client access is restricted for internal -// load balancers. -// +kubebuilder:validation:Enum=Global;Local -type GCPClientAccess string - -const ( - GCPGlobalAccess GCPClientAccess = "Global" - GCPLocalAccess GCPClientAccess = "Local" -) - -// IBMLoadBalancerParameters provides configuration settings that are -// specific to IBM Cloud load balancers. -type IBMLoadBalancerParameters struct { - // protocol specifies whether the load balancer uses PROXY protocol to forward connections to - // the IngressController. See "service.kubernetes.io/ibm-load-balancer-cloud-provider-enable-features: - // "proxy-protocol"" at https://cloud.ibm.com/docs/containers?topic=containers-vpc-lbaas" - // - // PROXY protocol can be used with load balancers that support it to - // communicate the source addresses of client connections when - // forwarding those connections to the IngressController. Using PROXY - // protocol enables the IngressController to report those source - // addresses instead of reporting the load balancer's address in HTTP - // headers and logs. Note that enabling PROXY protocol on the - // IngressController will cause connections to fail if you are not using - // a load balancer that uses PROXY protocol to forward connections to - // the IngressController. See - // http://www.haproxy.org/download/2.2/doc/proxy-protocol.txt for - // information about PROXY protocol. - // - // Valid values for protocol are TCP, PROXY and omitted. - // When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. - // The current default is TCP, without the proxy protocol enabled. - // - // +optional - Protocol IngressControllerProtocol `json:"protocol,omitempty"` -} - -// OpenStackLoadBalancerParameters provides configuration settings that are -// specific to OpenStack load balancers. -type OpenStackLoadBalancerParameters struct { - // loadBalancerIP is tombstoned since the field was replaced by floatingIP. - // LoadBalancerIP string `json:"loadBalancerIP,omitempty"` - - // floatingIP specifies the IP address that the load balancer will use. - // When not specified, an IP address will be assigned randomly by the OpenStack cloud provider. - // When specified, the floating IP has to be pre-created. If the - // specified value is not a floating IP or is already claimed, the - // OpenStack cloud provider won't be able to provision the load - // balancer. - // This field may only be used if the IngressController has External scope. - // This value must be a valid IPv4 or IPv6 address. - // + --- - // + Note: this field is meant to be set by the ingress controller - // + to populate the `Service.Spec.LoadBalancerIP` field which has been - // + deprecated in Kubernetes: - // + https://github.com/kubernetes/kubernetes/pull/107235 - // + However, the field is still used by cloud-provider-openstack to reconcile - // + the floating IP that we attach to the external load balancer. - // - // +kubebuilder:validation:XValidation:rule="isIP(self)",message="floatingIP must be a valid IPv4 or IPv6 address" - // +optional - FloatingIP string `json:"floatingIP,omitempty"` -} - -// AWSClassicLoadBalancerParameters holds configuration parameters for an -// AWS Classic load balancer. -type AWSClassicLoadBalancerParameters struct { - // connectionIdleTimeout specifies the maximum time period that a - // connection may be idle before the load balancer closes the - // connection. The value must be parseable as a time duration value; - // see . A nil or zero value - // means no opinion, in which case a default value is used. The default - // value for this field is 60s. This default is subject to change. - // - // +kubebuilder:validation:Format=duration - // +optional - ConnectionIdleTimeout metav1.Duration `json:"connectionIdleTimeout,omitempty"` - - // subnets specifies the subnets to which the load balancer will - // attach. The subnets may be specified by either their - // ID or name. The total number of subnets is limited to 10. - // - // In order for the load balancer to be provisioned with subnets, - // each subnet must exist, each subnet must be from a different - // availability zone, and the load balancer service must be - // recreated to pick up new values. - // - // When omitted from the spec, the subnets will be auto-discovered - // for each availability zone. Auto-discovered subnets are not reported - // in the status of the IngressController object. - // - // +optional - Subnets *AWSSubnets `json:"subnets,omitempty"` -} - -// AWSNetworkLoadBalancerParameters holds configuration parameters for an -// AWS Network load balancer. For Example: Setting AWS EIPs https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html -// +kubebuilder:validation:XValidation:rule=`has(self.subnets) && has(self.subnets.ids) && has(self.subnets.names) && has(self.eipAllocations) ? size(self.subnets.ids + self.subnets.names) == size(self.eipAllocations) : true`,message="number of subnets must be equal to number of eipAllocations" -// +kubebuilder:validation:XValidation:rule=`has(self.subnets) && has(self.subnets.ids) && !has(self.subnets.names) && has(self.eipAllocations) ? size(self.subnets.ids) == size(self.eipAllocations) : true`,message="number of subnets must be equal to number of eipAllocations" -// +kubebuilder:validation:XValidation:rule=`has(self.subnets) && has(self.subnets.names) && !has(self.subnets.ids) && has(self.eipAllocations) ? size(self.subnets.names) == size(self.eipAllocations) : true`,message="number of subnets must be equal to number of eipAllocations" -type AWSNetworkLoadBalancerParameters struct { - // subnets specifies the subnets to which the load balancer will - // attach. The subnets may be specified by either their - // ID or name. The total number of subnets is limited to 10. - // - // In order for the load balancer to be provisioned with subnets, - // each subnet must exist, each subnet must be from a different - // availability zone, and the load balancer service must be - // recreated to pick up new values. - // - // When omitted from the spec, the subnets will be auto-discovered - // for each availability zone. Auto-discovered subnets are not reported - // in the status of the IngressController object. - // - // +optional - Subnets *AWSSubnets `json:"subnets,omitempty"` - - // eipAllocations is a list of IDs for Elastic IP (EIP) addresses that - // are assigned to the Network Load Balancer. - // The following restrictions apply: - // - // eipAllocations can only be used with external scope, not internal. - // An EIP can be allocated to only a single IngressController. - // The number of EIP allocations must match the number of subnets that are used for the load balancer. - // Each EIP allocation must be unique. - // A maximum of 10 EIP allocations are permitted. - // - // See https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html for general - // information about configuration, characteristics, and limitations of Elastic IP addresses. - // - // +optional - // +listType=atomic - // +kubebuilder:validation:XValidation:rule=`self.all(x, self.exists_one(y, x == y))`,message="eipAllocations cannot contain duplicates" - // +kubebuilder:validation:MaxItems=10 - EIPAllocations []EIPAllocation `json:"eipAllocations"` -} - -// EIPAllocation is an ID for an Elastic IP (EIP) address that can be allocated to an ELB in the AWS environment. -// Values must begin with `eipalloc-` followed by exactly 17 hexadecimal (`[0-9a-fA-F]`) characters. -// + Explanation of the regex `^eipalloc-[0-9a-fA-F]{17}$` for validating value of the EIPAllocation: -// + ^eipalloc- ensures the string starts with "eipalloc-". -// + [0-9a-fA-F]{17} matches exactly 17 hexadecimal characters (0-9, a-f, A-F). -// + $ ensures the string ends after the 17 hexadecimal characters. -// + Example of Valid and Invalid values: -// + eipalloc-1234567890abcdef1 is valid. -// + eipalloc-1234567890abcde is not valid (too short). -// + eipalloc-1234567890abcdefg is not valid (contains a non-hex character 'g'). -// + Max length is calculated as follows: -// + eipalloc- = 9 chars and 17 hexadecimal chars after `-` -// + So, total is 17 + 9 = 26 chars required for value of an EIPAllocation. -// -// +kubebuilder:validation:MinLength=26 -// +kubebuilder:validation:MaxLength=26 -// +kubebuilder:validation:XValidation:rule=`self.startsWith('eipalloc-')`,message="eipAllocations should start with 'eipalloc-'" -// +kubebuilder:validation:XValidation:rule=`self.split("-", 2)[1].matches('[0-9a-fA-F]{17}$')`,message="eipAllocations must be 'eipalloc-' followed by exactly 17 hexadecimal characters (0-9, a-f, A-F)" -type EIPAllocation string - -// HostNetworkStrategy holds parameters for the HostNetwork endpoint publishing -// strategy. -type HostNetworkStrategy struct { - // protocol specifies whether the IngressController expects incoming - // connections to use plain TCP or whether the IngressController expects - // PROXY protocol. - // - // PROXY protocol can be used with load balancers that support it to - // communicate the source addresses of client connections when - // forwarding those connections to the IngressController. Using PROXY - // protocol enables the IngressController to report those source - // addresses instead of reporting the load balancer's address in HTTP - // headers and logs. Note that enabling PROXY protocol on the - // IngressController will cause connections to fail if you are not using - // a load balancer that uses PROXY protocol to forward connections to - // the IngressController. See - // http://www.haproxy.org/download/2.2/doc/proxy-protocol.txt for - // information about PROXY protocol. - // - // The following values are valid for this field: - // - // * The empty string. - // * "TCP". - // * "PROXY". - // - // The empty string specifies the default, which is TCP without PROXY - // protocol. Note that the default is subject to change. - // - // +optional - Protocol IngressControllerProtocol `json:"protocol,omitempty"` - - // httpPort is the port on the host which should be used to listen for - // HTTP requests. This field should be set when port 80 is already in use. - // The value should not coincide with the NodePort range of the cluster. - // When the value is 0 or is not specified it defaults to 80. - // +kubebuilder:validation:Maximum=65535 - // +kubebuilder:validation:Minimum=0 - // +kubebuilder:default=80 - // +optional - HTTPPort int32 `json:"httpPort,omitempty"` - - // httpsPort is the port on the host which should be used to listen for - // HTTPS requests. This field should be set when port 443 is already in use. - // The value should not coincide with the NodePort range of the cluster. - // When the value is 0 or is not specified it defaults to 443. - // +kubebuilder:validation:Maximum=65535 - // +kubebuilder:validation:Minimum=0 - // +kubebuilder:default=443 - // +optional - HTTPSPort int32 `json:"httpsPort,omitempty"` - - // statsPort is the port on the host where the stats from the router are - // published. The value should not coincide with the NodePort range of the - // cluster. If an external load balancer is configured to forward connections - // to this IngressController, the load balancer should use this port for - // health checks. The load balancer can send HTTP probes on this port on a - // given node, with the path /healthz/ready to determine if the ingress - // controller is ready to receive traffic on the node. For proper operation - // the load balancer must not forward traffic to a node until the health - // check reports ready. The load balancer should also stop forwarding requests - // within a maximum of 45 seconds after /healthz/ready starts reporting - // not-ready. Probing every 5 to 10 seconds, with a 5-second timeout and with - // a threshold of two successful or failed requests to become healthy or - // unhealthy respectively, are well-tested values. When the value is 0 or - // is not specified it defaults to 1936. - // +kubebuilder:validation:Maximum=65535 - // +kubebuilder:validation:Minimum=0 - // +kubebuilder:default=1936 - // +optional - StatsPort int32 `json:"statsPort,omitempty"` -} - -// PrivateStrategy holds parameters for the Private endpoint publishing -// strategy. -type PrivateStrategy struct { - // protocol specifies whether the IngressController expects incoming - // connections to use plain TCP or whether the IngressController expects - // PROXY protocol. - // - // PROXY protocol can be used with load balancers that support it to - // communicate the source addresses of client connections when - // forwarding those connections to the IngressController. Using PROXY - // protocol enables the IngressController to report those source - // addresses instead of reporting the load balancer's address in HTTP - // headers and logs. Note that enabling PROXY protocol on the - // IngressController will cause connections to fail if you are not using - // a load balancer that uses PROXY protocol to forward connections to - // the IngressController. See - // http://www.haproxy.org/download/2.2/doc/proxy-protocol.txt for - // information about PROXY protocol. - // - // The following values are valid for this field: - // - // * The empty string. - // * "TCP". - // * "PROXY". - // - // The empty string specifies the default, which is TCP without PROXY - // protocol. Note that the default is subject to change. - // - // +optional - Protocol IngressControllerProtocol `json:"protocol,omitempty"` -} - -// NodePortStrategy holds parameters for the NodePortService endpoint publishing strategy. -type NodePortStrategy struct { - // protocol specifies whether the IngressController expects incoming - // connections to use plain TCP or whether the IngressController expects - // PROXY protocol. - // - // PROXY protocol can be used with load balancers that support it to - // communicate the source addresses of client connections when - // forwarding those connections to the IngressController. Using PROXY - // protocol enables the IngressController to report those source - // addresses instead of reporting the load balancer's address in HTTP - // headers and logs. Note that enabling PROXY protocol on the - // IngressController will cause connections to fail if you are not using - // a load balancer that uses PROXY protocol to forward connections to - // the IngressController. See - // http://www.haproxy.org/download/2.2/doc/proxy-protocol.txt for - // information about PROXY protocol. - // - // The following values are valid for this field: - // - // * The empty string. - // * "TCP". - // * "PROXY". - // - // The empty string specifies the default, which is TCP without PROXY - // protocol. Note that the default is subject to change. - // - // +optional - Protocol IngressControllerProtocol `json:"protocol,omitempty"` -} - -// IngressControllerProtocol specifies whether PROXY protocol is enabled or not. -// +kubebuilder:validation:Enum="";TCP;PROXY -type IngressControllerProtocol string - -const ( - DefaultProtocol IngressControllerProtocol = "" - TCPProtocol IngressControllerProtocol = "TCP" - ProxyProtocol IngressControllerProtocol = "PROXY" -) - -// EndpointPublishingStrategy is a way to publish the endpoints of an -// IngressController, and represents the type and any additional configuration -// for a specific type. -// +union -type EndpointPublishingStrategy struct { - // type is the publishing strategy to use. Valid values are: - // - // * LoadBalancerService - // - // Publishes the ingress controller using a Kubernetes LoadBalancer Service. - // - // In this configuration, the ingress controller deployment uses container - // networking. A LoadBalancer Service is created to publish the deployment. - // - // See: https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer - // - // If domain is set, a wildcard DNS record will be managed to point at the - // LoadBalancer Service's external name. DNS records are managed only in DNS - // zones defined by dns.config.openshift.io/cluster .spec.publicZone and - // .spec.privateZone. - // - // Wildcard DNS management is currently supported only on the AWS, Azure, - // and GCP platforms. - // - // * HostNetwork - // - // Publishes the ingress controller on node ports where the ingress controller - // is deployed. - // - // In this configuration, the ingress controller deployment uses host - // networking, bound to node ports 80 and 443. The user is responsible for - // configuring an external load balancer to publish the ingress controller via - // the node ports. - // - // * Private - // - // Does not publish the ingress controller. - // - // In this configuration, the ingress controller deployment uses container - // networking, and is not explicitly published. The user must manually publish - // the ingress controller. - // - // * NodePortService - // - // Publishes the ingress controller using a Kubernetes NodePort Service. - // - // In this configuration, the ingress controller deployment uses container - // networking. A NodePort Service is created to publish the deployment. The - // specific node ports are dynamically allocated by OpenShift; however, to - // support static port allocations, user changes to the node port - // field of the managed NodePort Service will preserved. - // - // +unionDiscriminator - // +required - Type EndpointPublishingStrategyType `json:"type"` - - // loadBalancer holds parameters for the load balancer. Present only if - // type is LoadBalancerService. - // +optional - LoadBalancer *LoadBalancerStrategy `json:"loadBalancer,omitempty"` - - // hostNetwork holds parameters for the HostNetwork endpoint publishing - // strategy. Present only if type is HostNetwork. - // +optional - HostNetwork *HostNetworkStrategy `json:"hostNetwork,omitempty"` - - // private holds parameters for the Private endpoint publishing - // strategy. Present only if type is Private. - // +optional - Private *PrivateStrategy `json:"private,omitempty"` - - // nodePort holds parameters for the NodePortService endpoint publishing strategy. - // Present only if type is NodePortService. - // +optional - NodePort *NodePortStrategy `json:"nodePort,omitempty"` -} - -// ClientCertificatePolicy describes the policy for client certificates. -// +kubebuilder:validation:Enum="";Required;Optional -type ClientCertificatePolicy string - -const ( - // ClientCertificatePolicyRequired indicates that a client certificate - // should be required. - ClientCertificatePolicyRequired ClientCertificatePolicy = "Required" - - // ClientCertificatePolicyOptional indicates that a client certificate - // should be requested but not required. - ClientCertificatePolicyOptional ClientCertificatePolicy = "Optional" -) - -// ClientTLS specifies TLS configuration to enable client-to-server -// authentication, which can be used for mutual TLS. -type ClientTLS struct { - // clientCertificatePolicy specifies whether the ingress controller - // requires clients to provide certificates. This field accepts the - // values "Required" or "Optional". - // - // Note that the ingress controller only checks client certificates for - // edge-terminated and reencrypt TLS routes; it cannot check - // certificates for cleartext HTTP or passthrough TLS routes. - // - // +required - ClientCertificatePolicy ClientCertificatePolicy `json:"clientCertificatePolicy"` - - // clientCA specifies a configmap containing the PEM-encoded CA - // certificate bundle that should be used to verify a client's - // certificate. The administrator must create this configmap in the - // openshift-config namespace. - // - // +required - ClientCA configv1.ConfigMapNameReference `json:"clientCA"` - - // allowedSubjectPatterns specifies a list of regular expressions that - // should be matched against the distinguished name on a valid client - // certificate to filter requests. The regular expressions must use - // PCRE syntax. If this list is empty, no filtering is performed. If - // the list is nonempty, then at least one pattern must match a client - // certificate's distinguished name or else the ingress controller - // rejects the certificate and denies the connection. - // - // +listType=atomic - // +optional - AllowedSubjectPatterns []string `json:"allowedSubjectPatterns,omitempty"` -} - -// RouteAdmissionPolicy is an admission policy for allowing new route claims. -type RouteAdmissionPolicy struct { - // namespaceOwnership describes how host name claims across namespaces should - // be handled. - // - // Value must be one of: - // - // - Strict: Do not allow routes in different namespaces to claim the same host. - // - // - InterNamespaceAllowed: Allow routes to claim different paths of the same - // host name across namespaces. - // - // If empty, the default is Strict. - // +optional - NamespaceOwnership NamespaceOwnershipCheck `json:"namespaceOwnership,omitempty"` - // wildcardPolicy describes how routes with wildcard policies should - // be handled for the ingress controller. WildcardPolicy controls use - // of routes [1] exposed by the ingress controller based on the route's - // wildcard policy. - // - // [1] https://github.com/openshift/api/blob/master/route/v1/types.go - // - // Note: Updating WildcardPolicy from WildcardsAllowed to WildcardsDisallowed - // will cause admitted routes with a wildcard policy of Subdomain to stop - // working. These routes must be updated to a wildcard policy of None to be - // readmitted by the ingress controller. - // - // WildcardPolicy supports WildcardsAllowed and WildcardsDisallowed values. - // - // If empty, defaults to "WildcardsDisallowed". - // - WildcardPolicy WildcardPolicy `json:"wildcardPolicy,omitempty"` -} - -// WildcardPolicy is a route admission policy component that describes how -// routes with a wildcard policy should be handled. -// +kubebuilder:validation:Enum=WildcardsAllowed;WildcardsDisallowed -type WildcardPolicy string - -const ( - // WildcardPolicyAllowed indicates routes with any wildcard policy are - // admitted by the ingress controller. - WildcardPolicyAllowed WildcardPolicy = "WildcardsAllowed" - - // WildcardPolicyDisallowed indicates only routes with a wildcard policy - // of None are admitted by the ingress controller. - WildcardPolicyDisallowed WildcardPolicy = "WildcardsDisallowed" -) - -// NamespaceOwnershipCheck is a route admission policy component that describes -// how host name claims across namespaces should be handled. -// +kubebuilder:validation:Enum=InterNamespaceAllowed;Strict -type NamespaceOwnershipCheck string - -const ( - // InterNamespaceAllowedOwnershipCheck allows routes to claim different paths of the same host name across namespaces. - InterNamespaceAllowedOwnershipCheck NamespaceOwnershipCheck = "InterNamespaceAllowed" - - // StrictNamespaceOwnershipCheck does not allow routes to claim the same host name across namespaces. - StrictNamespaceOwnershipCheck NamespaceOwnershipCheck = "Strict" -) - -// LoggingDestinationType is a type of destination to which to send log -// messages. -// -// +kubebuilder:validation:Enum=Container;Syslog -type LoggingDestinationType string - -const ( - // Container sends log messages to a sidecar container. - ContainerLoggingDestinationType LoggingDestinationType = "Container" - - // Syslog sends log messages to a syslog endpoint. - SyslogLoggingDestinationType LoggingDestinationType = "Syslog" - - // ContainerLoggingSidecarContainerName is the name of the container - // with the log output in an ingress controller pod when container - // logging is used. - ContainerLoggingSidecarContainerName = "logs" -) - -// SyslogLoggingDestinationParameters describes parameters for the Syslog -// logging destination type. -type SyslogLoggingDestinationParameters struct { - // address is the IP address of the syslog endpoint that receives log - // messages. - // - // +required - Address string `json:"address"` - - // port is the UDP port number of the syslog endpoint that receives log - // messages. - // - // +kubebuilder:validation:Minimum=1 - // +kubebuilder:validation:Maximum=65535 - // +required - Port uint32 `json:"port"` - - // facility specifies the syslog facility of log messages. - // - // If this field is empty, the facility is "local1". - // - // +kubebuilder:validation:Enum=kern;user;mail;daemon;auth;syslog;lpr;news;uucp;cron;auth2;ftp;ntp;audit;alert;cron2;local0;local1;local2;local3;local4;local5;local6;local7 - // +optional - Facility string `json:"facility,omitempty"` - - // maxLength is the maximum length of the log message. - // - // Valid values are integers in the range 480 to 4096, inclusive. - // - // When omitted, the default value is 1024. - // - // +kubebuilder:validation:Maximum=4096 - // +kubebuilder:validation:Minimum=480 - // +kubebuilder:default=1024 - // +default:=1024 - // +optional - MaxLength uint32 `json:"maxLength,omitempty"` -} - -// ContainerLoggingDestinationParameters describes parameters for the Container -// logging destination type. -type ContainerLoggingDestinationParameters struct { - // maxLength is the maximum length of the log message. - // - // Valid values are integers in the range 480 to 8192, inclusive. - // - // When omitted, the default value is 1024. - // - // +kubebuilder:validation:Maximum=8192 - // +kubebuilder:validation:Minimum=480 - // +kubebuilder:default=1024 - // +default:=1024 - // +optional - MaxLength int32 `json:"maxLength,omitempty"` -} - -// LoggingDestination describes a destination for log messages. -// +union -type LoggingDestination struct { - // type is the type of destination for logs. It must be one of the - // following: - // - // * Container - // - // The ingress operator configures the sidecar container named "logs" on - // the ingress controller pod and configures the ingress controller to - // write logs to the sidecar. The logs are then available as container - // logs. The expectation is that the administrator configures a custom - // logging solution that reads logs from this sidecar. Note that using - // container logs means that logs may be dropped if the rate of logs - // exceeds the container runtime's or the custom logging solution's - // capacity. - // - // * Syslog - // - // Logs are sent to a syslog endpoint. The administrator must specify - // an endpoint that can receive syslog messages. The expectation is - // that the administrator has configured a custom syslog instance. - // - // +unionDiscriminator - // +required - Type LoggingDestinationType `json:"type"` - - // syslog holds parameters for a syslog endpoint. Present only if - // type is Syslog. - // - // +optional - Syslog *SyslogLoggingDestinationParameters `json:"syslog,omitempty"` - - // container holds parameters for the Container logging destination. - // Present only if type is Container. - // - // +optional - Container *ContainerLoggingDestinationParameters `json:"container,omitempty"` -} - -// IngressControllerCaptureHTTPHeader describes an HTTP header that should be -// captured. -type IngressControllerCaptureHTTPHeader struct { - // name specifies a header name. Its value must be a valid HTTP header - // name as defined in RFC 2616 section 4.2. - // - // +kubebuilder:validation:Pattern="^[-!#$%&'*+.0-9A-Z^_`a-z|~]+$" - // +required - Name string `json:"name"` - - // maxLength specifies a maximum length for the header value. If a - // header value exceeds this length, the value will be truncated in the - // log message. Note that the ingress controller may impose a separate - // bound on the total length of HTTP headers in a request. - // - // +kubebuilder:validation:Minimum=1 - // +required - MaxLength int `json:"maxLength"` -} - -// IngressControllerCaptureHTTPHeaders specifies which HTTP headers the -// IngressController captures. -type IngressControllerCaptureHTTPHeaders struct { - // request specifies which HTTP request headers to capture. - // - // If this field is empty, no request headers are captured. - // - // +nullable - // +optional - // +listType=atomic - Request []IngressControllerCaptureHTTPHeader `json:"request,omitempty"` - - // response specifies which HTTP response headers to capture. - // - // If this field is empty, no response headers are captured. - // - // +nullable - // +optional - // +listType=atomic - Response []IngressControllerCaptureHTTPHeader `json:"response,omitempty"` -} - -// CookieMatchType indicates the type of matching used against cookie names to -// select a cookie for capture. -// +kubebuilder:validation:Enum=Exact;Prefix -type CookieMatchType string - -const ( - // CookieMatchTypeExact indicates that an exact string match should be - // performed. - CookieMatchTypeExact CookieMatchType = "Exact" - // CookieMatchTypePrefix indicates that a string prefix match should be - // performed. - CookieMatchTypePrefix CookieMatchType = "Prefix" -) - -// IngressControllerCaptureHTTPCookie describes an HTTP cookie that should be -// captured. -type IngressControllerCaptureHTTPCookie struct { - IngressControllerCaptureHTTPCookieUnion `json:",inline"` - - // maxLength specifies a maximum length of the string that will be - // logged, which includes the cookie name, cookie value, and - // one-character delimiter. If the log entry exceeds this length, the - // value will be truncated in the log message. Note that the ingress - // controller may impose a separate bound on the total length of HTTP - // headers in a request. - // - // +kubebuilder:validation:Minimum=1 - // +kubebuilder:validation:Maximum=1024 - // +required - MaxLength int `json:"maxLength"` -} - -// IngressControllerCaptureHTTPCookieUnion describes optional fields of an HTTP cookie that should be captured. -// +union -type IngressControllerCaptureHTTPCookieUnion struct { - // matchType specifies the type of match to be performed on the cookie - // name. Allowed values are "Exact" for an exact string match and - // "Prefix" for a string prefix match. If "Exact" is specified, a name - // must be specified in the name field. If "Prefix" is provided, a - // prefix must be specified in the namePrefix field. For example, - // specifying matchType "Prefix" and namePrefix "foo" will capture a - // cookie named "foo" or "foobar" but not one named "bar". The first - // matching cookie is captured. - // - // +unionDiscriminator - // +required - MatchType CookieMatchType `json:"matchType"` - - // name specifies a cookie name. Its value must be a valid HTTP cookie - // name as defined in RFC 6265 section 4.1. - // - // +kubebuilder:validation:Pattern="^[-!#$%&'*+.0-9A-Z^_`a-z|~]*$" - // +kubebuilder:validation:MinLength=0 - // +kubebuilder:validation:MaxLength=1024 - // +optional - Name string `json:"name"` - - // namePrefix specifies a cookie name prefix. Its value must be a valid - // HTTP cookie name as defined in RFC 6265 section 4.1. - // - // +kubebuilder:validation:Pattern="^[-!#$%&'*+.0-9A-Z^_`a-z|~]*$" - // +kubebuilder:validation:MinLength=0 - // +kubebuilder:validation:MaxLength=1024 - // +optional - NamePrefix string `json:"namePrefix"` -} - -// LoggingPolicy indicates how an event should be logged. -// +kubebuilder:validation:Enum=Log;Ignore -type LoggingPolicy string - -const ( - // LoggingPolicyLog indicates that an event should be logged. - LoggingPolicyLog LoggingPolicy = "Log" - // LoggingPolicyIgnore indicates that an event should not be logged. - LoggingPolicyIgnore LoggingPolicy = "Ignore" -) - -// AccessLogging describes how client requests should be logged. -type AccessLogging struct { - // destination is where access logs go. - // - // +required - Destination LoggingDestination `json:"destination"` - - // httpLogFormat specifies the format of the log message for an HTTP - // request. - // - // If this field is empty, log messages use the implementation's default - // HTTP log format. For HAProxy's default HTTP log format, see the - // HAProxy documentation: - // http://cbonte.github.io/haproxy-dconv/2.0/configuration.html#8.2.3 - // - // Note that this format only applies to cleartext HTTP connections - // and to secure HTTP connections for which the ingress controller - // terminates encryption (that is, edge-terminated or reencrypt - // connections). It does not affect the log format for TLS passthrough - // connections. - // - // +optional - HttpLogFormat string `json:"httpLogFormat,omitempty"` - - // httpCaptureHeaders defines HTTP headers that should be captured in - // access logs. If this field is empty, no headers are captured. - // - // Note that this option only applies to cleartext HTTP connections - // and to secure HTTP connections for which the ingress controller - // terminates encryption (that is, edge-terminated or reencrypt - // connections). Headers cannot be captured for TLS passthrough - // connections. - // - // +optional - HTTPCaptureHeaders IngressControllerCaptureHTTPHeaders `json:"httpCaptureHeaders,omitempty"` - - // httpCaptureCookies specifies HTTP cookies that should be captured in - // access logs. If this field is empty, no cookies are captured. - // - // +nullable - // +optional - // +kubebuilder:validation:MaxItems=1 - // +listType=atomic - HTTPCaptureCookies []IngressControllerCaptureHTTPCookie `json:"httpCaptureCookies,omitempty"` - - // logEmptyRequests specifies how connections on which no request is - // received should be logged. Typically, these empty requests come from - // load balancers' health probes or Web browsers' speculative - // connections ("preconnect"), in which case logging these requests may - // be undesirable. However, these requests may also be caused by - // network errors, in which case logging empty requests may be useful - // for diagnosing the errors. In addition, these requests may be caused - // by port scans, in which case logging empty requests may aid in - // detecting intrusion attempts. Allowed values for this field are - // "Log" and "Ignore". The default value is "Log". - // - // +optional - // +kubebuilder:default:="Log" - LogEmptyRequests LoggingPolicy `json:"logEmptyRequests,omitempty"` -} - -// IngressControllerLogging describes what should be logged where. -type IngressControllerLogging struct { - // access describes how the client requests should be logged. - // - // If this field is empty, access logging is disabled. - // - // +optional - Access *AccessLogging `json:"access,omitempty"` -} - -// IngressControllerHTTPHeaderPolicy is a policy for setting HTTP headers. -// -// +kubebuilder:validation:Enum=Append;Replace;IfNone;Never -type IngressControllerHTTPHeaderPolicy string - -const ( - // AppendHTTPHeaderPolicy appends the header, preserving any existing header. - AppendHTTPHeaderPolicy IngressControllerHTTPHeaderPolicy = "Append" - // ReplaceHTTPHeaderPolicy sets the header, removing any existing header. - ReplaceHTTPHeaderPolicy IngressControllerHTTPHeaderPolicy = "Replace" - // IfNoneHTTPHeaderPolicy sets the header if it is not already set. - IfNoneHTTPHeaderPolicy IngressControllerHTTPHeaderPolicy = "IfNone" - // NeverHTTPHeaderPolicy never sets the header, preserving any existing - // header. - NeverHTTPHeaderPolicy IngressControllerHTTPHeaderPolicy = "Never" -) - -// IngressControllerHTTPUniqueIdHeaderPolicy describes configuration for a -// unique id header. -type IngressControllerHTTPUniqueIdHeaderPolicy struct { - // name specifies the name of the HTTP header (for example, "unique-id") - // that the ingress controller should inject into HTTP requests. The - // field's value must be a valid HTTP header name as defined in RFC 2616 - // section 4.2. If the field is empty, no header is injected. - // - // +optional - // +kubebuilder:validation:Pattern="^$|^[-!#$%&'*+.0-9A-Z^_`a-z|~]+$" - // +kubebuilder:validation:MinLength=0 - // +kubebuilder:validation:MaxLength=1024 - Name string `json:"name,omitempty"` - - // format specifies the format for the injected HTTP header's value. - // This field has no effect unless name is specified. For the - // HAProxy-based ingress controller implementation, this format uses the - // same syntax as the HTTP log format. If the field is empty, the - // default value is "%{+X}o\\ %ci:%cp_%fi:%fp_%Ts_%rt:%pid"; see the - // corresponding HAProxy documentation: - // http://cbonte.github.io/haproxy-dconv/2.0/configuration.html#8.2.3 - // - // +optional - // +kubebuilder:validation:Pattern="^(%(%|(\\{[-+]?[QXE](,[-+]?[QXE])*\\})?([A-Za-z]+|\\[[.0-9A-Z_a-z]+(\\([^)]+\\))?(,[.0-9A-Z_a-z]+(\\([^)]+\\))?)*\\]))|[^%[:cntrl:]])*$" - // +kubebuilder:validation:MinLength=0 - // +kubebuilder:validation:MaxLength=1024 - Format string `json:"format,omitempty"` -} - -// IngressControllerHTTPHeaderNameCaseAdjustment is the name of an HTTP header -// (for example, "X-Forwarded-For") in the desired capitalization. The value -// must be a valid HTTP header name as defined in RFC 2616 section 4.2. -// -// +kubebuilder:validation:Pattern="^$|^[-!#$%&'*+.0-9A-Z^_`a-z|~]+$" -// +kubebuilder:validation:MinLength=0 -// +kubebuilder:validation:MaxLength=1024 -type IngressControllerHTTPHeaderNameCaseAdjustment string - -// IngressControllerHTTPHeaders specifies how the IngressController handles -// certain HTTP headers. -type IngressControllerHTTPHeaders struct { - // forwardedHeaderPolicy specifies when and how the IngressController - // sets the Forwarded, X-Forwarded-For, X-Forwarded-Host, - // X-Forwarded-Port, X-Forwarded-Proto, and X-Forwarded-Proto-Version - // HTTP headers. The value may be one of the following: - // - // * "Append", which specifies that the IngressController appends the - // headers, preserving existing headers. - // - // * "Replace", which specifies that the IngressController sets the - // headers, replacing any existing Forwarded or X-Forwarded-* headers. - // - // * "IfNone", which specifies that the IngressController sets the - // headers if they are not already set. - // - // * "Never", which specifies that the IngressController never sets the - // headers, preserving any existing headers. - // - // By default, the policy is "Append". - // - // +optional - ForwardedHeaderPolicy IngressControllerHTTPHeaderPolicy `json:"forwardedHeaderPolicy,omitempty"` - - // uniqueId describes configuration for a custom HTTP header that the - // ingress controller should inject into incoming HTTP requests. - // Typically, this header is configured to have a value that is unique - // to the HTTP request. The header can be used by applications or - // included in access logs to facilitate tracing individual HTTP - // requests. - // - // If this field is empty, no such header is injected into requests. - // - // +optional - UniqueId IngressControllerHTTPUniqueIdHeaderPolicy `json:"uniqueId,omitempty"` - - // headerNameCaseAdjustments specifies case adjustments that can be - // applied to HTTP header names. Each adjustment is specified as an - // HTTP header name with the desired capitalization. For example, - // specifying "X-Forwarded-For" indicates that the "x-forwarded-for" - // HTTP header should be adjusted to have the specified capitalization. - // - // These adjustments are only applied to cleartext, edge-terminated, and - // re-encrypt routes, and only when using HTTP/1. - // - // For request headers, these adjustments are applied only for routes - // that have the haproxy.router.openshift.io/h1-adjust-case=true - // annotation. For response headers, these adjustments are applied to - // all HTTP responses. - // - // If this field is empty, no request headers are adjusted. - // - // +nullable - // +optional - // +listType=atomic - HeaderNameCaseAdjustments []IngressControllerHTTPHeaderNameCaseAdjustment `json:"headerNameCaseAdjustments,omitempty"` - - // actions specifies options for modifying headers and their values. - // Note that this option only applies to cleartext HTTP connections - // and to secure HTTP connections for which the ingress controller - // terminates encryption (that is, edge-terminated or reencrypt - // connections). Headers cannot be modified for TLS passthrough - // connections. - // Setting the HSTS (`Strict-Transport-Security`) header is not supported via actions. `Strict-Transport-Security` - // may only be configured using the "haproxy.router.openshift.io/hsts_header" route annotation, and only in - // accordance with the policy specified in Ingress.Spec.RequiredHSTSPolicies. - // Any actions defined here are applied after any actions related to the following other fields: - // cache-control, spec.clientTLS, - // spec.httpHeaders.forwardedHeaderPolicy, spec.httpHeaders.uniqueId, - // and spec.httpHeaders.headerNameCaseAdjustments. - // In case of HTTP request headers, the actions specified in spec.httpHeaders.actions on the Route will be executed after - // the actions specified in the IngressController's spec.httpHeaders.actions field. - // In case of HTTP response headers, the actions specified in spec.httpHeaders.actions on the IngressController will be - // executed after the actions specified in the Route's spec.httpHeaders.actions field. - // Headers set using this API cannot be captured for use in access logs. - // The following header names are reserved and may not be modified via this API: - // Strict-Transport-Security, Proxy, Host, Cookie, Set-Cookie. - // Note that the total size of all net added headers *after* interpolating dynamic values - // must not exceed the value of spec.tuningOptions.headerBufferMaxRewriteBytes on the - // IngressController. Please refer to the documentation - // for that API field for more details. - // +optional - Actions IngressControllerHTTPHeaderActions `json:"actions,omitempty"` -} - -// IngressControllerHTTPHeaderActions defines configuration for actions on HTTP request and response headers. -type IngressControllerHTTPHeaderActions struct { - // response is a list of HTTP response headers to modify. - // Actions defined here will modify the response headers of all requests passing through an ingress controller. - // These actions are applied to all Routes i.e. for all connections handled by the ingress controller defined within a cluster. - // IngressController actions for response headers will be executed after Route actions. - // Currently, actions may define to either `Set` or `Delete` headers values. - // Actions are applied in sequence as defined in this list. - // A maximum of 20 response header actions may be configured. - // Sample fetchers allowed are "res.hdr" and "ssl_c_der". - // Converters allowed are "lower" and "base64". - // Example header values: "%[res.hdr(X-target),lower]", "%{+Q}[ssl_c_der,base64]". - // +listType=map - // +listMapKey=name - // +optional - // +kubebuilder:validation:MaxItems=20 - // +kubebuilder:validation:XValidation:rule=`self.all(key, key.action.type == "Delete" || (has(key.action.set) && key.action.set.value.matches('^(?:%(?:%|(?:\\{[-+]?[QXE](?:,[-+]?[QXE])*\\})?\\[(?:res\\.hdr\\([0-9A-Za-z-]+\\)|ssl_c_der)(?:,(?:lower|base64))*\\])|[^%[:cntrl:]])+$')))`,message="Either the header value provided is not in correct format or the sample fetcher/converter specified is not allowed. The dynamic header value will be interpreted as an HAProxy format string as defined in http://cbonte.github.io/haproxy-dconv/2.6/configuration.html#8.2.6 and may use HAProxy's %[] syntax and otherwise must be a valid HTTP header value as defined in https://datatracker.ietf.org/doc/html/rfc7230#section-3.2. Sample fetchers allowed are res.hdr, ssl_c_der. Converters allowed are lower, base64." - Response []IngressControllerHTTPHeader `json:"response"` - // request is a list of HTTP request headers to modify. - // Actions defined here will modify the request headers of all requests passing through an ingress controller. - // These actions are applied to all Routes i.e. for all connections handled by the ingress controller defined within a cluster. - // IngressController actions for request headers will be executed before Route actions. - // Currently, actions may define to either `Set` or `Delete` headers values. - // Actions are applied in sequence as defined in this list. - // A maximum of 20 request header actions may be configured. - // Sample fetchers allowed are "req.hdr" and "ssl_c_der". - // Converters allowed are "lower" and "base64". - // Example header values: "%[req.hdr(X-target),lower]", "%{+Q}[ssl_c_der,base64]". - // + --- - // + Note: Any change to regex mentioned below must be reflected in the CRD validation of route in https://github.com/openshift/library-go/blob/master/pkg/route/validation/validation.go and vice-versa. - // +listType=map - // +listMapKey=name - // +optional - // +kubebuilder:validation:MaxItems=20 - // +kubebuilder:validation:XValidation:rule=`self.all(key, key.action.type == "Delete" || (has(key.action.set) && key.action.set.value.matches('^(?:%(?:%|(?:\\{[-+]?[QXE](?:,[-+]?[QXE])*\\})?\\[(?:req\\.hdr\\([0-9A-Za-z-]+\\)|ssl_c_der)(?:,(?:lower|base64))*\\])|[^%[:cntrl:]])+$')))`,message="Either the header value provided is not in correct format or the sample fetcher/converter specified is not allowed. The dynamic header value will be interpreted as an HAProxy format string as defined in http://cbonte.github.io/haproxy-dconv/2.6/configuration.html#8.2.6 and may use HAProxy's %[] syntax and otherwise must be a valid HTTP header value as defined in https://datatracker.ietf.org/doc/html/rfc7230#section-3.2. Sample fetchers allowed are req.hdr, ssl_c_der. Converters allowed are lower, base64." - Request []IngressControllerHTTPHeader `json:"request"` -} - -// IngressControllerHTTPHeader specifies configuration for setting or deleting an HTTP header. -type IngressControllerHTTPHeader struct { - // name specifies the name of a header on which to perform an action. Its value must be a valid HTTP header - // name as defined in RFC 2616 section 4.2. - // The name must consist only of alphanumeric and the following special characters, "-!#$%&'*+.^_`". - // The following header names are reserved and may not be modified via this API: - // Strict-Transport-Security, Proxy, Host, Cookie, Set-Cookie. - // It must be no more than 255 characters in length. - // Header name must be unique. - // +required - // +kubebuilder:validation:MinLength=1 - // +kubebuilder:validation:MaxLength=255 - // +kubebuilder:validation:Pattern="^[-!#$%&'*+.0-9A-Z^_`a-z|~]+$" - // +kubebuilder:validation:XValidation:rule="self.lowerAscii() != 'strict-transport-security'",message="strict-transport-security header may not be modified via header actions" - // +kubebuilder:validation:XValidation:rule="self.lowerAscii() != 'proxy'",message="proxy header may not be modified via header actions" - // +kubebuilder:validation:XValidation:rule="self.lowerAscii() != 'host'",message="host header may not be modified via header actions" - // +kubebuilder:validation:XValidation:rule="self.lowerAscii() != 'cookie'",message="cookie header may not be modified via header actions" - // +kubebuilder:validation:XValidation:rule="self.lowerAscii() != 'set-cookie'",message="set-cookie header may not be modified via header actions" - Name string `json:"name"` - // action specifies actions to perform on headers, such as setting or deleting headers. - // +required - Action IngressControllerHTTPHeaderActionUnion `json:"action"` -} - -// IngressControllerHTTPHeaderActionUnion specifies an action to take on an HTTP header. -// +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'Set' ? has(self.set) : !has(self.set)",message="set is required when type is Set, and forbidden otherwise" -// +union -type IngressControllerHTTPHeaderActionUnion struct { - // type defines the type of the action to be applied on the header. - // Possible values are Set or Delete. - // Set allows you to set HTTP request and response headers. - // Delete allows you to delete HTTP request and response headers. - // +unionDiscriminator - // +kubebuilder:validation:Enum:=Set;Delete - // +required - Type IngressControllerHTTPHeaderActionType `json:"type"` - - // set specifies how the HTTP header should be set. - // This field is required when type is Set and forbidden otherwise. - // +optional - // +unionMember - Set *IngressControllerSetHTTPHeader `json:"set,omitempty"` -} - -// IngressControllerHTTPHeaderActionType defines actions that can be performed on HTTP headers. -type IngressControllerHTTPHeaderActionType string - -const ( - // Set specifies that an HTTP header should be set. - Set IngressControllerHTTPHeaderActionType = "Set" - // Delete specifies that an HTTP header should be deleted. - Delete IngressControllerHTTPHeaderActionType = "Delete" -) - -// IngressControllerSetHTTPHeader defines the value which needs to be set on an HTTP header. -type IngressControllerSetHTTPHeader struct { - // value specifies a header value. - // Dynamic values can be added. The value will be interpreted as an HAProxy format string as defined in - // http://cbonte.github.io/haproxy-dconv/2.6/configuration.html#8.2.6 and may use HAProxy's %[] syntax and - // otherwise must be a valid HTTP header value as defined in https://datatracker.ietf.org/doc/html/rfc7230#section-3.2. - // The value of this field must be no more than 16384 characters in length. - // Note that the total size of all net added headers *after* interpolating dynamic values - // must not exceed the value of spec.tuningOptions.headerBufferMaxRewriteBytes on the - // IngressController. - // + --- - // + Note: This limit was selected as most common web servers have a limit of 16384 characters or some lower limit. - // + See . - // +required - // +kubebuilder:validation:MinLength=1 - // +kubebuilder:validation:MaxLength=16384 - Value string `json:"value"` -} - -// IngressControllerTuningOptions specifies options for tuning the performance -// of ingress controller pods -type IngressControllerTuningOptions struct { - // headerBufferBytes describes how much memory should be reserved - // (in bytes) for IngressController connection sessions. - // Note that this value must be at least 16384 if HTTP/2 is - // enabled for the IngressController (https://tools.ietf.org/html/rfc7540). - // If this field is empty, the IngressController will use a default value - // of 32768 bytes. - // - // Setting this field is generally not recommended as headerBufferBytes - // values that are too small may break the IngressController and - // headerBufferBytes values that are too large could cause the - // IngressController to use significantly more memory than necessary. - // - // +kubebuilder:validation:Minimum=16384 - // +optional - HeaderBufferBytes int32 `json:"headerBufferBytes,omitempty"` - - // headerBufferMaxRewriteBytes describes how much memory should be reserved - // (in bytes) from headerBufferBytes for HTTP header rewriting - // and appending for IngressController connection sessions. - // Note that incoming HTTP requests will be limited to - // (headerBufferBytes - headerBufferMaxRewriteBytes) bytes, meaning - // headerBufferBytes must be greater than headerBufferMaxRewriteBytes. - // If this field is empty, the IngressController will use a default value - // of 8192 bytes. - // - // Setting this field is generally not recommended as - // headerBufferMaxRewriteBytes values that are too small may break the - // IngressController and headerBufferMaxRewriteBytes values that are too - // large could cause the IngressController to use significantly more memory - // than necessary. - // - // +kubebuilder:validation:Minimum=4096 - // +optional - HeaderBufferMaxRewriteBytes int32 `json:"headerBufferMaxRewriteBytes,omitempty"` - - // threadCount defines the number of threads created per HAProxy process. - // Creating more threads allows each ingress controller pod to handle more - // connections, at the cost of more system resources being used. HAProxy - // currently supports up to 64 threads. If this field is empty, the - // IngressController will use the default value. The current default is 4 - // threads, but this may change in future releases. - // - // Setting this field is generally not recommended. Increasing the number - // of HAProxy threads allows ingress controller pods to utilize more CPU - // time under load, potentially starving other pods if set too high. - // Reducing the number of threads may cause the ingress controller to - // perform poorly. - // - // +kubebuilder:validation:Minimum=1 - // +kubebuilder:validation:Maximum=64 - // +optional - ThreadCount int32 `json:"threadCount,omitempty"` - - // clientTimeout defines how long a connection will be held open while - // waiting for a client response. - // - // If unset, the default timeout is 30s - // +kubebuilder:validation:Format=duration - // +optional - ClientTimeout *metav1.Duration `json:"clientTimeout,omitempty"` - - // clientFinTimeout defines how long a connection will be held open while - // waiting for the client response to the server/backend closing the - // connection. - // - // If unset, the default timeout is 1s - // +kubebuilder:validation:Format=duration - // +optional - ClientFinTimeout *metav1.Duration `json:"clientFinTimeout,omitempty"` - - // serverTimeout defines how long a connection will be held open while - // waiting for a server/backend response. - // - // If unset, the default timeout is 30s - // +kubebuilder:validation:Format=duration - // +optional - ServerTimeout *metav1.Duration `json:"serverTimeout,omitempty"` - - // serverFinTimeout defines how long a connection will be held open while - // waiting for the server/backend response to the client closing the - // connection. - // - // If unset, the default timeout is 1s - // +kubebuilder:validation:Format=duration - // +optional - ServerFinTimeout *metav1.Duration `json:"serverFinTimeout,omitempty"` - - // tunnelTimeout defines how long a tunnel connection (including - // websockets) will be held open while the tunnel is idle. - // - // If unset, the default timeout is 1h - // +kubebuilder:validation:Format=duration - // +optional - TunnelTimeout *metav1.Duration `json:"tunnelTimeout,omitempty"` - - // connectTimeout defines the maximum time to wait for - // a connection attempt to a server/backend to succeed. - // - // This field expects an unsigned duration string of decimal numbers, each with optional - // fraction and a unit suffix, e.g. "300ms", "1.5h" or "2h45m". - // Valid time units are "ns", "us" (or "µs" U+00B5 or "μs" U+03BC), "ms", "s", "m", "h". - // - // When omitted, this means the user has no opinion and the platform is left - // to choose a reasonable default. This default is subject to change over time. - // The current default is 5s. - // - // +kubebuilder:validation:Pattern=^(0|([0-9]+(\.[0-9]+)?(ns|us|µs|μs|ms|s|m|h))+)$ - // +kubebuilder:validation:Type:=string - // +optional - ConnectTimeout *metav1.Duration `json:"connectTimeout,omitempty"` - - // httpKeepAliveTimeout defines the maximum allowed time to wait for - // a new HTTP request to appear on a connection from the client to the router. - // - // This field expects an unsigned duration string of a decimal number, with optional - // fraction and a unit suffix, e.g. "300ms", "1.5s" or "2m45s". - // Valid time units are "ms", "s", "m". - // The allowed range is from 1 millisecond to 15 minutes. - // - // When omitted, this means the user has no opinion and the platform is left - // to choose a reasonable default. This default is subject to change over time. - // The current default is 300s. - // - // Low values (tens of milliseconds or less) can cause clients to close and reopen connections - // for each request, leading to reduced connection sharing. - // For HTTP/2, special care should be taken with low values. - // A few seconds is a reasonable starting point to avoid holding idle connections open - // while still allowing subsequent requests to reuse the connection. - // - // High values (minutes or more) favor connection reuse but may cause idle - // connections to linger longer. - // - // +kubebuilder:validation:Type:=string - // +kubebuilder:validation:XValidation:rule="self.matches('^([0-9]+(\\\\.[0-9]+)?(ms|s|m))+$')",message="httpKeepAliveTimeout must be a valid duration string composed of an unsigned integer value, optionally followed by a decimal fraction and a unit suffix (ms, s, m)" - // +kubebuilder:validation:XValidation:rule="!self.matches('^([0-9]+(\\\\.[0-9]+)?(ms|s|m))+$') || duration(self) <= duration('15m')",message="httpKeepAliveTimeout must be less than or equal to 15 minutes" - // +kubebuilder:validation:XValidation:rule="!self.matches('^([0-9]+(\\\\.[0-9]+)?(ms|s|m))+$') || duration(self) >= duration('1ms')",message="httpKeepAliveTimeout must be greater than or equal to 1 millisecond" - // +kubebuilder:validation:MinLength=1 - // +kubebuilder:validation:MaxLength=16 - // +optional - HTTPKeepAliveTimeout *metav1.Duration `json:"httpKeepAliveTimeout,omitempty"` - - // tlsInspectDelay defines how long the router can hold data to find a - // matching route. - // - // Setting this too short can cause the router to fall back to the default - // certificate for edge-terminated or reencrypt routes even when a better - // matching certificate could be used. - // - // If unset, the default inspect delay is 5s - // +kubebuilder:validation:Format=duration - // +optional - TLSInspectDelay *metav1.Duration `json:"tlsInspectDelay,omitempty"` - - // healthCheckInterval defines how long the router waits between two consecutive - // health checks on its configured backends. This value is applied globally as - // a default for all routes, but may be overridden per-route by the route annotation - // "router.openshift.io/haproxy.health.check.interval". - // - // Expects an unsigned duration string of decimal numbers, each with optional - // fraction and a unit suffix, eg "300ms", "1.5h" or "2h45m". - // Valid time units are "ns", "us" (or "µs" U+00B5 or "μs" U+03BC), "ms", "s", "m", "h". - // - // Setting this to less than 5s can cause excess traffic due to too frequent - // TCP health checks and accompanying SYN packet storms. Alternatively, setting - // this too high can result in increased latency, due to backend servers that are no - // longer available, but haven't yet been detected as such. - // - // An empty or zero healthCheckInterval means no opinion and IngressController chooses - // a default, which is subject to change over time. - // Currently the default healthCheckInterval value is 5s. - // - // Currently the minimum allowed value is 1s and the maximum allowed value is - // 2147483647ms (24.85 days). Both are subject to change over time. - // - // +kubebuilder:validation:Pattern=^(0|([0-9]+(\.[0-9]+)?(ns|us|µs|μs|ms|s|m|h))+)$ - // +kubebuilder:validation:Type:=string - // +optional - HealthCheckInterval *metav1.Duration `json:"healthCheckInterval,omitempty"` - - // maxConnections defines the maximum number of simultaneous - // connections that can be established per HAProxy process. - // Increasing this value allows each ingress controller pod to - // handle more connections but at the cost of additional - // system resources being consumed. - // - // Permitted values are: empty, 0, -1, and the range - // 2000-2000000. - // - // If this field is empty or 0, the IngressController will use - // the default value of 50000, but the default is subject to - // change in future releases. - // - // If the value is -1 then HAProxy will dynamically compute a - // maximum value based on the available ulimits in the running - // container. Selecting -1 (i.e., auto) will result in a large - // value being computed (~520000 on OpenShift >=4.10 clusters) - // and therefore each HAProxy process will incur significant - // memory usage compared to the current default of 50000. - // - // Setting a value that is greater than the current operating - // system limit will prevent the HAProxy process from - // starting. - // - // If you choose a discrete value (e.g., 750000) and the - // router pod is migrated to a new node, there's no guarantee - // that that new node has identical ulimits configured. In - // such a scenario the pod would fail to start. If you have - // nodes with different ulimits configured (e.g., different - // tuned profiles) and you choose a discrete value then the - // guidance is to use -1 and let the value be computed - // dynamically at runtime. - // - // You can monitor memory usage for router containers with the - // following metric: - // 'container_memory_working_set_bytes{container="router",namespace="openshift-ingress"}'. - // - // You can monitor memory usage of individual HAProxy - // processes in router containers with the following metric: - // 'container_memory_working_set_bytes{container="router",namespace="openshift-ingress"}/container_processes{container="router",namespace="openshift-ingress"}'. - // - // +optional - MaxConnections int32 `json:"maxConnections,omitempty"` - - // reloadInterval defines the minimum interval at which the router is allowed to reload - // to accept new changes. Increasing this value can prevent the accumulation of - // HAProxy processes, depending on the scenario. Increasing this interval can - // also lessen load imbalance on a backend's servers when using the roundrobin - // balancing algorithm. Alternatively, decreasing this value may decrease latency - // since updates to HAProxy's configuration can take effect more quickly. - // - // The value must be a time duration value; see . - // Currently, the minimum value allowed is 1s, and the maximum allowed value is - // 120s. Minimum and maximum allowed values may change in future versions of OpenShift. - // Note that if a duration outside of these bounds is provided, the value of reloadInterval - // will be capped/floored and not rejected (e.g. a duration of over 120s will be capped to - // 120s; the IngressController will not reject and replace this disallowed value with - // the default). - // - // A zero value for reloadInterval tells the IngressController to choose the default, - // which is currently 5s and subject to change without notice. - // - // This field expects an unsigned duration string of decimal numbers, each with optional - // fraction and a unit suffix, e.g. "300ms", "1.5h" or "2h45m". - // Valid time units are "ns", "us" (or "µs" U+00B5 or "μs" U+03BC), "ms", "s", "m", "h". - // - // Note: Setting a value significantly larger than the default of 5s can cause latency - // in observing updates to routes and their endpoints. HAProxy's configuration will - // be reloaded less frequently, and newly created routes will not be served until the - // subsequent reload. - // - // +kubebuilder:validation:Pattern=^(0|([0-9]+(\.[0-9]+)?(ns|us|µs|μs|ms|s|m|h))+)$ - // +kubebuilder:validation:Type:=string - // +optional - ReloadInterval metav1.Duration `json:"reloadInterval,omitempty"` -} - -// HTTPEmptyRequestsPolicy indicates how HTTP connections for which no request -// is received should be handled. -// +kubebuilder:validation:Enum=Respond;Ignore -type HTTPEmptyRequestsPolicy string - -const ( - // HTTPEmptyRequestsPolicyRespond indicates that the ingress controller - // should respond to empty requests. - HTTPEmptyRequestsPolicyRespond HTTPEmptyRequestsPolicy = "Respond" - // HTTPEmptyRequestsPolicyIgnore indicates that the ingress controller - // should ignore empty requests. - HTTPEmptyRequestsPolicyIgnore HTTPEmptyRequestsPolicy = "Ignore" -) - -var ( - // Available indicates the ingress controller deployment is available. - IngressControllerAvailableConditionType = "Available" - // LoadBalancerManaged indicates the management status of any load balancer - // service associated with an ingress controller. - LoadBalancerManagedIngressConditionType = "LoadBalancerManaged" - // LoadBalancerReady indicates the ready state of any load balancer service - // associated with an ingress controller. - LoadBalancerReadyIngressConditionType = "LoadBalancerReady" - // DNSManaged indicates the management status of any DNS records for the - // ingress controller. - DNSManagedIngressConditionType = "DNSManaged" - // DNSReady indicates the ready state of any DNS records for the ingress - // controller. - DNSReadyIngressConditionType = "DNSReady" -) - -// IngressControllerStatus defines the observed status of the IngressController. -type IngressControllerStatus struct { - // availableReplicas is number of observed available replicas according to the - // ingress controller deployment. - // +optional - AvailableReplicas int32 `json:"availableReplicas"` - - // selector is a label selector, in string format, for ingress controller pods - // corresponding to the IngressController. The number of matching pods should - // equal the value of availableReplicas. - // +optional - Selector string `json:"selector"` - - // domain is the actual domain in use. - // +optional - Domain string `json:"domain"` - - // endpointPublishingStrategy is the actual strategy in use. - // +optional - EndpointPublishingStrategy *EndpointPublishingStrategy `json:"endpointPublishingStrategy,omitempty"` - - // conditions is a list of conditions and their status. - // - // Available means the ingress controller deployment is available and - // servicing route and ingress resources (i.e, .status.availableReplicas - // equals .spec.replicas) - // - // There are additional conditions which indicate the status of other - // ingress controller features and capabilities. - // - // * LoadBalancerManaged - // - True if the following conditions are met: - // * The endpoint publishing strategy requires a service load balancer. - // - False if any of those conditions are unsatisfied. - // - // * LoadBalancerReady - // - True if the following conditions are met: - // * A load balancer is managed. - // * The load balancer is ready. - // - False if any of those conditions are unsatisfied. - // - // * DNSManaged - // - True if the following conditions are met: - // * The endpoint publishing strategy and platform support DNS. - // * The ingress controller domain is set. - // * dns.config.openshift.io/cluster configures DNS zones. - // - False if any of those conditions are unsatisfied. - // - // * DNSReady - // - True if the following conditions are met: - // * DNS is managed. - // * DNS records have been successfully created. - // - False if any of those conditions are unsatisfied. - // +listType=map - // +listMapKey=type - // +optional - Conditions []OperatorCondition `json:"conditions,omitempty"` - - // tlsProfile is the TLS connection configuration that is in effect. - // +optional - TLSProfile *configv1.TLSProfileSpec `json:"tlsProfile,omitempty"` - - // observedGeneration is the most recent generation observed. - // +optional - ObservedGeneration int64 `json:"observedGeneration,omitempty"` - - // namespaceSelector is the actual namespaceSelector in use. - // +optional - NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty"` - - // routeSelector is the actual routeSelector in use. - // +optional - RouteSelector *metav1.LabelSelector `json:"routeSelector,omitempty"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// IngressControllerList contains a list of IngressControllers. -// -// Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). -// +openshift:compatibility-gen:level=1 -type IngressControllerList struct { - metav1.TypeMeta `json:",inline"` - - // metadata is the standard list's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - metav1.ListMeta `json:"metadata,omitempty"` - - Items []IngressController `json:"items"` -} - -// IngressControllerConnectionTerminationPolicy defines the behaviour -// for handling idle connections during a soft reload of the router. -// -// +kubebuilder:validation:Enum=Immediate;Deferred -type IngressControllerConnectionTerminationPolicy string - -const ( - // IngressControllerConnectionTerminationPolicyImmediate specifies - // that idle connections should be closed immediately during a - // router reload. - IngressControllerConnectionTerminationPolicyImmediate IngressControllerConnectionTerminationPolicy = "Immediate" - - // IngressControllerConnectionTerminationPolicyDeferred - // specifies that idle connections should remain open until a - // terminating event, such as a new request, the expiration of - // the proxy keep-alive timeout, or the client closing the - // connection. - IngressControllerConnectionTerminationPolicyDeferred IngressControllerConnectionTerminationPolicy = "Deferred" -) - -// IngressControllerClosedClientConnectionPolicy controls how the IngressController -// behaves when the client closes the TCP connection while the TLS -// handshake or HTTP request is in progress. -// -// +kubebuilder:validation:Enum=Abort;Continue -type IngressControllerClosedClientConnectionPolicy string - -const ( - // IngressControllerClosedClientConnectionPolicyAbort aborts processing early when the client - // closes the connection. - // - // This affects two types of processing: TLS handshake computation on the router - // and request handling. - // - // When the client closes the connection, the router will stop processing - // the TLS handshake, preventing unnecessary CPU work. - // - // If the HTTP request has not yet been sent to the backend, it will be aborted. - // If the request is already being processed by the backend, the router will - // half-close the connection to signal this condition to the backend server, - // which can then decide how to proceed. - IngressControllerClosedClientConnectionPolicyAbort IngressControllerClosedClientConnectionPolicy = "Abort" - - // IngressControllerClosedClientConnectionPolicyContinue continues processing even if the client - // closes the connection. - // - // The router will complete the TLS handshake and wait for the backend - // server's response regardless of the client having closed the connection. - IngressControllerClosedClientConnectionPolicyContinue IngressControllerClosedClientConnectionPolicy = "Continue" -) diff --git a/apis/vendor/github.com/openshift/api/operator/v1/types_ingresscontroller.go b/apis/vendor/github.com/openshift/api/operator/v1/types_ingresscontroller.go new file mode 100644 index 00000000000..2d442d4b41a --- /dev/null +++ b/apis/vendor/github.com/openshift/api/operator/v1/types_ingresscontroller.go @@ -0,0 +1,2386 @@ +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + + corev1 "k8s.io/api/core/v1" + + configv1 "github.com/openshift/api/config/v1" +) + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.availableReplicas,selectorpath=.status.selector +// +kubebuilder:resource:path=ingresscontrollers,scope=Namespaced +// +openshift:api-approved.openshift.io=https://github.com/openshift/api/pull/616 +// +openshift:capability=Ingress +// +openshift:file-pattern=cvoRunLevel=0000_50,operatorName=ingress,operatorOrdering=00 + +// IngressController describes a managed ingress controller for the cluster. The +// controller can service OpenShift Route and Kubernetes Ingress resources. +// +// When an IngressController is created, a new ingress controller deployment is +// created to allow external traffic to reach the services that expose Ingress +// or Route resources. Updating this resource may lead to disruption for public +// facing network connections as a new ingress controller revision may be rolled +// out. +// +// https://kubernetes.io/docs/concepts/services-networking/ingress-controllers +// +// Whenever possible, sensible defaults for the platform are used. See each +// field for more details. +// +// Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). +// +openshift:compatibility-gen:level=1 +// +kubebuilder:validation:XValidation:rule="!has(self.spec.domain) || size('router-' + self.metadata.name + '.' + self.spec.domain) <= 253",message="The combined 'router-' + metadata.name + '.' + .spec.domain cannot exceed 253 characters" +type IngressController struct { + metav1.TypeMeta `json:",inline"` + + // metadata is the standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + metav1.ObjectMeta `json:"metadata,omitempty"` + + // spec is the specification of the desired behavior of the IngressController. + Spec IngressControllerSpec `json:"spec,omitempty"` + // status is the most recently observed status of the IngressController. + Status IngressControllerStatus `json:"status,omitempty"` +} + +// IngressControllerSpec is the specification of the desired behavior of the +// IngressController. +type IngressControllerSpec struct { + // domain is a DNS name serviced by the ingress controller and is used to + // configure multiple features: + // + // * For the LoadBalancerService endpoint publishing strategy, domain is + // used to configure DNS records. See endpointPublishingStrategy. + // + // * When using a generated default certificate, the certificate will be valid + // for domain and its subdomains. See defaultCertificate. + // + // * The value is published to individual Route statuses so that end-users + // know where to target external DNS records. + // + // domain must be unique among all IngressControllers, and cannot be + // updated. + // + // If empty, defaults to ingress.config.openshift.io/cluster .spec.domain. + // + // The domain value must be a valid DNS name. It must consist of lowercase + // alphanumeric characters, '-' or '.', and each label must start and end + // with an alphanumeric character and not exceed 63 characters. Maximum + // length of a valid DNS domain is 253 characters. + // + // The implementation may add a prefix such as "router-default." to the domain + // when constructing the router canonical hostname. To ensure the resulting + // hostname does not exceed the DNS maximum length of 253 characters, + // the domain length is additionally validated at the IngressController object + // level. For the maximum length of the domain value itself, the shortest + // possible variant of the prefix and the ingress controller name was considered + // for example "router-a." + // + // +kubebuilder:validation:MaxLength=244 + // +kubebuilder:validation:XValidation:rule="!format.dns1123Subdomain().validate(self).hasValue()",message="domain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character" + // +kubebuilder:validation:XValidation:rule="self.split('.').all(label, size(label) <= 63)",message="each DNS label must not exceed 63 characters" + // +optional + Domain string `json:"domain,omitempty"` + + // httpErrorCodePages specifies a configmap with custom error pages. + // The administrator must create this configmap in the openshift-config namespace. + // This configmap should have keys in the format "error-page-.http", + // where is an HTTP error code. + // For example, "error-page-503.http" defines an error page for HTTP 503 responses. + // Currently only error pages for 503 and 404 responses can be customized. + // Each value in the configmap should be the full response, including HTTP headers. + // Eg- https://raw.githubusercontent.com/openshift/router/fadab45747a9b30cc3f0a4b41ad2871f95827a93/images/router/haproxy/conf/error-page-503.http + // If this field is empty, the ingress controller uses the default error pages. + HttpErrorCodePages configv1.ConfigMapNameReference `json:"httpErrorCodePages,omitempty"` + + // replicas is the desired number of ingress controller replicas. If unset, + // the default depends on the value of the defaultPlacement field in the + // cluster config.openshift.io/v1/ingresses status. + // + // The value of replicas is set based on the value of a chosen field in the + // Infrastructure CR. If defaultPlacement is set to ControlPlane, the + // chosen field will be controlPlaneTopology. If it is set to Workers the + // chosen field will be infrastructureTopology. Replicas will then be set to 1 + // or 2 based whether the chosen field's value is SingleReplica or + // HighlyAvailable, respectively. + // + // These defaults are subject to change. + // + // +optional + Replicas *int32 `json:"replicas,omitempty"` + + // endpointPublishingStrategy is used to publish the ingress controller + // endpoints to other networks, enable load balancer integrations, etc. + // + // If unset, the default is based on + // infrastructure.config.openshift.io/cluster .status.platform: + // + // AWS: LoadBalancerService (with External scope) + // Azure: LoadBalancerService (with External scope) + // GCP: LoadBalancerService (with External scope) + // IBMCloud: LoadBalancerService (with External scope) + // AlibabaCloud: LoadBalancerService (with External scope) + // Libvirt: HostNetwork + // + // Any other platform types (including None) default to HostNetwork. + // + // endpointPublishingStrategy cannot be updated. + // + // +optional + EndpointPublishingStrategy *EndpointPublishingStrategy `json:"endpointPublishingStrategy,omitempty"` + + // defaultCertificate is a reference to a secret containing the default + // certificate served by the ingress controller. When Routes don't specify + // their own certificate, defaultCertificate is used. + // + // The secret must contain the following keys and data: + // + // tls.crt: certificate file contents + // tls.key: key file contents + // + // If unset, a wildcard certificate is automatically generated and used. The + // certificate is valid for the ingress controller domain (and subdomains) and + // the generated certificate's CA will be automatically integrated with the + // cluster's trust store. + // + // If a wildcard certificate is used and shared by multiple + // HTTP/2 enabled routes (which implies ALPN) then clients + // (i.e., notably browsers) are at liberty to reuse open + // connections. This means a client can reuse a connection to + // another route and that is likely to fail. This behaviour is + // generally known as connection coalescing. + // + // The in-use certificate (whether generated or user-specified) will be + // automatically integrated with OpenShift's built-in OAuth server. + // + // +optional + DefaultCertificate *corev1.LocalObjectReference `json:"defaultCertificate,omitempty"` + + // namespaceSelector is used to filter the set of namespaces serviced by the + // ingress controller. This is useful for implementing shards. + // + // If unset, the default is no filtering. + // + // +optional + NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty"` + + // routeSelector is used to filter the set of Routes serviced by the ingress + // controller. This is useful for implementing shards. + // + // If unset, the default is no filtering. + // + // +optional + RouteSelector *metav1.LabelSelector `json:"routeSelector,omitempty"` + + // nodePlacement enables explicit control over the scheduling of the ingress + // controller. + // + // If unset, defaults are used. See NodePlacement for more details. + // + // +optional + NodePlacement *NodePlacement `json:"nodePlacement,omitempty"` + + // tlsSecurityProfile specifies settings for TLS connections for ingresscontrollers. + // + // If unset, the default is based on the apiservers.config.openshift.io/cluster resource. + // + // Note that when using the Old, Intermediate, and Modern profile types, the effective + // profile configuration is subject to change between releases. For example, given + // a specification to use the Intermediate profile deployed on release X.Y.Z, an upgrade + // to release X.Y.Z+1 may cause a new profile configuration to be applied to the ingress + // controller, resulting in a rollout. + // + // +optional + TLSSecurityProfile *configv1.TLSSecurityProfile `json:"tlsSecurityProfile,omitempty"` + + // clientTLS specifies settings for requesting and verifying client + // certificates, which can be used to enable mutual TLS for + // edge-terminated and reencrypt routes. + // + // +optional + ClientTLS ClientTLS `json:"clientTLS"` + + // routeAdmission defines a policy for handling new route claims (for example, + // to allow or deny claims across namespaces). + // + // If empty, defaults will be applied. See specific routeAdmission fields + // for details about their defaults. + // + // +optional + RouteAdmission *RouteAdmissionPolicy `json:"routeAdmission,omitempty"` + + // logging defines parameters for what should be logged where. If this + // field is empty, operational logs are enabled but access logs are + // disabled. + // + // +optional + Logging *IngressControllerLogging `json:"logging,omitempty"` + + // httpHeaders defines policy for HTTP headers. + // + // If this field is empty, the default values are used. + // + // +optional + HTTPHeaders *IngressControllerHTTPHeaders `json:"httpHeaders,omitempty"` + + // httpEmptyRequestsPolicy describes how HTTP connections should be + // handled if the connection times out before a request is received. + // Allowed values for this field are "Respond" and "Ignore". If the + // field is set to "Respond", the ingress controller sends an HTTP 400 + // or 408 response, logs the connection (if access logging is enabled), + // and counts the connection in the appropriate metrics. If the field + // is set to "Ignore", the ingress controller closes the connection + // without sending a response, logging the connection, or incrementing + // metrics. The default value is "Respond". + // + // Typically, these connections come from load balancers' health probes + // or Web browsers' speculative connections ("preconnect") and can be + // safely ignored. However, these requests may also be caused by + // network errors, and so setting this field to "Ignore" may impede + // detection and diagnosis of problems. In addition, these requests may + // be caused by port scans, in which case logging empty requests may aid + // in detecting intrusion attempts. + // + // +optional + // +kubebuilder:default:="Respond" + HTTPEmptyRequestsPolicy HTTPEmptyRequestsPolicy `json:"httpEmptyRequestsPolicy,omitempty"` + + // tuningOptions defines parameters for adjusting the performance of + // ingress controller pods. All fields are optional and will use their + // respective defaults if not set. See specific tuningOptions fields for + // more details. + // + // Setting fields within tuningOptions is generally not recommended. The + // default values are suitable for most configurations. + // + // +optional + TuningOptions IngressControllerTuningOptions `json:"tuningOptions,omitempty"` + + // unsupportedConfigOverrides allows specifying unsupported + // configuration options. Its use is unsupported. + // + // +optional + // +nullable + // +kubebuilder:pruning:PreserveUnknownFields + UnsupportedConfigOverrides runtime.RawExtension `json:"unsupportedConfigOverrides"` + + // httpCompression defines a policy for HTTP traffic compression. + // By default, there is no HTTP compression. + // + // +optional + HTTPCompression HTTPCompressionPolicy `json:"httpCompression,omitempty"` + + // idleConnectionTerminationPolicy maps directly to HAProxy's + // idle-close-on-response option and controls whether HAProxy + // keeps idle frontend connections open during a soft stop + // (router reload). + // + // Allowed values for this field are "Immediate" and + // "Deferred". The default value is "Immediate". + // + // When set to "Immediate", idle connections are closed + // immediately during router reloads. This ensures immediate + // propagation of route changes but may impact clients + // sensitive to connection resets. + // + // When set to "Deferred", HAProxy will maintain idle + // connections during a soft reload instead of closing them + // immediately. These connections remain open until any of the + // following occurs: + // + // - A new request is received on the connection, in which + // case HAProxy handles it in the old process and closes + // the connection after sending the response. + // + // - HAProxy's `timeout http-keep-alive` duration expires. + // By default this is 300 seconds, but it can be changed + // using httpKeepAliveTimeout tuning option. + // + // - The client's keep-alive timeout expires, causing the + // client to close the connection. + // + // Setting Deferred can help prevent errors in clients or load + // balancers that do not properly handle connection resets. + // Additionally, this option allows you to retain the pre-2.4 + // HAProxy behaviour: in HAProxy version 2.2 (OpenShift + // versions < 4.14), maintaining idle connections during a + // soft reload was the default behaviour, but starting with + // HAProxy 2.4, the default changed to closing idle + // connections immediately. + // + // Important Consideration: + // + // - Using Deferred will result in temporary inconsistencies + // for the first request on each persistent connection + // after a route update and router reload. This request + // will be processed by the old HAProxy process using its + // old configuration. Subsequent requests will use the + // updated configuration. + // + // Operational Considerations: + // + // - Keeping idle connections open during reloads may lead + // to an accumulation of old HAProxy processes if + // connections remain idle for extended periods, + // especially in environments where frequent reloads + // occur. + // + // - Consider monitoring the number of HAProxy processes in + // the router pods when Deferred is set. + // + // - You may need to enable or adjust the + // `ingress.operator.openshift.io/hard-stop-after` + // duration (configured via an annotation on the + // IngressController resource) in environments with + // frequent reloads to prevent resource exhaustion. + // + // +optional + // +kubebuilder:default:="Immediate" + // +default="Immediate" + IdleConnectionTerminationPolicy IngressControllerConnectionTerminationPolicy `json:"idleConnectionTerminationPolicy,omitempty"` + + // closedClientConnectionPolicy controls how the IngressController + // behaves when the client closes the TCP connection while the TLS + // handshake or HTTP request is in progress. This option maps directly + // to HAProxy’s "abortonclose" option. + // + // Valid values are: "Abort" and "Continue". + // The default value is "Continue". + // + // When set to "Abort", the router will stop processing the TLS handshake + // if it is in progress, and it will not send an HTTP request to the backend server + // if the request has not yet been sent when the client closes the connection. + // + // When set to "Continue", the router will complete the TLS handshake + // if it is in progress, or send an HTTP request to the backend server + // and wait for the backend server's response, regardless of + // whether the client has closed the connection. + // + // Setting "Abort" can help free CPU resources otherwise spent on TLS computation + // for connections the client has already closed, and can reduce request queue + // size, thereby reducing the load on saturated backend servers. + // + // Important Considerations: + // + // - The default policy ("Continue") is HTTP-compliant, and requests + // for aborted client connections will still be served. + // Use the "Continue" policy to allow a client to send a request + // and then immediately close its side of the connection while + // still receiving a response on the half-closed connection. + // + // - When clients use keep-alive connections, the most common case for premature + // closure is when the user wants to cancel the transfer or when a timeout + // occurs. In that case, the "Abort" policy may be used to reduce resource consumption. + // + // - Using RSA keys larger than 2048 bits can significantly slow down + // TLS computations. Consider using the "Abort" policy to reduce CPU usage. + // + // +optional + // +kubebuilder:default:="Continue" + // +default="Continue" + ClosedClientConnectionPolicy IngressControllerClosedClientConnectionPolicy `json:"closedClientConnectionPolicy,omitempty"` + + // haproxyVersion specifies the HAProxy version to use for this + // IngressController. + // + // OpenShift 5.0 introduces HAProxy 3.2 as its default version and supports + // HAProxy 2.8 from OpenShift 4.22 for migration purposes. When an OpenShift + // release introduces a new default HAProxy version, that HAProxy version + // becomes available as a pinnable value in subsequent OpenShift releases, + // providing a smooth migration path for administrators who want to defer + // HAProxy upgrades. + // + // Valid values for OpenShift 5.0: + // - Unset (default): Uses HAProxy 3.2 (the default for OpenShift 5.0) + // - "3.2": Explicitly pins HAProxy 3.2 for preservation during cluster + // upgrades to future OpenShift releases + // - "2.8": Uses HAProxy 2.8 from OpenShift 4.22 (migration support, will + // be dropped in the next OpenShift release) + // + // If a specific HAProxy version is set and would become unsupported in a + // target cluster upgrade, a preflight check will block the cluster upgrade + // until this field is updated to unset or a supported version. + // + // +optional + // +openshift:enable:FeatureGate=IngressControllerMultipleHAProxyVersions + HAProxyVersion HAProxyVersion `json:"haproxyVersion,omitempty"` +} + +// httpCompressionPolicy turns on compression for the specified MIME types. +// +// This field is optional, and its absence implies that compression should not be enabled +// globally in HAProxy. +// +// If httpCompressionPolicy exists, compression should be enabled only for the specified +// MIME types. +type HTTPCompressionPolicy struct { + // mimeTypes is a list of MIME types that should have compression applied. + // This list can be empty, in which case the ingress controller does not apply compression. + // + // Note: Not all MIME types benefit from compression, but HAProxy will still use resources + // to try to compress if instructed to. Generally speaking, text (html, css, js, etc.) + // formats benefit from compression, but formats that are already compressed (image, + // audio, video, etc.) benefit little in exchange for the time and cpu spent on compressing + // again. See https://joehonton.medium.com/the-gzip-penalty-d31bd697f1a2 + // + // +listType=set + MimeTypes []CompressionMIMEType `json:"mimeTypes,omitempty"` +} + +// CompressionMIMEType defines the format of a single MIME type. +// E.g. "text/css; charset=utf-8", "text/html", "text/*", "image/svg+xml", +// "application/octet-stream", "X-custom/customsub", etc. +// +// The format should follow the Content-Type definition in RFC 1341: +// Content-Type := type "/" subtype *[";" parameter] +// - The type in Content-Type can be one of: +// application, audio, image, message, multipart, text, video, or a custom +// type preceded by "X-" and followed by a token as defined below. +// - The token is a string of at least one character, and not containing white +// space, control characters, or any of the characters in the tspecials set. +// - The tspecials set contains the characters ()<>@,;:\"/[]?.= +// - The subtype in Content-Type is also a token. +// - The optional parameter/s following the subtype are defined as: +// token "=" (token / quoted-string) +// - The quoted-string, as defined in RFC 822, is surrounded by double quotes +// and can contain white space plus any character EXCEPT \, ", and CR. +// It can also contain any single ASCII character as long as it is escaped by \. +// +// +kubebuilder:validation:Pattern=`^(?i)(x-[^][ ()\\<>@,;:"/?.=\x00-\x1F\x7F]+|application|audio|image|message|multipart|text|video)/[^][ ()\\<>@,;:"/?.=\x00-\x1F\x7F]+(; *[^][ ()\\<>@,;:"/?.=\x00-\x1F\x7F]+=([^][ ()\\<>@,;:"/?.=\x00-\x1F\x7F]+|"(\\[\x00-\x7F]|[^\x0D"\\])*"))*$` +type CompressionMIMEType string + +// NodePlacement describes node scheduling configuration for an ingress +// controller. +type NodePlacement struct { + // nodeSelector is the node selector applied to ingress controller + // deployments. + // + // If set, the specified selector is used and replaces the default. + // + // If unset, the default depends on the value of the defaultPlacement + // field in the cluster config.openshift.io/v1/ingresses status. + // + // When defaultPlacement is Workers, the default is: + // + // kubernetes.io/os: linux + // node-role.kubernetes.io/worker: '' + // + // When defaultPlacement is ControlPlane, the default is: + // + // kubernetes.io/os: linux + // node-role.kubernetes.io/master: '' + // + // These defaults are subject to change. + // + // Note that using nodeSelector.matchExpressions is not supported. Only + // nodeSelector.matchLabels may be used. This is a limitation of the + // Kubernetes API: the pod spec does not allow complex expressions for + // node selectors. + // + // +optional + NodeSelector *metav1.LabelSelector `json:"nodeSelector,omitempty"` + + // tolerations is a list of tolerations applied to ingress controller + // deployments. + // + // The default is an empty list. + // + // See https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ + // + // +optional + // +listType=atomic + Tolerations []corev1.Toleration `json:"tolerations,omitempty"` +} + +// EndpointPublishingStrategyType is a way to publish ingress controller endpoints. +// +kubebuilder:validation:Enum=LoadBalancerService;HostNetwork;Private;NodePortService +type EndpointPublishingStrategyType string + +const ( + // LoadBalancerService publishes the ingress controller using a Kubernetes + // LoadBalancer Service. + LoadBalancerServiceStrategyType EndpointPublishingStrategyType = "LoadBalancerService" + + // HostNetwork publishes the ingress controller on node ports where the + // ingress controller is deployed. + HostNetworkStrategyType EndpointPublishingStrategyType = "HostNetwork" + + // Private does not publish the ingress controller. + PrivateStrategyType EndpointPublishingStrategyType = "Private" + + // NodePortService publishes the ingress controller using a Kubernetes NodePort Service. + NodePortServiceStrategyType EndpointPublishingStrategyType = "NodePortService" +) + +// LoadBalancerScope is the scope at which a load balancer is exposed. +// +kubebuilder:validation:Enum=Internal;External +type LoadBalancerScope string + +var ( + // InternalLoadBalancer is a load balancer that is exposed only on the + // cluster's private network. + InternalLoadBalancer LoadBalancerScope = "Internal" + + // ExternalLoadBalancer is a load balancer that is exposed on the + // cluster's public network (which is typically on the Internet). + ExternalLoadBalancer LoadBalancerScope = "External" +) + +// CIDR is an IP address range in CIDR notation (for example, "10.0.0.0/8" +// or "fd00::/8"). +// +kubebuilder:validation:Pattern=`(^(([0-9]|[0-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[0-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/([0-9]|[12][0-9]|3[0-2])$)|(^s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:)))(%.+)?s*(\/(12[0-8]|1[0-1][0-9]|[1-9][0-9]|[0-9]))$)` +// + --- +// + The regex for the IPv4 CIDR range was taken from other CIDR fields in the OpenShift API +// + and the one for the IPv6 CIDR range was taken from +// + https://blog.markhatton.co.uk/2011/03/15/regular-expressions-for-ip-addresses-cidr-ranges-and-hostnames/ +// + The resulting regex is an OR of both regexes. +type CIDR string + +// LoadBalancerStrategy holds parameters for a load balancer. +// +kubebuilder:validation:XValidation:rule="!has(self.scope) || self.scope != 'Internal' || !has(self.providerParameters) || !has(self.providerParameters.aws) || !has(self.providerParameters.aws.networkLoadBalancer) || !has(self.providerParameters.aws.networkLoadBalancer.eipAllocations)",message="eipAllocations are forbidden when the scope is Internal." +// +kubebuilder:validation:XValidation:rule=`!has(self.scope) || self.scope != 'Internal' || !has(self.providerParameters) || !has(self.providerParameters.openstack) || !has(self.providerParameters.openstack.floatingIP) || self.providerParameters.openstack.floatingIP == ""`,message="cannot specify a floating ip when scope is internal" +type LoadBalancerStrategy struct { + // scope indicates the scope at which the load balancer is exposed. + // Possible values are "External" and "Internal". + // + // +required + Scope LoadBalancerScope `json:"scope"` + + // allowedSourceRanges specifies an allowlist of IP address ranges to which + // access to the load balancer should be restricted. Each range must be + // specified using CIDR notation (e.g. "10.0.0.0/8" or "fd00::/8"). If no range is + // specified, "0.0.0.0/0" for IPv4 and "::/0" for IPv6 are used by default, + // which allows all source addresses. + // + // To facilitate migration from earlier versions of OpenShift that did + // not have the allowedSourceRanges field, you may set the + // service.beta.kubernetes.io/load-balancer-source-ranges annotation on + // the "router-" service in the + // "openshift-ingress" namespace, and this annotation will take + // effect if allowedSourceRanges is empty on OpenShift 4.12. + // + // +nullable + // +optional + // +listType=atomic + AllowedSourceRanges []CIDR `json:"allowedSourceRanges,omitempty"` + + // providerParameters holds desired load balancer information specific to + // the underlying infrastructure provider. + // + // If empty, defaults will be applied. See specific providerParameters + // fields for details about their defaults. + // + // +optional + ProviderParameters *ProviderLoadBalancerParameters `json:"providerParameters,omitempty"` + + // dnsManagementPolicy indicates if the lifecycle of the wildcard DNS record + // associated with the load balancer service will be managed by + // the ingress operator. It defaults to Managed. + // Valid values are: Managed and Unmanaged. + // + // +kubebuilder:default:="Managed" + // +required + // +default="Managed" + DNSManagementPolicy LoadBalancerDNSManagementPolicy `json:"dnsManagementPolicy,omitempty"` +} + +// LoadBalancerDNSManagementPolicy is a policy for configuring how +// ingresscontrollers manage DNS. +// +// +kubebuilder:validation:Enum=Managed;Unmanaged +type LoadBalancerDNSManagementPolicy string + +const ( + // ManagedLoadBalancerDNS specifies that the operator manages + // a wildcard DNS record for the ingresscontroller. + ManagedLoadBalancerDNS LoadBalancerDNSManagementPolicy = "Managed" + // UnmanagedLoadBalancerDNS specifies that the operator does not manage + // any wildcard DNS record for the ingresscontroller. + UnmanagedLoadBalancerDNS LoadBalancerDNSManagementPolicy = "Unmanaged" +) + +// ProviderLoadBalancerParameters holds desired load balancer information +// specific to the underlying infrastructure provider. +// +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'OpenStack' ? true : !has(self.openstack)",message="openstack is not permitted when type is not OpenStack" +// +union +type ProviderLoadBalancerParameters struct { + // type is the underlying infrastructure provider for the load balancer. + // Allowed values are "AWS", "Azure", "BareMetal", "GCP", "IBM", "Nutanix", + // "OpenStack", and "VSphere". + // + // +unionDiscriminator + // +required + Type LoadBalancerProviderType `json:"type"` + + // aws provides configuration settings that are specific to AWS + // load balancers. + // + // If empty, defaults will be applied. See specific aws fields for + // details about their defaults. + // + // +optional + AWS *AWSLoadBalancerParameters `json:"aws,omitempty"` + + // gcp provides configuration settings that are specific to GCP + // load balancers. + // + // If empty, defaults will be applied. See specific gcp fields for + // details about their defaults. + // + // +optional + GCP *GCPLoadBalancerParameters `json:"gcp,omitempty"` + + // ibm provides configuration settings that are specific to IBM Cloud + // load balancers. + // + // If empty, defaults will be applied. See specific ibm fields for + // details about their defaults. + // + // +optional + IBM *IBMLoadBalancerParameters `json:"ibm,omitempty"` + + // openstack provides configuration settings that are specific to OpenStack + // load balancers. + // + // If empty, defaults will be applied. See specific openstack fields for + // details about their defaults. + // + // +optional + OpenStack *OpenStackLoadBalancerParameters `json:"openstack,omitempty"` +} + +// LoadBalancerProviderType is the underlying infrastructure provider for the +// load balancer. Allowed values are "AWS", "Azure", "BareMetal", "GCP", "IBM", "Nutanix", +// "OpenStack", and "VSphere". +// +// +kubebuilder:validation:Enum=AWS;Azure;BareMetal;GCP;Nutanix;OpenStack;VSphere;IBM +type LoadBalancerProviderType string + +const ( + AWSLoadBalancerProvider LoadBalancerProviderType = "AWS" + AzureLoadBalancerProvider LoadBalancerProviderType = "Azure" + GCPLoadBalancerProvider LoadBalancerProviderType = "GCP" + OpenStackLoadBalancerProvider LoadBalancerProviderType = "OpenStack" + VSphereLoadBalancerProvider LoadBalancerProviderType = "VSphere" + IBMLoadBalancerProvider LoadBalancerProviderType = "IBM" + BareMetalLoadBalancerProvider LoadBalancerProviderType = "BareMetal" + AlibabaCloudLoadBalancerProvider LoadBalancerProviderType = "AlibabaCloud" + NutanixLoadBalancerProvider LoadBalancerProviderType = "Nutanix" +) + +// AWSLoadBalancerParameters provides configuration settings that are +// specific to AWS load balancers. +// +union +type AWSLoadBalancerParameters struct { + // type is the type of AWS load balancer to instantiate for an ingresscontroller. + // + // Valid values are: + // + // * "Classic": A Classic Load Balancer that makes routing decisions at either + // the transport layer (TCP/SSL) or the application layer (HTTP/HTTPS). See + // the following for additional details: + // + // https://docs.aws.amazon.com/AmazonECS/latest/developerguide/load-balancer-types.html#clb + // + // * "NLB": A Network Load Balancer that makes routing decisions at the + // transport layer (TCP/SSL). See the following for additional details: + // + // https://docs.aws.amazon.com/AmazonECS/latest/developerguide/load-balancer-types.html#nlb + // + // +unionDiscriminator + // +required + Type AWSLoadBalancerType `json:"type"` + + // classicLoadBalancerParameters holds configuration parameters for an AWS + // classic load balancer. Present only if type is Classic. + // + // +optional + ClassicLoadBalancerParameters *AWSClassicLoadBalancerParameters `json:"classicLoadBalancer,omitempty"` + + // networkLoadBalancerParameters holds configuration parameters for an AWS + // network load balancer. Present only if type is NLB. + // + // +optional + NetworkLoadBalancerParameters *AWSNetworkLoadBalancerParameters `json:"networkLoadBalancer,omitempty"` +} + +// AWSLoadBalancerType is the type of AWS load balancer to instantiate. +// +kubebuilder:validation:Enum=Classic;NLB +type AWSLoadBalancerType string + +const ( + AWSClassicLoadBalancer AWSLoadBalancerType = "Classic" + AWSNetworkLoadBalancer AWSLoadBalancerType = "NLB" +) + +// AWSSubnets contains a list of references to AWS subnets by +// ID or name. +// +kubebuilder:validation:XValidation:rule=`has(self.ids) && has(self.names) ? size(self.ids + self.names) <= 10 : true`,message="the total number of subnets cannot exceed 10" +// +kubebuilder:validation:XValidation:rule=`has(self.ids) && self.ids.size() > 0 || has(self.names) && self.names.size() > 0`,message="must specify at least 1 subnet name or id" +type AWSSubnets struct { + // ids specifies a list of AWS subnets by subnet ID. + // Subnet IDs must start with "subnet-", consist only + // of alphanumeric characters, must be exactly 24 + // characters long, must be unique, and the total + // number of subnets specified by ids and names + // must not exceed 10. + // + // +optional + // +listType=atomic + // +kubebuilder:validation:XValidation:rule=`self.all(x, self.exists_one(y, x == y))`,message="subnet ids cannot contain duplicates" + // + Note: Though it may seem redundant, MaxItems is necessary to prevent exceeding of the cost budget for the validation rules. + // +kubebuilder:validation:MaxItems=10 + IDs []AWSSubnetID `json:"ids,omitempty"` + + // names specifies a list of AWS subnets by subnet name. + // Subnet names must not start with "subnet-", must not + // include commas, must be under 256 characters in length, + // must be unique, and the total number of subnets + // specified by ids and names must not exceed 10. + // + // +optional + // +listType=atomic + // +kubebuilder:validation:XValidation:rule=`self.all(x, self.exists_one(y, x == y))`,message="subnet names cannot contain duplicates" + // + Note: Though it may seem redundant, MaxItems is necessary to prevent exceeding of the cost budget for the validation rules. + // +kubebuilder:validation:MaxItems=10 + Names []AWSSubnetName `json:"names,omitempty"` +} + +// AWSSubnetID is a reference to an AWS subnet ID. +// +kubebuilder:validation:MinLength=24 +// +kubebuilder:validation:MaxLength=24 +// +kubebuilder:validation:Pattern=`^subnet-[0-9A-Za-z]+$` +type AWSSubnetID string + +// AWSSubnetName is a reference to an AWS subnet name. +// +kubebuilder:validation:MinLength=1 +// +kubebuilder:validation:MaxLength=256 +// +kubebuilder:validation:XValidation:rule=`!self.contains(',')`,message="subnet name cannot contain a comma" +// +kubebuilder:validation:XValidation:rule=`!self.startsWith('subnet-')`,message="subnet name cannot start with 'subnet-'" +type AWSSubnetName string + +// GCPLoadBalancerParameters provides configuration settings that are +// specific to GCP load balancers. +type GCPLoadBalancerParameters struct { + // clientAccess describes how client access is restricted for internal + // load balancers. + // + // Valid values are: + // * "Global": Specifying an internal load balancer with Global client access + // allows clients from any region within the VPC to communicate with the load + // balancer. + // + // https://cloud.google.com/kubernetes-engine/docs/how-to/internal-load-balancing#global_access + // + // * "Local": Specifying an internal load balancer with Local client access + // means only clients within the same region (and VPC) as the GCP load balancer + // can communicate with the load balancer. Note that this is the default behavior. + // + // https://cloud.google.com/load-balancing/docs/internal#client_access + // + // +optional + ClientAccess GCPClientAccess `json:"clientAccess,omitempty"` +} + +// GCPClientAccess describes how client access is restricted for internal +// load balancers. +// +kubebuilder:validation:Enum=Global;Local +type GCPClientAccess string + +const ( + GCPGlobalAccess GCPClientAccess = "Global" + GCPLocalAccess GCPClientAccess = "Local" +) + +// IBMLoadBalancerParameters provides configuration settings that are +// specific to IBM Cloud load balancers. +type IBMLoadBalancerParameters struct { + // protocol specifies whether the load balancer uses PROXY protocol to forward connections to + // the IngressController. See "service.kubernetes.io/ibm-load-balancer-cloud-provider-enable-features: + // "proxy-protocol"" at https://cloud.ibm.com/docs/containers?topic=containers-vpc-lbaas" + // + // PROXY protocol can be used with load balancers that support it to + // communicate the source addresses of client connections when + // forwarding those connections to the IngressController. Using PROXY + // protocol enables the IngressController to report those source + // addresses instead of reporting the load balancer's address in HTTP + // headers and logs. Note that enabling PROXY protocol on the + // IngressController will cause connections to fail if you are not using + // a load balancer that uses PROXY protocol to forward connections to + // the IngressController. See + // http://www.haproxy.org/download/2.2/doc/proxy-protocol.txt for + // information about PROXY protocol. + // + // Valid values for protocol are TCP, PROXY and omitted. + // When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. + // The current default is TCP, without the proxy protocol enabled. + // + // +optional + Protocol IngressControllerProtocol `json:"protocol,omitempty"` +} + +// OpenStackLoadBalancerParameters provides configuration settings that are +// specific to OpenStack load balancers. +type OpenStackLoadBalancerParameters struct { + // loadBalancerIP is tombstoned since the field was replaced by floatingIP. + // LoadBalancerIP string `json:"loadBalancerIP,omitempty"` + + // floatingIP specifies the IP address that the load balancer will use. + // When not specified, an IP address will be assigned randomly by the OpenStack cloud provider. + // When specified, the floating IP has to be pre-created. If the + // specified value is not a floating IP or is already claimed, the + // OpenStack cloud provider won't be able to provision the load + // balancer. + // This field may only be used if the IngressController has External scope. + // This value must be a valid IPv4 or IPv6 address. + // + --- + // + Note: this field is meant to be set by the ingress controller + // + to populate the `Service.Spec.LoadBalancerIP` field which has been + // + deprecated in Kubernetes: + // + https://github.com/kubernetes/kubernetes/pull/107235 + // + However, the field is still used by cloud-provider-openstack to reconcile + // + the floating IP that we attach to the external load balancer. + // + // +kubebuilder:validation:XValidation:rule="isIP(self)",message="floatingIP must be a valid IPv4 or IPv6 address" + // +optional + FloatingIP string `json:"floatingIP,omitempty"` +} + +// AWSClassicLoadBalancerParameters holds configuration parameters for an +// AWS Classic load balancer. +type AWSClassicLoadBalancerParameters struct { + // connectionIdleTimeout specifies the maximum time period that a + // connection may be idle before the load balancer closes the + // connection. The value must be parseable as a time duration value; + // see . A nil or zero value + // means no opinion, in which case a default value is used. The default + // value for this field is 60s. This default is subject to change. + // + // +kubebuilder:validation:Format=duration + // +optional + ConnectionIdleTimeout metav1.Duration `json:"connectionIdleTimeout,omitempty"` + + // subnets specifies the subnets to which the load balancer will + // attach. The subnets may be specified by either their + // ID or name. The total number of subnets is limited to 10. + // + // In order for the load balancer to be provisioned with subnets, + // each subnet must exist, each subnet must be from a different + // availability zone, and the load balancer service must be + // recreated to pick up new values. + // + // When omitted from the spec, the subnets will be auto-discovered + // for each availability zone. Auto-discovered subnets are not reported + // in the status of the IngressController object. + // + // +optional + Subnets *AWSSubnets `json:"subnets,omitempty"` +} + +// AWSNetworkLoadBalancerParameters holds configuration parameters for an +// AWS Network load balancer. For Example: Setting AWS EIPs https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html +// +kubebuilder:validation:XValidation:rule=`has(self.subnets) && has(self.subnets.ids) && has(self.subnets.names) && has(self.eipAllocations) ? size(self.subnets.ids + self.subnets.names) == size(self.eipAllocations) : true`,message="number of subnets must be equal to number of eipAllocations" +// +kubebuilder:validation:XValidation:rule=`has(self.subnets) && has(self.subnets.ids) && !has(self.subnets.names) && has(self.eipAllocations) ? size(self.subnets.ids) == size(self.eipAllocations) : true`,message="number of subnets must be equal to number of eipAllocations" +// +kubebuilder:validation:XValidation:rule=`has(self.subnets) && has(self.subnets.names) && !has(self.subnets.ids) && has(self.eipAllocations) ? size(self.subnets.names) == size(self.eipAllocations) : true`,message="number of subnets must be equal to number of eipAllocations" +type AWSNetworkLoadBalancerParameters struct { + // subnets specifies the subnets to which the load balancer will + // attach. The subnets may be specified by either their + // ID or name. The total number of subnets is limited to 10. + // + // In order for the load balancer to be provisioned with subnets, + // each subnet must exist, each subnet must be from a different + // availability zone, and the load balancer service must be + // recreated to pick up new values. + // + // When omitted from the spec, the subnets will be auto-discovered + // for each availability zone. Auto-discovered subnets are not reported + // in the status of the IngressController object. + // + // +optional + Subnets *AWSSubnets `json:"subnets,omitempty"` + + // eipAllocations is a list of IDs for Elastic IP (EIP) addresses that + // are assigned to the Network Load Balancer. + // The following restrictions apply: + // + // eipAllocations can only be used with external scope, not internal. + // An EIP can be allocated to only a single IngressController. + // The number of EIP allocations must match the number of subnets that are used for the load balancer. + // Each EIP allocation must be unique. + // A maximum of 10 EIP allocations are permitted. + // + // See https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html for general + // information about configuration, characteristics, and limitations of Elastic IP addresses. + // + // +optional + // +listType=atomic + // +kubebuilder:validation:XValidation:rule=`self.all(x, self.exists_one(y, x == y))`,message="eipAllocations cannot contain duplicates" + // +kubebuilder:validation:MaxItems=10 + EIPAllocations []EIPAllocation `json:"eipAllocations"` + + // protocol specifies whether the Network Load Balancer uses PROXY + // protocol to forward connections to the IngressController. + // + // When set to "TCP", the NLB uses AWS's native client IP preservation. + // This may cause hairpin connection failures for internal load + // balancers when connections are made from pods to router pods on + // the same node. + // + // When set to "PROXY", the NLB disables native client IP preservation + // and uses PROXY protocol v2. The IngressController enables PROXY + // protocol on HAProxy so that it can parse PROXY protocol headers to + // obtain the original client IP. This avoids hairpin connection + // failures. + // + // The following values are valid for this field: + // + // * "TCP". + // * "PROXY". + // + // When omitted, this means the user has no opinion and the value is + // left to the platform to choose a reasonable default, which is subject to + // change over time. The current default is "PROXY". + // + // Note that changing this field may cause brief connection failures + // during the transition as the NLB attribute change and router rollout + // occur independently. + // + // +optional + Protocol NLBProtocol `json:"protocol,omitempty"` +} + +// NLBProtocol specifies whether the AWS Network Load Balancer uses +// PROXY protocol to forward connections to the IngressController. +// +kubebuilder:validation:Enum=TCP;PROXY +// +enum +type NLBProtocol string + +const ( + // NLBProtocolTCP instructs the NLB to forward connections using TCP + // without PROXY protocol. + NLBProtocolTCP NLBProtocol = "TCP" + // NLBProtocolProxy instructs the NLB to forward connections using + // PROXY protocol v2. + NLBProtocolProxy NLBProtocol = "PROXY" +) + +// EIPAllocation is an ID for an Elastic IP (EIP) address that can be allocated to an ELB in the AWS environment. +// Values must begin with `eipalloc-` followed by exactly 17 hexadecimal (`[0-9a-fA-F]`) characters. +// + Explanation of the regex `^eipalloc-[0-9a-fA-F]{17}$` for validating value of the EIPAllocation: +// + ^eipalloc- ensures the string starts with "eipalloc-". +// + [0-9a-fA-F]{17} matches exactly 17 hexadecimal characters (0-9, a-f, A-F). +// + $ ensures the string ends after the 17 hexadecimal characters. +// + Example of Valid and Invalid values: +// + eipalloc-1234567890abcdef1 is valid. +// + eipalloc-1234567890abcde is not valid (too short). +// + eipalloc-1234567890abcdefg is not valid (contains a non-hex character 'g'). +// + Max length is calculated as follows: +// + eipalloc- = 9 chars and 17 hexadecimal chars after `-` +// + So, total is 17 + 9 = 26 chars required for value of an EIPAllocation. +// +// +kubebuilder:validation:MinLength=26 +// +kubebuilder:validation:MaxLength=26 +// +kubebuilder:validation:XValidation:rule=`self.startsWith('eipalloc-')`,message="eipAllocations should start with 'eipalloc-'" +// +kubebuilder:validation:XValidation:rule=`self.split("-", 2)[1].matches('[0-9a-fA-F]{17}$')`,message="eipAllocations must be 'eipalloc-' followed by exactly 17 hexadecimal characters (0-9, a-f, A-F)" +type EIPAllocation string + +// HostNetworkStrategy holds parameters for the HostNetwork endpoint publishing +// strategy. +type HostNetworkStrategy struct { + // protocol specifies whether the IngressController expects incoming + // connections to use plain TCP or whether the IngressController expects + // PROXY protocol. + // + // PROXY protocol can be used with load balancers that support it to + // communicate the source addresses of client connections when + // forwarding those connections to the IngressController. Using PROXY + // protocol enables the IngressController to report those source + // addresses instead of reporting the load balancer's address in HTTP + // headers and logs. Note that enabling PROXY protocol on the + // IngressController will cause connections to fail if you are not using + // a load balancer that uses PROXY protocol to forward connections to + // the IngressController. See + // http://www.haproxy.org/download/2.2/doc/proxy-protocol.txt for + // information about PROXY protocol. + // + // The following values are valid for this field: + // + // * The empty string. + // * "TCP". + // * "PROXY". + // + // The empty string specifies the default, which is TCP without PROXY + // protocol. Note that the default is subject to change. + // + // +optional + Protocol IngressControllerProtocol `json:"protocol,omitempty"` + + // httpPort is the port on the host which should be used to listen for + // HTTP requests. This field should be set when port 80 is already in use. + // The value should not coincide with the NodePort range of the cluster. + // When the value is 0 or is not specified it defaults to 80. + // +kubebuilder:validation:Maximum=65535 + // +kubebuilder:validation:Minimum=0 + // +kubebuilder:default=80 + // +optional + HTTPPort int32 `json:"httpPort,omitempty"` + + // httpsPort is the port on the host which should be used to listen for + // HTTPS requests. This field should be set when port 443 is already in use. + // The value should not coincide with the NodePort range of the cluster. + // When the value is 0 or is not specified it defaults to 443. + // +kubebuilder:validation:Maximum=65535 + // +kubebuilder:validation:Minimum=0 + // +kubebuilder:default=443 + // +optional + HTTPSPort int32 `json:"httpsPort,omitempty"` + + // statsPort is the port on the host where the stats from the router are + // published. The value should not coincide with the NodePort range of the + // cluster. If an external load balancer is configured to forward connections + // to this IngressController, the load balancer should use this port for + // health checks. The load balancer can send HTTP probes on this port on a + // given node, with the path /healthz/ready to determine if the ingress + // controller is ready to receive traffic on the node. For proper operation + // the load balancer must not forward traffic to a node until the health + // check reports ready. The load balancer should also stop forwarding requests + // within a maximum of 45 seconds after /healthz/ready starts reporting + // not-ready. Probing every 5 to 10 seconds, with a 5-second timeout and with + // a threshold of two successful or failed requests to become healthy or + // unhealthy respectively, are well-tested values. When the value is 0 or + // is not specified it defaults to 1936. + // +kubebuilder:validation:Maximum=65535 + // +kubebuilder:validation:Minimum=0 + // +kubebuilder:default=1936 + // +optional + StatsPort int32 `json:"statsPort,omitempty"` +} + +// PrivateStrategy holds parameters for the Private endpoint publishing +// strategy. +type PrivateStrategy struct { + // protocol specifies whether the IngressController expects incoming + // connections to use plain TCP or whether the IngressController expects + // PROXY protocol. + // + // PROXY protocol can be used with load balancers that support it to + // communicate the source addresses of client connections when + // forwarding those connections to the IngressController. Using PROXY + // protocol enables the IngressController to report those source + // addresses instead of reporting the load balancer's address in HTTP + // headers and logs. Note that enabling PROXY protocol on the + // IngressController will cause connections to fail if you are not using + // a load balancer that uses PROXY protocol to forward connections to + // the IngressController. See + // http://www.haproxy.org/download/2.2/doc/proxy-protocol.txt for + // information about PROXY protocol. + // + // The following values are valid for this field: + // + // * The empty string. + // * "TCP". + // * "PROXY". + // + // The empty string specifies the default, which is TCP without PROXY + // protocol. Note that the default is subject to change. + // + // +optional + Protocol IngressControllerProtocol `json:"protocol,omitempty"` +} + +// NodePortStrategy holds parameters for the NodePortService endpoint publishing strategy. +type NodePortStrategy struct { + // protocol specifies whether the IngressController expects incoming + // connections to use plain TCP or whether the IngressController expects + // PROXY protocol. + // + // PROXY protocol can be used with load balancers that support it to + // communicate the source addresses of client connections when + // forwarding those connections to the IngressController. Using PROXY + // protocol enables the IngressController to report those source + // addresses instead of reporting the load balancer's address in HTTP + // headers and logs. Note that enabling PROXY protocol on the + // IngressController will cause connections to fail if you are not using + // a load balancer that uses PROXY protocol to forward connections to + // the IngressController. See + // http://www.haproxy.org/download/2.2/doc/proxy-protocol.txt for + // information about PROXY protocol. + // + // The following values are valid for this field: + // + // * The empty string. + // * "TCP". + // * "PROXY". + // + // The empty string specifies the default, which is TCP without PROXY + // protocol. Note that the default is subject to change. + // + // +optional + Protocol IngressControllerProtocol `json:"protocol,omitempty"` +} + +// IngressControllerProtocol specifies whether PROXY protocol is enabled or not. +// +kubebuilder:validation:Enum="";TCP;PROXY +type IngressControllerProtocol string + +const ( + DefaultProtocol IngressControllerProtocol = "" + TCPProtocol IngressControllerProtocol = "TCP" + ProxyProtocol IngressControllerProtocol = "PROXY" +) + +// EndpointPublishingStrategy is a way to publish the endpoints of an +// IngressController, and represents the type and any additional configuration +// for a specific type. +// +union +type EndpointPublishingStrategy struct { + // type is the publishing strategy to use. Valid values are: + // + // * LoadBalancerService + // + // Publishes the ingress controller using a Kubernetes LoadBalancer Service. + // + // In this configuration, the ingress controller deployment uses container + // networking. A LoadBalancer Service is created to publish the deployment. + // + // See: https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer + // + // If domain is set, a wildcard DNS record will be managed to point at the + // LoadBalancer Service's external name. DNS records are managed only in DNS + // zones defined by dns.config.openshift.io/cluster .spec.publicZone and + // .spec.privateZone. + // + // Wildcard DNS management is currently supported only on the AWS, Azure, + // and GCP platforms. + // + // * HostNetwork + // + // Publishes the ingress controller on node ports where the ingress controller + // is deployed. + // + // In this configuration, the ingress controller deployment uses host + // networking, bound to node ports 80 and 443. The user is responsible for + // configuring an external load balancer to publish the ingress controller via + // the node ports. + // + // * Private + // + // Does not publish the ingress controller. + // + // In this configuration, the ingress controller deployment uses container + // networking, and is not explicitly published. The user must manually publish + // the ingress controller. + // + // * NodePortService + // + // Publishes the ingress controller using a Kubernetes NodePort Service. + // + // In this configuration, the ingress controller deployment uses container + // networking. A NodePort Service is created to publish the deployment. The + // specific node ports are dynamically allocated by OpenShift; however, to + // support static port allocations, user changes to the node port + // field of the managed NodePort Service will preserved. + // + // +unionDiscriminator + // +required + Type EndpointPublishingStrategyType `json:"type"` + + // loadBalancer holds parameters for the load balancer. Present only if + // type is LoadBalancerService. + // +optional + LoadBalancer *LoadBalancerStrategy `json:"loadBalancer,omitempty"` + + // hostNetwork holds parameters for the HostNetwork endpoint publishing + // strategy. Present only if type is HostNetwork. + // +optional + HostNetwork *HostNetworkStrategy `json:"hostNetwork,omitempty"` + + // private holds parameters for the Private endpoint publishing + // strategy. Present only if type is Private. + // +optional + Private *PrivateStrategy `json:"private,omitempty"` + + // nodePort holds parameters for the NodePortService endpoint publishing strategy. + // Present only if type is NodePortService. + // +optional + NodePort *NodePortStrategy `json:"nodePort,omitempty"` +} + +// ClientCertificatePolicy describes the policy for client certificates. +// +kubebuilder:validation:Enum="";Required;Optional +type ClientCertificatePolicy string + +const ( + // ClientCertificatePolicyRequired indicates that a client certificate + // should be required. + ClientCertificatePolicyRequired ClientCertificatePolicy = "Required" + + // ClientCertificatePolicyOptional indicates that a client certificate + // should be requested but not required. + ClientCertificatePolicyOptional ClientCertificatePolicy = "Optional" +) + +// ClientTLS specifies TLS configuration to enable client-to-server +// authentication, which can be used for mutual TLS. +type ClientTLS struct { + // clientCertificatePolicy specifies whether the ingress controller + // requires clients to provide certificates. This field accepts the + // values "Required" or "Optional". + // + // Note that the ingress controller only checks client certificates for + // edge-terminated and reencrypt TLS routes; it cannot check + // certificates for cleartext HTTP or passthrough TLS routes. + // + // +required + ClientCertificatePolicy ClientCertificatePolicy `json:"clientCertificatePolicy"` + + // clientCA specifies a configmap containing the PEM-encoded CA + // certificate bundle that should be used to verify a client's + // certificate. The administrator must create this configmap in the + // openshift-config namespace. + // + // +required + ClientCA configv1.ConfigMapNameReference `json:"clientCA"` + + // allowedSubjectPatterns specifies a list of regular expressions that + // should be matched against the distinguished name on a valid client + // certificate to filter requests. The regular expressions must use + // PCRE syntax. If this list is empty, no filtering is performed. If + // the list is nonempty, then at least one pattern must match a client + // certificate's distinguished name or else the ingress controller + // rejects the certificate and denies the connection. + // + // +listType=atomic + // +optional + AllowedSubjectPatterns []string `json:"allowedSubjectPatterns,omitempty"` +} + +// RouteAdmissionPolicy is an admission policy for allowing new route claims. +type RouteAdmissionPolicy struct { + // namespaceOwnership describes how host name claims across namespaces should + // be handled. + // + // Value must be one of: + // + // - Strict: Do not allow routes in different namespaces to claim the same host. + // + // - InterNamespaceAllowed: Allow routes to claim different paths of the same + // host name across namespaces. + // + // If empty, the default is Strict. + // +optional + NamespaceOwnership NamespaceOwnershipCheck `json:"namespaceOwnership,omitempty"` + // wildcardPolicy describes how routes with wildcard policies should + // be handled for the ingress controller. WildcardPolicy controls use + // of routes [1] exposed by the ingress controller based on the route's + // wildcard policy. + // + // [1] https://github.com/openshift/api/blob/master/route/v1/types.go + // + // Note: Updating WildcardPolicy from WildcardsAllowed to WildcardsDisallowed + // will cause admitted routes with a wildcard policy of Subdomain to stop + // working. These routes must be updated to a wildcard policy of None to be + // readmitted by the ingress controller. + // + // WildcardPolicy supports WildcardsAllowed and WildcardsDisallowed values. + // + // If empty, defaults to "WildcardsDisallowed". + // + WildcardPolicy WildcardPolicy `json:"wildcardPolicy,omitempty"` +} + +// WildcardPolicy is a route admission policy component that describes how +// routes with a wildcard policy should be handled. +// +kubebuilder:validation:Enum=WildcardsAllowed;WildcardsDisallowed +type WildcardPolicy string + +const ( + // WildcardPolicyAllowed indicates routes with any wildcard policy are + // admitted by the ingress controller. + WildcardPolicyAllowed WildcardPolicy = "WildcardsAllowed" + + // WildcardPolicyDisallowed indicates only routes with a wildcard policy + // of None are admitted by the ingress controller. + WildcardPolicyDisallowed WildcardPolicy = "WildcardsDisallowed" +) + +// NamespaceOwnershipCheck is a route admission policy component that describes +// how host name claims across namespaces should be handled. +// +kubebuilder:validation:Enum=InterNamespaceAllowed;Strict +type NamespaceOwnershipCheck string + +const ( + // InterNamespaceAllowedOwnershipCheck allows routes to claim different paths of the same host name across namespaces. + InterNamespaceAllowedOwnershipCheck NamespaceOwnershipCheck = "InterNamespaceAllowed" + + // StrictNamespaceOwnershipCheck does not allow routes to claim the same host name across namespaces. + StrictNamespaceOwnershipCheck NamespaceOwnershipCheck = "Strict" +) + +// LoggingDestinationType is a type of destination to which to send log +// messages. +// +// +kubebuilder:validation:Enum=Container;Syslog +type LoggingDestinationType string + +const ( + // Container sends log messages to a sidecar container. + ContainerLoggingDestinationType LoggingDestinationType = "Container" + + // Syslog sends log messages to a syslog endpoint. + SyslogLoggingDestinationType LoggingDestinationType = "Syslog" + + // ContainerLoggingSidecarContainerName is the name of the container + // with the log output in an ingress controller pod when container + // logging is used. + ContainerLoggingSidecarContainerName = "logs" +) + +// SyslogLoggingDestinationParameters describes parameters for the Syslog +// logging destination type. +type SyslogLoggingDestinationParameters struct { + // address is the IP address of the syslog endpoint that receives log + // messages. + // + // +required + Address string `json:"address"` + + // port is the UDP port number of the syslog endpoint that receives log + // messages. + // + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=65535 + // +required + Port uint32 `json:"port"` + + // facility specifies the syslog facility of log messages. + // + // If this field is empty, the facility is "local1". + // + // +kubebuilder:validation:Enum=kern;user;mail;daemon;auth;syslog;lpr;news;uucp;cron;auth2;ftp;ntp;audit;alert;cron2;local0;local1;local2;local3;local4;local5;local6;local7 + // +optional + Facility string `json:"facility,omitempty"` + + // maxLength is the maximum length of the log message. + // + // Valid values are integers in the range 480 to 4096, inclusive. + // + // When omitted, the default value is 1024. + // + // +kubebuilder:validation:Maximum=4096 + // +kubebuilder:validation:Minimum=480 + // +kubebuilder:default=1024 + // +default:=1024 + // +optional + MaxLength uint32 `json:"maxLength,omitempty"` +} + +// ContainerLoggingDestinationParameters describes parameters for the Container +// logging destination type. +type ContainerLoggingDestinationParameters struct { + // maxLength is the maximum length of the log message. + // + // Valid values are integers in the range 480 to 8192, inclusive. + // + // When omitted, the default value is 1024. + // + // +kubebuilder:validation:Maximum=8192 + // +kubebuilder:validation:Minimum=480 + // +kubebuilder:default=1024 + // +default:=1024 + // +optional + MaxLength int32 `json:"maxLength,omitempty"` +} + +// LoggingDestination describes a destination for log messages. +// +union +type LoggingDestination struct { + // type is the type of destination for logs. It must be one of the + // following: + // + // * Container + // + // The ingress operator configures the sidecar container named "logs" on + // the ingress controller pod and configures the ingress controller to + // write logs to the sidecar. The logs are then available as container + // logs. The expectation is that the administrator configures a custom + // logging solution that reads logs from this sidecar. Note that using + // container logs means that logs may be dropped if the rate of logs + // exceeds the container runtime's or the custom logging solution's + // capacity. + // + // * Syslog + // + // Logs are sent to a syslog endpoint. The administrator must specify + // an endpoint that can receive syslog messages. The expectation is + // that the administrator has configured a custom syslog instance. + // + // +unionDiscriminator + // +required + Type LoggingDestinationType `json:"type"` + + // syslog holds parameters for a syslog endpoint. Present only if + // type is Syslog. + // + // +optional + Syslog *SyslogLoggingDestinationParameters `json:"syslog,omitempty"` + + // container holds parameters for the Container logging destination. + // Present only if type is Container. + // + // +optional + Container *ContainerLoggingDestinationParameters `json:"container,omitempty"` +} + +// IngressControllerCaptureHTTPHeader describes an HTTP header that should be +// captured. +type IngressControllerCaptureHTTPHeader struct { + // name specifies a header name. Its value must be a valid HTTP header + // name as defined in RFC 2616 section 4.2. + // + // +kubebuilder:validation:Pattern="^[-!#$%&'*+.0-9A-Z^_`a-z|~]+$" + // +required + Name string `json:"name"` + + // maxLength specifies a maximum length for the header value. If a + // header value exceeds this length, the value will be truncated in the + // log message. Note that the ingress controller may impose a separate + // bound on the total length of HTTP headers in a request. + // + // +kubebuilder:validation:Minimum=1 + // +required + MaxLength int `json:"maxLength"` +} + +// IngressControllerCaptureHTTPHeaders specifies which HTTP headers the +// IngressController captures. +type IngressControllerCaptureHTTPHeaders struct { + // request specifies which HTTP request headers to capture. + // + // If this field is empty, no request headers are captured. + // + // +nullable + // +optional + // +listType=atomic + Request []IngressControllerCaptureHTTPHeader `json:"request,omitempty"` + + // response specifies which HTTP response headers to capture. + // + // If this field is empty, no response headers are captured. + // + // +nullable + // +optional + // +listType=atomic + Response []IngressControllerCaptureHTTPHeader `json:"response,omitempty"` +} + +// CookieMatchType indicates the type of matching used against cookie names to +// select a cookie for capture. +// +kubebuilder:validation:Enum=Exact;Prefix +type CookieMatchType string + +const ( + // CookieMatchTypeExact indicates that an exact string match should be + // performed. + CookieMatchTypeExact CookieMatchType = "Exact" + // CookieMatchTypePrefix indicates that a string prefix match should be + // performed. + CookieMatchTypePrefix CookieMatchType = "Prefix" +) + +// IngressControllerCaptureHTTPCookie describes an HTTP cookie that should be +// captured. +type IngressControllerCaptureHTTPCookie struct { + IngressControllerCaptureHTTPCookieUnion `json:",inline"` + + // maxLength specifies a maximum length of the string that will be + // logged, which includes the cookie name, cookie value, and + // one-character delimiter. If the log entry exceeds this length, the + // value will be truncated in the log message. Note that the ingress + // controller may impose a separate bound on the total length of HTTP + // headers in a request. + // + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=1024 + // +required + MaxLength int `json:"maxLength"` +} + +// IngressControllerCaptureHTTPCookieUnion describes optional fields of an HTTP cookie that should be captured. +// +union +type IngressControllerCaptureHTTPCookieUnion struct { + // matchType specifies the type of match to be performed on the cookie + // name. Allowed values are "Exact" for an exact string match and + // "Prefix" for a string prefix match. If "Exact" is specified, a name + // must be specified in the name field. If "Prefix" is provided, a + // prefix must be specified in the namePrefix field. For example, + // specifying matchType "Prefix" and namePrefix "foo" will capture a + // cookie named "foo" or "foobar" but not one named "bar". The first + // matching cookie is captured. + // + // +unionDiscriminator + // +required + MatchType CookieMatchType `json:"matchType"` + + // name specifies a cookie name. Its value must be a valid HTTP cookie + // name as defined in RFC 6265 section 4.1. + // + // +kubebuilder:validation:Pattern="^[-!#$%&'*+.0-9A-Z^_`a-z|~]*$" + // +kubebuilder:validation:MinLength=0 + // +kubebuilder:validation:MaxLength=1024 + // +optional + Name string `json:"name"` + + // namePrefix specifies a cookie name prefix. Its value must be a valid + // HTTP cookie name as defined in RFC 6265 section 4.1. + // + // +kubebuilder:validation:Pattern="^[-!#$%&'*+.0-9A-Z^_`a-z|~]*$" + // +kubebuilder:validation:MinLength=0 + // +kubebuilder:validation:MaxLength=1024 + // +optional + NamePrefix string `json:"namePrefix"` +} + +// LoggingPolicy indicates how an event should be logged. +// +kubebuilder:validation:Enum=Log;Ignore +type LoggingPolicy string + +const ( + // LoggingPolicyLog indicates that an event should be logged. + LoggingPolicyLog LoggingPolicy = "Log" + // LoggingPolicyIgnore indicates that an event should not be logged. + LoggingPolicyIgnore LoggingPolicy = "Ignore" +) + +// AccessLogging describes how client requests should be logged. +type AccessLogging struct { + // destination is where access logs go. + // + // +required + Destination LoggingDestination `json:"destination"` + + // httpLogFormat specifies the format of the log message for an HTTP + // request. + // + // If this field is empty, log messages use the implementation's default + // HTTP log format. For HAProxy's default HTTP log format, see the + // HAProxy documentation: + // http://cbonte.github.io/haproxy-dconv/2.0/configuration.html#8.2.3 + // + // Note that this format only applies to cleartext HTTP connections + // and to secure HTTP connections for which the ingress controller + // terminates encryption (that is, edge-terminated or reencrypt + // connections). It does not affect the log format for TLS passthrough + // connections. + // + // +optional + HttpLogFormat string `json:"httpLogFormat,omitempty"` + + // httpCaptureHeaders defines HTTP headers that should be captured in + // access logs. If this field is empty, no headers are captured. + // + // Note that this option only applies to cleartext HTTP connections + // and to secure HTTP connections for which the ingress controller + // terminates encryption (that is, edge-terminated or reencrypt + // connections). Headers cannot be captured for TLS passthrough + // connections. + // + // +optional + HTTPCaptureHeaders IngressControllerCaptureHTTPHeaders `json:"httpCaptureHeaders,omitempty"` + + // httpCaptureCookies specifies HTTP cookies that should be captured in + // access logs. If this field is empty, no cookies are captured. + // + // +nullable + // +optional + // +kubebuilder:validation:MaxItems=1 + // +listType=atomic + HTTPCaptureCookies []IngressControllerCaptureHTTPCookie `json:"httpCaptureCookies,omitempty"` + + // logEmptyRequests specifies how connections on which no request is + // received should be logged. Typically, these empty requests come from + // load balancers' health probes or Web browsers' speculative + // connections ("preconnect"), in which case logging these requests may + // be undesirable. However, these requests may also be caused by + // network errors, in which case logging empty requests may be useful + // for diagnosing the errors. In addition, these requests may be caused + // by port scans, in which case logging empty requests may aid in + // detecting intrusion attempts. Allowed values for this field are + // "Log" and "Ignore". The default value is "Log". + // + // +optional + // +kubebuilder:default:="Log" + LogEmptyRequests LoggingPolicy `json:"logEmptyRequests,omitempty"` +} + +// IngressControllerLogging describes what should be logged where. +type IngressControllerLogging struct { + // access describes how the client requests should be logged. + // + // If this field is empty, access logging is disabled. + // + // +optional + Access *AccessLogging `json:"access,omitempty"` +} + +// IngressControllerHTTPHeaderPolicy is a policy for setting HTTP headers. +// +// +kubebuilder:validation:Enum=Append;Replace;IfNone;Never +type IngressControllerHTTPHeaderPolicy string + +const ( + // AppendHTTPHeaderPolicy appends the header, preserving any existing header. + AppendHTTPHeaderPolicy IngressControllerHTTPHeaderPolicy = "Append" + // ReplaceHTTPHeaderPolicy sets the header, removing any existing header. + ReplaceHTTPHeaderPolicy IngressControllerHTTPHeaderPolicy = "Replace" + // IfNoneHTTPHeaderPolicy sets the header if it is not already set. + IfNoneHTTPHeaderPolicy IngressControllerHTTPHeaderPolicy = "IfNone" + // NeverHTTPHeaderPolicy never sets the header, preserving any existing + // header. + NeverHTTPHeaderPolicy IngressControllerHTTPHeaderPolicy = "Never" +) + +// IngressControllerHTTPUniqueIdHeaderPolicy describes configuration for a +// unique id header. +type IngressControllerHTTPUniqueIdHeaderPolicy struct { + // name specifies the name of the HTTP header (for example, "unique-id") + // that the ingress controller should inject into HTTP requests. The + // field's value must be a valid HTTP header name as defined in RFC 2616 + // section 4.2. If the field is empty, no header is injected. + // + // +optional + // +kubebuilder:validation:Pattern="^$|^[-!#$%&'*+.0-9A-Z^_`a-z|~]+$" + // +kubebuilder:validation:MinLength=0 + // +kubebuilder:validation:MaxLength=1024 + Name string `json:"name,omitempty"` + + // format specifies the format for the injected HTTP header's value. + // This field has no effect unless name is specified. For the + // HAProxy-based ingress controller implementation, this format uses the + // same syntax as the HTTP log format. If the field is empty, the + // default value is "%{+X}o\\ %ci:%cp_%fi:%fp_%Ts_%rt:%pid"; see the + // corresponding HAProxy documentation: + // http://cbonte.github.io/haproxy-dconv/2.0/configuration.html#8.2.3 + // + // +optional + // +kubebuilder:validation:Pattern="^(%(%|(\\{[-+]?[QXE](,[-+]?[QXE])*\\})?([A-Za-z]+|\\[[.0-9A-Z_a-z]+(\\([^)]+\\))?(,[.0-9A-Z_a-z]+(\\([^)]+\\))?)*\\]))|[^%[:cntrl:]])*$" + // +kubebuilder:validation:MinLength=0 + // +kubebuilder:validation:MaxLength=1024 + Format string `json:"format,omitempty"` +} + +// IngressControllerHTTPHeaderNameCaseAdjustment is the name of an HTTP header +// (for example, "X-Forwarded-For") in the desired capitalization. The value +// must be a valid HTTP header name as defined in RFC 2616 section 4.2. +// +// +kubebuilder:validation:Pattern="^$|^[-!#$%&'*+.0-9A-Z^_`a-z|~]+$" +// +kubebuilder:validation:MinLength=0 +// +kubebuilder:validation:MaxLength=1024 +type IngressControllerHTTPHeaderNameCaseAdjustment string + +// IngressControllerHTTPHeaders specifies how the IngressController handles +// certain HTTP headers. +type IngressControllerHTTPHeaders struct { + // forwardedHeaderPolicy specifies when and how the IngressController + // sets the Forwarded, X-Forwarded-For, X-Forwarded-Host, + // X-Forwarded-Port, X-Forwarded-Proto, and X-Forwarded-Proto-Version + // HTTP headers. The value may be one of the following: + // + // * "Append", which specifies that the IngressController appends the + // headers, preserving existing headers. + // + // * "Replace", which specifies that the IngressController sets the + // headers, replacing any existing Forwarded or X-Forwarded-* headers. + // + // * "IfNone", which specifies that the IngressController sets the + // headers if they are not already set. + // + // * "Never", which specifies that the IngressController never sets the + // headers, preserving any existing headers. + // + // By default, the policy is "Append". + // + // +optional + ForwardedHeaderPolicy IngressControllerHTTPHeaderPolicy `json:"forwardedHeaderPolicy,omitempty"` + + // uniqueId describes configuration for a custom HTTP header that the + // ingress controller should inject into incoming HTTP requests. + // Typically, this header is configured to have a value that is unique + // to the HTTP request. The header can be used by applications or + // included in access logs to facilitate tracing individual HTTP + // requests. + // + // If this field is empty, no such header is injected into requests. + // + // +optional + UniqueId IngressControllerHTTPUniqueIdHeaderPolicy `json:"uniqueId,omitempty"` + + // headerNameCaseAdjustments specifies case adjustments that can be + // applied to HTTP header names. Each adjustment is specified as an + // HTTP header name with the desired capitalization. For example, + // specifying "X-Forwarded-For" indicates that the "x-forwarded-for" + // HTTP header should be adjusted to have the specified capitalization. + // + // These adjustments are only applied to cleartext, edge-terminated, and + // re-encrypt routes, and only when using HTTP/1. + // + // For request headers, these adjustments are applied only for routes + // that have the haproxy.router.openshift.io/h1-adjust-case=true + // annotation. For response headers, these adjustments are applied to + // all HTTP responses. + // + // If this field is empty, no request headers are adjusted. + // + // +nullable + // +optional + // +listType=atomic + HeaderNameCaseAdjustments []IngressControllerHTTPHeaderNameCaseAdjustment `json:"headerNameCaseAdjustments,omitempty"` + + // actions specifies options for modifying headers and their values. + // Note that this option only applies to cleartext HTTP connections + // and to secure HTTP connections for which the ingress controller + // terminates encryption (that is, edge-terminated or reencrypt + // connections). Headers cannot be modified for TLS passthrough + // connections. + // Setting the HSTS (`Strict-Transport-Security`) header is not supported via actions. `Strict-Transport-Security` + // may only be configured using the "haproxy.router.openshift.io/hsts_header" route annotation, and only in + // accordance with the policy specified in Ingress.Spec.RequiredHSTSPolicies. + // Any actions defined here are applied after any actions related to the following other fields: + // cache-control, spec.clientTLS, + // spec.httpHeaders.forwardedHeaderPolicy, spec.httpHeaders.uniqueId, + // and spec.httpHeaders.headerNameCaseAdjustments. + // In case of HTTP request headers, the actions specified in spec.httpHeaders.actions on the Route will be executed after + // the actions specified in the IngressController's spec.httpHeaders.actions field. + // In case of HTTP response headers, the actions specified in spec.httpHeaders.actions on the IngressController will be + // executed after the actions specified in the Route's spec.httpHeaders.actions field. + // Headers set using this API cannot be captured for use in access logs. + // The following header names are reserved and may not be modified via this API: + // Strict-Transport-Security, Proxy, Host, Cookie, Set-Cookie. + // Note that the total size of all net added headers *after* interpolating dynamic values + // must not exceed the value of spec.tuningOptions.headerBufferMaxRewriteBytes on the + // IngressController. Please refer to the documentation + // for that API field for more details. + // +optional + Actions IngressControllerHTTPHeaderActions `json:"actions,omitempty"` +} + +// IngressControllerHTTPHeaderActions defines configuration for actions on HTTP request and response headers. +type IngressControllerHTTPHeaderActions struct { + // response is a list of HTTP response headers to modify. + // Actions defined here will modify the response headers of all requests passing through an ingress controller. + // These actions are applied to all Routes i.e. for all connections handled by the ingress controller defined within a cluster. + // IngressController actions for response headers will be executed after Route actions. + // Currently, actions may define to either `Set` or `Delete` headers values. + // Actions are applied in sequence as defined in this list. + // A maximum of 20 response header actions may be configured. + // Sample fetchers allowed are "res.hdr" and "ssl_c_der". + // Converters allowed are "lower" and "base64". + // Example header values: "%[res.hdr(X-target),lower]", "%{+Q}[ssl_c_der,base64]". + // +listType=map + // +listMapKey=name + // +optional + // +kubebuilder:validation:MaxItems=20 + // +kubebuilder:validation:XValidation:rule=`self.all(key, key.action.type == "Delete" || (has(key.action.set) && key.action.set.value.matches('^(?:%(?:%|(?:\\{[-+]?[QXE](?:,[-+]?[QXE])*\\})?\\[(?:res\\.hdr\\([0-9A-Za-z-]+\\)|ssl_c_der)(?:,(?:lower|base64))*\\])|[^%[:cntrl:]])+$')))`,message="Either the header value provided is not in correct format or the sample fetcher/converter specified is not allowed. The dynamic header value will be interpreted as an HAProxy format string as defined in http://cbonte.github.io/haproxy-dconv/2.6/configuration.html#8.2.6 and may use HAProxy's %[] syntax and otherwise must be a valid HTTP header value as defined in https://datatracker.ietf.org/doc/html/rfc7230#section-3.2. Sample fetchers allowed are res.hdr, ssl_c_der. Converters allowed are lower, base64." + Response []IngressControllerHTTPHeader `json:"response"` + // request is a list of HTTP request headers to modify. + // Actions defined here will modify the request headers of all requests passing through an ingress controller. + // These actions are applied to all Routes i.e. for all connections handled by the ingress controller defined within a cluster. + // IngressController actions for request headers will be executed before Route actions. + // Currently, actions may define to either `Set` or `Delete` headers values. + // Actions are applied in sequence as defined in this list. + // A maximum of 20 request header actions may be configured. + // Sample fetchers allowed are "req.hdr" and "ssl_c_der". + // Converters allowed are "lower" and "base64". + // Example header values: "%[req.hdr(X-target),lower]", "%{+Q}[ssl_c_der,base64]". + // + --- + // + Note: Any change to regex mentioned below must be reflected in the CRD validation of route in https://github.com/openshift/library-go/blob/master/pkg/route/validation/validation.go and vice-versa. + // +listType=map + // +listMapKey=name + // +optional + // +kubebuilder:validation:MaxItems=20 + // +kubebuilder:validation:XValidation:rule=`self.all(key, key.action.type == "Delete" || (has(key.action.set) && key.action.set.value.matches('^(?:%(?:%|(?:\\{[-+]?[QXE](?:,[-+]?[QXE])*\\})?\\[(?:req\\.hdr\\([0-9A-Za-z-]+\\)|ssl_c_der)(?:,(?:lower|base64))*\\])|[^%[:cntrl:]])+$')))`,message="Either the header value provided is not in correct format or the sample fetcher/converter specified is not allowed. The dynamic header value will be interpreted as an HAProxy format string as defined in http://cbonte.github.io/haproxy-dconv/2.6/configuration.html#8.2.6 and may use HAProxy's %[] syntax and otherwise must be a valid HTTP header value as defined in https://datatracker.ietf.org/doc/html/rfc7230#section-3.2. Sample fetchers allowed are req.hdr, ssl_c_der. Converters allowed are lower, base64." + Request []IngressControllerHTTPHeader `json:"request"` +} + +// IngressControllerHTTPHeader specifies configuration for setting or deleting an HTTP header. +type IngressControllerHTTPHeader struct { + // name specifies the name of a header on which to perform an action. Its value must be a valid HTTP header + // name as defined in RFC 2616 section 4.2. + // The name must consist only of alphanumeric and the following special characters, "-!#$%&'*+.^_`". + // The following header names are reserved and may not be modified via this API: + // Strict-Transport-Security, Proxy, Host, Cookie, Set-Cookie. + // It must be no more than 255 characters in length. + // Header name must be unique. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=255 + // +kubebuilder:validation:Pattern="^[-!#$%&'*+.0-9A-Z^_`a-z|~]+$" + // +kubebuilder:validation:XValidation:rule="self.lowerAscii() != 'strict-transport-security'",message="strict-transport-security header may not be modified via header actions" + // +kubebuilder:validation:XValidation:rule="self.lowerAscii() != 'proxy'",message="proxy header may not be modified via header actions" + // +kubebuilder:validation:XValidation:rule="self.lowerAscii() != 'host'",message="host header may not be modified via header actions" + // +kubebuilder:validation:XValidation:rule="self.lowerAscii() != 'cookie'",message="cookie header may not be modified via header actions" + // +kubebuilder:validation:XValidation:rule="self.lowerAscii() != 'set-cookie'",message="set-cookie header may not be modified via header actions" + Name string `json:"name"` + // action specifies actions to perform on headers, such as setting or deleting headers. + // +required + Action IngressControllerHTTPHeaderActionUnion `json:"action"` +} + +// IngressControllerHTTPHeaderActionUnion specifies an action to take on an HTTP header. +// +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'Set' ? has(self.set) : !has(self.set)",message="set is required when type is Set, and forbidden otherwise" +// +union +type IngressControllerHTTPHeaderActionUnion struct { + // type defines the type of the action to be applied on the header. + // Possible values are Set or Delete. + // Set allows you to set HTTP request and response headers. + // Delete allows you to delete HTTP request and response headers. + // +unionDiscriminator + // +kubebuilder:validation:Enum:=Set;Delete + // +required + Type IngressControllerHTTPHeaderActionType `json:"type"` + + // set specifies how the HTTP header should be set. + // This field is required when type is Set and forbidden otherwise. + // +optional + // +unionMember + Set *IngressControllerSetHTTPHeader `json:"set,omitempty"` +} + +// IngressControllerHTTPHeaderActionType defines actions that can be performed on HTTP headers. +type IngressControllerHTTPHeaderActionType string + +const ( + // Set specifies that an HTTP header should be set. + Set IngressControllerHTTPHeaderActionType = "Set" + // Delete specifies that an HTTP header should be deleted. + Delete IngressControllerHTTPHeaderActionType = "Delete" +) + +// IngressControllerSetHTTPHeader defines the value which needs to be set on an HTTP header. +type IngressControllerSetHTTPHeader struct { + // value specifies a header value. + // Dynamic values can be added. The value will be interpreted as an HAProxy format string as defined in + // http://cbonte.github.io/haproxy-dconv/2.6/configuration.html#8.2.6 and may use HAProxy's %[] syntax and + // otherwise must be a valid HTTP header value as defined in https://datatracker.ietf.org/doc/html/rfc7230#section-3.2. + // The value of this field must be no more than 16384 characters in length. + // Note that the total size of all net added headers *after* interpolating dynamic values + // must not exceed the value of spec.tuningOptions.headerBufferMaxRewriteBytes on the + // IngressController. + // + --- + // + Note: This limit was selected as most common web servers have a limit of 16384 characters or some lower limit. + // + See . + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=16384 + Value string `json:"value"` +} + +// IngressControllerTuningOptions specifies options for tuning the performance +// of ingress controller pods +type IngressControllerTuningOptions struct { + // headerBufferBytes describes how much memory should be reserved + // (in bytes) for IngressController connection sessions. + // Note that this value must be at least 16384 if HTTP/2 is + // enabled for the IngressController (https://tools.ietf.org/html/rfc7540). + // If this field is empty, the IngressController will use a default value + // of 32768 bytes. + // + // Setting this field is generally not recommended as headerBufferBytes + // values that are too small may break the IngressController and + // headerBufferBytes values that are too large could cause the + // IngressController to use significantly more memory than necessary. + // + // +kubebuilder:validation:Minimum=16384 + // +optional + HeaderBufferBytes int32 `json:"headerBufferBytes,omitempty"` + + // headerBufferMaxRewriteBytes describes how much memory should be reserved + // (in bytes) from headerBufferBytes for HTTP header rewriting + // and appending for IngressController connection sessions. + // Note that incoming HTTP requests will be limited to + // (headerBufferBytes - headerBufferMaxRewriteBytes) bytes, meaning + // headerBufferBytes must be greater than headerBufferMaxRewriteBytes. + // If this field is empty, the IngressController will use a default value + // of 8192 bytes. + // + // Setting this field is generally not recommended as + // headerBufferMaxRewriteBytes values that are too small may break the + // IngressController and headerBufferMaxRewriteBytes values that are too + // large could cause the IngressController to use significantly more memory + // than necessary. + // + // +kubebuilder:validation:Minimum=4096 + // +optional + HeaderBufferMaxRewriteBytes int32 `json:"headerBufferMaxRewriteBytes,omitempty"` + + // threadCount defines the number of threads created per HAProxy process. + // Creating more threads allows each ingress controller pod to handle more + // connections, at the cost of more system resources being used. HAProxy + // currently supports up to 64 threads. If this field is empty, the + // IngressController will use the default value. The current default is 4 + // threads, but this may change in future releases. + // + // Setting this field is generally not recommended. Increasing the number + // of HAProxy threads allows ingress controller pods to utilize more CPU + // time under load, potentially starving other pods if set too high. + // Reducing the number of threads may cause the ingress controller to + // perform poorly. + // + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=64 + // +optional + ThreadCount int32 `json:"threadCount,omitempty"` + + // clientTimeout defines how long a connection will be held open while + // waiting for a client response. + // + // If unset, the default timeout is 30s + // +kubebuilder:validation:Format=duration + // +optional + ClientTimeout *metav1.Duration `json:"clientTimeout,omitempty"` + + // clientFinTimeout defines how long a connection will be held open while + // waiting for the client response to the server/backend closing the + // connection. + // + // If unset, the default timeout is 1s + // +kubebuilder:validation:Format=duration + // +optional + ClientFinTimeout *metav1.Duration `json:"clientFinTimeout,omitempty"` + + // serverTimeout defines how long a connection will be held open while + // waiting for a server/backend response. + // + // If unset, the default timeout is 30s + // +kubebuilder:validation:Format=duration + // +optional + ServerTimeout *metav1.Duration `json:"serverTimeout,omitempty"` + + // serverFinTimeout defines how long a connection will be held open while + // waiting for the server/backend response to the client closing the + // connection. + // + // If unset, the default timeout is 1s + // +kubebuilder:validation:Format=duration + // +optional + ServerFinTimeout *metav1.Duration `json:"serverFinTimeout,omitempty"` + + // tunnelTimeout defines how long a tunnel connection (including + // websockets) will be held open while the tunnel is idle. + // + // If unset, the default timeout is 1h + // +kubebuilder:validation:Format=duration + // +optional + TunnelTimeout *metav1.Duration `json:"tunnelTimeout,omitempty"` + + // connectTimeout defines the maximum time to wait for + // a connection attempt to a server/backend to succeed. + // + // This field expects an unsigned duration string of decimal numbers, each with optional + // fraction and a unit suffix, e.g. "300ms", "1.5h" or "2h45m". + // Valid time units are "ns", "us" (or "µs" U+00B5 or "μs" U+03BC), "ms", "s", "m", "h". + // + // When omitted, this means the user has no opinion and the platform is left + // to choose a reasonable default. This default is subject to change over time. + // The current default is 5s. + // + // +kubebuilder:validation:Pattern=^(0|([0-9]+(\.[0-9]+)?(ns|us|µs|μs|ms|s|m|h))+)$ + // +kubebuilder:validation:Type:=string + // +optional + ConnectTimeout *metav1.Duration `json:"connectTimeout,omitempty"` + + // httpKeepAliveTimeout defines the maximum allowed time to wait for + // a new HTTP request to appear on a connection from the client to the router. + // + // This field expects an unsigned duration string of a decimal number, with optional + // fraction and a unit suffix, e.g. "300ms", "1.5s" or "2m45s". + // Valid time units are "ms", "s", "m". + // The allowed range is from 1 millisecond to 15 minutes. + // + // When omitted, this means the user has no opinion and the platform is left + // to choose a reasonable default. This default is subject to change over time. + // The current default is 300s. + // + // Low values (tens of milliseconds or less) can cause clients to close and reopen connections + // for each request, leading to reduced connection sharing. + // For HTTP/2, special care should be taken with low values. + // A few seconds is a reasonable starting point to avoid holding idle connections open + // while still allowing subsequent requests to reuse the connection. + // + // High values (minutes or more) favor connection reuse but may cause idle + // connections to linger longer. + // + // +kubebuilder:validation:Type:=string + // +kubebuilder:validation:XValidation:rule="self.matches('^([0-9]+(\\\\.[0-9]+)?(ms|s|m))+$')",message="httpKeepAliveTimeout must be a valid duration string composed of an unsigned integer value, optionally followed by a decimal fraction and a unit suffix (ms, s, m)" + // +kubebuilder:validation:XValidation:rule="!self.matches('^([0-9]+(\\\\.[0-9]+)?(ms|s|m))+$') || duration(self) <= duration('15m')",message="httpKeepAliveTimeout must be less than or equal to 15 minutes" + // +kubebuilder:validation:XValidation:rule="!self.matches('^([0-9]+(\\\\.[0-9]+)?(ms|s|m))+$') || duration(self) >= duration('1ms')",message="httpKeepAliveTimeout must be greater than or equal to 1 millisecond" + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=16 + // +optional + HTTPKeepAliveTimeout *metav1.Duration `json:"httpKeepAliveTimeout,omitempty"` + + // tlsInspectDelay defines how long the router can hold data to find a + // matching route. + // + // Setting this too short can cause the router to fall back to the default + // certificate for edge-terminated or reencrypt routes even when a better + // matching certificate could be used. + // + // If unset, the default inspect delay is 5s + // +kubebuilder:validation:Format=duration + // +optional + TLSInspectDelay *metav1.Duration `json:"tlsInspectDelay,omitempty"` + + // healthCheckInterval defines how long the router waits between two consecutive + // health checks on its configured backends. This value is applied globally as + // a default for all routes, but may be overridden per-route by the route annotation + // "router.openshift.io/haproxy.health.check.interval". + // + // Expects an unsigned duration string of decimal numbers, each with optional + // fraction and a unit suffix, eg "300ms", "1.5h" or "2h45m". + // Valid time units are "ns", "us" (or "µs" U+00B5 or "μs" U+03BC), "ms", "s", "m", "h". + // + // Setting this to less than 5s can cause excess traffic due to too frequent + // TCP health checks and accompanying SYN packet storms. Alternatively, setting + // this too high can result in increased latency, due to backend servers that are no + // longer available, but haven't yet been detected as such. + // + // An empty or zero healthCheckInterval means no opinion and IngressController chooses + // a default, which is subject to change over time. + // Currently the default healthCheckInterval value is 5s. + // + // Currently the minimum allowed value is 1s and the maximum allowed value is + // 2147483647ms (24.85 days). Both are subject to change over time. + // + // +kubebuilder:validation:Pattern=^(0|([0-9]+(\.[0-9]+)?(ns|us|µs|μs|ms|s|m|h))+)$ + // +kubebuilder:validation:Type:=string + // +optional + HealthCheckInterval *metav1.Duration `json:"healthCheckInterval,omitempty"` + + // maxConnections defines the maximum number of simultaneous + // connections that can be established per HAProxy process. + // Increasing this value allows each ingress controller pod to + // handle more connections but at the cost of additional + // system resources being consumed. + // + // Permitted values are: empty, 0, -1, and the range + // 2000-2000000. + // + // If this field is empty or 0, the IngressController will use + // the default value of 50000, but the default is subject to + // change in future releases. + // + // If the value is -1 then HAProxy will dynamically compute a + // maximum value based on the available ulimits in the running + // container. Selecting -1 (i.e., auto) will result in a large + // value being computed (~520000 on OpenShift >=4.10 clusters) + // and therefore each HAProxy process will incur significant + // memory usage compared to the current default of 50000. + // + // Setting a value that is greater than the current operating + // system limit will prevent the HAProxy process from + // starting. + // + // If you choose a discrete value (e.g., 750000) and the + // router pod is migrated to a new node, there's no guarantee + // that that new node has identical ulimits configured. In + // such a scenario the pod would fail to start. If you have + // nodes with different ulimits configured (e.g., different + // tuned profiles) and you choose a discrete value then the + // guidance is to use -1 and let the value be computed + // dynamically at runtime. + // + // You can monitor memory usage for router containers with the + // following metric: + // 'container_memory_working_set_bytes{container="router",namespace="openshift-ingress"}'. + // + // You can monitor memory usage of individual HAProxy + // processes in router containers with the following metric: + // 'container_memory_working_set_bytes{container="router",namespace="openshift-ingress"}/container_processes{container="router",namespace="openshift-ingress"}'. + // + // +kubebuilder:validation:XValidation:rule="self == 0 || self == -1 || (self >= 2000 && self <= 2000000)",message="maxConnections must be 0, -1, or between 2000 and 2000000" + // +optional + MaxConnections int32 `json:"maxConnections,omitempty"` + + // reloadInterval defines the minimum interval at which the router is allowed to reload + // to accept new changes. Increasing this value can prevent the accumulation of + // HAProxy processes, depending on the scenario. Increasing this interval can + // also lessen load imbalance on a backend's servers when using the roundrobin + // balancing algorithm. Alternatively, decreasing this value may decrease latency + // since updates to HAProxy's configuration can take effect more quickly. + // + // The value must be a time duration value; see . + // Currently, the minimum value allowed is 1s, and the maximum allowed value is + // 120s. Minimum and maximum allowed values may change in future versions of OpenShift. + // Note that if a duration outside of these bounds is provided, the value of reloadInterval + // will be capped/floored and not rejected (e.g. a duration of over 120s will be capped to + // 120s; the IngressController will not reject and replace this disallowed value with + // the default). + // + // A zero value for reloadInterval tells the IngressController to choose the default, + // which is currently 5s and subject to change without notice. + // + // This field expects an unsigned duration string of decimal numbers, each with optional + // fraction and a unit suffix, e.g. "300ms", "1.5h" or "2h45m". + // Valid time units are "ns", "us" (or "µs" U+00B5 or "μs" U+03BC), "ms", "s", "m", "h". + // + // Note: Setting a value significantly larger than the default of 5s can cause latency + // in observing updates to routes and their endpoints. HAProxy's configuration will + // be reloaded less frequently, and newly created routes will not be served until the + // subsequent reload. + // + // +kubebuilder:validation:Pattern=^(0|([0-9]+(\.[0-9]+)?(ns|us|µs|μs|ms|s|m|h))+)$ + // +kubebuilder:validation:Type:=string + // +optional + ReloadInterval metav1.Duration `json:"reloadInterval,omitempty"` + + // configurationManagement specifies how OpenShift router should update + // the HAProxy configuration. The following values are valid for this + // field: + // + // * "ForkAndReload". + // * "Dynamic". + // + // Omitting this field means that the user has no opinion and the + // platform may choose a reasonable default. This default is subject to + // change over time. The current default is "ForkAndReload". + // + // "ForkAndReload" means that OpenShift router should rewrite the + // HAProxy configuration file and instruct HAProxy to fork and reload. + // This is OpenShift router's traditional approach. + // + // "Dynamic" means that OpenShift router may use HAProxy's control + // socket for some configuration updates and fall back to fork and + // reload for other configuration updates. This is a newer approach, + // which may be less mature than ForkAndReload. This setting can + // improve load-balancing fairness and metrics accuracy and reduce CPU + // and memory usage if HAProxy has frequent configuration updates for + // route and endpoints updates. + // + // Note: The "Dynamic" option is currently experimental and should not + // be enabled on production clusters. + // + // +openshift:enable:FeatureGate=IngressControllerDynamicConfigurationManager + // +optional + ConfigurationManagement IngressControllerConfigurationManagement `json:"configurationManagement,omitempty"` +} + +// IngressControllerConfigurationManagement specifies whether always to use +// fork-and-reload to update the HAProxy configuration or whether to use +// HAProxy's control socket for some configuration updates. +// +// +enum +// +kubebuilder:validation:Enum=Dynamic;ForkAndReload +type IngressControllerConfigurationManagement string + +const ( + IngressControllerConfigurationManagementDynamic IngressControllerConfigurationManagement = "Dynamic" + IngressControllerConfigurationManagementForkAndReload IngressControllerConfigurationManagement = "ForkAndReload" +) + +// HTTPEmptyRequestsPolicy indicates how HTTP connections for which no request +// is received should be handled. +// +kubebuilder:validation:Enum=Respond;Ignore +type HTTPEmptyRequestsPolicy string + +const ( + // HTTPEmptyRequestsPolicyRespond indicates that the ingress controller + // should respond to empty requests. + HTTPEmptyRequestsPolicyRespond HTTPEmptyRequestsPolicy = "Respond" + // HTTPEmptyRequestsPolicyIgnore indicates that the ingress controller + // should ignore empty requests. + HTTPEmptyRequestsPolicyIgnore HTTPEmptyRequestsPolicy = "Ignore" +) + +var ( + // Available indicates the ingress controller deployment is available. + IngressControllerAvailableConditionType = "Available" + // LoadBalancerManaged indicates the management status of any load balancer + // service associated with an ingress controller. + LoadBalancerManagedIngressConditionType = "LoadBalancerManaged" + // LoadBalancerReady indicates the ready state of any load balancer service + // associated with an ingress controller. + LoadBalancerReadyIngressConditionType = "LoadBalancerReady" + // DNSManaged indicates the management status of any DNS records for the + // ingress controller. + DNSManagedIngressConditionType = "DNSManaged" + // DNSReady indicates the ready state of any DNS records for the ingress + // controller. + DNSReadyIngressConditionType = "DNSReady" +) + +// IngressControllerStatus defines the observed status of the IngressController. +type IngressControllerStatus struct { + // availableReplicas is number of observed available replicas according to the + // ingress controller deployment. + // +optional + AvailableReplicas int32 `json:"availableReplicas"` + + // selector is a label selector, in string format, for ingress controller pods + // corresponding to the IngressController. The number of matching pods should + // equal the value of availableReplicas. + // +optional + Selector string `json:"selector"` + + // domain is the actual domain in use. + // +optional + Domain string `json:"domain"` + + // endpointPublishingStrategy is the actual strategy in use. + // +optional + EndpointPublishingStrategy *EndpointPublishingStrategy `json:"endpointPublishingStrategy,omitempty"` + + // conditions is a list of conditions and their status. + // + // Available means the ingress controller deployment is available and + // servicing route and ingress resources (i.e, .status.availableReplicas + // equals .spec.replicas) + // + // There are additional conditions which indicate the status of other + // ingress controller features and capabilities. + // + // * LoadBalancerManaged + // - True if the following conditions are met: + // * The endpoint publishing strategy requires a service load balancer. + // - False if any of those conditions are unsatisfied. + // + // * LoadBalancerReady + // - True if the following conditions are met: + // * A load balancer is managed. + // * The load balancer is ready. + // - False if any of those conditions are unsatisfied. + // + // * DNSManaged + // - True if the following conditions are met: + // * The endpoint publishing strategy and platform support DNS. + // * The ingress controller domain is set. + // * dns.config.openshift.io/cluster configures DNS zones. + // - False if any of those conditions are unsatisfied. + // + // * DNSReady + // - True if the following conditions are met: + // * DNS is managed. + // * DNS records have been successfully created. + // - False if any of those conditions are unsatisfied. + // +listType=map + // +listMapKey=type + // +optional + Conditions []OperatorCondition `json:"conditions,omitempty"` + + // tlsProfile is the TLS connection configuration that is in effect. + // +optional + TLSProfile *configv1.TLSProfileSpec `json:"tlsProfile,omitempty"` + + // observedGeneration is the most recent generation observed. + // +optional + ObservedGeneration int64 `json:"observedGeneration,omitempty"` + + // namespaceSelector is the actual namespaceSelector in use. + // +optional + NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty"` + + // routeSelector is the actual routeSelector in use. + // +optional + RouteSelector *metav1.LabelSelector `json:"routeSelector,omitempty"` + + // effectiveHAProxyVersion reports the HAProxy version currently in use by + // this IngressController. This reflects the resolved value of the + // spec.haproxyVersion field. When omitted, the effective value has not yet + // been resolved by the operator or the feature is not enabled for this cluster. + // + // Examples for OpenShift 5.0: + // - "3.2": Using HAProxy 3.2 + // - "2.8": Using HAProxy 2.8 + // + // +optional + // +openshift:enable:FeatureGate=IngressControllerMultipleHAProxyVersions + EffectiveHAProxyVersion HAProxyVersion `json:"effectiveHAProxyVersion,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// IngressControllerList contains a list of IngressControllers. +// +// Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). +// +openshift:compatibility-gen:level=1 +type IngressControllerList struct { + metav1.TypeMeta `json:",inline"` + + // metadata is the standard list's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + metav1.ListMeta `json:"metadata,omitempty"` + + Items []IngressController `json:"items"` +} + +// IngressControllerConnectionTerminationPolicy defines the behaviour +// for handling idle connections during a soft reload of the router. +// +// +kubebuilder:validation:Enum=Immediate;Deferred +type IngressControllerConnectionTerminationPolicy string + +const ( + // IngressControllerConnectionTerminationPolicyImmediate specifies + // that idle connections should be closed immediately during a + // router reload. + IngressControllerConnectionTerminationPolicyImmediate IngressControllerConnectionTerminationPolicy = "Immediate" + + // IngressControllerConnectionTerminationPolicyDeferred + // specifies that idle connections should remain open until a + // terminating event, such as a new request, the expiration of + // the proxy keep-alive timeout, or the client closing the + // connection. + IngressControllerConnectionTerminationPolicyDeferred IngressControllerConnectionTerminationPolicy = "Deferred" +) + +// IngressControllerClosedClientConnectionPolicy controls how the IngressController +// behaves when the client closes the TCP connection while the TLS +// handshake or HTTP request is in progress. +// +// +kubebuilder:validation:Enum=Abort;Continue +type IngressControllerClosedClientConnectionPolicy string + +const ( + // IngressControllerClosedClientConnectionPolicyAbort aborts processing early when the client + // closes the connection. + // + // This affects two types of processing: TLS handshake computation on the router + // and request handling. + // + // When the client closes the connection, the router will stop processing + // the TLS handshake, preventing unnecessary CPU work. + // + // If the HTTP request has not yet been sent to the backend, it will be aborted. + // If the request is already being processed by the backend, the router will + // half-close the connection to signal this condition to the backend server, + // which can then decide how to proceed. + IngressControllerClosedClientConnectionPolicyAbort IngressControllerClosedClientConnectionPolicy = "Abort" + + // IngressControllerClosedClientConnectionPolicyContinue continues processing even if the client + // closes the connection. + // + // The router will complete the TLS handshake and wait for the backend + // server's response regardless of the client having closed the connection. + IngressControllerClosedClientConnectionPolicyContinue IngressControllerClosedClientConnectionPolicy = "Continue" +) + +// HAProxyVersion is a string representing a HAProxy minor version in "X.Y" +// format. The allowed values are constrained by enum validation and vary by +// OpenShift release. +// +// +kubebuilder:validation:Enum="2.8";"3.2" +type HAProxyVersion string + +const ( + // HAProxyVersion28 represents HAProxy 2.8, shipped with OpenShift 4.22. + HAProxyVersion28 HAProxyVersion = "2.8" + + // HAProxyVersion32 represents HAProxy 3.2, introduced in OpenShift 5.0. + HAProxyVersion32 HAProxyVersion = "3.2" +) diff --git a/apis/vendor/github.com/openshift/api/operator/v1/types_kmsencryption.go b/apis/vendor/github.com/openshift/api/operator/v1/types_kmsencryption.go new file mode 100644 index 00000000000..51a981b7165 --- /dev/null +++ b/apis/vendor/github.com/openshift/api/operator/v1/types_kmsencryption.go @@ -0,0 +1,171 @@ +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +kubebuilder:validation:Enum=Healthy;Unhealthy;Error +type KMSPluginHealthStatus string + +const ( + KMSPluginHealthStatusHealthy KMSPluginHealthStatus = "Healthy" + + KMSPluginHealthStatusUnhealthy KMSPluginHealthStatus = "Unhealthy" + + KMSPluginHealthStatusError KMSPluginHealthStatus = "Error" +) + +type KMSPluginHealthReport struct { + + // nodeName is the name of the node this instance of the plugin runs on. + // The combination of nodeName and keyID makes this health report unique. + // The value must be a valid Kubernetes node name: a lowercase RFC 1123 subdomain + // consisting of lowercase alphanumeric characters, '-' or '.', starting and ending with + // an alphanumeric character, and be at most 253 characters in length. + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=253 + // +kubebuilder:validation:XValidation:rule="!format.dns1123Subdomain().validate(self).hasValue()",message="nodeName must be a lowercase RFC 1123 subdomain consisting of lowercase alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character" + // +required + NodeName string `json:"nodeName,omitempty"` + + // keyID is the encryption-key-secret id (kms-{keyID}.sock), a unique identifier of the plugin on that node. + // This is not a cryptographic key used to encrypt/decrypt any resources. + // The value must be between 1 and 512 characters. + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=512 + // +required + KeyID string `json:"keyID,omitempty"` + + // --- TOMBSTONE --- + // keyId is the encryption-key-secret id (kms-{keyId}.sock), a unique identifier of the plugin on that node. + // This is not a cryptographic key used to encrypt/decrypt any resources. + // The value must be between 1 and 512 characters. + // It has been renamed to keyID. + // The field name is reserved to prevent reuse. + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=512 + // +required + // KeyId string `json:"keyId,omitempty"` + + // status contains a health indicator for the respective KMS plugin + // The field can have three states: healthy, unhealthy, error. + // With error and unhealthy containing additional information in Detail. + // +required + Status KMSPluginHealthStatus `json:"status,omitempty"` + + // lastCheckedTime is a timestamp of when the probe was last checked. + // +required + LastCheckedTime metav1.Time `json:"lastCheckedTime,omitempty"` + + // remoteKeyID refers to the remote key identifier from KMS v2 StatusResponse.key_id. + // This is not a cryptographic key, but a unique representation of the KEK. + // The value must be between 1 and 1024 characters. + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=1024 + // +required + RemoteKeyID string `json:"remoteKeyID,omitempty"` + + // --- TOMBSTONE --- + // kekId refers to the remote KEK id from KMS v2 StatusResponse.key_id. + // This is not a cryptographic key, but a unique representation of the KEK. + // The value must be between 1 and 1024 characters. + // It has been renamed to remoteKeyID. + // The field name is reserved to prevent reuse. + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=1024 + // +required + // KEKId string `json:"kekId,omitempty"` + + // detail contains additional error/health information for the respective KMS plugin. + // When omitted, no additional error or health information is provided. + // When set, the value must be between 1 and 1024 characters. + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=1024 + // +optional + Detail string `json:"detail,omitempty"` +} + +// +openshift:compatibility-gen:level=1 +// +kubebuilder:validation:MinProperties=1 +type KMSEncryptionStatus struct { + // healthReports contains all KMS plugin health reports. + // When omitted, no health reports are available. + // Each entry must have a unique combination of nodeName and keyID. + // +optional + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=200 + // +listType=map + // +listMapKey=nodeName + // +listMapKey=keyID + HealthReports []KMSPluginHealthReport `json:"healthReports,omitempty"` + + // preflight contains the state of KMS preflight validation for this operator. + // The preflight validates the KMS provider configuration before it is used + // to create a new encryption key, catching configuration issues early such + // as incorrect login credentials or an unreachable Vault service. + // When omitted, no preflight validation is in progress. + // +optional + Preflight KMSPreflightCheck `json:"preflight,omitzero"` +} + +// KMSPreflightCheck describes a preflight validation request and its result. +// +// +kubebuilder:validation:MinProperties=1 +type KMSPreflightCheck struct { + // observedConfigHash is a hash of the KMS provider configuration and + // its referenced resources that has been observed and requires preflight + // validation before a new encryption key can be created. + // The value must be exactly 8 characters. + // +kubebuilder:validation:MinLength=8 + // +kubebuilder:validation:MaxLength=8 + // +kubebuilder:validation:XValidation:rule="self.matches('^[A-Za-z0-9_-]*={0,2}$')",message="must be a valid base64url encoded value" + // +required + ObservedConfigHash string `json:"observedConfigHash,omitempty"` + + // result contains the outcome of the most recent preflight check. + // Preflight is considered passed when result.status is Succeeded and + // result.configHash matches observedConfigHash. + // When omitted, no preflight check result has been reported yet. + // +optional + Result KMSPreflightResult `json:"result,omitzero"` +} + +// +kubebuilder:validation:Enum=Succeeded;Failed +type KMSPreflightResultStatus string + +const ( + KMSPreflightResultSucceeded KMSPreflightResultStatus = "Succeeded" + + KMSPreflightResultFailed KMSPreflightResultStatus = "Failed" +) + +// KMSPreflightResult contains the outcome of a preflight validation. +// +// +openshift:compatibility-gen:level=1 +type KMSPreflightResult struct { + // status indicates the outcome of the preflight check. + // Succeeded means the KMS plugin responded to Status, Encrypt, and + // Decrypt calls successfully. + // Failed means the validation did not pass. + // +required + Status KMSPreflightResultStatus `json:"status,omitempty"` + + // configHash is the hash of the configuration that was validated. + // This is compared against observedConfigHash to confirm the result + // corresponds to the current configuration. + // The value must be exactly 8 characters. + // +kubebuilder:validation:MinLength=8 + // +kubebuilder:validation:MaxLength=8 + // +kubebuilder:validation:XValidation:rule="self.matches('^[A-Za-z0-9_-]*={0,2}$')",message="must be a valid base64url encoded value" + // +required + ConfigHash string `json:"configHash,omitempty"` + + // remoteKeyID is the remote key encryption key identifier from KMS v2 + // StatusResponse.key_id. This is not a cryptographic key, but a unique + // representation of the remote key used to encrypt data. + // The value must be between 1 and 1024 characters. + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=1024 + // +required + RemoteKeyID string `json:"remoteKeyID,omitempty"` +} diff --git a/apis/vendor/github.com/openshift/api/operator/v1/types_kubeapiserver.go b/apis/vendor/github.com/openshift/api/operator/v1/types_kubeapiserver.go index 1461f11a12a..31b0c201b40 100644 --- a/apis/vendor/github.com/openshift/api/operator/v1/types_kubeapiserver.go +++ b/apis/vendor/github.com/openshift/api/operator/v1/types_kubeapiserver.go @@ -63,6 +63,11 @@ type KubeAPIServerStatus struct { // +optional // +listType=atomic ServiceAccountIssuers []ServiceAccountIssuerStatus `json:"serviceAccountIssuers,omitempty"` + + // encryptionStatus contains status reports for the KMS plugin health and its key rotation. + // +optional + // +openshift:enable:FeatureGate=KMSEncryption + EncryptionStatus KMSEncryptionStatus `json:"encryptionStatus,omitempty,omitzero"` } type ServiceAccountIssuerStatus struct { diff --git a/apis/vendor/github.com/openshift/api/operator/v1/types_openshiftapiserver.go b/apis/vendor/github.com/openshift/api/operator/v1/types_openshiftapiserver.go index a96e033cb7b..c9d104ad2c1 100644 --- a/apis/vendor/github.com/openshift/api/operator/v1/types_openshiftapiserver.go +++ b/apis/vendor/github.com/openshift/api/operator/v1/types_openshiftapiserver.go @@ -39,6 +39,11 @@ type OpenShiftAPIServerSpec struct { type OpenShiftAPIServerStatus struct { OperatorStatus `json:",inline"` + + // encryptionStatus contains status reports for the KMS plugin health and its key rotation. + // +optional + // +openshift:enable:FeatureGate=KMSEncryption + EncryptionStatus KMSEncryptionStatus `json:"encryptionStatus,omitempty,omitzero"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/apis/vendor/github.com/openshift/api/operator/v1/zz_generated.deepcopy.go b/apis/vendor/github.com/openshift/api/operator/v1/zz_generated.deepcopy.go index 3d3c8f4f825..8f7441b6c7c 100644 --- a/apis/vendor/github.com/openshift/api/operator/v1/zz_generated.deepcopy.go +++ b/apis/vendor/github.com/openshift/api/operator/v1/zz_generated.deepcopy.go @@ -285,6 +285,22 @@ func (in *Authentication) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AuthenticationConfigMapReference) DeepCopyInto(out *AuthenticationConfigMapReference) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthenticationConfigMapReference. +func (in *AuthenticationConfigMapReference) DeepCopy() *AuthenticationConfigMapReference { + if in == nil { + return nil + } + out := new(AuthenticationConfigMapReference) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AuthenticationList) DeepCopyInto(out *AuthenticationList) { *out = *in @@ -318,10 +334,33 @@ func (in *AuthenticationList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AuthenticationProxyConfig) DeepCopyInto(out *AuthenticationProxyConfig) { + *out = *in + if in.NoProxy != nil { + in, out := &in.NoProxy, &out.NoProxy + *out = make([]string, len(*in)) + copy(*out, *in) + } + out.TrustedCA = in.TrustedCA + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthenticationProxyConfig. +func (in *AuthenticationProxyConfig) DeepCopy() *AuthenticationProxyConfig { + if in == nil { + return nil + } + out := new(AuthenticationProxyConfig) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AuthenticationSpec) DeepCopyInto(out *AuthenticationSpec) { *out = *in in.OperatorSpec.DeepCopyInto(&out.OperatorSpec) + in.Proxy.DeepCopyInto(&out.Proxy) return } @@ -338,7 +377,7 @@ func (in *AuthenticationSpec) DeepCopy() *AuthenticationSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AuthenticationStatus) DeepCopyInto(out *AuthenticationStatus) { *out = *in - out.OAuthAPIServer = in.OAuthAPIServer + in.OAuthAPIServer.DeepCopyInto(&out.OAuthAPIServer) in.OperatorStatus.DeepCopyInto(&out.OperatorStatus) return } @@ -469,6 +508,7 @@ func (in *CSIDriverConfigSpec) DeepCopyInto(out *CSIDriverConfigSpec) { *out = new(VSphereCSIDriverConfigSpec) (*in).DeepCopyInto(*out) } + in.SecretsStore.DeepCopyInto(&out.SecretsStore) return } @@ -1180,6 +1220,22 @@ func (in *ContainerLoggingDestinationParameters) DeepCopy() *ContainerLoggingDes return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CustomSecretRotation) DeepCopyInto(out *CustomSecretRotation) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomSecretRotation. +func (in *CustomSecretRotation) DeepCopy() *CustomSecretRotation { + if in == nil { + return nil + } + out := new(CustomSecretRotation) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DNS) DeepCopyInto(out *DNS) { *out = *in @@ -2749,6 +2805,80 @@ func (in *IrreconcilableValidationOverrides) DeepCopy() *IrreconcilableValidatio return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KMSEncryptionStatus) DeepCopyInto(out *KMSEncryptionStatus) { + *out = *in + if in.HealthReports != nil { + in, out := &in.HealthReports, &out.HealthReports + *out = make([]KMSPluginHealthReport, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + out.Preflight = in.Preflight + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KMSEncryptionStatus. +func (in *KMSEncryptionStatus) DeepCopy() *KMSEncryptionStatus { + if in == nil { + return nil + } + out := new(KMSEncryptionStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KMSPluginHealthReport) DeepCopyInto(out *KMSPluginHealthReport) { + *out = *in + in.LastCheckedTime.DeepCopyInto(&out.LastCheckedTime) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KMSPluginHealthReport. +func (in *KMSPluginHealthReport) DeepCopy() *KMSPluginHealthReport { + if in == nil { + return nil + } + out := new(KMSPluginHealthReport) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KMSPreflightCheck) DeepCopyInto(out *KMSPreflightCheck) { + *out = *in + out.Result = in.Result + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KMSPreflightCheck. +func (in *KMSPreflightCheck) DeepCopy() *KMSPreflightCheck { + if in == nil { + return nil + } + out := new(KMSPreflightCheck) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KMSPreflightResult) DeepCopyInto(out *KMSPreflightResult) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KMSPreflightResult. +func (in *KMSPreflightResult) DeepCopy() *KMSPreflightResult { + if in == nil { + return nil + } + out := new(KMSPreflightResult) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *KubeAPIServer) DeepCopyInto(out *KubeAPIServer) { *out = *in @@ -2838,6 +2968,7 @@ func (in *KubeAPIServerStatus) DeepCopyInto(out *KubeAPIServerStatus) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + in.EncryptionStatus.DeepCopyInto(&out.EncryptionStatus) return } @@ -3432,6 +3563,33 @@ func (in *ManagedBootImages) DeepCopy() *ManagedBootImages { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManagedTokenRequests) DeepCopyInto(out *ManagedTokenRequests) { + *out = *in + if in.Audiences != nil { + in, out := &in.Audiences, &out.Audiences + *out = new([]SecretsStoreTokenRequest) + if **in != nil { + in, out := *in, *out + *out = make([]SecretsStoreTokenRequest, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedTokenRequests. +func (in *ManagedTokenRequests) DeepCopy() *ManagedTokenRequests { + if in == nil { + return nil + } + out := new(ManagedTokenRequests) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MyOperatorResource) DeepCopyInto(out *MyOperatorResource) { *out = *in @@ -4038,6 +4196,7 @@ func (in *NodeStatus) DeepCopy() *NodeStatus { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *OAuthAPIServerStatus) DeepCopyInto(out *OAuthAPIServerStatus) { *out = *in + in.EncryptionStatus.DeepCopyInto(&out.EncryptionStatus) return } @@ -4287,6 +4446,7 @@ func (in *OpenShiftAPIServerSpec) DeepCopy() *OpenShiftAPIServerSpec { func (in *OpenShiftAPIServerStatus) DeepCopyInto(out *OpenShiftAPIServerStatus) { *out = *in in.OperatorStatus.DeepCopyInto(&out.OperatorStatus) + in.EncryptionStatus.DeepCopyInto(&out.EncryptionStatus) return } @@ -4869,6 +5029,79 @@ func (in *SFlowConfig) DeepCopy() *SFlowConfig { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecretsStoreCSIDriverConfigSpec) DeepCopyInto(out *SecretsStoreCSIDriverConfigSpec) { + *out = *in + out.SecretRotation = in.SecretRotation + in.TokenRequests.DeepCopyInto(&out.TokenRequests) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretsStoreCSIDriverConfigSpec. +func (in *SecretsStoreCSIDriverConfigSpec) DeepCopy() *SecretsStoreCSIDriverConfigSpec { + if in == nil { + return nil + } + out := new(SecretsStoreCSIDriverConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecretsStoreSecretRotation) DeepCopyInto(out *SecretsStoreSecretRotation) { + *out = *in + out.Custom = in.Custom + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretsStoreSecretRotation. +func (in *SecretsStoreSecretRotation) DeepCopy() *SecretsStoreSecretRotation { + if in == nil { + return nil + } + out := new(SecretsStoreSecretRotation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecretsStoreTokenRequest) DeepCopyInto(out *SecretsStoreTokenRequest) { + *out = *in + if in.Audience != nil { + in, out := &in.Audience, &out.Audience + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretsStoreTokenRequest. +func (in *SecretsStoreTokenRequest) DeepCopy() *SecretsStoreTokenRequest { + if in == nil { + return nil + } + out := new(SecretsStoreTokenRequest) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecretsStoreTokenRequests) DeepCopyInto(out *SecretsStoreTokenRequests) { + *out = *in + in.Managed.DeepCopyInto(&out.Managed) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretsStoreTokenRequests. +func (in *SecretsStoreTokenRequests) DeepCopy() *SecretsStoreTokenRequests { + if in == nil { + return nil + } + out := new(SecretsStoreTokenRequests) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Server) DeepCopyInto(out *Server) { *out = *in diff --git a/apis/vendor/github.com/openshift/api/operator/v1/zz_generated.featuregated-crd-manifests.yaml b/apis/vendor/github.com/openshift/api/operator/v1/zz_generated.featuregated-crd-manifests.yaml index 53cf23ade1f..aab9e3564fe 100644 --- a/apis/vendor/github.com/openshift/api/operator/v1/zz_generated.featuregated-crd-manifests.yaml +++ b/apis/vendor/github.com/openshift/api/operator/v1/zz_generated.featuregated-crd-manifests.yaml @@ -5,7 +5,9 @@ authentications.operator.openshift.io: CRDName: authentications.operator.openshift.io Capability: "" Category: "" - FeatureGates: [] + FeatureGates: + - AuthenticationComponentProxy + - KMSEncryption FilenameOperatorName: authentication FilenameOperatorOrdering: "01" FilenameRunLevel: "0000_50" @@ -69,6 +71,7 @@ clustercsidrivers.operator.openshift.io: Capability: "" Category: "" FeatureGates: + - AWSEuropeanSovereignCloudInstall - VSphereConfigurableMaxAllowedBlockVolumesPerNode FilenameOperatorName: csi-driver FilenameOperatorOrdering: "01" @@ -175,7 +178,10 @@ ingresscontrollers.operator.openshift.io: CRDName: ingresscontrollers.operator.openshift.io Capability: Ingress Category: "" - FeatureGates: [] + FeatureGates: + - IngressControllerDynamicConfigurationManager + - IngressControllerMultipleHAProxyVersions + - TLSGroupPreferences FilenameOperatorName: ingress FilenameOperatorOrdering: "00" FilenameRunLevel: "0000_50" @@ -219,6 +225,7 @@ kubeapiservers.operator.openshift.io: Category: coreoperators FeatureGates: - EventTTL + - KMSEncryption FilenameOperatorName: kube-apiserver FilenameOperatorOrdering: "01" FilenameRunLevel: "0000_20" @@ -373,7 +380,8 @@ openshiftapiservers.operator.openshift.io: CRDName: openshiftapiservers.operator.openshift.io Capability: "" Category: coreoperators - FeatureGates: [] + FeatureGates: + - KMSEncryption FilenameOperatorName: openshift-apiserver FilenameOperatorOrdering: "01" FilenameRunLevel: "0000_30" diff --git a/apis/vendor/github.com/openshift/api/operator/v1/zz_generated.model_name.go b/apis/vendor/github.com/openshift/api/operator/v1/zz_generated.model_name.go new file mode 100644 index 00000000000..13ab0c5f6f2 --- /dev/null +++ b/apis/vendor/github.com/openshift/api/operator/v1/zz_generated.model_name.go @@ -0,0 +1,1246 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +// Code generated by codegen. DO NOT EDIT. + +package v1 + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AWSCSIDriverConfigSpec) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.AWSCSIDriverConfigSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AWSClassicLoadBalancerParameters) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.AWSClassicLoadBalancerParameters" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AWSEFSVolumeMetrics) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.AWSEFSVolumeMetrics" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AWSEFSVolumeMetricsRecursiveWalkConfig) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.AWSEFSVolumeMetricsRecursiveWalkConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AWSLoadBalancerParameters) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.AWSLoadBalancerParameters" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AWSNetworkLoadBalancerParameters) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.AWSNetworkLoadBalancerParameters" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AWSSubnets) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.AWSSubnets" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AccessLogging) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.AccessLogging" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AddPage) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.AddPage" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AdditionalNetworkDefinition) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.AdditionalNetworkDefinition" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AdditionalRoutingCapabilities) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.AdditionalRoutingCapabilities" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Authentication) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.Authentication" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AuthenticationConfigMapReference) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.AuthenticationConfigMapReference" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AuthenticationList) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.AuthenticationList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AuthenticationProxyConfig) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.AuthenticationProxyConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AuthenticationSpec) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.AuthenticationSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AuthenticationStatus) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.AuthenticationStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AzureCSIDriverConfigSpec) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.AzureCSIDriverConfigSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in AzureDiskEncryptionSet) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.AzureDiskEncryptionSet" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in BGPManagedConfig) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.BGPManagedConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in BootImageSkewEnforcementConfig) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.BootImageSkewEnforcementConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in BootImageSkewEnforcementStatus) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.BootImageSkewEnforcementStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CSIDriverConfigSpec) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.CSIDriverConfigSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CSISnapshotController) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.CSISnapshotController" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CSISnapshotControllerList) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.CSISnapshotControllerList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CSISnapshotControllerSpec) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.CSISnapshotControllerSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CSISnapshotControllerStatus) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.CSISnapshotControllerStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Capability) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.Capability" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CapabilityVisibility) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.CapabilityVisibility" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ClientTLS) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ClientTLS" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CloudCredential) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.CloudCredential" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CloudCredentialList) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.CloudCredentialList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CloudCredentialSpec) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.CloudCredentialSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CloudCredentialStatus) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.CloudCredentialStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ClusterBootImageAutomatic) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ClusterBootImageAutomatic" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ClusterBootImageManual) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ClusterBootImageManual" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ClusterCSIDriver) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ClusterCSIDriver" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ClusterCSIDriverList) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ClusterCSIDriverList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ClusterCSIDriverSpec) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ClusterCSIDriverSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ClusterCSIDriverStatus) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ClusterCSIDriverStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ClusterNetworkEntry) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ClusterNetworkEntry" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Config) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.Config" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ConfigList) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ConfigList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ConfigMapFileReference) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ConfigMapFileReference" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ConfigSpec) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ConfigSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ConfigStatus) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ConfigStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Console) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.Console" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ConsoleConfigRoute) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ConsoleConfigRoute" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ConsoleCustomization) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ConsoleCustomization" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ConsoleList) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ConsoleList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ConsoleProviders) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ConsoleProviders" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ConsoleSpec) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ConsoleSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ConsoleStatus) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ConsoleStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ContainerLoggingDestinationParameters) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ContainerLoggingDestinationParameters" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in CustomSecretRotation) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.CustomSecretRotation" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DNS) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.DNS" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DNSCache) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.DNSCache" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DNSList) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.DNSList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DNSNodePlacement) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.DNSNodePlacement" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DNSOverTLSConfig) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.DNSOverTLSConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DNSSpec) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.DNSSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DNSStatus) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.DNSStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DNSTransportConfig) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.DNSTransportConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DefaultNetworkDefinition) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.DefaultNetworkDefinition" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DeveloperConsoleCatalogCategory) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.DeveloperConsoleCatalogCategory" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DeveloperConsoleCatalogCategoryMeta) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.DeveloperConsoleCatalogCategoryMeta" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DeveloperConsoleCatalogCustomization) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.DeveloperConsoleCatalogCustomization" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in DeveloperConsoleCatalogTypes) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.DeveloperConsoleCatalogTypes" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in EgressIPConfig) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.EgressIPConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in EndpointPublishingStrategy) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.EndpointPublishingStrategy" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Etcd) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.Etcd" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in EtcdList) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.EtcdList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in EtcdSpec) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.EtcdSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in EtcdStatus) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.EtcdStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ExportNetworkFlows) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ExportNetworkFlows" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in FeaturesMigration) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.FeaturesMigration" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in FileReferenceSource) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.FileReferenceSource" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ForwardPlugin) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ForwardPlugin" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in GCPCSIDriverConfigSpec) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.GCPCSIDriverConfigSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in GCPKMSKeyReference) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.GCPKMSKeyReference" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in GCPLoadBalancerParameters) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.GCPLoadBalancerParameters" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in GatewayConfig) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.GatewayConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in GatherStatus) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.GatherStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in GathererStatus) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.GathererStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in GenerationStatus) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.GenerationStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in HTTPCompressionPolicy) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.HTTPCompressionPolicy" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in HealthCheck) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.HealthCheck" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in HostNetworkStrategy) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.HostNetworkStrategy" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in HybridOverlayConfig) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.HybridOverlayConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in IBMCloudCSIDriverConfigSpec) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.IBMCloudCSIDriverConfigSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in IBMLoadBalancerParameters) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.IBMLoadBalancerParameters" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in IPAMConfig) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.IPAMConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in IPFIXConfig) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.IPFIXConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in IPsecConfig) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.IPsecConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in IPsecFullModeConfig) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.IPsecFullModeConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in IPv4GatewayConfig) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.IPv4GatewayConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in IPv4OVNKubernetesConfig) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.IPv4OVNKubernetesConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in IPv6GatewayConfig) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.IPv6GatewayConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in IPv6OVNKubernetesConfig) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.IPv6OVNKubernetesConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Ingress) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.Ingress" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in IngressController) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.IngressController" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in IngressControllerCaptureHTTPCookie) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.IngressControllerCaptureHTTPCookie" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in IngressControllerCaptureHTTPCookieUnion) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.IngressControllerCaptureHTTPCookieUnion" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in IngressControllerCaptureHTTPHeader) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.IngressControllerCaptureHTTPHeader" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in IngressControllerCaptureHTTPHeaders) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.IngressControllerCaptureHTTPHeaders" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in IngressControllerHTTPHeader) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.IngressControllerHTTPHeader" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in IngressControllerHTTPHeaderActionUnion) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.IngressControllerHTTPHeaderActionUnion" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in IngressControllerHTTPHeaderActions) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.IngressControllerHTTPHeaderActions" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in IngressControllerHTTPHeaders) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.IngressControllerHTTPHeaders" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in IngressControllerHTTPUniqueIdHeaderPolicy) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.IngressControllerHTTPUniqueIdHeaderPolicy" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in IngressControllerList) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.IngressControllerList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in IngressControllerLogging) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.IngressControllerLogging" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in IngressControllerSetHTTPHeader) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.IngressControllerSetHTTPHeader" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in IngressControllerSpec) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.IngressControllerSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in IngressControllerStatus) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.IngressControllerStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in IngressControllerTuningOptions) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.IngressControllerTuningOptions" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in InsightsOperator) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.InsightsOperator" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in InsightsOperatorList) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.InsightsOperatorList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in InsightsOperatorSpec) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.InsightsOperatorSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in InsightsOperatorStatus) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.InsightsOperatorStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in InsightsReport) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.InsightsReport" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in IrreconcilableValidationOverrides) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.IrreconcilableValidationOverrides" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in KMSEncryptionStatus) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.KMSEncryptionStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in KMSPluginHealthReport) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.KMSPluginHealthReport" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in KMSPreflightCheck) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.KMSPreflightCheck" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in KMSPreflightResult) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.KMSPreflightResult" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in KubeAPIServer) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.KubeAPIServer" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in KubeAPIServerList) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.KubeAPIServerList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in KubeAPIServerSpec) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.KubeAPIServerSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in KubeAPIServerStatus) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.KubeAPIServerStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in KubeControllerManager) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.KubeControllerManager" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in KubeControllerManagerList) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.KubeControllerManagerList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in KubeControllerManagerSpec) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.KubeControllerManagerSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in KubeControllerManagerStatus) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.KubeControllerManagerStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in KubeScheduler) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.KubeScheduler" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in KubeSchedulerList) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.KubeSchedulerList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in KubeSchedulerSpec) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.KubeSchedulerSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in KubeSchedulerStatus) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.KubeSchedulerStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in KubeStorageVersionMigrator) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.KubeStorageVersionMigrator" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in KubeStorageVersionMigratorList) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.KubeStorageVersionMigratorList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in KubeStorageVersionMigratorSpec) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.KubeStorageVersionMigratorSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in KubeStorageVersionMigratorStatus) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.KubeStorageVersionMigratorStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in LoadBalancerStrategy) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.LoadBalancerStrategy" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in LoggingDestination) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.LoggingDestination" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Logo) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.Logo" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in MTUMigration) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.MTUMigration" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in MTUMigrationValues) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.MTUMigrationValues" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in MachineConfiguration) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.MachineConfiguration" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in MachineConfigurationList) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.MachineConfigurationList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in MachineConfigurationSpec) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.MachineConfigurationSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in MachineConfigurationStatus) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.MachineConfigurationStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in MachineManager) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.MachineManager" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in MachineManagerSelector) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.MachineManagerSelector" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ManagedBootImages) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ManagedBootImages" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ManagedTokenRequests) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ManagedTokenRequests" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in MyOperatorResource) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.MyOperatorResource" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in MyOperatorResourceSpec) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.MyOperatorResourceSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in MyOperatorResourceStatus) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.MyOperatorResourceStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NetFlowConfig) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.NetFlowConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Network) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.Network" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NetworkList) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.NetworkList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NetworkMigration) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.NetworkMigration" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NetworkSpec) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.NetworkSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NetworkStatus) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.NetworkStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NoOverlayConfig) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.NoOverlayConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NodeDisruptionPolicyClusterStatus) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.NodeDisruptionPolicyClusterStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NodeDisruptionPolicyConfig) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.NodeDisruptionPolicyConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NodeDisruptionPolicySpecAction) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.NodeDisruptionPolicySpecAction" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NodeDisruptionPolicySpecFile) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.NodeDisruptionPolicySpecFile" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NodeDisruptionPolicySpecSSHKey) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.NodeDisruptionPolicySpecSSHKey" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NodeDisruptionPolicySpecUnit) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.NodeDisruptionPolicySpecUnit" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NodeDisruptionPolicyStatus) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.NodeDisruptionPolicyStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NodeDisruptionPolicyStatusAction) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.NodeDisruptionPolicyStatusAction" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NodeDisruptionPolicyStatusFile) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.NodeDisruptionPolicyStatusFile" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NodeDisruptionPolicyStatusSSHKey) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.NodeDisruptionPolicyStatusSSHKey" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NodeDisruptionPolicyStatusUnit) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.NodeDisruptionPolicyStatusUnit" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NodePlacement) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.NodePlacement" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NodePortStrategy) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.NodePortStrategy" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NodeStatus) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.NodeStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OAuthAPIServerStatus) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.OAuthAPIServerStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OLM) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.OLM" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OLMList) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.OLMList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OLMSpec) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.OLMSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OLMStatus) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.OLMStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OVNKubernetesConfig) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.OVNKubernetesConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OpenShiftAPIServer) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.OpenShiftAPIServer" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OpenShiftAPIServerList) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.OpenShiftAPIServerList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OpenShiftAPIServerSpec) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.OpenShiftAPIServerSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OpenShiftAPIServerStatus) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.OpenShiftAPIServerStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OpenShiftControllerManager) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.OpenShiftControllerManager" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OpenShiftControllerManagerList) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.OpenShiftControllerManagerList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OpenShiftControllerManagerSpec) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.OpenShiftControllerManagerSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OpenShiftControllerManagerStatus) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.OpenShiftControllerManagerStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OpenShiftSDNConfig) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.OpenShiftSDNConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OpenStackLoadBalancerParameters) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.OpenStackLoadBalancerParameters" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OperatorCondition) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.OperatorCondition" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OperatorSpec) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.OperatorSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in OperatorStatus) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.OperatorStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PartialSelector) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.PartialSelector" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Perspective) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.Perspective" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PerspectiveVisibility) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.PerspectiveVisibility" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PinnedResourceReference) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.PinnedResourceReference" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PolicyAuditConfig) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.PolicyAuditConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PrivateStrategy) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.PrivateStrategy" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ProjectAccess) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ProjectAccess" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ProviderLoadBalancerParameters) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ProviderLoadBalancerParameters" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ProxyConfig) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ProxyConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in QuickStarts) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.QuickStarts" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ReloadService) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ReloadService" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ResourceAttributesAccessReview) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ResourceAttributesAccessReview" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in RestartService) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.RestartService" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in RouteAdmissionPolicy) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.RouteAdmissionPolicy" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in SFlowConfig) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.SFlowConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in SecretsStoreCSIDriverConfigSpec) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.SecretsStoreCSIDriverConfigSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in SecretsStoreSecretRotation) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.SecretsStoreSecretRotation" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in SecretsStoreTokenRequest) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.SecretsStoreTokenRequest" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in SecretsStoreTokenRequests) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.SecretsStoreTokenRequests" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Server) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.Server" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ServiceAccountIssuerStatus) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ServiceAccountIssuerStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ServiceCA) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ServiceCA" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ServiceCAList) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ServiceCAList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ServiceCASpec) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ServiceCASpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ServiceCAStatus) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ServiceCAStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ServiceCatalogAPIServer) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ServiceCatalogAPIServer" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ServiceCatalogAPIServerList) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ServiceCatalogAPIServerList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ServiceCatalogAPIServerSpec) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ServiceCatalogAPIServerSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ServiceCatalogAPIServerStatus) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ServiceCatalogAPIServerStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ServiceCatalogControllerManager) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ServiceCatalogControllerManager" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ServiceCatalogControllerManagerList) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ServiceCatalogControllerManagerList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ServiceCatalogControllerManagerSpec) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ServiceCatalogControllerManagerSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ServiceCatalogControllerManagerStatus) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.ServiceCatalogControllerManagerStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in SimpleMacvlanConfig) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.SimpleMacvlanConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in StaticIPAMAddresses) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.StaticIPAMAddresses" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in StaticIPAMConfig) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.StaticIPAMConfig" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in StaticIPAMDNS) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.StaticIPAMDNS" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in StaticIPAMRoutes) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.StaticIPAMRoutes" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in StaticPodOperatorSpec) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.StaticPodOperatorSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in StaticPodOperatorStatus) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.StaticPodOperatorStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in StatuspageProvider) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.StatuspageProvider" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Storage) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.Storage" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in StorageList) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.StorageList" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in StorageSpec) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.StorageSpec" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in StorageStatus) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.StorageStatus" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in SyslogLoggingDestinationParameters) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.SyslogLoggingDestinationParameters" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Theme) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.Theme" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in Upstream) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.Upstream" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in UpstreamResolvers) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.UpstreamResolvers" +} + +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in VSphereCSIDriverConfigSpec) OpenAPIModelName() string { + return "com.github.openshift.api.operator.v1.VSphereCSIDriverConfigSpec" +} diff --git a/apis/vendor/github.com/openshift/api/operator/v1/zz_generated.swagger_doc_generated.go b/apis/vendor/github.com/openshift/api/operator/v1/zz_generated.swagger_doc_generated.go index e35d997a763..27e09161681 100644 --- a/apis/vendor/github.com/openshift/api/operator/v1/zz_generated.swagger_doc_generated.go +++ b/apis/vendor/github.com/openshift/api/operator/v1/zz_generated.swagger_doc_generated.go @@ -37,6 +37,7 @@ func (MyOperatorResource) SwaggerDoc() map[string]string { var map_NodeStatus = map[string]string{ "": "NodeStatus provides information about the current state of a particular node managed by this operator.", "nodeName": "nodeName is the name of the node", + "nodeUID": "nodeUID is the UID of the node. This field is used to detect that a node has been deleted and recreated with the same name. When the UID changes, it indicates the node is a new instance and the controller should treat this status entry as stale. When omitted, UID-based node replacement detection is not available for this entry.", "currentRevision": "currentRevision is the generation of the most recently successful deployment. Can not be set on creation of a nodeStatus. Updates must only increase the value.", "targetRevision": "targetRevision is the generation of the deployment we're trying to apply. Can not be set on creation of a nodeStatus.", "lastFailedRevision": "lastFailedRevision is the generation of the deployment we tried and failed to deploy.", @@ -118,6 +119,15 @@ func (Authentication) SwaggerDoc() map[string]string { return map_Authentication } +var map_AuthenticationConfigMapReference = map[string]string{ + "": "AuthenticationConfigMapReference references a ConfigMap in the openshift-config namespace.", + "name": "name is the metadata.name of the referenced ConfigMap. Must be a valid DNS subdomain name (RFC 1123): at most 253 characters, only lowercase alphanumeric characters, '-' or '.', starting and ending with an alphanumeric character.", +} + +func (AuthenticationConfigMapReference) SwaggerDoc() map[string]string { + return map_AuthenticationConfigMapReference +} + var map_AuthenticationList = map[string]string{ "": "AuthenticationList is a collection of items\n\nCompatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).", "metadata": "metadata is the standard list's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", @@ -127,6 +137,26 @@ func (AuthenticationList) SwaggerDoc() map[string]string { return map_AuthenticationList } +var map_AuthenticationProxyConfig = map[string]string{ + "": "AuthenticationProxyConfig holds proxy configuration scoped to authentication components (the OAuth server and the cluster authentication operator).", + "httpProxy": "httpProxy is the URL of the proxy for HTTP requests. Must be a valid URL with http or https scheme, a non-empty hostname, and no path, query parameters, or fragment. Userinfo (e.g. user:password@host) is allowed for proxy authentication. Maximum length is 2048 characters.", + "httpsProxy": "httpsProxy is the URL of the proxy for HTTPS requests. Must be a valid URL with http or https scheme, a non-empty hostname, and no path, query parameters, or fragment. Userinfo (e.g. user:password@host) is allowed for proxy authentication. Maximum length is 2048 characters.", + "noProxy": "noProxy is a list of hostnames and/or CIDRs and/or IPs for which the proxy should not be used. Must contain at least one entry when set. Each entry must be between 1 and 253 characters long and at most 64 entries are allowed. Duplicate entries are not permitted. Entries that are not valid hostnames, CIDRs, or IPs are silently ignored. Cluster-internal defaults (.cluster.local, .svc, 127.0.0.1, localhost) are always appended automatically and do not need to be included.", + "trustedCA": "trustedCA is a reference to a ConfigMap in the openshift-config namespace containing a CA certificate bundle under the key \"ca-bundle.crt\". This bundle is appended to the system trust store used by authentication components for proxy TLS connections. When omitted, only the system trust store is used.", +} + +func (AuthenticationProxyConfig) SwaggerDoc() map[string]string { + return map_AuthenticationProxyConfig +} + +var map_AuthenticationSpec = map[string]string{ + "proxy": "proxy configures proxy settings for outbound connections made by the authentication stack. When set, it replaces the cluster-wide proxy (proxy.config.openshift.io/cluster) entirely for authentication — individual fields are not inherited from the cluster-wide configuration. When omitted, the cluster-wide proxy is used if configured; otherwise no proxy is used.", +} + +func (AuthenticationSpec) SwaggerDoc() map[string]string { + return map_AuthenticationSpec +} + var map_AuthenticationStatus = map[string]string{ "oauthAPIServer": "oauthAPIServer holds status specific only to oauth-apiserver", } @@ -137,6 +167,7 @@ func (AuthenticationStatus) SwaggerDoc() map[string]string { var map_OAuthAPIServerStatus = map[string]string{ "latestAvailableRevision": "latestAvailableRevision is the latest revision used as suffix of revisioned secrets like encryption-config. A new revision causes a new deployment of pods.", + "encryptionStatus": "encryptionStatus contains status reports for the KMS plugin health and its key rotation.", } func (OAuthAPIServerStatus) SwaggerDoc() map[string]string { @@ -466,7 +497,7 @@ func (Theme) SwaggerDoc() map[string]string { var map_AWSCSIDriverConfigSpec = map[string]string{ "": "AWSCSIDriverConfigSpec defines properties that can be configured for the AWS CSI driver.", - "kmsKeyARN": "kmsKeyARN sets the cluster default storage class to encrypt volumes with a user-defined KMS key, rather than the default KMS key used by AWS. The value may be either the ARN or Alias ARN of a KMS key.", + "kmsKeyARN": "kmsKeyARN sets the cluster default storage class to encrypt volumes with a user-defined KMS key, rather than the default KMS key used by AWS. The value may be either the ARN or Alias ARN of a KMS key.\n\nThe ARN must follow the format: arn::kms:::(key|alias)/, where: is the AWS partition (aws, aws-cn, aws-us-gov, aws-iso, aws-iso-b, aws-iso-e, aws-iso-f, or aws-eusc), is the AWS region, is a 12-digit numeric identifier for the AWS account, is the KMS key ID or alias name.", "efsVolumeMetrics": "efsVolumeMetrics sets the configuration for collecting metrics from EFS volumes used by the EFS CSI Driver.", } @@ -515,13 +546,14 @@ func (AzureDiskEncryptionSet) SwaggerDoc() map[string]string { } var map_CSIDriverConfigSpec = map[string]string{ - "": "CSIDriverConfigSpec defines configuration spec that can be used to optionally configure a specific CSI Driver.", - "driverType": "driverType indicates type of CSI driver for which the driverConfig is being applied to. Valid values are: AWS, Azure, GCP, IBMCloud, vSphere and omitted. Consumers should treat unknown values as a NO-OP.", - "aws": "aws is used to configure the AWS CSI driver.", - "azure": "azure is used to configure the Azure CSI driver.", - "gcp": "gcp is used to configure the GCP CSI driver.", - "ibmcloud": "ibmcloud is used to configure the IBM Cloud CSI driver.", - "vSphere": "vSphere is used to configure the vsphere CSI driver.", + "": "CSIDriverConfigSpec defines configuration spec that can be used to optionally configure a specific CSI Driver.", + "driverType": "driverType indicates type of CSI driver for which the driverConfig is being applied to. Valid values are: AWS, Azure, GCP, IBMCloud, vSphere, SecretsStore and omitted. Consumers should treat unknown values as a NO-OP.", + "aws": "aws is used to configure the AWS CSI driver.", + "azure": "azure is used to configure the Azure CSI driver.", + "gcp": "gcp is used to configure the GCP CSI driver.", + "ibmcloud": "ibmcloud is used to configure the IBM Cloud CSI driver.", + "vSphere": "vSphere is used to configure the vsphere CSI driver.", + "secretsStore": "secretsStore is used to configure the Secrets Store CSI driver.", } func (CSIDriverConfigSpec) SwaggerDoc() map[string]string { @@ -566,6 +598,15 @@ func (ClusterCSIDriverStatus) SwaggerDoc() map[string]string { return map_ClusterCSIDriverStatus } +var map_CustomSecretRotation = map[string]string{ + "": "CustomSecretRotation holds configuration for custom secret rotation behavior.", + "minimumRefreshAge": "minimumRefreshAge is the minimum time in seconds between secret rotation attempts. Each time kubelet calls NodePublishVolume, the driver checks whether this interval has elapsed since the last successful provider call. If it has, the driver contacts the secret provider to fetch the latest secret values and updates the mounted volume. Setting this value below the kubelet syncFrequency (default: 1 minute) has no additional effect on the actual rotation cadence. Must be at least 1 second and no more than 31560000 seconds (~1 year). When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time.", +} + +func (CustomSecretRotation) SwaggerDoc() map[string]string { + return map_CustomSecretRotation +} + var map_GCPCSIDriverConfigSpec = map[string]string{ "": "GCPCSIDriverConfigSpec defines properties that can be configured for the GCP CSI driver.", "kmsKey": "kmsKey sets the cluster default storage class to encrypt volumes with customer-supplied encryption keys, rather than the default keys managed by GCP.", @@ -596,6 +637,55 @@ func (IBMCloudCSIDriverConfigSpec) SwaggerDoc() map[string]string { return map_IBMCloudCSIDriverConfigSpec } +var map_ManagedTokenRequests = map[string]string{ + "": "ManagedTokenRequests holds the configuration for operator-managed service account token requests.", + "audiences": "audiences specifies service account token audiences that kubelet will provide to the CSI driver during NodePublishVolume calls. These tokens enable workload identity federation (WIF) with cloud providers such as AWS, Azure, and GCP. When empty, the operator clears all tokenRequests from the CSIDriver object.", +} + +func (ManagedTokenRequests) SwaggerDoc() map[string]string { + return map_ManagedTokenRequests +} + +var map_SecretsStoreCSIDriverConfigSpec = map[string]string{ + "": "SecretsStoreCSIDriverConfigSpec defines properties that can be configured for the Secrets Store CSI driver.", + "secretRotation": "secretRotation controls automatic secret rotation behavior. When omitted, secret rotation is enabled with a default poll interval of 2 minutes.", + "tokenRequests": "tokenRequests controls service account token configuration for workload identity federation (WIF) with cloud providers. When omitted, the operator preserves any existing tokenRequests already configured on the CSIDriver object without modification.", +} + +func (SecretsStoreCSIDriverConfigSpec) SwaggerDoc() map[string]string { + return map_SecretsStoreCSIDriverConfigSpec +} + +var map_SecretsStoreSecretRotation = map[string]string{ + "": "SecretsStoreSecretRotation configures the automatic secret rotation behavior for the Secrets Store CSI driver.", + "type": "type determines the secret rotation behavior. When \"None\", secret rotation is disabled and secrets are only fetched at initial pod mount time. When \"Custom\", secret rotation is enabled with the configuration specified in the custom field.", + "custom": "custom holds the custom rotation configuration. Only valid when type is \"Custom\".", +} + +func (SecretsStoreSecretRotation) SwaggerDoc() map[string]string { + return map_SecretsStoreSecretRotation +} + +var map_SecretsStoreTokenRequest = map[string]string{ + "": "SecretsStoreTokenRequest specifies a service account token audience configuration for workload identity federation (WIF) with the Secrets Store CSI driver.", + "audience": "audience is the intended audience of the service account token. An empty string means the issued token will use the kube-apiserver's default APIAudiences.", + "expirationSeconds": "expirationSeconds is the requested duration of validity of the service account token. The token issuer may return a token with a different validity duration. When omitted, the token expiration is determined by the kube-apiserver. Must be at least 600 seconds (10 minutes) and no more than 315360000 seconds (~10 years).", +} + +func (SecretsStoreTokenRequest) SwaggerDoc() map[string]string { + return map_SecretsStoreTokenRequest +} + +var map_SecretsStoreTokenRequests = map[string]string{ + "": "SecretsStoreTokenRequests configures how service account tokens are provided to the Secrets Store CSI driver for workload identity federation.", + "type": "type determines how the operator manages tokenRequests on the CSIDriver object. When \"Unmanaged\", existing tokenRequests on the CSIDriver are preserved and the managed field is not used. When \"Managed\", the operator sets tokenRequests from the audiences specified in the managed field, replacing any previously configured values. Once set to \"Managed\", type cannot be reverted back to \"Unmanaged\".", + "managed": "managed holds configuration for operator-managed tokenRequests. Only valid when type is \"Managed\".", +} + +func (SecretsStoreTokenRequests) SwaggerDoc() map[string]string { + return map_SecretsStoreTokenRequests +} + var map_VSphereCSIDriverConfigSpec = map[string]string{ "": "VSphereCSIDriverConfigSpec defines properties that can be configured for vsphere CSI driver.", "topologyCategories": "topologyCategories indicates tag categories with which vcenter resources such as hostcluster or datacenter were tagged with. If cluster Infrastructure object has a topology, values specified in Infrastructure object will be used and modifications to topologyCategories will be rejected.", @@ -798,7 +888,7 @@ func (EtcdList) SwaggerDoc() map[string]string { var map_EtcdSpec = map[string]string{ "controlPlaneHardwareSpeed": "HardwareSpeed allows user to change the etcd tuning profile which configures the latency parameters for heartbeat interval and leader election timeouts allowing the cluster to tolerate longer round-trip-times between etcd members. Valid values are \"\", \"Standard\" and \"Slower\".\n\t\"\" means no opinion and the platform is left to choose a reasonable default\n\twhich is subject to change without notice.", - "backendQuotaGiB": "backendQuotaGiB sets the etcd backend storage size limit in gibibytes. The value should be an integer not less than 8 and not more than 32. When not specified, the default value is 8.", + "backendQuotaGiB": "backendQuotaGiB sets the etcd backend storage size limit in gibibytes. The value should be an integer not less than 8 and not more than 16. When not specified, the default value is 8.", } func (EtcdSpec) SwaggerDoc() map[string]string { @@ -830,6 +920,7 @@ var map_AWSNetworkLoadBalancerParameters = map[string]string{ "": "AWSNetworkLoadBalancerParameters holds configuration parameters for an AWS Network load balancer. For Example: Setting AWS EIPs https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html", "subnets": "subnets specifies the subnets to which the load balancer will attach. The subnets may be specified by either their ID or name. The total number of subnets is limited to 10.\n\nIn order for the load balancer to be provisioned with subnets, each subnet must exist, each subnet must be from a different availability zone, and the load balancer service must be recreated to pick up new values.\n\nWhen omitted from the spec, the subnets will be auto-discovered for each availability zone. Auto-discovered subnets are not reported in the status of the IngressController object.", "eipAllocations": "eipAllocations is a list of IDs for Elastic IP (EIP) addresses that are assigned to the Network Load Balancer. The following restrictions apply:\n\neipAllocations can only be used with external scope, not internal. An EIP can be allocated to only a single IngressController. The number of EIP allocations must match the number of subnets that are used for the load balancer. Each EIP allocation must be unique. A maximum of 10 EIP allocations are permitted.\n\nSee https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html for general information about configuration, characteristics, and limitations of Elastic IP addresses.", + "protocol": "protocol specifies whether the Network Load Balancer uses PROXY protocol to forward connections to the IngressController.\n\nWhen set to \"TCP\", the NLB uses AWS's native client IP preservation. This may cause hairpin connection failures for internal load balancers when connections are made from pods to router pods on the same node.\n\nWhen set to \"PROXY\", the NLB disables native client IP preservation and uses PROXY protocol v2. The IngressController enables PROXY protocol on HAProxy so that it can parse PROXY protocol headers to obtain the original client IP. This avoids hairpin connection failures.\n\nThe following values are valid for this field:\n\n* \"TCP\". * \"PROXY\".\n\nWhen omitted, this means the user has no opinion and the value is left to the platform to choose a reasonable default, which is subject to change over time. The current default is \"PROXY\".\n\nNote that changing this field may cause brief connection failures during the transition as the NLB attribute change and router rollout occur independently.", } func (AWSNetworkLoadBalancerParameters) SwaggerDoc() map[string]string { @@ -1082,6 +1173,7 @@ var map_IngressControllerSpec = map[string]string{ "httpCompression": "httpCompression defines a policy for HTTP traffic compression. By default, there is no HTTP compression.", "idleConnectionTerminationPolicy": "idleConnectionTerminationPolicy maps directly to HAProxy's idle-close-on-response option and controls whether HAProxy keeps idle frontend connections open during a soft stop (router reload).\n\nAllowed values for this field are \"Immediate\" and \"Deferred\". The default value is \"Immediate\".\n\nWhen set to \"Immediate\", idle connections are closed immediately during router reloads. This ensures immediate propagation of route changes but may impact clients sensitive to connection resets.\n\nWhen set to \"Deferred\", HAProxy will maintain idle connections during a soft reload instead of closing them immediately. These connections remain open until any of the following occurs:\n\n - A new request is received on the connection, in which\n case HAProxy handles it in the old process and closes\n the connection after sending the response.\n\n - HAProxy's `timeout http-keep-alive` duration expires.\n By default this is 300 seconds, but it can be changed\n using httpKeepAliveTimeout tuning option.\n\n - The client's keep-alive timeout expires, causing the\n client to close the connection.\n\nSetting Deferred can help prevent errors in clients or load balancers that do not properly handle connection resets. Additionally, this option allows you to retain the pre-2.4 HAProxy behaviour: in HAProxy version 2.2 (OpenShift versions < 4.14), maintaining idle connections during a soft reload was the default behaviour, but starting with HAProxy 2.4, the default changed to closing idle connections immediately.\n\nImportant Consideration:\n\n - Using Deferred will result in temporary inconsistencies\n for the first request on each persistent connection\n after a route update and router reload. This request\n will be processed by the old HAProxy process using its\n old configuration. Subsequent requests will use the\n updated configuration.\n\nOperational Considerations:\n\n - Keeping idle connections open during reloads may lead\n to an accumulation of old HAProxy processes if\n connections remain idle for extended periods,\n especially in environments where frequent reloads\n occur.\n\n - Consider monitoring the number of HAProxy processes in\n the router pods when Deferred is set.\n\n - You may need to enable or adjust the\n `ingress.operator.openshift.io/hard-stop-after`\n duration (configured via an annotation on the\n IngressController resource) in environments with\n frequent reloads to prevent resource exhaustion.", "closedClientConnectionPolicy": "closedClientConnectionPolicy controls how the IngressController behaves when the client closes the TCP connection while the TLS handshake or HTTP request is in progress. This option maps directly to HAProxy’s \"abortonclose\" option.\n\nValid values are: \"Abort\" and \"Continue\". The default value is \"Continue\".\n\nWhen set to \"Abort\", the router will stop processing the TLS handshake if it is in progress, and it will not send an HTTP request to the backend server if the request has not yet been sent when the client closes the connection.\n\nWhen set to \"Continue\", the router will complete the TLS handshake if it is in progress, or send an HTTP request to the backend server and wait for the backend server's response, regardless of whether the client has closed the connection.\n\nSetting \"Abort\" can help free CPU resources otherwise spent on TLS computation for connections the client has already closed, and can reduce request queue size, thereby reducing the load on saturated backend servers.\n\nImportant Considerations:\n\n - The default policy (\"Continue\") is HTTP-compliant, and requests\n for aborted client connections will still be served.\n Use the \"Continue\" policy to allow a client to send a request\n and then immediately close its side of the connection while\n still receiving a response on the half-closed connection.\n\n - When clients use keep-alive connections, the most common case for premature\n closure is when the user wants to cancel the transfer or when a timeout\n occurs. In that case, the \"Abort\" policy may be used to reduce resource consumption.\n\n - Using RSA keys larger than 2048 bits can significantly slow down\n TLS computations. Consider using the \"Abort\" policy to reduce CPU usage.", + "haproxyVersion": "haproxyVersion specifies the HAProxy version to use for this IngressController.\n\nOpenShift 5.0 introduces HAProxy 3.2 as its default version and supports HAProxy 2.8 from OpenShift 4.22 for migration purposes. When an OpenShift release introduces a new default HAProxy version, that HAProxy version becomes available as a pinnable value in subsequent OpenShift releases, providing a smooth migration path for administrators who want to defer HAProxy upgrades.\n\nValid values for OpenShift 5.0: - Unset (default): Uses HAProxy 3.2 (the default for OpenShift 5.0) - \"3.2\": Explicitly pins HAProxy 3.2 for preservation during cluster\n upgrades to future OpenShift releases\n- \"2.8\": Uses HAProxy 2.8 from OpenShift 4.22 (migration support, will\n be dropped in the next OpenShift release)\n\nIf a specific HAProxy version is set and would become unsupported in a target cluster upgrade, a preflight check will block the cluster upgrade until this field is updated to unset or a supported version.", } func (IngressControllerSpec) SwaggerDoc() map[string]string { @@ -1099,6 +1191,7 @@ var map_IngressControllerStatus = map[string]string{ "observedGeneration": "observedGeneration is the most recent generation observed.", "namespaceSelector": "namespaceSelector is the actual namespaceSelector in use.", "routeSelector": "routeSelector is the actual routeSelector in use.", + "effectiveHAProxyVersion": "effectiveHAProxyVersion reports the HAProxy version currently in use by this IngressController. This reflects the resolved value of the spec.haproxyVersion field. When omitted, the effective value has not yet been resolved by the operator or the feature is not enabled for this cluster.\n\nExamples for OpenShift 5.0: - \"3.2\": Using HAProxy 3.2 - \"2.8\": Using HAProxy 2.8", } func (IngressControllerStatus) SwaggerDoc() map[string]string { @@ -1121,6 +1214,7 @@ var map_IngressControllerTuningOptions = map[string]string{ "healthCheckInterval": "healthCheckInterval defines how long the router waits between two consecutive health checks on its configured backends. This value is applied globally as a default for all routes, but may be overridden per-route by the route annotation \"router.openshift.io/haproxy.health.check.interval\".\n\nExpects an unsigned duration string of decimal numbers, each with optional fraction and a unit suffix, eg \"300ms\", \"1.5h\" or \"2h45m\". Valid time units are \"ns\", \"us\" (or \"µs\" U+00B5 or \"μs\" U+03BC), \"ms\", \"s\", \"m\", \"h\".\n\nSetting this to less than 5s can cause excess traffic due to too frequent TCP health checks and accompanying SYN packet storms. Alternatively, setting this too high can result in increased latency, due to backend servers that are no longer available, but haven't yet been detected as such.\n\nAn empty or zero healthCheckInterval means no opinion and IngressController chooses a default, which is subject to change over time. Currently the default healthCheckInterval value is 5s.\n\nCurrently the minimum allowed value is 1s and the maximum allowed value is 2147483647ms (24.85 days). Both are subject to change over time.", "maxConnections": "maxConnections defines the maximum number of simultaneous connections that can be established per HAProxy process. Increasing this value allows each ingress controller pod to handle more connections but at the cost of additional system resources being consumed.\n\nPermitted values are: empty, 0, -1, and the range 2000-2000000.\n\nIf this field is empty or 0, the IngressController will use the default value of 50000, but the default is subject to change in future releases.\n\nIf the value is -1 then HAProxy will dynamically compute a maximum value based on the available ulimits in the running container. Selecting -1 (i.e., auto) will result in a large value being computed (~520000 on OpenShift >=4.10 clusters) and therefore each HAProxy process will incur significant memory usage compared to the current default of 50000.\n\nSetting a value that is greater than the current operating system limit will prevent the HAProxy process from starting.\n\nIf you choose a discrete value (e.g., 750000) and the router pod is migrated to a new node, there's no guarantee that that new node has identical ulimits configured. In such a scenario the pod would fail to start. If you have nodes with different ulimits configured (e.g., different tuned profiles) and you choose a discrete value then the guidance is to use -1 and let the value be computed dynamically at runtime.\n\nYou can monitor memory usage for router containers with the following metric: 'container_memory_working_set_bytes{container=\"router\",namespace=\"openshift-ingress\"}'.\n\nYou can monitor memory usage of individual HAProxy processes in router containers with the following metric: 'container_memory_working_set_bytes{container=\"router\",namespace=\"openshift-ingress\"}/container_processes{container=\"router\",namespace=\"openshift-ingress\"}'.", "reloadInterval": "reloadInterval defines the minimum interval at which the router is allowed to reload to accept new changes. Increasing this value can prevent the accumulation of HAProxy processes, depending on the scenario. Increasing this interval can also lessen load imbalance on a backend's servers when using the roundrobin balancing algorithm. Alternatively, decreasing this value may decrease latency since updates to HAProxy's configuration can take effect more quickly.\n\nThe value must be a time duration value; see . Currently, the minimum value allowed is 1s, and the maximum allowed value is 120s. Minimum and maximum allowed values may change in future versions of OpenShift. Note that if a duration outside of these bounds is provided, the value of reloadInterval will be capped/floored and not rejected (e.g. a duration of over 120s will be capped to 120s; the IngressController will not reject and replace this disallowed value with the default).\n\nA zero value for reloadInterval tells the IngressController to choose the default, which is currently 5s and subject to change without notice.\n\nThis field expects an unsigned duration string of decimal numbers, each with optional fraction and a unit suffix, e.g. \"300ms\", \"1.5h\" or \"2h45m\". Valid time units are \"ns\", \"us\" (or \"µs\" U+00B5 or \"μs\" U+03BC), \"ms\", \"s\", \"m\", \"h\".\n\nNote: Setting a value significantly larger than the default of 5s can cause latency in observing updates to routes and their endpoints. HAProxy's configuration will be reloaded less frequently, and newly created routes will not be served until the subsequent reload.", + "configurationManagement": "configurationManagement specifies how OpenShift router should update the HAProxy configuration. The following values are valid for this field:\n\n* \"ForkAndReload\". * \"Dynamic\".\n\nOmitting this field means that the user has no opinion and the platform may choose a reasonable default. This default is subject to change over time. The current default is \"ForkAndReload\".\n\n\"ForkAndReload\" means that OpenShift router should rewrite the HAProxy configuration file and instruct HAProxy to fork and reload. This is OpenShift router's traditional approach.\n\n\"Dynamic\" means that OpenShift router may use HAProxy's control socket for some configuration updates and fall back to fork and reload for other configuration updates. This is a newer approach, which may be less mature than ForkAndReload. This setting can improve load-balancing fairness and metrics accuracy and reduce CPU and memory usage if HAProxy has frequent configuration updates for route and endpoints updates.\n\nNote: The \"Dynamic\" option is currently experimental and should not be enabled on production clusters.", } func (IngressControllerTuningOptions) SwaggerDoc() map[string]string { @@ -1295,6 +1389,49 @@ func (InsightsReport) SwaggerDoc() map[string]string { return map_InsightsReport } +var map_KMSEncryptionStatus = map[string]string{ + "healthReports": "healthReports contains all KMS plugin health reports. When omitted, no health reports are available. Each entry must have a unique combination of nodeName and keyID.", + "preflight": "preflight contains the state of KMS preflight validation for this operator. The preflight validates the KMS provider configuration before it is used to create a new encryption key, catching configuration issues early such as incorrect login credentials or an unreachable Vault service. When omitted, no preflight validation is in progress.", +} + +func (KMSEncryptionStatus) SwaggerDoc() map[string]string { + return map_KMSEncryptionStatus +} + +var map_KMSPluginHealthReport = map[string]string{ + "nodeName": "nodeName is the name of the node this instance of the plugin runs on. The combination of nodeName and keyID makes this health report unique. The value must be a valid Kubernetes node name: a lowercase RFC 1123 subdomain consisting of lowercase alphanumeric characters, '-' or '.', starting and ending with an alphanumeric character, and be at most 253 characters in length.", + "keyID": "keyID is the encryption-key-secret id (kms-{keyID}.sock), a unique identifier of the plugin on that node. This is not a cryptographic key used to encrypt/decrypt any resources. The value must be between 1 and 512 characters.", + "status": "status contains a health indicator for the respective KMS plugin The field can have three states: healthy, unhealthy, error. With error and unhealthy containing additional information in Detail.", + "lastCheckedTime": "lastCheckedTime is a timestamp of when the probe was last checked.", + "remoteKeyID": "remoteKeyID refers to the remote key identifier from KMS v2 StatusResponse.key_id. This is not a cryptographic key, but a unique representation of the KEK. The value must be between 1 and 1024 characters.", + "detail": "detail contains additional error/health information for the respective KMS plugin. When omitted, no additional error or health information is provided. When set, the value must be between 1 and 1024 characters.", +} + +func (KMSPluginHealthReport) SwaggerDoc() map[string]string { + return map_KMSPluginHealthReport +} + +var map_KMSPreflightCheck = map[string]string{ + "": "KMSPreflightCheck describes a preflight validation request and its result.", + "observedConfigHash": "observedConfigHash is a hash of the KMS provider configuration and its referenced resources that has been observed and requires preflight validation before a new encryption key can be created. The value must be exactly 8 characters.", + "result": "result contains the outcome of the most recent preflight check. Preflight is considered passed when result.status is Succeeded and result.configHash matches observedConfigHash. When omitted, no preflight check result has been reported yet.", +} + +func (KMSPreflightCheck) SwaggerDoc() map[string]string { + return map_KMSPreflightCheck +} + +var map_KMSPreflightResult = map[string]string{ + "": "KMSPreflightResult contains the outcome of a preflight validation.", + "status": "status indicates the outcome of the preflight check. Succeeded means the KMS plugin responded to Status, Encrypt, and Decrypt calls successfully. Failed means the validation did not pass.", + "configHash": "configHash is the hash of the configuration that was validated. This is compared against observedConfigHash to confirm the result corresponds to the current configuration. The value must be exactly 8 characters.", + "remoteKeyID": "remoteKeyID is the remote key encryption key identifier from KMS v2 StatusResponse.key_id. This is not a cryptographic key, but a unique representation of the remote key used to encrypt data. The value must be between 1 and 1024 characters.", +} + +func (KMSPreflightResult) SwaggerDoc() map[string]string { + return map_KMSPreflightResult +} + var map_KubeAPIServer = map[string]string{ "": "KubeAPIServer provides information to configure an operator to manage kube-apiserver.\n\nCompatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).", "metadata": "metadata is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", @@ -1326,6 +1463,7 @@ func (KubeAPIServerSpec) SwaggerDoc() map[string]string { var map_KubeAPIServerStatus = map[string]string{ "serviceAccountIssuers": "serviceAccountIssuers tracks history of used service account issuers. The item without expiration time represents the currently used service account issuer. The other items represents service account issuers that were used previously and are still being trusted. The default expiration for the items is set by the platform and it defaults to 24h. see: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#service-account-token-volume-projection", + "encryptionStatus": "encryptionStatus contains status reports for the KMS plugin health and its key rotation.", } func (KubeAPIServerStatus) SwaggerDoc() map[string]string { @@ -2079,6 +2217,14 @@ func (OpenShiftAPIServerList) SwaggerDoc() map[string]string { return map_OpenShiftAPIServerList } +var map_OpenShiftAPIServerStatus = map[string]string{ + "encryptionStatus": "encryptionStatus contains status reports for the KMS plugin health and its key rotation.", +} + +func (OpenShiftAPIServerStatus) SwaggerDoc() map[string]string { + return map_OpenShiftAPIServerStatus +} + var map_OpenShiftControllerManager = map[string]string{ "": "OpenShiftControllerManager provides information to configure an operator to manage openshift-controller-manager.\n\nCompatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).", "metadata": "metadata is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", diff --git a/apis/vendor/github.com/openshift/installer/pkg/types/vsphere/machinepool.go b/apis/vendor/github.com/openshift/installer/pkg/types/vsphere/machinepool.go index 1a0fdb06e32..ff65a0161f5 100644 --- a/apis/vendor/github.com/openshift/installer/pkg/types/vsphere/machinepool.go +++ b/apis/vendor/github.com/openshift/installer/pkg/types/vsphere/machinepool.go @@ -30,7 +30,7 @@ type MachinePool struct { // +listType=map // +listMapKey=name // +kubebuilder:validation:MaxItems=29 - DataDisks []DataDisk `json:"dataDisks"` + DataDisks []DataDisk `json:"dataDisks,omitempty"` // Zones defines available zones // Zones is available in TechPreview. diff --git a/apis/vendor/golang.org/x/net/http2/server_wrap.go b/apis/vendor/golang.org/x/net/http2/server_wrap.go index a7a09551c43..737f1f0573b 100644 --- a/apis/vendor/golang.org/x/net/http2/server_wrap.go +++ b/apis/vendor/golang.org/x/net/http2/server_wrap.go @@ -10,9 +10,11 @@ package http2 import ( "context" + "crypto/tls" "errors" "net" "net/http" + "slices" "sync" "time" ) @@ -44,6 +46,20 @@ func configureServer(s *http.Server, conf *Server) error { h2.IdleTimeout = h1.ReadTimeout } } + + // Register h2 and http/1.1 ALPN protocols on s.TLSConfig, matching + // the pre-wrapping implementation in server.go, so that TLS listeners + // built from s.TLSConfig still negotiate HTTP/2. + if s.TLSConfig == nil { + s.TLSConfig = new(tls.Config) + } + if !slices.Contains(s.TLSConfig.NextProtos, NextProtoTLS) { + s.TLSConfig.NextProtos = append(s.TLSConfig.NextProtos, NextProtoTLS) + } + if !slices.Contains(s.TLSConfig.NextProtos, "http/1.1") { + s.TLSConfig.NextProtos = append(s.TLSConfig.NextProtos, "http/1.1") + } + conf.state = &serverInternalState{ s1: s, } diff --git a/apis/vendor/golang.org/x/net/http2/transport_wrap.go b/apis/vendor/golang.org/x/net/http2/transport_wrap.go index d25d99bdbb0..eab2e6b0731 100644 --- a/apis/vendor/golang.org/x/net/http2/transport_wrap.go +++ b/apis/vendor/golang.org/x/net/http2/transport_wrap.go @@ -22,8 +22,8 @@ import ( ) func configureTransport(t1 *http.Transport) error { - // ConfigureTransport is a no-op: The http.Transport already supports HTTP/2. - return nil + _, err := configureTransports(t1) + return err } func configureTransports(t1 *http.Transport) (*Transport, error) { @@ -31,6 +31,17 @@ func configureTransports(t1 *http.Transport) (*Transport, error) { // linked to the http.Transport's. tr2 := &Transport{} tr2.configure(t1) + // Enable HTTP/2 on the transport, as the pre-wrapping implementation did: + // net/http does not auto-enable it for a transport with a custom + // TLSClientConfig or dialer. + if t1.TLSClientConfig == nil { + t1.TLSClientConfig = &tls.Config{} + } + if t1.Protocols == nil { + t1.Protocols = new(http.Protocols) + t1.Protocols.SetHTTP1(true) + } + t1.Protocols.SetHTTP2(true) return tr2, nil } diff --git a/apis/vendor/k8s.io/api/authorization/v1/generated.proto b/apis/vendor/k8s.io/api/authorization/v1/generated.proto index ff529c969e4..c47449f911b 100644 --- a/apis/vendor/k8s.io/api/authorization/v1/generated.proto +++ b/apis/vendor/k8s.io/api/authorization/v1/generated.proto @@ -95,38 +95,38 @@ message LabelSelectorAttributes { // Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions // checking. message LocalSubjectAccessReview { - // Standard list metadata. + // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - // Spec holds information about the request being evaluated. spec.namespace must be equal to the namespace + // spec holds information about the request being evaluated. spec.namespace must be equal to the namespace // you made the request against. If empty, it is defaulted. optional SubjectAccessReviewSpec spec = 2; - // Status is filled in by the server and indicates whether the request is allowed or not + // status is filled in by the server and indicates whether the request is allowed or not // +optional optional SubjectAccessReviewStatus status = 3; } // NonResourceAttributes includes the authorization attributes available for non-resource requests to the Authorizer interface message NonResourceAttributes { - // Path is the URL path of the request + // path is the URL path of the request // +optional optional string path = 1; - // Verb is the standard HTTP verb + // verb is the standard HTTP verb // +optional optional string verb = 2; } // NonResourceRule holds information that describes a rule for the non-resource message NonResourceRule { - // Verb is a list of kubernetes non-resource API verbs, like: get, post, put, delete, patch, head, options. "*" means all. + // verbs is a list of kubernetes non-resource API verbs, like: get, post, put, delete, patch, head, options. "*" means all. // +listType=atomic repeated string verbs = 1; - // NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, + // nonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, // final step in the path. "*" means all. // +optional // +listType=atomic @@ -135,34 +135,34 @@ message NonResourceRule { // ResourceAttributes includes the authorization attributes available for resource requests to the Authorizer interface message ResourceAttributes { - // Namespace is the namespace of the action being requested. Currently, there is no distinction between no namespace and all namespaces + // namespace is the namespace of the action being requested. Currently, there is no distinction between no namespace and all namespaces // "" (empty) is defaulted for LocalSubjectAccessReviews // "" (empty) is empty for cluster-scoped resources // "" (empty) means "all" for namespace scoped resources from a SubjectAccessReview or SelfSubjectAccessReview // +optional optional string namespace = 1; - // Verb is a kubernetes resource API verb, like: get, list, watch, create, update, delete, proxy. "*" means all. + // verb is a kubernetes resource API verb, like: get, list, watch, create, update, delete, proxy. "*" means all. // +optional optional string verb = 2; - // Group is the API Group of the Resource. "*" means all. + // group is the API Group of the Resource. "*" means all. // +optional optional string group = 3; - // Version is the API Version of the Resource. "*" means all. + // version is the API Version of the Resource. "*" means all. // +optional optional string version = 4; - // Resource is one of the existing resource types. "*" means all. + // resource is one of the existing resource types. "*" means all. // +optional optional string resource = 5; - // Subresource is one of the existing resource types. "" means none. + // subresource is one of the existing resource types. "" means none. // +optional optional string subresource = 6; - // Name is the name of the resource being requested for a "get" or deleted for a "delete". "" (empty) means all. + // name is the name of the resource being requested for a "get" or deleted for a "delete". "" (empty) means all. // +optional optional string name = 7; @@ -178,23 +178,23 @@ message ResourceAttributes { // ResourceRule is the list of actions the subject is allowed to perform on resources. The list ordering isn't significant, // may contain duplicates, and possibly be incomplete. message ResourceRule { - // Verb is a list of kubernetes resource API verbs, like: get, list, watch, create, update, delete, proxy. "*" means all. + // verbs is a list of kubernetes resource API verbs, like: get, list, watch, create, update, delete, proxy. "*" means all. // +listType=atomic repeated string verbs = 1; - // APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of + // apiGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of // the enumerated resources in any API group will be allowed. "*" means all. // +optional // +listType=atomic repeated string apiGroups = 2; - // Resources is a list of resources this rule applies to. "*" means all in the specified apiGroups. + // resources is a list of resources this rule applies to. "*" means all in the specified apiGroups. // "*/foo" represents the subresource 'foo' for all resources in the specified apiGroups. // +optional // +listType=atomic repeated string resources = 3; - // ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. "*" means all. + // resourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. "*" means all. // +optional // +listType=atomic repeated string resourceNames = 4; @@ -204,27 +204,27 @@ message ResourceRule { // spec.namespace means "in all namespaces". Self is a special case, because users should always be able // to check whether they can perform an action message SelfSubjectAccessReview { - // Standard list metadata. + // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - // Spec holds information about the request being evaluated. user and groups must be empty + // spec holds information about the request being evaluated. user and groups must be empty optional SelfSubjectAccessReviewSpec spec = 2; - // Status is filled in by the server and indicates whether the request is allowed or not + // status is filled in by the server and indicates whether the request is allowed or not // +optional optional SubjectAccessReviewStatus status = 3; } -// SelfSubjectAccessReviewSpec is a description of the access request. Exactly one of ResourceAuthorizationAttributes -// and NonResourceAuthorizationAttributes must be set +// SelfSubjectAccessReviewSpec is a description of the access request. Exactly one of resourceAttributes +// and nonResourceAttributes must be set message SelfSubjectAccessReviewSpec { - // ResourceAuthorizationAttributes describes information for a resource access request + // resourceAttributes describes information for a resource access request // +optional optional ResourceAttributes resourceAttributes = 1; - // NonResourceAttributes describes information for a non-resource access request + // nonResourceAttributes describes information for a non-resource access request // +optional optional NonResourceAttributes nonResourceAttributes = 2; } @@ -236,88 +236,88 @@ message SelfSubjectAccessReviewSpec { // drive authorization decisions as this raises confused deputy, cache lifetime/revocation, and correctness concerns. // SubjectAccessReview, and LocalAccessReview are the correct way to defer authorization decisions to the API server. message SelfSubjectRulesReview { - // Standard list metadata. + // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - // Spec holds information about the request being evaluated. + // spec holds information about the request being evaluated. optional SelfSubjectRulesReviewSpec spec = 2; - // Status is filled in by the server and indicates the set of actions a user can perform. + // status is filled in by the server and indicates the set of actions a user can perform. // +optional optional SubjectRulesReviewStatus status = 3; } // SelfSubjectRulesReviewSpec defines the specification for SelfSubjectRulesReview. message SelfSubjectRulesReviewSpec { - // Namespace to evaluate rules for. Required. + // namespace to evaluate rules for. Required. optional string namespace = 1; } // SubjectAccessReview checks whether or not a user or group can perform an action. message SubjectAccessReview { - // Standard list metadata. + // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - // Spec holds information about the request being evaluated + // spec holds information about the request being evaluated optional SubjectAccessReviewSpec spec = 2; - // Status is filled in by the server and indicates whether the request is allowed or not + // status is filled in by the server and indicates whether the request is allowed or not // +optional optional SubjectAccessReviewStatus status = 3; } -// SubjectAccessReviewSpec is a description of the access request. Exactly one of ResourceAuthorizationAttributes -// and NonResourceAuthorizationAttributes must be set +// SubjectAccessReviewSpec is a description of the access request. Exactly one of resourceAttributes +// and nonResourceAttributes must be set message SubjectAccessReviewSpec { - // ResourceAuthorizationAttributes describes information for a resource access request + // resourceAttributes describes information for a resource access request // +optional optional ResourceAttributes resourceAttributes = 1; - // NonResourceAttributes describes information for a non-resource access request + // nonResourceAttributes describes information for a non-resource access request // +optional optional NonResourceAttributes nonResourceAttributes = 2; - // User is the user you're testing for. + // user is the user you're testing for. // If you specify "User" but not "Groups", then is it interpreted as "What if User were not a member of any groups // +optional optional string user = 3; - // Groups is the groups you're testing for. + // groups is the groups you're testing for. // +optional // +listType=atomic repeated string groups = 4; - // Extra corresponds to the user.Info.GetExtra() method from the authenticator. Since that is input to the authorizer + // extra corresponds to the user.Info.GetExtra() method from the authenticator. Since that is input to the authorizer // it needs a reflection here. // +optional map extra = 5; - // UID information about the requesting user. + // uid information about the requesting user. // +optional optional string uid = 6; } // SubjectAccessReviewStatus message SubjectAccessReviewStatus { - // Allowed is required. True if the action would be allowed, false otherwise. + // allowed is required. True if the action would be allowed, false otherwise. optional bool allowed = 1; - // Denied is optional. True if the action would be denied, otherwise + // denied is optional. True if the action would be denied, otherwise // false. If both allowed is false and denied is false, then the // authorizer has no opinion on whether to authorize the action. Denied // may not be true if Allowed is true. // +optional optional bool denied = 4; - // Reason is optional. It indicates why a request was allowed or denied. + // reason is optional. It indicates why a request was allowed or denied. // +optional optional string reason = 2; - // EvaluationError is an indication that some error occurred during the authorization check. + // evaluationError is an indication that some error occurred during the authorization check. // It is entirely possible to get an error and be able to continue determine authorization status in spite of it. // For instance, RBAC can be missing a role, but enough roles are still present and bound to reason about the request. // +optional @@ -329,21 +329,21 @@ message SubjectAccessReviewStatus { // Because authorization rules are additive, if a rule appears in a list it's safe to assume the subject has that permission, // even if that list is incomplete. message SubjectRulesReviewStatus { - // ResourceRules is the list of actions the subject is allowed to perform on resources. + // resourceRules is the list of actions the subject is allowed to perform on resources. // The list ordering isn't significant, may contain duplicates, and possibly be incomplete. // +listType=atomic repeated ResourceRule resourceRules = 1; - // NonResourceRules is the list of actions the subject is allowed to perform on non-resources. + // nonResourceRules is the list of actions the subject is allowed to perform on non-resources. // The list ordering isn't significant, may contain duplicates, and possibly be incomplete. // +listType=atomic repeated NonResourceRule nonResourceRules = 2; - // Incomplete is true when the rules returned by this call are incomplete. This is most commonly + // incomplete is true when the rules returned by this call are incomplete. This is most commonly // encountered when an authorizer, such as an external authorizer, doesn't support rules evaluation. optional bool incomplete = 3; - // EvaluationError can appear in combination with Rules. It indicates an error occurred during + // evaluationError can appear in combination with Rules. It indicates an error occurred during // rule evaluation, such as an authorizer that doesn't support rule evaluation, and that // ResourceRules and/or NonResourceRules may be incomplete. // +optional diff --git a/apis/vendor/k8s.io/api/authorization/v1/generated.protomessage.pb.go b/apis/vendor/k8s.io/api/authorization/v1/generated.protomessage.pb.go deleted file mode 100644 index dc1e1028c00..00000000000 --- a/apis/vendor/k8s.io/api/authorization/v1/generated.protomessage.pb.go +++ /dev/null @@ -1,54 +0,0 @@ -//go:build kubernetes_protomessage_one_more_release -// +build kubernetes_protomessage_one_more_release - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by go-to-protobuf. DO NOT EDIT. - -package v1 - -func (*ExtraValue) ProtoMessage() {} - -func (*FieldSelectorAttributes) ProtoMessage() {} - -func (*LabelSelectorAttributes) ProtoMessage() {} - -func (*LocalSubjectAccessReview) ProtoMessage() {} - -func (*NonResourceAttributes) ProtoMessage() {} - -func (*NonResourceRule) ProtoMessage() {} - -func (*ResourceAttributes) ProtoMessage() {} - -func (*ResourceRule) ProtoMessage() {} - -func (*SelfSubjectAccessReview) ProtoMessage() {} - -func (*SelfSubjectAccessReviewSpec) ProtoMessage() {} - -func (*SelfSubjectRulesReview) ProtoMessage() {} - -func (*SelfSubjectRulesReviewSpec) ProtoMessage() {} - -func (*SubjectAccessReview) ProtoMessage() {} - -func (*SubjectAccessReviewSpec) ProtoMessage() {} - -func (*SubjectAccessReviewStatus) ProtoMessage() {} - -func (*SubjectRulesReviewStatus) ProtoMessage() {} diff --git a/apis/vendor/k8s.io/api/authorization/v1/types.go b/apis/vendor/k8s.io/api/authorization/v1/types.go index 251e776b024..dcc9b0f853b 100644 --- a/apis/vendor/k8s.io/api/authorization/v1/types.go +++ b/apis/vendor/k8s.io/api/authorization/v1/types.go @@ -31,15 +31,15 @@ import ( // SubjectAccessReview checks whether or not a user or group can perform an action. type SubjectAccessReview struct { metav1.TypeMeta `json:",inline"` - // Standard list metadata. + // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - // Spec holds information about the request being evaluated + // spec holds information about the request being evaluated Spec SubjectAccessReviewSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` - // Status is filled in by the server and indicates whether the request is allowed or not + // status is filled in by the server and indicates whether the request is allowed or not // +optional Status SubjectAccessReviewStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } @@ -55,15 +55,15 @@ type SubjectAccessReview struct { // to check whether they can perform an action type SelfSubjectAccessReview struct { metav1.TypeMeta `json:",inline"` - // Standard list metadata. + // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - // Spec holds information about the request being evaluated. user and groups must be empty + // spec holds information about the request being evaluated. user and groups must be empty Spec SelfSubjectAccessReviewSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` - // Status is filled in by the server and indicates whether the request is allowed or not + // status is filled in by the server and indicates whether the request is allowed or not // +optional Status SubjectAccessReviewStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } @@ -78,44 +78,44 @@ type SelfSubjectAccessReview struct { // checking. type LocalSubjectAccessReview struct { metav1.TypeMeta `json:",inline"` - // Standard list metadata. + // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - // Spec holds information about the request being evaluated. spec.namespace must be equal to the namespace + // spec holds information about the request being evaluated. spec.namespace must be equal to the namespace // you made the request against. If empty, it is defaulted. Spec SubjectAccessReviewSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` - // Status is filled in by the server and indicates whether the request is allowed or not + // status is filled in by the server and indicates whether the request is allowed or not // +optional Status SubjectAccessReviewStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } // ResourceAttributes includes the authorization attributes available for resource requests to the Authorizer interface type ResourceAttributes struct { - // Namespace is the namespace of the action being requested. Currently, there is no distinction between no namespace and all namespaces + // namespace is the namespace of the action being requested. Currently, there is no distinction between no namespace and all namespaces // "" (empty) is defaulted for LocalSubjectAccessReviews // "" (empty) is empty for cluster-scoped resources // "" (empty) means "all" for namespace scoped resources from a SubjectAccessReview or SelfSubjectAccessReview // +optional Namespace string `json:"namespace,omitempty" protobuf:"bytes,1,opt,name=namespace"` - // Verb is a kubernetes resource API verb, like: get, list, watch, create, update, delete, proxy. "*" means all. + // verb is a kubernetes resource API verb, like: get, list, watch, create, update, delete, proxy. "*" means all. // +optional Verb string `json:"verb,omitempty" protobuf:"bytes,2,opt,name=verb"` - // Group is the API Group of the Resource. "*" means all. + // group is the API Group of the Resource. "*" means all. // +optional Group string `json:"group,omitempty" protobuf:"bytes,3,opt,name=group"` - // Version is the API Version of the Resource. "*" means all. + // version is the API Version of the Resource. "*" means all. // +optional Version string `json:"version,omitempty" protobuf:"bytes,4,opt,name=version"` - // Resource is one of the existing resource types. "*" means all. + // resource is one of the existing resource types. "*" means all. // +optional Resource string `json:"resource,omitempty" protobuf:"bytes,5,opt,name=resource"` - // Subresource is one of the existing resource types. "" means none. + // subresource is one of the existing resource types. "" means none. // +optional Subresource string `json:"subresource,omitempty" protobuf:"bytes,6,opt,name=subresource"` - // Name is the name of the resource being requested for a "get" or deleted for a "delete". "" (empty) means all. + // name is the name of the resource being requested for a "get" or deleted for a "delete". "" (empty) means all. // +optional Name string `json:"name,omitempty" protobuf:"bytes,7,opt,name=name"` // fieldSelector describes the limitation on access based on field. It can only limit access, not broaden it. @@ -182,37 +182,37 @@ type FieldSelectorAttributes struct { // NonResourceAttributes includes the authorization attributes available for non-resource requests to the Authorizer interface type NonResourceAttributes struct { - // Path is the URL path of the request + // path is the URL path of the request // +optional Path string `json:"path,omitempty" protobuf:"bytes,1,opt,name=path"` - // Verb is the standard HTTP verb + // verb is the standard HTTP verb // +optional Verb string `json:"verb,omitempty" protobuf:"bytes,2,opt,name=verb"` } -// SubjectAccessReviewSpec is a description of the access request. Exactly one of ResourceAuthorizationAttributes -// and NonResourceAuthorizationAttributes must be set +// SubjectAccessReviewSpec is a description of the access request. Exactly one of resourceAttributes +// and nonResourceAttributes must be set type SubjectAccessReviewSpec struct { - // ResourceAuthorizationAttributes describes information for a resource access request + // resourceAttributes describes information for a resource access request // +optional ResourceAttributes *ResourceAttributes `json:"resourceAttributes,omitempty" protobuf:"bytes,1,opt,name=resourceAttributes"` - // NonResourceAttributes describes information for a non-resource access request + // nonResourceAttributes describes information for a non-resource access request // +optional NonResourceAttributes *NonResourceAttributes `json:"nonResourceAttributes,omitempty" protobuf:"bytes,2,opt,name=nonResourceAttributes"` - // User is the user you're testing for. + // user is the user you're testing for. // If you specify "User" but not "Groups", then is it interpreted as "What if User were not a member of any groups // +optional User string `json:"user,omitempty" protobuf:"bytes,3,opt,name=user"` - // Groups is the groups you're testing for. + // groups is the groups you're testing for. // +optional // +listType=atomic Groups []string `json:"groups,omitempty" protobuf:"bytes,4,rep,name=groups"` - // Extra corresponds to the user.Info.GetExtra() method from the authenticator. Since that is input to the authorizer + // extra corresponds to the user.Info.GetExtra() method from the authenticator. Since that is input to the authorizer // it needs a reflection here. // +optional Extra map[string]ExtraValue `json:"extra,omitempty" protobuf:"bytes,5,rep,name=extra"` - // UID information about the requesting user. + // uid information about the requesting user. // +optional UID string `json:"uid,omitempty" protobuf:"bytes,6,opt,name=uid"` } @@ -226,31 +226,31 @@ func (t ExtraValue) String() string { return fmt.Sprintf("%v", []string(t)) } -// SelfSubjectAccessReviewSpec is a description of the access request. Exactly one of ResourceAuthorizationAttributes -// and NonResourceAuthorizationAttributes must be set +// SelfSubjectAccessReviewSpec is a description of the access request. Exactly one of resourceAttributes +// and nonResourceAttributes must be set type SelfSubjectAccessReviewSpec struct { - // ResourceAuthorizationAttributes describes information for a resource access request + // resourceAttributes describes information for a resource access request // +optional ResourceAttributes *ResourceAttributes `json:"resourceAttributes,omitempty" protobuf:"bytes,1,opt,name=resourceAttributes"` - // NonResourceAttributes describes information for a non-resource access request + // nonResourceAttributes describes information for a non-resource access request // +optional NonResourceAttributes *NonResourceAttributes `json:"nonResourceAttributes,omitempty" protobuf:"bytes,2,opt,name=nonResourceAttributes"` } // SubjectAccessReviewStatus type SubjectAccessReviewStatus struct { - // Allowed is required. True if the action would be allowed, false otherwise. + // allowed is required. True if the action would be allowed, false otherwise. Allowed bool `json:"allowed" protobuf:"varint,1,opt,name=allowed"` - // Denied is optional. True if the action would be denied, otherwise + // denied is optional. True if the action would be denied, otherwise // false. If both allowed is false and denied is false, then the // authorizer has no opinion on whether to authorize the action. Denied // may not be true if Allowed is true. // +optional Denied bool `json:"denied,omitempty" protobuf:"varint,4,opt,name=denied"` - // Reason is optional. It indicates why a request was allowed or denied. + // reason is optional. It indicates why a request was allowed or denied. // +optional Reason string `json:"reason,omitempty" protobuf:"bytes,2,opt,name=reason"` - // EvaluationError is an indication that some error occurred during the authorization check. + // evaluationError is an indication that some error occurred during the authorization check. // It is entirely possible to get an error and be able to continue determine authorization status in spite of it. // For instance, RBAC can be missing a role, but enough roles are still present and bound to reason about the request. // +optional @@ -271,22 +271,22 @@ type SubjectAccessReviewStatus struct { // SubjectAccessReview, and LocalAccessReview are the correct way to defer authorization decisions to the API server. type SelfSubjectRulesReview struct { metav1.TypeMeta `json:",inline"` - // Standard list metadata. + // metadata is the standard list metadata. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - // Spec holds information about the request being evaluated. + // spec holds information about the request being evaluated. Spec SelfSubjectRulesReviewSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` - // Status is filled in by the server and indicates the set of actions a user can perform. + // status is filled in by the server and indicates the set of actions a user can perform. // +optional Status SubjectRulesReviewStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } // SelfSubjectRulesReviewSpec defines the specification for SelfSubjectRulesReview. type SelfSubjectRulesReviewSpec struct { - // Namespace to evaluate rules for. Required. + // namespace to evaluate rules for. Required. Namespace string `json:"namespace,omitempty" protobuf:"bytes,1,opt,name=namespace"` } @@ -295,18 +295,18 @@ type SelfSubjectRulesReviewSpec struct { // Because authorization rules are additive, if a rule appears in a list it's safe to assume the subject has that permission, // even if that list is incomplete. type SubjectRulesReviewStatus struct { - // ResourceRules is the list of actions the subject is allowed to perform on resources. + // resourceRules is the list of actions the subject is allowed to perform on resources. // The list ordering isn't significant, may contain duplicates, and possibly be incomplete. // +listType=atomic ResourceRules []ResourceRule `json:"resourceRules" protobuf:"bytes,1,rep,name=resourceRules"` - // NonResourceRules is the list of actions the subject is allowed to perform on non-resources. + // nonResourceRules is the list of actions the subject is allowed to perform on non-resources. // The list ordering isn't significant, may contain duplicates, and possibly be incomplete. // +listType=atomic NonResourceRules []NonResourceRule `json:"nonResourceRules" protobuf:"bytes,2,rep,name=nonResourceRules"` - // Incomplete is true when the rules returned by this call are incomplete. This is most commonly + // incomplete is true when the rules returned by this call are incomplete. This is most commonly // encountered when an authorizer, such as an external authorizer, doesn't support rules evaluation. Incomplete bool `json:"incomplete" protobuf:"bytes,3,rep,name=incomplete"` - // EvaluationError can appear in combination with Rules. It indicates an error occurred during + // evaluationError can appear in combination with Rules. It indicates an error occurred during // rule evaluation, such as an authorizer that doesn't support rule evaluation, and that // ResourceRules and/or NonResourceRules may be incomplete. // +optional @@ -316,21 +316,21 @@ type SubjectRulesReviewStatus struct { // ResourceRule is the list of actions the subject is allowed to perform on resources. The list ordering isn't significant, // may contain duplicates, and possibly be incomplete. type ResourceRule struct { - // Verb is a list of kubernetes resource API verbs, like: get, list, watch, create, update, delete, proxy. "*" means all. + // verbs is a list of kubernetes resource API verbs, like: get, list, watch, create, update, delete, proxy. "*" means all. // +listType=atomic Verbs []string `json:"verbs" protobuf:"bytes,1,rep,name=verbs"` - // APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of + // apiGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of // the enumerated resources in any API group will be allowed. "*" means all. // +optional // +listType=atomic APIGroups []string `json:"apiGroups,omitempty" protobuf:"bytes,2,rep,name=apiGroups"` - // Resources is a list of resources this rule applies to. "*" means all in the specified apiGroups. + // resources is a list of resources this rule applies to. "*" means all in the specified apiGroups. // "*/foo" represents the subresource 'foo' for all resources in the specified apiGroups. // +optional // +listType=atomic Resources []string `json:"resources,omitempty" protobuf:"bytes,3,rep,name=resources"` - // ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. "*" means all. + // resourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. "*" means all. // +optional // +listType=atomic ResourceNames []string `json:"resourceNames,omitempty" protobuf:"bytes,4,rep,name=resourceNames"` @@ -338,11 +338,11 @@ type ResourceRule struct { // NonResourceRule holds information that describes a rule for the non-resource type NonResourceRule struct { - // Verb is a list of kubernetes non-resource API verbs, like: get, post, put, delete, patch, head, options. "*" means all. + // verbs is a list of kubernetes non-resource API verbs, like: get, post, put, delete, patch, head, options. "*" means all. // +listType=atomic Verbs []string `json:"verbs" protobuf:"bytes,1,rep,name=verbs"` - // NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, + // nonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, // final step in the path. "*" means all. // +optional // +listType=atomic diff --git a/apis/vendor/k8s.io/api/authorization/v1/types_swagger_doc_generated.go b/apis/vendor/k8s.io/api/authorization/v1/types_swagger_doc_generated.go index 29d0aa8463d..0b3ae19a599 100644 --- a/apis/vendor/k8s.io/api/authorization/v1/types_swagger_doc_generated.go +++ b/apis/vendor/k8s.io/api/authorization/v1/types_swagger_doc_generated.go @@ -49,9 +49,9 @@ func (LabelSelectorAttributes) SwaggerDoc() map[string]string { var map_LocalSubjectAccessReview = map[string]string{ "": "LocalSubjectAccessReview checks whether or not a user or group can perform an action in a given namespace. Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions checking.", - "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - "spec": "Spec holds information about the request being evaluated. spec.namespace must be equal to the namespace you made the request against. If empty, it is defaulted.", - "status": "Status is filled in by the server and indicates whether the request is allowed or not", + "metadata": "metadata is the standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "spec": "spec holds information about the request being evaluated. spec.namespace must be equal to the namespace you made the request against. If empty, it is defaulted.", + "status": "status is filled in by the server and indicates whether the request is allowed or not", } func (LocalSubjectAccessReview) SwaggerDoc() map[string]string { @@ -60,8 +60,8 @@ func (LocalSubjectAccessReview) SwaggerDoc() map[string]string { var map_NonResourceAttributes = map[string]string{ "": "NonResourceAttributes includes the authorization attributes available for non-resource requests to the Authorizer interface", - "path": "Path is the URL path of the request", - "verb": "Verb is the standard HTTP verb", + "path": "path is the URL path of the request", + "verb": "verb is the standard HTTP verb", } func (NonResourceAttributes) SwaggerDoc() map[string]string { @@ -70,8 +70,8 @@ func (NonResourceAttributes) SwaggerDoc() map[string]string { var map_NonResourceRule = map[string]string{ "": "NonResourceRule holds information that describes a rule for the non-resource", - "verbs": "Verb is a list of kubernetes non-resource API verbs, like: get, post, put, delete, patch, head, options. \"*\" means all.", - "nonResourceURLs": "NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path. \"*\" means all.", + "verbs": "verbs is a list of kubernetes non-resource API verbs, like: get, post, put, delete, patch, head, options. \"*\" means all.", + "nonResourceURLs": "nonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path. \"*\" means all.", } func (NonResourceRule) SwaggerDoc() map[string]string { @@ -80,13 +80,13 @@ func (NonResourceRule) SwaggerDoc() map[string]string { var map_ResourceAttributes = map[string]string{ "": "ResourceAttributes includes the authorization attributes available for resource requests to the Authorizer interface", - "namespace": "Namespace is the namespace of the action being requested. Currently, there is no distinction between no namespace and all namespaces \"\" (empty) is defaulted for LocalSubjectAccessReviews \"\" (empty) is empty for cluster-scoped resources \"\" (empty) means \"all\" for namespace scoped resources from a SubjectAccessReview or SelfSubjectAccessReview", - "verb": "Verb is a kubernetes resource API verb, like: get, list, watch, create, update, delete, proxy. \"*\" means all.", - "group": "Group is the API Group of the Resource. \"*\" means all.", - "version": "Version is the API Version of the Resource. \"*\" means all.", - "resource": "Resource is one of the existing resource types. \"*\" means all.", - "subresource": "Subresource is one of the existing resource types. \"\" means none.", - "name": "Name is the name of the resource being requested for a \"get\" or deleted for a \"delete\". \"\" (empty) means all.", + "namespace": "namespace is the namespace of the action being requested. Currently, there is no distinction between no namespace and all namespaces \"\" (empty) is defaulted for LocalSubjectAccessReviews \"\" (empty) is empty for cluster-scoped resources \"\" (empty) means \"all\" for namespace scoped resources from a SubjectAccessReview or SelfSubjectAccessReview", + "verb": "verb is a kubernetes resource API verb, like: get, list, watch, create, update, delete, proxy. \"*\" means all.", + "group": "group is the API Group of the Resource. \"*\" means all.", + "version": "version is the API Version of the Resource. \"*\" means all.", + "resource": "resource is one of the existing resource types. \"*\" means all.", + "subresource": "subresource is one of the existing resource types. \"\" means none.", + "name": "name is the name of the resource being requested for a \"get\" or deleted for a \"delete\". \"\" (empty) means all.", "fieldSelector": "fieldSelector describes the limitation on access based on field. It can only limit access, not broaden it.", "labelSelector": "labelSelector describes the limitation on access based on labels. It can only limit access, not broaden it.", } @@ -97,10 +97,10 @@ func (ResourceAttributes) SwaggerDoc() map[string]string { var map_ResourceRule = map[string]string{ "": "ResourceRule is the list of actions the subject is allowed to perform on resources. The list ordering isn't significant, may contain duplicates, and possibly be incomplete.", - "verbs": "Verb is a list of kubernetes resource API verbs, like: get, list, watch, create, update, delete, proxy. \"*\" means all.", - "apiGroups": "APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of the enumerated resources in any API group will be allowed. \"*\" means all.", - "resources": "Resources is a list of resources this rule applies to. \"*\" means all in the specified apiGroups.\n \"*/foo\" represents the subresource 'foo' for all resources in the specified apiGroups.", - "resourceNames": "ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. \"*\" means all.", + "verbs": "verbs is a list of kubernetes resource API verbs, like: get, list, watch, create, update, delete, proxy. \"*\" means all.", + "apiGroups": "apiGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of the enumerated resources in any API group will be allowed. \"*\" means all.", + "resources": "resources is a list of resources this rule applies to. \"*\" means all in the specified apiGroups.\n \"*/foo\" represents the subresource 'foo' for all resources in the specified apiGroups.", + "resourceNames": "resourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. \"*\" means all.", } func (ResourceRule) SwaggerDoc() map[string]string { @@ -109,9 +109,9 @@ func (ResourceRule) SwaggerDoc() map[string]string { var map_SelfSubjectAccessReview = map[string]string{ "": "SelfSubjectAccessReview checks whether or the current user can perform an action. Not filling in a spec.namespace means \"in all namespaces\". Self is a special case, because users should always be able to check whether they can perform an action", - "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - "spec": "Spec holds information about the request being evaluated. user and groups must be empty", - "status": "Status is filled in by the server and indicates whether the request is allowed or not", + "metadata": "metadata is the standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "spec": "spec holds information about the request being evaluated. user and groups must be empty", + "status": "status is filled in by the server and indicates whether the request is allowed or not", } func (SelfSubjectAccessReview) SwaggerDoc() map[string]string { @@ -119,9 +119,9 @@ func (SelfSubjectAccessReview) SwaggerDoc() map[string]string { } var map_SelfSubjectAccessReviewSpec = map[string]string{ - "": "SelfSubjectAccessReviewSpec is a description of the access request. Exactly one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be set", - "resourceAttributes": "ResourceAuthorizationAttributes describes information for a resource access request", - "nonResourceAttributes": "NonResourceAttributes describes information for a non-resource access request", + "": "SelfSubjectAccessReviewSpec is a description of the access request. Exactly one of resourceAttributes and nonResourceAttributes must be set", + "resourceAttributes": "resourceAttributes describes information for a resource access request", + "nonResourceAttributes": "nonResourceAttributes describes information for a non-resource access request", } func (SelfSubjectAccessReviewSpec) SwaggerDoc() map[string]string { @@ -130,9 +130,9 @@ func (SelfSubjectAccessReviewSpec) SwaggerDoc() map[string]string { var map_SelfSubjectRulesReview = map[string]string{ "": "SelfSubjectRulesReview enumerates the set of actions the current user can perform within a namespace. The returned list of actions may be incomplete depending on the server's authorization mode, and any errors experienced during the evaluation. SelfSubjectRulesReview should be used by UIs to show/hide actions, or to quickly let an end user reason about their permissions. It should NOT Be used by external systems to drive authorization decisions as this raises confused deputy, cache lifetime/revocation, and correctness concerns. SubjectAccessReview, and LocalAccessReview are the correct way to defer authorization decisions to the API server.", - "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - "spec": "Spec holds information about the request being evaluated.", - "status": "Status is filled in by the server and indicates the set of actions a user can perform.", + "metadata": "metadata is the standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "spec": "spec holds information about the request being evaluated.", + "status": "status is filled in by the server and indicates the set of actions a user can perform.", } func (SelfSubjectRulesReview) SwaggerDoc() map[string]string { @@ -141,7 +141,7 @@ func (SelfSubjectRulesReview) SwaggerDoc() map[string]string { var map_SelfSubjectRulesReviewSpec = map[string]string{ "": "SelfSubjectRulesReviewSpec defines the specification for SelfSubjectRulesReview.", - "namespace": "Namespace to evaluate rules for. Required.", + "namespace": "namespace to evaluate rules for. Required.", } func (SelfSubjectRulesReviewSpec) SwaggerDoc() map[string]string { @@ -150,9 +150,9 @@ func (SelfSubjectRulesReviewSpec) SwaggerDoc() map[string]string { var map_SubjectAccessReview = map[string]string{ "": "SubjectAccessReview checks whether or not a user or group can perform an action.", - "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - "spec": "Spec holds information about the request being evaluated", - "status": "Status is filled in by the server and indicates whether the request is allowed or not", + "metadata": "metadata is the standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "spec": "spec holds information about the request being evaluated", + "status": "status is filled in by the server and indicates whether the request is allowed or not", } func (SubjectAccessReview) SwaggerDoc() map[string]string { @@ -160,13 +160,13 @@ func (SubjectAccessReview) SwaggerDoc() map[string]string { } var map_SubjectAccessReviewSpec = map[string]string{ - "": "SubjectAccessReviewSpec is a description of the access request. Exactly one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be set", - "resourceAttributes": "ResourceAuthorizationAttributes describes information for a resource access request", - "nonResourceAttributes": "NonResourceAttributes describes information for a non-resource access request", - "user": "User is the user you're testing for. If you specify \"User\" but not \"Groups\", then is it interpreted as \"What if User were not a member of any groups", - "groups": "Groups is the groups you're testing for.", - "extra": "Extra corresponds to the user.Info.GetExtra() method from the authenticator. Since that is input to the authorizer it needs a reflection here.", - "uid": "UID information about the requesting user.", + "": "SubjectAccessReviewSpec is a description of the access request. Exactly one of resourceAttributes and nonResourceAttributes must be set", + "resourceAttributes": "resourceAttributes describes information for a resource access request", + "nonResourceAttributes": "nonResourceAttributes describes information for a non-resource access request", + "user": "user is the user you're testing for. If you specify \"User\" but not \"Groups\", then is it interpreted as \"What if User were not a member of any groups", + "groups": "groups is the groups you're testing for.", + "extra": "extra corresponds to the user.Info.GetExtra() method from the authenticator. Since that is input to the authorizer it needs a reflection here.", + "uid": "uid information about the requesting user.", } func (SubjectAccessReviewSpec) SwaggerDoc() map[string]string { @@ -175,10 +175,10 @@ func (SubjectAccessReviewSpec) SwaggerDoc() map[string]string { var map_SubjectAccessReviewStatus = map[string]string{ "": "SubjectAccessReviewStatus", - "allowed": "Allowed is required. True if the action would be allowed, false otherwise.", - "denied": "Denied is optional. True if the action would be denied, otherwise false. If both allowed is false and denied is false, then the authorizer has no opinion on whether to authorize the action. Denied may not be true if Allowed is true.", - "reason": "Reason is optional. It indicates why a request was allowed or denied.", - "evaluationError": "EvaluationError is an indication that some error occurred during the authorization check. It is entirely possible to get an error and be able to continue determine authorization status in spite of it. For instance, RBAC can be missing a role, but enough roles are still present and bound to reason about the request.", + "allowed": "allowed is required. True if the action would be allowed, false otherwise.", + "denied": "denied is optional. True if the action would be denied, otherwise false. If both allowed is false and denied is false, then the authorizer has no opinion on whether to authorize the action. Denied may not be true if Allowed is true.", + "reason": "reason is optional. It indicates why a request was allowed or denied.", + "evaluationError": "evaluationError is an indication that some error occurred during the authorization check. It is entirely possible to get an error and be able to continue determine authorization status in spite of it. For instance, RBAC can be missing a role, but enough roles are still present and bound to reason about the request.", } func (SubjectAccessReviewStatus) SwaggerDoc() map[string]string { @@ -187,10 +187,10 @@ func (SubjectAccessReviewStatus) SwaggerDoc() map[string]string { var map_SubjectRulesReviewStatus = map[string]string{ "": "SubjectRulesReviewStatus contains the result of a rules check. This check can be incomplete depending on the set of authorizers the server is configured with and any errors experienced during evaluation. Because authorization rules are additive, if a rule appears in a list it's safe to assume the subject has that permission, even if that list is incomplete.", - "resourceRules": "ResourceRules is the list of actions the subject is allowed to perform on resources. The list ordering isn't significant, may contain duplicates, and possibly be incomplete.", - "nonResourceRules": "NonResourceRules is the list of actions the subject is allowed to perform on non-resources. The list ordering isn't significant, may contain duplicates, and possibly be incomplete.", - "incomplete": "Incomplete is true when the rules returned by this call are incomplete. This is most commonly encountered when an authorizer, such as an external authorizer, doesn't support rules evaluation.", - "evaluationError": "EvaluationError can appear in combination with Rules. It indicates an error occurred during rule evaluation, such as an authorizer that doesn't support rule evaluation, and that ResourceRules and/or NonResourceRules may be incomplete.", + "resourceRules": "resourceRules is the list of actions the subject is allowed to perform on resources. The list ordering isn't significant, may contain duplicates, and possibly be incomplete.", + "nonResourceRules": "nonResourceRules is the list of actions the subject is allowed to perform on non-resources. The list ordering isn't significant, may contain duplicates, and possibly be incomplete.", + "incomplete": "incomplete is true when the rules returned by this call are incomplete. This is most commonly encountered when an authorizer, such as an external authorizer, doesn't support rules evaluation.", + "evaluationError": "evaluationError can appear in combination with Rules. It indicates an error occurred during rule evaluation, such as an authorizer that doesn't support rule evaluation, and that ResourceRules and/or NonResourceRules may be incomplete.", } func (SubjectRulesReviewStatus) SwaggerDoc() map[string]string { diff --git a/apis/vendor/k8s.io/api/core/v1/generated.pb.go b/apis/vendor/k8s.io/api/core/v1/generated.pb.go index b7de1bea54d..0fcbd5edf7b 100644 --- a/apis/vendor/k8s.io/api/core/v1/generated.pb.go +++ b/apis/vendor/k8s.io/api/core/v1/generated.pb.go @@ -196,6 +196,8 @@ func (m *ISCSIVolumeSource) Reset() { *m = ISCSIVolumeSource{} } func (m *ImageVolumeSource) Reset() { *m = ImageVolumeSource{} } +func (m *ImageVolumeStatus) Reset() { *m = ImageVolumeStatus{} } + func (m *KeyToPath) Reset() { *m = KeyToPath{} } func (m *Lifecycle) Reset() { *m = Lifecycle{} } @@ -242,6 +244,8 @@ func (m *NodeAddress) Reset() { *m = NodeAddress{} } func (m *NodeAffinity) Reset() { *m = NodeAffinity{} } +func (m *NodeAllocatableResourceClaimStatus) Reset() { *m = NodeAllocatableResourceClaimStatus{} } + func (m *NodeCondition) Reset() { *m = NodeCondition{} } func (m *NodeConfigSource) Reset() { *m = NodeConfigSource{} } @@ -346,6 +350,8 @@ func (m *PodResourceClaimStatus) Reset() { *m = PodResourceClaimStatus{} } func (m *PodSchedulingGate) Reset() { *m = PodSchedulingGate{} } +func (m *PodSchedulingGroup) Reset() { *m = PodSchedulingGroup{} } + func (m *PodSecurityContext) Reset() { *m = PodSecurityContext{} } func (m *PodSignature) Reset() { *m = PodSignature{} } @@ -504,14 +510,14 @@ func (m *VolumeResourceRequirements) Reset() { *m = VolumeResourceRequirements{} func (m *VolumeSource) Reset() { *m = VolumeSource{} } +func (m *VolumeStatus) Reset() { *m = VolumeStatus{} } + func (m *VsphereVirtualDiskVolumeSource) Reset() { *m = VsphereVirtualDiskVolumeSource{} } func (m *WeightedPodAffinityTerm) Reset() { *m = WeightedPodAffinityTerm{} } func (m *WindowsSecurityContextOptions) Reset() { *m = WindowsSecurityContextOptions{} } -func (m *WorkloadReference) Reset() { *m = WorkloadReference{} } - func (m *AWSElasticBlockStoreVolumeSource) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -5155,6 +5161,34 @@ func (m *ImageVolumeSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *ImageVolumeStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ImageVolumeStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ImageVolumeStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.ImageRef) + copy(dAtA[i:], m.ImageRef) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ImageRef))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *KeyToPath) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -6291,6 +6325,72 @@ func (m *NodeAffinity) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *NodeAllocatableResourceClaimStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NodeAllocatableResourceClaimStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NodeAllocatableResourceClaimStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Resources) > 0 { + keysForResources := make([]string, 0, len(m.Resources)) + for k := range m.Resources { + keysForResources = append(keysForResources, string(k)) + } + sort.Strings(keysForResources) + for iNdEx := len(keysForResources) - 1; iNdEx >= 0; iNdEx-- { + v := m.Resources[ResourceName(keysForResources[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForResources[iNdEx]) + copy(dAtA[i:], keysForResources[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForResources[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1a + } + } + if len(m.Containers) > 0 { + for iNdEx := len(m.Containers) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Containers[iNdEx]) + copy(dAtA[i:], m.Containers[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Containers[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + i -= len(m.ResourceClaimName) + copy(dAtA[i:], m.ResourceClaimName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ResourceClaimName))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *NodeCondition) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -9446,6 +9546,36 @@ func (m *PodSchedulingGate) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *PodSchedulingGroup) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PodSchedulingGroup) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PodSchedulingGroup) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.PodGroupName != nil { + i -= len(*m.PodGroupName) + copy(dAtA[i:], *m.PodGroupName) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.PodGroupName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *PodSecurityContext) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -9639,9 +9769,9 @@ func (m *PodSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.WorkloadRef != nil { + if m.SchedulingGroup != nil { { - size, err := m.WorkloadRef.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.SchedulingGroup.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -9651,7 +9781,7 @@ func (m *PodSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x2 i-- - dAtA[i] = 0xd2 + dAtA[i] = 0xda } if m.HostnameOverride != nil { i -= len(*m.HostnameOverride) @@ -10150,6 +10280,22 @@ func (m *PodStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.NodeAllocatableResourceClaimStatuses) > 0 { + for iNdEx := len(m.NodeAllocatableResourceClaimStatuses) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.NodeAllocatableResourceClaimStatuses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xaa + } + } if m.Resources != nil { { size, err := m.Resources.MarshalToSizedBuffer(dAtA[:i]) @@ -11532,6 +11678,13 @@ func (m *ResourceHealth) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Message != nil { + i -= len(*m.Message) + copy(dAtA[i:], *m.Message) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Message))) + i-- + dAtA[i] = 0x32 + } i -= len(m.Health) copy(dAtA[i:], m.Health) i = encodeVarintGenerated(dAtA, i, uint64(len(m.Health))) @@ -14149,6 +14302,18 @@ func (m *VolumeMountStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.VolumeStatus != nil { + { + size, err := m.VolumeStatus.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } if m.RecursiveReadOnly != nil { i -= len(*m.RecursiveReadOnly) copy(dAtA[i:], *m.RecursiveReadOnly) @@ -14801,6 +14966,41 @@ func (m *VolumeSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *VolumeStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *VolumeStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VolumeStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Image != nil { + { + size, err := m.Image.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *VsphereVirtualDiskVolumeSource) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -14934,44 +15134,6 @@ func (m *WindowsSecurityContextOptions) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } -func (m *WorkloadReference) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *WorkloadReference) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WorkloadReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - i -= len(m.PodGroupReplicaKey) - copy(dAtA[i:], m.PodGroupReplicaKey) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.PodGroupReplicaKey))) - i-- - dAtA[i] = 0x1a - i -= len(m.PodGroup) - copy(dAtA[i:], m.PodGroup) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.PodGroup))) - i-- - dAtA[i] = 0x12 - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { offset -= sovGenerated(v) base := offset @@ -16706,6 +16868,17 @@ func (m *ImageVolumeSource) Size() (n int) { return n } +func (m *ImageVolumeStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ImageRef) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + func (m *KeyToPath) Size() (n int) { if m == nil { return 0 @@ -17123,6 +17296,32 @@ func (m *NodeAffinity) Size() (n int) { return n } +func (m *NodeAllocatableResourceClaimStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ResourceClaimName) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Containers) > 0 { + for _, s := range m.Containers { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Resources) > 0 { + for k, v := range m.Resources { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + return n +} + func (m *NodeCondition) Size() (n int) { if m == nil { return 0 @@ -18296,6 +18495,19 @@ func (m *PodSchedulingGate) Size() (n int) { return n } +func (m *PodSchedulingGroup) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PodGroupName != nil { + l = len(*m.PodGroupName) + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + func (m *PodSecurityContext) Size() (n int) { if m == nil { return 0 @@ -18535,8 +18747,8 @@ func (m *PodSpec) Size() (n int) { l = len(*m.HostnameOverride) n += 2 + l + sovGenerated(uint64(l)) } - if m.WorkloadRef != nil { - l = m.WorkloadRef.Size() + if m.SchedulingGroup != nil { + l = m.SchedulingGroup.Size() n += 2 + l + sovGenerated(uint64(l)) } return n @@ -18628,6 +18840,12 @@ func (m *PodStatus) Size() (n int) { l = m.Resources.Size() n += 2 + l + sovGenerated(uint64(l)) } + if len(m.NodeAllocatableResourceClaimStatuses) > 0 { + for _, e := range m.NodeAllocatableResourceClaimStatuses { + l = e.Size() + n += 2 + l + sovGenerated(uint64(l)) + } + } return n } @@ -19052,6 +19270,10 @@ func (m *ResourceHealth) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) l = len(m.Health) n += 1 + l + sovGenerated(uint64(l)) + if m.Message != nil { + l = len(*m.Message) + n += 1 + l + sovGenerated(uint64(l)) + } return n } @@ -20041,6 +20263,10 @@ func (m *VolumeMountStatus) Size() (n int) { l = len(*m.RecursiveReadOnly) n += 1 + l + sovGenerated(uint64(l)) } + if m.VolumeStatus != nil { + l = m.VolumeStatus.Size() + n += 1 + l + sovGenerated(uint64(l)) + } return n } @@ -20246,6 +20472,19 @@ func (m *VolumeSource) Size() (n int) { return n } +func (m *VolumeStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Image != nil { + l = m.Image.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + func (m *VsphereVirtualDiskVolumeSource) Size() (n int) { if m == nil { return 0 @@ -20299,21 +20538,6 @@ func (m *WindowsSecurityContextOptions) Size() (n int) { return n } -func (m *WorkloadReference) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.PodGroup) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.PodGroupReplicaKey) - n += 1 + l + sovGenerated(uint64(l)) - return n -} - func sovGenerated(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -21595,6 +21819,16 @@ func (this *ImageVolumeSource) String() string { }, "") return s } +func (this *ImageVolumeStatus) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ImageVolumeStatus{`, + `ImageRef:` + fmt.Sprintf("%v", this.ImageRef) + `,`, + `}`, + }, "") + return s +} func (this *KeyToPath) String() string { if this == nil { return "nil" @@ -21951,6 +22185,28 @@ func (this *NodeAffinity) String() string { }, "") return s } +func (this *NodeAllocatableResourceClaimStatus) String() string { + if this == nil { + return "nil" + } + keysForResources := make([]string, 0, len(this.Resources)) + for k := range this.Resources { + keysForResources = append(keysForResources, string(k)) + } + sort.Strings(keysForResources) + mapStringForResources := "map[ResourceName]resource.Quantity{" + for _, k := range keysForResources { + mapStringForResources += fmt.Sprintf("%v: %v,", k, this.Resources[ResourceName(k)]) + } + mapStringForResources += "}" + s := strings.Join([]string{`&NodeAllocatableResourceClaimStatus{`, + `ResourceClaimName:` + fmt.Sprintf("%v", this.ResourceClaimName) + `,`, + `Containers:` + fmt.Sprintf("%v", this.Containers) + `,`, + `Resources:` + mapStringForResources + `,`, + `}`, + }, "") + return s +} func (this *NodeCondition) String() string { if this == nil { return "nil" @@ -22800,6 +23056,16 @@ func (this *PodSchedulingGate) String() string { }, "") return s } +func (this *PodSchedulingGroup) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PodSchedulingGroup{`, + `PodGroupName:` + valueToStringGenerated(this.PodGroupName) + `,`, + `}`, + }, "") + return s +} func (this *PodSecurityContext) String() string { if this == nil { return "nil" @@ -22958,7 +23224,7 @@ func (this *PodSpec) String() string { `ResourceClaims:` + repeatedStringForResourceClaims + `,`, `Resources:` + strings.Replace(this.Resources.String(), "ResourceRequirements", "ResourceRequirements", 1) + `,`, `HostnameOverride:` + valueToStringGenerated(this.HostnameOverride) + `,`, - `WorkloadRef:` + strings.Replace(this.WorkloadRef.String(), "WorkloadReference", "WorkloadReference", 1) + `,`, + `SchedulingGroup:` + strings.Replace(this.SchedulingGroup.String(), "PodSchedulingGroup", "PodSchedulingGroup", 1) + `,`, `}`, }, "") return s @@ -23002,6 +23268,11 @@ func (this *PodStatus) String() string { repeatedStringForHostIPs += strings.Replace(strings.Replace(f.String(), "HostIP", "HostIP", 1), `&`, ``, 1) + "," } repeatedStringForHostIPs += "}" + repeatedStringForNodeAllocatableResourceClaimStatuses := "[]NodeAllocatableResourceClaimStatus{" + for _, f := range this.NodeAllocatableResourceClaimStatuses { + repeatedStringForNodeAllocatableResourceClaimStatuses += strings.Replace(strings.Replace(f.String(), "NodeAllocatableResourceClaimStatus", "NodeAllocatableResourceClaimStatus", 1), `&`, ``, 1) + "," + } + repeatedStringForNodeAllocatableResourceClaimStatuses += "}" keysForAllocatedResources := make([]string, 0, len(this.AllocatedResources)) for k := range this.AllocatedResources { keysForAllocatedResources = append(keysForAllocatedResources, string(k)) @@ -23033,6 +23304,7 @@ func (this *PodStatus) String() string { `ExtendedResourceClaimStatus:` + strings.Replace(this.ExtendedResourceClaimStatus.String(), "PodExtendedResourceClaimStatus", "PodExtendedResourceClaimStatus", 1) + `,`, `AllocatedResources:` + mapStringForAllocatedResources + `,`, `Resources:` + strings.Replace(this.Resources.String(), "ResourceRequirements", "ResourceRequirements", 1) + `,`, + `NodeAllocatableResourceClaimStatuses:` + repeatedStringForNodeAllocatableResourceClaimStatuses + `,`, `}`, }, "") return s @@ -23365,6 +23637,7 @@ func (this *ResourceHealth) String() string { s := strings.Join([]string{`&ResourceHealth{`, `ResourceID:` + fmt.Sprintf("%v", this.ResourceID) + `,`, `Health:` + fmt.Sprintf("%v", this.Health) + `,`, + `Message:` + valueToStringGenerated(this.Message) + `,`, `}`, }, "") return s @@ -24118,6 +24391,7 @@ func (this *VolumeMountStatus) String() string { `MountPath:` + fmt.Sprintf("%v", this.MountPath) + `,`, `ReadOnly:` + fmt.Sprintf("%v", this.ReadOnly) + `,`, `RecursiveReadOnly:` + valueToStringGenerated(this.RecursiveReadOnly) + `,`, + `VolumeStatus:` + strings.Replace(this.VolumeStatus.String(), "VolumeStatus", "VolumeStatus", 1) + `,`, `}`, }, "") return s @@ -24217,6 +24491,16 @@ func (this *VolumeSource) String() string { }, "") return s } +func (this *VolumeStatus) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&VolumeStatus{`, + `Image:` + strings.Replace(this.Image.String(), "ImageVolumeStatus", "ImageVolumeStatus", 1) + `,`, + `}`, + }, "") + return s +} func (this *VsphereVirtualDiskVolumeSource) String() string { if this == nil { return "nil" @@ -24254,18 +24538,6 @@ func (this *WindowsSecurityContextOptions) String() string { }, "") return s } -func (this *WorkloadReference) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&WorkloadReference{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `PodGroup:` + fmt.Sprintf("%v", this.PodGroup) + `,`, - `PodGroupReplicaKey:` + fmt.Sprintf("%v", this.PodGroupReplicaKey) + `,`, - `}`, - }, "") - return s -} func valueToStringGenerated(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { @@ -39166,6 +39438,88 @@ func (m *ImageVolumeSource) Unmarshal(dAtA []byte) error { } return nil } +func (m *ImageVolumeStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ImageVolumeStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ImageVolumeStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ImageRef", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ImageRef = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *KeyToPath) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -42742,6 +43096,249 @@ func (m *NodeAffinity) Unmarshal(dAtA []byte) error { } return nil } +func (m *NodeAllocatableResourceClaimStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NodeAllocatableResourceClaimStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NodeAllocatableResourceClaimStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResourceClaimName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ResourceClaimName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Containers", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Containers = append(m.Containers, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Resources == nil { + m.Resources = make(map[ResourceName]resource.Quantity) + } + var mapkey ResourceName + mapvalue := &resource.Quantity{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = ResourceName(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &resource.Quantity{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Resources[ResourceName(mapkey)] = *mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *NodeCondition) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -52496,7 +53093,155 @@ func (m *PodResourceClaim) Unmarshal(dAtA []byte) error { } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResourceClaimName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.ResourceClaimName = &s + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResourceClaimTemplateName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.ResourceClaimTemplateName = &s + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodResourceClaimStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodResourceClaimStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodResourceClaimStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ResourceClaimName", wireType) } @@ -52529,39 +53274,6 @@ func (m *PodResourceClaim) Unmarshal(dAtA []byte) error { s := string(dAtA[iNdEx:postIndex]) m.ResourceClaimName = &s iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResourceClaimTemplateName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(dAtA[iNdEx:postIndex]) - m.ResourceClaimTemplateName = &s - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -52583,7 +53295,7 @@ func (m *PodResourceClaim) Unmarshal(dAtA []byte) error { } return nil } -func (m *PodResourceClaimStatus) Unmarshal(dAtA []byte) error { +func (m *PodSchedulingGate) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -52606,10 +53318,10 @@ func (m *PodResourceClaimStatus) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PodResourceClaimStatus: wiretype end group for non-group") + return fmt.Errorf("proto: PodSchedulingGate: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PodResourceClaimStatus: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PodSchedulingGate: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -52644,39 +53356,6 @@ func (m *PodResourceClaimStatus) Unmarshal(dAtA []byte) error { } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResourceClaimName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(dAtA[iNdEx:postIndex]) - m.ResourceClaimName = &s - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -52698,7 +53377,7 @@ func (m *PodResourceClaimStatus) Unmarshal(dAtA []byte) error { } return nil } -func (m *PodSchedulingGate) Unmarshal(dAtA []byte) error { +func (m *PodSchedulingGroup) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -52721,15 +53400,15 @@ func (m *PodSchedulingGate) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PodSchedulingGate: wiretype end group for non-group") + return fmt.Errorf("proto: PodSchedulingGroup: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PodSchedulingGate: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PodSchedulingGroup: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PodGroupName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -52757,7 +53436,8 @@ func (m *PodSchedulingGate) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + s := string(dAtA[iNdEx:postIndex]) + m.PodGroupName = &s iNdEx = postIndex default: iNdEx = preIndex @@ -54801,9 +55481,9 @@ func (m *PodSpec) Unmarshal(dAtA []byte) error { s := string(dAtA[iNdEx:postIndex]) m.HostnameOverride = &s iNdEx = postIndex - case 42: + case 43: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field WorkloadRef", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SchedulingGroup", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -54830,10 +55510,10 @@ func (m *PodSpec) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.WorkloadRef == nil { - m.WorkloadRef = &WorkloadReference{} + if m.SchedulingGroup == nil { + m.SchedulingGroup = &PodSchedulingGroup{} } - if err := m.WorkloadRef.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.SchedulingGroup.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -55637,6 +56317,40 @@ func (m *PodStatus) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 21: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeAllocatableResourceClaimStatuses", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NodeAllocatableResourceClaimStatuses = append(m.NodeAllocatableResourceClaimStatuses, NodeAllocatableResourceClaimStatus{}) + if err := m.NodeAllocatableResourceClaimStatuses[len(m.NodeAllocatableResourceClaimStatuses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -59194,13 +59908,159 @@ func (m *ResourceClaim) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Request", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Request = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ResourceFieldSelector) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ResourceFieldSelector: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResourceFieldSelector: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContainerName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContainerName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Resource = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Request", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Divisor", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -59210,23 +60070,24 @@ func (m *ResourceClaim) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Request = string(dAtA[iNdEx:postIndex]) + if err := m.Divisor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -59249,7 +60110,7 @@ func (m *ResourceClaim) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResourceFieldSelector) Unmarshal(dAtA []byte) error { +func (m *ResourceHealth) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -59272,15 +60133,15 @@ func (m *ResourceFieldSelector) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResourceFieldSelector: wiretype end group for non-group") + return fmt.Errorf("proto: ResourceHealth: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResourceFieldSelector: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ResourceHealth: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContainerName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ResourceID", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -59308,126 +60169,11 @@ func (m *ResourceFieldSelector) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ContainerName = string(dAtA[iNdEx:postIndex]) + m.ResourceID = ResourceID(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Resource = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Divisor", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Divisor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ResourceHealth) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ResourceHealth: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ResourceHealth: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResourceID", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Health", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -59455,11 +60201,11 @@ func (m *ResourceHealth) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ResourceID = ResourceID(dAtA[iNdEx:postIndex]) + m.Health = ResourceHealthStatus(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Health", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -59487,7 +60233,8 @@ func (m *ResourceHealth) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Health = ResourceHealthStatus(dAtA[iNdEx:postIndex]) + s := string(dAtA[iNdEx:postIndex]) + m.Message = &s iNdEx = postIndex default: iNdEx = preIndex @@ -68123,6 +68870,42 @@ func (m *VolumeMountStatus) Unmarshal(dAtA []byte) error { s := RecursiveReadOnlyMode(dAtA[iNdEx:postIndex]) m.RecursiveReadOnly = &s iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VolumeStatus", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.VolumeStatus == nil { + m.VolumeStatus = &VolumeStatus{} + } + if err := m.VolumeStatus.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -69690,16 +70473,88 @@ func (m *VolumeSource) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.PortworxVolume == nil { - m.PortworxVolume = &PortworxVolumeSource{} + if m.PortworxVolume == nil { + m.PortworxVolume = &PortworxVolumeSource{} + } + if err := m.PortworxVolume.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 25: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ScaleIO", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ScaleIO == nil { + m.ScaleIO = &ScaleIOVolumeSource{} + } + if err := m.ScaleIO.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 26: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Projected", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Projected == nil { + m.Projected = &ProjectedVolumeSource{} } - if err := m.PortworxVolume.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Projected.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 25: + case 27: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ScaleIO", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field StorageOS", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -69726,16 +70581,16 @@ func (m *VolumeSource) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.ScaleIO == nil { - m.ScaleIO = &ScaleIOVolumeSource{} + if m.StorageOS == nil { + m.StorageOS = &StorageOSVolumeSource{} } - if err := m.ScaleIO.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.StorageOS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 26: + case 28: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Projected", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CSI", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -69762,16 +70617,16 @@ func (m *VolumeSource) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Projected == nil { - m.Projected = &ProjectedVolumeSource{} + if m.CSI == nil { + m.CSI = &CSIVolumeSource{} } - if err := m.Projected.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.CSI.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 27: + case 29: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StorageOS", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Ephemeral", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -69798,16 +70653,16 @@ func (m *VolumeSource) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.StorageOS == nil { - m.StorageOS = &StorageOSVolumeSource{} + if m.Ephemeral == nil { + m.Ephemeral = &EphemeralVolumeSource{} } - if err := m.StorageOS.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Ephemeral.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 28: + case 30: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CSI", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Image", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -69834,50 +70689,64 @@ func (m *VolumeSource) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.CSI == nil { - m.CSI = &CSIVolumeSource{} + if m.Image == nil { + m.Image = &ImageVolumeSource{} } - if err := m.CSI.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Image.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 29: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ephemeral", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err } - postIndex := iNdEx + msglen - if postIndex < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGenerated } - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - if m.Ephemeral == nil { - m.Ephemeral = &EphemeralVolumeSource{} + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *VolumeStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated } - if err := m.Ephemeral.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + if iNdEx >= l { + return io.ErrUnexpectedEOF } - iNdEx = postIndex - case 30: + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: VolumeStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VolumeStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Image", wireType) } @@ -69907,7 +70776,7 @@ func (m *VolumeSource) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Image == nil { - m.Image = &ImageVolumeSource{} + m.Image = &ImageVolumeStatus{} } if err := m.Image.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -70384,152 +71253,6 @@ func (m *WindowsSecurityContextOptions) Unmarshal(dAtA []byte) error { } return nil } -func (m *WorkloadReference) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: WorkloadReference: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WorkloadReference: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PodGroup", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PodGroup = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PodGroupReplicaKey", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PodGroupReplicaKey = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipGenerated(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/apis/vendor/k8s.io/api/core/v1/generated.proto b/apis/vendor/k8s.io/api/core/v1/generated.proto index 570b4d34389..ba4f80e5ec3 100644 --- a/apis/vendor/k8s.io/api/core/v1/generated.proto +++ b/apis/vendor/k8s.io/api/core/v1/generated.proto @@ -1132,7 +1132,6 @@ message ContainerStatus { // AllocatedResources represents the compute resources allocated for this container by the // node. Kubelet sets this value to Container.Resources.Requests upon successful pod admission // and after successfully admitting desired pod resize. - // +featureGate=InPlacePodVerticalScalingAllocatedStatus // +optional map allocatedResources = 10; @@ -2275,6 +2274,16 @@ message ImageVolumeSource { optional string pullPolicy = 2; } +// ImageVolumeStatus represents the image-based volume status. +message ImageVolumeStatus { + // ImageRef is the digest of the image used for this volume. + // It should have a value that's similar to the pod's status.containerStatuses[i].imageID. + // The ImageRef length should not exceed 256 characters. + // +kubebuilder:validation:MaxLength=256 + // +required + optional string imageRef = 1; +} + // Maps a string key to a path within a volume. message KeyToPath { // key is the key to project. @@ -2677,6 +2686,22 @@ message NodeAffinity { repeated PreferredSchedulingTerm preferredDuringSchedulingIgnoredDuringExecution = 2; } +// NodeAllocatableResourceClaimStatus describes the status of node allocatable resources allocated via DRA. +message NodeAllocatableResourceClaimStatus { + // ResourceClaimName is the resource claim referenced by the pod that resulted in this node allocatable resource allocation. + // +required + optional string resourceClaimName = 1; + + // Containers lists the names of all containers in this pod that reference the claim. + // +optional + // +listType=set + repeated string containers = 2; + + // Resources is a map of the node-allocatable resource name to the aggregate quantity allocated to the claim. + // +required + map resources = 3; +} + // NodeCondition contains condition information for a node. message NodeCondition { // Type of node condition. @@ -2812,7 +2837,6 @@ message NodeRuntimeHandlerFeatures { optional bool recursiveReadOnlyMounts = 1; // UserNamespaces is set to true if the runtime handler supports UserNamespaces, including for volumes. - // +featureGate=UserNamespacesSupport // +optional optional bool userNamespaces = 2; } @@ -2974,7 +2998,6 @@ message NodeStatus { optional NodeConfigStatus config = 11; // The available runtime handlers. - // +featureGate=UserNamespacesSupport // +optional // +listType=atomic repeated NodeRuntimeHandler runtimeHandlers = 12; @@ -3528,8 +3551,7 @@ message PersistentVolumeSource { // portworxVolume represents a portworx volume attached and mounted on kubelets host machine. // Deprecated: PortworxVolume is deprecated. All operations for the in-tree portworxVolume type - // are redirected to the pxd.portworx.com CSI driver when the CSIMigrationPortworx feature-gate - // is on. + // are redirected to the pxd.portworx.com CSI driver. // +optional optional PortworxVolumeSource portworxVolume = 18; @@ -3918,8 +3940,6 @@ message PodCondition { optional string type = 1; // If set, this represents the .metadata.generation that the pod condition was set based upon. - // The PodObservedGenerationTracking feature gate must be enabled to use this field. - // +featureGate=PodObservedGenerationTracking // +optional optional int64 observedGeneration = 7; @@ -4153,6 +4173,14 @@ message PodReadinessGate { // // It adds a name to it that uniquely identifies the ResourceClaim inside the Pod. // Containers that need access to the ResourceClaim reference it with this name. +// +// When the DRAWorkloadResourceClaims feature gate is enabled and this Pod +// belongs to a PodGroup, a PodResourceClaim is matched to a +// PodGroupResourceClaim if all of their fields are equal (Name, +// ResourceClaimName, and ResourceClaimTemplateName). A matched claim references +// a single ResourceClaim shared across all Pods in the PodGroup, reserved for +// the PodGroup in ResourceClaimStatus.ReservedFor rather than for individual +// Pods. message PodResourceClaim { // Name uniquely identifies this resource claim inside the pod. // This must be a DNS_LABEL. @@ -4174,6 +4202,16 @@ message PodResourceClaim { // generated component, will be used to form a unique name for the // ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses. // + // When the DRAWorkloadResourceClaims feature gate is enabled and the pod + // belongs to a PodGroup that defines a PodGroupResourceClaim with the same + // Name and ResourceClaimTemplateName, this PodResourceClaim resolves to the + // ResourceClaim generated for the PodGroup. All pods in the group that + // define an equivalent PodResourceClaim matching the + // PodGroupResourceClaim's Name and ResourceClaimTemplateName share the same + // generated ResourceClaim. ResourceClaims generated for a PodGroup are + // owned by the PodGroup and their lifecycles are tied to the PodGroup + // instead of any individual pod. + // // This field is immutable and no changes will be made to the // corresponding ResourceClaim by the control plane after creating the // ResourceClaim. @@ -4193,9 +4231,16 @@ message PodResourceClaimStatus { optional string name = 1; // ResourceClaimName is the name of the ResourceClaim that was - // generated for the Pod in the namespace of the Pod. If this is - // unset, then generating a ResourceClaim was not necessary. The - // pod.spec.resourceClaims entry can be ignored in this case. + // generated for the Pod in the namespace of the Pod. + // + // When the DRAWorkloadResourceClaims feature is enabled and the + // corresponding PodResourceClaim matches a PodGroupResourceClaim + // made by the Pod's PodGroup, then this is the name of the + // ResourceClaim generated and reserved for the PodGroup. + // + // If this is unset, then generating a ResourceClaim was not + // necessary. The pod.spec.resourceClaims entry can be ignored in + // this case. // // +optional optional string resourceClaimName = 2; @@ -4208,6 +4253,20 @@ message PodSchedulingGate { optional string name = 1; } +// PodSchedulingGroup identifies the runtime scheduling group instance that a Pod belongs to. +// The scheduler uses this information to apply workload-aware scheduling semantics. +// Exactly one field must be specified. +// +union +message PodSchedulingGroup { + // PodGroupName specifies the name of the standalone PodGroup object + // that represents the runtime instance of this group. + // Must be a DNS subdomain. + // + // +optional + // +oneOf=GroupSelection + optional string podGroupName = 1; +} + // PodSecurityContext holds pod-level security attributes and common container settings. // Some fields are also present in container.securityContext. Field values of // container.securityContext take precedence over field values of PodSecurityContext. @@ -4669,7 +4728,6 @@ message PodSpec { // When set to false, a new userns is created for the pod. Setting false is useful for // mitigating container breakout vulnerabilities even allowing users to run their // containers as root without actually having root privileges on the host. - // This field is alpha-level and is only honored by servers that enable the UserNamespacesSupport feature. // +k8s:conversion-gen=false // +optional optional bool hostUsers = 37; @@ -4735,17 +4793,22 @@ message PodSpec { // +optional optional string hostnameOverride = 41; - // WorkloadRef provides a reference to the Workload object that this Pod belongs to. - // This field is used by the scheduler to identify the PodGroup and apply the - // correct group scheduling policies. The Workload object referenced - // by this field may not exist at the time the Pod is created. - // This field is immutable, but a Workload object with the same name - // may be recreated with different policies. Doing this during pod scheduling + // SchedulingGroup provides a reference to the immediate scheduling runtime + // grouping object that this Pod belongs to. + // This field is used by the scheduler to identify the group and apply the + // correct group scheduling policies. The association with a group also + // impacts other lifecycle aspects of a Pod that are relevant in a wider context + // of scheduling like preemption, resource attachment, etc. If not specified, + // the Pod is treated as a single unit in all of these aspects. + // The group object referenced by this field may not exist at the time the + // Pod is created. + // This field is immutable, but a group object with the same name may be + // recreated with different policies. Doing this during pod scheduling // may result in the placement not conforming to the expected policies. // // +featureGate=GenericWorkload // +optional - optional WorkloadReference workloadRef = 42; + optional PodSchedulingGroup schedulingGroup = 43; } // PodStatus represents information about the status of a pod. Status may trail the actual @@ -4754,7 +4817,6 @@ message PodSpec { message PodStatus { // If set, this represents the .metadata.generation that the pod status was set based upon. // The PodObservedGenerationTracking feature gate must be enabled to use this field. - // +featureGate=PodObservedGenerationTracking // +optional optional int64 observedGeneration = 17; @@ -4923,6 +4985,16 @@ message PodStatus { // +featureGate=InPlacePodLevelResourcesVerticalScaling // +optional optional ResourceRequirements resources = 20; + + // NodeAllocatableResourceClaimStatuses contains the status of node-allocatable resources + // that were allocated for this pod through DRA claims. This includes resources currently + // reported in v1.Node `status.allocatable` that are not extended resources + // (see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#extended-resources). + // Examples include "cpu", "memory", "ephemeral-storage", and hugepages. + // +featureGate=DRANodeAllocatableResources + // +optional + // +listType=atomic + repeated NodeAllocatableResourceClaimStatus nodeAllocatableResourceClaimStatuses = 21; } // PodStatusResult is a wrapper for PodStatus returned by kubelet that can be encode/decoded @@ -5300,8 +5372,8 @@ message ReplicationController { // be the same as the Pod(s) that the replication controller manages. // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional - // +k8s:subfield(name)=+k8s:optional - // +k8s:subfield(name)=+k8s:format=k8s-long-name + // +k8s:alpha(since: "1.36")=+k8s:subfield(name)=+k8s:optional + // +k8s:alpha(since: "1.36")=+k8s:subfield(name)=+k8s:format=k8s-long-name optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; // Spec defines the specification of the desired behavior of the replication controller. @@ -5358,18 +5430,18 @@ message ReplicationControllerSpec { // Defaults to 1. // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#what-is-a-replicationcontroller // +optional - // +k8s:optional + // +k8s:alpha(since: "1.36")=+k8s:optional // +default=1 - // +k8s:minimum=0 + // +k8s:alpha(since: "1.36")=+k8s:minimum=0 optional int32 replicas = 1; // Minimum number of seconds for which a newly created pod should be ready // without any of its container crashing, for it to be considered available. // Defaults to 0 (pod will be considered available as soon as it is ready) // +optional - // +k8s:optional + // +k8s:alpha(since: "1.36")=+k8s:optional // +default=0 - // +k8s:minimum=0 + // +k8s:alpha(since: "1.36")=+k8s:minimum=0 optional int32 minReadySeconds = 4; // Selector is a label query over pods that should match the Replicas count. @@ -5468,6 +5540,12 @@ message ResourceHealth { // // In future we may want to introduce the PermanentlyUnhealthy Status. optional string health = 2; + + // Message provides human-readable context for Health (e.g. "ECC error count exceeded threshold"). + // This field is populated by the kubelet when ResourceHealthStatusMessage is enabled if the DRA plugin returns a message, and is null otherwise. + // +featureGate=ResourceHealthStatusMessage + // +optional + optional string message = 6; } // ResourceQuota sets aggregate quota restrictions enforced per namespace @@ -5970,7 +6048,6 @@ message SecurityContext { // procMount denotes the type of proc mount to use for the containers. // The default value is Default which uses the container runtime defaults for // readonly paths and masked paths. - // This requires the ProcMountType feature flag to be enabled. // Note that this field cannot be set when spec.os.name is windows. // +optional optional string procMount = 9; @@ -6885,6 +6962,11 @@ message VolumeMountStatus { // depending on the mount result. // +optional optional string recursiveReadOnly = 4; + + // volumeStatus represents volume-type-specific status about the mounted + // volume. + // +optional + optional VolumeStatus volumeStatus = 5; } // VolumeNodeAffinity defines constraints that limit what nodes this volume can be accessed from. @@ -7126,8 +7208,7 @@ message VolumeSource { // portworxVolume represents a portworx volume attached and mounted on kubelets host machine. // Deprecated: PortworxVolume is deprecated. All operations for the in-tree portworxVolume type - // are redirected to the pxd.portworx.com CSI driver when the CSIMigrationPortworx feature-gate - // is on. + // are redirected to the pxd.portworx.com CSI driver. // +optional optional PortworxVolumeSource portworxVolume = 24; @@ -7184,14 +7265,22 @@ message VolumeSource { // A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message. // The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field. // The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images. - // The volume will be mounted read-only (ro) and non-executable files (noexec). + // The volume will be mounted read-only (ro). // Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath) before 1.33. // The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type. - // +featureGate=ImageVolume // +optional optional ImageVolumeSource image = 30; } +// VolumeStatus represents the status of a mounted volume. +// At most one of its members must be specified. +message VolumeStatus { + // image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine. + // +featureGate=ImageVolumeWithDigest + // +optional + optional ImageVolumeStatus image = 1; +} + // Represents a vSphere volume resource. message VsphereVirtualDiskVolumeSource { // volumePath is the path that identifies vSphere volume vmdk @@ -7249,33 +7338,3 @@ message WindowsSecurityContextOptions { optional bool hostProcess = 4; } -// WorkloadReference identifies the Workload object and PodGroup membership -// that a Pod belongs to. The scheduler uses this information to apply -// workload-aware scheduling semantics. -message WorkloadReference { - // Name defines the name of the Workload object this Pod belongs to. - // Workload must be in the same namespace as the Pod. - // If it doesn't match any existing Workload, the Pod will remain unschedulable - // until a Workload object is created and observed by the kube-scheduler. - // It must be a DNS subdomain. - // - // +required - optional string name = 1; - - // PodGroup is the name of the PodGroup within the Workload that this Pod - // belongs to. If it doesn't match any existing PodGroup within the Workload, - // the Pod will remain unschedulable until the Workload object is recreated - // and observed by the kube-scheduler. It must be a DNS label. - // - // +required - optional string podGroup = 2; - - // PodGroupReplicaKey specifies the replica key of the PodGroup to which this - // Pod belongs. It is used to distinguish pods belonging to different replicas - // of the same pod group. The pod group policy is applied separately to each replica. - // When set, it must be a DNS label. - // - // +optional - optional string podGroupReplicaKey = 3; -} - diff --git a/apis/vendor/k8s.io/api/core/v1/generated.protomessage.pb.go b/apis/vendor/k8s.io/api/core/v1/generated.protomessage.pb.go deleted file mode 100644 index cf74ffa0885..00000000000 --- a/apis/vendor/k8s.io/api/core/v1/generated.protomessage.pb.go +++ /dev/null @@ -1,498 +0,0 @@ -//go:build kubernetes_protomessage_one_more_release -// +build kubernetes_protomessage_one_more_release - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by go-to-protobuf. DO NOT EDIT. - -package v1 - -func (*AWSElasticBlockStoreVolumeSource) ProtoMessage() {} - -func (*Affinity) ProtoMessage() {} - -func (*AppArmorProfile) ProtoMessage() {} - -func (*AttachedVolume) ProtoMessage() {} - -func (*AvoidPods) ProtoMessage() {} - -func (*AzureDiskVolumeSource) ProtoMessage() {} - -func (*AzureFilePersistentVolumeSource) ProtoMessage() {} - -func (*AzureFileVolumeSource) ProtoMessage() {} - -func (*Binding) ProtoMessage() {} - -func (*CSIPersistentVolumeSource) ProtoMessage() {} - -func (*CSIVolumeSource) ProtoMessage() {} - -func (*Capabilities) ProtoMessage() {} - -func (*CephFSPersistentVolumeSource) ProtoMessage() {} - -func (*CephFSVolumeSource) ProtoMessage() {} - -func (*CinderPersistentVolumeSource) ProtoMessage() {} - -func (*CinderVolumeSource) ProtoMessage() {} - -func (*ClientIPConfig) ProtoMessage() {} - -func (*ClusterTrustBundleProjection) ProtoMessage() {} - -func (*ComponentCondition) ProtoMessage() {} - -func (*ComponentStatus) ProtoMessage() {} - -func (*ComponentStatusList) ProtoMessage() {} - -func (*ConfigMap) ProtoMessage() {} - -func (*ConfigMapEnvSource) ProtoMessage() {} - -func (*ConfigMapKeySelector) ProtoMessage() {} - -func (*ConfigMapList) ProtoMessage() {} - -func (*ConfigMapNodeConfigSource) ProtoMessage() {} - -func (*ConfigMapProjection) ProtoMessage() {} - -func (*ConfigMapVolumeSource) ProtoMessage() {} - -func (*Container) ProtoMessage() {} - -func (*ContainerExtendedResourceRequest) ProtoMessage() {} - -func (*ContainerImage) ProtoMessage() {} - -func (*ContainerPort) ProtoMessage() {} - -func (*ContainerResizePolicy) ProtoMessage() {} - -func (*ContainerRestartRule) ProtoMessage() {} - -func (*ContainerRestartRuleOnExitCodes) ProtoMessage() {} - -func (*ContainerState) ProtoMessage() {} - -func (*ContainerStateRunning) ProtoMessage() {} - -func (*ContainerStateTerminated) ProtoMessage() {} - -func (*ContainerStateWaiting) ProtoMessage() {} - -func (*ContainerStatus) ProtoMessage() {} - -func (*ContainerUser) ProtoMessage() {} - -func (*DaemonEndpoint) ProtoMessage() {} - -func (*DownwardAPIProjection) ProtoMessage() {} - -func (*DownwardAPIVolumeFile) ProtoMessage() {} - -func (*DownwardAPIVolumeSource) ProtoMessage() {} - -func (*EmptyDirVolumeSource) ProtoMessage() {} - -func (*EndpointAddress) ProtoMessage() {} - -func (*EndpointPort) ProtoMessage() {} - -func (*EndpointSubset) ProtoMessage() {} - -func (*Endpoints) ProtoMessage() {} - -func (*EndpointsList) ProtoMessage() {} - -func (*EnvFromSource) ProtoMessage() {} - -func (*EnvVar) ProtoMessage() {} - -func (*EnvVarSource) ProtoMessage() {} - -func (*EphemeralContainer) ProtoMessage() {} - -func (*EphemeralContainerCommon) ProtoMessage() {} - -func (*EphemeralVolumeSource) ProtoMessage() {} - -func (*Event) ProtoMessage() {} - -func (*EventList) ProtoMessage() {} - -func (*EventSeries) ProtoMessage() {} - -func (*EventSource) ProtoMessage() {} - -func (*ExecAction) ProtoMessage() {} - -func (*FCVolumeSource) ProtoMessage() {} - -func (*FileKeySelector) ProtoMessage() {} - -func (*FlexPersistentVolumeSource) ProtoMessage() {} - -func (*FlexVolumeSource) ProtoMessage() {} - -func (*FlockerVolumeSource) ProtoMessage() {} - -func (*GCEPersistentDiskVolumeSource) ProtoMessage() {} - -func (*GRPCAction) ProtoMessage() {} - -func (*GitRepoVolumeSource) ProtoMessage() {} - -func (*GlusterfsPersistentVolumeSource) ProtoMessage() {} - -func (*GlusterfsVolumeSource) ProtoMessage() {} - -func (*HTTPGetAction) ProtoMessage() {} - -func (*HTTPHeader) ProtoMessage() {} - -func (*HostAlias) ProtoMessage() {} - -func (*HostIP) ProtoMessage() {} - -func (*HostPathVolumeSource) ProtoMessage() {} - -func (*ISCSIPersistentVolumeSource) ProtoMessage() {} - -func (*ISCSIVolumeSource) ProtoMessage() {} - -func (*ImageVolumeSource) ProtoMessage() {} - -func (*KeyToPath) ProtoMessage() {} - -func (*Lifecycle) ProtoMessage() {} - -func (*LifecycleHandler) ProtoMessage() {} - -func (*LimitRange) ProtoMessage() {} - -func (*LimitRangeItem) ProtoMessage() {} - -func (*LimitRangeList) ProtoMessage() {} - -func (*LimitRangeSpec) ProtoMessage() {} - -func (*LinuxContainerUser) ProtoMessage() {} - -func (*List) ProtoMessage() {} - -func (*LoadBalancerIngress) ProtoMessage() {} - -func (*LoadBalancerStatus) ProtoMessage() {} - -func (*LocalObjectReference) ProtoMessage() {} - -func (*LocalVolumeSource) ProtoMessage() {} - -func (*ModifyVolumeStatus) ProtoMessage() {} - -func (*NFSVolumeSource) ProtoMessage() {} - -func (*Namespace) ProtoMessage() {} - -func (*NamespaceCondition) ProtoMessage() {} - -func (*NamespaceList) ProtoMessage() {} - -func (*NamespaceSpec) ProtoMessage() {} - -func (*NamespaceStatus) ProtoMessage() {} - -func (*Node) ProtoMessage() {} - -func (*NodeAddress) ProtoMessage() {} - -func (*NodeAffinity) ProtoMessage() {} - -func (*NodeCondition) ProtoMessage() {} - -func (*NodeConfigSource) ProtoMessage() {} - -func (*NodeConfigStatus) ProtoMessage() {} - -func (*NodeDaemonEndpoints) ProtoMessage() {} - -func (*NodeFeatures) ProtoMessage() {} - -func (*NodeList) ProtoMessage() {} - -func (*NodeProxyOptions) ProtoMessage() {} - -func (*NodeRuntimeHandler) ProtoMessage() {} - -func (*NodeRuntimeHandlerFeatures) ProtoMessage() {} - -func (*NodeSelector) ProtoMessage() {} - -func (*NodeSelectorRequirement) ProtoMessage() {} - -func (*NodeSelectorTerm) ProtoMessage() {} - -func (*NodeSpec) ProtoMessage() {} - -func (*NodeStatus) ProtoMessage() {} - -func (*NodeSwapStatus) ProtoMessage() {} - -func (*NodeSystemInfo) ProtoMessage() {} - -func (*ObjectFieldSelector) ProtoMessage() {} - -func (*ObjectReference) ProtoMessage() {} - -func (*PersistentVolume) ProtoMessage() {} - -func (*PersistentVolumeClaim) ProtoMessage() {} - -func (*PersistentVolumeClaimCondition) ProtoMessage() {} - -func (*PersistentVolumeClaimList) ProtoMessage() {} - -func (*PersistentVolumeClaimSpec) ProtoMessage() {} - -func (*PersistentVolumeClaimStatus) ProtoMessage() {} - -func (*PersistentVolumeClaimTemplate) ProtoMessage() {} - -func (*PersistentVolumeClaimVolumeSource) ProtoMessage() {} - -func (*PersistentVolumeList) ProtoMessage() {} - -func (*PersistentVolumeSource) ProtoMessage() {} - -func (*PersistentVolumeSpec) ProtoMessage() {} - -func (*PersistentVolumeStatus) ProtoMessage() {} - -func (*PhotonPersistentDiskVolumeSource) ProtoMessage() {} - -func (*Pod) ProtoMessage() {} - -func (*PodAffinity) ProtoMessage() {} - -func (*PodAffinityTerm) ProtoMessage() {} - -func (*PodAntiAffinity) ProtoMessage() {} - -func (*PodAttachOptions) ProtoMessage() {} - -func (*PodCertificateProjection) ProtoMessage() {} - -func (*PodCondition) ProtoMessage() {} - -func (*PodDNSConfig) ProtoMessage() {} - -func (*PodDNSConfigOption) ProtoMessage() {} - -func (*PodExecOptions) ProtoMessage() {} - -func (*PodExtendedResourceClaimStatus) ProtoMessage() {} - -func (*PodIP) ProtoMessage() {} - -func (*PodList) ProtoMessage() {} - -func (*PodLogOptions) ProtoMessage() {} - -func (*PodOS) ProtoMessage() {} - -func (*PodPortForwardOptions) ProtoMessage() {} - -func (*PodProxyOptions) ProtoMessage() {} - -func (*PodReadinessGate) ProtoMessage() {} - -func (*PodResourceClaim) ProtoMessage() {} - -func (*PodResourceClaimStatus) ProtoMessage() {} - -func (*PodSchedulingGate) ProtoMessage() {} - -func (*PodSecurityContext) ProtoMessage() {} - -func (*PodSignature) ProtoMessage() {} - -func (*PodSpec) ProtoMessage() {} - -func (*PodStatus) ProtoMessage() {} - -func (*PodStatusResult) ProtoMessage() {} - -func (*PodTemplate) ProtoMessage() {} - -func (*PodTemplateList) ProtoMessage() {} - -func (*PodTemplateSpec) ProtoMessage() {} - -func (*PortStatus) ProtoMessage() {} - -func (*PortworxVolumeSource) ProtoMessage() {} - -func (*Preconditions) ProtoMessage() {} - -func (*PreferAvoidPodsEntry) ProtoMessage() {} - -func (*PreferredSchedulingTerm) ProtoMessage() {} - -func (*Probe) ProtoMessage() {} - -func (*ProbeHandler) ProtoMessage() {} - -func (*ProjectedVolumeSource) ProtoMessage() {} - -func (*QuobyteVolumeSource) ProtoMessage() {} - -func (*RBDPersistentVolumeSource) ProtoMessage() {} - -func (*RBDVolumeSource) ProtoMessage() {} - -func (*RangeAllocation) ProtoMessage() {} - -func (*ReplicationController) ProtoMessage() {} - -func (*ReplicationControllerCondition) ProtoMessage() {} - -func (*ReplicationControllerList) ProtoMessage() {} - -func (*ReplicationControllerSpec) ProtoMessage() {} - -func (*ReplicationControllerStatus) ProtoMessage() {} - -func (*ResourceClaim) ProtoMessage() {} - -func (*ResourceFieldSelector) ProtoMessage() {} - -func (*ResourceHealth) ProtoMessage() {} - -func (*ResourceQuota) ProtoMessage() {} - -func (*ResourceQuotaList) ProtoMessage() {} - -func (*ResourceQuotaSpec) ProtoMessage() {} - -func (*ResourceQuotaStatus) ProtoMessage() {} - -func (*ResourceRequirements) ProtoMessage() {} - -func (*ResourceStatus) ProtoMessage() {} - -func (*SELinuxOptions) ProtoMessage() {} - -func (*ScaleIOPersistentVolumeSource) ProtoMessage() {} - -func (*ScaleIOVolumeSource) ProtoMessage() {} - -func (*ScopeSelector) ProtoMessage() {} - -func (*ScopedResourceSelectorRequirement) ProtoMessage() {} - -func (*SeccompProfile) ProtoMessage() {} - -func (*Secret) ProtoMessage() {} - -func (*SecretEnvSource) ProtoMessage() {} - -func (*SecretKeySelector) ProtoMessage() {} - -func (*SecretList) ProtoMessage() {} - -func (*SecretProjection) ProtoMessage() {} - -func (*SecretReference) ProtoMessage() {} - -func (*SecretVolumeSource) ProtoMessage() {} - -func (*SecurityContext) ProtoMessage() {} - -func (*SerializedReference) ProtoMessage() {} - -func (*Service) ProtoMessage() {} - -func (*ServiceAccount) ProtoMessage() {} - -func (*ServiceAccountList) ProtoMessage() {} - -func (*ServiceAccountTokenProjection) ProtoMessage() {} - -func (*ServiceList) ProtoMessage() {} - -func (*ServicePort) ProtoMessage() {} - -func (*ServiceProxyOptions) ProtoMessage() {} - -func (*ServiceSpec) ProtoMessage() {} - -func (*ServiceStatus) ProtoMessage() {} - -func (*SessionAffinityConfig) ProtoMessage() {} - -func (*SleepAction) ProtoMessage() {} - -func (*StorageOSPersistentVolumeSource) ProtoMessage() {} - -func (*StorageOSVolumeSource) ProtoMessage() {} - -func (*Sysctl) ProtoMessage() {} - -func (*TCPSocketAction) ProtoMessage() {} - -func (*Taint) ProtoMessage() {} - -func (*Toleration) ProtoMessage() {} - -func (*TopologySelectorLabelRequirement) ProtoMessage() {} - -func (*TopologySelectorTerm) ProtoMessage() {} - -func (*TopologySpreadConstraint) ProtoMessage() {} - -func (*TypedLocalObjectReference) ProtoMessage() {} - -func (*TypedObjectReference) ProtoMessage() {} - -func (*Volume) ProtoMessage() {} - -func (*VolumeDevice) ProtoMessage() {} - -func (*VolumeMount) ProtoMessage() {} - -func (*VolumeMountStatus) ProtoMessage() {} - -func (*VolumeNodeAffinity) ProtoMessage() {} - -func (*VolumeProjection) ProtoMessage() {} - -func (*VolumeResourceRequirements) ProtoMessage() {} - -func (*VolumeSource) ProtoMessage() {} - -func (*VsphereVirtualDiskVolumeSource) ProtoMessage() {} - -func (*WeightedPodAffinityTerm) ProtoMessage() {} - -func (*WindowsSecurityContextOptions) ProtoMessage() {} - -func (*WorkloadReference) ProtoMessage() {} diff --git a/apis/vendor/k8s.io/api/core/v1/types.go b/apis/vendor/k8s.io/api/core/v1/types.go index 705c82083cc..ac0494f3c51 100644 --- a/apis/vendor/k8s.io/api/core/v1/types.go +++ b/apis/vendor/k8s.io/api/core/v1/types.go @@ -161,8 +161,7 @@ type VolumeSource struct { Projected *ProjectedVolumeSource `json:"projected,omitempty" protobuf:"bytes,26,opt,name=projected"` // portworxVolume represents a portworx volume attached and mounted on kubelets host machine. // Deprecated: PortworxVolume is deprecated. All operations for the in-tree portworxVolume type - // are redirected to the pxd.portworx.com CSI driver when the CSIMigrationPortworx feature-gate - // is on. + // are redirected to the pxd.portworx.com CSI driver. // +optional PortworxVolume *PortworxVolumeSource `json:"portworxVolume,omitempty" protobuf:"bytes,24,opt,name=portworxVolume"` // scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes. @@ -214,10 +213,9 @@ type VolumeSource struct { // A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message. // The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field. // The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images. - // The volume will be mounted read-only (ro) and non-executable files (noexec). + // The volume will be mounted read-only (ro). // Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath) before 1.33. // The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type. - // +featureGate=ImageVolume // +optional Image *ImageVolumeSource `json:"image,omitempty" protobuf:"bytes,30,opt,name=image"` } @@ -325,8 +323,7 @@ type PersistentVolumeSource struct { PhotonPersistentDisk *PhotonPersistentDiskVolumeSource `json:"photonPersistentDisk,omitempty" protobuf:"bytes,17,opt,name=photonPersistentDisk"` // portworxVolume represents a portworx volume attached and mounted on kubelets host machine. // Deprecated: PortworxVolume is deprecated. All operations for the in-tree portworxVolume type - // are redirected to the pxd.portworx.com CSI driver when the CSIMigrationPortworx feature-gate - // is on. + // are redirected to the pxd.portworx.com CSI driver. // +optional PortworxVolume *PortworxVolumeSource `json:"portworxVolume,omitempty" protobuf:"bytes,18,opt,name=portworxVolume"` // scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes. @@ -672,6 +669,17 @@ const ( PersistentVolumeClaimVolumeModifyVolumeError PersistentVolumeClaimConditionType = "ModifyVolumeError" // Volume is being modified PersistentVolumeClaimVolumeModifyingVolume PersistentVolumeClaimConditionType = "ModifyingVolume" + + // PersistentVolumeClaimUnused indicates whether the PVC is currently not in use by any Pod. + // When status is True, the PVC is not referenced by any non-terminal Pod. + // The lastTransitionTime indicates when the PVC last transitioned to being unused. + // + // Both in-use time and unused time duration indicated by this condition may be shorter or + // slightly longer than actual in-use time or unused time because of processing delays or + // when this feature was enabled in the cluster. + // + // Requires PersistentVolumeClaimUnusedSinceTime alpha featuregate + PersistentVolumeClaimUnused PersistentVolumeClaimConditionType = "Unused" ) // +enum @@ -3363,7 +3371,6 @@ type ContainerStatus struct { // AllocatedResources represents the compute resources allocated for this container by the // node. Kubelet sets this value to Container.Resources.Requests upon successful pod admission // and after successfully admitting desired pod resize. - // +featureGate=InPlacePodVerticalScalingAllocatedStatus // +optional AllocatedResources ResourceList `json:"allocatedResources,omitempty" protobuf:"bytes,10,rep,name=allocatedResources,casttype=ResourceList,castkey=ResourceName"` // Resources represents the compute resource requests and limits that have been successfully @@ -3421,6 +3428,10 @@ const ( ResourceHealthStatusUnknown ResourceHealthStatus = "Unknown" ) +// ResourceHealthMessageMaxLength is the maximum length for ResourceHealth.Message field. +// Messages longer than this will be truncated with "..." appended. +const ResourceHealthMessageMaxLength = 1024 + // ResourceID is calculated based on the source of this resource health information. // For DevicePlugin: // @@ -3448,6 +3459,11 @@ type ResourceHealth struct { // // In future we may want to introduce the PermanentlyUnhealthy Status. Health ResourceHealthStatus `json:"health,omitempty" protobuf:"bytes,2,name=health"` + // Message provides human-readable context for Health (e.g. "ECC error count exceeded threshold"). + // This field is populated by the kubelet when ResourceHealthStatusMessage is enabled if the DRA plugin returns a message, and is null otherwise. + // +featureGate=ResourceHealthStatusMessage + // +optional + Message *string `json:"message,omitempty" protobuf:"bytes,6,opt,name=message"` } // ContainerUser represents user identity information @@ -3575,8 +3591,6 @@ type PodCondition struct { // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions Type PodConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=PodConditionType"` // If set, this represents the .metadata.generation that the pod condition was set based upon. - // The PodObservedGenerationTracking feature gate must be enabled to use this field. - // +featureGate=PodObservedGenerationTracking // +optional ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,7,opt,name=observedGeneration"` // Status is the status of the condition. @@ -3623,6 +3637,29 @@ type VolumeMountStatus struct { // depending on the mount result. // +optional RecursiveReadOnly *RecursiveReadOnlyMode `json:"recursiveReadOnly,omitempty" protobuf:"bytes,4,opt,name=recursiveReadOnly,casttype=RecursiveReadOnlyMode"` + // volumeStatus represents volume-type-specific status about the mounted + // volume. + // +optional + VolumeStatus *VolumeStatus `json:"volumeStatus,omitempty" protobuf:"bytes,5,opt,name=volumeStatus"` +} + +// VolumeStatus represents the status of a mounted volume. +// At most one of its members must be specified. +type VolumeStatus struct { + // image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine. + // +featureGate=ImageVolumeWithDigest + // +optional + Image *ImageVolumeStatus `json:"image,omitempty" protobuf:"bytes,1,opt,name=image"` +} + +// ImageVolumeStatus represents the image-based volume status. +type ImageVolumeStatus struct { + // ImageRef is the digest of the image used for this volume. + // It should have a value that's similar to the pod's status.containerStatuses[i].imageID. + // The ImageRef length should not exceed 256 characters. + // +kubebuilder:validation:MaxLength=256 + // +required + ImageRef string `json:"imageRef,omitempty" protobuf:"bytes,1,opt,name=imageRef"` } // RestartPolicy describes how the container should be restarted. @@ -4378,7 +4415,6 @@ type PodSpec struct { // When set to false, a new userns is created for the pod. Setting false is useful for // mitigating container breakout vulnerabilities even allowing users to run their // containers as root without actually having root privileges on the host. - // This field is alpha-level and is only honored by servers that enable the UserNamespacesSupport feature. // +k8s:conversion-gen=false // +optional HostUsers *bool `json:"hostUsers,omitempty" protobuf:"bytes,37,opt,name=hostUsers"` @@ -4440,17 +4476,27 @@ type PodSpec struct { // +featureGate=HostnameOverride // +optional HostnameOverride *string `json:"hostnameOverride,omitempty" protobuf:"bytes,41,opt,name=hostnameOverride"` - // WorkloadRef provides a reference to the Workload object that this Pod belongs to. - // This field is used by the scheduler to identify the PodGroup and apply the - // correct group scheduling policies. The Workload object referenced - // by this field may not exist at the time the Pod is created. - // This field is immutable, but a Workload object with the same name - // may be recreated with different policies. Doing this during pod scheduling + + // WorkloadRef is tombstoned to show why 42 is a reserved protobuf tag. + // This field got replaced with the SchedulingGroup field in Kubernetes 1.36. + // WorkloadRef *WorkloadReference `json:"workloadRef,omitempty" protobuf:"bytes,42,opt,name=workloadRef"` + + // SchedulingGroup provides a reference to the immediate scheduling runtime + // grouping object that this Pod belongs to. + // This field is used by the scheduler to identify the group and apply the + // correct group scheduling policies. The association with a group also + // impacts other lifecycle aspects of a Pod that are relevant in a wider context + // of scheduling like preemption, resource attachment, etc. If not specified, + // the Pod is treated as a single unit in all of these aspects. + // The group object referenced by this field may not exist at the time the + // Pod is created. + // This field is immutable, but a group object with the same name may be + // recreated with different policies. Doing this during pod scheduling // may result in the placement not conforming to the expected policies. // // +featureGate=GenericWorkload // +optional - WorkloadRef *WorkloadReference `json:"workloadRef,omitempty" protobuf:"bytes,42,opt,name=workloadRef"` + SchedulingGroup *PodSchedulingGroup `json:"schedulingGroup,omitempty" protobuf:"bytes,43,opt,name=schedulingGroup"` } // PodResourceClaim references exactly one ResourceClaim, either directly @@ -4459,6 +4505,14 @@ type PodSpec struct { // // It adds a name to it that uniquely identifies the ResourceClaim inside the Pod. // Containers that need access to the ResourceClaim reference it with this name. +// +// When the DRAWorkloadResourceClaims feature gate is enabled and this Pod +// belongs to a PodGroup, a PodResourceClaim is matched to a +// PodGroupResourceClaim if all of their fields are equal (Name, +// ResourceClaimName, and ResourceClaimTemplateName). A matched claim references +// a single ResourceClaim shared across all Pods in the PodGroup, reserved for +// the PodGroup in ResourceClaimStatus.ReservedFor rather than for individual +// Pods. type PodResourceClaim struct { // Name uniquely identifies this resource claim inside the pod. // This must be a DNS_LABEL. @@ -4485,6 +4539,16 @@ type PodResourceClaim struct { // generated component, will be used to form a unique name for the // ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses. // + // When the DRAWorkloadResourceClaims feature gate is enabled and the pod + // belongs to a PodGroup that defines a PodGroupResourceClaim with the same + // Name and ResourceClaimTemplateName, this PodResourceClaim resolves to the + // ResourceClaim generated for the PodGroup. All pods in the group that + // define an equivalent PodResourceClaim matching the + // PodGroupResourceClaim's Name and ResourceClaimTemplateName share the same + // generated ResourceClaim. ResourceClaims generated for a PodGroup are + // owned by the PodGroup and their lifecycles are tied to the PodGroup + // instead of any individual pod. + // // This field is immutable and no changes will be made to the // corresponding ResourceClaim by the control plane after creating the // ResourceClaim. @@ -4504,9 +4568,16 @@ type PodResourceClaimStatus struct { Name string `json:"name" protobuf:"bytes,1,name=name"` // ResourceClaimName is the name of the ResourceClaim that was - // generated for the Pod in the namespace of the Pod. If this is - // unset, then generating a ResourceClaim was not necessary. The - // pod.spec.resourceClaims entry can be ignored in this case. + // generated for the Pod in the namespace of the Pod. + // + // When the DRAWorkloadResourceClaims feature is enabled and the + // corresponding PodResourceClaim matches a PodGroupResourceClaim + // made by the Pod's PodGroup, then this is the name of the + // ResourceClaim generated and reserved for the PodGroup. + // + // If this is unset, then generating a ResourceClaim was not + // necessary. The pod.spec.resourceClaims entry can be ignored in + // this case. // // +optional ResourceClaimName *string `json:"resourceClaimName,omitempty" protobuf:"bytes,2,opt,name=resourceClaimName"` @@ -4562,34 +4633,18 @@ type PodSchedulingGate struct { Name string `json:"name" protobuf:"bytes,1,opt,name=name"` } -// WorkloadReference identifies the Workload object and PodGroup membership -// that a Pod belongs to. The scheduler uses this information to apply -// workload-aware scheduling semantics. -type WorkloadReference struct { - // Name defines the name of the Workload object this Pod belongs to. - // Workload must be in the same namespace as the Pod. - // If it doesn't match any existing Workload, the Pod will remain unschedulable - // until a Workload object is created and observed by the kube-scheduler. - // It must be a DNS subdomain. - // - // +required - Name string `json:"name" protobuf:"bytes,1,opt,name=name"` - - // PodGroup is the name of the PodGroup within the Workload that this Pod - // belongs to. If it doesn't match any existing PodGroup within the Workload, - // the Pod will remain unschedulable until the Workload object is recreated - // and observed by the kube-scheduler. It must be a DNS label. - // - // +required - PodGroup string `json:"podGroup" protobuf:"bytes,2,opt,name=podGroup"` - - // PodGroupReplicaKey specifies the replica key of the PodGroup to which this - // Pod belongs. It is used to distinguish pods belonging to different replicas - // of the same pod group. The pod group policy is applied separately to each replica. - // When set, it must be a DNS label. +// PodSchedulingGroup identifies the runtime scheduling group instance that a Pod belongs to. +// The scheduler uses this information to apply workload-aware scheduling semantics. +// Exactly one field must be specified. +// +union +type PodSchedulingGroup struct { + // PodGroupName specifies the name of the standalone PodGroup object + // that represents the runtime instance of this group. + // Must be a DNS subdomain. // // +optional - PodGroupReplicaKey string `json:"podGroupReplicaKey,omitempty" protobuf:"bytes,3,opt,name=podGroupReplicaKey"` + // +oneOf=GroupSelection + PodGroupName *string `json:"podGroupName,omitempty" protobuf:"bytes,1,opt,name=podGroupName"` } // +enum @@ -5251,7 +5306,6 @@ type EphemeralContainer struct { type PodStatus struct { // If set, this represents the .metadata.generation that the pod status was set based upon. // The PodObservedGenerationTracking feature gate must be enabled to use this field. - // +featureGate=PodObservedGenerationTracking // +optional ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,17,opt,name=observedGeneration"` // The phase of a Pod is a simple, high-level summary of where the Pod is in its lifecycle. @@ -5414,6 +5468,16 @@ type PodStatus struct { // +featureGate=InPlacePodLevelResourcesVerticalScaling // +optional Resources *ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,20,opt,name=resources"` + + // NodeAllocatableResourceClaimStatuses contains the status of node-allocatable resources + // that were allocated for this pod through DRA claims. This includes resources currently + // reported in v1.Node `status.allocatable` that are not extended resources + // (see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#extended-resources). + // Examples include "cpu", "memory", "ephemeral-storage", and hugepages. + // +featureGate=DRANodeAllocatableResources + // +optional + // +listType=atomic + NodeAllocatableResourceClaimStatuses []NodeAllocatableResourceClaimStatus `json:"nodeAllocatableResourceClaimStatuses,omitempty" protobuf:"bytes,21,rep,name=nodeAllocatableResourceClaimStatuses"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -5533,18 +5597,18 @@ type ReplicationControllerSpec struct { // Defaults to 1. // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#what-is-a-replicationcontroller // +optional - // +k8s:optional + // +k8s:alpha(since: "1.36")=+k8s:optional // +default=1 - // +k8s:minimum=0 + // +k8s:alpha(since: "1.36")=+k8s:minimum=0 Replicas *int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"` // Minimum number of seconds for which a newly created pod should be ready // without any of its container crashing, for it to be considered available. // Defaults to 0 (pod will be considered available as soon as it is ready) // +optional - // +k8s:optional + // +k8s:alpha(since: "1.36")=+k8s:optional // +default=0 - // +k8s:minimum=0 + // +k8s:alpha(since: "1.36")=+k8s:minimum=0 MinReadySeconds int32 `json:"minReadySeconds,omitempty" protobuf:"varint,4,opt,name=minReadySeconds"` // Selector is a label query over pods that should match the Replicas count. @@ -5634,7 +5698,7 @@ type ReplicationControllerCondition struct { // +genclient:method=UpdateScale,verb=update,subresource=scale,input=k8s.io/api/autoscaling/v1.Scale,result=k8s.io/api/autoscaling/v1.Scale // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:prerelease-lifecycle-gen:introduced=1.0 -// +k8s:supportsSubresource=/scale +// +k8s:supportsSubresource="/scale" // ReplicationController represents the configuration of a replication controller. type ReplicationController struct { @@ -5644,8 +5708,8 @@ type ReplicationController struct { // be the same as the Pod(s) that the replication controller manages. // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional - // +k8s:subfield(name)=+k8s:optional - // +k8s:subfield(name)=+k8s:format=k8s-long-name + // +k8s:alpha(since: "1.36")=+k8s:subfield(name)=+k8s:optional + // +k8s:alpha(since: "1.36")=+k8s:subfield(name)=+k8s:format=k8s-long-name metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` // Spec defines the specification of the desired behavior of the replication controller. @@ -6585,7 +6649,6 @@ type NodeRuntimeHandlerFeatures struct { // +optional RecursiveReadOnlyMounts *bool `json:"recursiveReadOnlyMounts,omitempty" protobuf:"varint,1,opt,name=recursiveReadOnlyMounts"` // UserNamespaces is set to true if the runtime handler supports UserNamespaces, including for volumes. - // +featureGate=UserNamespacesSupport // +optional UserNamespaces *bool `json:"userNamespaces,omitempty" protobuf:"varint,2,opt,name=userNamespaces"` } @@ -6756,7 +6819,6 @@ type NodeStatus struct { // +optional Config *NodeConfigStatus `json:"config,omitempty" protobuf:"bytes,11,opt,name=config"` // The available runtime handlers. - // +featureGate=UserNamespacesSupport // +optional // +listType=atomic RuntimeHandlers []NodeRuntimeHandler `json:"runtimeHandlers,omitempty" protobuf:"bytes,12,rep,name=runtimeHandlers"` @@ -8247,7 +8309,6 @@ type SecurityContext struct { // procMount denotes the type of proc mount to use for the containers. // The default value is Default which uses the container runtime defaults for // readonly paths and masked paths. - // This requires the ProcMountType feature flag to be enabled. // Note that this field cannot be set when spec.os.name is windows. // +optional ProcMount *ProcMountType `json:"procMount,omitempty" protobuf:"bytes,9,opt,name=procMount"` @@ -8452,3 +8513,17 @@ type ImageVolumeSource struct { // +optional PullPolicy PullPolicy `json:"pullPolicy,omitempty" protobuf:"bytes,2,opt,name=pullPolicy,casttype=PullPolicy"` } + +// NodeAllocatableResourceClaimStatus describes the status of node allocatable resources allocated via DRA. +type NodeAllocatableResourceClaimStatus struct { + // ResourceClaimName is the resource claim referenced by the pod that resulted in this node allocatable resource allocation. + // +required + ResourceClaimName string `json:"resourceClaimName" protobuf:"bytes,1,opt,name=resourceClaimName"` + // Containers lists the names of all containers in this pod that reference the claim. + // +optional + // +listType=set + Containers []string `json:"containers,omitempty" protobuf:"bytes,2,rep,name=containers"` + // Resources is a map of the node-allocatable resource name to the aggregate quantity allocated to the claim. + // +required + Resources map[ResourceName]resource.Quantity `json:"resources" protobuf:"bytes,3,rep,name=resources"` +} diff --git a/apis/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go b/apis/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go index 0f5e44e917a..97eb5ceec3a 100644 --- a/apis/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go +++ b/apis/vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go @@ -992,6 +992,15 @@ func (ImageVolumeSource) SwaggerDoc() map[string]string { return map_ImageVolumeSource } +var map_ImageVolumeStatus = map[string]string{ + "": "ImageVolumeStatus represents the image-based volume status.", + "imageRef": "ImageRef is the digest of the image used for this volume. It should have a value that's similar to the pod's status.containerStatuses[i].imageID. The ImageRef length should not exceed 256 characters.", +} + +func (ImageVolumeStatus) SwaggerDoc() map[string]string { + return map_ImageVolumeStatus +} + var map_KeyToPath = map[string]string{ "": "Maps a string key to a path within a volume.", "key": "key is the key to project.", @@ -1225,6 +1234,17 @@ func (NodeAffinity) SwaggerDoc() map[string]string { return map_NodeAffinity } +var map_NodeAllocatableResourceClaimStatus = map[string]string{ + "": "NodeAllocatableResourceClaimStatus describes the status of node allocatable resources allocated via DRA.", + "resourceClaimName": "ResourceClaimName is the resource claim referenced by the pod that resulted in this node allocatable resource allocation.", + "containers": "Containers lists the names of all containers in this pod that reference the claim.", + "resources": "Resources is a map of the node-allocatable resource name to the aggregate quantity allocated to the claim.", +} + +func (NodeAllocatableResourceClaimStatus) SwaggerDoc() map[string]string { + return map_NodeAllocatableResourceClaimStatus +} + var map_NodeCondition = map[string]string{ "": "NodeCondition contains condition information for a node.", "type": "Type of node condition.", @@ -1565,7 +1585,7 @@ var map_PersistentVolumeSource = map[string]string{ "quobyte": "quobyte represents a Quobyte mount on the host that shares a pod's lifetime. Deprecated: Quobyte is deprecated and the in-tree quobyte type is no longer supported.", "azureDisk": "azureDisk represents an Azure Data Disk mount on the host and bind mount to the pod. Deprecated: AzureDisk is deprecated. All operations for the in-tree azureDisk type are redirected to the disk.csi.azure.com CSI driver.", "photonPersistentDisk": "photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine. Deprecated: PhotonPersistentDisk is deprecated and the in-tree photonPersistentDisk type is no longer supported.", - "portworxVolume": "portworxVolume represents a portworx volume attached and mounted on kubelets host machine. Deprecated: PortworxVolume is deprecated. All operations for the in-tree portworxVolume type are redirected to the pxd.portworx.com CSI driver when the CSIMigrationPortworx feature-gate is on.", + "portworxVolume": "portworxVolume represents a portworx volume attached and mounted on kubelets host machine. Deprecated: PortworxVolume is deprecated. All operations for the in-tree portworxVolume type are redirected to the pxd.portworx.com CSI driver.", "scaleIO": "scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes. Deprecated: ScaleIO is deprecated and the in-tree scaleIO type is no longer supported.", "local": "local represents directly-attached storage with node affinity", "storageos": "storageOS represents a StorageOS volume that is attached to the kubelet's host machine and mounted into the pod. Deprecated: StorageOS is deprecated and the in-tree storageos type is no longer supported. More info: https://examples.k8s.io/volumes/storageos/README.md", @@ -1691,7 +1711,7 @@ func (PodCertificateProjection) SwaggerDoc() map[string]string { var map_PodCondition = map[string]string{ "": "PodCondition contains details for the current condition of this pod.", "type": "Type is the type of the condition. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions", - "observedGeneration": "If set, this represents the .metadata.generation that the pod condition was set based upon. The PodObservedGenerationTracking feature gate must be enabled to use this field.", + "observedGeneration": "If set, this represents the .metadata.generation that the pod condition was set based upon.", "status": "Status is the status of the condition. Can be True, False, Unknown. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions", "lastProbeTime": "Last time we probed the condition.", "lastTransitionTime": "Last time the condition transitioned from one status to another.", @@ -1822,10 +1842,10 @@ func (PodReadinessGate) SwaggerDoc() map[string]string { } var map_PodResourceClaim = map[string]string{ - "": "PodResourceClaim references exactly one ResourceClaim, either directly or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim for the pod.\n\nIt adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name.", + "": "PodResourceClaim references exactly one ResourceClaim, either directly or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim for the pod.\n\nIt adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name.\n\nWhen the DRAWorkloadResourceClaims feature gate is enabled and this Pod belongs to a PodGroup, a PodResourceClaim is matched to a PodGroupResourceClaim if all of their fields are equal (Name, ResourceClaimName, and ResourceClaimTemplateName). A matched claim references a single ResourceClaim shared across all Pods in the PodGroup, reserved for the PodGroup in ResourceClaimStatus.ReservedFor rather than for individual Pods.", "name": "Name uniquely identifies this resource claim inside the pod. This must be a DNS_LABEL.", "resourceClaimName": "ResourceClaimName is the name of a ResourceClaim object in the same namespace as this pod.\n\nExactly one of ResourceClaimName and ResourceClaimTemplateName must be set.", - "resourceClaimTemplateName": "ResourceClaimTemplateName is the name of a ResourceClaimTemplate object in the same namespace as this pod.\n\nThe template will be used to create a new ResourceClaim, which will be bound to this pod. When this pod is deleted, the ResourceClaim will also be deleted. The pod name and resource name, along with a generated component, will be used to form a unique name for the ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.\n\nThis field is immutable and no changes will be made to the corresponding ResourceClaim by the control plane after creating the ResourceClaim.\n\nExactly one of ResourceClaimName and ResourceClaimTemplateName must be set.", + "resourceClaimTemplateName": "ResourceClaimTemplateName is the name of a ResourceClaimTemplate object in the same namespace as this pod.\n\nThe template will be used to create a new ResourceClaim, which will be bound to this pod. When this pod is deleted, the ResourceClaim will also be deleted. The pod name and resource name, along with a generated component, will be used to form a unique name for the ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.\n\nWhen the DRAWorkloadResourceClaims feature gate is enabled and the pod belongs to a PodGroup that defines a PodGroupResourceClaim with the same Name and ResourceClaimTemplateName, this PodResourceClaim resolves to the ResourceClaim generated for the PodGroup. All pods in the group that define an equivalent PodResourceClaim matching the PodGroupResourceClaim's Name and ResourceClaimTemplateName share the same generated ResourceClaim. ResourceClaims generated for a PodGroup are owned by the PodGroup and their lifecycles are tied to the PodGroup instead of any individual pod.\n\nThis field is immutable and no changes will be made to the corresponding ResourceClaim by the control plane after creating the ResourceClaim.\n\nExactly one of ResourceClaimName and ResourceClaimTemplateName must be set.", } func (PodResourceClaim) SwaggerDoc() map[string]string { @@ -1835,7 +1855,7 @@ func (PodResourceClaim) SwaggerDoc() map[string]string { var map_PodResourceClaimStatus = map[string]string{ "": "PodResourceClaimStatus is stored in the PodStatus for each PodResourceClaim which references a ResourceClaimTemplate. It stores the generated name for the corresponding ResourceClaim.", "name": "Name uniquely identifies this resource claim inside the pod. This must match the name of an entry in pod.spec.resourceClaims, which implies that the string must be a DNS_LABEL.", - "resourceClaimName": "ResourceClaimName is the name of the ResourceClaim that was generated for the Pod in the namespace of the Pod. If this is unset, then generating a ResourceClaim was not necessary. The pod.spec.resourceClaims entry can be ignored in this case.", + "resourceClaimName": "ResourceClaimName is the name of the ResourceClaim that was generated for the Pod in the namespace of the Pod.\n\nWhen the DRAWorkloadResourceClaims feature is enabled and the corresponding PodResourceClaim matches a PodGroupResourceClaim made by the Pod's PodGroup, then this is the name of the ResourceClaim generated and reserved for the PodGroup.\n\nIf this is unset, then generating a ResourceClaim was not necessary. The pod.spec.resourceClaims entry can be ignored in this case.", } func (PodResourceClaimStatus) SwaggerDoc() map[string]string { @@ -1851,6 +1871,15 @@ func (PodSchedulingGate) SwaggerDoc() map[string]string { return map_PodSchedulingGate } +var map_PodSchedulingGroup = map[string]string{ + "": "PodSchedulingGroup identifies the runtime scheduling group instance that a Pod belongs to. The scheduler uses this information to apply workload-aware scheduling semantics. Exactly one field must be specified.", + "podGroupName": "PodGroupName specifies the name of the standalone PodGroup object that represents the runtime instance of this group. Must be a DNS subdomain.", +} + +func (PodSchedulingGroup) SwaggerDoc() map[string]string { + return map_PodSchedulingGroup +} + var map_PodSecurityContext = map[string]string{ "": "PodSecurityContext holds pod-level security attributes and common container settings. Some fields are also present in container.securityContext. Field values of container.securityContext take precedence over field values of PodSecurityContext.", "seLinuxOptions": "The SELinux context to be applied to all containers. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows.", @@ -1919,12 +1948,12 @@ var map_PodSpec = map[string]string{ "topologySpreadConstraints": "TopologySpreadConstraints describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. All topologySpreadConstraints are ANDed.", "setHostnameAsFQDN": "If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false.", "os": "Specifies the OS of the containers in the pod. Some pod and container fields are restricted if this is set.\n\nIf the OS field is set to linux, the following fields must be unset: -securityContext.windowsOptions\n\nIf the OS field is set to windows, following fields must be unset: - spec.hostPID - spec.hostIPC - spec.hostUsers - spec.resources - spec.securityContext.appArmorProfile - spec.securityContext.seLinuxOptions - spec.securityContext.seccompProfile - spec.securityContext.fsGroup - spec.securityContext.fsGroupChangePolicy - spec.securityContext.sysctls - spec.shareProcessNamespace - spec.securityContext.runAsUser - spec.securityContext.runAsGroup - spec.securityContext.supplementalGroups - spec.securityContext.supplementalGroupsPolicy - spec.containers[*].securityContext.appArmorProfile - spec.containers[*].securityContext.seLinuxOptions - spec.containers[*].securityContext.seccompProfile - spec.containers[*].securityContext.capabilities - spec.containers[*].securityContext.readOnlyRootFilesystem - spec.containers[*].securityContext.privileged - spec.containers[*].securityContext.allowPrivilegeEscalation - spec.containers[*].securityContext.procMount - spec.containers[*].securityContext.runAsUser - spec.containers[*].securityContext.runAsGroup", - "hostUsers": "Use the host's user namespace. Optional: Default to true. If set to true or not present, the pod will be run in the host user namespace, useful for when the pod needs a feature only available to the host user namespace, such as loading a kernel module with CAP_SYS_MODULE. When set to false, a new userns is created for the pod. Setting false is useful for mitigating container breakout vulnerabilities even allowing users to run their containers as root without actually having root privileges on the host. This field is alpha-level and is only honored by servers that enable the UserNamespacesSupport feature.", + "hostUsers": "Use the host's user namespace. Optional: Default to true. If set to true or not present, the pod will be run in the host user namespace, useful for when the pod needs a feature only available to the host user namespace, such as loading a kernel module with CAP_SYS_MODULE. When set to false, a new userns is created for the pod. Setting false is useful for mitigating container breakout vulnerabilities even allowing users to run their containers as root without actually having root privileges on the host.", "schedulingGates": "SchedulingGates is an opaque list of values that if specified will block scheduling the pod. If schedulingGates is not empty, the pod will stay in the SchedulingGated state and the scheduler will not attempt to schedule the pod.\n\nSchedulingGates can only be set at pod creation time, and be removed only afterwards.", "resourceClaims": "ResourceClaims defines which ResourceClaims must be allocated and reserved before the Pod is allowed to start. The resources will be made available to those containers which consume them by name.\n\nThis is a stable field but requires that the DynamicResourceAllocation feature gate is enabled.\n\nThis field is immutable.", "resources": "Resources is the total amount of CPU and Memory resources required by all containers in the pod. It supports specifying Requests and Limits for \"cpu\", \"memory\" and \"hugepages-\" resource names only. ResourceClaims are not supported.\n\nThis field enables fine-grained control over resource allocation for the entire pod, allowing resource sharing among containers in a pod.\n\nThis is an alpha field and requires enabling the PodLevelResources feature gate.", "hostnameOverride": "HostnameOverride specifies an explicit override for the pod's hostname as perceived by the pod. This field only specifies the pod's hostname and does not affect its DNS records. When this field is set to a non-empty string: - It takes precedence over the values set in `hostname` and `subdomain`. - The Pod's hostname will be set to this value. - `setHostnameAsFQDN` must be nil or set to false. - `hostNetwork` must be set to false.\n\nThis field must be a valid DNS subdomain as defined in RFC 1123 and contain at most 64 characters. Requires the HostnameOverride feature gate to be enabled.", - "workloadRef": "WorkloadRef provides a reference to the Workload object that this Pod belongs to. This field is used by the scheduler to identify the PodGroup and apply the correct group scheduling policies. The Workload object referenced by this field may not exist at the time the Pod is created. This field is immutable, but a Workload object with the same name may be recreated with different policies. Doing this during pod scheduling may result in the placement not conforming to the expected policies.", + "schedulingGroup": "SchedulingGroup provides a reference to the immediate scheduling runtime grouping object that this Pod belongs to. This field is used by the scheduler to identify the group and apply the correct group scheduling policies. The association with a group also impacts other lifecycle aspects of a Pod that are relevant in a wider context of scheduling like preemption, resource attachment, etc. If not specified, the Pod is treated as a single unit in all of these aspects. The group object referenced by this field may not exist at the time the Pod is created. This field is immutable, but a group object with the same name may be recreated with different policies. Doing this during pod scheduling may result in the placement not conforming to the expected policies.", } func (PodSpec) SwaggerDoc() map[string]string { @@ -1932,27 +1961,28 @@ func (PodSpec) SwaggerDoc() map[string]string { } var map_PodStatus = map[string]string{ - "": "PodStatus represents information about the status of a pod. Status may trail the actual state of a system, especially if the node that hosts the pod cannot contact the control plane.", - "observedGeneration": "If set, this represents the .metadata.generation that the pod status was set based upon. The PodObservedGenerationTracking feature gate must be enabled to use this field.", - "phase": "The phase of a Pod is a simple, high-level summary of where the Pod is in its lifecycle. The conditions array, the reason and message fields, and the individual container status arrays contain more detail about the pod's status. There are five possible phase values:\n\nPending: The pod has been accepted by the Kubernetes system, but one or more of the container images has not been created. This includes time before being scheduled as well as time spent downloading images over the network, which could take a while. Running: The pod has been bound to a node, and all of the containers have been created. At least one container is still running, or is in the process of starting or restarting. Succeeded: All containers in the pod have terminated in success, and will not be restarted. Failed: All containers in the pod have terminated, and at least one container has terminated in failure. The container either exited with non-zero status or was terminated by the system. Unknown: For some reason the state of the pod could not be obtained, typically due to an error in communicating with the host of the pod.\n\nMore info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-phase", - "conditions": "Current service state of pod. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions", - "message": "A human readable message indicating details about why the pod is in this condition.", - "reason": "A brief CamelCase message indicating details about why the pod is in this state. e.g. 'Evicted'", - "nominatedNodeName": "nominatedNodeName is set only when this pod preempts other pods on the node, but it cannot be scheduled right away as preemption victims receive their graceful termination periods. This field does not guarantee that the pod will be scheduled on this node. Scheduler may decide to place the pod elsewhere if other nodes become available sooner. Scheduler may also decide to give the resources on this node to a higher priority pod that is created after preemption. As a result, this field may be different than PodSpec.nodeName when the pod is scheduled.", - "hostIP": "hostIP holds the IP address of the host to which the pod is assigned. Empty if the pod has not started yet. A pod can be assigned to a node that has a problem in kubelet which in turns mean that HostIP will not be updated even if there is a node is assigned to pod", - "hostIPs": "hostIPs holds the IP addresses allocated to the host. If this field is specified, the first entry must match the hostIP field. This list is empty if the pod has not started yet. A pod can be assigned to a node that has a problem in kubelet which in turns means that HostIPs will not be updated even if there is a node is assigned to this pod.", - "podIP": "podIP address allocated to the pod. Routable at least within the cluster. Empty if not yet allocated.", - "podIPs": "podIPs holds the IP addresses allocated to the pod. If this field is specified, the 0th entry must match the podIP field. Pods may be allocated at most 1 value for each of IPv4 and IPv6. This list is empty if no IPs have been allocated yet.", - "startTime": "RFC 3339 date and time at which the object was acknowledged by the Kubelet. This is before the Kubelet pulled the container image(s) for the pod.", - "initContainerStatuses": "Statuses of init containers in this pod. The most recent successful non-restartable init container will have ready = true, the most recently started container will have startTime set. Each init container in the pod should have at most one status in this list, and all statuses should be for containers in the pod. However this is not enforced. If a status for a non-existent container is present in the list, or the list has duplicate names, the behavior of various Kubernetes components is not defined and those statuses might be ignored. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-and-container-status", - "containerStatuses": "Statuses of containers in this pod. Each container in the pod should have at most one status in this list, and all statuses should be for containers in the pod. However this is not enforced. If a status for a non-existent container is present in the list, or the list has duplicate names, the behavior of various Kubernetes components is not defined and those statuses might be ignored. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-and-container-status", - "qosClass": "The Quality of Service (QOS) classification assigned to the pod based on resource requirements See PodQOSClass type for available QOS classes More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-qos/#quality-of-service-classes", - "ephemeralContainerStatuses": "Statuses for any ephemeral containers that have run in this pod. Each ephemeral container in the pod should have at most one status in this list, and all statuses should be for containers in the pod. However this is not enforced. If a status for a non-existent container is present in the list, or the list has duplicate names, the behavior of various Kubernetes components is not defined and those statuses might be ignored. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-and-container-status", - "resize": "Status of resources resize desired for pod's containers. It is empty if no resources resize is pending. Any changes to container resources will automatically set this to \"Proposed\" Deprecated: Resize status is moved to two pod conditions PodResizePending and PodResizeInProgress. PodResizePending will track states where the spec has been resized, but the Kubelet has not yet allocated the resources. PodResizeInProgress will track in-progress resizes, and should be present whenever allocated resources != acknowledged resources.", - "resourceClaimStatuses": "Status of resource claims.", - "extendedResourceClaimStatus": "Status of extended resource claim backed by DRA.", - "allocatedResources": "AllocatedResources is the total requests allocated for this pod by the node. If pod-level requests are not set, this will be the total requests aggregated across containers in the pod.", - "resources": "Resources represents the compute resource requests and limits that have been applied at the pod level if pod-level requests or limits are set in PodSpec.Resources", + "": "PodStatus represents information about the status of a pod. Status may trail the actual state of a system, especially if the node that hosts the pod cannot contact the control plane.", + "observedGeneration": "If set, this represents the .metadata.generation that the pod status was set based upon. The PodObservedGenerationTracking feature gate must be enabled to use this field.", + "phase": "The phase of a Pod is a simple, high-level summary of where the Pod is in its lifecycle. The conditions array, the reason and message fields, and the individual container status arrays contain more detail about the pod's status. There are five possible phase values:\n\nPending: The pod has been accepted by the Kubernetes system, but one or more of the container images has not been created. This includes time before being scheduled as well as time spent downloading images over the network, which could take a while. Running: The pod has been bound to a node, and all of the containers have been created. At least one container is still running, or is in the process of starting or restarting. Succeeded: All containers in the pod have terminated in success, and will not be restarted. Failed: All containers in the pod have terminated, and at least one container has terminated in failure. The container either exited with non-zero status or was terminated by the system. Unknown: For some reason the state of the pod could not be obtained, typically due to an error in communicating with the host of the pod.\n\nMore info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-phase", + "conditions": "Current service state of pod. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions", + "message": "A human readable message indicating details about why the pod is in this condition.", + "reason": "A brief CamelCase message indicating details about why the pod is in this state. e.g. 'Evicted'", + "nominatedNodeName": "nominatedNodeName is set only when this pod preempts other pods on the node, but it cannot be scheduled right away as preemption victims receive their graceful termination periods. This field does not guarantee that the pod will be scheduled on this node. Scheduler may decide to place the pod elsewhere if other nodes become available sooner. Scheduler may also decide to give the resources on this node to a higher priority pod that is created after preemption. As a result, this field may be different than PodSpec.nodeName when the pod is scheduled.", + "hostIP": "hostIP holds the IP address of the host to which the pod is assigned. Empty if the pod has not started yet. A pod can be assigned to a node that has a problem in kubelet which in turns mean that HostIP will not be updated even if there is a node is assigned to pod", + "hostIPs": "hostIPs holds the IP addresses allocated to the host. If this field is specified, the first entry must match the hostIP field. This list is empty if the pod has not started yet. A pod can be assigned to a node that has a problem in kubelet which in turns means that HostIPs will not be updated even if there is a node is assigned to this pod.", + "podIP": "podIP address allocated to the pod. Routable at least within the cluster. Empty if not yet allocated.", + "podIPs": "podIPs holds the IP addresses allocated to the pod. If this field is specified, the 0th entry must match the podIP field. Pods may be allocated at most 1 value for each of IPv4 and IPv6. This list is empty if no IPs have been allocated yet.", + "startTime": "RFC 3339 date and time at which the object was acknowledged by the Kubelet. This is before the Kubelet pulled the container image(s) for the pod.", + "initContainerStatuses": "Statuses of init containers in this pod. The most recent successful non-restartable init container will have ready = true, the most recently started container will have startTime set. Each init container in the pod should have at most one status in this list, and all statuses should be for containers in the pod. However this is not enforced. If a status for a non-existent container is present in the list, or the list has duplicate names, the behavior of various Kubernetes components is not defined and those statuses might be ignored. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-and-container-status", + "containerStatuses": "Statuses of containers in this pod. Each container in the pod should have at most one status in this list, and all statuses should be for containers in the pod. However this is not enforced. If a status for a non-existent container is present in the list, or the list has duplicate names, the behavior of various Kubernetes components is not defined and those statuses might be ignored. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-and-container-status", + "qosClass": "The Quality of Service (QOS) classification assigned to the pod based on resource requirements See PodQOSClass type for available QOS classes More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-qos/#quality-of-service-classes", + "ephemeralContainerStatuses": "Statuses for any ephemeral containers that have run in this pod. Each ephemeral container in the pod should have at most one status in this list, and all statuses should be for containers in the pod. However this is not enforced. If a status for a non-existent container is present in the list, or the list has duplicate names, the behavior of various Kubernetes components is not defined and those statuses might be ignored. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-and-container-status", + "resize": "Status of resources resize desired for pod's containers. It is empty if no resources resize is pending. Any changes to container resources will automatically set this to \"Proposed\" Deprecated: Resize status is moved to two pod conditions PodResizePending and PodResizeInProgress. PodResizePending will track states where the spec has been resized, but the Kubelet has not yet allocated the resources. PodResizeInProgress will track in-progress resizes, and should be present whenever allocated resources != acknowledged resources.", + "resourceClaimStatuses": "Status of resource claims.", + "extendedResourceClaimStatus": "Status of extended resource claim backed by DRA.", + "allocatedResources": "AllocatedResources is the total requests allocated for this pod by the node. If pod-level requests are not set, this will be the total requests aggregated across containers in the pod.", + "resources": "Resources represents the compute resource requests and limits that have been applied at the pod level if pod-level requests or limits are set in PodSpec.Resources", + "nodeAllocatableResourceClaimStatuses": "NodeAllocatableResourceClaimStatuses contains the status of node-allocatable resources that were allocated for this pod through DRA claims. This includes resources currently reported in v1.Node `status.allocatable` that are not extended resources (see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#extended-resources). Examples include \"cpu\", \"memory\", \"ephemeral-storage\", and hugepages.", } func (PodStatus) SwaggerDoc() map[string]string { @@ -2230,6 +2260,7 @@ var map_ResourceHealth = map[string]string{ "": "ResourceHealth represents the health of a resource. It has the latest device health information. This is a part of KEP https://kep.k8s.io/4680.", "resourceID": "ResourceID is the unique identifier of the resource. See the ResourceID type for more information.", "health": "Health of the resource. can be one of:\n - Healthy: operates as normal\n - Unhealthy: reported unhealthy. We consider this a temporary health issue\n since we do not have a mechanism today to distinguish\n temporary and permanent issues.\n - Unknown: The status cannot be determined.\n For example, Device Plugin got unregistered and hasn't been re-registered since.\n\nIn future we may want to introduce the PermanentlyUnhealthy Status.", + "message": "Message provides human-readable context for Health (e.g. \"ECC error count exceeded threshold\"). This field is populated by the kubelet when ResourceHealthStatusMessage is enabled if the DRA plugin returns a message, and is null otherwise.", } func (ResourceHealth) SwaggerDoc() map[string]string { @@ -2462,7 +2493,7 @@ var map_SecurityContext = map[string]string{ "runAsNonRoot": "Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.", "readOnlyRootFilesystem": "Whether this container has a read-only root filesystem. Default is false. Note that this field cannot be set when spec.os.name is windows.", "allowPrivilegeEscalation": "AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN Note that this field cannot be set when spec.os.name is windows.", - "procMount": "procMount denotes the type of proc mount to use for the containers. The default value is Default which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows.", + "procMount": "procMount denotes the type of proc mount to use for the containers. The default value is Default which uses the container runtime defaults for readonly paths and masked paths. Note that this field cannot be set when spec.os.name is windows.", "seccompProfile": "The seccomp options to use by this container. If seccomp options are provided at both the pod & container level, the container options override the pod options. Note that this field cannot be set when spec.os.name is windows.", "appArmorProfile": "appArmorProfile is the AppArmor options to use by this container. If set, this profile overrides the pod's appArmorProfile. Note that this field cannot be set when spec.os.name is windows.", } @@ -2782,6 +2813,7 @@ var map_VolumeMountStatus = map[string]string{ "mountPath": "MountPath corresponds to the original VolumeMount.", "readOnly": "ReadOnly corresponds to the original VolumeMount.", "recursiveReadOnly": "RecursiveReadOnly must be set to Disabled, Enabled, or unspecified (for non-readonly mounts). An IfPossible value in the original VolumeMount must be translated to Disabled or Enabled, depending on the mount result.", + "volumeStatus": "volumeStatus represents volume-type-specific status about the mounted volume.", } func (VolumeMountStatus) SwaggerDoc() map[string]string { @@ -2847,18 +2879,27 @@ var map_VolumeSource = map[string]string{ "azureDisk": "azureDisk represents an Azure Data Disk mount on the host and bind mount to the pod. Deprecated: AzureDisk is deprecated. All operations for the in-tree azureDisk type are redirected to the disk.csi.azure.com CSI driver.", "photonPersistentDisk": "photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine. Deprecated: PhotonPersistentDisk is deprecated and the in-tree photonPersistentDisk type is no longer supported.", "projected": "projected items for all in one resources secrets, configmaps, and downward API", - "portworxVolume": "portworxVolume represents a portworx volume attached and mounted on kubelets host machine. Deprecated: PortworxVolume is deprecated. All operations for the in-tree portworxVolume type are redirected to the pxd.portworx.com CSI driver when the CSIMigrationPortworx feature-gate is on.", + "portworxVolume": "portworxVolume represents a portworx volume attached and mounted on kubelets host machine. Deprecated: PortworxVolume is deprecated. All operations for the in-tree portworxVolume type are redirected to the pxd.portworx.com CSI driver.", "scaleIO": "scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes. Deprecated: ScaleIO is deprecated and the in-tree scaleIO type is no longer supported.", "storageos": "storageOS represents a StorageOS volume attached and mounted on Kubernetes nodes. Deprecated: StorageOS is deprecated and the in-tree storageos type is no longer supported.", "csi": "csi (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers.", "ephemeral": "ephemeral represents a volume that is handled by a cluster storage driver. The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, and deleted when the pod is removed.\n\nUse this if: a) the volume is only needed while the pod runs, b) features of normal volumes like restoring from snapshot or capacity\n tracking are needed,\nc) the storage driver is specified through a storage class, and d) the storage driver supports dynamic volume provisioning through\n a PersistentVolumeClaim (see EphemeralVolumeSource for more\n information on the connection between this volume type\n and PersistentVolumeClaim).\n\nUse PersistentVolumeClaim or one of the vendor-specific APIs for volumes that persist for longer than the lifecycle of an individual pod.\n\nUse CSI for light-weight local ephemeral volumes if the CSI driver is meant to be used that way - see the documentation of the driver for more information.\n\nA pod can use both types of ephemeral volumes and persistent volumes at the same time.", - "image": "image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine. The volume is resolved at pod startup depending on which PullPolicy value is provided:\n\n- Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. - Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. - IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.\n\nThe volume gets re-resolved if the pod gets deleted and recreated, which means that new remote content will become available on pod recreation. A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message. The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field. The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images. The volume will be mounted read-only (ro) and non-executable files (noexec). Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath) before 1.33. The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type.", + "image": "image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine. The volume is resolved at pod startup depending on which PullPolicy value is provided:\n\n- Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. - Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. - IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.\n\nThe volume gets re-resolved if the pod gets deleted and recreated, which means that new remote content will become available on pod recreation. A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message. The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field. The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images. The volume will be mounted read-only (ro). Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath) before 1.33. The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type.", } func (VolumeSource) SwaggerDoc() map[string]string { return map_VolumeSource } +var map_VolumeStatus = map[string]string{ + "": "VolumeStatus represents the status of a mounted volume. At most one of its members must be specified.", + "image": "image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine.", +} + +func (VolumeStatus) SwaggerDoc() map[string]string { + return map_VolumeStatus +} + var map_VsphereVirtualDiskVolumeSource = map[string]string{ "": "Represents a vSphere volume resource.", "volumePath": "volumePath is the path that identifies vSphere volume vmdk", @@ -2893,15 +2934,4 @@ func (WindowsSecurityContextOptions) SwaggerDoc() map[string]string { return map_WindowsSecurityContextOptions } -var map_WorkloadReference = map[string]string{ - "": "WorkloadReference identifies the Workload object and PodGroup membership that a Pod belongs to. The scheduler uses this information to apply workload-aware scheduling semantics.", - "name": "Name defines the name of the Workload object this Pod belongs to. Workload must be in the same namespace as the Pod. If it doesn't match any existing Workload, the Pod will remain unschedulable until a Workload object is created and observed by the kube-scheduler. It must be a DNS subdomain.", - "podGroup": "PodGroup is the name of the PodGroup within the Workload that this Pod belongs to. If it doesn't match any existing PodGroup within the Workload, the Pod will remain unschedulable until the Workload object is recreated and observed by the kube-scheduler. It must be a DNS label.", - "podGroupReplicaKey": "PodGroupReplicaKey specifies the replica key of the PodGroup to which this Pod belongs. It is used to distinguish pods belonging to different replicas of the same pod group. The pod group policy is applied separately to each replica. When set, it must be a DNS label.", -} - -func (WorkloadReference) SwaggerDoc() map[string]string { - return map_WorkloadReference -} - // AUTO-GENERATED FUNCTIONS END HERE diff --git a/apis/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go b/apis/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go index 15bc2ee0331..10af6c17d2c 100644 --- a/apis/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go +++ b/apis/vendor/k8s.io/api/core/v1/zz_generated.deepcopy.go @@ -22,6 +22,7 @@ limitations under the License. package v1 import ( + resource "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" types "k8s.io/apimachinery/pkg/types" @@ -2170,6 +2171,22 @@ func (in *ImageVolumeSource) DeepCopy() *ImageVolumeSource { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ImageVolumeStatus) DeepCopyInto(out *ImageVolumeStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageVolumeStatus. +func (in *ImageVolumeStatus) DeepCopy() *ImageVolumeStatus { + if in == nil { + return nil + } + out := new(ImageVolumeStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *KeyToPath) DeepCopyInto(out *KeyToPath) { *out = *in @@ -2760,6 +2777,34 @@ func (in *NodeAffinity) DeepCopy() *NodeAffinity { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeAllocatableResourceClaimStatus) DeepCopyInto(out *NodeAllocatableResourceClaimStatus) { + *out = *in + if in.Containers != nil { + in, out := &in.Containers, &out.Containers + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Resources != nil { + in, out := &in.Resources, &out.Resources + *out = make(map[ResourceName]resource.Quantity, len(*in)) + for key, val := range *in { + (*out)[key] = val.DeepCopy() + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeAllocatableResourceClaimStatus. +func (in *NodeAllocatableResourceClaimStatus) DeepCopy() *NodeAllocatableResourceClaimStatus { + if in == nil { + return nil + } + out := new(NodeAllocatableResourceClaimStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NodeCondition) DeepCopyInto(out *NodeCondition) { *out = *in @@ -4299,6 +4344,27 @@ func (in *PodSchedulingGate) DeepCopy() *PodSchedulingGate { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PodSchedulingGroup) DeepCopyInto(out *PodSchedulingGroup) { + *out = *in + if in.PodGroupName != nil { + in, out := &in.PodGroupName, &out.PodGroupName + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSchedulingGroup. +func (in *PodSchedulingGroup) DeepCopy() *PodSchedulingGroup { + if in == nil { + return nil + } + out := new(PodSchedulingGroup) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PodSecurityContext) DeepCopyInto(out *PodSecurityContext) { *out = *in @@ -4569,10 +4635,10 @@ func (in *PodSpec) DeepCopyInto(out *PodSpec) { *out = new(string) **out = **in } - if in.WorkloadRef != nil { - in, out := &in.WorkloadRef, &out.WorkloadRef - *out = new(WorkloadReference) - **out = **in + if in.SchedulingGroup != nil { + in, out := &in.SchedulingGroup, &out.SchedulingGroup + *out = new(PodSchedulingGroup) + (*in).DeepCopyInto(*out) } return } @@ -4656,6 +4722,13 @@ func (in *PodStatus) DeepCopyInto(out *PodStatus) { *out = new(ResourceRequirements) (*in).DeepCopyInto(*out) } + if in.NodeAllocatableResourceClaimStatuses != nil { + in, out := &in.NodeAllocatableResourceClaimStatuses, &out.NodeAllocatableResourceClaimStatuses + *out = make([]NodeAllocatableResourceClaimStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } return } @@ -5222,6 +5295,11 @@ func (in *ResourceFieldSelector) DeepCopy() *ResourceFieldSelector { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ResourceHealth) DeepCopyInto(out *ResourceHealth) { *out = *in + if in.Message != nil { + in, out := &in.Message, &out.Message + *out = new(string) + **out = **in + } return } @@ -5422,7 +5500,9 @@ func (in *ResourceStatus) DeepCopyInto(out *ResourceStatus) { if in.Resources != nil { in, out := &in.Resources, &out.Resources *out = make([]ResourceHealth, len(*in)) - copy(*out, *in) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } } return } @@ -6529,6 +6609,11 @@ func (in *VolumeMountStatus) DeepCopyInto(out *VolumeMountStatus) { *out = new(RecursiveReadOnlyMode) **out = **in } + if in.VolumeStatus != nil { + in, out := &in.VolumeStatus, &out.VolumeStatus + *out = new(VolumeStatus) + (*in).DeepCopyInto(*out) + } return } @@ -6805,6 +6890,27 @@ func (in *VolumeSource) DeepCopy() *VolumeSource { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VolumeStatus) DeepCopyInto(out *VolumeStatus) { + *out = *in + if in.Image != nil { + in, out := &in.Image, &out.Image + *out = new(ImageVolumeStatus) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeStatus. +func (in *VolumeStatus) DeepCopy() *VolumeStatus { + if in == nil { + return nil + } + out := new(VolumeStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *VsphereVirtualDiskVolumeSource) DeepCopyInto(out *VsphereVirtualDiskVolumeSource) { *out = *in @@ -6873,19 +6979,3 @@ func (in *WindowsSecurityContextOptions) DeepCopy() *WindowsSecurityContextOptio in.DeepCopyInto(out) return out } - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *WorkloadReference) DeepCopyInto(out *WorkloadReference) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadReference. -func (in *WorkloadReference) DeepCopy() *WorkloadReference { - if in == nil { - return nil - } - out := new(WorkloadReference) - in.DeepCopyInto(out) - return out -} diff --git a/apis/vendor/k8s.io/api/core/v1/zz_generated.model_name.go b/apis/vendor/k8s.io/api/core/v1/zz_generated.model_name.go index 523bb3a8529..8e79ad909ed 100644 --- a/apis/vendor/k8s.io/api/core/v1/zz_generated.model_name.go +++ b/apis/vendor/k8s.io/api/core/v1/zz_generated.model_name.go @@ -421,6 +421,11 @@ func (in ImageVolumeSource) OpenAPIModelName() string { return "io.k8s.api.core.v1.ImageVolumeSource" } +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ImageVolumeStatus) OpenAPIModelName() string { + return "io.k8s.api.core.v1.ImageVolumeStatus" +} + // OpenAPIModelName returns the OpenAPI model name for this type. func (in KeyToPath) OpenAPIModelName() string { return "io.k8s.api.core.v1.KeyToPath" @@ -536,6 +541,11 @@ func (in NodeAffinity) OpenAPIModelName() string { return "io.k8s.api.core.v1.NodeAffinity" } +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in NodeAllocatableResourceClaimStatus) OpenAPIModelName() string { + return "io.k8s.api.core.v1.NodeAllocatableResourceClaimStatus" +} + // OpenAPIModelName returns the OpenAPI model name for this type. func (in NodeCondition) OpenAPIModelName() string { return "io.k8s.api.core.v1.NodeCondition" @@ -796,6 +806,11 @@ func (in PodSchedulingGate) OpenAPIModelName() string { return "io.k8s.api.core.v1.PodSchedulingGate" } +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in PodSchedulingGroup) OpenAPIModelName() string { + return "io.k8s.api.core.v1.PodSchedulingGroup" +} + // OpenAPIModelName returns the OpenAPI model name for this type. func (in PodSecurityContext) OpenAPIModelName() string { return "io.k8s.api.core.v1.PodSecurityContext" @@ -1191,6 +1206,11 @@ func (in VolumeSource) OpenAPIModelName() string { return "io.k8s.api.core.v1.VolumeSource" } +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in VolumeStatus) OpenAPIModelName() string { + return "io.k8s.api.core.v1.VolumeStatus" +} + // OpenAPIModelName returns the OpenAPI model name for this type. func (in VsphereVirtualDiskVolumeSource) OpenAPIModelName() string { return "io.k8s.api.core.v1.VsphereVirtualDiskVolumeSource" @@ -1205,8 +1225,3 @@ func (in WeightedPodAffinityTerm) OpenAPIModelName() string { func (in WindowsSecurityContextOptions) OpenAPIModelName() string { return "io.k8s.api.core.v1.WindowsSecurityContextOptions" } - -// OpenAPIModelName returns the OpenAPI model name for this type. -func (in WorkloadReference) OpenAPIModelName() string { - return "io.k8s.api.core.v1.WorkloadReference" -} diff --git a/apis/vendor/k8s.io/api/rbac/v1/generated.proto b/apis/vendor/k8s.io/api/rbac/v1/generated.proto index 56869814ec4..7b4ec2afc16 100644 --- a/apis/vendor/k8s.io/api/rbac/v1/generated.proto +++ b/apis/vendor/k8s.io/api/rbac/v1/generated.proto @@ -46,6 +46,7 @@ message ClusterRole { // Rules holds all the PolicyRules for this ClusterRole // +optional // +listType=atomic + // +k8s:alpha(since: "1.36")=+k8s:optional repeated PolicyRule rules = 2; // AggregationRule is an optional field that describes how to build the Rules for this ClusterRole. @@ -65,11 +66,13 @@ message ClusterRoleBinding { // Subjects holds references to the objects the role applies to. // +optional // +listType=atomic + // +k8s:alpha(since: "1.36")=+k8s:optional repeated Subject subjects = 2; // RoleRef can only reference a ClusterRole in the global namespace. // If the RoleRef cannot be resolved, the Authorizer must return an error. // This field is immutable. + // +required optional RoleRef roleRef = 3; } @@ -98,6 +101,8 @@ message ClusterRoleList { message PolicyRule { // Verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs. // +listType=atomic + // +required + // +k8s:alpha(since: "1.36")=+k8s:required repeated string verbs = 1; // APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of @@ -133,6 +138,7 @@ message Role { // Rules holds all the PolicyRules for this Role // +optional // +listType=atomic + // +k8s:alpha(since: "1.36")=+k8s:optional repeated PolicyRule rules = 2; } @@ -147,11 +153,13 @@ message RoleBinding { // Subjects holds references to the objects the role applies to. // +optional // +listType=atomic + // +k8s:alpha(since: "1.36")=+k8s:optional repeated Subject subjects = 2; // RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. // If the RoleRef cannot be resolved, the Authorizer must return an error. // This field is immutable. + // +required optional RoleRef roleRef = 3; } @@ -179,14 +187,16 @@ message RoleList { // +structType=atomic message RoleRef { // APIGroup is the group for the resource being referenced + // +optional optional string apiGroup = 1; // Kind is the type of resource being referenced + // +required optional string kind = 2; // Name is the name of resource being referenced // +required - // +k8s:required + // +k8s:alpha(since: "1.36")=+k8s:required optional string name = 3; } @@ -196,6 +206,7 @@ message RoleRef { message Subject { // Kind of object being referenced. Values defined by this API group are "User", "Group", and "ServiceAccount". // If the Authorizer does not recognized the kind value, the Authorizer should report an error. + // +required optional string kind = 1; // APIGroup holds the API group of the referenced subject. @@ -206,7 +217,7 @@ message Subject { // Name of the object being referenced. // +required - // +k8s:required + // +k8s:alpha(since: "1.36")=+k8s:required optional string name = 3; // Namespace of the referenced object. If the object kind is non-namespace, such as "User" or "Group", and this value is not empty diff --git a/apis/vendor/k8s.io/api/rbac/v1/generated.protomessage.pb.go b/apis/vendor/k8s.io/api/rbac/v1/generated.protomessage.pb.go deleted file mode 100644 index 6e29e012fa5..00000000000 --- a/apis/vendor/k8s.io/api/rbac/v1/generated.protomessage.pb.go +++ /dev/null @@ -1,46 +0,0 @@ -//go:build kubernetes_protomessage_one_more_release -// +build kubernetes_protomessage_one_more_release - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by go-to-protobuf. DO NOT EDIT. - -package v1 - -func (*AggregationRule) ProtoMessage() {} - -func (*ClusterRole) ProtoMessage() {} - -func (*ClusterRoleBinding) ProtoMessage() {} - -func (*ClusterRoleBindingList) ProtoMessage() {} - -func (*ClusterRoleList) ProtoMessage() {} - -func (*PolicyRule) ProtoMessage() {} - -func (*Role) ProtoMessage() {} - -func (*RoleBinding) ProtoMessage() {} - -func (*RoleBindingList) ProtoMessage() {} - -func (*RoleList) ProtoMessage() {} - -func (*RoleRef) ProtoMessage() {} - -func (*Subject) ProtoMessage() {} diff --git a/apis/vendor/k8s.io/api/rbac/v1/types.go b/apis/vendor/k8s.io/api/rbac/v1/types.go index 2fde11b3064..d3bb6d1a9cd 100644 --- a/apis/vendor/k8s.io/api/rbac/v1/types.go +++ b/apis/vendor/k8s.io/api/rbac/v1/types.go @@ -49,6 +49,8 @@ const ( type PolicyRule struct { // Verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs. // +listType=atomic + // +required + // +k8s:alpha(since: "1.36")=+k8s:required Verbs []string `json:"verbs" protobuf:"bytes,1,rep,name=verbs"` // APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of @@ -79,6 +81,7 @@ type PolicyRule struct { type Subject struct { // Kind of object being referenced. Values defined by this API group are "User", "Group", and "ServiceAccount". // If the Authorizer does not recognized the kind value, the Authorizer should report an error. + // +required Kind string `json:"kind" protobuf:"bytes,1,opt,name=kind"` // APIGroup holds the API group of the referenced subject. // Defaults to "" for ServiceAccount subjects. @@ -87,7 +90,7 @@ type Subject struct { APIGroup string `json:"apiGroup,omitempty" protobuf:"bytes,2,opt,name=apiGroup"` // Name of the object being referenced. // +required - // +k8s:required + // +k8s:alpha(since: "1.36")=+k8s:required Name string `json:"name" protobuf:"bytes,3,opt,name=name"` // Namespace of the referenced object. If the object kind is non-namespace, such as "User" or "Group", and this value is not empty // the Authorizer should report an error. @@ -99,12 +102,14 @@ type Subject struct { // +structType=atomic type RoleRef struct { // APIGroup is the group for the resource being referenced + // +optional APIGroup string `json:"apiGroup" protobuf:"bytes,1,opt,name=apiGroup"` // Kind is the type of resource being referenced + // +required Kind string `json:"kind" protobuf:"bytes,2,opt,name=kind"` // Name is the name of resource being referenced // +required - // +k8s:required + // +k8s:alpha(since: "1.36")=+k8s:required Name string `json:"name" protobuf:"bytes,3,opt,name=name"` } @@ -122,6 +127,7 @@ type Role struct { // Rules holds all the PolicyRules for this Role // +optional // +listType=atomic + // +k8s:alpha(since: "1.36")=+k8s:optional Rules []PolicyRule `json:"rules" protobuf:"bytes,2,rep,name=rules"` } @@ -141,11 +147,13 @@ type RoleBinding struct { // Subjects holds references to the objects the role applies to. // +optional // +listType=atomic + // +k8s:alpha(since: "1.36")=+k8s:optional Subjects []Subject `json:"subjects,omitempty" protobuf:"bytes,2,rep,name=subjects"` // RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. // If the RoleRef cannot be resolved, the Authorizer must return an error. // This field is immutable. + // +required RoleRef RoleRef `json:"roleRef" protobuf:"bytes,3,opt,name=roleRef"` } @@ -192,6 +200,7 @@ type ClusterRole struct { // Rules holds all the PolicyRules for this ClusterRole // +optional // +listType=atomic + // +k8s:alpha(since: "1.36")=+k8s:optional Rules []PolicyRule `json:"rules" protobuf:"bytes,2,rep,name=rules"` // AggregationRule is an optional field that describes how to build the Rules for this ClusterRole. @@ -226,11 +235,13 @@ type ClusterRoleBinding struct { // Subjects holds references to the objects the role applies to. // +optional // +listType=atomic + // +k8s:alpha(since: "1.36")=+k8s:optional Subjects []Subject `json:"subjects,omitempty" protobuf:"bytes,2,rep,name=subjects"` // RoleRef can only reference a ClusterRole in the global namespace. // If the RoleRef cannot be resolved, the Authorizer must return an error. // This field is immutable. + // +required RoleRef RoleRef `json:"roleRef" protobuf:"bytes,3,opt,name=roleRef"` } diff --git a/apis/vendor/k8s.io/apimachinery/pkg/api/resource/generated.protomessage.pb.go b/apis/vendor/k8s.io/apimachinery/pkg/api/resource/generated.protomessage.pb.go deleted file mode 100644 index 712e155c3e5..00000000000 --- a/apis/vendor/k8s.io/apimachinery/pkg/api/resource/generated.protomessage.pb.go +++ /dev/null @@ -1,26 +0,0 @@ -//go:build kubernetes_protomessage_one_more_release -// +build kubernetes_protomessage_one_more_release - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by go-to-protobuf. DO NOT EDIT. - -package resource - -func (*Quantity) ProtoMessage() {} - -func (*QuantityValue) ProtoMessage() {} diff --git a/apis/vendor/k8s.io/apimachinery/pkg/api/validate/content/errors.go b/apis/vendor/k8s.io/apimachinery/pkg/api/validate/content/errors.go index a4a1b5574c6..13eeced1a06 100644 --- a/apis/vendor/k8s.io/apimachinery/pkg/api/validate/content/errors.go +++ b/apis/vendor/k8s.io/apimachinery/pkg/api/validate/content/errors.go @@ -29,6 +29,12 @@ func MinError[T constraints.Integer](min T) string { return fmt.Sprintf("must be greater than or equal to %d", min) } +// MaxError returns a string explanation of a "must be less than or equal" +// validation failure. +func MaxError[T constraints.Integer](max T) string { + return fmt.Sprintf("must be less than or equal to %d", max) +} + // MaxLenError returns a string explanation of a "string too long" validation // failure. func MaxLenError(length int) string { diff --git a/apis/vendor/k8s.io/apimachinery/pkg/api/validate/content/path.go b/apis/vendor/k8s.io/apimachinery/pkg/api/validate/content/path.go new file mode 100644 index 00000000000..c41b1d47312 --- /dev/null +++ b/apis/vendor/k8s.io/apimachinery/pkg/api/validate/content/path.go @@ -0,0 +1,63 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package content + +import ( + "fmt" + "strings" +) + +// Strings that cannot be used as names specified as path segments (like the +// REST API or etcd store). +var pathSegmentNameMayNotBe = []string{".", ".."} + +// Substrings that cannot be used in names specified as path segments (like the +// REST API or etcd store). +var pathSegmentNameMayNotContain = []string{"/", "%"} + +// IsPathSegmentName validates the name can be safely encoded as a path +// segment. +// +// Note that, for historical reason, this function does not check for +// empty strings or impose a limit on the length of the name. +func IsPathSegmentName(name string) []string { + for _, illegalName := range pathSegmentNameMayNotBe { + if name == illegalName { + return []string{fmt.Sprintf(`may not be '%s'`, illegalName)} + } + } + + return IsPathSegmentPrefix(name) +} + +// IsPathSegmentPrefix validates the name can be used as a prefix for a +// name which will be encoded as a path segment It does not check for exact +// matches with disallowed names, since an arbitrary suffix might make the name +// valid. +// +// Note that, for historical reason, this function does not check for +// empty strings or impose a limit on the length of the name. +func IsPathSegmentPrefix(name string) []string { + var errors []string + for _, illegalContent := range pathSegmentNameMayNotContain { + if strings.Contains(name, illegalContent) { + errors = append(errors, fmt.Sprintf(`may not contain '%s'`, illegalContent)) + } + } + + return errors +} diff --git a/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/fieldsv1.go b/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/fieldsv1.go new file mode 100644 index 00000000000..81aca59facb --- /dev/null +++ b/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/fieldsv1.go @@ -0,0 +1,170 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1 + +import ( + "fmt" + "io" +) + +func (FieldsV1) SwaggerDoc() map[string]string { + return map[string]string{ + "": "FieldsV1 stores a set of fields in a data structure like a Trie, in JSON format.\n\nEach key is either a '.' representing the field itself, and will always map to an empty set, or a string representing a sub-field or item. The string will follow one of these four formats: 'f:', where is the name of a field in a struct, or key in a map 'v:', where is the exact json formatted value of a list item 'i:', where is position of a item in a list 'k:', where is a map of a list item's key fields to their unique values If a key maps to an empty Fields value, the field that key represents is part of the set.\n\nThe exact format is defined in sigs.k8s.io/structured-merge-diff", + } +} + +type FieldsV1Reader interface { + io.Reader + io.ReaderAt + // Size returns the original byte length of the underlying data. Size is the number of bytes available for reading via ReadAt. + Size() int64 +} + +func (f *FieldsV1) DeepCopy() *FieldsV1 { + if f == nil { + return nil + } + out := new(FieldsV1) + f.DeepCopyInto(out) + return out +} + +func (f *FieldsV1) Marshal() (dAtA []byte, err error) { + size := f.Size() + dAtA = make([]byte, size) + n, err := f.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (f *FieldsV1) MarshalTo(dAtA []byte) (int, error) { + size := f.Size() + return f.MarshalToSizedBuffer(dAtA[:size]) +} + +func (f *FieldsV1) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + rawBytes := f.GetRawBytes() + if len(rawBytes) > 0 { + i -= len(rawBytes) + copy(dAtA[i:], rawBytes) + i = encodeVarintGenerated(dAtA, i, uint64(len(rawBytes))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (f *FieldsV1) Size() (n int) { + if f == nil { + return 0 + } + var l int + _ = l + if l := int(f.GetRawReader().Size()); l > 0 { + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (f *FieldsV1) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FieldsV1: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FieldsV1: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Raw", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + + f.SetRawBytes(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/fieldsv1_byte.go b/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/fieldsv1_byte.go new file mode 100644 index 00000000000..66f28e1d9ff --- /dev/null +++ b/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/fieldsv1_byte.go @@ -0,0 +1,105 @@ +//go:build !fieldsv1string + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1 + +import ( + "bytes" +) + +// FieldsV1 stores a set of fields in a data structure like a Trie, in JSON format. +// +// Each key is either a '.' representing the field itself, and will always map to an empty set, +// or a string representing a sub-field or item. The string will follow one of these four formats: +// 'f:', where is the name of a field in a struct, or key in a map +// 'v:', where is the exact json formatted value of a list item +// 'i:', where is position of a item in a list +// 'k:', where is a map of a list item's key fields to their unique values +// If a key maps to an empty Fields value, the field that key represents is part of the set. +// +// The exact format is defined in sigs.k8s.io/structured-merge-diff +// +k8s:deepcopy-gen=false +// +protobuf.options.marshal=false +// +protobuf.options.(gogoproto.goproto_stringer)=false +type FieldsV1 struct { + // Raw is the underlying serialization of this object. + // + // Deprecated: Direct access to this field is deprecated. Use GetRawBytes, GetRawString, SetRawBytes, SetRawString, GetRawReader, NewFieldsV1 instead. + Raw []byte `json:"-" protobuf:"bytes,1,opt,name=Raw"` +} + +func (f FieldsV1) String() string { + return string(f.Raw) +} + +func (f FieldsV1) Equal(f2 FieldsV1) bool { + return bytes.Equal(f.Raw, f2.Raw) +} + +func (f *FieldsV1) GetRawReader() FieldsV1Reader { + if f == nil || len(f.Raw) == 0 { + return bytes.NewReader(nil) + } + return bytes.NewReader(f.Raw) +} + +// GetRawBytes returns the raw bytes. +// These may or may not be a copy of the underlying bytes. +// If mutating the underlying bytes is desired, the returned bytes may be mutated and then passed to SetRawBytes(). +// If mutating the underlying bytes is not desired, make a copy of the returned bytes. +func (f *FieldsV1) GetRawBytes() []byte { + if f == nil { + return nil + } + return f.Raw +} + +// GetRawString returns the raw data as a string. +func (f *FieldsV1) GetRawString() string { + if f == nil { + return "" + } + return string(f.Raw) +} + +// SetRawBytes sets the raw bytes. It does not retain the passed-in byte slice. +func (f *FieldsV1) SetRawBytes(b []byte) { + if f != nil { + f.Raw = bytes.Clone(b) + } +} + +// SetRawString sets the raw data from a string. +func (f *FieldsV1) SetRawString(s string) { + if f != nil { + f.Raw = []byte(s) + } +} + +func NewFieldsV1(raw string) *FieldsV1 { + return &FieldsV1{Raw: []byte(raw)} +} + +func (f *FieldsV1) DeepCopyInto(out *FieldsV1) { + *out = *f + if f.Raw != nil { + in, out := &f.Raw, &out.Raw + *out = make([]byte, len(*in)) + copy(*out, *in) + } +} diff --git a/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/fieldsv1_string.go b/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/fieldsv1_string.go new file mode 100644 index 00000000000..679452ae17d --- /dev/null +++ b/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/fieldsv1_string.go @@ -0,0 +1,113 @@ +//go:build fieldsv1string + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1 + +import ( + "strings" + "unique" +) + +// FieldsV1 stores a set of fields in a data structure like a Trie, in JSON format. +// +// Each key is either a '.' representing the field itself, and will always map to an empty set, +// or a string representing a sub-field or item. The string will follow one of these four formats: +// 'f:', where is the name of a field in a struct, or key in a map +// 'v:', where is the exact json formatted value of a list item +// 'i:', where is position of a item in a list +// 'k:', where is a map of a list item's key fields to their unique values +// If a key maps to an empty Fields value, the field that key represents is part of the set. +// +// The exact format is defined in sigs.k8s.io/structured-merge-diff +// +k8s:deepcopy-gen=false +// +protobuf.options.marshal=false +// +protobuf.options.(gogoproto.goproto_stringer)=false +type FieldsV1 struct { + // The zero value of a unique.Handle[string] has an uninitialized underlying pointer. + // Calling .Value() on it panics. We must explicitly check for this uninitialized + // state (f.handle == unique.Handle[string]{}) across accessors to safely support + // uninitialized metav1.FieldsV1{} objects. + // See ongoing golang discussion related to this here: https://github.com/golang/go/issues/73344 + handle unique.Handle[string] +} + +func (f FieldsV1) String() string { + if f.handle == (unique.Handle[string]{}) { + return "" + } + return f.handle.Value() +} + +func (f FieldsV1) Equal(f2 FieldsV1) bool { + if f.handle == f2.handle { + return true + } + // An uninitialized FieldsV1 compared to an explicitly empty + // FieldsV1 (unique.Make("") will fail the handle check above. + // Evaluate string contents directly as well to maintain parity with legacy + // bytes.Equal(nil, []byte{}) == true behavior. + return f.GetRawString() == f2.GetRawString() +} + +func (f *FieldsV1) GetRawReader() FieldsV1Reader { + if f == nil || f.handle == (unique.Handle[string]{}) { + return strings.NewReader("") + } + return strings.NewReader(f.handle.Value()) +} + +// GetRawBytes returns the raw bytes. +// These may or may not be a copy of the underlying bytes. +// If mutating the underlying bytes is desired, the returned bytes may be mutated and then passed to SetRawBytes(). +// If mutating the underlying bytes is not desired, make a copy of the returned bytes. +func (f *FieldsV1) GetRawBytes() []byte { + if f == nil || f.handle == (unique.Handle[string]{}) { + return nil + } + return []byte(f.handle.Value()) +} + +// GetRawString returns the raw data as a string. +func (f *FieldsV1) GetRawString() string { + if f == nil || f.handle == (unique.Handle[string]{}) { + return "" + } + return f.handle.Value() +} + +// SetRawBytes sets the raw bytes. It does not retain the passed-in byte slice. +func (f *FieldsV1) SetRawBytes(b []byte) { + if f != nil { + f.handle = unique.Make(string(b)) + } +} + +// SetRawString sets the raw data from a string. +func (f *FieldsV1) SetRawString(s string) { + if f != nil { + f.handle = unique.Make(s) + } +} + +func NewFieldsV1(raw string) *FieldsV1 { + return &FieldsV1{handle: unique.Make(raw)} +} + +func (f *FieldsV1) DeepCopyInto(out *FieldsV1) { + *out = *f +} diff --git a/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.pb.go b/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.pb.go index f6b1a6a4e06..293b0223a73 100644 --- a/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.pb.go +++ b/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.pb.go @@ -105,6 +105,8 @@ func (m *RootPaths) Reset() { *m = RootPaths{} } func (m *ServerAddressByClientCIDR) Reset() { *m = ServerAddressByClientCIDR{} } +func (m *ShardInfo) Reset() { *m = ShardInfo{} } + func (m *Status) Reset() { *m = Status{} } func (m *StatusCause) Reset() { *m = StatusCause{} } @@ -694,36 +696,6 @@ func (m *FieldSelectorRequirement) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } -func (m *FieldsV1) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *FieldsV1) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *FieldsV1) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Raw != nil { - i -= len(m.Raw) - copy(dAtA[i:], m.Raw) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Raw))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func (m *GetOptions) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1130,6 +1102,18 @@ func (m *ListMeta) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.ShardInfo != nil { + { + size, err := m.ShardInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } if m.RemainingItemCount != nil { i = encodeVarintGenerated(dAtA, i, uint64(*m.RemainingItemCount)) i-- @@ -1173,6 +1157,11 @@ func (m *ListOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + i -= len(m.ShardSelector) + copy(dAtA[i:], m.ShardSelector) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ShardSelector))) + i-- + dAtA[i] = 0x7a if m.SendInitialEvents != nil { i-- if *m.SendInitialEvents { @@ -1797,6 +1786,34 @@ func (m *ServerAddressByClientCIDR) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } +func (m *ShardInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ShardInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ShardInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Selector) + copy(dAtA[i:], m.Selector) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Selector))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *Status) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2405,19 +2422,6 @@ func (m *FieldSelectorRequirement) Size() (n int) { return n } -func (m *FieldsV1) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Raw != nil { - l = len(m.Raw) - n += 1 + l + sovGenerated(uint64(l)) - } - return n -} - func (m *GetOptions) Size() (n int) { if m == nil { return 0 @@ -2585,6 +2589,10 @@ func (m *ListMeta) Size() (n int) { if m.RemainingItemCount != nil { n += 1 + sovGenerated(uint64(*m.RemainingItemCount)) } + if m.ShardInfo != nil { + l = m.ShardInfo.Size() + n += 1 + l + sovGenerated(uint64(l)) + } return n } @@ -2613,6 +2621,8 @@ func (m *ListOptions) Size() (n int) { if m.SendInitialEvents != nil { n += 2 } + l = len(m.ShardSelector) + n += 1 + l + sovGenerated(uint64(l)) return n } @@ -2835,6 +2845,17 @@ func (m *ServerAddressByClientCIDR) Size() (n int) { return n } +func (m *ShardInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Selector) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + func (m *Status) Size() (n int) { if m == nil { return 0 @@ -3217,6 +3238,7 @@ func (this *ListMeta) String() string { `ResourceVersion:` + fmt.Sprintf("%v", this.ResourceVersion) + `,`, `Continue:` + fmt.Sprintf("%v", this.Continue) + `,`, `RemainingItemCount:` + valueToStringGenerated(this.RemainingItemCount) + `,`, + `ShardInfo:` + strings.Replace(this.ShardInfo.String(), "ShardInfo", "ShardInfo", 1) + `,`, `}`, }, "") return s @@ -3236,6 +3258,7 @@ func (this *ListOptions) String() string { `AllowWatchBookmarks:` + fmt.Sprintf("%v", this.AllowWatchBookmarks) + `,`, `ResourceVersionMatch:` + fmt.Sprintf("%v", this.ResourceVersionMatch) + `,`, `SendInitialEvents:` + valueToStringGenerated(this.SendInitialEvents) + `,`, + `ShardSelector:` + fmt.Sprintf("%v", this.ShardSelector) + `,`, `}`, }, "") return s @@ -3405,6 +3428,16 @@ func (this *ServerAddressByClientCIDR) String() string { }, "") return s } +func (this *ShardInfo) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ShardInfo{`, + `Selector:` + fmt.Sprintf("%v", this.Selector) + `,`, + `}`, + }, "") + return s +} func (this *Status) String() string { if this == nil { return "nil" @@ -5314,90 +5347,6 @@ func (m *FieldSelectorRequirement) Unmarshal(dAtA []byte) error { } return nil } -func (m *FieldsV1) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: FieldsV1: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: FieldsV1: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Raw", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Raw = append(m.Raw[:0], dAtA[iNdEx:postIndex]...) - if m.Raw == nil { - m.Raw = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *GetOptions) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -6847,6 +6796,42 @@ func (m *ListMeta) Unmarshal(dAtA []byte) error { } } m.RemainingItemCount = &v + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ShardInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ShardInfo == nil { + m.ShardInfo = &ShardInfo{} + } + if err := m.ShardInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -7157,6 +7142,38 @@ func (m *ListOptions) Unmarshal(dAtA []byte) error { } b := bool(v != 0) m.SendInitialEvents = &b + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ShardSelector", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ShardSelector = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -9113,6 +9130,88 @@ func (m *ServerAddressByClientCIDR) Unmarshal(dAtA []byte) error { } return nil } +func (m *ShardInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ShardInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ShardInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Selector", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Selector = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *Status) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto b/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto index fb21b723686..d03a7331411 100644 --- a/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto +++ b/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto @@ -369,9 +369,13 @@ message FieldSelectorRequirement { // If a key maps to an empty Fields value, the field that key represents is part of the set. // // The exact format is defined in sigs.k8s.io/structured-merge-diff +// +k8s:deepcopy-gen=false +// +protobuf.options.marshal=false // +protobuf.options.(gogoproto.goproto_stringer)=false message FieldsV1 { // Raw is the underlying serialization of this object. + // + // Deprecated: Direct access to this field is deprecated. Use GetRawBytes, GetRawString, SetRawBytes, SetRawString, GetRawReader, NewFieldsV1 instead. optional bytes Raw = 1; } @@ -533,6 +537,17 @@ message ListMeta { // should not rely on the remainingItemCount to be set or to be exact. // +optional optional int64 remainingItemCount = 4; + + // shardInfo is set when the list is a filtered subset of the full collection, + // as selected by a shard selector on the request. It echoes back the selector + // so clients can verify which shard they received and merge sharded responses. + // Clients should not cache sharded list responses as a full representation + // of the collection. + // + // This is an alpha field and requires enabling the ShardedListAndWatch feature gate. + // +featureGate=ShardedListAndWatch + // +optional + optional ShardInfo shardInfo = 5; } // ListOptions is the query options to a standard REST list call. @@ -643,6 +658,38 @@ message ListOptions { // compatibility reasons) and to false otherwise. // +optional optional bool sendInitialEvents = 11; + + // shardSelector restricts the list of returned objects using a CEL-based + // shard selector expression. The format uses the shardRange() function + // combined with || (logical OR) to specify one or more hash ranges: + // + // shardRange(object.metadata.uid, '0x0', '0x8000000000000000') + // shardRange(object.metadata.uid, '0x0', '0x8000000000000000') || shardRange(object.metadata.uid, '0x8000000000000000', '0x10000000000000000') + // + // Field paths use CEL-style object-rooted syntax (e.g. "object.metadata.uid"), + // NOT the fieldSelector format ("metadata.uid"). Currently supported paths: + // - object.metadata.uid + // - object.metadata.namespace + // + // hexStart and hexEnd are single-quoted CEL string literals with a '0x' prefix, + // defining the inclusive lower and exclusive upper bounds over the 64-bit FNV-1a + // hash space. The full range is [0x0, 0x10000000000000000), where the exclusive + // upper bound equals 2^64. + // + // Examples: + // 2-shard split: + // shard 0: shardRange(object.metadata.uid, '0x0000000000000000', '0x8000000000000000') + // shard 1: shardRange(object.metadata.uid, '0x8000000000000000', '0x10000000000000000') + // 4-shard split: + // shard 0: shardRange(object.metadata.uid, '0x0000000000000000', '0x4000000000000000') + // shard 1: shardRange(object.metadata.uid, '0x4000000000000000', '0x8000000000000000') + // shard 2: shardRange(object.metadata.uid, '0x8000000000000000', '0xc000000000000000') + // shard 3: shardRange(object.metadata.uid, '0xc000000000000000', '0x10000000000000000') + // + // This is an alpha field and requires enabling the ShardedListAndWatch feature gate. + // +featureGate=ShardedListAndWatch + // +optional + optional string shardSelector = 15; } // ManagedFieldsEntry is a workflow-id, a FieldSet and the group version of the resource @@ -1009,6 +1056,15 @@ message ServerAddressByClientCIDR { optional string serverAddress = 2; } +// ShardInfo describes the shard selector that was applied to produce a list response. +// Its presence on a list response indicates the list is a filtered subset. +message ShardInfo { + // selector is the shard selector string from the request, echoed back so clients + // can verify which shard they received and merge responses from multiple shards. + // +required + optional string selector = 1; +} + // Status is a return value for calls that don't return other objects. message Status { // Standard list metadata. diff --git a/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.protomessage.pb.go b/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.protomessage.pb.go deleted file mode 100644 index 459ae1ad873..00000000000 --- a/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.protomessage.pb.go +++ /dev/null @@ -1,112 +0,0 @@ -//go:build kubernetes_protomessage_one_more_release -// +build kubernetes_protomessage_one_more_release - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by go-to-protobuf. DO NOT EDIT. - -package v1 - -func (*APIGroup) ProtoMessage() {} - -func (*APIGroupList) ProtoMessage() {} - -func (*APIResource) ProtoMessage() {} - -func (*APIResourceList) ProtoMessage() {} - -func (*APIVersions) ProtoMessage() {} - -func (*ApplyOptions) ProtoMessage() {} - -func (*Condition) ProtoMessage() {} - -func (*CreateOptions) ProtoMessage() {} - -func (*DeleteOptions) ProtoMessage() {} - -func (*Duration) ProtoMessage() {} - -func (*FieldSelectorRequirement) ProtoMessage() {} - -func (*FieldsV1) ProtoMessage() {} - -func (*GetOptions) ProtoMessage() {} - -func (*GroupKind) ProtoMessage() {} - -func (*GroupResource) ProtoMessage() {} - -func (*GroupVersion) ProtoMessage() {} - -func (*GroupVersionForDiscovery) ProtoMessage() {} - -func (*GroupVersionKind) ProtoMessage() {} - -func (*GroupVersionResource) ProtoMessage() {} - -func (*LabelSelector) ProtoMessage() {} - -func (*LabelSelectorRequirement) ProtoMessage() {} - -func (*List) ProtoMessage() {} - -func (*ListMeta) ProtoMessage() {} - -func (*ListOptions) ProtoMessage() {} - -func (*ManagedFieldsEntry) ProtoMessage() {} - -func (*MicroTime) ProtoMessage() {} - -func (*ObjectMeta) ProtoMessage() {} - -func (*OwnerReference) ProtoMessage() {} - -func (*PartialObjectMetadata) ProtoMessage() {} - -func (*PartialObjectMetadataList) ProtoMessage() {} - -func (*Patch) ProtoMessage() {} - -func (*PatchOptions) ProtoMessage() {} - -func (*Preconditions) ProtoMessage() {} - -func (*RootPaths) ProtoMessage() {} - -func (*ServerAddressByClientCIDR) ProtoMessage() {} - -func (*Status) ProtoMessage() {} - -func (*StatusCause) ProtoMessage() {} - -func (*StatusDetails) ProtoMessage() {} - -func (*TableOptions) ProtoMessage() {} - -func (*Time) ProtoMessage() {} - -func (*Timestamp) ProtoMessage() {} - -func (*TypeMeta) ProtoMessage() {} - -func (*UpdateOptions) ProtoMessage() {} - -func (*Verbs) ProtoMessage() {} - -func (*WatchEvent) ProtoMessage() {} diff --git a/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/helpers.go b/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/helpers.go index c748071ed7f..45ed1e9891e 100644 --- a/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/helpers.go +++ b/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/helpers.go @@ -279,17 +279,18 @@ func ResetObjectMetaForStatus(meta, existingMeta Object) { // MarshalJSON may get called on pointers or values, so implement MarshalJSON on value. // http://stackoverflow.com/questions/21390979/custom-marshaljson-never-gets-called-in-go func (f FieldsV1) MarshalJSON() ([]byte, error) { - if f.Raw == nil { + raw := f.GetRawBytes() + if len(raw) == 0 { return []byte("null"), nil } if f.getContentType() == fieldsV1InvalidOrValidCBORObject { var u map[string]interface{} - if err := cbor.Unmarshal(f.Raw, &u); err != nil { + if err := cbor.Unmarshal(raw, &u); err != nil { return nil, fmt.Errorf("metav1.FieldsV1 cbor invalid: %w", err) } return utiljson.Marshal(u) } - return f.Raw, nil + return raw, nil } // UnmarshalJSON implements json.Unmarshaler @@ -298,7 +299,7 @@ func (f *FieldsV1) UnmarshalJSON(b []byte) error { return errors.New("metav1.FieldsV1: UnmarshalJSON on nil pointer") } if !bytes.Equal(b, []byte("null")) { - f.Raw = append(f.Raw[0:0], b...) + f.SetRawBytes(b) } return nil } @@ -307,17 +308,18 @@ var _ json.Marshaler = FieldsV1{} var _ json.Unmarshaler = &FieldsV1{} func (f FieldsV1) MarshalCBOR() ([]byte, error) { - if f.Raw == nil { + raw := f.GetRawBytes() + if len(raw) == 0 { return cbor.Marshal(nil) } if f.getContentType() == fieldsV1InvalidOrValidJSONObject { var u map[string]interface{} - if err := utiljson.Unmarshal(f.Raw, &u); err != nil { + if err := utiljson.Unmarshal(raw, &u); err != nil { return nil, fmt.Errorf("metav1.FieldsV1 json invalid: %w", err) } return cbor.Marshal(u) } - return f.Raw, nil + return raw, nil } var cborNull = []byte{0xf6} @@ -327,7 +329,7 @@ func (f *FieldsV1) UnmarshalCBOR(b []byte) error { return errors.New("metav1.FieldsV1: UnmarshalCBOR on nil pointer") } if !bytes.Equal(b, cborNull) { - f.Raw = append(f.Raw[0:0], b...) + f.SetRawBytes(b) } return nil } @@ -362,8 +364,13 @@ const ( // or, if a tag-enclosed map, an initial byte with major type "tag" (0xf6, 0xa0...0xbf, or // 0xc6...0xdb). The two sets of valid initial bytes don't intersect. func (f FieldsV1) getContentType() int { - if len(f.Raw) > 0 { - p := f.Raw[0] + reader := f.GetRawReader() + if reader.Size() > 0 { + var buf [1]byte + if _, err := reader.Read(buf[:]); err != nil { + return fieldsV1InvalidOrEmpty + } + p := buf[0] switch p { case 'n', '{', '\t', '\r', '\n', ' ': return fieldsV1InvalidOrValidJSONObject diff --git a/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/meta.go b/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/meta.go index 92d3ed5e012..6ae1b095fc5 100644 --- a/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/meta.go +++ b/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/meta.go @@ -94,6 +94,13 @@ type ListInterface interface { SetRemainingItemCount(c *int64) } +// ShardedListInterface can be implemented by list types to indicate that they +// represent a sharded subset of the full collection rather than the complete list. +type ShardedListInterface interface { + GetShardInfo() *ShardInfo + SetShardInfo(*ShardInfo) +} + // Type exposes the type and APIVersion of versioned or internal API objects. // TODO: move this, and TypeMeta and ListMeta, to a different package type Type interface { @@ -113,6 +120,8 @@ func (meta *ListMeta) GetContinue() string { return meta.Continue func (meta *ListMeta) SetContinue(c string) { meta.Continue = c } func (meta *ListMeta) GetRemainingItemCount() *int64 { return meta.RemainingItemCount } func (meta *ListMeta) SetRemainingItemCount(c *int64) { meta.RemainingItemCount = c } +func (meta *ListMeta) GetShardInfo() *ShardInfo { return meta.ShardInfo } +func (meta *ListMeta) SetShardInfo(s *ShardInfo) { meta.ShardInfo = s } func (obj *TypeMeta) GetObjectKind() schema.ObjectKind { return obj } diff --git a/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/micro_time_fuzz.go b/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/micro_time_fuzz.go index a5f437b4b38..338ea9be722 100644 --- a/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/micro_time_fuzz.go +++ b/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/micro_time_fuzz.go @@ -1,5 +1,4 @@ //go:build !notest -// +build !notest /* Copyright 2020 The Kubernetes Authors. diff --git a/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/time_fuzz.go b/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/time_fuzz.go index 48fb978450e..14ec5f05868 100644 --- a/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/time_fuzz.go +++ b/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/time_fuzz.go @@ -1,5 +1,4 @@ //go:build !notest -// +build !notest /* Copyright 2020 The Kubernetes Authors. diff --git a/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go b/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go index 9970e877d09..c8b87f20c8e 100644 --- a/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go +++ b/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go @@ -92,6 +92,26 @@ type ListMeta struct { // should not rely on the remainingItemCount to be set or to be exact. // +optional RemainingItemCount *int64 `json:"remainingItemCount,omitempty" protobuf:"bytes,4,opt,name=remainingItemCount"` + + // shardInfo is set when the list is a filtered subset of the full collection, + // as selected by a shard selector on the request. It echoes back the selector + // so clients can verify which shard they received and merge sharded responses. + // Clients should not cache sharded list responses as a full representation + // of the collection. + // + // This is an alpha field and requires enabling the ShardedListAndWatch feature gate. + // +featureGate=ShardedListAndWatch + // +optional + ShardInfo *ShardInfo `json:"shardInfo,omitempty" protobuf:"bytes,5,opt,name=shardInfo"` +} + +// ShardInfo describes the shard selector that was applied to produce a list response. +// Its presence on a list response indicates the list is a filtered subset. +type ShardInfo struct { + // selector is the shard selector string from the request, echoed back so clients + // can verify which shard they received and merge responses from multiple shards. + // +required + Selector string `json:"selector" protobuf:"bytes,1,opt,name=selector"` } // Field path constants that are specific to the internal API @@ -430,6 +450,38 @@ type ListOptions struct { // compatibility reasons) and to false otherwise. // +optional SendInitialEvents *bool `json:"sendInitialEvents,omitempty" protobuf:"varint,11,opt,name=sendInitialEvents"` + + // shardSelector restricts the list of returned objects using a CEL-based + // shard selector expression. The format uses the shardRange() function + // combined with || (logical OR) to specify one or more hash ranges: + // + // shardRange(object.metadata.uid, '0x0', '0x8000000000000000') + // shardRange(object.metadata.uid, '0x0', '0x8000000000000000') || shardRange(object.metadata.uid, '0x8000000000000000', '0x10000000000000000') + // + // Field paths use CEL-style object-rooted syntax (e.g. "object.metadata.uid"), + // NOT the fieldSelector format ("metadata.uid"). Currently supported paths: + // - object.metadata.uid + // - object.metadata.namespace + // + // hexStart and hexEnd are single-quoted CEL string literals with a '0x' prefix, + // defining the inclusive lower and exclusive upper bounds over the 64-bit FNV-1a + // hash space. The full range is [0x0, 0x10000000000000000), where the exclusive + // upper bound equals 2^64. + // + // Examples: + // 2-shard split: + // shard 0: shardRange(object.metadata.uid, '0x0000000000000000', '0x8000000000000000') + // shard 1: shardRange(object.metadata.uid, '0x8000000000000000', '0x10000000000000000') + // 4-shard split: + // shard 0: shardRange(object.metadata.uid, '0x0000000000000000', '0x4000000000000000') + // shard 1: shardRange(object.metadata.uid, '0x4000000000000000', '0x8000000000000000') + // shard 2: shardRange(object.metadata.uid, '0x8000000000000000', '0xc000000000000000') + // shard 3: shardRange(object.metadata.uid, '0xc000000000000000', '0x10000000000000000') + // + // This is an alpha field and requires enabling the ShardedListAndWatch feature gate. + // +featureGate=ShardedListAndWatch + // +optional + ShardSelector string `json:"shardSelector,omitempty" protobuf:"bytes,15,opt,name=shardSelector"` } const ( @@ -1384,27 +1436,6 @@ const ( ManagedFieldsOperationUpdate ManagedFieldsOperationType = "Update" ) -// FieldsV1 stores a set of fields in a data structure like a Trie, in JSON format. -// -// Each key is either a '.' representing the field itself, and will always map to an empty set, -// or a string representing a sub-field or item. The string will follow one of these four formats: -// 'f:', where is the name of a field in a struct, or key in a map -// 'v:', where is the exact json formatted value of a list item -// 'i:', where is position of a item in a list -// 'k:', where is a map of a list item's key fields to their unique values -// If a key maps to an empty Fields value, the field that key represents is part of the set. -// -// The exact format is defined in sigs.k8s.io/structured-merge-diff -// +protobuf.options.(gogoproto.goproto_stringer)=false -type FieldsV1 struct { - // Raw is the underlying serialization of this object. - Raw []byte `json:"-" protobuf:"bytes,1,opt,name=Raw"` -} - -func (f FieldsV1) String() string { - return string(f.Raw) -} - // TODO: Table does not generate to protobuf because of the interface{} - fix protobuf // generation to support a meta type that can accept any valid JSON. This can be introduced // in a v1 because clients a) receive an error if they try to access proto today, and b) diff --git a/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types_swagger_doc_generated.go b/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types_swagger_doc_generated.go index 405496d3df5..c45c00f1aac 100644 --- a/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types_swagger_doc_generated.go +++ b/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types_swagger_doc_generated.go @@ -147,14 +147,6 @@ func (FieldSelectorRequirement) SwaggerDoc() map[string]string { return map_FieldSelectorRequirement } -var map_FieldsV1 = map[string]string{ - "": "FieldsV1 stores a set of fields in a data structure like a Trie, in JSON format.\n\nEach key is either a '.' representing the field itself, and will always map to an empty set, or a string representing a sub-field or item. The string will follow one of these four formats: 'f:', where is the name of a field in a struct, or key in a map 'v:', where is the exact json formatted value of a list item 'i:', where is position of a item in a list 'k:', where is a map of a list item's key fields to their unique values If a key maps to an empty Fields value, the field that key represents is part of the set.\n\nThe exact format is defined in sigs.k8s.io/structured-merge-diff", -} - -func (FieldsV1) SwaggerDoc() map[string]string { - return map_FieldsV1 -} - var map_GetOptions = map[string]string{ "": "GetOptions is the standard query options to the standard REST get call.", "resourceVersion": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", @@ -211,6 +203,7 @@ var map_ListMeta = map[string]string{ "resourceVersion": "String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency", "continue": "continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a consistent list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response, unless you have received this token from an error message.", "remainingItemCount": "remainingItemCount is the number of subsequent items in the list which are not included in this list response. If the list request contained label or field selectors, then the number of remaining items is unknown and the field will be left unset and omitted during serialization. If the list is complete (either because it is not chunking or because this is the last chunk), then there are no more remaining items and this field will be left unset and omitted during serialization. Servers older than v1.15 do not set this field. The intended use of the remainingItemCount is *estimating* the size of a collection. Clients should not rely on the remainingItemCount to be set or to be exact.", + "shardInfo": "shardInfo is set when the list is a filtered subset of the full collection, as selected by a shard selector on the request. It echoes back the selector so clients can verify which shard they received and merge sharded responses. Clients should not cache sharded list responses as a full representation of the collection.\n\nThis is an alpha field and requires enabling the ShardedListAndWatch feature gate.", } func (ListMeta) SwaggerDoc() map[string]string { @@ -229,6 +222,7 @@ var map_ListOptions = map[string]string{ "limit": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", "continue": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", "sendInitialEvents": "`sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched.\n\nWhen `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan\n is interpreted as \"data at least as new as the provided `resourceVersion`\"\n and the bookmark event is send when the state is synced\n to a `resourceVersion` at least as fresh as the one provided by the ListOptions.\n If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the\n bookmark event is send when the state is synced at least to the moment\n when request started being processed.\n- `resourceVersionMatch` set to any other value or unset\n Invalid error is returned.\n\nDefaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise.", + "shardSelector": "shardSelector restricts the list of returned objects using a CEL-based shard selector expression. The format uses the shardRange() function combined with || (logical OR) to specify one or more hash ranges:\n\n shardRange(object.metadata.uid, '0x0', '0x8000000000000000')\n shardRange(object.metadata.uid, '0x0', '0x8000000000000000') || shardRange(object.metadata.uid, '0x8000000000000000', '0x10000000000000000')\n\nField paths use CEL-style object-rooted syntax (e.g. \"object.metadata.uid\"), NOT the fieldSelector format (\"metadata.uid\"). Currently supported paths:\n - object.metadata.uid\n - object.metadata.namespace\n\nhexStart and hexEnd are single-quoted CEL string literals with a '0x' prefix, defining the inclusive lower and exclusive upper bounds over the 64-bit FNV-1a hash space. The full range is [0x0, 0x10000000000000000), where the exclusive upper bound equals 2^64.\n\nExamples:\n 2-shard split:\n shard 0: shardRange(object.metadata.uid, '0x0000000000000000', '0x8000000000000000')\n shard 1: shardRange(object.metadata.uid, '0x8000000000000000', '0x10000000000000000')\n 4-shard split:\n shard 0: shardRange(object.metadata.uid, '0x0000000000000000', '0x4000000000000000')\n shard 1: shardRange(object.metadata.uid, '0x4000000000000000', '0x8000000000000000')\n shard 2: shardRange(object.metadata.uid, '0x8000000000000000', '0xc000000000000000')\n shard 3: shardRange(object.metadata.uid, '0xc000000000000000', '0x10000000000000000')\n\nThis is an alpha field and requires enabling the ShardedListAndWatch feature gate.", } func (ListOptions) SwaggerDoc() map[string]string { @@ -355,6 +349,15 @@ func (ServerAddressByClientCIDR) SwaggerDoc() map[string]string { return map_ServerAddressByClientCIDR } +var map_ShardInfo = map[string]string{ + "": "ShardInfo describes the shard selector that was applied to produce a list response. Its presence on a list response indicates the list is a filtered subset.", + "selector": "selector is the shard selector string from the request, echoed back so clients can verify which shard they received and merge responses from multiple shards.", +} + +func (ShardInfo) SwaggerDoc() map[string]string { + return map_ShardInfo +} + var map_Status = map[string]string{ "": "Status is a return value for calls that don't return other objects.", "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", diff --git a/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.conversion.go b/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.conversion.go index 82e2722404c..735cbcb08f1 100644 --- a/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.conversion.go +++ b/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.conversion.go @@ -440,6 +440,13 @@ func autoConvert_url_Values_To_v1_ListOptions(in *url.Values, out *ListOptions, } else { out.SendInitialEvents = nil } + if values, ok := map[string][]string(*in)["shardSelector"]; ok && len(values) > 0 { + if err := runtime.Convert_Slice_string_To_string(&values, &out.ShardSelector, s); err != nil { + return err + } + } else { + out.ShardSelector = "" + } return nil } diff --git a/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.deepcopy.go b/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.deepcopy.go index 6b0d0dfee96..eb7eb80d9ba 100644 --- a/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.deepcopy.go +++ b/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.deepcopy.go @@ -353,27 +353,6 @@ func (in *FieldSelectorRequirement) DeepCopy() *FieldSelectorRequirement { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FieldsV1) DeepCopyInto(out *FieldsV1) { - *out = *in - if in.Raw != nil { - in, out := &in.Raw, &out.Raw - *out = make([]byte, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FieldsV1. -func (in *FieldsV1) DeepCopy() *FieldsV1 { - if in == nil { - return nil - } - out := new(FieldsV1) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GetOptions) DeepCopyInto(out *GetOptions) { *out = *in @@ -606,6 +585,11 @@ func (in *ListMeta) DeepCopyInto(out *ListMeta) { *out = new(int64) **out = **in } + if in.ShardInfo != nil { + in, out := &in.ShardInfo, &out.ShardInfo + *out = new(ShardInfo) + **out = **in + } return } @@ -663,8 +647,7 @@ func (in *ManagedFieldsEntry) DeepCopyInto(out *ManagedFieldsEntry) { } if in.FieldsV1 != nil { in, out := &in.FieldsV1, &out.FieldsV1 - *out = new(FieldsV1) - (*in).DeepCopyInto(*out) + *out = (*in).DeepCopy() } return } @@ -947,6 +930,22 @@ func (in *ServerAddressByClientCIDR) DeepCopy() *ServerAddressByClientCIDR { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ShardInfo) DeepCopyInto(out *ShardInfo) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ShardInfo. +func (in *ShardInfo) DeepCopy() *ShardInfo { + if in == nil { + return nil + } + out := new(ShardInfo) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Status) DeepCopyInto(out *Status) { *out = *in diff --git a/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.model_name.go b/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.model_name.go index fd6e876ece2..3df687707c6 100644 --- a/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.model_name.go +++ b/apis/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/zz_generated.model_name.go @@ -201,6 +201,11 @@ func (in ServerAddressByClientCIDR) OpenAPIModelName() string { return "io.k8s.apimachinery.pkg.apis.meta.v1.ServerAddressByClientCIDR" } +// OpenAPIModelName returns the OpenAPI model name for this type. +func (in ShardInfo) OpenAPIModelName() string { + return "io.k8s.apimachinery.pkg.apis.meta.v1.ShardInfo" +} + // OpenAPIModelName returns the OpenAPI model name for this type. func (in Status) OpenAPIModelName() string { return "io.k8s.apimachinery.pkg.apis.meta.v1.Status" diff --git a/apis/vendor/k8s.io/apimachinery/pkg/runtime/generated.protomessage.pb.go b/apis/vendor/k8s.io/apimachinery/pkg/runtime/generated.protomessage.pb.go deleted file mode 100644 index 1716853ff17..00000000000 --- a/apis/vendor/k8s.io/apimachinery/pkg/runtime/generated.protomessage.pb.go +++ /dev/null @@ -1,28 +0,0 @@ -//go:build kubernetes_protomessage_one_more_release -// +build kubernetes_protomessage_one_more_release - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by go-to-protobuf. DO NOT EDIT. - -package runtime - -func (*RawExtension) ProtoMessage() {} - -func (*TypeMeta) ProtoMessage() {} - -func (*Unknown) ProtoMessage() {} diff --git a/apis/vendor/k8s.io/apimachinery/pkg/runtime/schema/generated.protomessage.pb.go b/apis/vendor/k8s.io/apimachinery/pkg/runtime/schema/generated.protomessage.pb.go deleted file mode 100644 index 047437377fb..00000000000 --- a/apis/vendor/k8s.io/apimachinery/pkg/runtime/schema/generated.protomessage.pb.go +++ /dev/null @@ -1,22 +0,0 @@ -//go:build kubernetes_protomessage_one_more_release -// +build kubernetes_protomessage_one_more_release - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by go-to-protobuf. DO NOT EDIT. - -package schema diff --git a/apis/vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/decode.go b/apis/vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/decode.go index 0210132ffaf..4a7055c10fd 100644 --- a/apis/vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/decode.go +++ b/apis/vendor/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/decode.go @@ -58,12 +58,18 @@ var decode cbor.DecMode = func() cbor.DecMode { // with or without tagging. If a tag number is present, it must be valid. TimeTag: cbor.DecTagOptional, - // Observed depth up to 16 in fuzzed batch/v1 CronJobList. JSON implementation limit - // is 10000. - MaxNestedLevels: 64, - - MaxArrayElements: 1024, - MaxMapPairs: 1024, + // MaxNestedLevels is set to the same value used in the JSON implementation. + MaxNestedLevels: 10000, + + // MaxArrayElements is set to the maximum allowed by the cbor library. We rely on + // the library initial wellformedness scan and on the api max request limit to + // prevent preallocating very large slices during decoding. + MaxArrayElements: 2147483647, + + // MaxMapPairs specifies the maximum number of key-value pairs allowed in a map. + // We selected this value as it is large enough so that in practice the API server + // decoder will always hit the request body limit before the limit here is reached. + MaxMapPairs: 2097152, // Indefinite-length sequences aren't produced by this serializer, but other // implementations can. diff --git a/apis/vendor/k8s.io/apimachinery/pkg/util/intstr/generated.protomessage.pb.go b/apis/vendor/k8s.io/apimachinery/pkg/util/intstr/generated.protomessage.pb.go deleted file mode 100644 index 2853a018300..00000000000 --- a/apis/vendor/k8s.io/apimachinery/pkg/util/intstr/generated.protomessage.pb.go +++ /dev/null @@ -1,24 +0,0 @@ -//go:build kubernetes_protomessage_one_more_release -// +build kubernetes_protomessage_one_more_release - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by go-to-protobuf. DO NOT EDIT. - -package intstr - -func (*IntOrString) ProtoMessage() {} diff --git a/apis/vendor/k8s.io/apimachinery/pkg/util/intstr/instr_fuzz.go b/apis/vendor/k8s.io/apimachinery/pkg/util/intstr/instr_fuzz.go index 2d6f6a0ccca..494325c1f3d 100644 --- a/apis/vendor/k8s.io/apimachinery/pkg/util/intstr/instr_fuzz.go +++ b/apis/vendor/k8s.io/apimachinery/pkg/util/intstr/instr_fuzz.go @@ -1,5 +1,4 @@ //go:build !notest -// +build !notest /* Copyright 2020 The Kubernetes Authors. diff --git a/apis/vendor/k8s.io/apimachinery/pkg/util/net/http.go b/apis/vendor/k8s.io/apimachinery/pkg/util/net/http.go index 8cc1810af13..8912804c50e 100644 --- a/apis/vendor/k8s.io/apimachinery/pkg/util/net/http.go +++ b/apis/vendor/k8s.io/apimachinery/pkg/util/net/http.go @@ -132,9 +132,11 @@ func SetTransportDefaults(t *http.Transport) *http.Transport { t = SetOldTransportDefaults(t) // Allow clients to disable http2 if needed. if s := os.Getenv("DISABLE_HTTP2"); len(s) > 0 { + //nolint:logcheck // Should be rare, not worth converting. klog.Info("HTTP2 has been explicitly disabled") } else if allowsHTTP2(t) { if err := configureHTTP2Transport(t); err != nil { + //nolint:logcheck // Should be rare, not worth converting. klog.Warningf("Transport failed http2 configuration: %v", err) } } @@ -148,6 +150,7 @@ func readIdleTimeoutSeconds() int { if s := os.Getenv("HTTP2_READ_IDLE_TIMEOUT_SECONDS"); len(s) > 0 { i, err := strconv.Atoi(s) if err != nil { + //nolint:logcheck // Should be rare, not worth converting. klog.Warningf("Illegal HTTP2_READ_IDLE_TIMEOUT_SECONDS(%q): %v."+ " Default value %d is used", s, err, ret) return ret @@ -162,6 +165,7 @@ func pingTimeoutSeconds() int { if s := os.Getenv("HTTP2_PING_TIMEOUT_SECONDS"); len(s) > 0 { i, err := strconv.Atoi(s) if err != nil { + //nolint:logcheck // Should be rare, not worth converting. klog.Warningf("Illegal HTTP2_PING_TIMEOUT_SECONDS(%q): %v."+ " Default value %d is used", s, err, ret) return ret @@ -256,6 +260,7 @@ func CloseIdleConnectionsFor(transport http.RoundTripper) { case RoundTripperWrapper: CloseIdleConnectionsFor(transport.WrappedRoundTripper()) default: + //nolint:logcheck // Should be rare, not worth converting. klog.Warningf("unknown transport type: %T", transport) } } diff --git a/apis/vendor/k8s.io/apimachinery/pkg/util/net/interface.go b/apis/vendor/k8s.io/apimachinery/pkg/util/net/interface.go index 01d028e727d..3ccf227af02 100644 --- a/apis/vendor/k8s.io/apimachinery/pkg/util/net/interface.go +++ b/apis/vendor/k8s.io/apimachinery/pkg/util/net/interface.go @@ -201,12 +201,12 @@ func parseIP(str string, family AddressFamily) (net.IP, error) { return net.IP(bytes), nil } -func isInterfaceUp(intf *net.Interface) bool { +func isInterfaceUp(logger klog.Logger, intf *net.Interface) bool { if intf == nil { return false } if intf.Flags&net.FlagUp != 0 { - klog.V(4).Infof("Interface %v is up", intf.Name) + logger.V(4).Info("Interface is up", "interface", intf.Name) return true } return false @@ -218,23 +218,23 @@ func isLoopbackOrPointToPoint(intf *net.Interface) bool { // getMatchingGlobalIP returns the first valid global unicast address of the given // 'family' from the list of 'addrs'. -func getMatchingGlobalIP(addrs []net.Addr, family AddressFamily) (net.IP, error) { +func getMatchingGlobalIP(logger klog.Logger, addrs []net.Addr, family AddressFamily) (net.IP, error) { if len(addrs) > 0 { for i := range addrs { - klog.V(4).Infof("Checking addr %s.", addrs[i].String()) + logger.V(4).Info("Checking for matching global IP", "address", addrs[i]) ip, _, err := netutils.ParseCIDRSloppy(addrs[i].String()) if err != nil { return nil, err } if memberOf(ip, family) { if ip.IsGlobalUnicast() { - klog.V(4).Infof("IP found %v", ip) + logger.V(4).Info("IP found", "IP", ip) return ip, nil } else { - klog.V(4).Infof("Non-global unicast address found %v", ip) + logger.V(4).Info("Non-global unicast address found", "IP", ip) } } else { - klog.V(4).Infof("%v is not an IPv%d address", ip, int(family)) + logger.V(4).Info("IP address has wrong version", "IP", ip, "IPVersion", int(family)) } } @@ -244,23 +244,23 @@ func getMatchingGlobalIP(addrs []net.Addr, family AddressFamily) (net.IP, error) // getIPFromInterface gets the IPs on an interface and returns a global unicast address, if any. The // interface must be up, the IP must in the family requested, and the IP must be a global unicast address. -func getIPFromInterface(intfName string, forFamily AddressFamily, nw networkInterfacer) (net.IP, error) { +func getIPFromInterface(logger klog.Logger, intfName string, forFamily AddressFamily, nw networkInterfacer) (net.IP, error) { intf, err := nw.InterfaceByName(intfName) if err != nil { return nil, err } - if isInterfaceUp(intf) { + if isInterfaceUp(logger, intf) { addrs, err := nw.Addrs(intf) if err != nil { return nil, err } - klog.V(4).Infof("Interface %q has %d addresses :%v.", intfName, len(addrs), addrs) - matchingIP, err := getMatchingGlobalIP(addrs, forFamily) + logger.V(4).Info("Found addresses for interface", "interface", intfName, "numAddresses", len(addrs), "addresses", addrs) + matchingIP, err := getMatchingGlobalIP(logger, addrs, forFamily) if err != nil { return nil, err } if matchingIP != nil { - klog.V(4).Infof("Found valid IPv%d address %v for interface %q.", int(forFamily), matchingIP, intfName) + logger.V(4).Info("Found valid address", "IPVersion", int(forFamily), "IP", matchingIP, "interface", intfName) return matchingIP, nil } } @@ -269,13 +269,13 @@ func getIPFromInterface(intfName string, forFamily AddressFamily, nw networkInte // getIPFromLoopbackInterface gets the IPs on a loopback interface and returns a global unicast address, if any. // The loopback interface must be up, the IP must in the family requested, and the IP must be a global unicast address. -func getIPFromLoopbackInterface(forFamily AddressFamily, nw networkInterfacer) (net.IP, error) { +func getIPFromLoopbackInterface(logger klog.Logger, forFamily AddressFamily, nw networkInterfacer) (net.IP, error) { intfs, err := nw.Interfaces() if err != nil { return nil, err } for _, intf := range intfs { - if !isInterfaceUp(&intf) { + if !isInterfaceUp(logger, &intf) { continue } if intf.Flags&(net.FlagLoopback) != 0 { @@ -283,13 +283,13 @@ func getIPFromLoopbackInterface(forFamily AddressFamily, nw networkInterfacer) ( if err != nil { return nil, err } - klog.V(4).Infof("Interface %q has %d addresses :%v.", intf.Name, len(addrs), addrs) - matchingIP, err := getMatchingGlobalIP(addrs, forFamily) + logger.V(4).Info("Found addresses for interface", "interface", intf.Name, "numAddresses", len(addrs), "addresses", addrs) + matchingIP, err := getMatchingGlobalIP(logger, addrs, forFamily) if err != nil { return nil, err } if matchingIP != nil { - klog.V(4).Infof("Found valid IPv%d address %v for interface %q.", int(forFamily), matchingIP, intf.Name) + logger.V(4).Info("Found valid address", "IPVersion", int(forFamily), "IP", matchingIP, "interface", intf.Name) return matchingIP, nil } } @@ -309,7 +309,7 @@ func memberOf(ip net.IP, family AddressFamily) bool { // chooseIPFromHostInterfaces looks at all system interfaces, trying to find one that is up that // has a global unicast address (non-loopback, non-link local, non-point2point), and returns the IP. // addressFamilies determines whether it prefers IPv4 or IPv6 -func chooseIPFromHostInterfaces(nw networkInterfacer, addressFamilies AddressFamilyPreference) (net.IP, error) { +func chooseIPFromHostInterfaces(logger klog.Logger, nw networkInterfacer, addressFamilies AddressFamilyPreference) (net.IP, error) { intfs, err := nw.Interfaces() if err != nil { return nil, err @@ -318,14 +318,14 @@ func chooseIPFromHostInterfaces(nw networkInterfacer, addressFamilies AddressFam return nil, fmt.Errorf("no interfaces found on host.") } for _, family := range addressFamilies { - klog.V(4).Infof("Looking for system interface with a global IPv%d address", uint(family)) + logger.V(4).Info("Looking for system interface with a global address", "IPVersion", uint(family)) for _, intf := range intfs { - if !isInterfaceUp(&intf) { - klog.V(4).Infof("Skipping: down interface %q", intf.Name) + if !isInterfaceUp(logger, &intf) { + logger.V(4).Info("Skipping: interface is down", "interface", intf.Name) continue } if isLoopbackOrPointToPoint(&intf) { - klog.V(4).Infof("Skipping: LB or P2P interface %q", intf.Name) + logger.V(4).Info("Skipping: is LB or P2P", "interface", intf.Name) continue } addrs, err := nw.Addrs(&intf) @@ -333,7 +333,7 @@ func chooseIPFromHostInterfaces(nw networkInterfacer, addressFamilies AddressFam return nil, err } if len(addrs) == 0 { - klog.V(4).Infof("Skipping: no addresses on interface %q", intf.Name) + logger.V(4).Info("Skipping: no addresses", "interface", intf.Name) continue } for _, addr := range addrs { @@ -342,15 +342,15 @@ func chooseIPFromHostInterfaces(nw networkInterfacer, addressFamilies AddressFam return nil, fmt.Errorf("unable to parse CIDR for interface %q: %s", intf.Name, err) } if !memberOf(ip, family) { - klog.V(4).Infof("Skipping: no address family match for %q on interface %q.", ip, intf.Name) + logger.V(4).Info("Skipping: no address family match", "IP", ip, "interface", intf.Name) continue } // TODO: Decide if should open up to allow IPv6 LLAs in future. if !ip.IsGlobalUnicast() { - klog.V(4).Infof("Skipping: non-global address %q on interface %q.", ip, intf.Name) + logger.V(4).Info("Skipping: non-global address", "IP", ip, "interface", intf.Name) continue } - klog.V(4).Infof("Found global unicast address %q on interface %q.", ip, intf.Name) + logger.V(4).Info("Found global unicast address", "IP", ip, "interface", intf.Name) return ip, nil } } @@ -363,20 +363,31 @@ func chooseIPFromHostInterfaces(nw networkInterfacer, addressFamilies AddressFam // interfaces. Otherwise, it will use IPv4 and IPv6 route information to return the // IP of the interface with a gateway on it (with priority given to IPv4). For a node // with no internet connection, it returns error. +// +//logcheck:context // [ChooseHostInterfaceWithLogger] should be used instead of ChooseHostInterface in code which supports contextual logging. func ChooseHostInterface() (net.IP, error) { - return chooseHostInterface(preferIPv4) + return ChooseHostInterfaceWithLogger(klog.Background()) } -func chooseHostInterface(addressFamilies AddressFamilyPreference) (net.IP, error) { +// ChooseHostInterfaceWithLogger is a method used fetch an IP for a daemon. +// If there is no routing info file, it will choose a global IP from the system +// interfaces. Otherwise, it will use IPv4 and IPv6 route information to return the +// IP of the interface with a gateway on it (with priority given to IPv4). For a node +// with no internet connection, it returns error. +func ChooseHostInterfaceWithLogger(logger klog.Logger) (net.IP, error) { + return chooseHostInterface(logger, preferIPv4) +} + +func chooseHostInterface(logger klog.Logger, addressFamilies AddressFamilyPreference) (net.IP, error) { var nw networkInterfacer = networkInterface{} if _, err := os.Stat(ipv4RouteFile); os.IsNotExist(err) { - return chooseIPFromHostInterfaces(nw, addressFamilies) + return chooseIPFromHostInterfaces(logger, nw, addressFamilies) } routes, err := getAllDefaultRoutes() if err != nil { return nil, err } - return chooseHostInterfaceFromRoute(routes, nw, addressFamilies) + return chooseHostInterfaceFromRoute(logger, routes, nw, addressFamilies) } // networkInterfacer defines an interface for several net library functions. Production @@ -427,36 +438,36 @@ func getAllDefaultRoutes() ([]Route, error) { // global IP address from the interface for the route. If there are routes but no global // address is obtained from the interfaces, it checks if the loopback interface has a global address. // addressFamilies determines whether it prefers IPv4 or IPv6 -func chooseHostInterfaceFromRoute(routes []Route, nw networkInterfacer, addressFamilies AddressFamilyPreference) (net.IP, error) { +func chooseHostInterfaceFromRoute(logger klog.Logger, routes []Route, nw networkInterfacer, addressFamilies AddressFamilyPreference) (net.IP, error) { for _, family := range addressFamilies { - klog.V(4).Infof("Looking for default routes with IPv%d addresses", uint(family)) + logger.V(4).Info("Looking for default routes with IP addresses", "IPVersion", uint(family)) for _, route := range routes { if route.Family != family { continue } - klog.V(4).Infof("Default route transits interface %q", route.Interface) - finalIP, err := getIPFromInterface(route.Interface, family, nw) + logger.V(4).Info("Default route transits interface", "interface", route.Interface) + finalIP, err := getIPFromInterface(logger, route.Interface, family, nw) if err != nil { return nil, err } if finalIP != nil { - klog.V(4).Infof("Found active IP %v ", finalIP) + logger.V(4).Info("Found active IP", "IP", finalIP) return finalIP, nil } // In case of network setups where default routes are present, but network // interfaces use only link-local addresses (e.g. as described in RFC5549). // the global IP is assigned to the loopback interface, and we should use it - loopbackIP, err := getIPFromLoopbackInterface(family, nw) + loopbackIP, err := getIPFromLoopbackInterface(logger, family, nw) if err != nil { return nil, err } if loopbackIP != nil { - klog.V(4).Infof("Found active IP %v on Loopback interface", loopbackIP) + logger.V(4).Info("Found active IP on Loopback interface", "IP", loopbackIP) return loopbackIP, nil } } } - klog.V(4).Infof("No active IP found by looking at default routes") + logger.V(4).Info("No active IP found by looking at default routes") return nil, fmt.Errorf("unable to select an IP from default routes.") } @@ -465,14 +476,25 @@ func chooseHostInterfaceFromRoute(routes []Route, nw networkInterfacer, addressF // If bindAddress is unspecified or loopback, it returns the default IP of the same // address family as bindAddress. // Otherwise, it just returns bindAddress. +// +//logcheck:context // [ResolveBindAddressWithLogger] should be used instead of ResolveBindAddress in code which supports contextual logging. func ResolveBindAddress(bindAddress net.IP) (net.IP, error) { + return ResolveBindAddressWithLogger(klog.Background(), bindAddress) +} + +// ResolveBindAddressWithLogger returns the IP address of a daemon, based on the given bindAddress: +// If bindAddress is unset, it returns the host's default IP, as with ChooseHostInterface(). +// If bindAddress is unspecified or loopback, it returns the default IP of the same +// address family as bindAddress. +// Otherwise, it just returns bindAddress. +func ResolveBindAddressWithLogger(logger klog.Logger, bindAddress net.IP) (net.IP, error) { addressFamilies := preferIPv4 if bindAddress != nil && memberOf(bindAddress, familyIPv6) { addressFamilies = preferIPv6 } if bindAddress == nil || bindAddress.IsUnspecified() || bindAddress.IsLoopback() { - hostIP, err := chooseHostInterface(addressFamilies) + hostIP, err := chooseHostInterface(logger, addressFamilies) if err != nil { return nil, err } @@ -485,10 +507,20 @@ func ResolveBindAddress(bindAddress net.IP) (net.IP, error) { // This is required in case of network setups where default routes are present, but network // interfaces use only link-local addresses (e.g. as described in RFC5549). // e.g when using BGP to announce a host IP over link-local ip addresses and this ip address is attached to the lo interface. +// +//logcheck:context // [ChooseBindAddressForInterfaceWithLogger] should be used instead of ChooseBindAddressForInterface in code which supports contextual logging. func ChooseBindAddressForInterface(intfName string) (net.IP, error) { + return ChooseBindAddressForInterfaceWithLogger(klog.Background(), intfName) +} + +// ChooseBindAddressForInterfaceWithLogger choose a global IP for a specific interface, with priority given to IPv4. +// This is required in case of network setups where default routes are present, but network +// interfaces use only link-local addresses (e.g. as described in RFC5549). +// e.g when using BGP to announce a host IP over link-local ip addresses and this ip address is attached to the lo interface. +func ChooseBindAddressForInterfaceWithLogger(logger klog.Logger, intfName string) (net.IP, error) { var nw networkInterfacer = networkInterface{} for _, family := range preferIPv4 { - ip, err := getIPFromInterface(intfName, family, nw) + ip, err := getIPFromInterface(logger, intfName, family, nw) if err != nil { return nil, err } diff --git a/apis/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go b/apis/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go index cc09bdbc436..38c1f7b03c4 100644 --- a/apis/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go +++ b/apis/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go @@ -17,14 +17,17 @@ limitations under the License. package runtime import ( + "bytes" "context" "fmt" "net/http" "runtime" + "strings" "sync" "time" "k8s.io/klog/v2" + "k8s.io/klog/v2/textlogger" ) var ( @@ -55,7 +58,6 @@ func HandleCrash(additionalHandlers ...func(interface{})) { if r := recover(); r != nil { additionalHandlersWithContext := make([]func(context.Context, interface{}), len(additionalHandlers)) for i, handler := range additionalHandlers { - handler := handler // capture loop variable additionalHandlersWithContext[i] = func(_ context.Context, r interface{}) { handler(r) } @@ -155,8 +157,37 @@ var ErrorHandlers = []ErrorHandler{ backoffError(1 * time.Millisecond), } +// ErrorHandler is called indirectly through [HandleError], [HandleErrorWithContext] or [HandleErrorWithLogger]. +// It is passed the same parameters that a structured logging backend needs to log a problem. +// It follows the semantic described for [HandleErrorWithContext] and [logr.Logger.Error]: +// - err is optional and may be nil +// - msg is string that describes the problem +// - keysAndValues contains additional information that varies between different occurrences of the problem +// +// [ErrorToString] can be used to convert these parameters into a single string, using the klog text output. type ErrorHandler func(ctx context.Context, err error, msg string, keysAndValues ...interface{}) +// ErrorToString takes the parameters passed to [ErrorHandler] and +// formats them as a string using the klog text output. +// +// If any of the values is a multi-line string, then the resulting +// string also uses line breaks and indention for the sake of readability. +// Does not include a trailing newline. +// +// Use errors.New if an error instead of a string is needed. +func ErrorToString(err error, msg string, keysAndValues ...interface{}) string { + var buffer bytes.Buffer + config := textlogger.NewConfig( + textlogger.Output(&buffer), + textlogger.WithHeader(false), + ) + logger := textlogger.NewLogger(config) + logger.Error(err, msg, keysAndValues...) + result := buffer.String() + result = strings.TrimSpace(result) + return result +} + // HandlerError is a method to invoke when a non-user facing piece of code cannot // return an error and needs to indicate it has been ignored. Invoking this method // is preferable to logging the error - the default behavior is to log but the diff --git a/apis/vendor/k8s.io/apimachinery/pkg/util/validation/field/error_matcher.go b/apis/vendor/k8s.io/apimachinery/pkg/util/validation/field/error_matcher.go index f0264e50c7d..1eeb71ff53e 100644 --- a/apis/vendor/k8s.io/apimachinery/pkg/util/validation/field/error_matcher.go +++ b/apis/vendor/k8s.io/apimachinery/pkg/util/validation/field/error_matcher.go @@ -40,10 +40,12 @@ type ErrorMatcher struct { matchField bool // TODO(thockin): consider whether value could be assumed - if the // "want" error has a nil value, don't match on value. - matchValue bool - matchOrigin bool - matchDetail func(want, got string) bool - requireOriginWhenInvalid bool + matchValue bool + matchOrigin bool + matchDetail func(want, got string) bool + requireOriginWhenInvalid bool + matchValidationStabilityLevel bool + matchSource bool // normalizationRules holds the pre-compiled regex patterns for path normalization. normalizationRules []NormalizationRule } @@ -86,6 +88,14 @@ func (m ErrorMatcher) Matches(want, got *Error) bool { if m.matchDetail != nil && !m.matchDetail(want.Detail, got.Detail) { return false } + if m.matchValidationStabilityLevel && want.ValidationStabilityLevel != got.ValidationStabilityLevel { + return false + } + + if m.matchSource && want.FromImperative != got.FromImperative { + return false + } + return true } @@ -148,6 +158,14 @@ func (m ErrorMatcher) Render(e *Error) string { comma() buf.WriteString(fmt.Sprintf("Detail=%q", e.Detail)) } + if m.matchValidationStabilityLevel { + comma() + buf.WriteString(fmt.Sprintf("ValidationStabilityLevel=%s", e.ValidationStabilityLevel)) + } + if m.matchSource { + comma() + buf.WriteString(fmt.Sprintf("FromImperative=%t", e.FromImperative)) + } return "{" + buf.String() + "}" } @@ -224,6 +242,20 @@ func (m ErrorMatcher) RequireOriginWhenInvalid() ErrorMatcher { return m } +// BySource returns a derived ErrorMatcher which also matches by the error origination +// value of field errors. +func (m ErrorMatcher) BySource() ErrorMatcher { + m.matchSource = true + return m +} + +// ByValidationStabilityLevel returns a derived ErrorMatcher which also matches by the validation stability level +// value of field errors. +func (m ErrorMatcher) ByValidationStabilityLevel() ErrorMatcher { + m.matchValidationStabilityLevel = true + return m +} + // ByDetailExact returns a derived ErrorMatcher which also matches errors by // the exact detail string. func (m ErrorMatcher) ByDetailExact() ErrorMatcher { diff --git a/apis/vendor/k8s.io/apimachinery/pkg/util/validation/field/errors.go b/apis/vendor/k8s.io/apimachinery/pkg/util/validation/field/errors.go index 950d8386823..9357fb306ce 100644 --- a/apis/vendor/k8s.io/apimachinery/pkg/util/validation/field/errors.go +++ b/apis/vendor/k8s.io/apimachinery/pkg/util/validation/field/errors.go @@ -42,7 +42,7 @@ type Error struct { // The value should be either: // - A simple camelCase identifier (e.g., "maximum", "maxItems") // - A structured format using "format=" for validation errors related to specific formats - // (e.g., "format=dns-label", "format=qualified-name") + // (e.g. "format=k8s-short-name") // // If the Origin corresponds to an existing declarative validation tag or JSON Schema keyword, // use that same name for consistency. @@ -55,10 +55,46 @@ type Error struct { // validation. This field is to identify errors from imperative validation // that should also be caught by declarative validation. CoveredByDeclarative bool + + // FromImperative denotes these errors are originating from the hand written validations. + FromImperative bool + + // ValidationStabilityLevel denotes the validation stability level of the declarative validation from this error is returned. This should be used in the declarative validations only. + ValidationStabilityLevel ValidationStabilityLevel +} + +// ValidationStabilityLevel denotes the stability level of a validation. +type ValidationStabilityLevel int + +const ( + stabilityLevelUnknown ValidationStabilityLevel = iota + stabilityLevelAlpha + stabilityLevelBeta +) + +func (v ValidationStabilityLevel) String() string { + switch v { + case stabilityLevelAlpha: + return "alpha" + case stabilityLevelBeta: + return "beta" + default: + return "unknown" + } } var _ error = &Error{} +// IsAlpha returns true if the error is an alpha validation error. +func (e *Error) IsAlpha() bool { + return e.ValidationStabilityLevel == stabilityLevelAlpha +} + +// IsBeta returns true if the error is a beta validation error. +func (e *Error) IsBeta() bool { + return e.ValidationStabilityLevel == stabilityLevelBeta +} + // Error implements the error interface. func (e *Error) Error() string { return fmt.Sprintf("%s: %s", e.Field, e.ErrorBody()) @@ -73,10 +109,10 @@ var omitValue = OmitValueType{} func (e *Error) ErrorBody() string { var s string switch e.Type { - case ErrorTypeRequired, ErrorTypeForbidden, ErrorTypeTooLong, ErrorTypeInternal: + case ErrorTypeRequired, ErrorTypeForbidden, ErrorTypeTooLong, ErrorTypeTooShort, ErrorTypeInternal: s = e.Type.String() case ErrorTypeInvalid, ErrorTypeTypeInvalid, ErrorTypeNotSupported, - ErrorTypeNotFound, ErrorTypeDuplicate, ErrorTypeTooMany: + ErrorTypeNotFound, ErrorTypeDuplicate, ErrorTypeTooMany, ErrorTypeTooFew: if e.BadValue == omitValue { s = e.Type.String() break @@ -113,6 +149,7 @@ func (e *Error) ErrorBody() string { if len(e.Detail) != 0 { s += fmt.Sprintf(": %s", e.Detail) } + return s } @@ -164,11 +201,18 @@ const ( // report that a given list has too many items. This is similar to FieldValueTooLong, // but the error indicates quantity instead of length. ErrorTypeTooMany ErrorType = "FieldValueTooMany" + // ErrorTypeTooFew is used to report "too few". This is used to + // report that a given list has too few items. This is similar to FieldValueTooLong, + // but the error indicates quantity instead of length. + ErrorTypeTooFew ErrorType = "FieldValueTooFew" // ErrorTypeInternal is used to report other errors that are not related // to user input. See InternalError(). ErrorTypeInternal ErrorType = "InternalError" // ErrorTypeTypeInvalid is for the value did not match the schema type for that field ErrorTypeTypeInvalid ErrorType = "FieldValueTypeInvalid" + // ErrorTypeTooShort is used to report that the given value is too short. + // This is similar to ErrorTypeInvalid. See TooShort(). + ErrorTypeTooShort ErrorType = "FieldValueTooShort" ) // String converts a ErrorType into its corresponding canonical error message. @@ -190,10 +234,14 @@ func (t ErrorType) String() string { return "Too long" case ErrorTypeTooMany: return "Too many" + case ErrorTypeTooFew: + return "Too few" case ErrorTypeInternal: return "Internal error" case ErrorTypeTypeInvalid: return "Invalid value" + case ErrorTypeTooShort: + return "Too short" default: return fmt.Sprintf("", string(t)) } @@ -201,32 +249,56 @@ func (t ErrorType) String() string { // TypeInvalid returns a *Error indicating "type is invalid" func TypeInvalid(field *Path, value interface{}, detail string) *Error { - return &Error{ErrorTypeTypeInvalid, field.String(), value, detail, "", false} + return &Error{ + Type: ErrorTypeTypeInvalid, + Field: field.String(), + BadValue: value, + Detail: detail, + } } // NotFound returns a *Error indicating "value not found". This is // used to report failure to find a requested value (e.g. looking up an ID). func NotFound(field *Path, value interface{}) *Error { - return &Error{ErrorTypeNotFound, field.String(), value, "", "", false} + return &Error{ + Type: ErrorTypeNotFound, + Field: field.String(), + BadValue: value, + } } // Required returns a *Error indicating "value required". This is used // to report required values that are not provided (e.g. empty strings, null // values, or empty arrays). func Required(field *Path, detail string) *Error { - return &Error{ErrorTypeRequired, field.String(), "", detail, "", false} + return &Error{ + Type: ErrorTypeRequired, + Field: field.String(), + Detail: detail, + BadValue: "", + } } // Duplicate returns a *Error indicating "duplicate value". This is // used to report collisions of values that must be unique (e.g. names or IDs). func Duplicate(field *Path, value interface{}) *Error { - return &Error{ErrorTypeDuplicate, field.String(), value, "", "", false} + return &Error{ + Type: ErrorTypeDuplicate, + Field: field.String(), + BadValue: value, + } } // Invalid returns a *Error indicating "invalid value". This is used // to report malformed values (e.g. failed regex match, too long, out of bounds). func Invalid(field *Path, value interface{}, detail string) *Error { - return &Error{ErrorTypeInvalid, field.String(), value, detail, "", false} + return &Error{ + Type: ErrorTypeInvalid, + Field: field.String(), + BadValue: value, + Detail: detail, + } + } // NotSupported returns a *Error indicating "unsupported value". @@ -241,7 +313,12 @@ func NotSupported[T ~string](field *Path, value interface{}, validValues []T) *E } detail = "supported values: " + strings.Join(quotedValues, ", ") } - return &Error{ErrorTypeNotSupported, field.String(), value, detail, "", false} + return &Error{ + Type: ErrorTypeNotSupported, + Field: field.String(), + BadValue: value, + Detail: detail, + } } // Forbidden returns a *Error indicating "forbidden". This is used to @@ -249,7 +326,12 @@ func NotSupported[T ~string](field *Path, value interface{}, validValues []T) *E // some conditions, but which are not permitted by current conditions (e.g. // security policy). func Forbidden(field *Path, detail string) *Error { - return &Error{ErrorTypeForbidden, field.String(), "", detail, "", false} + return &Error{ + Type: ErrorTypeForbidden, + Field: field.String(), + Detail: detail, + BadValue: "", + } } // TooLong returns a *Error indicating "too long". This is used to report that @@ -267,7 +349,35 @@ func TooLong(field *Path, _ interface{}, maxLength int) *Error { } else { msg = "value is too long" } - return &Error{ErrorTypeTooLong, field.String(), "", msg, "", false} + return &Error{ + Type: ErrorTypeTooLong, + Field: field.String(), + BadValue: "", + Detail: msg, + } +} + +// TooLongCharacters returns a *Error indicating "too long". This is used to report that +// the given value is too long in characters (including multi-byte characters). +// This is similar to Invalid, but the returned error will not include the too-long value. +// If maxLength is negative, it will be included in the message. The value argument is not used. +func TooLongCharacters[T ~string](field *Path, _ T, maxLength int) *Error { + var msg string + if maxLength >= 0 { + bs := "characters" + if maxLength == 1 { + bs = "character" + } + msg = fmt.Sprintf("may not be more than %d %s", maxLength, bs) + } else { + msg = "value is too long" + } + return &Error{ + Type: ErrorTypeTooLong, + Field: field.String(), + BadValue: "", + Detail: msg, + } } // TooLongMaxLength returns a *Error indicating "too long". @@ -299,14 +409,46 @@ func TooMany(field *Path, actualQuantity, maxQuantity int) *Error { actual = omitValue } - return &Error{ErrorTypeTooMany, field.String(), actual, msg, "", false} + return &Error{ + Type: ErrorTypeTooMany, + Field: field.String(), + BadValue: actual, + Detail: msg, + } } // InternalError returns a *Error indicating "internal error". This is used // to signal that an error was found that was not directly related to user // input. The err argument must be non-nil. func InternalError(field *Path, err error) *Error { - return &Error{ErrorTypeInternal, field.String(), nil, err.Error(), "", false} + return &Error{ + Type: ErrorTypeInternal, + Field: field.String(), + BadValue: err, + Detail: err.Error(), + } +} + +// TooShort returns a *Error indicating "too short". This is used to report that +// the given value is too short in characters. This is similar to Invalid. +// If minLength is non-negative, it will be included in the message. +func TooShort[T ~string](field *Path, value T, minLength int) *Error { + var msg string + if minLength >= 0 { + bs := "characters" + if minLength == 1 { + bs = "character" + } + msg = fmt.Sprintf("must be at least %d %s", minLength, bs) + } else { + msg = "value is too short" + } + return &Error{ + Type: ErrorTypeTooShort, + Field: field.String(), + BadValue: value, + Detail: msg, + } } // ErrorList holds a set of Errors. It is plausible that we might one day have @@ -397,6 +539,46 @@ func (list ErrorList) ExtractCoveredByDeclarative() ErrorList { return newList } +// MarkAlpha marks the error as an alpha validation error. +func (e *Error) MarkAlpha() *Error { + e.ValidationStabilityLevel = stabilityLevelAlpha + return e +} + +// MarkAlpha marks the errors as alpha validation errors. +func (list ErrorList) MarkAlpha() ErrorList { + for _, err := range list { + err.ValidationStabilityLevel = stabilityLevelAlpha + } + return list +} + +// MarkBeta marks the error as a beta validation error. +func (e *Error) MarkBeta() *Error { + e.ValidationStabilityLevel = stabilityLevelBeta + return e +} + +// MarkBeta marks the errors as beta validation errors. +func (list ErrorList) MarkBeta() ErrorList { + for _, err := range list { + err.ValidationStabilityLevel = stabilityLevelBeta + } + return list +} + +func (e *Error) MarkFromImperative() *Error { + e.FromImperative = true + return e +} + +func (list ErrorList) MarkFromImperative() ErrorList { + for _, err := range list { + err.FromImperative = true + } + return list +} + // RemoveCoveredByDeclarative returns a new ErrorList containing only the errors that should not be covered by declarative validation. func (list ErrorList) RemoveCoveredByDeclarative() ErrorList { newList := ErrorList{} @@ -407,3 +589,27 @@ func (list ErrorList) RemoveCoveredByDeclarative() ErrorList { } return newList } + +// TooFew returns a *Error indicating "too few". This is used to +// report that a given list has too few items. This is similar to TooLong, +// but the returned error indicates quantity instead of length. +func TooFew(field *Path, actualQuantity, minQuantity int) *Error { + var msg string + + if minQuantity >= 0 { + is := "items" + if minQuantity == 1 { + is = "item" + } + msg = fmt.Sprintf("must have at least %d %s", minQuantity, is) + } else { + msg = "has too few items" + } + + return &Error{ + Type: ErrorTypeTooFew, + Field: field.String(), + BadValue: actualQuantity, + Detail: msg, + } +} diff --git a/apis/vendor/k8s.io/apimachinery/pkg/util/validation/ip.go b/apis/vendor/k8s.io/apimachinery/pkg/util/validation/ip.go index 6e947c74c9e..869fb0aad08 100644 --- a/apis/vendor/k8s.io/apimachinery/pkg/util/validation/ip.go +++ b/apis/vendor/k8s.io/apimachinery/pkg/util/validation/ip.go @@ -115,7 +115,7 @@ func GetWarningsForIP(fldPath *field.Path, value string) []string { // ParseAddr() doesn't) or IPv4-mapped IPv6 (.Is4In6()). Either way, // re-stringifying the net.IP value will give the preferred form. return []string{ - fmt.Sprintf("%s: non-standard IP address %q will be considered invalid in a future Kubernetes release: use %q", fldPath, value, ip.String()), + fmt.Sprintf("%s: non-standard IP address %q is invalid: use %q", fldPath, value, ip.String()), } } @@ -233,7 +233,7 @@ func GetWarningsForCIDR(fldPath *field.Path, value string) []string { // ParsePrefix() doesn't) or IPv4-mapped IPv6 (.Is4In6()). Either way, // re-stringifying the net.IPNet value will give the preferred form. warnings = append(warnings, - fmt.Sprintf("%s: non-standard CIDR value %q will be considered invalid in a future Kubernetes release: use %q", fldPath, value, ipnet.String()), + fmt.Sprintf("%s: non-standard CIDR value %q is invalid: use %q", fldPath, value, ipnet.String()), ) } diff --git a/apis/vendor/k8s.io/apimachinery/third_party/forked/golang/reflect/deep_equal.go b/apis/vendor/k8s.io/apimachinery/third_party/forked/golang/reflect/deep_equal.go index 511e625b63d..bb0fa55f212 100644 --- a/apis/vendor/k8s.io/apimachinery/third_party/forked/golang/reflect/deep_equal.go +++ b/apis/vendor/k8s.io/apimachinery/third_party/forked/golang/reflect/deep_equal.go @@ -178,7 +178,7 @@ func (e Equalities) deepValueEqual(v1, v2 reflect.Value, visited map[visit]bool, } // Two lists that are both empty and both non nil are equal - if v1.Len() == 0 || v2.Len() == 0 { + if v1.Len() == 0 && v2.Len() == 0 { return true } } @@ -229,7 +229,7 @@ func (e Equalities) deepValueEqual(v1, v2 reflect.Value, visited map[visit]bool, } // Two maps that are both empty and both non nil are equal - if v1.Len() == 0 || v2.Len() == 0 { + if v1.Len() == 0 && v2.Len() == 0 { return true } } diff --git a/apis/vendor/k8s.io/klog/v2/README.md b/apis/vendor/k8s.io/klog/v2/README.md index d45cbe1720f..a680beb405b 100644 --- a/apis/vendor/k8s.io/klog/v2/README.md +++ b/apis/vendor/k8s.io/klog/v2/README.md @@ -48,8 +48,6 @@ How to use klog - For more logging conventions (See [Logging Conventions](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/logging.md)) - See our documentation on [pkg.go.dev/k8s.io](https://pkg.go.dev/k8s.io/klog). -**NOTE**: please use the newer go versions that support semantic import versioning in modules, ideally go 1.11.4 or greater. - ### Coexisting with klog/v2 See [this example](examples/coexist_klog_v1_and_v2/) to see how to coexist with both klog/v1 and klog/v2. diff --git a/apis/vendor/k8s.io/klog/v2/internal/serialize/keyvalues.go b/apis/vendor/k8s.io/klog/v2/internal/serialize/keyvalues.go index d1a4751c94b..73f91ea5004 100644 --- a/apis/vendor/k8s.io/klog/v2/internal/serialize/keyvalues.go +++ b/apis/vendor/k8s.io/klog/v2/internal/serialize/keyvalues.go @@ -20,7 +20,9 @@ import ( "bytes" "encoding/json" "fmt" + "slices" "strconv" + "strings" "github.com/go-logr/logr" ) @@ -51,139 +53,157 @@ func WithValues(oldKV, newKV []interface{}) []interface{} { return kv } -// MergeKVs deduplicates elements provided in two key/value slices. -// -// Keys in each slice are expected to be unique, so duplicates can only occur -// when the first and second slice contain the same key. When that happens, the -// key/value pair from the second slice is used. The first slice must be well-formed -// (= even key/value pairs). The second one may have a missing value, in which -// case the special "missing value" is added to the result. -func MergeKVs(first, second []interface{}) []interface{} { - maxLength := len(first) + (len(second)+1)/2*2 - if maxLength == 0 { - // Nothing to do at all. - return nil - } - - if len(first) == 0 && len(second)%2 == 0 { - // Nothing to be overridden, second slice is well-formed - // and can be used directly. - return second - } - - // Determine which keys are in the second slice so that we can skip - // them when iterating over the first one. The code intentionally - // favors performance over completeness: we assume that keys are string - // constants and thus compare equal when the string values are equal. A - // string constant being overridden by, for example, a fmt.Stringer is - // not handled. - overrides := map[interface{}]bool{} - for i := 0; i < len(second); i += 2 { - overrides[second[i]] = true - } - merged := make([]interface{}, 0, maxLength) - for i := 0; i+1 < len(first); i += 2 { - key := first[i] - if overrides[key] { - continue - } - merged = append(merged, key, first[i+1]) - } - merged = append(merged, second...) - if len(merged)%2 != 0 { - merged = append(merged, missingValue) - } - return merged -} - type Formatter struct { AnyToStringHook AnyToStringFunc } type AnyToStringFunc func(v interface{}) string -// MergeKVsInto is a variant of MergeKVs which directly formats the key/value -// pairs into a buffer. -func (f Formatter) MergeAndFormatKVs(b *bytes.Buffer, first, second []interface{}) { - if len(first) == 0 && len(second) == 0 { - // Nothing to do at all. - return - } +const missingValue = "(MISSING)" - if len(first) == 0 && len(second)%2 == 0 { - // Nothing to be overridden, second slice is well-formed - // and can be used directly. - for i := 0; i < len(second); i += 2 { - f.KVFormat(b, second[i], second[i+1]) - } - return - } +func FormatKVs(b *bytes.Buffer, kvs ...[]interface{}) { + Formatter{}.FormatKVs(b, kvs...) +} - // Determine which keys are in the second slice so that we can skip - // them when iterating over the first one. The code intentionally - // favors performance over completeness: we assume that keys are string - // constants and thus compare equal when the string values are equal. A - // string constant being overridden by, for example, a fmt.Stringer is - // not handled. - overrides := map[interface{}]bool{} - for i := 0; i < len(second); i += 2 { - overrides[second[i]] = true - } - for i := 0; i < len(first); i += 2 { - key := first[i] - if overrides[key] { - continue +// FormatKVs formats all key/value pairs such that the output contains no +// duplicates ("last one wins"). +func (f Formatter) FormatKVs(b *bytes.Buffer, kvs ...[]interface{}) { + // De-duplication is done by optimistically formatting all key value + // pairs and then cutting out the output of those key/value pairs which + // got overwritten later. + // + // In the common case of no duplicates, the only overhead is tracking + // previous keys. This uses a slice with a simple linear search because + // the number of entries is typically so low that allocating a map or + // keeping a sorted slice with binary search aren't justified. + // + // Using a fixed size here makes the Go compiler use the stack as + // initial backing store for the slice, which is crucial for + // performance. + existing := make([]obsoleteKV, 0, 32) + obsolete := make([]interval, 0, 32) // Sorted by start index. + for _, keysAndValues := range kvs { + for i := 0; i < len(keysAndValues); i += 2 { + var v interface{} + k := keysAndValues[i] + if i+1 < len(keysAndValues) { + v = keysAndValues[i+1] + } else { + v = missingValue + } + var e obsoleteKV + e.start = b.Len() + e.key = f.KVFormat(b, k, v) + e.end = b.Len() + i := findObsoleteEntry(existing, e.key) + if i >= 0 { + data := b.Bytes() + if bytes.Compare(data[existing[i].start:existing[i].end], data[e.start:e.end]) == 0 { + // The new entry gets obsoleted because it's identical. + // This has the advantage that key/value pairs from + // a WithValues call always come first, even if the same + // pair gets added again later. This makes different log + // entries more consistent. + // + // The new entry has a higher start index and thus can be appended. + obsolete = append(obsolete, e.interval) + } else { + // The old entry gets obsoleted because it's value is different. + // + // Sort order is not guaranteed, we have to insert at the right place. + index, _ := slices.BinarySearchFunc(obsolete, existing[i].interval, func(a, b interval) int { return a.start - b.start }) + obsolete = slices.Insert(obsolete, index, existing[i].interval) + existing[i].interval = e.interval + } + } else { + // Instead of appending at the end and doing a + // linear search in findEntry, we could keep + // the slice sorted by key and do a binary search. + // + // Above: + // i, ok := slices.BinarySearchFunc(existing, e, func(a, b entry) int { return strings.Compare(a.key, b.key) }) + // Here: + // existing = slices.Insert(existing, i, e) + // + // But that adds a dependency on the slices package + // and made performance slightly worse, presumably + // because the cost of shifting entries around + // did not pay of with faster lookups. + existing = append(existing, e) + } } - f.KVFormat(b, key, first[i+1]) } - // Round down. - l := len(second) - l = l / 2 * 2 - for i := 1; i < l; i += 2 { - f.KVFormat(b, second[i-1], second[i]) - } - if len(second)%2 == 1 { - f.KVFormat(b, second[len(second)-1], missingValue) - } -} -func MergeAndFormatKVs(b *bytes.Buffer, first, second []interface{}) { - Formatter{}.MergeAndFormatKVs(b, first, second) -} + // If we need to remove some obsolete key/value pairs then move the memory. + if len(obsolete) > 0 { + // Potentially the next remaining output (might itself be obsolete). + from := obsolete[0].end + // Next obsolete entry. + nextObsolete := 1 + // This is the source buffer, before truncation. + all := b.Bytes() + b.Truncate(obsolete[0].start) -const missingValue = "(MISSING)" + for nextObsolete < len(obsolete) { + if from == obsolete[nextObsolete].start { + // Skip also the next obsolete key/value. + from = obsolete[nextObsolete].end + nextObsolete++ + continue + } -// KVListFormat serializes all key/value pairs into the provided buffer. -// A space gets inserted before the first pair and between each pair. -func (f Formatter) KVListFormat(b *bytes.Buffer, keysAndValues ...interface{}) { - for i := 0; i < len(keysAndValues); i += 2 { - var v interface{} - k := keysAndValues[i] - if i+1 < len(keysAndValues) { - v = keysAndValues[i+1] - } else { - v = missingValue + // Preserve some output. Write uses copy, which + // explicitly allows source and destination to overlap. + // That could happen here. + valid := all[from:obsolete[nextObsolete].start] + b.Write(valid) + from = obsolete[nextObsolete].end + nextObsolete++ } - f.KVFormat(b, k, v) + // Copy end of buffer. + valid := all[from:] + b.Write(valid) } } -func KVListFormat(b *bytes.Buffer, keysAndValues ...interface{}) { - Formatter{}.KVListFormat(b, keysAndValues...) +type obsoleteKV struct { + key string + interval +} + +// interval includes the start and excludes the end. +type interval struct { + start int + end int } -func KVFormat(b *bytes.Buffer, k, v interface{}) { - Formatter{}.KVFormat(b, k, v) +func findObsoleteEntry(entries []obsoleteKV, key string) int { + for i, entry := range entries { + if entry.key == key { + return i + } + } + return -1 } // formatAny is the fallback formatter for a value. It supports a hook (for // example, for YAML encoding) and itself uses JSON encoding. func (f Formatter) formatAny(b *bytes.Buffer, v interface{}) { - b.WriteRune('=') if f.AnyToStringHook != nil { - b.WriteString(f.AnyToStringHook(v)) + str := f.AnyToStringHook(v) + if strings.Contains(str, "\n") { + // If it's multi-line, then pass it through writeStringValue to get start/end delimiters, + // which separates it better from any following key/value pair. + writeStringValue(b, str) + return + } + // Otherwise put it directly after the separator, on the same lime, + // The assumption is that the hook returns something where start/end are obvious. + b.WriteRune('=') + b.WriteString(str) return } + b.WriteRune('=') formatAsJSON(b, v) } diff --git a/apis/vendor/k8s.io/klog/v2/internal/serialize/keyvalues_no_slog.go b/apis/vendor/k8s.io/klog/v2/internal/serialize/keyvalues_no_slog.go index d9c7d15467c..b8c7e443d0b 100644 --- a/apis/vendor/k8s.io/klog/v2/internal/serialize/keyvalues_no_slog.go +++ b/apis/vendor/k8s.io/klog/v2/internal/serialize/keyvalues_no_slog.go @@ -28,7 +28,7 @@ import ( // KVFormat serializes one key/value pair into the provided buffer. // A space gets inserted before the pair. -func (f Formatter) KVFormat(b *bytes.Buffer, k, v interface{}) { +func (f Formatter) KVFormat(b *bytes.Buffer, k, v interface{}) string { // This is the version without slog support. Must be kept in sync with // the version in keyvalues_slog.go. @@ -37,13 +37,15 @@ func (f Formatter) KVFormat(b *bytes.Buffer, k, v interface{}) { // https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/migration-to-structured-logging.md#name-arguments // for the sake of performance. Keys with spaces, // special characters, etc. will break parsing. + var key string if sK, ok := k.(string); ok { // Avoid one allocation when the key is a string, which // normally it should be. - b.WriteString(sK) + key = sK } else { - b.WriteString(fmt.Sprintf("%s", k)) + key = fmt.Sprintf("%s", k) } + b.WriteString(key) // The type checks are sorted so that more frequently used ones // come first because that is then faster in the common @@ -94,4 +96,6 @@ func (f Formatter) KVFormat(b *bytes.Buffer, k, v interface{}) { default: f.formatAny(b, v) } + + return key } diff --git a/apis/vendor/k8s.io/klog/v2/internal/serialize/keyvalues_slog.go b/apis/vendor/k8s.io/klog/v2/internal/serialize/keyvalues_slog.go index 89acf977230..8e00843645e 100644 --- a/apis/vendor/k8s.io/klog/v2/internal/serialize/keyvalues_slog.go +++ b/apis/vendor/k8s.io/klog/v2/internal/serialize/keyvalues_slog.go @@ -29,8 +29,8 @@ import ( ) // KVFormat serializes one key/value pair into the provided buffer. -// A space gets inserted before the pair. -func (f Formatter) KVFormat(b *bytes.Buffer, k, v interface{}) { +// A space gets inserted before the pair. It returns the key. +func (f Formatter) KVFormat(b *bytes.Buffer, k, v interface{}) string { // This is the version without slog support. Must be kept in sync with // the version in keyvalues_slog.go. @@ -39,13 +39,15 @@ func (f Formatter) KVFormat(b *bytes.Buffer, k, v interface{}) { // https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/migration-to-structured-logging.md#name-arguments // for the sake of performance. Keys with spaces, // special characters, etc. will break parsing. + var key string if sK, ok := k.(string); ok { // Avoid one allocation when the key is a string, which // normally it should be. - b.WriteString(sK) + key = sK } else { - b.WriteString(fmt.Sprintf("%s", k)) + key = fmt.Sprintf("%s", k) } + b.WriteString(key) // The type checks are sorted so that more frequently used ones // come first because that is then faster in the common @@ -112,6 +114,8 @@ func (f Formatter) KVFormat(b *bytes.Buffer, k, v interface{}) { default: f.formatAny(b, v) } + + return key } // generateJSON has the same preference for plain strings as KVFormat. diff --git a/apis/vendor/k8s.io/klog/v2/internal/verbosity/verbosity.go b/apis/vendor/k8s.io/klog/v2/internal/verbosity/verbosity.go new file mode 100644 index 00000000000..40ec27d87ae --- /dev/null +++ b/apis/vendor/k8s.io/klog/v2/internal/verbosity/verbosity.go @@ -0,0 +1,303 @@ +/* +Copyright 2013 Google Inc. All Rights Reserved. +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package verbosity + +import ( + "bytes" + "errors" + "flag" + "fmt" + "path/filepath" + "runtime" + "strconv" + "strings" + "sync" + "sync/atomic" +) + +// New returns a struct that implements -v and -vmodule support. Changing and +// checking these settings is thread-safe, with all concurrency issues handled +// internally. +func New() *VState { + vs := new(VState) + + // The two fields must have a pointer to the overal struct for their + // implementation of Set. + vs.vmodule.vs = vs + vs.verbosity.vs = vs + + return vs +} + +// Value is an extension that makes it possible to use the values in pflag. +type Value interface { + flag.Value + Type() string +} + +func (vs *VState) V() Value { + return &vs.verbosity +} + +func (vs *VState) VModule() Value { + return &vs.vmodule +} + +// VState contains settings and state. Some of its fields can be accessed +// through atomic read/writes, in other cases a mutex must be held. +type VState struct { + mu sync.Mutex + + // These flags are modified only under lock, although verbosity may be fetched + // safely using atomic.LoadInt32. + vmodule moduleSpec // The state of the -vmodule flag. + verbosity levelSpec // V logging level, the value of the -v flag/ + + // pcs is used in V to avoid an allocation when computing the caller's PC. + pcs [1]uintptr + // vmap is a cache of the V Level for each V() call site, identified by PC. + // It is wiped whenever the vmodule flag changes state. + vmap map[uintptr]Level + // filterLength stores the length of the vmodule filter chain. If greater + // than zero, it means vmodule is enabled. It may be read safely + // using sync.LoadInt32, but is only modified under mu. + filterLength int32 +} + +// Level must be an int32 to support atomic read/writes. +type Level int32 + +type levelSpec struct { + vs *VState + l Level +} + +// get returns the value of the level. +func (l *levelSpec) get() Level { + return Level(atomic.LoadInt32((*int32)(&l.l))) +} + +// set sets the value of the level. +func (l *levelSpec) set(val Level) { + atomic.StoreInt32((*int32)(&l.l), int32(val)) +} + +// String is part of the flag.Value interface. +func (l *levelSpec) String() string { + return strconv.FormatInt(int64(l.l), 10) +} + +// Get is part of the flag.Getter interface. It returns the +// verbosity level as int32. +func (l *levelSpec) Get() interface{} { + return int32(l.l) +} + +// Type is part of pflag.Value. +func (l *levelSpec) Type() string { + return "Level" +} + +// Set is part of the flag.Value interface. +func (l *levelSpec) Set(value string) error { + v, err := strconv.ParseInt(value, 10, 32) + if err != nil { + return err + } + l.vs.mu.Lock() + defer l.vs.mu.Unlock() + l.vs.set(Level(v), l.vs.vmodule.filter, false) + return nil +} + +// moduleSpec represents the setting of the -vmodule flag. +type moduleSpec struct { + vs *VState + filter []modulePat +} + +// modulePat contains a filter for the -vmodule flag. +// It holds a verbosity level and a file pattern to match. +type modulePat struct { + pattern string + literal bool // The pattern is a literal string + level Level +} + +// match reports whether the file matches the pattern. It uses a string +// comparison if the pattern contains no metacharacters. +func (m *modulePat) match(file string) bool { + if m.literal { + return file == m.pattern + } + match, _ := filepath.Match(m.pattern, file) + return match +} + +func (m *moduleSpec) String() string { + // Lock because the type is not atomic. TODO: clean this up. + // Empty instances don't have and don't need a lock (can + // happen when flag uses introspection). + if m.vs != nil { + m.vs.mu.Lock() + defer m.vs.mu.Unlock() + } + var b bytes.Buffer + for i, f := range m.filter { + if i > 0 { + b.WriteRune(',') + } + fmt.Fprintf(&b, "%s=%d", f.pattern, f.level) + } + return b.String() +} + +// Get is part of the (Go 1.2) flag.Getter interface. It always returns nil for this flag type since the +// struct is not exported. +func (m *moduleSpec) Get() interface{} { + return nil +} + +// Type is part of pflag.Value +func (m *moduleSpec) Type() string { + return "pattern=N,..." +} + +var errVmoduleSyntax = errors.New("syntax error: expect comma-separated list of filename=N") + +// Set will sets module value +// Syntax: -vmodule=recordio=2,file=1,gfs*=3 +func (m *moduleSpec) Set(value string) error { + var filter []modulePat + for _, pat := range strings.Split(value, ",") { + if len(pat) == 0 { + // Empty strings such as from a trailing comma can be ignored. + continue + } + patLev := strings.Split(pat, "=") + if len(patLev) != 2 || len(patLev[0]) == 0 || len(patLev[1]) == 0 { + return errVmoduleSyntax + } + pattern := patLev[0] + v, err := strconv.ParseInt(patLev[1], 10, 32) + if err != nil { + return errors.New("syntax error: expect comma-separated list of filename=N") + } + if v < 0 { + return errors.New("negative value for vmodule level") + } + if v == 0 { + continue // Ignore. It's harmless but no point in paying the overhead. + } + // TODO: check syntax of filter? + filter = append(filter, modulePat{pattern, isLiteral(pattern), Level(v)}) + } + m.vs.mu.Lock() + defer m.vs.mu.Unlock() + m.vs.set(m.vs.verbosity.l, filter, true) + return nil +} + +// isLiteral reports whether the pattern is a literal string, that is, has no metacharacters +// that require filepath.Match to be called to match the pattern. +func isLiteral(pattern string) bool { + return !strings.ContainsAny(pattern, `\*?[]`) +} + +// set sets a consistent state for V logging. +// The mutex must be held. +func (vs *VState) set(l Level, filter []modulePat, setFilter bool) { + // Turn verbosity off so V will not fire while we are in transition. + vs.verbosity.set(0) + // Ditto for filter length. + atomic.StoreInt32(&vs.filterLength, 0) + + // Set the new filters and wipe the pc->Level map if the filter has changed. + if setFilter { + vs.vmodule.filter = filter + vs.vmap = make(map[uintptr]Level) + } + + // Things are consistent now, so enable filtering and verbosity. + // They are enabled in order opposite to that in V. + atomic.StoreInt32(&vs.filterLength, int32(len(filter))) + vs.verbosity.set(l) +} + +// Enabled checks whether logging is enabled at the given level. This must be +// called with depth=0 when the caller of enabled will do the logging and +// higher values when more stack levels need to be skipped. +// +// The mutex will be locked only if needed. +func (vs *VState) Enabled(level Level, depth int) bool { + // This function tries hard to be cheap unless there's work to do. + // The fast path is two atomic loads and compares. + + // Here is a cheap but safe test to see if V logging is enabled globally. + if vs.verbosity.get() >= level { + return true + } + + // It's off globally but vmodule may still be set. + // Here is another cheap but safe test to see if vmodule is enabled. + if atomic.LoadInt32(&vs.filterLength) > 0 { + // Now we need a proper lock to use the logging structure. The pcs field + // is shared so we must lock before accessing it. This is fairly expensive, + // but if V logging is enabled we're slow anyway. + vs.mu.Lock() + defer vs.mu.Unlock() + if runtime.Callers(depth+2, vs.pcs[:]) == 0 { + return false + } + // runtime.Callers returns "return PCs", but we want + // to look up the symbolic information for the call, + // so subtract 1 from the PC. runtime.CallersFrames + // would be cleaner, but allocates. + pc := vs.pcs[0] - 1 + v, ok := vs.vmap[pc] + if !ok { + v = vs.setV(pc) + } + return v >= level + } + return false +} + +// setV computes and remembers the V level for a given PC +// when vmodule is enabled. +// File pattern matching takes the basename of the file, stripped +// of its .go suffix, and uses filepath.Match, which is a little more +// general than the *? matching used in C++. +// Mutex is held. +func (vs *VState) setV(pc uintptr) Level { + fn := runtime.FuncForPC(pc) + file, _ := fn.FileLine(pc) + // The file is something like /a/b/c/d.go. We want just the d. + file = strings.TrimSuffix(file, ".go") + if slash := strings.LastIndex(file, "/"); slash >= 0 { + file = file[slash+1:] + } + for _, filter := range vs.vmodule.filter { + if filter.match(file) { + vs.vmap[pc] = filter.level + return filter.level + } + } + vs.vmap[pc] = 0 + return 0 +} diff --git a/apis/vendor/k8s.io/klog/v2/klog.go b/apis/vendor/k8s.io/klog/v2/klog.go index 47ec9466a6f..319ffbe2483 100644 --- a/apis/vendor/k8s.io/klog/v2/klog.go +++ b/apis/vendor/k8s.io/klog/v2/klog.go @@ -58,15 +58,30 @@ // // -logtostderr=true // Logs are written to standard error instead of to files. -// This shortcuts most of the usual output routing: -// -alsologtostderr, -stderrthreshold and -log_dir have no -// effect and output redirection at runtime with SetOutput is -// ignored. +// By default, all logs are written regardless of severity +// (legacy behavior). To filter logs by severity when +// -logtostderr=true, set -legacy_stderr_threshold_behavior=false +// and use -stderrthreshold. +// With -legacy_stderr_threshold_behavior=true, +// -stderrthreshold has no effect. +// +// The following flags always have no effect: +// -alsologtostderr, -alsologtostderrthreshold, and -log_dir. +// Output redirection at runtime with SetOutput is also ignored. // -alsologtostderr=false // Logs are written to standard error as well as to files. +// -alsologtostderrthreshold=INFO +// Log events at or above this severity are logged to standard +// error when -alsologtostderr=true (no effect when -logtostderr=true). +// Default is INFO to maintain backward compatibility. // -stderrthreshold=ERROR // Log events at or above this severity are logged to standard -// error as well as to files. +// error as well as to files. When -logtostderr=true, this flag +// has no effect unless -legacy_stderr_threshold_behavior=false. +// -legacy_stderr_threshold_behavior=true +// If true, -stderrthreshold is ignored when -logtostderr=true +// (legacy behavior). If false, -stderrthreshold is honored even +// when -logtostderr=true, allowing severity-based filtering. // -log_dir="" // Log files will be written to this directory instead of the // default temporary directory. @@ -156,7 +171,7 @@ func (s *severityValue) Set(value string) error { } threshold = severity.Severity(v) } - logging.stderrThreshold.set(threshold) + s.set(threshold) return nil } @@ -409,6 +424,15 @@ var commandLine flag.FlagSet // init sets up the defaults and creates command line flags. func init() { + // Initialize severity thresholds + logging.stderrThreshold = severityValue{ + Severity: severity.ErrorLog, // Default stderrThreshold is ERROR. + } + logging.alsologtostderrthreshold = severityValue{ + Severity: severity.InfoLog, // Default alsologtostderrthreshold is INFO (to maintain backward compatibility). + } + logging.setVState(0, nil, false) + commandLine.StringVar(&logging.logDir, "log_dir", "", "If non-empty, write log files in this directory (no effect when -logtostderr=true)") commandLine.StringVar(&logging.logFile, "log_file", "", "If non-empty, use this log file (no effect when -logtostderr=true)") commandLine.Uint64Var(&logging.logFileMaxSizeMB, "log_file_max_size", 1800, @@ -416,16 +440,14 @@ func init() { "If the value is 0, the maximum file size is unlimited.") commandLine.BoolVar(&logging.toStderr, "logtostderr", true, "log to standard error instead of files") commandLine.BoolVar(&logging.alsoToStderr, "alsologtostderr", false, "log to standard error as well as files (no effect when -logtostderr=true)") - logging.setVState(0, nil, false) + commandLine.BoolVar(&logging.legacyStderrThresholdBehavior, "legacy_stderr_threshold_behavior", true, "If true, stderrthreshold is ignored when logtostderr=true (legacy behavior). If false, stderrthreshold is honored even when logtostderr=true") commandLine.Var(&logging.verbosity, "v", "number for the log level verbosity") commandLine.BoolVar(&logging.addDirHeader, "add_dir_header", false, "If true, adds the file directory to the header of the log messages") commandLine.BoolVar(&logging.skipHeaders, "skip_headers", false, "If true, avoid header prefixes in the log messages") commandLine.BoolVar(&logging.oneOutput, "one_output", false, "If true, only write logs to their native severity level (vs also writing to each lower severity level; no effect when -logtostderr=true)") commandLine.BoolVar(&logging.skipLogHeaders, "skip_log_headers", false, "If true, avoid headers when opening log files (no effect when -logtostderr=true)") - logging.stderrThreshold = severityValue{ - Severity: severity.ErrorLog, // Default stderrThreshold is ERROR. - } - commandLine.Var(&logging.stderrThreshold, "stderrthreshold", "logs at or above this threshold go to stderr when writing to files and stderr (no effect when -logtostderr=true or -alsologtostderr=true)") + commandLine.Var(&logging.stderrThreshold, "stderrthreshold", "logs at or above this threshold go to stderr when writing to files and stderr (no effect when -logtostderr=true or -alsologtostderr=true unless -legacy_stderr_threshold_behavior=false)") + commandLine.Var(&logging.alsologtostderrthreshold, "alsologtostderrthreshold", "logs at or above this threshold go to stderr when -alsologtostderr=true (no effect when -logtostderr=true)") commandLine.Var(&logging.vmodule, "vmodule", "comma-separated list of pattern=N settings for file-filtered logging") commandLine.Var(&logging.traceLocation, "log_backtrace_at", "when logging hits line file:N, emit a stack trace") @@ -470,11 +492,13 @@ type settings struct { // Boolean flags. Not handled atomically because the flag.Value interface // does not let us avoid the =true, and that shorthand is necessary for // compatibility. TODO: does this matter enough to fix? Seems unlikely. - toStderr bool // The -logtostderr flag. - alsoToStderr bool // The -alsologtostderr flag. + toStderr bool // The -logtostderr flag. + alsoToStderr bool // The -alsologtostderr flag. + legacyStderrThresholdBehavior bool // The -legacy_stderr_threshold_behavior flag. // Level flag. Handled atomically. - stderrThreshold severityValue // The -stderrthreshold flag. + stderrThreshold severityValue // The -stderrthreshold flag. + alsologtostderrthreshold severityValue // The -alsologtostderrthreshold flag. // Access to all of the following fields must be protected via a mutex. @@ -809,16 +833,21 @@ func (l *loggingT) infoS(logger *logWriter, filter LogFilter, depth int, msg str // printS is called from infoS and errorS if logger is not specified. // set log severity by s func (l *loggingT) printS(err error, s severity.Severity, depth int, msg string, keysAndValues ...interface{}) { - // Only create a new buffer if we don't have one cached. - b := buffer.GetBuffer() // The message is always quoted, even if it contains line breaks. // If developers want multi-line output, they should use a small, fixed // message and put the multi-line output into a value. - b.WriteString(strconv.Quote(msg)) + qMsg := make([]byte, 0, 1024) + qMsg = strconv.AppendQuote(qMsg, msg) + + // Only create a new buffer if we don't have one cached. + b := buffer.GetBuffer() + b.Write(qMsg) + + var errKV []interface{} if err != nil { - serialize.KVListFormat(&b.Buffer, "err", err) + errKV = []interface{}{"err", err} } - serialize.KVListFormat(&b.Buffer, keysAndValues...) + serialize.FormatKVs(&b.Buffer, errKV, keysAndValues) l.printDepth(s, nil, nil, depth+1, &b.Buffer) // Make the buffer available for reuse. buffer.PutBuffer(b) @@ -885,9 +914,25 @@ func (l *loggingT) output(s severity.Severity, logger *logWriter, buf *buffer.Bu } } } else if l.toStderr { - os.Stderr.Write(data) + // When logging to stderr only, check if we should filter by severity. + // This is controlled by the legacy_stderr_threshold_behavior flag. + if l.legacyStderrThresholdBehavior { + // Legacy behavior: always write to stderr, ignore stderrthreshold + os.Stderr.Write(data) + } else { + // New behavior: honor stderrthreshold even when logtostderr=true + if s >= l.stderrThreshold.get() { + os.Stderr.Write(data) + } + } } else { - if alsoToStderr || l.alsoToStderr || s >= l.stderrThreshold.get() { + // Write to stderr if any of these conditions are met: + // - alsoToStderr is set (legacy behavior) + // - alsologtostderr is set and severity meets alsologtostderrthreshold + // - alsologtostderr is not set and severity meets stderrThreshold + if alsoToStderr || + (l.alsoToStderr && s >= l.alsologtostderrthreshold.get()) || + (!l.alsoToStderr && s >= l.stderrThreshold.get()) { os.Stderr.Write(data) } diff --git a/apis/vendor/k8s.io/klog/v2/klogr.go b/apis/vendor/k8s.io/klog/v2/klogr.go index efec96fd45b..6204c7bb434 100644 --- a/apis/vendor/k8s.io/klog/v2/klogr.go +++ b/apis/vendor/k8s.io/klog/v2/klogr.go @@ -53,7 +53,7 @@ func (l *klogger) Init(info logr.RuntimeInfo) { } func (l *klogger) Info(level int, msg string, kvList ...interface{}) { - merged := serialize.MergeKVs(l.values, kvList) + merged := serialize.WithValues(l.values, kvList) // Skip this function. VDepth(l.callDepth+1, Level(level)).InfoSDepth(l.callDepth+1, msg, merged...) } @@ -63,7 +63,7 @@ func (l *klogger) Enabled(level int) bool { } func (l *klogger) Error(err error, msg string, kvList ...interface{}) { - merged := serialize.MergeKVs(l.values, kvList) + merged := serialize.WithValues(l.values, kvList) ErrorSDepth(l.callDepth+1, err, msg, merged...) } diff --git a/apis/vendor/k8s.io/klog/v2/klogr_slog.go b/apis/vendor/k8s.io/klog/v2/klogr_slog.go index c77d7baafa6..901e28dd391 100644 --- a/apis/vendor/k8s.io/klog/v2/klogr_slog.go +++ b/apis/vendor/k8s.io/klog/v2/klogr_slog.go @@ -63,12 +63,17 @@ func slogOutput(file string, line int, now time.Time, err error, s severity.Seve } // See printS. + qMsg := make([]byte, 0, 1024) + qMsg = strconv.AppendQuote(qMsg, msg) + b := buffer.GetBuffer() - b.WriteString(strconv.Quote(msg)) + b.Write(qMsg) + + var errKV []interface{} if err != nil { - serialize.KVListFormat(&b.Buffer, "err", err) + errKV = []interface{}{"err", err} } - serialize.KVListFormat(&b.Buffer, kvList...) + serialize.FormatKVs(&b.Buffer, errKV, kvList) // See print + header. buf := logging.formatHeader(s, file, line, now) diff --git a/apis/vendor/k8s.io/klog/v2/textlogger/options.go b/apis/vendor/k8s.io/klog/v2/textlogger/options.go new file mode 100644 index 00000000000..ed834ca6800 --- /dev/null +++ b/apis/vendor/k8s.io/klog/v2/textlogger/options.go @@ -0,0 +1,172 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package textlogger + +import ( + "flag" + "io" + "os" + "strconv" + "time" + + "k8s.io/klog/v2/internal/verbosity" +) + +// Config influences logging in a text logger. To make this configurable via +// command line flags, instantiate this once per program and use AddFlags to +// bind command line flags to the instance before passing it to NewTestContext. +// +// Must be constructed with NewConfig. +type Config struct { + vstate *verbosity.VState + co configOptions +} + +// Verbosity returns a value instance that can be used to query (via String) or +// modify (via Set) the verbosity threshold. This is thread-safe and can be +// done at runtime. +func (c *Config) Verbosity() flag.Value { + return c.vstate.V() +} + +// VModule returns a value instance that can be used to query (via String) or +// modify (via Set) the vmodule settings. This is thread-safe and can be done +// at runtime. +func (c *Config) VModule() flag.Value { + return c.vstate.VModule() +} + +// ConfigOption implements functional parameters for NewConfig. +type ConfigOption func(co *configOptions) + +type configOptions struct { + verbosityFlagName string + vmoduleFlagName string + verbosityDefault int + fixedTime *time.Time + unwind func(int) (string, int) + withHeader bool + output io.Writer +} + +// VerbosityFlagName overrides the default -v for the verbosity level. +func VerbosityFlagName(name string) ConfigOption { + return func(co *configOptions) { + + co.verbosityFlagName = name + } +} + +// VModulFlagName overrides the default -vmodule for the per-module +// verbosity levels. +func VModuleFlagName(name string) ConfigOption { + return func(co *configOptions) { + co.vmoduleFlagName = name + } +} + +// Verbosity overrides the default verbosity level of 0. +// See https://github.com/kubernetes/community/blob/9406b4352fe2d5810cb21cc3cb059ce5886de157/contributors/devel/sig-instrumentation/logging.md#logging-conventions +// for log level conventions in Kubernetes. +func Verbosity(level int) ConfigOption { + return func(co *configOptions) { + co.verbosityDefault = level + } +} + +// Output overrides stderr as the output stream. +func Output(output io.Writer) ConfigOption { + return func(co *configOptions) { + co.output = output + } +} + +// FixedTime overrides the actual time with a fixed time. Useful only for testing. +// +// # Experimental +// +// Notice: This function is EXPERIMENTAL and may be changed or removed in a +// later release. +func FixedTime(ts time.Time) ConfigOption { + return func(co *configOptions) { + co.fixedTime = &ts + } +} + +// WithHeader controls whether the header (time, source code location, etc.) +// is included in the output. The default is to include it. +// +// This can be useful in combination with redirection to a buffer to +// turn structured log parameters into a string (see example). +// +// # Experimental +// +// Notice: This function is EXPERIMENTAL and may be changed or removed in a +// later release. +func WithHeader(enabled bool) ConfigOption { + return func(co *configOptions) { + co.withHeader = enabled + } +} + +// Backtrace overrides the default mechanism for determining the call site. +// The callback is invoked with the number of function calls between itself +// and the call site. It must return the file name and line number. An empty +// file name indicates that the information is unknown. +// +// # Experimental +// +// Notice: This function is EXPERIMENTAL and may be changed or removed in a +// later release. +func Backtrace(unwind func(skip int) (filename string, line int)) ConfigOption { + return func(co *configOptions) { + co.unwind = unwind + } +} + +// NewConfig returns a configuration with recommended defaults and optional +// modifications. Command line flags are not bound to any FlagSet yet. +func NewConfig(opts ...ConfigOption) *Config { + c := &Config{ + vstate: verbosity.New(), + co: configOptions{ + verbosityFlagName: "v", + vmoduleFlagName: "vmodule", + verbosityDefault: 0, + unwind: runtimeBacktrace, + withHeader: true, + output: os.Stderr, + }, + } + for _, opt := range opts { + opt(&c.co) + } + + // Cannot fail for this input. + _ = c.Verbosity().Set(strconv.FormatInt(int64(c.co.verbosityDefault), 10)) + return c +} + +// AddFlags registers the command line flags that control the configuration. +// +// The default flag names are the same as in klog, so unless those defaults +// are changed, either klog.InitFlags or Config.AddFlags can be used for the +// same flag set, but not both. +func (c *Config) AddFlags(fs *flag.FlagSet) { + fs.Var(c.Verbosity(), c.co.verbosityFlagName, "number for the log level verbosity of the testing logger") + fs.Var(c.VModule(), c.co.vmoduleFlagName, "comma-separated list of pattern=N log level settings for files matching the patterns") +} diff --git a/apis/vendor/k8s.io/klog/v2/textlogger/textlogger.go b/apis/vendor/k8s.io/klog/v2/textlogger/textlogger.go new file mode 100644 index 00000000000..813cba1d4cb --- /dev/null +++ b/apis/vendor/k8s.io/klog/v2/textlogger/textlogger.go @@ -0,0 +1,200 @@ +/* +Copyright 2019 The Kubernetes Authors. +Copyright 2020 Intel Corporation. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package textlogger contains an implementation of the logr interface which is +// producing the exact same output as klog. It does not route output through +// klog (i.e. ignores [k8s.io/klog/v2.InitFlags]). Instead, all settings must be +// configured through its own [NewConfig] and [Config.AddFlags]. +package textlogger + +import ( + "runtime" + "strconv" + "strings" + "time" + + "github.com/go-logr/logr" + + "k8s.io/klog/v2/internal/buffer" + "k8s.io/klog/v2/internal/serialize" + "k8s.io/klog/v2/internal/severity" + "k8s.io/klog/v2/internal/verbosity" +) + +var ( + // TimeNow is used to retrieve the current time. May be changed for testing. + TimeNow = time.Now +) + +const ( + // nameKey is used to log the `WithName` values as an additional attribute. + nameKey = "logger" +) + +// NewLogger constructs a new logger. +// +// Verbosity can be modified at any time through the Config.V and +// Config.VModule API. +func NewLogger(c *Config) logr.Logger { + return logr.New(&tlogger{ + values: nil, + config: c, + }) +} + +type tlogger struct { + callDepth int + + // hasPrefix is true if the first entry in values is the special + // nameKey key/value. Such an entry gets added and later updated in + // WithName. + hasPrefix bool + + values []interface{} + groups string + config *Config +} + +func (l *tlogger) Init(info logr.RuntimeInfo) { + l.callDepth = info.CallDepth +} + +func (l *tlogger) WithCallDepth(depth int) logr.LogSink { + newLogger := *l + newLogger.callDepth += depth + return &newLogger +} + +func (l *tlogger) Enabled(level int) bool { + return l.config.vstate.Enabled(verbosity.Level(level), 1+l.callDepth) +} + +func (l *tlogger) Info(_ int, msg string, kvList ...interface{}) { + l.print(nil, severity.InfoLog, msg, kvList) +} + +func (l *tlogger) Error(err error, msg string, kvList ...interface{}) { + l.print(err, severity.ErrorLog, msg, kvList) +} + +func (l *tlogger) print(err error, s severity.Severity, msg string, kvList []interface{}) { + var file string + var line int + var now time.Time + if l.config.co.withHeader { + // Determine caller. + // +1 for this frame, +1 for Info/Error. + skip := l.callDepth + 2 + file, line = l.config.co.unwind(skip) + if file == "" { + file = "???" + line = 1 + } else if slash := strings.LastIndex(file, "/"); slash >= 0 { + file = file[slash+1:] + } + now = time.Now() + } + l.printWithInfos(file, line, now, err, s, msg, kvList) +} + +func runtimeBacktrace(skip int) (string, int) { + _, file, line, ok := runtime.Caller(skip + 1) + if !ok { + return "", 0 + } + return file, line +} + +func (l *tlogger) printWithInfos(file string, line int, now time.Time, err error, s severity.Severity, msg string, kvList []interface{}) { + // The message is always quoted, even if it contains line breaks. + // If developers want multi-line output, they should use a small, fixed + // message and put the multi-line output into a value. + qMsg := make([]byte, 0, 1024) + qMsg = strconv.AppendQuote(qMsg, msg) + + // Only create a new buffer if we don't have one cached. + b := buffer.GetBuffer() + defer buffer.PutBuffer(b) + + if l.config.co.withHeader { + // Format header. + if l.config.co.fixedTime != nil { + now = *l.config.co.fixedTime + } + b.FormatHeader(s, file, line, now) + } + + b.Write(qMsg) + + var errKV []interface{} + if err != nil { + errKV = []interface{}{"err", err} + } + serialize.FormatKVs(&b.Buffer, errKV, l.values, kvList) + if b.Len() == 0 || b.Bytes()[b.Len()-1] != '\n' { + b.WriteByte('\n') + } + _, _ = l.config.co.output.Write(b.Bytes()) +} + +func (l *tlogger) WriteKlogBuffer(data []byte) { + _, _ = l.config.co.output.Write(data) +} + +// WithName returns a new logr.Logger with the specified name appended. klogr +// uses '/' characters to separate name elements. Callers should not pass '/' +// in the provided name string, but this library does not actually enforce that. +func (l *tlogger) WithName(name string) logr.LogSink { + clone := *l + if l.hasPrefix { + // Copy slice and modify value. No length checks and type + // assertions are needed because hasPrefix is only true if the + // first two elements exist and are key/value strings. + v := make([]interface{}, 0, len(l.values)) + v = append(v, l.values...) + prefix, _ := v[1].(string) + v[1] = prefix + "." + name + clone.values = v + } else { + // Preprend new key/value pair. + v := make([]interface{}, 0, 2+len(l.values)) + v = append(v, nameKey, name) + v = append(v, l.values...) + clone.values = v + clone.hasPrefix = true + } + return &clone +} + +func (l *tlogger) WithValues(kvList ...interface{}) logr.LogSink { + clone := *l + clone.values = serialize.WithValues(l.values, kvList) + return &clone +} + +// KlogBufferWriter is implemented by the textlogger LogSink. +type KlogBufferWriter interface { + // WriteKlogBuffer takes a pre-formatted buffer prepared by klog and + // writes it unchanged to the output stream. Can be used with + // klog.WriteKlogBuffer when setting a logger through + // klog.SetLoggerWithOptions. + WriteKlogBuffer([]byte) +} + +var _ logr.LogSink = &tlogger{} +var _ logr.CallDepthLogSink = &tlogger{} +var _ KlogBufferWriter = &tlogger{} diff --git a/apis/vendor/k8s.io/klog/v2/textlogger/textlogger_slog.go b/apis/vendor/k8s.io/klog/v2/textlogger/textlogger_slog.go new file mode 100644 index 00000000000..c888ef8a6b7 --- /dev/null +++ b/apis/vendor/k8s.io/klog/v2/textlogger/textlogger_slog.go @@ -0,0 +1,52 @@ +//go:build go1.21 +// +build go1.21 + +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package textlogger + +import ( + "context" + "log/slog" + + "github.com/go-logr/logr" + + "k8s.io/klog/v2/internal/serialize" + "k8s.io/klog/v2/internal/sloghandler" +) + +func (l *tlogger) Handle(ctx context.Context, record slog.Record) error { + return sloghandler.Handle(ctx, record, l.groups, l.printWithInfos) +} + +func (l *tlogger) WithAttrs(attrs []slog.Attr) logr.SlogSink { + clone := *l + clone.values = serialize.WithValues(l.values, sloghandler.Attrs2KVList(l.groups, attrs)) + return &clone +} + +func (l *tlogger) WithGroup(name string) logr.SlogSink { + clone := *l + if clone.groups != "" { + clone.groups += "." + name + } else { + clone.groups = name + } + return &clone +} + +var _ logr.SlogSink = &tlogger{} diff --git a/apis/vendor/k8s.io/utils/internal/third_party/forked/golang/net/ip.go b/apis/vendor/k8s.io/utils/internal/third_party/forked/golang/net/ip.go index 4340b6e7482..407c2463648 100644 --- a/apis/vendor/k8s.io/utils/internal/third_party/forked/golang/net/ip.go +++ b/apis/vendor/k8s.io/utils/internal/third_party/forked/golang/net/ip.go @@ -41,7 +41,7 @@ var IPv4 = stdnet.IPv4 // Parse IPv4 address (d.d.d.d). func parseIPv4(s string) IP { var p [IPv4len]byte - for i := 0; i < IPv4len; i++ { + for i := range IPv4len { if len(s) == 0 { // Missing octets. return nil diff --git a/apis/vendor/k8s.io/utils/ptr/OWNERS b/apis/vendor/k8s.io/utils/ptr/OWNERS index 0d6392752af..55da8262a05 100644 --- a/apis/vendor/k8s.io/utils/ptr/OWNERS +++ b/apis/vendor/k8s.io/utils/ptr/OWNERS @@ -2,9 +2,11 @@ approvers: - apelisse +- skitt - stewart-yu - thockin reviewers: - apelisse +- skitt - stewart-yu - thockin diff --git a/apis/vendor/k8s.io/utils/ptr/ptr.go b/apis/vendor/k8s.io/utils/ptr/ptr.go index 659ed3b9e2d..260f4f29ad9 100644 --- a/apis/vendor/k8s.io/utils/ptr/ptr.go +++ b/apis/vendor/k8s.io/utils/ptr/ptr.go @@ -27,19 +27,19 @@ import ( // // This function is only valid for structs and pointers to structs. Any other // type will cause a panic. Passing a typed nil pointer will return true. -func AllPtrFieldsNil(obj interface{}) bool { +func AllPtrFieldsNil(obj any) bool { v := reflect.ValueOf(obj) if !v.IsValid() { panic(fmt.Sprintf("reflect.ValueOf() produced a non-valid Value for %#v", obj)) } - if v.Kind() == reflect.Ptr { + if v.Kind() == reflect.Pointer { if v.IsNil() { return true } v = v.Elem() } for i := 0; i < v.NumField(); i++ { - if v.Field(i).Kind() == reflect.Ptr && !v.Field(i).IsNil() { + if v.Field(i).Kind() == reflect.Pointer && !v.Field(i).IsNil() { return false } } @@ -51,7 +51,7 @@ func To[T any](v T) *T { return &v } -// Deref dereferences ptr and returns the value it points to if no nil, or else +// Deref dereferences ptr and returns the value it points to if not nil, or else // returns def. func Deref[T any](ptr *T, def T) T { if ptr != nil { diff --git a/apis/vendor/modules.txt b/apis/vendor/modules.txt index 3b0856236aa..e159596f035 100644 --- a/apis/vendor/modules.txt +++ b/apis/vendor/modules.txt @@ -7,30 +7,28 @@ github.com/go-logr/logr # github.com/json-iterator/go v1.1.12 ## explicit; go 1.12 github.com/json-iterator/go -# github.com/kr/text v0.2.0 -## explicit # github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd ## explicit github.com/modern-go/concurrent # github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee ## explicit; go 1.12 github.com/modern-go/reflect2 -# github.com/openshift/api v0.0.0-20260318185450-1f2fa3f09f4e -## explicit; go 1.25.0 +# github.com/openshift/api v0.0.0-20260728120005-8ba0b25b0f29 +## explicit; go 1.26.0 github.com/openshift/api/config/v1 github.com/openshift/api/machine/v1 github.com/openshift/api/machine/v1beta1 github.com/openshift/api/operator/v1 -# github.com/openshift/installer v1.4.22-ec5 -## explicit; go 1.25.0 +# github.com/openshift/installer v1.5.0-alpha.1 +## explicit; go 1.26.0 github.com/openshift/installer/pkg/types/vsphere # github.com/x448/float16 v0.8.4 ## explicit; go 1.11 github.com/x448/float16 -# go.yaml.in/yaml/v2 v2.4.3 +# go.yaml.in/yaml/v2 v2.4.4 ## explicit; go 1.15 go.yaml.in/yaml/v2 -# golang.org/x/net v0.55.0 +# golang.org/x/net v0.55.1-0.20260602153038-42abb857022c ## explicit; go 1.25.0 golang.org/x/net/http/httpguts golang.org/x/net/http2 @@ -38,7 +36,7 @@ golang.org/x/net/http2/hpack golang.org/x/net/idna golang.org/x/net/internal/httpcommon golang.org/x/net/internal/httpsfv -# golang.org/x/text v0.37.0 +# golang.org/x/text v0.38.0 ## explicit; go 1.25.0 golang.org/x/text/secure/bidirule golang.org/x/text/transform @@ -47,13 +45,13 @@ golang.org/x/text/unicode/norm # gopkg.in/inf.v0 v0.9.1 ## explicit gopkg.in/inf.v0 -# k8s.io/api v0.35.4 -## explicit; go 1.25.0 +# k8s.io/api v0.36.2 +## explicit; go 1.26.0 k8s.io/api/authorization/v1 k8s.io/api/core/v1 k8s.io/api/rbac/v1 -# k8s.io/apimachinery v0.35.4 -## explicit; go 1.25.0 +# k8s.io/apimachinery v0.36.2 +## explicit; go 1.26.0 k8s.io/apimachinery/pkg/api/operation k8s.io/apimachinery/pkg/api/resource k8s.io/apimachinery/pkg/api/validate/constraints @@ -80,8 +78,8 @@ k8s.io/apimachinery/pkg/util/validation k8s.io/apimachinery/pkg/util/validation/field k8s.io/apimachinery/pkg/watch k8s.io/apimachinery/third_party/forked/golang/reflect -# k8s.io/klog/v2 v2.130.1 -## explicit; go 1.18 +# k8s.io/klog/v2 v2.140.0 +## explicit; go 1.21 k8s.io/klog/v2 k8s.io/klog/v2/internal/buffer k8s.io/klog/v2/internal/clock @@ -89,11 +87,13 @@ k8s.io/klog/v2/internal/dbg k8s.io/klog/v2/internal/serialize k8s.io/klog/v2/internal/severity k8s.io/klog/v2/internal/sloghandler -# k8s.io/kube-openapi v0.0.0-20260304202019-5b3e3fdb0acf -## explicit; go 1.23.0 +k8s.io/klog/v2/internal/verbosity +k8s.io/klog/v2/textlogger +# k8s.io/kube-openapi v0.0.0-20260519202549-bbf5c5577288 +## explicit; go 1.24.0 k8s.io/kube-openapi/pkg/util -# k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 -## explicit; go 1.18 +# k8s.io/utils v0.0.0-20260707023825-cf1189d6abe3 +## explicit; go 1.25 k8s.io/utils/internal/third_party/forked/golang/net k8s.io/utils/net k8s.io/utils/ptr @@ -105,6 +105,6 @@ sigs.k8s.io/json/internal/golang/encoding/json ## explicit; go 1.18 sigs.k8s.io/randfill sigs.k8s.io/randfill/bytesource -# sigs.k8s.io/structured-merge-diff/v6 v6.3.1 +# sigs.k8s.io/structured-merge-diff/v6 v6.4.0 ## explicit; go 1.23 sigs.k8s.io/structured-merge-diff/v6/value diff --git a/apis/vendor/sigs.k8s.io/structured-merge-diff/v6/value/allocator.go b/apis/vendor/sigs.k8s.io/structured-merge-diff/v6/value/allocator.go index f70cd41674b..acbfe8cebaa 100644 --- a/apis/vendor/sigs.k8s.io/structured-merge-diff/v6/value/allocator.go +++ b/apis/vendor/sigs.k8s.io/structured-merge-diff/v6/value/allocator.go @@ -16,6 +16,8 @@ limitations under the License. package value +import "reflect" + // Allocator provides a value object allocation strategy. // Value objects can be allocated by passing an allocator to the "Using" // receiver functions on the value interfaces, e.g. Map.ZipUsing(allocator, ...). @@ -24,8 +26,8 @@ package value type Allocator interface { // Free gives the allocator back any value objects returned by the "Using" // receiver functions on the value interfaces. - // interface{} may be any of: Value, Map, List or Range. - Free(interface{}) + // any may be any of: Value, Map, List or Range. + Free(any) // The unexported functions are for "Using" receiver functions of the value types // to request what they need from the allocator. @@ -74,7 +76,7 @@ func (p *heapAllocator) allocListReflectRange() *listReflectRange { return &listReflectRange{vr: &valueReflect{}} } -func (p *heapAllocator) Free(_ interface{}) {} +func (p *heapAllocator) Free(_ any) {} // NewFreelistAllocator creates freelist based allocator. // This allocator provides fast allocation and freeing of short lived value objects. @@ -89,25 +91,25 @@ func (p *heapAllocator) Free(_ interface{}) {} // for all temporary value access. func NewFreelistAllocator() Allocator { return &freelistAllocator{ - valueUnstructured: &freelist{new: func() interface{} { + valueUnstructured: &freelist[*valueUnstructured]{new: func() *valueUnstructured { return &valueUnstructured{} }}, - listUnstructuredRange: &freelist{new: func() interface{} { + listUnstructuredRange: &freelist[*listUnstructuredRange]{new: func() *listUnstructuredRange { return &listUnstructuredRange{vv: &valueUnstructured{}} }}, - valueReflect: &freelist{new: func() interface{} { + valueReflect: &freelist[*valueReflect]{new: func() *valueReflect { return &valueReflect{} }}, - mapReflect: &freelist{new: func() interface{} { + mapReflect: &freelist[*mapReflect]{new: func() *mapReflect { return &mapReflect{} }}, - structReflect: &freelist{new: func() interface{} { + structReflect: &freelist[*structReflect]{new: func() *structReflect { return &structReflect{} }}, - listReflect: &freelist{new: func() interface{} { + listReflect: &freelist[*listReflect]{new: func() *listReflect { return &listReflect{} }}, - listReflectRange: &freelist{new: func() interface{} { + listReflectRange: &freelist[*listReflectRange]{new: func() *listReflectRange { return &listReflectRange{vr: &valueReflect{}} }}, } @@ -119,22 +121,22 @@ func NewFreelistAllocator() Allocator { const freelistMaxSize = 1000 type freelistAllocator struct { - valueUnstructured *freelist - listUnstructuredRange *freelist - valueReflect *freelist - mapReflect *freelist - structReflect *freelist - listReflect *freelist - listReflectRange *freelist + valueUnstructured *freelist[*valueUnstructured] + listUnstructuredRange *freelist[*listUnstructuredRange] + valueReflect *freelist[*valueReflect] + mapReflect *freelist[*mapReflect] + structReflect *freelist[*structReflect] + listReflect *freelist[*listReflect] + listReflectRange *freelist[*listReflectRange] } -type freelist struct { - list []interface{} - new func() interface{} +type freelist[T any] struct { + list []T + new func() T } -func (f *freelist) allocate() interface{} { - var w2 interface{} +func (f *freelist[T]) allocate() T { + var w2 T if n := len(f.list); n > 0 { w2, f.list = f.list[n-1], f.list[:n-1] } else { @@ -143,61 +145,73 @@ func (f *freelist) allocate() interface{} { return w2 } -func (f *freelist) free(v interface{}) { +func (f *freelist[T]) free(v T) { if len(f.list) < freelistMaxSize { f.list = append(f.list, v) } } -func (w *freelistAllocator) Free(value interface{}) { +func (w *freelistAllocator) Free(value any) { switch v := value.(type) { case *valueUnstructured: v.Value = nil // don't hold references to unstructured objects w.valueUnstructured.free(v) case *listUnstructuredRange: + v.list = nil // don't hold references to unstructured objects v.vv.Value = nil // don't hold references to unstructured objects w.listUnstructuredRange.free(v) case *valueReflect: - v.ParentMapKey = nil v.ParentMap = nil + v.ParentMapKey = nil + v.Value = reflect.Value{} // don't hold references to reflected objects w.valueReflect.free(v) case *mapReflect: + v.valueReflect.ParentMap = nil + v.valueReflect.ParentMapKey = nil + v.valueReflect.Value = reflect.Value{} // don't hold references to reflected objects w.mapReflect.free(v) case *structReflect: + v.valueReflect.ParentMap = nil + v.valueReflect.ParentMapKey = nil + v.valueReflect.Value = reflect.Value{} // don't hold references to reflected objects w.structReflect.free(v) case *listReflect: + v.Value = reflect.Value{} // don't hold references to reflected objects w.listReflect.free(v) case *listReflectRange: - v.vr.ParentMapKey = nil + v.list = reflect.Value{} // don't hold references to reflected objects v.vr.ParentMap = nil + v.vr.ParentMapKey = nil + v.vr.Value = reflect.Value{} // don't hold references to reflected objects + v.entry = nil w.listReflectRange.free(v) } } func (w *freelistAllocator) allocValueUnstructured() *valueUnstructured { - return w.valueUnstructured.allocate().(*valueUnstructured) + return w.valueUnstructured.allocate() } func (w *freelistAllocator) allocListUnstructuredRange() *listUnstructuredRange { - return w.listUnstructuredRange.allocate().(*listUnstructuredRange) + return w.listUnstructuredRange.allocate() } func (w *freelistAllocator) allocValueReflect() *valueReflect { - return w.valueReflect.allocate().(*valueReflect) + return w.valueReflect.allocate() } func (w *freelistAllocator) allocStructReflect() *structReflect { - return w.structReflect.allocate().(*structReflect) + return w.structReflect.allocate() } func (w *freelistAllocator) allocMapReflect() *mapReflect { - return w.mapReflect.allocate().(*mapReflect) + return w.mapReflect.allocate() } func (w *freelistAllocator) allocListReflect() *listReflect { - return w.listReflect.allocate().(*listReflect) + return w.listReflect.allocate() } func (w *freelistAllocator) allocListReflectRange() *listReflectRange { - return w.listReflectRange.allocate().(*listReflectRange) + return w.listReflectRange.allocate() } diff --git a/apis/vendor/sigs.k8s.io/structured-merge-diff/v6/value/jsontagutil.go b/apis/vendor/sigs.k8s.io/structured-merge-diff/v6/value/jsontagutil.go index 3aadceb2226..db256137345 100644 --- a/apis/vendor/sigs.k8s.io/structured-merge-diff/v6/value/jsontagutil.go +++ b/apis/vendor/sigs.k8s.io/structured-merge-diff/v6/value/jsontagutil.go @@ -76,11 +76,16 @@ func OmitZeroFunc(t reflect.Type) func(reflect.Value) bool { // but is based on the highly efficient approach from https://golang.org/src/encoding/json/encode.go func lookupJsonTags(f reflect.StructField) (name string, omit bool, inline bool, omitempty bool, omitzero func(reflect.Value) bool) { + // Skip unexported non-embedded fields, matching encoding/json behavior. + if f.PkgPath != "" && !f.Anonymous { + return "", true, false, false, nil + } tag := f.Tag.Get("json") if tag == "-" { return "", true, false, false, nil } name, opts := parseTag(tag) + inline = f.Anonymous && name == "" if name == "" { name = f.Name } @@ -89,7 +94,7 @@ func lookupJsonTags(f reflect.StructField) (name string, omit bool, inline bool, omitzero = OmitZeroFunc(f.Type) } - return name, false, opts.Contains("inline"), opts.Contains("omitempty"), omitzero + return name, false, inline, opts.Contains("omitempty"), omitzero } func isEmpty(v reflect.Value) bool { diff --git a/apis/vendor/sigs.k8s.io/structured-merge-diff/v6/value/reflectcache.go b/apis/vendor/sigs.k8s.io/structured-merge-diff/v6/value/reflectcache.go index 3b4a402ee1a..75b7085c3e6 100644 --- a/apis/vendor/sigs.k8s.io/structured-merge-diff/v6/value/reflectcache.go +++ b/apis/vendor/sigs.k8s.io/structured-merge-diff/v6/value/reflectcache.go @@ -84,6 +84,10 @@ func (f *FieldCacheEntry) CanOmit(fieldVal reflect.Value) bool { func (f *FieldCacheEntry) GetFrom(structVal reflect.Value) reflect.Value { // field might be nested within 'inline' structs for _, elem := range f.fieldPath { + if safeIsNil(structVal) { + // if any part of the path is nil, return the zero value for the field type + return reflect.Zero(f.fieldType) + } structVal = dereference(structVal).FieldByIndex(elem) } return structVal diff --git a/config/crds/hive.openshift.io_clusterdeployments.yaml b/config/crds/hive.openshift.io_clusterdeployments.yaml index 1e98c50e9eb..6334a4aa9fa 100644 --- a/config/crds/hive.openshift.io_clusterdeployments.yaml +++ b/config/crds/hive.openshift.io_clusterdeployments.yaml @@ -484,6 +484,37 @@ spec: If unset, the default timeout is 30s format: duration type: string + configurationManagement: + description: |- + configurationManagement specifies how OpenShift router should update + the HAProxy configuration. The following values are valid for this + field: + + * "ForkAndReload". + * "Dynamic". + + Omitting this field means that the user has no opinion and the + platform may choose a reasonable default. This default is subject to + change over time. The current default is "ForkAndReload". + + "ForkAndReload" means that OpenShift router should rewrite the + HAProxy configuration file and instruct HAProxy to fork and reload. + This is OpenShift router's traditional approach. + + "Dynamic" means that OpenShift router may use HAProxy's control + socket for some configuration updates and fall back to fork and + reload for other configuration updates. This is a newer approach, + which may be less mature than ForkAndReload. This setting can + improve load-balancing fairness and metrics accuracy and reduce CPU + and memory usage if HAProxy has frequent configuration updates for + route and endpoints updates. + + Note: The "Dynamic" option is currently experimental and should not + be enabled on production clusters. + enum: + - Dynamic + - ForkAndReload + type: string connectTimeout: description: |- connectTimeout defines the maximum time to wait for @@ -633,6 +664,9 @@ spec: 'container_memory_working_set_bytes{container="router",namespace="openshift-ingress"}/container_processes{container="router",namespace="openshift-ingress"}'. format: int32 type: integer + x-kubernetes-validations: + - message: maxConnections must be 0, -1, or between 2000 and 2000000 + rule: self == 0 || self == -1 || (self >= 2000 && self <= 2000000) reloadInterval: description: |- reloadInterval defines the minimum interval at which the router is allowed to reload @@ -2269,24 +2303,6 @@ spec: description: enabledCapabilities lists all the capabilities that are currently managed. items: description: ClusterVersionCapability enumerates optional, core cluster components. - enum: - - openshift-samples - - baremetal - - marketplace - - Console - - Insights - - Storage - - CSISnapshot - - NodeTuning - - MachineAPI - - Build - - DeploymentConfig - - ImageRegistry - - OperatorLifecycleManager - - CloudCredential - - Ingress - - CloudControllerManager - - OperatorLifecycleManagerV1 type: string type: array x-kubernetes-list-type: atomic @@ -2294,24 +2310,6 @@ spec: description: knownCapabilities lists all the capabilities known to the current cluster. items: description: ClusterVersionCapability enumerates optional, core cluster components. - enum: - - openshift-samples - - baremetal - - marketplace - - Console - - Insights - - Storage - - CSISnapshot - - NodeTuning - - MachineAPI - - Build - - DeploymentConfig - - ImageRegistry - - OperatorLifecycleManager - - CloudCredential - - Ingress - - CloudControllerManager - - OperatorLifecycleManagerV1 type: string type: array x-kubernetes-list-type: atomic diff --git a/go.mod b/go.mod index b8d47acd718..8681cc89956 100644 --- a/go.mod +++ b/go.mod @@ -9,10 +9,10 @@ require ( github.com/Azure/go-autorest/autorest v0.11.30 github.com/Azure/go-autorest/autorest/azure/auth v0.5.13 github.com/Azure/go-autorest/autorest/to v0.4.0 - github.com/IBM/go-sdk-core/v5 v5.21.0 - github.com/IBM/networking-go-sdk v0.51.11 - github.com/IBM/platform-services-go-sdk v0.86.1 - github.com/IBM/vpc-go-sdk v0.71.1 + github.com/IBM/go-sdk-core/v5 v5.21.2 + github.com/IBM/networking-go-sdk v0.51.15 + github.com/IBM/platform-services-go-sdk v0.91.0 + github.com/IBM/vpc-go-sdk v0.76.2 github.com/blang/semver/v4 v4.0.0 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc github.com/davegardnerisme/deephash v0.0.0-20210406090112-6d072427d830 @@ -28,14 +28,14 @@ require ( github.com/miekg/dns v1.1.35 github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee github.com/onsi/ginkgo v1.16.5 - github.com/onsi/gomega v1.38.2 - github.com/openshift/api v0.0.0-20260318185450-1f2fa3f09f4e + github.com/onsi/gomega v1.42.0 + github.com/openshift/api v0.0.0-20260728120005-8ba0b25b0f29 github.com/openshift/build-machinery-go v0.0.0-20250602125535-1b6d00b8c37c github.com/openshift/cluster-autoscaler-operator v0.0.1-0.20250219201631-227f7537c3b4 github.com/openshift/generic-admission-server v1.14.1-0.20260305203524-5df3cca1e3cd github.com/openshift/hive/apis v0.0.0 - github.com/openshift/installer v1.4.22-ec5 - github.com/openshift/library-go v0.0.0-20251107090138-0de9712313a5 + github.com/openshift/installer v1.5.0-alpha.1 + github.com/openshift/library-go v0.0.0-20260728221828-f675e9a73816 github.com/openshift/machine-api-operator v0.2.1-0.20251128002018-85c00c0d525f github.com/openshift/machine-api-provider-gcp v0.0.1-0.20260113091719-80740861bb2a github.com/openshift/machine-api-provider-ibmcloud v0.0.0-20231207164151-6b0b8ea7b16d @@ -43,34 +43,34 @@ require ( github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.84.0 github.com/prometheus/client_golang v1.23.2 github.com/prometheus/client_model v0.6.2 - github.com/sirupsen/logrus v1.9.4-0.20230606125235-dd1b4c2e81af - github.com/spf13/cobra v1.10.1 + github.com/sirupsen/logrus v1.9.4 + github.com/spf13/cobra v1.10.2 github.com/spf13/pflag v1.0.10 github.com/stretchr/testify v1.11.1 github.com/tidwall/gjson v1.18.0 github.com/vmware/govmomi v0.53.0 - golang.org/x/crypto v0.52.0 + golang.org/x/crypto v0.53.0 golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 - golang.org/x/mod v0.35.0 - golang.org/x/net v0.55.0 // indirect - golang.org/x/oauth2 v0.34.0 - golang.org/x/time v0.14.0 - google.golang.org/api v0.255.0 - gopkg.in/ini.v1 v1.67.0 + golang.org/x/mod v0.36.0 + golang.org/x/net v0.55.1-0.20260602153038-42abb857022c // indirect + golang.org/x/oauth2 v0.36.0 + golang.org/x/time v0.15.0 + google.golang.org/api v0.267.0 + gopkg.in/ini.v1 v1.67.3 gopkg.in/yaml.v2 v2.4.0 - k8s.io/api v0.35.4 - k8s.io/apiextensions-apiserver v0.35.4 - k8s.io/apimachinery v0.35.4 - k8s.io/cli-runtime v0.35.4 - k8s.io/client-go v0.35.4 + k8s.io/api v0.36.2 + k8s.io/apiextensions-apiserver v0.36.2 + k8s.io/apimachinery v0.36.2 + k8s.io/cli-runtime v0.36.0 + k8s.io/client-go v0.36.2 k8s.io/cluster-registry v0.0.6 - k8s.io/code-generator v0.35.4 + k8s.io/code-generator v0.36.2 k8s.io/klog v1.0.0 - k8s.io/kube-aggregator v0.35.4 - k8s.io/kubectl v0.35.4 - k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 - sigs.k8s.io/cluster-api-provider-azure v1.21.1-0.20250929163617-2c4eaa611a39 - sigs.k8s.io/controller-runtime v0.22.4 + k8s.io/kube-aggregator v0.36.2 + k8s.io/kubectl v0.36.0 + k8s.io/utils v0.0.0-20260707023825-cf1189d6abe3 + sigs.k8s.io/cluster-api-provider-azure v1.24.2 + sigs.k8s.io/controller-runtime v0.24.1 sigs.k8s.io/controller-tools v0.19.0 sigs.k8s.io/yaml v1.6.0 ) @@ -82,7 +82,7 @@ require ( github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcegraph/armresourcegraph v0.8.2 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 // indirect github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.1 // indirect - github.com/IBM-Cloud/power-go-client v1.12.0 // indirect + github.com/IBM-Cloud/power-go-client v1.14.4 // indirect github.com/IBM/keyprotect-go-client v0.12.2 // indirect github.com/OpenPeeDeeP/depguard/v2 v2.2.1 // indirect github.com/alexkohler/nakedret/v2 v2.0.5 // indirect @@ -102,7 +102,7 @@ require ( github.com/go-openapi/validate v0.24.0 // indirect github.com/go-test/deep v1.1.1 github.com/golang-jwt/jwt/v5 v5.3.0 // indirect - github.com/hashicorp/go-version v1.7.0 // indirect + github.com/hashicorp/go-version v1.9.0 // indirect github.com/hexops/gotextdiff v1.0.3 // indirect github.com/kkHAIKE/contextcheck v1.1.6 // indirect github.com/leonklingele/grouper v1.1.2 // indirect @@ -118,10 +118,10 @@ require ( github.com/yagipy/maintidx v1.0.0 // indirect github.com/ykadowak/zerologlint v0.1.5 // indirect gitlab.com/bosi/decorder v0.4.2 // indirect - golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 // indirect - sigs.k8s.io/cluster-api v1.11.3 // indirect - sigs.k8s.io/cluster-api-provider-aws/v2 v2.10.1-0.20260226000023-67627b2da0df // indirect - sigs.k8s.io/cluster-api-provider-gcp v1.10.1-0.20251030112604-5c2bfd5aadb3 // indirect + golang.org/x/exp v0.0.0-20251219203646-944ab1f22d93 // indirect + sigs.k8s.io/cluster-api v1.13.4 // indirect + sigs.k8s.io/cluster-api-provider-aws/v2 v2.12.1 // indirect + sigs.k8s.io/cluster-api-provider-gcp v1.12.0 // indirect ) require ( @@ -130,7 +130,7 @@ require ( github.com/aws/aws-sdk-go-v2/config v1.32.10 github.com/aws/aws-sdk-go-v2/credentials v1.19.10 github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.18 // indirect - github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.19.12 + github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.20.13 github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.21 // indirect github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.21 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.8.4 // indirect @@ -154,30 +154,30 @@ require ( ) require ( - github.com/openshift/client-go v0.0.0-20260317180604-743f664b82d1 + github.com/openshift/client-go v0.0.0-20260728123811-92b24dd0dd1f go.uber.org/mock v0.6.0 ) require ( 4d63.com/gochecknoglobals v0.2.2 // indirect cel.dev/expr v0.25.1 // indirect - cloud.google.com/go v0.121.6 // indirect - cloud.google.com/go/auth v0.17.0 // indirect + cloud.google.com/go v0.123.0 // indirect + cloud.google.com/go/auth v0.18.1 // indirect cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect cloud.google.com/go/iam v1.5.3 // indirect - cloud.google.com/go/kms v1.22.0 // indirect - cloud.google.com/go/longrunning v0.6.7 // indirect - cloud.google.com/go/monitoring v1.24.2 // indirect - cloud.google.com/go/storage v1.57.0 // indirect + cloud.google.com/go/kms v1.25.0 // indirect + cloud.google.com/go/longrunning v0.8.0 // indirect + cloud.google.com/go/monitoring v1.24.3 // indirect + cloud.google.com/go/storage v1.58.0 // indirect + codeberg.org/chavacava/garif v0.2.0 // indirect github.com/AlecAivazis/survey/v2 v2.3.7 // indirect github.com/Antonboom/errname v1.0.0 // indirect github.com/Antonboom/testifylint v1.5.2 // indirect - github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.7.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/msi/armmsi v1.3.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork v1.1.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2 v2.2.1 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.8.1 // indirect - github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect + github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect github.com/Azure/go-autorest v14.2.0+incompatible // indirect github.com/Azure/go-autorest/autorest/adal v0.9.24 // indirect github.com/Azure/go-autorest/autorest/azure/cli v0.4.6 // indirect @@ -185,14 +185,14 @@ require ( github.com/Azure/go-autorest/autorest/validation v0.3.1 // indirect github.com/Azure/go-autorest/logger v0.2.2 // indirect github.com/Azure/go-autorest/tracing v0.6.1 // indirect - github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c // indirect + github.com/BurntSushi/toml v1.6.0 // indirect github.com/Crocmagnon/fatcontext v0.7.1 // indirect github.com/Djarvur/go-err113 v0.1.0 // indirect - github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.30.0 // indirect - github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.53.0 // indirect - github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.53.0 // indirect + github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.31.0 // indirect + github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.54.0 // indirect + github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.54.0 // indirect github.com/IBM-Cloud/bluemix-go v0.0.0-20211102075456-ffc4e11dfb16 // indirect - github.com/IBM/ibm-cos-sdk-go v1.12.3 // indirect + github.com/IBM/ibm-cos-sdk-go v1.12.4 // indirect github.com/MakeNowJust/heredoc v1.0.0 // indirect github.com/Masterminds/semver/v3 v3.4.0 // indirect github.com/NYTimes/gziphandler v1.1.1 // indirect @@ -203,8 +203,6 @@ require ( github.com/alingse/nilnesserr v0.1.2 // indirect github.com/antlr4-go/antlr/v4 v4.13.1 // indirect github.com/apparentlymart/go-cidr v1.1.0 // indirect - github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect - github.com/asaskevich/govalidator/v11 v11.0.2-0.20250122183457-e11347878e23 // indirect github.com/ashanbrown/forbidigo v1.6.0 // indirect github.com/ashanbrown/makezero v1.2.0 // indirect github.com/aws/aws-sdk-go-v2/service/cloudfront v1.40.4 // indirect @@ -220,14 +218,11 @@ require ( github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/chai2010/gettext-go v1.0.2 // indirect github.com/charithe/durationcheck v0.0.10 // indirect - github.com/chavacava/garif v0.1.0 // indirect github.com/ckaznocha/intrange v0.3.0 // indirect github.com/cncf/xds/go v0.0.0-20251210132809-ee656c7534f5 // indirect - github.com/containers/image/v5 v5.31.0 // indirect - github.com/containers/storage v1.54.0 // indirect github.com/coreos/go-semver v0.3.1 // indirect - github.com/coreos/go-systemd/v22 v22.6.0 // indirect - github.com/coreos/ignition/v2 v2.24.0 // indirect + github.com/coreos/go-systemd/v22 v22.7.0 // indirect + github.com/coreos/ignition/v2 v2.25.0 // indirect github.com/coreos/stream-metadata-go v0.4.10-0.20250806142651-4a7d280a6c7b // indirect github.com/coreos/vcontext v0.0.0-20230201181013-d72178a18687 // indirect github.com/daixiang0/gci v0.13.7 // indirect @@ -238,33 +233,33 @@ require ( github.com/ettle/strcase v0.2.0 // indirect github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f // indirect github.com/fatih/camelcase v1.0.0 // indirect - github.com/fatih/color v1.18.0 // indirect + github.com/fatih/color v1.19.0 // indirect github.com/fatih/structtag v1.2.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.9.0 // indirect github.com/fxamacker/cbor/v2 v2.9.0 // indirect github.com/fzipp/gocyclo v0.6.0 // indirect - github.com/gabriel-vasile/mimetype v1.4.9 // indirect + github.com/gabriel-vasile/mimetype v1.4.11 // indirect github.com/ghostiam/protogetter v0.3.9 // indirect github.com/go-critic/go-critic v0.12.0 // indirect github.com/go-errors/errors v1.4.2 // indirect github.com/go-jose/go-jose/v4 v4.1.4 // indirect - github.com/go-openapi/errors v0.22.1 // indirect + github.com/go-openapi/errors v0.22.4 // indirect github.com/go-openapi/jsonpointer v0.22.3 // indirect github.com/go-openapi/jsonreference v0.21.3 // indirect - github.com/go-openapi/strfmt v0.23.0 // indirect - github.com/go-openapi/swag v0.25.3 // indirect - github.com/go-openapi/swag/cmdutils v0.25.3 // indirect - github.com/go-openapi/swag/conv v0.25.3 // indirect - github.com/go-openapi/swag/fileutils v0.25.3 // indirect - github.com/go-openapi/swag/jsonname v0.25.3 // indirect - github.com/go-openapi/swag/jsonutils v0.25.3 // indirect - github.com/go-openapi/swag/loading v0.25.3 // indirect - github.com/go-openapi/swag/mangling v0.25.3 // indirect - github.com/go-openapi/swag/netutils v0.25.3 // indirect - github.com/go-openapi/swag/stringutils v0.25.3 // indirect - github.com/go-openapi/swag/typeutils v0.25.3 // indirect - github.com/go-openapi/swag/yamlutils v0.25.3 // indirect + github.com/go-openapi/strfmt v0.25.0 // indirect + github.com/go-openapi/swag v0.25.4 // indirect + github.com/go-openapi/swag/cmdutils v0.25.4 // indirect + github.com/go-openapi/swag/conv v0.25.4 // indirect + github.com/go-openapi/swag/fileutils v0.25.4 // indirect + github.com/go-openapi/swag/jsonname v0.25.4 // indirect + github.com/go-openapi/swag/jsonutils v0.25.4 // indirect + github.com/go-openapi/swag/loading v0.25.4 // indirect + github.com/go-openapi/swag/mangling v0.25.4 // indirect + github.com/go-openapi/swag/netutils v0.25.4 // indirect + github.com/go-openapi/swag/stringutils v0.25.4 // indirect + github.com/go-openapi/swag/typeutils v0.25.4 // indirect + github.com/go-openapi/swag/yamlutils v0.25.4 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect github.com/go-toolsmith/astcast v1.1.0 // indirect @@ -290,15 +285,15 @@ require ( github.com/golangci/revgrep v0.8.0 // indirect github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed // indirect github.com/google/btree v1.1.3 // indirect - github.com/googleapis/gax-go/v2 v2.15.0 // indirect - github.com/gophercloud/gophercloud/v2 v2.8.0 // indirect + github.com/googleapis/gax-go/v2 v2.17.0 // indirect + github.com/gophercloud/gophercloud/v2 v2.10.0 // indirect github.com/gordonklaus/ineffassign v0.1.0 // indirect github.com/gostaticanalysis/analysisutil v0.7.1 // indirect github.com/gostaticanalysis/comment v1.5.0 // indirect github.com/gostaticanalysis/forcetypeassert v0.2.0 // indirect github.com/gostaticanalysis/nilerr v0.1.1 // indirect - github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect - github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect + github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.1.0 // indirect + github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.3 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-immutable-radix/v2 v2.1.0 // indirect github.com/hashicorp/go-retryablehttp v0.7.8 // indirect @@ -329,16 +324,14 @@ require ( github.com/matoous/godox v1.1.0 // indirect github.com/mattn/go-colorable v0.1.14 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.16 // indirect github.com/metal3-io/baremetal-operator/apis v0.4.0 // indirect github.com/metal3-io/baremetal-operator/pkg/hardwareutils v0.4.0 // indirect - github.com/mgechev/revive v1.7.0 // indirect + github.com/mgechev/revive v1.15.0 // indirect github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect github.com/microsoft/kiota-serialization-form-go v1.1.2 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect - github.com/mitchellh/mapstructure v1.5.0 // indirect - github.com/moby/term v0.5.0 // indirect + github.com/moby/term v0.5.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect github.com/moricho/tparallel v0.3.2 // indirect @@ -346,19 +339,18 @@ require ( github.com/nakabonne/nestif v0.3.1 // indirect github.com/nishanths/exhaustive v0.12.0 // indirect github.com/nishanths/predeclared v0.2.2 // indirect - github.com/nutanix-cloud-native/cluster-api-provider-nutanix v1.7.0 // indirect - github.com/nutanix-cloud-native/prism-go-client v0.5.0 // indirect + github.com/nutanix-cloud-native/cluster-api-provider-nutanix v1.10.3 // indirect + github.com/nutanix-cloud-native/prism-go-client v0.8.0 // indirect github.com/nxadm/tail v1.4.11 // indirect github.com/oklog/ulid v1.3.1 // indirect - github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/openshift/cloud-credential-operator v0.0.0-20250925191450-a3e50aeacc55 // indirect github.com/ovirt/go-ovirt v0.0.0-20210809163552-d4276e35d3db // indirect github.com/peterbourgon/diskv v2.0.1+incompatible // indirect github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/polyfloyd/go-errorlint v1.7.1 // indirect - github.com/prometheus/common v0.67.4 // indirect - github.com/prometheus/procfs v0.19.2 // indirect + github.com/prometheus/common v0.67.5 // indirect + github.com/prometheus/procfs v0.20.1 // indirect github.com/quasilyte/go-ruleguard v0.4.3-0.20240823090925-0fe6f58b47b1 // indirect github.com/quasilyte/go-ruleguard/dsl v0.3.22 // indirect github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 // indirect @@ -367,18 +359,18 @@ require ( github.com/rogpeppe/go-internal v1.14.1 // indirect github.com/ryancurrah/gomodguard v1.3.5 // indirect github.com/ryanrolds/sqlclosecheck v0.5.1 // indirect - github.com/sagikazarmark/locafero v0.7.0 // indirect + github.com/sagikazarmark/locafero v0.11.0 // indirect github.com/sanposhiho/wastedassign/v2 v2.1.0 // indirect - github.com/santhosh-tekuri/jsonschema/v6 v6.0.1 // indirect + github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 // indirect github.com/securego/gosec/v2 v2.22.2 // indirect github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 // indirect github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd // indirect github.com/sonatard/noctx v0.1.0 // indirect - github.com/sourcegraph/conc v0.3.0 // indirect + github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect github.com/sourcegraph/go-diff v0.7.0 // indirect - github.com/spf13/afero v1.12.0 // indirect - github.com/spf13/cast v1.7.1 // indirect - github.com/spf13/viper v1.20.1 // indirect + github.com/spf13/afero v1.15.0 // indirect + github.com/spf13/cast v1.10.0 // indirect + github.com/spf13/viper v1.21.0 // indirect github.com/spiffe/go-spiffe/v2 v2.6.0 // indirect github.com/ssgreg/nlreturn/v2 v2.2.1 // indirect github.com/std-uritemplate/std-uritemplate/go/v2 v2.0.5 // indirect @@ -399,36 +391,38 @@ require ( github.com/yeya24/promlinter v0.3.0 // indirect go-simpler.org/musttag v0.13.0 // indirect go-simpler.org/sloglint v0.9.0 // indirect - go.etcd.io/etcd/api/v3 v3.6.5 // indirect - go.etcd.io/etcd/client/pkg/v3 v3.6.5 // indirect - go.etcd.io/etcd/client/v3 v3.6.5 // indirect - go.mongodb.org/mongo-driver v1.17.4 // indirect + go.etcd.io/etcd/api/v3 v3.6.10 // indirect + go.etcd.io/etcd/client/pkg/v3 v3.6.10 // indirect + go.etcd.io/etcd/client/v3 v3.6.10 // indirect + go.mongodb.org/mongo-driver v1.17.6 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect go.opentelemetry.io/contrib/detectors/gcp v1.39.0 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.62.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.62.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.65.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.65.0 // indirect go.opentelemetry.io/otel v1.44.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.38.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.38.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.43.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.43.0 // indirect go.opentelemetry.io/otel/metric v1.44.0 // indirect go.opentelemetry.io/otel/sdk v1.43.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.43.0 // indirect go.opentelemetry.io/otel/trace v1.44.0 // indirect - go.opentelemetry.io/proto/otlp v1.7.1 // indirect + go.opentelemetry.io/proto/otlp v1.10.0 // indirect + go.podman.io/image/v5 v5.37.0 // indirect + go.podman.io/storage v1.60.0 // indirect go.uber.org/automaxprocs v1.6.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.1 // indirect - go.yaml.in/yaml/v2 v2.4.3 // indirect + go.yaml.in/yaml/v2 v2.4.4 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect - golang.org/x/sync v0.20.0 // indirect - golang.org/x/sys v0.45.0 // indirect - golang.org/x/term v0.43.0 // indirect - golang.org/x/text v0.37.0 // indirect - golang.org/x/tools v0.44.0 // indirect + golang.org/x/sync v0.21.0 // indirect + golang.org/x/sys v0.46.0 // indirect + golang.org/x/term v0.44.0 // indirect + golang.org/x/text v0.38.0 // indirect + golang.org/x/tools v0.45.0 // indirect gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect - google.golang.org/genproto v0.0.0-20250707201910-8d1bb00bc6a7 // indirect - google.golang.org/grpc v1.79.3 // indirect - google.golang.org/protobuf v1.36.10 // indirect + google.golang.org/genproto v0.0.0-20260128011058-8636f8732409 // indirect + google.golang.org/grpc v1.80.0 // indirect + google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af // indirect gopkg.in/gcfg.v1 v1.2.3 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect @@ -436,48 +430,49 @@ require ( gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect honnef.co/go/tools v0.6.1 // indirect - k8s.io/apiserver v0.35.4 // indirect + k8s.io/apiserver v0.36.2 // indirect k8s.io/cloud-provider-vsphere v1.33.3 // indirect - k8s.io/component-base v0.35.4 // indirect - k8s.io/component-helpers v0.35.4 // indirect + k8s.io/component-base v0.36.2 // indirect + k8s.io/component-helpers v0.36.0 // indirect k8s.io/gengo/v2 v2.0.0-20250922181213-ec3ebc5fd46b // indirect - k8s.io/klog/v2 v2.130.1 // indirect - k8s.io/kube-openapi v0.0.0-20260304202019-5b3e3fdb0acf // indirect + k8s.io/klog/v2 v2.140.0 // indirect + k8s.io/kube-openapi v0.0.0-20260519202549-bbf5c5577288 // indirect + k8s.io/streaming v0.36.2 // indirect mvdan.cc/gofumpt v0.7.0 // indirect mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f // indirect - sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.32.0 // indirect - sigs.k8s.io/cluster-api-provider-ibmcloud v0.12.0 // indirect - sigs.k8s.io/cluster-api-provider-openstack v0.13.0 // indirect - sigs.k8s.io/cluster-api-provider-vsphere v1.14.0 // indirect + sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.34.0 // indirect + sigs.k8s.io/cluster-api-provider-ibmcloud v0.13.1 // indirect + sigs.k8s.io/cluster-api-provider-openstack v0.14.6 // indirect + sigs.k8s.io/cluster-api-provider-vsphere v1.15.3 // indirect sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect sigs.k8s.io/kube-storage-version-migrator v0.0.6-0.20230721195810-5c8923c5ff96 // indirect - sigs.k8s.io/kustomize/api v0.20.1 // indirect - sigs.k8s.io/kustomize/kyaml v0.20.1 // indirect + sigs.k8s.io/kustomize/api v0.21.1 // indirect + sigs.k8s.io/kustomize/kyaml v0.21.1 // indirect sigs.k8s.io/randfill v1.0.0 // indirect - sigs.k8s.io/structured-merge-diff/v6 v6.3.1 // indirect + sigs.k8s.io/structured-merge-diff/v6 v6.4.0 // indirect ) require ( cloud.google.com/go/compute/metadata v0.9.0 // indirect github.com/Antonboom/nilnil v1.0.1 // indirect - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.19.1 // indirect - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.0 // indirect - github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.5.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.1 // indirect + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.12.0 // indirect + github.com/AzureAD/microsoft-authentication-library-for-go v1.6.0 // indirect github.com/blizzy78/varnamelen v0.8.0 // indirect github.com/breml/bidichk v0.3.2 // indirect github.com/butuzov/ireturn v0.3.1 // indirect - github.com/emicklei/go-restful/v3 v3.12.2 // indirect + github.com/emicklei/go-restful/v3 v3.13.0 // indirect github.com/evanphx/json-patch/v5 v5.9.11 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-logr/zapr v1.3.0 // indirect - github.com/go-playground/validator/v10 v10.27.0 // indirect + github.com/go-playground/validator/v10 v10.28.0 // indirect github.com/golang-jwt/jwt/v4 v4.5.2 // indirect - github.com/google/cel-go v0.26.0 // indirect + github.com/google/cel-go v0.26.1 // indirect github.com/google/gnostic-models v0.7.1 // indirect github.com/google/s2a-go v0.1.9 // indirect - github.com/googleapis/enterprise-certificate-proxy v0.3.6 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.2 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.3.11 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 // indirect github.com/jongio/azidext/go/azidext v0.5.0 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/microsoft/kiota-abstractions-go v1.9.2 // indirect @@ -489,21 +484,20 @@ require ( github.com/microsoftgraph/msgraph-sdk-go-core v1.2.1 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/openshift/cluster-control-plane-machine-set-operator v0.0.0-20251029084908-344babe6a957 - github.com/pelletier/go-toml/v2 v2.2.3 // indirect + github.com/pelletier/go-toml/v2 v2.2.4 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/quasilyte/gogrep v0.5.0 // indirect github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 // indirect - github.com/rivo/uniseg v0.4.7 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/sivchari/tenv v1.12.1 // indirect - github.com/stoewer/go-strcase v1.3.0 // indirect + github.com/stoewer/go-strcase v1.3.1 // indirect github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.1 // indirect github.com/tidwall/sjson v1.2.5 golang.org/x/exp/typeparams v0.0.0-20250210185358-939b2ce775ac // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect - k8s.io/kms v0.35.4 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260401024825-9d38bb4040a9 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260401024825-9d38bb4040a9 // indirect + k8s.io/kms v0.36.2 // indirect ) // sub modules @@ -529,16 +523,5 @@ exclude ( // CVE-2025-30204: Some transitive deps are still using older v4. Safe to remove once go.sum shows only 4.5.2 or higher. replace github.com/golang-jwt/jwt/v4 => github.com/golang-jwt/jwt/v4 v4.5.2 -// From installer: This is to force capi back for the older provider version -replace sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.19.3 - -// From installer: -// Temporary vendoring of upstream providers while they work to update to capi v1.11, which contains breaking changes -// See: https://issues.redhat.com/browse/CORS-4262 -replace ( - github.com/nutanix-cloud-native/cluster-api-provider-nutanix => github.com/nutanix-cloud-native/cluster-api-provider-nutanix v1.7.2-0.20251007022949-442bc2ebe286 - sigs.k8s.io/cluster-api-provider-azure => github.com/mboersma/cluster-api-provider-azure v0.3.1-0.20251030205607-3161b9cc8d3e -) - // Pinned for machine-api-operator compatibility replace github.com/vmware/govmomi => github.com/vmware/govmomi v0.52.0 diff --git a/go.sum b/go.sum index 6da213633e0..39b8c61e2df 100644 --- a/go.sum +++ b/go.sum @@ -4,28 +4,30 @@ 4d63.com/gochecknoglobals v0.2.2/go.mod h1:lLxwTQjL5eIesRbvnzIP3jZtG140FnTdz+AlMa+ogt0= cel.dev/expr v0.25.1 h1:1KrZg61W6TWSxuNZ37Xy49ps13NUovb66QLprthtwi4= cel.dev/expr v0.25.1/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4= -cloud.google.com/go v0.121.6 h1:waZiuajrI28iAf40cWgycWNgaXPO06dupuS+sgibK6c= -cloud.google.com/go v0.121.6/go.mod h1:coChdst4Ea5vUpiALcYKXEpR1S9ZgXbhEzzMcMR66vI= -cloud.google.com/go/auth v0.17.0 h1:74yCm7hCj2rUyyAocqnFzsAYXgJhrG26XCFimrc/Kz4= -cloud.google.com/go/auth v0.17.0/go.mod h1:6wv/t5/6rOPAX4fJiRjKkJCvswLwdet7G8+UGXt7nCQ= +cloud.google.com/go v0.123.0 h1:2NAUJwPR47q+E35uaJeYoNhuNEM9kM8SjgRgdeOJUSE= +cloud.google.com/go v0.123.0/go.mod h1:xBoMV08QcqUGuPW65Qfm1o9Y4zKZBpGS+7bImXLTAZU= +cloud.google.com/go/auth v0.18.1 h1:IwTEx92GFUo2pJ6Qea0EU3zYvKnTAeRCODxfA/G5UWs= +cloud.google.com/go/auth v0.18.1/go.mod h1:GfTYoS9G3CWpRA3Va9doKN9mjPGRS+v41jmZAhBzbrA= cloud.google.com/go/auth/oauth2adapt v0.2.8 h1:keo8NaayQZ6wimpNSmW5OPc283g65QNIiLpZnkHRbnc= cloud.google.com/go/auth/oauth2adapt v0.2.8/go.mod h1:XQ9y31RkqZCcwJWNSx2Xvric3RrU88hAYYbjDWYDL+c= cloud.google.com/go/compute/metadata v0.9.0 h1:pDUj4QMoPejqq20dK0Pg2N4yG9zIkYGdBtwLoEkH9Zs= cloud.google.com/go/compute/metadata v0.9.0/go.mod h1:E0bWwX5wTnLPedCKqk3pJmVgCBSM6qQI1yTBdEb3C10= cloud.google.com/go/iam v1.5.3 h1:+vMINPiDF2ognBJ97ABAYYwRgsaqxPbQDlMnbHMjolc= cloud.google.com/go/iam v1.5.3/go.mod h1:MR3v9oLkZCTlaqljW6Eb2d3HGDGK5/bDv93jhfISFvU= -cloud.google.com/go/kms v1.22.0 h1:dBRIj7+GDeeEvatJeTB19oYZNV0aj6wEqSIT/7gLqtk= -cloud.google.com/go/kms v1.22.0/go.mod h1:U7mf8Sva5jpOb4bxYZdtw/9zsbIjrklYwPcvMk34AL8= -cloud.google.com/go/logging v1.13.0 h1:7j0HgAp0B94o1YRDqiqm26w4q1rDMH7XNRU34lJXHYc= -cloud.google.com/go/logging v1.13.0/go.mod h1:36CoKh6KA/M0PbhPKMq6/qety2DCAErbhXT62TuXALA= -cloud.google.com/go/longrunning v0.6.7 h1:IGtfDWHhQCgCjwQjV9iiLnUta9LBCo8R9QmAFsS/PrE= -cloud.google.com/go/longrunning v0.6.7/go.mod h1:EAFV3IZAKmM56TyiE6VAP3VoTzhZzySwI/YI1s/nRsY= -cloud.google.com/go/monitoring v1.24.2 h1:5OTsoJ1dXYIiMiuL+sYscLc9BumrL3CarVLL7dd7lHM= -cloud.google.com/go/monitoring v1.24.2/go.mod h1:x7yzPWcgDRnPEv3sI+jJGBkwl5qINf+6qY4eq0I9B4U= -cloud.google.com/go/storage v1.57.0 h1:4g7NB7Ta7KetVbOMpCqy89C+Vg5VE8scqlSHUPm7Rds= -cloud.google.com/go/storage v1.57.0/go.mod h1:329cwlpzALLgJuu8beyJ/uvQznDHpa2U5lGjWednkzg= -cloud.google.com/go/trace v1.11.6 h1:2O2zjPzqPYAHrn3OKl029qlqG6W8ZdYaOWRyr8NgMT4= -cloud.google.com/go/trace v1.11.6/go.mod h1:GA855OeDEBiBMzcckLPE2kDunIpC72N+Pq8WFieFjnI= +cloud.google.com/go/kms v1.25.0 h1:gVqvGGUmz0nYCmtoxWmdc1wli2L1apgP8U4fghPGSbQ= +cloud.google.com/go/kms v1.25.0/go.mod h1:XIdHkzfj0bUO3E+LvwPg+oc7s58/Ns8Nd8Sdtljihbk= +cloud.google.com/go/logging v1.13.1 h1:O7LvmO0kGLaHY/gq8cV7T0dyp6zJhYAOtZPX4TF3QtY= +cloud.google.com/go/logging v1.13.1/go.mod h1:XAQkfkMBxQRjQek96WLPNze7vsOmay9H5PqfsNYDqvw= +cloud.google.com/go/longrunning v0.8.0 h1:LiKK77J3bx5gDLi4SMViHixjD2ohlkwBi+mKA7EhfW8= +cloud.google.com/go/longrunning v0.8.0/go.mod h1:UmErU2Onzi+fKDg2gR7dusz11Pe26aknR4kHmJJqIfk= +cloud.google.com/go/monitoring v1.24.3 h1:dde+gMNc0UhPZD1Azu6at2e79bfdztVDS5lvhOdsgaE= +cloud.google.com/go/monitoring v1.24.3/go.mod h1:nYP6W0tm3N9H/bOw8am7t62YTzZY+zUeQ+Bi6+2eonI= +cloud.google.com/go/storage v1.58.0 h1:PflFXlmFJjG/nBeR9B7pKddLQWaFaRWx4uUi/LyNxxo= +cloud.google.com/go/storage v1.58.0/go.mod h1:cMWbtM+anpC74gn6qjLh+exqYcfmB9Hqe5z6adx+CLI= +cloud.google.com/go/trace v1.11.7 h1:kDNDX8JkaAG3R2nq1lIdkb7FCSi1rCmsEtKVsty7p+U= +cloud.google.com/go/trace v1.11.7/go.mod h1:TNn9d5V3fQVf6s4SCveVMIBS2LJUqo73GACmq/Tky0s= +codeberg.org/chavacava/garif v0.2.0 h1:F0tVjhYbuOCnvNcU3YSpO6b3Waw6Bimy4K0mM8y6MfY= +codeberg.org/chavacava/garif v0.2.0/go.mod h1:P2BPbVbT4QcvLZrORc2T29szK3xEOlnl0GiPTJmEqBQ= github.com/4meepo/tagalign v1.4.2 h1:0hcLHPGMjDyM1gHG58cS73aQF8J4TdVR96TZViorO9E= github.com/4meepo/tagalign v1.4.2/go.mod h1:+p4aMyFM+ra7nb41CnFG6aSDXqRxU/w1VQqScKqDARI= github.com/Abirdcfly/dupword v0.1.3 h1:9Pa1NuAsZvpFPi9Pqkd93I7LIYRURj+A//dFd5tgBeE= @@ -40,16 +42,14 @@ github.com/Antonboom/testifylint v1.5.2 h1:4s3Xhuv5AvdIgbd8wOOEeo0uZG7PbDKQyKY5l github.com/Antonboom/testifylint v1.5.2/go.mod h1:vxy8VJ0bc6NavlYqjZfmp6EfqXMtBgQ4+mhCojwC1P8= github.com/Azure/azure-sdk-for-go v68.0.0+incompatible h1:fcYLmCpyNYRnvJbPerq7U0hS+6+I79yEDJBqVNcqUzU= github.com/Azure/azure-sdk-for-go v68.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.19.1 h1:5YTBM8QDVIBN3sxBil89WfdAAqDZbyJTgh688DSxX5w= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.19.1/go.mod h1:YD5h/ldMsG0XiIw7PdyNhLxaM317eFh5yNLccNfGdyw= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.0 h1:KpMC6LFL7mqpExyMC9jVOYRiVhLmamjeZfRsUpB7l4s= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.0/go.mod h1:J7MUC/wtRpfGVbQ5sIItY5/FuVWmvzlY21WAOfQnq/I= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.1 h1:jHb/wfvRikGdxMXYV3QG/SzUOPYN9KEUUuC0Yd0/vC0= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.1/go.mod h1:pzBXCYn05zvYIrwLgtK8Ap8QcjRg+0i76tMQdWN6wOk= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1 h1:Hk5QBxZQC1jb2Fwj6mpzme37xbCDdNTxU7O9eb5+LB4= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1/go.mod h1:IYus9qsFobWIc2YVwe/WPjcnyCkPKtnHAqUYeebc8z0= github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2 h1:yz1bePFlP5Vws5+8ez6T3HWXPmwOK7Yvq8QxDBD3SKY= github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2/go.mod h1:Pa9ZNPuoNu/GztvBSKk9J1cDJW6vk/n0zLtV4mgd8N8= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 h1:9iefClla7iYpfYWdzPCRDozdmndjTm8DXdpCzPajMgA= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2/go.mod h1:XtLgD3ZD34DAaVIIAyG3objl5DynM3CQ/vMcbBNJZGI= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.7.0 h1:LkHbJbgF3YyvC53aqYGR+wWQDn2Rdp9AQdGndf9QvY4= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.7.0/go.mod h1:QyiQdW4f4/BIfB8ZutZ2s+28RAgfa/pT+zS++ZHyM1I= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.12.0 h1:fhqpLE3UEXi9lPaBRpQ6XuRW0nU7hgg4zlmZZa+a9q4= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.12.0/go.mod h1:7dCRMLwisfRH3dBupKeNCioWYUZ4SS09Z14H+7i8ZoY= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2 h1:mLY+pNLjCUeKhgnAJWAKhEUQM+RJQo2H1fuGSw1Ky1E= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2/go.mod h1:FbdwsQ2EzwvXxOPcMFYO8ogEc9uMMIj3YkmCdXdAFmk= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0 h1:PTFGRSlMKCQelWwxUyYVEUqseBJVemLyqWJjvMyt0do= @@ -70,10 +70,8 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1. github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0/go.mod h1:5kakwfW5CjC9KK+Q4wjXAg+ShuIm2mBMua0ZFj2C8PE= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.8.1 h1:/Zt+cDPnpC3OVDm/JKLOs7M2DKmLRIIp3XIx9pHHiig= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.8.1/go.mod h1:Ng3urmn6dYe8gnbCMoHHVl5APYz2txho3koEkV2o2HA= -github.com/Azure/azure-service-operator/v2 v2.13.0 h1:24xDkuGOjSDKKkthECRo/I76slmlt3u0buYQ4rvX3pQ= -github.com/Azure/azure-service-operator/v2 v2.13.0/go.mod h1:3xfZMZm4yjdcjr3lh1kWqP2dtvZS/nCy7wpNERYDatg= -github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= -github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= +github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEKWjV8V+WSxDXJ4NFATAsZjh8iIbsQIg= +github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest/autorest v0.11.28/go.mod h1:MrkzG3Y3AH668QyF9KRk5neJnGgmhQ6krbhR8Q5eMvA= @@ -106,41 +104,41 @@ github.com/Azure/go-autorest/tracing v0.6.1 h1:YUMSrC/CeD1ZnnXcNYU4a/fzsO35u2Fsf github.com/Azure/go-autorest/tracing v0.6.1/go.mod h1:/3EgjbsjraOqiicERAeu3m7/z0x1TzjQGAwDrJrXGkc= github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1 h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM= github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1/go.mod h1:tCcJZ0uHAmvjsVYzEFivsRTN00oz5BEsRgQHu5JZ9WE= -github.com/AzureAD/microsoft-authentication-library-for-go v1.5.0 h1:XkkQbfMyuH2jTSjQjSoihryI8GINRcs4xp8lNawg0FI= -github.com/AzureAD/microsoft-authentication-library-for-go v1.5.0/go.mod h1:HKpQxkWaGLJ+D/5H8QRpyQXA1eKjxkFlOMwck5+33Jk= +github.com/AzureAD/microsoft-authentication-library-for-go v1.6.0 h1:XRzhVemXdgvJqCH0sFfrBUTnUJSBrBf7++ypk+twtRs= +github.com/AzureAD/microsoft-authentication-library-for-go v1.6.0/go.mod h1:HKpQxkWaGLJ+D/5H8QRpyQXA1eKjxkFlOMwck5+33Jk= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c h1:pxW6RcqyfI9/kWtOwnv/G+AzdKuy2ZrqINhenH4HyNs= -github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= +github.com/BurntSushi/toml v1.6.0 h1:dRaEfpa2VI55EwlIW72hMRHdWouJeRF7TPYhI+AUQjk= +github.com/BurntSushi/toml v1.6.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/Crocmagnon/fatcontext v0.7.1 h1:SC/VIbRRZQeQWj/TcQBS6JmrXcfA+BU4OGSVUt54PjM= github.com/Crocmagnon/fatcontext v0.7.1/go.mod h1:1wMvv3NXEBJucFGfwOJBxSVWcoIO6emV215SMkW9MFU= github.com/Djarvur/go-err113 v0.1.0 h1:uCRZZOdMQ0TZPHYTdYpoC0bLYJKPEHPUJ8MeAa51lNU= github.com/Djarvur/go-err113 v0.1.0/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.1 h1:Sz1JIXEcSfhz7fUi7xHnhpIE0thVASYjvosApmHuD2k= github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.1/go.mod h1:n/LSCXNuIYqVfBlVXyHfMQkZDdp1/mmxfSjADd3z1Zg= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.30.0 h1:sBEjpZlNHzK1voKq9695PJSX2o5NEXl7/OL3coiIY0c= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.30.0/go.mod h1:P4WPRUkOhJC13W//jWpyfJNDAIpvRbAUIYLX/4jtlE0= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.53.0 h1:owcC2UnmsZycprQ5RfRgjydWhuoxg71LUfyiQdijZuM= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.53.0/go.mod h1:ZPpqegjbE99EPKsu3iUWV22A04wzGPcAY/ziSIQEEgs= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.53.0 h1:4LP6hvB4I5ouTbGgWtixJhgED6xdf67twf9PoY96Tbg= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.53.0/go.mod h1:jUZ5LYlw40WMd07qxcQJD5M40aUxrfwqQX1g7zxYnrQ= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.53.0 h1:Ron4zCA/yk6U7WOBXhTJcDpsUBG9npumK6xw2auFltQ= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.53.0/go.mod h1:cSgYe11MCNYunTnRXrKiR/tHc0eoKjICUuWpNZoVCOo= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.31.0 h1:DHa2U07rk8syqvCge0QIGMCE1WxGj9njT44GH7zNJLQ= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.31.0/go.mod h1:P4WPRUkOhJC13W//jWpyfJNDAIpvRbAUIYLX/4jtlE0= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.54.0 h1:lhhYARPUu3LmHysQ/igznQphfzynnqI3D75oUyw1HXk= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.54.0/go.mod h1:l9rva3ApbBpEJxSNYnwT9N4CDLrWgtq3u8736C5hyJw= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.54.0 h1:xfK3bbi6F2RDtaZFtUdKO3osOBIhNb+xTs8lFW6yx9o= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.54.0/go.mod h1:vB2GH9GAYYJTO3mEn8oYwzEdhlayZIdQz6zdzgUIRvA= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.54.0 h1:s0WlVbf9qpvkh1c/uDAPElam0WrL7fHRIidgZJ7UqZI= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.54.0/go.mod h1:Mf6O40IAyB9zR/1J8nGDDPirZQQPbYJni8Yisy7NTMc= github.com/IBM-Cloud/bluemix-go v0.0.0-20211102075456-ffc4e11dfb16 h1:kSfKKawp3hYDcjV+d+qcadWfFsCNHDCgklOUnVMle+I= github.com/IBM-Cloud/bluemix-go v0.0.0-20211102075456-ffc4e11dfb16/go.mod h1:q0fXFSbum/16D8Mgn1ROSfSyX4BmvBCm/hHdcXz0wCU= -github.com/IBM-Cloud/power-go-client v1.12.0 h1:tF9Mq5GLYHebpzQT6IYB89lIxEST1E9teuchjxSAaw0= -github.com/IBM-Cloud/power-go-client v1.12.0/go.mod h1:SpTK1ttW8bfMNUVQS8qOEuWn2KOkzaCLyzfze8MG1JE= -github.com/IBM/go-sdk-core/v5 v5.21.0 h1:DUnYhvC4SoC8T84rx5omnhY3+xcQg/Whyoa3mDPIMkk= -github.com/IBM/go-sdk-core/v5 v5.21.0/go.mod h1:Q3BYO6iDA2zweQPDGbNTtqft5tDcEpm6RTuqMlPcvbw= -github.com/IBM/ibm-cos-sdk-go v1.12.3 h1:kMIs1nfPY0UXAMcW6bq8O9WOd6KgqiDBnIMd0e/fMqA= -github.com/IBM/ibm-cos-sdk-go v1.12.3/go.mod h1:dt13UIqJRgfGIlSNlnf17JmAXlBXhfTgXLKV3as8ABk= +github.com/IBM-Cloud/power-go-client v1.14.4 h1:XXQp4atVwvCfDps1nF5zyi2FzNbsuHtszz5nBJ9yCYg= +github.com/IBM-Cloud/power-go-client v1.14.4/go.mod h1:TT0jJbptQuDRwB9PPYDcGe0ZwFSl5GiSrNuQeJzJYco= +github.com/IBM/go-sdk-core/v5 v5.21.2 h1:mJ5QbLPOm4g5qhZiVB6wbSllfpeUExftGoyPek2hk4M= +github.com/IBM/go-sdk-core/v5 v5.21.2/go.mod h1:ngpMgwkjur1VNUjqn11LPk3o5eCyOCRbcfg/0YAY7Hc= +github.com/IBM/ibm-cos-sdk-go v1.12.4 h1:XUxGUQoqNH6Cpa/eSItbRhVRdmDIsd9jCTMeTVh1siE= +github.com/IBM/ibm-cos-sdk-go v1.12.4/go.mod h1:s4abN0Kllr83a/aI5KEjNY6fZCQK4apt2w4QjVD0PU0= github.com/IBM/keyprotect-go-client v0.12.2 h1:Cjxcqin9Pl0xz3MnxdiVd4v/eIa79xL3hQpSbwOr/DQ= github.com/IBM/keyprotect-go-client v0.12.2/go.mod h1:yr8h2noNgU8vcbs+vhqoXp3Lmv73PI0zAc6VMgFvWwM= -github.com/IBM/networking-go-sdk v0.51.11 h1:l+yMXcO9GDcb7JU9jl8riUOXjnHTvIKSLnXYFlYlKXo= -github.com/IBM/networking-go-sdk v0.51.11/go.mod h1:TAXWyBUk3C3R7aS1m84EfKdnDcBMZMAClwLfDj/SYZc= -github.com/IBM/platform-services-go-sdk v0.86.1 h1:ngBpaXvUF3gmLvbU1Z4lX1wowOSYgGoKBEBaR/urt30= -github.com/IBM/platform-services-go-sdk v0.86.1/go.mod h1:aGD045m6I8pfcB77wft8w2cHqWOJjcM3YSSV55BX0Js= -github.com/IBM/vpc-go-sdk v0.71.1 h1:SP5/uQs5JDb1QRvSJ1QC2BzE+BHEMq4jd2+JEcRuieE= -github.com/IBM/vpc-go-sdk v0.71.1/go.mod h1:K3vVlje72PYE3ZRt1iouE+jSIq+vCyYzT1HiFC06hUA= +github.com/IBM/networking-go-sdk v0.51.15 h1:JEljJvjUYeSL5F091sI3kZzD9wZYDWsnnKJIoR47XNk= +github.com/IBM/networking-go-sdk v0.51.15/go.mod h1:TAXWyBUk3C3R7aS1m84EfKdnDcBMZMAClwLfDj/SYZc= +github.com/IBM/platform-services-go-sdk v0.91.0 h1:5o4XotMmP9UfCg9BKG0cx/pTAMhBh0KzjyFQQyHZTgE= +github.com/IBM/platform-services-go-sdk v0.91.0/go.mod h1:KAnBhxKaYsu9It2aVXV6oCPEj78imvTs2qSG0ScZKpM= +github.com/IBM/vpc-go-sdk v0.76.2 h1:bZ6aHA1X69Ekn9rxd5XyjxuV9dwEneamEPYojDPHZdA= +github.com/IBM/vpc-go-sdk v0.76.2/go.mod h1:hhgE1EQZRq1Cngdh4A6+LLUaA0kKWW/rgfHpISM+AKg= github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ= github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE= github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0= @@ -177,10 +175,6 @@ github.com/apparentlymart/go-cidr v1.1.0/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/Y github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de h1:FxWPpzIjnTlhPwqqXc4/vE0f7GvRjuAsbW+HOIe8KnA= github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de/go.mod h1:DCaWoUhZrYW9p1lxo/cm8EmUOOzAPSEZNGF2DK1dJgw= github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= -github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/asaskevich/govalidator/v11 v11.0.2-0.20250122183457-e11347878e23 h1:I+Cy77zrFmVWIHOZaxiNV4L7w9xuVux9LMqAblGzvdE= -github.com/asaskevich/govalidator/v11 v11.0.2-0.20250122183457-e11347878e23/go.mod h1:S7DsXubvw3xBC8rSI+qmzcTNw7xEND0ojHPqglh/whY= github.com/ashanbrown/forbidigo v1.6.0 h1:D3aewfM37Yb3pxHujIPSpTf6oQk9sc9WZi8gerOIVIY= github.com/ashanbrown/forbidigo v1.6.0/go.mod h1:Y8j9jy9ZYAEHXdu723cUlraTqbzjKF1MUyfOKL+AjcU= github.com/ashanbrown/makezero v1.2.0 h1:/2Lp1bypdmK9wDIq7uWBlDF1iMUpIIS4A+pF6C9IEUU= @@ -196,8 +190,8 @@ github.com/aws/aws-sdk-go-v2/credentials v1.19.10 h1:EEhmEUFCE1Yhl7vDhNOI5OCL/iK github.com/aws/aws-sdk-go-v2/credentials v1.19.10/go.mod h1:RnnlFCAlxQCkN2Q379B67USkBMu1PipEEiibzYN5UTE= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.18 h1:Ii4s+Sq3yDfaMLpjrJsqD6SmG/Wq/P5L/hw2qa78UAY= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.18/go.mod h1:6x81qnY++ovptLE6nWQeWrpXxbnlIex+4H4eYYGcqfc= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.19.12 h1:ofHawDLJTI6ytDIji+g4dXQ6u2idzTb04tDlN9AS614= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.19.12/go.mod h1:f5pL4iLDfbcxj1SZcdRdIokBB5eHbuYPS/Fs9DwUPRQ= +github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.20.13 h1:s6/ARIdkx/rp5BDSlDZ2BVI9svqkiURlel6muTLo3rw= +github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.20.13/go.mod h1:1KM+TxVmodlscDCO9fTYyjmDNy5IBSKPapy17XS+Czk= github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.21 h1:Rgg6wvjjtX8bNHcvi9OnXWwcE0a2vGpbwmtICOsvcf4= github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.21/go.mod h1:A/kJFst/nm//cyqonihbdpQZwiUhhzpqTsdbhDdRF9c= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.21 h1:PEgGVtPoB6NTpPrBgqSE5hE/o47Ij9qk/SEZFbUOe9A= @@ -244,8 +238,6 @@ github.com/aws/aws-sdk-go-v2/service/sts v1.41.7 h1:NITQpgo9A5NrDZ57uOWj+abvXSb8 github.com/aws/aws-sdk-go-v2/service/sts v1.41.7/go.mod h1:sks5UWBhEuWYDPdwlnRFn1w7xWdH29Jcpe+/PJQefEs= github.com/aws/smithy-go v1.24.2 h1:FzA3bu/nt/vDvmnkg+R8Xl46gmzEDam6mZ1hzmwXFng= github.com/aws/smithy-go v1.24.2/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc= -github.com/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o= -github.com/benbjohnson/clock v1.3.5/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bkielbasa/cyclop v1.2.3 h1:faIVMIGDIANuGPWH031CZJTi2ymOQBULs9H21HSMa5w= @@ -278,22 +270,16 @@ github.com/chai2010/gettext-go v1.0.2 h1:1Lwwip6Q2QGsAdl/ZKPCwTe9fe0CjlUbqj5bFNS github.com/chai2010/gettext-go v1.0.2/go.mod h1:y+wnP2cHYaVj19NZhYKAwEMH2CI1gNHeQQ+5AjwawxA= github.com/charithe/durationcheck v0.0.10 h1:wgw73BiocdBDQPik+zcEoBG/ob8uyBHf2iyoHGPf5w4= github.com/charithe/durationcheck v0.0.10/go.mod h1:bCWXb7gYRysD1CU3C+u4ceO49LoGOY1C1L6uouGNreQ= -github.com/chavacava/garif v0.1.0 h1:2JHa3hbYf5D9dsgseMKAmc/MZ109otzgNFk5s87H9Pc= -github.com/chavacava/garif v0.1.0/go.mod h1:XMyYCkEL58DF0oyW4qDjjnPWONs2HBqYKI+UIPD+Gww= github.com/ckaznocha/intrange v0.3.0 h1:VqnxtK32pxgkhJgYQEeOArVidIPg+ahLP7WBOXZd5ZY= github.com/ckaznocha/intrange v0.3.0/go.mod h1:+I/o2d2A1FBHgGELbGxzIcyd3/9l9DuwjM8FsbSS3Lo= github.com/cncf/xds/go v0.0.0-20251210132809-ee656c7534f5 h1:6xNmx7iTtyBRev0+D/Tv1FZd4SCg8axKApyNyRsAt/w= github.com/cncf/xds/go v0.0.0-20251210132809-ee656c7534f5/go.mod h1:KdCmV+x/BuvyMxRnYBlmVaq4OLiKW6iRQfvC62cvdkI= -github.com/containers/image/v5 v5.31.0 h1:eDFVlz5XaYICxe9dXpf23htEKvyosgkl62mJlIATXE4= -github.com/containers/image/v5 v5.31.0/go.mod h1:5QfOqSackPkSbF7Qxc1DnVNnPJKQ+KWLkfEfDpK590Q= -github.com/containers/storage v1.54.0 h1:xwYAlf6n9OnIlURQLLg3FYHbO74fQ/2W2N6EtQEUM4I= -github.com/containers/storage v1.54.0/go.mod h1:PlMOoinRrBSnhYODLxt4EXl0nmJt+X0kjG0Xdt9fMTw= github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= -github.com/coreos/go-systemd/v22 v22.6.0 h1:aGVa/v8B7hpb0TKl0MWoAavPDmHvobFe5R5zn0bCJWo= -github.com/coreos/go-systemd/v22 v22.6.0/go.mod h1:iG+pp635Fo7ZmV/j14KUcmEyWF+0X7Lua8rrTWzYgWU= -github.com/coreos/ignition/v2 v2.24.0 h1:TVcsSWiYvhXihD8Mss3CTRuKaNZM2OIfpoKiudIhrKo= -github.com/coreos/ignition/v2 v2.24.0/go.mod h1:HelGgFZ1WZ4ZPOIDS0a06A2JTdbbdAine5r3AkSYz5s= +github.com/coreos/go-systemd/v22 v22.7.0 h1:LAEzFkke61DFROc7zNLX/WA2i5J8gYqe0rSj9KI28KA= +github.com/coreos/go-systemd/v22 v22.7.0/go.mod h1:xNUYtjHu2EDXbsxz1i41wouACIwT7Ybq9o0BQhMwD0w= +github.com/coreos/ignition/v2 v2.25.0 h1:4TboIy9z2ofMZmIv5ypyXCFTeKjPNwE5mQNpgkJLdMM= +github.com/coreos/ignition/v2 v2.25.0/go.mod h1:L8tzd8rDzGMKtEvJ22Rk41jW5chE50sDK5Rn/8C1JsE= github.com/coreos/stream-metadata-go v0.4.10-0.20250806142651-4a7d280a6c7b h1:CT6nMx5Ap/K6MT8zMqByrWz+RZV7O6pBGW5LhB/pwvY= github.com/coreos/stream-metadata-go v0.4.10-0.20250806142651-4a7d280a6c7b/go.mod h1:dTE8UEFgyUcrbdUg7vGT3uIP7S8a1IwUlmWLKlOp8G8= github.com/coreos/vcontext v0.0.0-20230201181013-d72178a18687 h1:uSmlDgJGbUB0bwQBcZomBTottKwEDF5fF8UjSwKSzWM= @@ -327,8 +313,8 @@ github.com/dougm/pretty v0.0.0-20160325215624-add1dbc86daf h1:A2XbJkAuMMFy/9Efto github.com/dougm/pretty v0.0.0-20160325215624-add1dbc86daf/go.mod h1:7NQ3kWOx2cZOSjtcveTa5nqupVr2s6/83sG+rTlI7uA= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= -github.com/emicklei/go-restful/v3 v3.12.2 h1:DhwDP0vY3k8ZzE0RunuJy8GhNpPL6zqLkDf9B/a0/xU= -github.com/emicklei/go-restful/v3 v3.12.2/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/emicklei/go-restful/v3 v3.13.0 h1:C4Bl2xDndpU6nJ4bc1jXd+uTmYPVUwkD6bFY/oTyCes= +github.com/emicklei/go-restful/v3 v3.13.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.14.0 h1:hbG2kr4RuFj222B6+7T83thSPqLjwBIfQawTkC++2HA= github.com/envoyproxy/go-control-plane v0.14.0/go.mod h1:NcS5X47pLl/hfqxU70yPwL9ZMkUlwlKxtAohpi2wBEU= github.com/envoyproxy/go-control-plane/envoy v1.36.0 h1:yg/JjO5E7ubRyKX3m07GF3reDNEnfOboJ0QySbH736g= @@ -347,8 +333,8 @@ github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f h1:Wl78ApPPB2 github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f/go.mod h1:OSYXu++VVOHnXeitef/D8n/6y4QV8uLHSFXX4NeXMGc= github.com/fatih/camelcase v1.0.0 h1:hxNvNX/xYBp0ovncs8WyWZrOrpBNub/JfaMvbURyft8= github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= -github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= -github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= +github.com/fatih/color v1.19.0 h1:Zp3PiM21/9Ld6FzSKyL5c/BULoe/ONr9KlbYVOfG8+w= +github.com/fatih/color v1.19.0/go.mod h1:zNk67I0ZUT1bEGsSGyCZYZNrHuTkJJB+r6Q9VuMi0LE= github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4= github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= @@ -370,8 +356,8 @@ github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sa github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ= github.com/fzipp/gocyclo v0.6.0 h1:lsblElZG7d3ALtGMx9fmxeTKZaLLpU8mET09yN4BBLo= github.com/fzipp/gocyclo v0.6.0/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA= -github.com/gabriel-vasile/mimetype v1.4.9 h1:5k+WDwEsD9eTLL8Tz3L0VnmVh9QxGjRmjBvAG7U/oYY= -github.com/gabriel-vasile/mimetype v1.4.9/go.mod h1:WnSQhFKJuBlRyLiKohA/2DtIlPFAbguNaG7QCHcyGok= +github.com/gabriel-vasile/mimetype v1.4.11 h1:AQvxbp830wPhHTqc1u7nzoLT+ZFxGY7emj5DR5DYFik= +github.com/gabriel-vasile/mimetype v1.4.11/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghostiam/protogetter v0.3.9 h1:j+zlLLWzqLay22Cz/aYwTHKQ88GE2DQ6GkWSYFOI4lQ= github.com/ghostiam/protogetter v0.3.9/go.mod h1:WZ0nw9pfzsgxuRsPOFQomgDVSWtDLJRfQJEhsGbmQMA= @@ -394,8 +380,8 @@ github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR github.com/go-openapi/analysis v0.23.0 h1:aGday7OWupfMs+LbmLZG4k0MYXIANxcuBTYUC03zFCU= github.com/go-openapi/analysis v0.23.0/go.mod h1:9mz9ZWaSlV8TvjQHLl2mUW2PbZtemkE8yA5v22ohupo= github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/errors v0.22.1 h1:kslMRRnK7NCb/CvR1q1VWuEQCEIsBGn5GgKD9e+HYhU= -github.com/go-openapi/errors v0.22.1/go.mod h1:+n/5UdIqdVnLIJ6Q9Se8HNGUXYaY6CN8ImWzfi/Gzp0= +github.com/go-openapi/errors v0.22.4 h1:oi2K9mHTOb5DPW2Zjdzs/NIvwi2N3fARKaTJLdNabaM= +github.com/go-openapi/errors v0.22.4/go.mod h1:z9S8ASTUqx7+CP1Q8dD8ewGH/1JWFFLX/2PmAYNQLgk= github.com/go-openapi/jsonpointer v0.22.3 h1:dKMwfV4fmt6Ah90zloTbUKWMD+0he+12XYAsPotrkn8= github.com/go-openapi/jsonpointer v0.22.3/go.mod h1:0lBbqeRsQ5lIanv3LHZBrmRGHLHcQoOXQnf88fHlGWo= github.com/go-openapi/jsonreference v0.21.3 h1:96Dn+MRPa0nYAR8DR1E03SblB5FJvh7W6krPI0Z7qMc= @@ -407,34 +393,34 @@ github.com/go-openapi/runtime v0.28.0/go.mod h1:QN7OzcS+XuYmkQLw05akXk0jRH/eZ3kb github.com/go-openapi/spec v0.21.0 h1:LTVzPc3p/RzRnkQqLRndbAzjY0d0BCL72A6j3CdL9ZY= github.com/go-openapi/spec v0.21.0/go.mod h1:78u6VdPw81XU44qEWGhtr982gJ5BWg2c0I5XwVMotYk= github.com/go-openapi/strfmt v0.20.0/go.mod h1:UukAYgTaQfqJuAFlNxxMWNvMYiwiXtLsF2VwmoFtbtc= -github.com/go-openapi/strfmt v0.23.0 h1:nlUS6BCqcnAk0pyhi9Y+kdDVZdZMHfEKQiS4HaMgO/c= -github.com/go-openapi/strfmt v0.23.0/go.mod h1:NrtIpfKtWIygRkKVsxh7XQMDQW5HKQl6S5ik2elW+K4= -github.com/go-openapi/swag v0.25.3 h1:FAa5wJXyDtI7yUztKDfZxDrSx+8WTg31MfCQ9s3PV+s= -github.com/go-openapi/swag v0.25.3/go.mod h1:tX9vI8Mj8Ny+uCEk39I1QADvIPI7lkndX4qCsEqhkS8= -github.com/go-openapi/swag/cmdutils v0.25.3 h1:EIwGxN143JCThNHnqfqs85R8lJcJG06qjJRZp3VvjLI= -github.com/go-openapi/swag/cmdutils v0.25.3/go.mod h1:pdae/AFo6WxLl5L0rq87eRzVPm/XRHM3MoYgRMvG4A0= -github.com/go-openapi/swag/conv v0.25.3 h1:PcB18wwfba7MN5BVlBIV+VxvUUeC2kEuCEyJ2/t2X7E= -github.com/go-openapi/swag/conv v0.25.3/go.mod h1:n4Ibfwhn8NJnPXNRhBO5Cqb9ez7alBR40JS4rbASUPU= -github.com/go-openapi/swag/fileutils v0.25.3 h1:P52Uhd7GShkeU/a1cBOuqIcHMHBrA54Z2t5fLlE85SQ= -github.com/go-openapi/swag/fileutils v0.25.3/go.mod h1:cdOT/PKbwcysVQ9Tpr0q20lQKH7MGhOEb6EwmHOirUk= -github.com/go-openapi/swag/jsonname v0.25.3 h1:U20VKDS74HiPaLV7UZkztpyVOw3JNVsit+w+gTXRj0A= -github.com/go-openapi/swag/jsonname v0.25.3/go.mod h1:GPVEk9CWVhNvWhZgrnvRA6utbAltopbKwDu8mXNUMag= -github.com/go-openapi/swag/jsonutils v0.25.3 h1:kV7wer79KXUM4Ea4tBdAVTU842Rg6tWstX3QbM4fGdw= -github.com/go-openapi/swag/jsonutils v0.25.3/go.mod h1:ILcKqe4HC1VEZmJx51cVuZQ6MF8QvdfXsQfiaCs0z9o= -github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.3 h1:/i3E9hBujtXfHy91rjtwJ7Fgv5TuDHgnSrYjhFxwxOw= -github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.3/go.mod h1:8kYfCR2rHyOj25HVvxL5Nm8wkfzggddgjZm6RgjT8Ao= -github.com/go-openapi/swag/loading v0.25.3 h1:Nn65Zlzf4854MY6Ft0JdNrtnHh2bdcS/tXckpSnOb2Y= -github.com/go-openapi/swag/loading v0.25.3/go.mod h1:xajJ5P4Ang+cwM5gKFrHBgkEDWfLcsAKepIuzTmOb/c= -github.com/go-openapi/swag/mangling v0.25.3 h1:rGIrEzXaYWuUW1MkFmG3pcH+EIA0/CoUkQnIyB6TUyo= -github.com/go-openapi/swag/mangling v0.25.3/go.mod h1:6dxwu6QyORHpIIApsdZgb6wBk/DPU15MdyYj/ikn0Hg= -github.com/go-openapi/swag/netutils v0.25.3 h1:XWXHZfL/65ABiv8rvGp9dtE0C6QHTYkCrNV77jTl358= -github.com/go-openapi/swag/netutils v0.25.3/go.mod h1:m2W8dtdaoX7oj9rEttLyTeEFFEBvnAx9qHd5nJEBzYg= -github.com/go-openapi/swag/stringutils v0.25.3 h1:nAmWq1fUTWl/XiaEPwALjp/8BPZJun70iDHRNq/sH6w= -github.com/go-openapi/swag/stringutils v0.25.3/go.mod h1:GTsRvhJW5xM5gkgiFe0fV3PUlFm0dr8vki6/VSRaZK0= -github.com/go-openapi/swag/typeutils v0.25.3 h1:2w4mEEo7DQt3V4veWMZw0yTPQibiL3ri2fdDV4t2TQc= -github.com/go-openapi/swag/typeutils v0.25.3/go.mod h1:Ou7g//Wx8tTLS9vG0UmzfCsjZjKhpjxayRKTHXf2pTE= -github.com/go-openapi/swag/yamlutils v0.25.3 h1:LKTJjCn/W1ZfMec0XDL4Vxh8kyAnv1orH5F2OREDUrg= -github.com/go-openapi/swag/yamlutils v0.25.3/go.mod h1:Y7QN6Wc5DOBXK14/xeo1cQlq0EA0wvLoSv13gDQoCao= +github.com/go-openapi/strfmt v0.25.0 h1:7R0RX7mbKLa9EYCTHRcCuIPcaqlyQiWNPTXwClK0saQ= +github.com/go-openapi/strfmt v0.25.0/go.mod h1:nNXct7OzbwrMY9+5tLX4I21pzcmE6ccMGXl3jFdPfn8= +github.com/go-openapi/swag v0.25.4 h1:OyUPUFYDPDBMkqyxOTkqDYFnrhuhi9NR6QVUvIochMU= +github.com/go-openapi/swag v0.25.4/go.mod h1:zNfJ9WZABGHCFg2RnY0S4IOkAcVTzJ6z2Bi+Q4i6qFQ= +github.com/go-openapi/swag/cmdutils v0.25.4 h1:8rYhB5n6WawR192/BfUu2iVlxqVR9aRgGJP6WaBoW+4= +github.com/go-openapi/swag/cmdutils v0.25.4/go.mod h1:pdae/AFo6WxLl5L0rq87eRzVPm/XRHM3MoYgRMvG4A0= +github.com/go-openapi/swag/conv v0.25.4 h1:/Dd7p0LZXczgUcC/Ikm1+YqVzkEeCc9LnOWjfkpkfe4= +github.com/go-openapi/swag/conv v0.25.4/go.mod h1:3LXfie/lwoAv0NHoEuY1hjoFAYkvlqI/Bn5EQDD3PPU= +github.com/go-openapi/swag/fileutils v0.25.4 h1:2oI0XNW5y6UWZTC7vAxC8hmsK/tOkWXHJQH4lKjqw+Y= +github.com/go-openapi/swag/fileutils v0.25.4/go.mod h1:cdOT/PKbwcysVQ9Tpr0q20lQKH7MGhOEb6EwmHOirUk= +github.com/go-openapi/swag/jsonname v0.25.4 h1:bZH0+MsS03MbnwBXYhuTttMOqk+5KcQ9869Vye1bNHI= +github.com/go-openapi/swag/jsonname v0.25.4/go.mod h1:GPVEk9CWVhNvWhZgrnvRA6utbAltopbKwDu8mXNUMag= +github.com/go-openapi/swag/jsonutils v0.25.4 h1:VSchfbGhD4UTf4vCdR2F4TLBdLwHyUDTd1/q4i+jGZA= +github.com/go-openapi/swag/jsonutils v0.25.4/go.mod h1:7OYGXpvVFPn4PpaSdPHJBtF0iGnbEaTk8AvBkoWnaAY= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.4 h1:IACsSvBhiNJwlDix7wq39SS2Fh7lUOCJRmx/4SN4sVo= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.4/go.mod h1:Mt0Ost9l3cUzVv4OEZG+WSeoHwjWLnarzMePNDAOBiM= +github.com/go-openapi/swag/loading v0.25.4 h1:jN4MvLj0X6yhCDduRsxDDw1aHe+ZWoLjW+9ZQWIKn2s= +github.com/go-openapi/swag/loading v0.25.4/go.mod h1:rpUM1ZiyEP9+mNLIQUdMiD7dCETXvkkC30z53i+ftTE= +github.com/go-openapi/swag/mangling v0.25.4 h1:2b9kBJk9JvPgxr36V23FxJLdwBrpijI26Bx5JH4Hp48= +github.com/go-openapi/swag/mangling v0.25.4/go.mod h1:6dxwu6QyORHpIIApsdZgb6wBk/DPU15MdyYj/ikn0Hg= +github.com/go-openapi/swag/netutils v0.25.4 h1:Gqe6K71bGRb3ZQLusdI8p/y1KLgV4M/k+/HzVSqT8H0= +github.com/go-openapi/swag/netutils v0.25.4/go.mod h1:m2W8dtdaoX7oj9rEttLyTeEFFEBvnAx9qHd5nJEBzYg= +github.com/go-openapi/swag/stringutils v0.25.4 h1:O6dU1Rd8bej4HPA3/CLPciNBBDwZj9HiEpdVsb8B5A8= +github.com/go-openapi/swag/stringutils v0.25.4/go.mod h1:GTsRvhJW5xM5gkgiFe0fV3PUlFm0dr8vki6/VSRaZK0= +github.com/go-openapi/swag/typeutils v0.25.4 h1:1/fbZOUN472NTc39zpa+YGHn3jzHWhv42wAJSN91wRw= +github.com/go-openapi/swag/typeutils v0.25.4/go.mod h1:Ou7g//Wx8tTLS9vG0UmzfCsjZjKhpjxayRKTHXf2pTE= +github.com/go-openapi/swag/yamlutils v0.25.4 h1:6jdaeSItEUb7ioS9lFoCZ65Cne1/RZtPBZ9A56h92Sw= +github.com/go-openapi/swag/yamlutils v0.25.4/go.mod h1:MNzq1ulQu+yd8Kl7wPOut/YHAAU/H6hL91fF+E2RFwc= github.com/go-openapi/testify/enable/yaml/v2 v2.0.2 h1:0+Y41Pz1NkbTHz8NngxTuAXxEodtNSI1WG1c/m5Akw4= github.com/go-openapi/testify/enable/yaml/v2 v2.0.2/go.mod h1:kme83333GCtJQHXQ8UKX3IBZu6z8T5Dvy5+CW3NLUUg= github.com/go-openapi/testify/v2 v2.0.2 h1:X999g3jeLcoY8qctY/c/Z8iBHTbwLz7R2WXd6Ub6wls= @@ -447,8 +433,8 @@ github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/o github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.27.0 h1:w8+XrWVMhGkxOaaowyKH35gFydVHOvC0/uWoy2Fzwn4= -github.com/go-playground/validator/v10 v10.27.0/go.mod h1:I5QpIEbmr8On7W0TktmJAumgzX4CA1XNl4ZmDuVHKKo= +github.com/go-playground/validator/v10 v10.28.0 h1:Q7ibns33JjyW48gHkuFT91qX48KG0ktULL6FgHdG688= +github.com/go-playground/validator/v10 v10.28.0/go.mod h1:GoI6I1SjPBh9p7ykNE/yj3fFYbyDOpwMn5KXd+m2hUU= github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI= github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= @@ -520,8 +506,6 @@ github.com/golang-jwt/jwt/v4 v4.5.2 h1:YtQM7lnr8iZ+j5q71MGKkNw9Mn7AjHM68uc9g5fXe github.com/golang-jwt/jwt/v4 v4.5.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo= github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE= -github.com/golang/mock v1.7.0-rc.1 h1:YojYx61/OLFsiv6Rw1Z96LpldJIy31o+UHmwAUMJ6/U= -github.com/golang/mock v1.7.0-rc.1/go.mod h1:s42URUywIqd+OcERslBJvOjepvNymP31m3q8d/GkuRs= github.com/golang/protobuf v1.2.0/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= @@ -552,8 +536,8 @@ github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed h1:IURFTjxeTfNF github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed/go.mod h1:XLXN8bNw4CGRPaqgl3bv/lhz7bsGPh4/xSaMTbo2vkQ= github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= -github.com/google/cel-go v0.26.0 h1:DPGjXackMpJWH680oGY4lZhYjIameYmR+/6RBdDGmaI= -github.com/google/cel-go v0.26.0/go.mod h1:A9O8OU9rdvrK5MQyrqfIxo1a0u4g3sF8KB6PUIaryMM= +github.com/google/cel-go v0.26.1 h1:iPbVVEdkhTX++hpe3lzSk7D3G3QSYqLGoHOcEio+UXQ= +github.com/google/cel-go v0.26.1/go.mod h1:A9O8OU9rdvrK5MQyrqfIxo1a0u4g3sF8KB6PUIaryMM= github.com/google/gnostic-models v0.7.1 h1:SisTfuFKJSKM5CPZkffwi6coztzzeYUhc3v4yxLWH8c= github.com/google/gnostic-models v0.7.1/go.mod h1:whL5G0m6dmc5cPxKc5bdKdEN3UjI7OUGxBlw57miDrQ= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -572,20 +556,20 @@ github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian/v3 v3.3.3 h1:DIhPTQrbPkgs2yJYdXU/eNACCG5DVQjySNRNlflZ9Fc= github.com/google/martian/v3 v3.3.3/go.mod h1:iEPrYcgCF7jA9OtScMFQyAlZZ4YXTKEtJ1E6RWzmBA0= -github.com/google/pprof v0.0.0-20250630185457-6e76a2b096b5 h1:xhMrHhTJ6zxu3gA4enFM9MLn9AY7613teCdFnlUVbSQ= -github.com/google/pprof v0.0.0-20250630185457-6e76a2b096b5/go.mod h1:5hDyRhoBCxViHszMt12TnOpEI4VVi+U8Gm9iphldiMA= +github.com/google/pprof v0.0.0-20260402051712-545e8a4df936 h1:EwtI+Al+DeppwYX2oXJCETMO23COyaKGP6fHVpkpWpg= +github.com/google/pprof v0.0.0-20260402051712-545e8a4df936/go.mod h1:MxpfABSjhmINe3F1It9d+8exIHFvUqtLIRCdOGNXqiI= github.com/google/s2a-go v0.1.9 h1:LGD7gtMgezd8a/Xak7mEWL0PjoTQFvpRudN895yqKW0= github.com/google/s2a-go v0.1.9/go.mod h1:YA0Ei2ZQL3acow2O62kdp9UlnvMmU7kA6Eutn0dXayM= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 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/googleapis/enterprise-certificate-proxy v0.3.6 h1:GW/XbdyBFQ8Qe+YAmFU9uHLo7OnF5tL52HFAgMmyrf4= -github.com/googleapis/enterprise-certificate-proxy v0.3.6/go.mod h1:MkHOF77EYAE7qfSuSS9PU6g4Nt4e11cnsDUowfwewLA= -github.com/googleapis/gax-go/v2 v2.15.0 h1:SyjDc1mGgZU5LncH8gimWo9lW1DtIfPibOG81vgd/bo= -github.com/googleapis/gax-go/v2 v2.15.0/go.mod h1:zVVkkxAQHa1RQpg9z2AUCMnKhi0Qld9rcmyfL1OZhoc= -github.com/gophercloud/gophercloud/v2 v2.8.0 h1:of2+8tT6+FbEYHfYC8GBu8TXJNsXYSNm9KuvpX7Neqo= -github.com/gophercloud/gophercloud/v2 v2.8.0/go.mod h1:Ki/ILhYZr/5EPebrPL9Ej+tUg4lqx71/YH2JWVeU+Qk= +github.com/googleapis/enterprise-certificate-proxy v0.3.11 h1:vAe81Msw+8tKUxi2Dqh/NZMz7475yUvmRIkXr4oN2ao= +github.com/googleapis/enterprise-certificate-proxy v0.3.11/go.mod h1:RFV7MUdlb7AgEq2v7FmMCfeSMCllAzWxFgRdusoGks8= +github.com/googleapis/gax-go/v2 v2.17.0 h1:RksgfBpxqff0EZkDWYuz9q/uWsTVz+kf43LsZ1J6SMc= +github.com/googleapis/gax-go/v2 v2.17.0/go.mod h1:mzaqghpQp4JDh3HvADwrat+6M3MOIDp5YKHhb9PAgDY= +github.com/gophercloud/gophercloud/v2 v2.10.0 h1:NRadC0aHNvy4iMoFXj5AFiPmut/Sj3hAPAo9B59VMGc= +github.com/gophercloud/gophercloud/v2 v2.10.0/go.mod h1:Ki/ILhYZr/5EPebrPL9Ej+tUg4lqx71/YH2JWVeU+Qk= github.com/gophercloud/utils/v2 v2.0.0-20250212084022-725b94822eeb h1:TQTXVYXL3d0zRAybRUKKboO0z/XAsXEfU6Oax8n00kc= github.com/gophercloud/utils/v2 v2.0.0-20250212084022-725b94822eeb/go.mod h1:tIUw/gFHOB6lFV9LhzNZg5jfCLYMxI2lC1dZUa7NlHM= github.com/gordonklaus/ineffassign v0.1.0 h1:y2Gd/9I7MdY1oEIt+n+rowjBNDcLQq3RsH5hwJd0f9s= @@ -605,16 +589,12 @@ github.com/gostaticanalysis/nilerr v0.1.1/go.mod h1:wZYb6YI5YAxxq0i1+VJbY0s2YONW github.com/gostaticanalysis/testutil v0.3.1-0.20210208050101-bfb5c8eec0e4/go.mod h1:D+FIZ+7OahH3ePw/izIEeH5I06eKs1IKI4Xr64/Am3M= github.com/gostaticanalysis/testutil v0.5.0 h1:Dq4wT1DdTwTGCQQv3rl3IvD5Ld0E6HiY+3Zh0sUGqw8= github.com/gostaticanalysis/testutil v0.5.0/go.mod h1:OLQSbuM6zw2EvCcXTz1lVq5unyoNft372msDY0nY5Hs= -github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 h1:+ngKgrYPPJrOjhax5N+uePQ0Fh1Z7PheYoUI/0nzkPA= -github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1 h1:qnpSQwGEnkcRpTqNOIR6bJbR0gAorgP9CSALpRcKoAA= -github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1/go.mod h1:lXGCsh6c22WGtjr+qGHj1otzZpV/1kwTMAqkwZsnWRU= -github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.0 h1:FbSCl+KggFl+Ocym490i/EyXF4lPgLoUtcSWquBM0Rs= -github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.0/go.mod h1:qOchhhIlmRcqk/O9uCo/puJlyo07YINaIqdZfZG3Jkc= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.2 h1:8Tjv8EJ+pM1xP8mK6egEbD1OgnVTyacbefKhmbLhIhU= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.2/go.mod h1:pkJQ2tZHJ0aFOVEEot6oZmaVEZcRme73eIFmhiVuRWs= +github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.1.0 h1:QGLs/O40yoNK9vmy4rhUGBVyMf1lISBGtXRpsu/Qu/o= +github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.1.0/go.mod h1:hM2alZsMUni80N33RBe6J0e423LB+odMj7d3EMP9l20= +github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.3 h1:B+8ClL/kCQkRiU82d9xajRPKYMrB7E0MbtzWVi1K4ns= +github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.3/go.mod h1:NbCUVmiS4foBGBHOYlCT25+YmGpJ32dZPi75pGEUpj4= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 h1:HWRh5R2+9EifMyIHV7ZV+MIZqgz+PMpZ14Jynv3O2Zs= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0/go.mod h1:JfhWUomR1baixubs02l85lZYYOm7LV6om4ceouMv45c= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= @@ -631,8 +611,8 @@ github.com/hashicorp/go-retryablehttp v0.7.8/go.mod h1:rjiScheydd+CxvumBsIrFKlx3 github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= -github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.9.0 h1:CeOIz6k+LoN3qX9Z0tyQrPtiB1DFYRPfCIBtaXPSCnA= +github.com/hashicorp/go-version v1.9.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= 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/heptio/velero v1.0.0 h1:5xFd2mieexakJiaxo5SgIAGXfgj+o+9QTIDm0vWpWVs= @@ -650,8 +630,6 @@ github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2 github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jarcoal/httpmock v1.3.1 h1:iUx3whfZWVf3jT01hQTO/Eo5sAYtB2/rqaUuOtpInww= github.com/jarcoal/httpmock v1.3.1/go.mod h1:3yb8rc4BI7TCBhFY8ng0gjuLKJNquuDNiPaZjnENuYg= -github.com/jellydator/ttlcache/v3 v3.3.0 h1:BdoC9cE81qXfrxeb9eoJi9dWrdhSuwXMAnHTbnBm4Wc= -github.com/jellydator/ttlcache/v3 v3.3.0/go.mod h1:bj2/e0l4jRnQdrnSTaGTsh4GSXvMjQcy41i7th0GVGw= github.com/jgautheron/goconst v1.7.1 h1:VpdAG7Ca7yvvJk5n8dMwQhfEZJh95kl/Hl9S1OI5Jkk= github.com/jgautheron/goconst v1.7.1/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4= github.com/jhump/protoreflect v1.14.0 h1:MBbQK392K3u8NTLbKOCIi3XdI+y+c6yt5oMq0X3xviw= @@ -751,13 +729,8 @@ github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stg github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= 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.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= -github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/mboersma/cluster-api-provider-azure v0.3.1-0.20251030205607-3161b9cc8d3e h1:vjfMVJwnYtZ69rk8j5U4750dWxsSPy0TtyYAw8m8pm0= -github.com/mboersma/cluster-api-provider-azure v0.3.1-0.20251030205607-3161b9cc8d3e/go.mod h1:lowBy4P1sFNQf1d7Fs8JRuuyg5ZC0j3LvUyzoEpLnbE= -github.com/mgechev/revive v1.7.0 h1:JyeQ4yO5K8aZhIKf5rec56u0376h8AlKNQEmjfkjKlY= -github.com/mgechev/revive v1.7.0/go.mod h1:qZnwcNhoguE58dfi96IJeSTPeZQejNeoMQLUZGi4SW4= +github.com/mgechev/revive v1.15.0 h1:vJ0HzSBzfNyPbHKolgiFjHxLek9KUijhqh42yGoqZ8Q= +github.com/mgechev/revive v1.15.0/go.mod h1:LlAKO3QQe9OJ0pVZzI2GPa8CbXGZ/9lNpCGvK4T/a8A= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI= github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= @@ -784,10 +757,8 @@ github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrk github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= -github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= -github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= +github.com/moby/term v0.5.2 h1:6qk3FJAFDs6i/q3W/pQ97SX192qKfZgGjCQqfCJkgzQ= +github.com/moby/term v0.5.2/go.mod h1:d3djjFCrjnB+fl8NJux+EJzu0msscUP+f8it8hPkFLc= 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= @@ -811,42 +782,40 @@ github.com/nishanths/predeclared v0.2.2 h1:V2EPdZPliZymNAn79T8RkNApBjMmVKh5XRpLm github.com/nishanths/predeclared v0.2.2/go.mod h1:RROzoN6TnGQupbC+lqggsOlcgysk3LMK/HI84Mp280c= github.com/nunnatsa/ginkgolinter v0.19.1 h1:mjwbOlDQxZi9Cal+KfbEJTCz327OLNfwNvoZ70NJ+c4= github.com/nunnatsa/ginkgolinter v0.19.1/go.mod h1:jkQ3naZDmxaZMXPWaS9rblH+i+GWXQCaS/JFIWcOH2s= -github.com/nutanix-cloud-native/cluster-api-provider-nutanix v1.7.2-0.20251007022949-442bc2ebe286 h1:gJ97hSUWCPL4wCTBRObtYKC5laktxdiqDNwpblkBVyI= -github.com/nutanix-cloud-native/cluster-api-provider-nutanix v1.7.2-0.20251007022949-442bc2ebe286/go.mod h1:dk4aixfBLxH9L4JHxxrKct6SGWj+tYTKrQT2V6pOf98= -github.com/nutanix-cloud-native/prism-go-client v0.5.0 h1:aSNuKDOK7+q676MQyetYXcySY41IjSvN2UmrDIU3+6s= -github.com/nutanix-cloud-native/prism-go-client v0.5.0/go.mod h1:QhLX+sEep0cStzHVYU6mPgIlnA8U3DySskagrbDprRk= +github.com/nutanix-cloud-native/cluster-api-provider-nutanix v1.10.3 h1:OnuhVbc1euRIoOhywpvEWHGvw2m9OV9mjaZzqzPLUCQ= +github.com/nutanix-cloud-native/cluster-api-provider-nutanix v1.10.3/go.mod h1:1yxoeIPBB4YPwXR18UGLV/xZ0jj8PkJxTyEbivRCArw= +github.com/nutanix-cloud-native/prism-go-client v0.8.0 h1:CYOxciuvis1xq++eQcyMZrDxVO/LQgPpyvUKzMxEO9A= +github.com/nutanix-cloud-native/prism-go-client v0.8.0/go.mod h1:S5nV4cEuQSGOAv+C+svUuuwAOYX3U/Q/lVwtAIy7tGw= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY= github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc= github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -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 v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.27.2 h1:LzwLj0b89qtIy6SSASkzlNvX6WktqurSHwkk2ipF/Ns= -github.com/onsi/ginkgo/v2 v2.27.2/go.mod h1:ArE1D/XhNXBXCBkKOLkbsb2c81dQHCRcF5zwn/ykDRo= +github.com/onsi/ginkgo/v2 v2.28.3 h1:4JvMdwtFU0imd8fHx25OJXoDMRexnf8v5NHKYSTTji4= +github.com/onsi/ginkgo/v2 v2.28.3/go.mod h1:+aXOY+vzZ5mu2iI2HpTZUPmM//oQfsNFX6gU9kNcA44= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= -github.com/onsi/gomega v1.38.2 h1:eZCjf2xjZAqe+LeWvKb5weQ+NcPwX84kqJ0cZNxok2A= -github.com/onsi/gomega v1.38.2/go.mod h1:W2MJcYxRGV63b418Ai34Ud0hEdTVXq9NW9+Sx6uXf3k= +github.com/onsi/gomega v1.42.0 h1:CJby8u36xb7v34W78F8WKvqTQP7PCMIPB78IVDB73l4= +github.com/onsi/gomega v1.42.0/go.mod h1:M/Uqpu/8qTjtzCLUA2zJHX9Iilrau25x1PdoSRbWh5A= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/openshift/api v0.0.0-20260318185450-1f2fa3f09f4e h1:n2fW82JRX5B/+eCULWIe06MAhJVaE8fUsvy0A0Gn9n4= -github.com/openshift/api v0.0.0-20260318185450-1f2fa3f09f4e/go.mod h1:pyVjK0nZ4sRs4fuQVQ4rubsJdahI1PB94LnQ8sGdvxo= +github.com/openshift/api v0.0.0-20260728120005-8ba0b25b0f29 h1:WrS2vkQtwJyo5xHJnJfjmHPDasdyKLKwojhMDV3tPto= +github.com/openshift/api v0.0.0-20260728120005-8ba0b25b0f29/go.mod h1:k6qH5QOVa5GDln2VVm8Jz4NV3Z7R2SATHFLwGS6Wh3M= github.com/openshift/baremetal-operator/apis v0.0.0-20231128154154-6736c9b9c6c8 h1:f5nZJ4mB9Rf1epInmKoqDJGdoHyqZwHCiaE/OH4Yx84= github.com/openshift/baremetal-operator/apis v0.0.0-20231128154154-6736c9b9c6c8/go.mod h1:CvKrrnAcvvtrZIc9y9WaqWmJhK0AJ9sWnh+VP4d7jcM= github.com/openshift/baremetal-operator/pkg/hardwareutils v0.0.0-20231128154154-6736c9b9c6c8 h1:38vY9w7dXqB7tI9g1GCUnpahNDyBbp9Yylq+BQ154YE= github.com/openshift/baremetal-operator/pkg/hardwareutils v0.0.0-20231128154154-6736c9b9c6c8/go.mod h1:399nvdaqoU9rTI25UdFw2EWcVjmJPpeZPIhfDAIx/XU= github.com/openshift/build-machinery-go v0.0.0-20250602125535-1b6d00b8c37c h1:gJvhduWIrpzoUTwrJjjeul+hGETKkhRhEZosBg/X3Hg= github.com/openshift/build-machinery-go v0.0.0-20250602125535-1b6d00b8c37c/go.mod h1:8jcm8UPtg2mCAsxfqKil1xrmRMI3a+XU2TZ9fF8A7TE= -github.com/openshift/client-go v0.0.0-20260317180604-743f664b82d1 h1:Hr/R38eg5ZJXfbiaHumjJIN1buDZwhsm4ys4npVCXH0= -github.com/openshift/client-go v0.0.0-20260317180604-743f664b82d1/go.mod h1:Za51LlH76ALiQ/aKGBYJXmyJNkA//IDJ+I///30CA2M= +github.com/openshift/client-go v0.0.0-20260728123811-92b24dd0dd1f h1:dP7eA8s2WZWQNom5DDG7zHvl3FkcBVhtWUVXznr0Ezw= +github.com/openshift/client-go v0.0.0-20260728123811-92b24dd0dd1f/go.mod h1:pqFNk7AzeRdbhI1Ox7fFPhUTxcaeIXVLYjraSiig/ZM= github.com/openshift/cloud-credential-operator v0.0.0-20250925191450-a3e50aeacc55 h1:l4vr7i3v6Z+Ho2X6Msr7dUK1HqyGjwqNvsZ8qITyzxc= github.com/openshift/cloud-credential-operator v0.0.0-20250925191450-a3e50aeacc55/go.mod h1:vRzx2kLy4/GPEwJb/PDUyS3C1/eLkhQD5Hezp+wQQCw= github.com/openshift/cloud-provider-vsphere v1.19.1-0.20240626105621-6464d0bb4928 h1:gX0HAKR0f40xmMWlUSn8DBMCjip8Iuzg5XToWAv6Uzw= @@ -859,10 +828,10 @@ github.com/openshift/cluster-control-plane-machine-set-operator v0.0.0-202510290 github.com/openshift/cluster-control-plane-machine-set-operator v0.0.0-20251029084908-344babe6a957/go.mod h1:TBlORAAtNZ/Tl86pO7GjNXKsH/g0QAW5GnvYstdOhYI= github.com/openshift/generic-admission-server v1.14.1-0.20260305203524-5df3cca1e3cd h1:vmJQouRzbrWIh/klml4SHYpB7U4FEDu6eKt9oqhIVBQ= github.com/openshift/generic-admission-server v1.14.1-0.20260305203524-5df3cca1e3cd/go.mod h1:DMfTM7LGbW1IF+h1K3stXiomJmu4l5dTKgrfItEIWrU= -github.com/openshift/installer v1.4.22-ec5 h1:NG9X2iZG5mbUVZIBhpMtMrGNK7Tbm9dDGAI6aXh/QZc= -github.com/openshift/installer v1.4.22-ec5/go.mod h1:PbGvWlLRbmmSsaTQBAjhXPzliz9XJAYUdXcY0t/3UiY= -github.com/openshift/library-go v0.0.0-20251107090138-0de9712313a5 h1:Gq8jCFgSrilZ2ZHjQleFZWlblikc1aaRZ0hqs+yvrP4= -github.com/openshift/library-go v0.0.0-20251107090138-0de9712313a5/go.mod h1:OlFFws1AO51uzfc48MsStGE4SFMWlMZD0+f5a/zCtKI= +github.com/openshift/installer v1.5.0-alpha.1 h1:Vd+ZAiD6cV5h8fBTPvYnbq42KwScdzhHVF3RFhzHu0w= +github.com/openshift/installer v1.5.0-alpha.1/go.mod h1:K6syzgcjEQO7QymXOD/CnJTqNNrJVoBX3I1YecYmfck= +github.com/openshift/library-go v0.0.0-20260728221828-f675e9a73816 h1:9wH/CYW5WyblUkRi0/4W3WSeNWbkIQUX+jXax0k4BSc= +github.com/openshift/library-go v0.0.0-20260728221828-f675e9a73816/go.mod h1:iahMN6YoNSRG1xyRj03YYU5iboJzv+UZFu9S0grJmQc= github.com/openshift/machine-api-operator v0.2.1-0.20251128002018-85c00c0d525f h1:nExol3fBEA615EeN7bZ6wvd4EaANOAIgj9aXfdyIja4= github.com/openshift/machine-api-operator v0.2.1-0.20251128002018-85c00c0d525f/go.mod h1:l+ZQYLZhs8U4JS3FCLKUW6/ke0bwajst+howtbJiumo= github.com/openshift/machine-api-provider-gcp v0.0.1-0.20260113091719-80740861bb2a h1:O5GKvDmDrWv0MQVF6fW5NMAjK60PYTG9JGDww/YyGhQ= @@ -881,8 +850,8 @@ github.com/otiai10/mint v1.3.1/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH github.com/ovirt/go-ovirt v0.0.0-20210809163552-d4276e35d3db h1:ahvAlEurj4TF1SExDJHNeqknQC8lAwnZEPLyZJuRyd0= github.com/ovirt/go-ovirt v0.0.0-20210809163552-d4276e35d3db/go.mod h1:Zkdj9/rW6eyuw0uOeEns6O3pP5G2ak+bI/tgkQ/tEZI= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= -github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= -github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= +github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= +github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= @@ -906,10 +875,10 @@ github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg= github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk= github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE= -github.com/prometheus/common v0.67.4 h1:yR3NqWO1/UyO1w2PhUvXlGQs/PtFmoveVO0KZ4+Lvsc= -github.com/prometheus/common v0.67.4/go.mod h1:gP0fq6YjjNCLssJCQp0yk4M8W6ikLURwkdd/YKtTbyI= -github.com/prometheus/procfs v0.19.2 h1:zUMhqEW66Ex7OXIiDkll3tl9a1ZdilUOd/F6ZXw4Vws= -github.com/prometheus/procfs v0.19.2/go.mod h1:M0aotyiemPhBCM0z5w87kL22CxfcH05ZpYlu+b4J7mw= +github.com/prometheus/common v0.67.5 h1:pIgK94WWlQt1WLwAC5j2ynLaBRDiinoAb86HZHTUGI4= +github.com/prometheus/common v0.67.5/go.mod h1:SjE/0MzDEEAyrdr5Gqc6G+sXI67maCxzaT3A2+HqjUw= +github.com/prometheus/procfs v0.20.1 h1:XwbrGOIplXW/AU3YhIhLODXMJYyC1isLFfYCsTEycfc= +github.com/prometheus/procfs v0.20.1/go.mod h1:o9EMBZGRyvDrSPH1RqdxhojkuXstoe4UlK79eF5TGGo= github.com/quasilyte/go-ruleguard v0.4.3-0.20240823090925-0fe6f58b47b1 h1:+Wl/0aFp0hpuHM3H//KMft64WQ1yX9LdJY64Qm/gFCo= github.com/quasilyte/go-ruleguard v0.4.3-0.20240823090925-0fe6f58b47b1/go.mod h1:GJLgqsLeo4qgavUoL8JeGFNS7qcisx3awV/w9eWTmNI= github.com/quasilyte/go-ruleguard/dsl v0.3.22 h1:wd8zkOhSNr+I+8Qeciml08ivDt1pSXe60+5DqOpCjPE= @@ -922,9 +891,6 @@ github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 h1:M8mH9eK4OUR4l github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567/go.mod h1:DWNGW8A4Y+GyBgPuaQJuWiy0XYftx4Xm/y5Jqk9I6VQ= github.com/raeperd/recvcheck v0.2.0 h1:GnU+NsbiCqdC2XX5+vMZzP+jAJC5fht7rcVTAhX74UI= github.com/raeperd/recvcheck v0.2.0/go.mod h1:n04eYkwIR0JbgD73wT8wL4JjPC3wm0nFtzBnWNocnYU= -github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= -github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/robfig/cron v1.2.0 h1:ZjScXvvxeQ63Dbyxy76Fj3AT3Ut0aKsyd2/tl3DTMuQ= github.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k= github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -932,30 +898,26 @@ github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= -github.com/rotisserie/eris v0.5.4 h1:Il6IvLdAapsMhvuOahHWiBnl1G++Q0/L5UIkI5mARSk= -github.com/rotisserie/eris v0.5.4/go.mod h1:Z/kgYTJiJtocxCbFfvRmO+QejApzG6zpyky9G1A4g9s= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryancurrah/gomodguard v1.3.5 h1:cShyguSwUEeC0jS7ylOiG/idnd1TpJ1LfHGpV3oJmPU= github.com/ryancurrah/gomodguard v1.3.5/go.mod h1:MXlEPQRxgfPQa62O8wzK3Ozbkv9Rkqr+wKjSxTdsNJE= github.com/ryanrolds/sqlclosecheck v0.5.1 h1:dibWW826u0P8jNLsLN+En7+RqWWTYrjCB9fJfSfdyCU= github.com/ryanrolds/sqlclosecheck v0.5.1/go.mod h1:2g3dUjoS6AL4huFdv6wn55WpLIDjY7ZgUR4J8HOO/XQ= -github.com/sagikazarmark/locafero v0.7.0 h1:5MqpDsTGNDhY8sGp0Aowyf0qKsPrhewaLSsFaodPcyo= -github.com/sagikazarmark/locafero v0.7.0/go.mod h1:2za3Cg5rMaTMoG/2Ulr9AwtFaIppKXTRYnozin4aB5k= -github.com/samber/lo v1.49.1 h1:4BIFyVfuQSEpluc7Fua+j1NolZHiEHEpaSEKdsH0tew= -github.com/samber/lo v1.49.1/go.mod h1:dO6KHFzUKXgP8LDhU0oI8d2hekjXnGOu0DB8Jecxd6o= +github.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc= +github.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik= github.com/sanposhiho/wastedassign/v2 v2.1.0 h1:crurBF7fJKIORrV85u9UUpePDYGWnwvv3+A96WvwXT0= github.com/sanposhiho/wastedassign/v2 v2.1.0/go.mod h1:+oSmSC+9bQ+VUAxA66nBb0Z7N8CK7mscKTDYC6aIek4= -github.com/santhosh-tekuri/jsonschema/v6 v6.0.1 h1:PKK9DyHxif4LZo+uQSgXNqs0jj5+xZwwfKHgph2lxBw= -github.com/santhosh-tekuri/jsonschema/v6 v6.0.1/go.mod h1:JXeL+ps8p7/KNMjDQk3TCwPpBy0wYklyWTfbkIzdIFU= +github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 h1:KRzFb2m7YtdldCEkzs6KqmJw4nqEVZGK7IN2kJkjTuQ= +github.com/santhosh-tekuri/jsonschema/v6 v6.0.2/go.mod h1:JXeL+ps8p7/KNMjDQk3TCwPpBy0wYklyWTfbkIzdIFU= github.com/sashamelentyev/interfacebloat v1.1.0 h1:xdRdJp0irL086OyW1H/RTZTr1h/tMEOsumirXcOJqAw= github.com/sashamelentyev/interfacebloat v1.1.0/go.mod h1:+Y9yU5YdTkrNvoX0xHc84dxiN1iBi9+G8zZIhPVoNjQ= github.com/sashamelentyev/usestdlibvars v1.28.0 h1:jZnudE2zKCtYlGzLVreNp5pmCdOxXUzwsMDBkR21cyQ= github.com/sashamelentyev/usestdlibvars v1.28.0/go.mod h1:9nl0jgOfHKWNFS43Ojw0i7aRoS4j6EBye3YBhmAIRF8= github.com/securego/gosec/v2 v2.22.2 h1:IXbuI7cJninj0nRpZSLCUlotsj8jGusohfONMrHoF6g= github.com/securego/gosec/v2 v2.22.2/go.mod h1:UEBGA+dSKb+VqM6TdehR7lnQtIIMorYJ4/9CW1KVQBE= -github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= -github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= +github.com/sergi/go-diff v1.4.0 h1:n/SP9D5ad1fORl+llWyN+D6qoUETXNZARKjyY2/KVCw= +github.com/sergi/go-diff v1.4.0/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 h1:bUGsEnyNbVPw06Bs80sCeARAlK8lhwqGyi6UT8ymuGk= @@ -965,8 +927,8 @@ github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd/go.mod h1:TrYk7fJV github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.9.4-0.20230606125235-dd1b4c2e81af h1:Sp5TG9f7K39yfB+If0vjp97vuT74F72r8hfRpP8jLU0= -github.com/sirupsen/logrus v1.9.4-0.20230606125235-dd1b4c2e81af/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/sirupsen/logrus v1.9.4 h1:TsZE7l11zFCLZnZ+teH4Umoq5BhEIfIzfRDZ1Uzql2w= +github.com/sirupsen/logrus v1.9.4/go.mod h1:ftWc9WdOfJ0a92nsE2jF5u5ZwH8Bv2zdeOC42RjbV2g= github.com/sivchari/containedctx v1.0.3 h1:x+etemjbsh2fB5ewm5FeLNi5bUjK0V8n0RB+Wwfd0XE= github.com/sivchari/containedctx v1.0.3/go.mod h1:c1RDvCbnJLtH4lLcYD/GqwiBSSf4F5Qk0xld2rBqzJ4= github.com/sivchari/tenv v1.12.1 h1:+E0QzjktdnExv/wwsnnyk4oqZBUfuh89YMQT1cyuvSY= @@ -975,24 +937,24 @@ github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js= github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= github.com/sonatard/noctx v0.1.0 h1:JjqOc2WN16ISWAjAk8M5ej0RfExEXtkEyExl2hLW+OM= github.com/sonatard/noctx v0.1.0/go.mod h1:0RvBxqY8D4j9cTTTWE8ylt2vqj2EPI8fHmrxHdsaZ2c= -github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= -github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= +github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw= +github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8/go.mod h1:3n1Cwaq1E1/1lhQhtRK2ts/ZwZEhjcQeJQ1RuC6Q/8U= github.com/sourcegraph/go-diff v0.7.0 h1:9uLlrd5T46OXs5qpp8L/MTltk0zikUGi0sNNyCpA8G0= github.com/sourcegraph/go-diff v0.7.0/go.mod h1:iBszgVvyxdc8SFZ7gm69go2KDdt3ag071iBaWPF6cjs= -github.com/spf13/afero v1.12.0 h1:UcOPyRBYczmFn6yvphxkn9ZEOY65cpwGKb5mL36mrqs= -github.com/spf13/afero v1.12.0/go.mod h1:ZTlWwG4/ahT8W7T0WQ5uYmjI9duaLQGy3Q2OAl4sk/4= -github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= -github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I= +github.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg= +github.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY= +github.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v1.10.1 h1:lJeBwCfmrnXthfAupyUTzJ/J4Nc1RsHC/mSRU2dll/s= -github.com/spf13/cobra v1.10.1/go.mod h1:7SmJGaTHFVBY0jW4NXGluQoLvhqFQM+6XSKD+P4XaB0= +github.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU= +github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.20.1 h1:ZMi+z/lvLyPSCoNtFCpqjy0S4kPbirhpTMwl8BkW9X4= -github.com/spf13/viper v1.20.1/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4= +github.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU= +github.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY= github.com/spiffe/go-spiffe/v2 v2.6.0 h1:l+DolpxNWYgruGQVV0xsfeya3CsC7m8iBzDnMpsbLuo= github.com/spiffe/go-spiffe/v2 v2.6.0/go.mod h1:gm2SeUoMZEtpnzPNs2Csc0D/gX33k1xIx7lEzqblHEs= github.com/ssgreg/nlreturn/v2 v2.2.1 h1:X4XDI7jstt3ySqGU86YGAURbxw3oTDPK9sPEi6YEwQ0= @@ -1001,8 +963,8 @@ github.com/stbenjam/no-sprintf-host-port v0.2.0 h1:i8pxvGrt1+4G0czLr/WnmyH7zbZ8B github.com/stbenjam/no-sprintf-host-port v0.2.0/go.mod h1:eL0bQ9PasS0hsyTyfTjjG+E80QIyPnBVQbYZyv20Jfk= github.com/std-uritemplate/std-uritemplate/go/v2 v2.0.5 h1:d3ht4RA1cu00hB+olyK+ppvOEhphHY3oGfSo/BMPlqo= github.com/std-uritemplate/std-uritemplate/go/v2 v2.0.5/go.mod h1:Z5KcoM0YLC7INlNhEezeIZ0TZNYf7WSNO0Lvah4DSeQ= -github.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs= -github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo= +github.com/stoewer/go-strcase v1.3.1 h1:iS0MdW+kVTxgMoE1LAZyMiYJFKlOzLooE4MxjirtkAs= +github.com/stoewer/go-strcase v1.3.1/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= @@ -1098,39 +1060,39 @@ go-simpler.org/sloglint v0.9.0 h1:/40NQtjRx9txvsB/RN022KsUJU+zaaSb/9q9BSefSrE= go-simpler.org/sloglint v0.9.0/go.mod h1:G/OrAF6uxj48sHahCzrbarVMptL2kjWTaUeC8+fOGww= go.etcd.io/bbolt v1.4.3 h1:dEadXpI6G79deX5prL3QRNP6JB8UxVkqo4UPnHaNXJo= go.etcd.io/bbolt v1.4.3/go.mod h1:tKQlpPaYCVFctUIgFKFnAlvbmB3tpy1vkTnDWohtc0E= -go.etcd.io/etcd/api/v3 v3.6.5 h1:pMMc42276sgR1j1raO/Qv3QI9Af/AuyQUW6CBAWuntA= -go.etcd.io/etcd/api/v3 v3.6.5/go.mod h1:ob0/oWA/UQQlT1BmaEkWQzI0sJ1M0Et0mMpaABxguOQ= -go.etcd.io/etcd/client/pkg/v3 v3.6.5 h1:Duz9fAzIZFhYWgRjp/FgNq2gO1jId9Yae/rLn3RrBP8= -go.etcd.io/etcd/client/pkg/v3 v3.6.5/go.mod h1:8Wx3eGRPiy0qOFMZT/hfvdos+DjEaPxdIDiCDUv/FQk= -go.etcd.io/etcd/client/v3 v3.6.5 h1:yRwZNFBx/35VKHTcLDeO7XVLbCBFbPi+XV4OC3QJf2U= -go.etcd.io/etcd/client/v3 v3.6.5/go.mod h1:ZqwG/7TAFZ0BJ0jXRPoJjKQJtbFo/9NIY8uoFFKcCyo= -go.etcd.io/etcd/pkg/v3 v3.6.5 h1:byxWB4AqIKI4SBmquZUG1WGtvMfMaorXFoCcFbVeoxM= -go.etcd.io/etcd/pkg/v3 v3.6.5/go.mod h1:uqrXrzmMIJDEy5j00bCqhVLzR5jEJIwDp5wTlLwPGOU= -go.etcd.io/etcd/server/v3 v3.6.5 h1:4RbUb1Bd4y1WkBHmuF+cZII83JNQMuNXzyjwigQ06y0= -go.etcd.io/etcd/server/v3 v3.6.5/go.mod h1:PLuhyVXz8WWRhzXDsl3A3zv/+aK9e4A9lpQkqawIaH0= +go.etcd.io/etcd/api/v3 v3.6.10 h1:jlwjtELjA8yi2VWpOFH+0w0lGr3K6mVDyn0RDB9aaAY= +go.etcd.io/etcd/api/v3 v3.6.10/go.mod h1:pdV4VeFmvhdNjB4LWRkC8ReLyRBAxUOze3GarMhE2sk= +go.etcd.io/etcd/client/pkg/v3 v3.6.10 h1:tBT7podcPhuVbCVkAEzx8bC5I+aqxfLwBN8/As1arrA= +go.etcd.io/etcd/client/pkg/v3 v3.6.10/go.mod h1:WEy3PpwbbEBVRdh1NVJYsuUe/8eyI21PNJRazeD8z/Y= +go.etcd.io/etcd/client/v3 v3.6.10 h1:J598zJ+C/ZPvImypmq5waj84+bovePrlZERHklf34y0= +go.etcd.io/etcd/client/v3 v3.6.10/go.mod h1:iHhUDUcEwaKs1YFq3MgmI9U4zhTVasp/vgdVbFf1RS8= +go.etcd.io/etcd/pkg/v3 v3.6.8 h1:Xe+LIL974spy8b4nEx3H0KMr1ofq3r0kh6FbU3aw4es= +go.etcd.io/etcd/pkg/v3 v3.6.8/go.mod h1:TRibVNe+FqJIe1abOAA1PsuQ4wqO87ZaOoprg09Tn8c= +go.etcd.io/etcd/server/v3 v3.6.8 h1:U2strdSEy1U8qcSzRIdkYpvOPtBy/9i/IfaaCI9flZ4= +go.etcd.io/etcd/server/v3 v3.6.8/go.mod h1:88dCtwUnSirkUoJbflQxxWXqtBSZa6lSG0Kuej+dois= go.etcd.io/raft/v3 v3.6.0 h1:5NtvbDVYpnfZWcIHgGRk9DyzkBIXOi8j+DDp1IcnUWQ= go.etcd.io/raft/v3 v3.6.0/go.mod h1:nLvLevg6+xrVtHUmVaTcTz603gQPHfh7kUAwV6YpfGo= go.keploy.io/server v0.8.6 h1:czE9jaliyAkMMJcYnMPNuu6tun7UgwFbokxEG95vLN4= go.keploy.io/server v0.8.6/go.mod h1:t7BPuZQSiC3PNHZ9dbn3e3VB61HNWwiqVmaRujfDFUg= go.mongodb.org/mongo-driver v1.4.3/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= -go.mongodb.org/mongo-driver v1.17.4 h1:jUorfmVzljjr0FLzYQsGP8cgN/qzzxlY9Vh0C9KFXVw= -go.mongodb.org/mongo-driver v1.17.4/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ= +go.mongodb.org/mongo-driver v1.17.6 h1:87JUG1wZfWsr6rIz3ZmpH90rL5tea7O3IHuSwHUpsss= +go.mongodb.org/mongo-driver v1.17.6/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ= go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= go.opentelemetry.io/contrib/detectors/gcp v1.39.0 h1:kWRNZMsfBHZ+uHjiH4y7Etn2FK26LAGkNFw7RHv1DhE= go.opentelemetry.io/contrib/detectors/gcp v1.39.0/go.mod h1:t/OGqzHBa5v6RHZwrDBJ2OirWc+4q/w2fTbLZwAKjTk= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.62.0 h1:rbRJ8BBoVMsQShESYZ0FkvcITu8X8QNwJogcLUmDNNw= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.62.0/go.mod h1:ru6KHrNtNHxM4nD/vd6QrLVWgKhxPYgblq4VAtNawTQ= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.62.0 h1:Hf9xI/XLML9ElpiHVDNwvqI0hIFlzV8dgIr35kV1kRU= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.62.0/go.mod h1:NfchwuyNoMcZ5MLHwPrODwUF1HWCXWrL31s8gSAdIKY= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.65.0 h1:XmiuHzgJt067+a6kwyAzkhXooYVv3/TOw9cM2VfJgUM= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.65.0/go.mod h1:KDgtbWKTQs4bM+VPUr6WlL9m/WXcmkCcBlIzqxPGzmI= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.65.0 h1:7iP2uCb7sGddAr30RRS6xjKy7AZ2JtTOPA3oolgVSw8= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.65.0/go.mod h1:c7hN3ddxs/z6q9xwvfLPk+UHlWRQyaeR1LdgfL/66l0= go.opentelemetry.io/otel v1.44.0 h1:JjwHmHpA4iZ3wBxluu2fbbE7j4kqlE8jXyAyPXH7HqU= go.opentelemetry.io/otel v1.44.0/go.mod h1:BMgjTHL9WPRlRjL2oZCBTL4whCGtXch2H4BhOPIAyYc= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.38.0 h1:GqRJVj7UmLjCVyVJ3ZFLdPRmhDUp2zFmQe3RHIOsw24= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.38.0/go.mod h1:ri3aaHSmCTVYu2AWv44YMauwAQc0aqI9gHKIcSbI1pU= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.38.0 h1:lwI4Dc5leUqENgGuQImwLo4WnuXFPetmPpkLi2IrX54= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.38.0/go.mod h1:Kz/oCE7z5wuyhPxsXDuaPteSWqjSBD5YaSdbxZYGbGk= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.37.0 h1:6VjV6Et+1Hd2iLZEPtdV7vie80Yyqf7oikJLjQ/myi0= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.37.0/go.mod h1:u8hcp8ji5gaM/RfcOo8z9NMnf1pVLfVY7lBY2VOGuUU= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.43.0 h1:88Y4s2C8oTui1LGM6bTWkw0ICGcOLCAI5l6zsD1j20k= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.43.0/go.mod h1:Vl1/iaggsuRlrHf/hfPJPvVag77kKyvrLeD10kpMl+A= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.43.0 h1:RAE+JPfvEmvy+0LzyUA25/SGawPwIUbZ6u0Wug54sLc= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.43.0/go.mod h1:AGmbycVGEsRx9mXMZ75CsOyhSP6MFIcj/6dnG+vhVjk= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.38.0 h1:wm/Q0GAAykXv83wzcKzGGqAnnfLFyFe7RslekZuv+VI= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.38.0/go.mod h1:ra3Pa40+oKjvYh+ZD3EdxFZZB0xdMfuileHAm4nNN7w= go.opentelemetry.io/otel/metric v1.44.0 h1:1w0gILTcHdr3YI+ixLyjemwrVnsMURbTZFrSYCdDdmc= go.opentelemetry.io/otel/metric v1.44.0/go.mod h1:8O7hanEPBNgEMmybD3s2VBKcgWOCsA6tzHBPODAiquo= go.opentelemetry.io/otel/sdk v1.43.0 h1:pi5mE86i5rTeLXqoF/hhiBtUNcrAGHLKQdhg4h4V9Dg= @@ -1139,8 +1101,12 @@ go.opentelemetry.io/otel/sdk/metric v1.43.0 h1:S88dyqXjJkuBNLeMcVPRFXpRw2fuwdvfC go.opentelemetry.io/otel/sdk/metric v1.43.0/go.mod h1:C/RJtwSEJ5hzTiUz5pXF1kILHStzb9zFlIEe85bhj6A= go.opentelemetry.io/otel/trace v1.44.0 h1:jxF5CsGYCe74MCRx2X4g7WsY/VBKRqqpNvXlX/6gtIk= go.opentelemetry.io/otel/trace v1.44.0/go.mod h1:oLl1jrMQAVo6v3GAggN+1VH9VIz9iUSvW53sW1Q8PIE= -go.opentelemetry.io/proto/otlp v1.7.1 h1:gTOMpGDb0WTBOP8JaO72iL3auEZhVmAQg4ipjOVAtj4= -go.opentelemetry.io/proto/otlp v1.7.1/go.mod h1:b2rVh6rfI/s2pHWNlB7ILJcRALpcNDzKhACevjI+ZnE= +go.opentelemetry.io/proto/otlp v1.10.0 h1:IQRWgT5srOCYfiWnpqUYz9CVmbO8bFmKcwYxpuCSL2g= +go.opentelemetry.io/proto/otlp v1.10.0/go.mod h1:/CV4QoCR/S9yaPj8utp3lvQPoqMtxXdzn7ozvvozVqk= +go.podman.io/image/v5 v5.37.0 h1:yzgQybwuWIIeK63hu+mQqna/wOh96XD5cpVc6j8Dg5M= +go.podman.io/image/v5 v5.37.0/go.mod h1:+s2Sx5dia/jVeT8tI3r2NAPrARMiDdbEq3QPIQogx3I= +go.podman.io/storage v1.60.0 h1:bWNSrR58nxg39VNFDSx3m0AswbvyzPGOo5XsUfomTao= +go.podman.io/storage v1.60.0/go.mod h1:NK+rsWJVuQeCM7ifv7cxD3abegWxwtW/3OkuSUJJoE4= go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs= go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= @@ -1151,8 +1117,8 @@ 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.27.1 h1:08RqriUEv8+ArZRYSTXy1LeBScaMpVSTBhCeaZYfMYc= go.uber.org/zap v1.27.1/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= -go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0= -go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8= +go.yaml.in/yaml/v2 v2.4.4 h1:tuyd0P+2Ont/d6e2rl3be67goVK4R6deVxCUX5vyPaQ= +go.yaml.in/yaml/v2 v2.4.4/go.mod h1:gMZqIpDtDqOfM0uNfy0SkpRhvUryYH0Z6wdMYcacYXQ= go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -1167,10 +1133,10 @@ golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliY golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= -golang.org/x/crypto v0.52.0 h1:RMs7fP2rXdep0CftQlK8Uf+kibLm7qkCcradZWYz988= -golang.org/x/crypto v0.52.0/go.mod h1:1QgfPxDqh0T2M/elOJtp9RvuR95kVjir0e6/BvEmGbc= -golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 h1:nDVHiLt8aIbd/VzvPWN6kSOPE7+F/fNFDSXLVYkE/Iw= -golang.org/x/exp v0.0.0-20250305212735-054e65f0b394/go.mod h1:sIifuuw/Yco/y6yb6+bDNfyeQ/MdPUy/hKEMYQV17cM= +golang.org/x/crypto v0.53.0 h1:QZ4Muo8THX6CizN2vPPd5fBGHyogrdK9fG4wLPFUsto= +golang.org/x/crypto v0.53.0/go.mod h1:DNLU434OwVakk9PzuwV8w62mAJpRJL3vsgcfp4Qnsio= +golang.org/x/exp v0.0.0-20251219203646-944ab1f22d93 h1:fQsdNF2N+/YewlRZiricy4P1iimyPKZ/xwniHj8Q2a0= +golang.org/x/exp v0.0.0-20251219203646-944ab1f22d93/go.mod h1:EPRbTFwzwjXj9NpYyyrvenVh9Y+GFeEvMNh7Xuz7xgU= golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/exp/typeparams v0.0.0-20230203172020-98cc5a0785f9/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/exp/typeparams v0.0.0-20250210185358-939b2ce775ac h1:TSSpLIG4v+p0rPv1pNOQtl1I8knsO4S9trOxNMOLVP4= @@ -1189,8 +1155,8 @@ golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/mod v0.35.0 h1:Ww1D637e6Pg+Zb2KrWfHQUnH2dQRLBQyAtpr/haaJeM= -golang.org/x/mod v0.35.0/go.mod h1:+GwiRhIInF8wPm+4AoT6L0FA1QWAad3OMdTRx4tFYlU= +golang.org/x/mod v0.36.0 h1:JJjpVx6myfUsUdAzZuOSTTmRE0PfZeNWzzvKrP7amb4= +golang.org/x/mod v0.36.0/go.mod h1:moc6ELqsWcOw5Ef3xVprK5ul/MvtVvkIXLziUOICjUQ= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/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= @@ -1214,10 +1180,10 @@ golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -golang.org/x/net v0.55.0 h1:bcvxaJn3e1U6InsFWt1JUq1aSjnRxLzT2rtD2KfkDF8= -golang.org/x/net v0.55.0/go.mod h1:L5U2KuzuOe1lY7Z+aWVIKK6qEeJXnXV9yzGA+WCHJww= -golang.org/x/oauth2 v0.34.0 h1:hqK/t4AKgbqWkdkcAeI8XLmbK+4m4G5YeQRrmiotGlw= -golang.org/x/oauth2 v0.34.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= +golang.org/x/net v0.55.1-0.20260602153038-42abb857022c h1:hzdRVvjwthcq46T3ybsDtJpg1iZZaW3zik9P3tsYJeo= +golang.org/x/net v0.55.1-0.20260602153038-42abb857022c/go.mod h1:Mo4aFsyVPXieTwCJ1g83a3xU8RY7PkHFQqQ7pkWnuM0= +golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= +golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1230,8 +1196,8 @@ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= -golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= +golang.org/x/sync v0.21.0 h1:HLII4xRRTtCRkxYp4HNFF0Js/Og6q2i++KXbg0gHCwM= +golang.org/x/sync v0.21.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1258,7 +1224,6 @@ golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211105183446-c75c47738b0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1270,8 +1235,8 @@ golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY= -golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/sys v0.46.0 h1:noSf2Fq6F8DBgS+LysIkx7rIExoNHJsxOAtPp4rthXw= +golang.org/x/sys v0.46.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= @@ -1282,8 +1247,8 @@ golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= -golang.org/x/term v0.43.0 h1:S4RLU2sB31O/NCl+zFN9Aru9A/Cq2aqKpTZJ6B+DwT4= -golang.org/x/term v0.43.0/go.mod h1:lrhlHNdQJHO+1qVYiHfFKVuVioJIheAc3fBSMFYEIsk= +golang.org/x/term v0.44.0 h1:0rLvDRCtNj0gZkyIXhCyOb2OAzEhLVqc4B+hrsBhrmc= +golang.org/x/term v0.44.0/go.mod h1:7ze4MdzUzLXpSAoFP1H0bOI9aXDqveSvatT5vKcFh2Y= 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= @@ -1295,10 +1260,10 @@ golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc= -golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38= -golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI= -golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4= +golang.org/x/text v0.38.0 h1:sXmwo9DwP3OK9EZ7PqAdaooSGozfl/3a6/xJcbzPRhE= +golang.org/x/text v0.38.0/go.mod h1:YXZt3QhHUKYT53r2lLKFIVi6Ao1jdzrTR/KQ09qyxF4= +golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U= +golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -1326,8 +1291,8 @@ golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= -golang.org/x/tools v0.44.0 h1:UP4ajHPIcuMjT1GqzDWRlalUEoY+uzoZKnhOjbIPD2c= -golang.org/x/tools v0.44.0/go.mod h1:KA0AfVErSdxRZIsOVipbv3rQhVXTnlU6UhKxHd1seDI= +golang.org/x/tools v0.45.0 h1:18qN3FAooORvApf5XjCXgsuayZOEtXf6JK18I3+ONa8= +golang.org/x/tools v0.45.0/go.mod h1:LuUGqqaXcXMEFEruIVJVm5mgDD8vww/z/SR1gQ4uE/0= golang.org/x/tools/go/expect v0.1.1-deprecated h1:jpBZDwmgPhXsKZC6WhL20P4b/wmnpsEAGHaNy0n/rJM= golang.org/x/tools/go/expect v0.1.1-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY= golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated h1:1h2MnaIAIXISqTFKdENegdpAgUXz6NrPEsbIeWaBRvM= @@ -1340,18 +1305,18 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gomodules.xyz/jsonpatch/v2 v2.5.0 h1:JELs8RLM12qJGXU4u/TO3V25KW8GreMKl9pdkk14RM0= gomodules.xyz/jsonpatch/v2 v2.5.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= -gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= -gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= -google.golang.org/api v0.255.0 h1:OaF+IbRwOottVCYV2wZan7KUq7UeNUQn1BcPc4K7lE4= -google.golang.org/api v0.255.0/go.mod h1:d1/EtvCLdtiWEV4rAEHDHGh2bCnqsWhw+M8y2ECN4a8= -google.golang.org/genproto v0.0.0-20250707201910-8d1bb00bc6a7 h1:FGOcxvKlJgRBVbXeugjljCfCgfKWhC42FBoYmTCWVBs= -google.golang.org/genproto v0.0.0-20250707201910-8d1bb00bc6a7/go.mod h1:249YoW4b1INqFTEop2T4aJgiO7UBYJrpejsaLvjWfI8= -google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 h1:fCvbg86sFXwdrl5LgVcTEvNC+2txB5mgROGmRL5mrls= -google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:+rXWjjaukWZun3mLfjmVnQi18E1AsFbDN9QdJ5YXLto= -google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww= -google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:7i2o+ce6H/6BluujYR+kqX3GKH+dChPTQU19wjRPiGk= -google.golang.org/grpc v1.79.3 h1:sybAEdRIEtvcD68Gx7dmnwjZKlyfuc61Dyo9pGXXkKE= -google.golang.org/grpc v1.79.3/go.mod h1:KmT0Kjez+0dde/v2j9vzwoAScgEPx/Bw1CYChhHLrHQ= +gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= +gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= +google.golang.org/api v0.267.0 h1:w+vfWPMPYeRs8qH1aYYsFX68jMls5acWl/jocfLomwE= +google.golang.org/api v0.267.0/go.mod h1:Jzc0+ZfLnyvXma3UtaTl023TdhZu6OMBP9tJ+0EmFD0= +google.golang.org/genproto v0.0.0-20260128011058-8636f8732409 h1:VQZ/yAbAtjkHgH80teYd2em3xtIkkHd7ZhqfH2N9CsM= +google.golang.org/genproto v0.0.0-20260128011058-8636f8732409/go.mod h1:rxKD3IEILWEu3P44seeNOAwZN4SaoKaQ/2eTg4mM6EM= +google.golang.org/genproto/googleapis/api v0.0.0-20260401024825-9d38bb4040a9 h1:VPWxll4HlMw1Vs/qXtN7BvhZqsS9cdAittCNvVENElA= +google.golang.org/genproto/googleapis/api v0.0.0-20260401024825-9d38bb4040a9/go.mod h1:7QBABkRtR8z+TEnmXTqIqwJLlzrZKVfAUm7tY3yGv0M= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260401024825-9d38bb4040a9 h1:m8qni9SQFH0tJc1X0vmnpw/0t+AImlSvp30sEupozUg= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260401024825-9d38bb4040a9/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= +google.golang.org/grpc v1.80.0 h1:Xr6m2WmWZLETvUNvIUmeD5OAagMw3FiKmMlTdViWsHM= +google.golang.org/grpc v1.80.0/go.mod h1:ho/dLnxwi3EDJA4Zghp7k2Ec1+c2jqup0bFkw07bwF4= 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= @@ -1360,8 +1325,8 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 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.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE= -google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= +google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af h1:+5/Sw3GsDNlEmu7TfklWKPdQ0Ykja5VEmq2i817+jbI= +google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1377,8 +1342,8 @@ gopkg.in/h2non/gock.v1 v1.1.2 h1:jBbHXgGBK/AoPVfJh5x4r/WxIrElvbLel8TCZkkZJoY= gopkg.in/h2non/gock.v1 v1.1.2/go.mod h1:n7UGz/ckNChHiK05rDoiC4MYSunEC/lyaUm2WWaDva0= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= -gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.67.3 h1:iM9Lhz5MRSGhHVGGwCuzG9KO8PoirCXj/m/qTmOJJQw= +gopkg.in/ini.v1 v1.67.3/go.mod h1:x/cyOwCgZqOkJoDIJ3c1KNHMo10+nLGAhh+kn3Zizss= gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= @@ -1397,62 +1362,68 @@ 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.6.1 h1:R094WgE8K4JirYjBaOpz/AvTyUu/3wbmAoskKN/pxTI= honnef.co/go/tools v0.6.1/go.mod h1:3puzxxljPCe8RGJX7BIy1plGbxEOZni5mR2aXe3/uk4= -k8s.io/api v0.35.4 h1:P7nFYKl5vo9AGUp1Z+Pmd3p2tA7bX2wbFWCvDeRv988= -k8s.io/api v0.35.4/go.mod h1:yl4lqySWOgYJJf9RERXKUwE9g2y+CkuwG+xmcOK8wXU= -k8s.io/apiextensions-apiserver v0.35.4 h1:HeP+Upp7ItdvnyGmub0yoix+2z5+ev4M5cE5TCgtOUU= -k8s.io/apiextensions-apiserver v0.35.4/go.mod h1:ogQlk+stIE8mnoRthSYCwlOS12fVqgWFiErMwPaXA7c= -k8s.io/apimachinery v0.35.4 h1:xtdom9RG7e+yDp71uoXoJDWEE2eOiHgeO4GdBzwWpds= -k8s.io/apimachinery v0.35.4/go.mod h1:NNi1taPOpep0jOj+oRha3mBJPqvi0hGdaV8TCqGQ+cc= -k8s.io/apiserver v0.35.4 h1:vtuFqNFmF9bPRdHDL2lpK6qCTPWDreZJL4LRPwVM6ho= -k8s.io/apiserver v0.35.4/go.mod h1:JnBcb+J8kFXKpZkgcbcUnPBBHi4qgBii1I7dLxFY/oo= -k8s.io/cli-runtime v0.35.4 h1:8QRCXSDvopflFNM65Vkkdv42BljPdRSiqf6HFyI1iik= -k8s.io/cli-runtime v0.35.4/go.mod h1:MKLFuZxiJpm87UxjVeQRNy3sCaczHrSOPKN9pinlrM0= -k8s.io/client-go v0.35.4 h1:DN6fyaGuzK64UvnKO5fOA6ymSjvfGAnCAHAR0C66kD8= -k8s.io/client-go v0.35.4/go.mod h1:2Pg9WpsS4NeOpoYTfHHfMxBG8zFMSAUi4O/qoiJC3nY= +k8s.io/api v0.36.2 h1:TF6YDLIzKfccK7cq9YpTcGX8TJmEkHVRv78DM51fRYY= +k8s.io/api v0.36.2/go.mod h1:F4LbMO4brjZYh7yFkXWhynSvtB7YauxV4c+HHkNRGNg= +k8s.io/apiextensions-apiserver v0.36.2 h1:3O5gqOj/dt2XWWbpMe+TXWpE9yU6pjM/tXxtHHJT/K4= +k8s.io/apiextensions-apiserver v0.36.2/go.mod h1:cL1tBWe8XSaP1H30iWKGo7hf6iAUUUJPEU70dskmAnA= +k8s.io/apimachinery v0.36.2 h1:0PE/W/WNy1UX61NLbXY5TMbJ6UwLL6E6lAPkYrKFxbQ= +k8s.io/apimachinery v0.36.2/go.mod h1:fvf/HOLXq9RId0rnDIbN1OEBvHXdQbLMM8nu0LcBUf4= +k8s.io/apiserver v0.36.2 h1:6vMnkmHZPeBloNkHUhmZYq7Ylv8WIB8xjyEl+eSt26E= +k8s.io/apiserver v0.36.2/go.mod h1:9PoQ2ikCytrZyZg11mGhLEF5m8Rgsb5FJmYJ4Wvnl1k= +k8s.io/cli-runtime v0.36.0 h1:HNxciQpQMMOKS0/GiUXcKDyA6J2FDILJj9NmP2BZrTg= +k8s.io/cli-runtime v0.36.0/go.mod h1:KObkknK9Ro5LYX+1RdiKc7C8CvGg4aX+V/Zv+E8WPHA= +k8s.io/client-go v0.36.2 h1:bfgxmFKc9CgqsgX4xKLAAdmTQlWee7Ob/HlDOrJ5TBI= +k8s.io/client-go v0.36.2/go.mod h1:1vgO4OAlfPnoLcb+Rze2GF5rAr14w8qjrYMoyXJzQj0= +k8s.io/cluster-bootstrap v0.35.5 h1:Dk0aNTKuqH87hBpzn85qrx1VVv5/CLNZCnCPDKlw5s4= +k8s.io/cluster-bootstrap v0.35.5/go.mod h1:Q9bKIm0xCTW8wMkR/NuUAm7VuRJnepI/6MNqdX6m540= k8s.io/cluster-registry v0.0.6 h1:zSzuBlDybN72jty3veddOALhWyzeXfF80u8NZg3FMFM= k8s.io/cluster-registry v0.0.6/go.mod h1:/F+o1rvzjBdLbg782rR8eKrOb20hPy7us+Zu/pjBtAY= -k8s.io/code-generator v0.35.4 h1:i0FfiXAeUMBlHarjVk5ZWf6Wjsg3YJpNYmOg0nPk6r4= -k8s.io/code-generator v0.35.4/go.mod h1:rwLDdemFgPK6dGlLFHPUieyekgAlV1x8IVafjAy/ELA= -k8s.io/component-base v0.35.4 h1:6n1tNJ87johN0Hif0Fs8K2GMthsaUwMqCebUDLYyv7U= -k8s.io/component-base v0.35.4/go.mod h1:qaDJgz5c1KYKla9occFmlJEfPpkuA55s90G509R+PeY= -k8s.io/component-helpers v0.35.4 h1:WJM/+fAeeJTAqxPDxgH0aB0q7t8DP+AbV5WkRkOoxYA= -k8s.io/component-helpers v0.35.4/go.mod h1:mE7X9mnMQEX6IbZejdMlWvCx3EPVt1/9PhH/FW0XHDI= +k8s.io/code-generator v0.36.2 h1:iBNFYhClojQaVrF99Z3iTAad7LztQh3yCtwR8L8Ocpg= +k8s.io/code-generator v0.36.2/go.mod h1:IfnsRW1IAq9iPxqs/FfOnVnWWONxS2mPDvWNR4fPlzI= +k8s.io/component-base v0.36.2 h1:Z0VH80O7Ng0HDZnZj3WRR3urEGa0kTwmO8CwEwjVK1w= +k8s.io/component-base v0.36.2/go.mod h1:mGfFOA7Gwpdm1VW2cwSQYbiDIlz8GD2WGwH88QSeCyA= +k8s.io/component-helpers v0.36.0 h1:KznLAOD7oPxjaeheW4SOQijz9UtMO8Nvp89+lR8FYks= +k8s.io/component-helpers v0.36.0/go.mod h1:BqZG+01Z97KR8GN9Stb8SiRmtn/EpZogriuQtpMCsLg= k8s.io/gengo/v2 v2.0.0-20250922181213-ec3ebc5fd46b h1:gMplByicHV/TJBizHd9aVEsTYoJBnnUAT5MHlTkbjhQ= k8s.io/gengo/v2 v2.0.0-20250922181213-ec3ebc5fd46b/go.mod h1:CgujABENc3KuTrcsdpGmrrASjtQsWCT7R99mEV4U/fM= k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= -k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= -k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= -k8s.io/kms v0.35.4 h1:0eE6Zd4nACEs8cc7qCxf3UwMAtgM87X8doj+pJCxJk0= -k8s.io/kms v0.35.4/go.mod h1:c/uQe/eKrWdBkvizLFW+ThLA6tTzR0RkkwJJyzDRT1g= -k8s.io/kube-aggregator v0.35.4 h1:6eR50WHwqSYJQTR6QxEG5fRW2vBA6Yoqzp72hw76koE= -k8s.io/kube-aggregator v0.35.4/go.mod h1:13mmXpCW9sReIQR8yLvApbKphZfoGnK39UJ8u1opT9g= -k8s.io/kube-openapi v0.0.0-20260304202019-5b3e3fdb0acf h1:btPscg4cMql0XdYK2jLsJcNEKmACJz8l+U7geC06FiM= -k8s.io/kube-openapi v0.0.0-20260304202019-5b3e3fdb0acf/go.mod h1:kdmbQkyfwUagLfXIad1y2TdrjPFWp2Q89B3qkRwf/pQ= -k8s.io/kubectl v0.35.4 h1:IHitney6OUeH29rBQnt6Cas6az8HpFeSAohormITNMc= -k8s.io/kubectl v0.35.4/go.mod h1:CGWAaof9ae4vGDAyhnSf1bSQN/U7jiWQHLVbMbLMjRI= -k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 h1:SjGebBtkBqHFOli+05xYbK8YF1Dzkbzn+gDM4X9T4Ck= -k8s.io/utils v0.0.0-20251002143259-bc988d571ff4/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/klog/v2 v2.140.0 h1:Tf+J3AH7xnUzZyVVXhTgGhEKnFqye14aadWv7bzXdzc= +k8s.io/klog/v2 v2.140.0/go.mod h1:o+/RWfJ6PwpnFn7OyAG3QnO47BFsymfEfrz6XyYSSp0= +k8s.io/kms v0.36.2 h1:o0l8zMRecm38k5NyRnO/3+2YA/MR6TMGcc3KQZA76hI= +k8s.io/kms v0.36.2/go.mod h1:g91diTD9h0oJCCHkTb00krlF+Qm5HTnkWLi9Q/TpRoc= +k8s.io/kube-aggregator v0.36.2 h1:zfeH9Fs16oDquNfBZef3M27dGG3QtJ9/TwkWfBlw1lo= +k8s.io/kube-aggregator v0.36.2/go.mod h1:UMrB5DfEhznFTf0bqYW2SV26GDy8HNaxoYakvKVWZ8M= +k8s.io/kube-openapi v0.0.0-20260519202549-bbf5c5577288 h1:A7Lby6ekC6nv+6oO38huCMFBRP0Os+tIeq1GkwxOQes= +k8s.io/kube-openapi v0.0.0-20260519202549-bbf5c5577288/go.mod h1:V/QaCUYDa+0QpcHhVVc5l99Uz56wEMEXBSj9oCDkNDY= +k8s.io/kubectl v0.36.0 h1:hEGr8NvIm2Wjqs2Xy48Uzmvo6lpHdGKlLyMvau2gTms= +k8s.io/kubectl v0.36.0/go.mod h1:iDe8aV5BEi45W8k+5n71I2pJ/nwE0PHDu+/2cejzYoo= +k8s.io/streaming v0.36.2 h1:NSKthPPg9UFSKsRauVJUVGH2Dvn8fhKmY4qrMkw/p98= +k8s.io/streaming v0.36.2/go.mod h1:z6fV3D+NVkoeqRMtWwlUZK6U17SY/LqNzOxWL6GyR/s= +k8s.io/utils v0.0.0-20260707023825-cf1189d6abe3 h1:jVkFFVfXdXP74B/zbO3hM3hpSFD0xvhQ5U686DPurkE= +k8s.io/utils v0.0.0-20260707023825-cf1189d6abe3/go.mod h1:M2s5JB1lIYP3jzZdorPLHXIPJzt9vv2muW5a6L9DtNM= mvdan.cc/gofumpt v0.7.0 h1:bg91ttqXmi9y2xawvkuMXyvAA/1ZGJqYAEGjXuP0JXU= mvdan.cc/gofumpt v0.7.0/go.mod h1:txVFJy/Sc/mvaycET54pV8SW8gWxTlUuGHVEcncmNUo= mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f h1:lMpcwN6GxNbWtbpI1+xzFLSW8XzX0u72NttUGVFjO3U= mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f/go.mod h1:RSLa7mKKCNeTTMHBw5Hsy2rfJmd6O2ivt9Dw9ZqCQpQ= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.32.0 h1:XotDXzqvJ8Nx5eiZZueLpTuafJz8SiodgOemI+w87QU= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.32.0/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw= -sigs.k8s.io/cluster-api v1.11.3 h1:apxfugbP1X8AG7THCM74CTarCOW4H2oOc6hlbm1hY80= -sigs.k8s.io/cluster-api v1.11.3/go.mod h1:CA471SACi81M8DzRKTlWpHV33G0cfWEj7sC4fALFVok= -sigs.k8s.io/cluster-api-provider-aws/v2 v2.10.1-0.20260226000023-67627b2da0df h1:jTXXHQqzCj0qRupZC4tWleQ+yL7JSdqT5WzovG1PlBI= -sigs.k8s.io/cluster-api-provider-aws/v2 v2.10.1-0.20260226000023-67627b2da0df/go.mod h1:vbVa187QP4/y7/03JqhYBmou4xabCRnuRoHwhE2BgE8= -sigs.k8s.io/cluster-api-provider-gcp v1.10.1-0.20251030112604-5c2bfd5aadb3 h1:hX2TCLts4fGf33RAkfMViy5qHZfMLZJfeu2BGYxXQkI= -sigs.k8s.io/cluster-api-provider-gcp v1.10.1-0.20251030112604-5c2bfd5aadb3/go.mod h1:BR9XUljy5o4V6MNTZva4XFh7Gj++4d5G8AnKa6iB6Tc= -sigs.k8s.io/cluster-api-provider-ibmcloud v0.12.0 h1:0+jfWLg+UmnGOdHZ9SrEpnUJgQPyyXpcjXGdkN5E5M4= -sigs.k8s.io/cluster-api-provider-ibmcloud v0.12.0/go.mod h1:OENB/2pEx2IgYAovlV7qHvOJYyBoKc94TxNqnjjyWYs= -sigs.k8s.io/cluster-api-provider-openstack v0.13.0 h1:iZN/qJhDZas74Mo/zM1tz038niv68e1g5wYCQJ5yczo= -sigs.k8s.io/cluster-api-provider-openstack v0.13.0/go.mod h1:ooipbibCnZS4mJTQJuZtlj0FyaA9MEH5CzxkJoxU4xo= -sigs.k8s.io/cluster-api-provider-vsphere v1.14.0 h1:MR3Ry1DvFeeLHH4ldFi1kChpkkB5HPOWHP0viURbL8c= -sigs.k8s.io/cluster-api-provider-vsphere v1.14.0/go.mod h1:QilGYtsQutBXDmdhSRyMDvJaKiuVaUaAf5LIirlZFZM= -sigs.k8s.io/controller-runtime v0.19.3 h1:XO2GvC9OPftRst6xWCpTgBZO04S2cbp0Qqkj8bX1sPw= -sigs.k8s.io/controller-runtime v0.19.3/go.mod h1:j4j87DqtsThvwTv5/Tc5NFRyyF/RF0ip4+62tbTSIUM= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.34.0 h1:hSfpvjjTQXQY2Fol2CS0QHMNs/WI1MOSGzCm1KhM5ec= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.34.0/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw= +sigs.k8s.io/cluster-api v1.13.4 h1:27PPEKSqESKeUIf475Ga6hSW1+gKxd5V5sCmMDgeBDo= +sigs.k8s.io/cluster-api v1.13.4/go.mod h1:suV3Ixu7yUMD651EtBULa/RtwHRxU30eojF3wifGe8Y= +sigs.k8s.io/cluster-api-provider-aws/v2 v2.12.1 h1:Qt4c7roIXEpe0wtTocE2tIWgShhcCSuLwQGgIiUFSZo= +sigs.k8s.io/cluster-api-provider-aws/v2 v2.12.1/go.mod h1:kzoAhbiaTDdVSQ9pWOQhDuBwQlkkl8xPbDnDw7M2Hk8= +sigs.k8s.io/cluster-api-provider-azure v1.24.2 h1:LNqS99Gon7Q9GPOO4eP/K9c1GGH09YF/EJSrBC/Tvgo= +sigs.k8s.io/cluster-api-provider-azure v1.24.2/go.mod h1:EDt1UPqLqlaKVWfwC5SzfHKg2joc0plhVyrRRo/bdRc= +sigs.k8s.io/cluster-api-provider-gcp v1.12.0 h1:RFdAxck4j62e320n8uUbFcro4zxdYZnTWj0mAHZ+CFo= +sigs.k8s.io/cluster-api-provider-gcp v1.12.0/go.mod h1:vL6gCBOG9LgszKtWsoPlrO1XFHqm5r0zlpk6V9eSCis= +sigs.k8s.io/cluster-api-provider-ibmcloud v0.13.1 h1:cR7WFEaNJJb6/R67o35zZXd7Vqf9eRAFiZkVDJomPI8= +sigs.k8s.io/cluster-api-provider-ibmcloud v0.13.1/go.mod h1:/B1y/mWZSM7qzdlmnI2OWF+27dPq/VinVkWKkYEdfj4= +sigs.k8s.io/cluster-api-provider-openstack v0.14.6 h1:yOln3Hd6JOFe2mkOGckFdWwFNhJdcNWrlfgwMdxmzto= +sigs.k8s.io/cluster-api-provider-openstack v0.14.6/go.mod h1:A5d/QLwDgQ9vOAD6/z6EKN23+4GXZK4E8vmh7Jlfsm0= +sigs.k8s.io/cluster-api-provider-vsphere v1.15.3 h1:gyz9GFzq7j1stm425PpmGRQDT8e2UWA2GAsski/jB9k= +sigs.k8s.io/cluster-api-provider-vsphere v1.15.3/go.mod h1:7UydsEUb+DKhhb3o5K2RAv3sTi9l/YJPLPVEEGjyNS8= +sigs.k8s.io/controller-runtime v0.24.1 h1:miPEwrmirImAvgME1L9qebGHrOnGJoVmVdtOU9fRfo4= +sigs.k8s.io/controller-runtime v0.24.1/go.mod h1:vFkfY5fGt5xAC/sKb8IBFKgWPNKG9OUG29dR8Y2wImw= sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20250911215635-f3b9e4f96392 h1:wmM9gmuERTwUDG+AyUYTDibEENDivB6ZiSn/FbuIW24= sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20250911215635-f3b9e4f96392/go.mod h1:sWEAaKdjIb8+pUyzfpeClTvbK2vTRdeF39lz/ee4EMU= sigs.k8s.io/controller-tools v0.19.0 h1:OU7jrPPiZusryu6YK0jYSjPqg8Vhf8cAzluP9XGI5uk= @@ -1461,13 +1432,13 @@ sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5E sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= sigs.k8s.io/kube-storage-version-migrator v0.0.6-0.20230721195810-5c8923c5ff96 h1:PFWFSkpArPNJxFX4ZKWAk9NSeRoZaXschn+ULa4xVek= sigs.k8s.io/kube-storage-version-migrator v0.0.6-0.20230721195810-5c8923c5ff96/go.mod h1:EOBQyBowOUsd7U4CJnMHNE0ri+zCXyouGdLwC/jZU+I= -sigs.k8s.io/kustomize/api v0.20.1 h1:iWP1Ydh3/lmldBnH/S5RXgT98vWYMaTUL1ADcr+Sv7I= -sigs.k8s.io/kustomize/api v0.20.1/go.mod h1:t6hUFxO+Ph0VxIk1sKp1WS0dOjbPCtLJ4p8aADLwqjM= -sigs.k8s.io/kustomize/kyaml v0.20.1 h1:PCMnA2mrVbRP3NIB6v9kYCAc38uvFLVs8j/CD567A78= -sigs.k8s.io/kustomize/kyaml v0.20.1/go.mod h1:0EmkQHRUsJxY8Ug9Niig1pUMSCGHxQ5RklbpV/Ri6po= +sigs.k8s.io/kustomize/api v0.21.1 h1:lzqbzvz2CSvsjIUZUBNFKtIMsEw7hVLJp0JeSIVmuJs= +sigs.k8s.io/kustomize/api v0.21.1/go.mod h1:f3wkKByTrgpgltLgySCntrYoq5d3q7aaxveSagwTlwI= +sigs.k8s.io/kustomize/kyaml v0.21.1 h1:IVlbmhC076nf6foyL6Taw4BkrLuEsXUXNpsE+ScX7fI= +sigs.k8s.io/kustomize/kyaml v0.21.1/go.mod h1:hmxADesM3yUN2vbA5z1/YTBnzLJ1dajdqpQonwBL1FQ= sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU= sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= -sigs.k8s.io/structured-merge-diff/v6 v6.3.1 h1:JrhdFMqOd/+3ByqlP2I45kTOZmTRLBUm5pvRjeheg7E= -sigs.k8s.io/structured-merge-diff/v6 v6.3.1/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE= +sigs.k8s.io/structured-merge-diff/v6 v6.4.0 h1:qmp2e3ZfFi1/jJbDGpD4mt3wyp6PE1NfKHCYLqgNQJo= +sigs.k8s.io/structured-merge-diff/v6 v6.4.0/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE= sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs= sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4= diff --git a/hack/app-sre/saas-template.yaml b/hack/app-sre/saas-template.yaml index 74b4c31ea04..7d9159fb3f8 100644 --- a/hack/app-sre/saas-template.yaml +++ b/hack/app-sre/saas-template.yaml @@ -964,6 +964,37 @@ objects: If unset, the default timeout is 30s format: duration type: string + configurationManagement: + description: |- + configurationManagement specifies how OpenShift router should update + the HAProxy configuration. The following values are valid for this + field: + + * "ForkAndReload". + * "Dynamic". + + Omitting this field means that the user has no opinion and the + platform may choose a reasonable default. This default is subject to + change over time. The current default is "ForkAndReload". + + "ForkAndReload" means that OpenShift router should rewrite the + HAProxy configuration file and instruct HAProxy to fork and reload. + This is OpenShift router's traditional approach. + + "Dynamic" means that OpenShift router may use HAProxy's control + socket for some configuration updates and fall back to fork and + reload for other configuration updates. This is a newer approach, + which may be less mature than ForkAndReload. This setting can + improve load-balancing fairness and metrics accuracy and reduce CPU + and memory usage if HAProxy has frequent configuration updates for + route and endpoints updates. + + Note: The "Dynamic" option is currently experimental and should not + be enabled on production clusters. + enum: + - Dynamic + - ForkAndReload + type: string connectTimeout: description: |- connectTimeout defines the maximum time to wait for @@ -1113,6 +1144,9 @@ objects: 'container_memory_working_set_bytes{container="router",namespace="openshift-ingress"}/container_processes{container="router",namespace="openshift-ingress"}'. format: int32 type: integer + x-kubernetes-validations: + - message: maxConnections must be 0, -1, or between 2000 and 2000000 + rule: self == 0 || self == -1 || (self >= 2000 && self <= 2000000) reloadInterval: description: |- reloadInterval defines the minimum interval at which the router is allowed to reload @@ -2749,24 +2783,6 @@ objects: description: enabledCapabilities lists all the capabilities that are currently managed. items: description: ClusterVersionCapability enumerates optional, core cluster components. - enum: - - openshift-samples - - baremetal - - marketplace - - Console - - Insights - - Storage - - CSISnapshot - - NodeTuning - - MachineAPI - - Build - - DeploymentConfig - - ImageRegistry - - OperatorLifecycleManager - - CloudCredential - - Ingress - - CloudControllerManager - - OperatorLifecycleManagerV1 type: string type: array x-kubernetes-list-type: atomic @@ -2774,24 +2790,6 @@ objects: description: knownCapabilities lists all the capabilities known to the current cluster. items: description: ClusterVersionCapability enumerates optional, core cluster components. - enum: - - openshift-samples - - baremetal - - marketplace - - Console - - Insights - - Storage - - CSISnapshot - - NodeTuning - - MachineAPI - - Build - - DeploymentConfig - - ImageRegistry - - OperatorLifecycleManager - - CloudCredential - - Ingress - - CloudControllerManager - - OperatorLifecycleManagerV1 type: string type: array x-kubernetes-list-type: atomic diff --git a/pkg/controller/clusterpool/clusterpool_controller_test.go b/pkg/controller/clusterpool/clusterpool_controller_test.go index fc1a236ffdf..51b1dfe0e3b 100644 --- a/pkg/controller/clusterpool/clusterpool_controller_test.go +++ b/pkg/controller/clusterpool/clusterpool_controller_test.go @@ -3050,7 +3050,11 @@ func TestReconcileRBAC(t *testing.T) { rbs.Items[idx].ResourceVersion = "" } - assert.Equal(t, test.expectedBindings, rbs.Items) + expectedBindings := test.expectedBindings + if expectedBindings == nil { + expectedBindings = []rbacv1.RoleBinding{} + } + assert.Equal(t, expectedBindings, rbs.Items) } else { require.Regexp(t, err, test.expectedErr) } diff --git a/pkg/controller/clusterrelocate/clusterrelocate_controller_test.go b/pkg/controller/clusterrelocate/clusterrelocate_controller_test.go index ff9f66f0ec3..56046c3a137 100644 --- a/pkg/controller/clusterrelocate/clusterrelocate_controller_test.go +++ b/pkg/controller/clusterrelocate/clusterrelocate_controller_test.go @@ -833,7 +833,7 @@ func TestReconcileClusterRelocate_Reconcile_Movement(t *testing.T) { Client: srcClient, logger: logger, remoteClusterAPIClientBuilder: func(secret *corev1.Secret, cn hivev1.ControllerName) remoteclient.Builder { - assert.Equal(t, kubeconfigSecret, secret, "unexpected secret passed to remote client builder") + testassert.AssertEqualWhereItCounts(t, kubeconfigSecret, secret, "unexpected secret passed to remote client builder") return mockRemoteClientBuilder }, } @@ -1191,7 +1191,7 @@ func TestReconcileClusterRelocate_Reconcile_RelocateStatus(t *testing.T) { Client: srcClient, logger: logger, remoteClusterAPIClientBuilder: func(secret *corev1.Secret, cn hivev1.ControllerName) remoteclient.Builder { - assert.Equal(t, kubeconfigSecret, secret, "unexpected secret passed to remote client builder") + testassert.AssertEqualWhereItCounts(t, kubeconfigSecret, secret, "unexpected secret passed to remote client builder") return mockRemoteClientBuilder }, } diff --git a/pkg/controller/dnsendpoint/dnsendpoint_controller_test.go b/pkg/controller/dnsendpoint/dnsendpoint_controller_test.go index 170b3a63aea..983481be61d 100644 --- a/pkg/controller/dnsendpoint/dnsendpoint_controller_test.go +++ b/pkg/controller/dnsendpoint/dnsendpoint_controller_test.go @@ -22,6 +22,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/client-go/rest" + "k8s.io/client-go/tools/events" "k8s.io/client-go/tools/record" "sigs.k8s.io/controller-runtime/pkg/cache" "sigs.k8s.io/controller-runtime/pkg/client" @@ -30,6 +31,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/reconcile" "sigs.k8s.io/controller-runtime/pkg/webhook" + "sigs.k8s.io/controller-runtime/pkg/webhook/conversion" hivev1 "github.com/openshift/hive/apis/hive/v1" "github.com/openshift/hive/pkg/constants" @@ -483,6 +485,8 @@ type fakeManager struct { watchedDomains sets.Set[string] } +var _ manager.Manager = &fakeManager{} + func (fm *fakeManager) Add(mgr manager.Runnable) error { // not implemented @@ -559,6 +563,14 @@ func (*fakeManager) GetHTTPClient() *http.Client { panic("not implemented") } +func (fm *fakeManager) GetConverterRegistry() conversion.Registry { + panic("unimplemented") +} + +func (fm *fakeManager) GetEventRecorder(name string) events.EventRecorder { + panic("unimplemented") +} + func TestMultiCloudDNSSetup(t *testing.T) { cases := []struct { diff --git a/pkg/installmanager/installmanager.go b/pkg/installmanager/installmanager.go index c4829863bf7..f97782b81a3 100644 --- a/pkg/installmanager/installmanager.go +++ b/pkg/installmanager/installmanager.go @@ -1785,7 +1785,7 @@ func waitForProvisioningStage(m *InstallManager) error { if err != nil { return errors.Wrap(err, "could not generate http client for config") } - restClient, err := apiutil.RESTClientForGVK(gvk, false, config, codecs, hc) + restClient, err := apiutil.RESTClientForGVK(gvk, false, false, config, codecs, hc) if err != nil { return errors.Wrap(err, "could not create REST client") } diff --git a/pkg/test/fake/fake.go b/pkg/test/fake/fake.go index 391117621ac..a13a90ea4b3 100644 --- a/pkg/test/fake/fake.go +++ b/pkg/test/fake/fake.go @@ -1,20 +1,143 @@ package fake import ( + "context" "reflect" hivev1 "github.com/openshift/hive/apis/hive/v1" hivecontractsv1alpha1 "github.com/openshift/hive/apis/hivecontracts/v1alpha1" hiveintv1alpha1 "github.com/openshift/hive/apis/hiveinternal/v1alpha1" scheme "github.com/openshift/hive/pkg/util/scheme" + "k8s.io/apimachinery/pkg/runtime" "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/client/apiutil" "sigs.k8s.io/controller-runtime/pkg/client/fake" ) +// clientWithTypeMeta wraps a fake client to preserve TypeMeta (Kind/APIVersion) on objects. +// +// BACKGROUND: In production, the real Kubernetes API server returns objects over the wire with +// TypeMeta populated (Kind and APIVersion fields). The real client-go preserves these fields +// when unmarshaling objects, even though etcd doesn't store them. Production code throughout +// this codebase relies on this behavior - for example, creating OwnerReferences via +// metav1.NewControllerRef(obj, obj.GroupVersionKind()) requires obj.GroupVersionKind() to +// return the correct GVK, which it gets from TypeMeta. +// +// PROBLEM: Starting in controller-runtime v0.24, the fake client intentionally clears TypeMeta +// on structured objects to match etcd storage behavior rather than wire protocol behavior +// (see https://github.com/kubernetes-sigs/controller-runtime/issues/1735). This causes tests +// to fail when production code calls obj.GroupVersionKind() on objects retrieved from the +// fake client, because it returns an empty GVK. +// +// SOLUTION: This wrapper intercepts fake client operations and re-populates TypeMeta using +// apiutil.GVKForObject(), which looks up the GVK from the scheme based on the object's Go type. +// This makes the fake client accurately simulate what production code sees from the real +// Kubernetes client, without requiring changes to production code that works correctly in +// real clusters. +type clientWithTypeMeta struct { + client.Client + scheme *runtime.Scheme +} + +func (c *clientWithTypeMeta) Get(ctx context.Context, key client.ObjectKey, obj client.Object, opts ...client.GetOption) error { + err := c.Client.Get(ctx, key, obj, opts...) + if err == nil { + if gvk, err := apiutil.GVKForObject(obj, c.scheme); err == nil { + obj.GetObjectKind().SetGroupVersionKind(gvk) + } + } + return err +} + +func (c *clientWithTypeMeta) List(ctx context.Context, list client.ObjectList, opts ...client.ListOption) error { + err := c.Client.List(ctx, list, opts...) + if err == nil { + items := reflect.ValueOf(list).Elem().FieldByName("Items") + if items.IsValid() { + for i := 0; i < items.Len(); i++ { + if obj, ok := items.Index(i).Addr().Interface().(client.Object); ok { + if gvk, err := apiutil.GVKForObject(obj, c.scheme); err == nil { + obj.GetObjectKind().SetGroupVersionKind(gvk) + } + } + } + } + } + return err +} + +func (c *clientWithTypeMeta) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error { + err := c.Client.Create(ctx, obj, opts...) + if err == nil { + if gvk, err := apiutil.GVKForObject(obj, c.scheme); err == nil { + obj.GetObjectKind().SetGroupVersionKind(gvk) + } + } + return err +} + +func (c *clientWithTypeMeta) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error { + err := c.Client.Update(ctx, obj, opts...) + if err == nil { + if gvk, err := apiutil.GVKForObject(obj, c.scheme); err == nil { + obj.GetObjectKind().SetGroupVersionKind(gvk) + } + } + return err +} + +func (c *clientWithTypeMeta) Patch(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.PatchOption) error { + err := c.Client.Patch(ctx, obj, patch, opts...) + if err == nil { + if gvk, err := apiutil.GVKForObject(obj, c.scheme); err == nil { + obj.GetObjectKind().SetGroupVersionKind(gvk) + } + } + return err +} + +func (c *clientWithTypeMeta) Status() client.StatusWriter { + return &statusWriterWithTypeMeta{ + StatusWriter: c.Client.Status(), + scheme: c.scheme, + } +} + +type statusWriterWithTypeMeta struct { + client.StatusWriter + scheme *runtime.Scheme +} + +func (s *statusWriterWithTypeMeta) Update(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error { + err := s.StatusWriter.Update(ctx, obj, opts...) + if err == nil { + if gvk, err := apiutil.GVKForObject(obj, s.scheme); err == nil { + obj.GetObjectKind().SetGroupVersionKind(gvk) + } + } + return err +} + +func (s *statusWriterWithTypeMeta) Patch(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.SubResourcePatchOption) error { + err := s.StatusWriter.Patch(ctx, obj, patch, opts...) + if err == nil { + if gvk, err := apiutil.GVKForObject(obj, s.scheme); err == nil { + obj.GetObjectKind().SetGroupVersionKind(gvk) + } + } + return err +} + +// FakeClientBuilder wraps controller-runtime's fake.ClientBuilder to return +// clients that preserve TypeMeta, matching real Kubernetes client behavior. +type FakeClientBuilder struct { + *fake.ClientBuilder + scheme *runtime.Scheme +} + // Wrapper around fake client which registers all necessary types // as Status sub-resource and adds the hive scheme to the client. -func NewFakeClientBuilder() *fake.ClientBuilder { - +func NewFakeClientBuilder() *FakeClientBuilder { scheme := scheme.GetScheme() types_list := scheme.KnownTypes(hivev1.SchemeGroupVersion) types_list2 := scheme.KnownTypes(hivecontractsv1alpha1.SchemeGroupVersion) @@ -41,5 +164,55 @@ func NewFakeClientBuilder() *fake.ClientBuilder { } } - return fake.NewClientBuilder().WithStatusSubresource(subresource_list...).WithScheme(scheme) + return &FakeClientBuilder{ + ClientBuilder: fake.NewClientBuilder().WithStatusSubresource(subresource_list...).WithScheme(scheme), + scheme: scheme, + } +} + +func (b *FakeClientBuilder) WithRuntimeObjects(objs ...runtime.Object) *FakeClientBuilder { + // Ensure TypeMeta is set on all objects before adding them to the fake client + for _, obj := range objs { + if clientObj, ok := obj.(client.Object); ok { + if gvk, err := apiutil.GVKForObject(clientObj, b.scheme); err == nil { + clientObj.GetObjectKind().SetGroupVersionKind(gvk) + } + } + } + b.ClientBuilder = b.ClientBuilder.WithRuntimeObjects(objs...) + return b +} + +func (b *FakeClientBuilder) WithObjects(objs ...client.Object) *FakeClientBuilder { + b.ClientBuilder = b.ClientBuilder.WithObjects(objs...) + return b +} + +func (b *FakeClientBuilder) WithLists(lists ...client.ObjectList) *FakeClientBuilder { + b.ClientBuilder = b.ClientBuilder.WithLists(lists...) + return b +} + +func (b *FakeClientBuilder) WithScheme(scheme *runtime.Scheme) *FakeClientBuilder { + b.ClientBuilder = b.ClientBuilder.WithScheme(scheme) + b.scheme = scheme + return b +} + +func (b *FakeClientBuilder) WithStatusSubresource(objs ...client.Object) *FakeClientBuilder { + b.ClientBuilder = b.ClientBuilder.WithStatusSubresource(objs...) + return b +} + +func (b *FakeClientBuilder) WithIndex(obj client.Object, field string, extractValue client.IndexerFunc) *FakeClientBuilder { + b.ClientBuilder = b.ClientBuilder.WithIndex(obj, field, extractValue) + return b +} + +func (b *FakeClientBuilder) Build() client.Client { + baseClient := b.ClientBuilder.Build() + return &clientWithTypeMeta{ + Client: baseClient, + scheme: b.scheme, + } } diff --git a/pkg/test/manager/mock/manager_generated.go b/pkg/test/manager/mock/manager_generated.go index b844682c097..1a02ebe0c7d 100644 --- a/pkg/test/manager/mock/manager_generated.go +++ b/pkg/test/manager/mock/manager_generated.go @@ -19,6 +19,7 @@ import ( meta "k8s.io/apimachinery/pkg/api/meta" runtime "k8s.io/apimachinery/pkg/runtime" rest "k8s.io/client-go/rest" + events "k8s.io/client-go/tools/events" record "k8s.io/client-go/tools/record" cache "sigs.k8s.io/controller-runtime/pkg/cache" client "sigs.k8s.io/controller-runtime/pkg/client" @@ -26,6 +27,7 @@ import ( healthz "sigs.k8s.io/controller-runtime/pkg/healthz" manager "sigs.k8s.io/controller-runtime/pkg/manager" webhook "sigs.k8s.io/controller-runtime/pkg/webhook" + conversion "sigs.k8s.io/controller-runtime/pkg/webhook/conversion" ) // MockManager is a mock of Manager interface. @@ -192,6 +194,34 @@ func (mr *MockManagerMockRecorder) GetControllerOptions() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetControllerOptions", reflect.TypeOf((*MockManager)(nil).GetControllerOptions)) } +// GetConverterRegistry mocks base method. +func (m *MockManager) GetConverterRegistry() conversion.Registry { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetConverterRegistry") + ret0, _ := ret[0].(conversion.Registry) + return ret0 +} + +// GetConverterRegistry indicates an expected call of GetConverterRegistry. +func (mr *MockManagerMockRecorder) GetConverterRegistry() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetConverterRegistry", reflect.TypeOf((*MockManager)(nil).GetConverterRegistry)) +} + +// GetEventRecorder mocks base method. +func (m *MockManager) GetEventRecorder(name string) events.EventRecorder { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetEventRecorder", name) + ret0, _ := ret[0].(events.EventRecorder) + return ret0 +} + +// GetEventRecorder indicates an expected call of GetEventRecorder. +func (mr *MockManagerMockRecorder) GetEventRecorder(name any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetEventRecorder", reflect.TypeOf((*MockManager)(nil).GetEventRecorder), name) +} + // GetEventRecorderFor mocks base method. func (m *MockManager) GetEventRecorderFor(name string) record.EventRecorder { m.ctrl.T.Helper() diff --git a/test/e2e/postinstall/syncsets/syncsets_suite_test.go b/test/e2e/postinstall/syncsets/syncsets_suite_test.go index 73cbdef9192..876a09ce577 100644 --- a/test/e2e/postinstall/syncsets/syncsets_suite_test.go +++ b/test/e2e/postinstall/syncsets/syncsets_suite_test.go @@ -462,7 +462,7 @@ func waitForSyncSetApplied(namespace, cdName, syncsetname, syncsettype string) e if err != nil { return err } - restClient, err := apiutil.RESTClientForGVK(gvk, false, cfg, serializer.NewCodecFactory(scheme), hc) + restClient, err := apiutil.RESTClientForGVK(gvk, false, false, cfg, serializer.NewCodecFactory(scheme), hc) if err != nil { return err } @@ -517,7 +517,7 @@ func waitForSyncSetDeleted(namespace, syncsetname string) error { if err != nil { return err } - restClient, err := apiutil.RESTClientForGVK(gvk, false, cfg, serializer.NewCodecFactory(scheme), hc) + restClient, err := apiutil.RESTClientForGVK(gvk, false, false, cfg, serializer.NewCodecFactory(scheme), hc) if err != nil { return err } @@ -556,7 +556,7 @@ func waitForSyncSetDisassociated(namespace, cdName, syncsetname, syncsettype str if err != nil { return err } - restClient, err := apiutil.RESTClientForGVK(gvk, false, cfg, serializer.NewCodecFactory(scheme), hc) + restClient, err := apiutil.RESTClientForGVK(gvk, false, false, cfg, serializer.NewCodecFactory(scheme), hc) if err != nil { return err } diff --git a/vendor/cloud.google.com/go/.release-please-manifest-individual.json b/vendor/cloud.google.com/go/.release-please-manifest-individual.json index c33488e447d..158fe0caa8c 100644 --- a/vendor/cloud.google.com/go/.release-please-manifest-individual.json +++ b/vendor/cloud.google.com/go/.release-please-manifest-individual.json @@ -1,18 +1,17 @@ { - "auth": "0.16.4", + "auth": "0.16.5", "auth/oauth2adapt": "0.2.8", - "bigquery": "1.69.0", - "bigquery/v2": "0.0.0", - "bigtable": "1.38.0", + "bigquery": "1.70.0", + "bigtable": "1.39.0", "datastore": "1.20.0", "errorreporting": "0.3.2", "firestore": "1.18.0", "logging": "1.13.0", "profiler": "0.4.3", - "pubsub": "1.50.0", - "pubsub/v2": "2.0.0", + "pubsub": "1.50.1", + "pubsub/v2": "2.0.1", "pubsublite": "1.8.2", - "spanner": "1.84.1", - "storage": "1.56.0", + "spanner": "1.85.1", + "storage": "1.56.1", "vertexai": "0.15.0" } diff --git a/vendor/cloud.google.com/go/.release-please-manifest-submodules.json b/vendor/cloud.google.com/go/.release-please-manifest-submodules.json index bc7be08b2ce..a194f475137 100644 --- a/vendor/cloud.google.com/go/.release-please-manifest-submodules.json +++ b/vendor/cloud.google.com/go/.release-please-manifest-submodules.json @@ -2,14 +2,14 @@ "accessapproval": "1.8.7", "accesscontextmanager": "1.9.6", "advisorynotifications": "1.5.6", - "ai": "0.12.1", - "aiplatform": "1.98.0", + "ai": "0.13.0", + "aiplatform": "1.102.0", "alloydb": "1.18.0", - "analytics": "0.29.0", + "analytics": "0.30.0", "apigateway": "1.7.7", "apigeeconnect": "1.7.7", "apigeeregistry": "0.9.6", - "apihub": "0.1.5", + "apihub": "0.2.0", "apikeys": "1.2.7", "appengine": "1.9.7", "apphub": "0.3.1", @@ -25,109 +25,111 @@ "beyondcorp": "1.1.6", "billing": "1.20.4", "binaryauthorization": "1.9.5", + "capacityplanner": "0.1.0", "certificatemanager": "1.9.5", "channel": "1.20.0", - "chat": "0.15.0", + "chat": "0.15.1", "chronicle": "0.1.1", - "cloudbuild": "1.22.3", + "cloudbuild": "1.23.0", "cloudcontrolspartner": "1.4.0", - "clouddms": "1.8.7", + "clouddms": "1.8.8", "cloudprofiler": "0.4.5", "cloudquotas": "1.4.0", "cloudtasks": "1.13.6", - "commerce": "1.2.5", - "compute": "1.43.0", - "compute/metadata": "0.8.0", - "confidentialcomputing": "1.9.2", - "config": "1.4.0", - "configdelivery": "0.1.0", - "contactcenterinsights": "1.17.3", + "commerce": "1.2.6", + "compute": "1.47.0", + "compute/metadata": "0.8.4", + "confidentialcomputing": "1.10.1", + "config": "1.5.1", + "configdelivery": "0.1.1", + "contactcenterinsights": "1.17.4", "container": "1.44.0", "containeranalysis": "0.14.1", - "datacatalog": "1.26.0", + "datacatalog": "1.26.1", "dataflow": "0.11.0", - "dataform": "0.12.0", - "datafusion": "1.8.6", - "datalabeling": "0.9.6", - "dataplex": "1.26.0", - "dataproc": "2.14.0", + "dataform": "0.12.1", + "datafusion": "1.8.7", + "datalabeling": "0.9.7", + "dataplex": "1.27.1", + "dataproc": "2.14.1", "dataqna": "0.9.7", - "datastream": "1.15.0", - "deploy": "1.27.2", - "developerconnect": "0.4.0", - "devicestreaming": "0.1.0", - "dialogflow": "1.69.0", - "discoveryengine": "1.20.0", - "dlp": "1.24.0", - "documentai": "1.37.0", - "domains": "0.10.6", - "edgecontainer": "1.4.3", - "edgenetwork": "1.2.6", - "essentialcontacts": "1.7.6", - "eventarc": "1.15.5", - "filestore": "1.10.2", - "financialservices": "0.1.3", - "functions": "1.19.6", - "gkebackup": "1.8.0", - "gkeconnect": "0.12.4", - "gkehub": "0.15.6", - "gkemulticloud": "1.5.3", + "datastream": "1.15.1", + "deploy": "1.27.3", + "developerconnect": "0.4.1", + "devicestreaming": "0.1.1", + "dialogflow": "1.69.1", + "discoveryengine": "1.21.1", + "documentai": "1.38.1", + "domains": "0.10.7", + "edgecontainer": "1.4.4", + "edgenetwork": "1.2.7", + "essentialcontacts": "1.7.7", + "eventarc": "1.16.1", + "filestore": "1.10.3", + "financialservices": "0.1.4", + "functions": "1.19.7", + "geminidataanalytics": "0.2.1", + "gkebackup": "1.8.1", + "gkeconnect": "0.12.5", + "gkehub": "0.16.0", + "gkemulticloud": "1.5.4", "grafeas": "0.3.16", - "gsuiteaddons": "1.7.7", + "gsuiteaddons": "1.7.8", "iam": "1.5.2", - "iap": "1.11.2", - "identitytoolkit": "0.2.5", - "ids": "1.5.6", - "iot": "1.8.6", - "kms": "1.22.0", + "iap": "1.11.3", + "identitytoolkit": "0.2.6", + "ids": "1.5.7", + "iot": "1.8.7", + "kms": "1.23.0", "language": "1.14.5", - "licensemanager": "0.1.0", - "lifesciences": "0.10.6", + "licensemanager": "0.1.1", + "lifesciences": "0.10.7", + "locationfinder": "0.1.1", "longrunning": "0.6.7", - "lustre": "0.2.0", - "maintenance": "0.1.1", - "managedidentities": "1.7.6", - "managedkafka": "0.7.0", - "maps": "1.22.0", - "mediatranslation": "0.9.6", - "memcache": "1.11.6", - "memorystore": "0.3.0", - "metastore": "1.14.7", - "migrationcenter": "1.1.5", - "modelarmor": "0.6.0", + "lustre": "0.2.1", + "maintenance": "0.1.2", + "managedidentities": "1.7.7", + "managedkafka": "0.8.1", + "maps": "1.23.0", + "mediatranslation": "0.9.7", + "memcache": "1.11.7", + "memorystore": "0.3.1", + "metastore": "1.14.8", + "migrationcenter": "1.1.6", + "modelarmor": "0.6.1", "monitoring": "1.24.2", - "netapp": "1.9.0", - "networkconnectivity": "1.18.0", - "networkmanagement": "1.20.0", - "networksecurity": "0.10.6", - "networkservices": "0.5.0", - "notebooks": "1.12.6", - "optimization": "1.7.6", - "oracledatabase": "0.5.0", - "orchestration": "1.11.9", - "orgpolicy": "1.15.0", - "osconfig": "1.15.0", - "oslogin": "1.14.6", - "parallelstore": "0.11.3", - "parametermanager": "0.3.0", - "phishingprotection": "0.9.6", - "policysimulator": "0.4.0", - "policytroubleshooter": "1.11.6", - "privatecatalog": "0.10.7", - "privilegedaccessmanager": "0.3.0", + "netapp": "1.10.1", + "networkconnectivity": "1.19.1", + "networkmanagement": "1.20.1", + "networksecurity": "0.10.7", + "networkservices": "0.5.1", + "notebooks": "1.12.7", + "optimization": "1.7.7", + "oracledatabase": "0.5.1", + "orchestration": "1.11.10", + "orgpolicy": "1.15.1", + "osconfig": "1.15.1", + "oslogin": "1.14.7", + "parallelstore": "0.11.4", + "parametermanager": "0.3.1", + "phishingprotection": "0.9.7", + "policysimulator": "0.4.1", + "policytroubleshooter": "1.11.7", + "privatecatalog": "0.10.8", + "privilegedaccessmanager": "0.3.1", "rapidmigrationassessment": "1.1.7", "recaptchaenterprise": "2.20.4", "recommendationengine": "0.9.6", "recommender": "1.13.5", "redis": "1.18.2", "resourcemanager": "1.10.6", - "retail": "1.24.0", + "retail": "1.25.0", "run": "1.12.0", "scheduler": "1.11.7", "secretmanager": "1.15.0", "securesourcemanager": "1.4.0", - "security": "1.19.0", - "securitycenter": "1.37.0", + "security": "1.19.1", + "securitycenter": "1.38.0", "securitycentermanagement": "1.1.5", "securityposture": "0.2.5", "servicecontrol": "1.14.5", @@ -136,7 +138,7 @@ "servicemanagement": "1.10.6", "serviceusage": "1.9.6", "shell": "1.8.6", - "shopping": "0.25.0", + "shopping": "1.1.0", "spanner/benchmarks": "0.1.0", "speech": "1.28.0", "storagebatchoperations": "0.1.0", @@ -146,15 +148,15 @@ "support": "1.4.0", "talent": "1.8.3", "telcoautomation": "1.1.5", - "texttospeech": "1.13.0", + "texttospeech": "1.14.0", "tpu": "1.8.3", "trace": "1.11.6", "translate": "1.12.6", - "video": "1.25.0", + "video": "1.27.0", "videointelligence": "1.12.6", "vision": "2.9.5", "visionai": "0.4.5", - "vmmigration": "1.8.6", + "vmmigration": "1.9.0", "vmwareengine": "1.3.5", "vpcaccess": "1.8.6", "webrisk": "1.11.1", diff --git a/vendor/cloud.google.com/go/.release-please-manifest.json b/vendor/cloud.google.com/go/.release-please-manifest.json index cabed7484ae..768a5b8e617 100644 --- a/vendor/cloud.google.com/go/.release-please-manifest.json +++ b/vendor/cloud.google.com/go/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.121.6" + ".": "0.123.0" } diff --git a/vendor/cloud.google.com/go/CHANGES.md b/vendor/cloud.google.com/go/CHANGES.md index e2dd1de9b4d..a63b40267f8 100644 --- a/vendor/cloud.google.com/go/CHANGES.md +++ b/vendor/cloud.google.com/go/CHANGES.md @@ -2,6 +2,40 @@ +## [0.123.0](https://github.com/googleapis/google-cloud-go/compare/v0.122.0...v0.123.0) (2025-09-18) + + +### Features + +* **internal/stategen:** Populate the latest googleapis commit ([#12880](https://github.com/googleapis/google-cloud-go/issues/12880)) ([7b017a0](https://github.com/googleapis/google-cloud-go/commit/7b017a083ddd322b21faf413a329ba870a98db96)) +* **librariangen:** Implement the build command ([#12817](https://github.com/googleapis/google-cloud-go/issues/12817)) ([14734c8](https://github.com/googleapis/google-cloud-go/commit/14734c875103f97748857b9b0472fd0b2658663f)) + + +### Bug Fixes + +* **internal/librariangen:** Add link to source commit in release notes ([#12881](https://github.com/googleapis/google-cloud-go/issues/12881)) ([1c06cc6](https://github.com/googleapis/google-cloud-go/commit/1c06cc6109a84941c367896575b187b79befc3af)) +* **internal/librariangen:** Fix CHANGES.md headers ([#12849](https://github.com/googleapis/google-cloud-go/issues/12849)) ([baf515d](https://github.com/googleapis/google-cloud-go/commit/baf515dfe0d94f36c9dc232f6b55e9828b268eb0)) +* **internal/librariangen:** Remove go mod init/tidy from postprocessor ([#12832](https://github.com/googleapis/google-cloud-go/issues/12832)) ([1fe506a](https://github.com/googleapis/google-cloud-go/commit/1fe506a37e68497b6da4587d409b79e7b4d2a113)) +* **internal/librariangen:** Test for error path with flags ([#12830](https://github.com/googleapis/google-cloud-go/issues/12830)) ([f0da7b2](https://github.com/googleapis/google-cloud-go/commit/f0da7b22488b4d9f6232d227d3e196d8d2b92858)) +* **internal/postprocessor:** Add dlp to skip-module-scan-paths ([#12857](https://github.com/googleapis/google-cloud-go/issues/12857)) ([45a7d9b](https://github.com/googleapis/google-cloud-go/commit/45a7d9b4b9083d1bcaca89c3d86878ba77c230e3)) +* **librariangen:** Honor original container contract ([#12846](https://github.com/googleapis/google-cloud-go/issues/12846)) ([71c8fd3](https://github.com/googleapis/google-cloud-go/commit/71c8fd368667f74426aa31b6c50def8151482480)) +* **librariangen:** Improvements to release-init ([#12842](https://github.com/googleapis/google-cloud-go/issues/12842)) ([0db677a](https://github.com/googleapis/google-cloud-go/commit/0db677a93fe16b9a62bb69a3cea7bc45d5aaec36)) +* **stategen:** Specify an appropriate tag format for google-cloud-go ([#12835](https://github.com/googleapis/google-cloud-go/issues/12835)) ([ffcff33](https://github.com/googleapis/google-cloud-go/commit/ffcff33a0c3fad720a31083672c4cf2498af719f)) + +## [0.122.0](https://github.com/googleapis/google-cloud-go/compare/v0.121.6...v0.122.0) (2025-09-04) + + +### Features + +* **internal/librariangen:** Add release-init command ([#12751](https://github.com/googleapis/google-cloud-go/issues/12751)) ([52e84cc](https://github.com/googleapis/google-cloud-go/commit/52e84cc9a11077eb3c50a0b5fc9aa26361d63b47)) + + +### Bug Fixes + +* **internal/godocfx:** Better support for v2 modules ([#12797](https://github.com/googleapis/google-cloud-go/issues/12797)) ([4bc8785](https://github.com/googleapis/google-cloud-go/commit/4bc878597a5e6bd97cf3ee2174f6df7fbdd2d47b)) +* **internal/godocfx:** Module detection when tidy errors ([#12801](https://github.com/googleapis/google-cloud-go/issues/12801)) ([83d46cd](https://github.com/googleapis/google-cloud-go/commit/83d46cdc5ed7cfbb94038e7fa1f787adfe532c74)) +* **internal/librariangen:** Fix goimports errors ([#12765](https://github.com/googleapis/google-cloud-go/issues/12765)) ([83bdaa4](https://github.com/googleapis/google-cloud-go/commit/83bdaa4ce4e42f8b4a29e2055fc4894d8c6b1e2c)) + ## [0.121.6](https://github.com/googleapis/google-cloud-go/compare/v0.121.5...v0.121.6) (2025-08-14) diff --git a/vendor/cloud.google.com/go/README.md b/vendor/cloud.google.com/go/README.md index 98d47fa2c43..5fd6ff388c5 100644 --- a/vendor/cloud.google.com/go/README.md +++ b/vendor/cloud.google.com/go/README.md @@ -24,8 +24,8 @@ Our libraries are compatible with the two most recent major Go releases, the same [policy](https://go.dev/doc/devel/release#policy) the Go programming language follows. This means the currently supported versions are: -- Go 1.23 - Go 1.24 +- Go 1.25 ## Authentication diff --git a/vendor/cloud.google.com/go/auth/CHANGES.md b/vendor/cloud.google.com/go/auth/CHANGES.md index 4deca443534..b48828c1504 100644 --- a/vendor/cloud.google.com/go/auth/CHANGES.md +++ b/vendor/cloud.google.com/go/auth/CHANGES.md @@ -1,3 +1,20 @@ +# Changes + +## [0.18.1](https://github.com/googleapis/google-cloud-go/releases/tag/auth%2Fv0.18.1) (2026-01-21) + +### Bug Fixes + +* add InternalOptions.TelemetryAttributes for internal client use (#13641) ([3876978](https://github.com/googleapis/google-cloud-go/commit/38769789755ed47d85e85dcd56596109de65f780)) +* remove singleton and restore normal usage of otelgrpc.clientHandler (#13522) ([673d4b0](https://github.com/googleapis/google-cloud-go/commit/673d4b05617f833aa433f7f6a350b5cb888ea20d)) + +## [0.18.0](https://github.com/googleapis/google-cloud-go/releases/tag/auth%2Fv0.18.0) (2025-12-15) + +### Features + +* Support scopes field from impersonated credential json (#13308) ([e3f62e1](https://github.com/googleapis/google-cloud-go/commit/e3f62e102840127a0058f5cced4c9738f2bf45f2)) +* add support for parsing EC private key (#13317) ([ea6bc62](https://github.com/googleapis/google-cloud-go/commit/ea6bc62ffe2cc0a6d607d698a181b37fa46c340d)) +* deprecate unsafe credentials JSON loading options (#13397) ([0dd2a3b](https://github.com/googleapis/google-cloud-go/commit/0dd2a3bdece9a85ee7216a737559fa9f5a869545)) + ## [0.17.0](https://github.com/googleapis/google-cloud-go/releases/tag/auth%2Fv0.17.0) (2025-10-02) ### Features @@ -5,8 +22,6 @@ * Add trust boundary support for service accounts and impersonation (HTTP/gRPC) (#11870) ([5c2b665](https://github.com/googleapis/google-cloud-go/commit/5c2b665f392e6dd90192f107188720aa1357e7da)) * add trust boundary support for external accounts (#12864) ([a67a146](https://github.com/googleapis/google-cloud-go/commit/a67a146a6a88a6f1ba10c409dfce8015ecd60a64)) -# Changelog - ## [0.16.5](https://github.com/googleapis/google-cloud-go/compare/auth/v0.16.4...auth/v0.16.5) (2025-08-14) diff --git a/vendor/cloud.google.com/go/auth/credentials/detect.go b/vendor/cloud.google.com/go/auth/credentials/detect.go index 6700e33e148..c9d7600e037 100644 --- a/vendor/cloud.google.com/go/auth/credentials/detect.go +++ b/vendor/cloud.google.com/go/auth/credentials/detect.go @@ -52,6 +52,44 @@ var ( allowOnGCECheck = true ) +// CredType specifies the type of JSON credentials being provided +// to a loading function such as [NewCredentialsFromFile] or +// [NewCredentialsFromJSON]. +type CredType string + +const ( + // ServiceAccount represents a service account file type. + ServiceAccount CredType = "service_account" + // AuthorizedUser represents a user credentials file type. + AuthorizedUser CredType = "authorized_user" + // ExternalAccount represents an external account file type. + // + // IMPORTANT: + // This credential type does not validate the credential configuration. A security + // risk occurs when a credential configuration configured with malicious urls + // is used. + // You should validate credential configurations provided by untrusted sources. + // See [Security requirements when using credential configurations from an external + // source] https://cloud.google.com/docs/authentication/external/externally-sourced-credentials + // for more details. + ExternalAccount CredType = "external_account" + // ImpersonatedServiceAccount represents an impersonated service account file type. + // + // IMPORTANT: + // This credential type does not validate the credential configuration. A security + // risk occurs when a credential configuration configured with malicious urls + // is used. + // You should validate credential configurations provided by untrusted sources. + // See [Security requirements when using credential configurations from an external + // source] https://cloud.google.com/docs/authentication/external/externally-sourced-credentials + // for more details. + ImpersonatedServiceAccount CredType = "impersonated_service_account" + // GDCHServiceAccount represents a GDCH service account credentials. + GDCHServiceAccount CredType = "gdch_service_account" + // ExternalAccountAuthorizedUser represents an external account authorized user credentials. + ExternalAccountAuthorizedUser CredType = "external_account_authorized_user" +) + // TokenBindingType specifies the type of binding used when requesting a token // whether to request a hard-bound token using mTLS or an instance identity // bound token using ALTS. @@ -92,6 +130,14 @@ func OnGCE() bool { // - On Google Compute Engine, Google App Engine standard second generation // runtimes, and Google App Engine flexible environment, it fetches // credentials from the metadata server. +// +// Important: If you accept a credential configuration (credential +// JSON/File/Stream) from an external source for authentication to Google +// Cloud Platform, you must validate it before providing it to any Google +// API or library. Providing an unvalidated credential configuration to +// Google APIs can compromise the security of your systems and data. For +// more information, refer to [Validate credential configurations from +// external sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). func DetectDefault(opts *DetectOptions) (*auth.Credentials, error) { if err := opts.validate(); err != nil { return nil, err @@ -189,25 +235,61 @@ type DetectOptions struct { // from the provided filepath. If provided, CredentialsJSON must not be. // Optional. // - // Important: If you accept a credential configuration (credential - // JSON/File/Stream) from an external source for authentication to Google - // Cloud Platform, you must validate it before providing it to any Google - // API or library. Providing an unvalidated credential configuration to - // Google APIs can compromise the security of your systems and data. For - // more information, refer to [Validate credential configurations from - // external sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + // Deprecated: This field is deprecated because of a potential security risk. + // It does not validate the credential configuration. The security risk occurs + // when a credential configuration is accepted from a source that is not + // under your control and used without validation on your side. + // + // If you know that you will be loading credential configurations of a + // specific type, it is recommended to use a credential-type-specific + // NewCredentialsFromFile method. This will ensure that an unexpected + // credential type with potential for malicious intent is not loaded + // unintentionally. You might still have to do validation for certain + // credential types. Please follow the recommendation for that method. For + // example, if you want to load only service accounts, you can use + // + // creds, err := credentials.NewCredentialsFromFile(ctx, credentials.ServiceAccount, filename, opts) + // + // If you are loading your credential configuration from an untrusted source + // and have not mitigated the risks (e.g. by validating the configuration + // yourself), make these changes as soon as possible to prevent security + // risks to your environment. + // + // Regardless of the method used, it is always your responsibility to + // validate configurations received from external sources. + // + // For more details see: + // https://cloud.google.com/docs/authentication/external/externally-sourced-credentials CredentialsFile string // CredentialsJSON overrides detection logic and uses the JSON bytes as the // source for the credential. If provided, CredentialsFile must not be. // Optional. // - // Important: If you accept a credential configuration (credential - // JSON/File/Stream) from an external source for authentication to Google - // Cloud Platform, you must validate it before providing it to any Google - // API or library. Providing an unvalidated credential configuration to - // Google APIs can compromise the security of your systems and data. For - // more information, refer to [Validate credential configurations from - // external sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + // Deprecated: This field is deprecated because of a potential security risk. + // It does not validate the credential configuration. The security risk occurs + // when a credential configuration is accepted from a source that is not + // under your control and used without validation on your side. + // + // If you know that you will be loading credential configurations of a + // specific type, it is recommended to use a credential-type-specific + // NewCredentialsFromJSON method. This will ensure that an unexpected + // credential type with potential for malicious intent is not loaded + // unintentionally. You might still have to do validation for certain + // credential types. Please follow the recommendation for that method. For + // example, if you want to load only service accounts, you can use + // + // creds, err := credentials.NewCredentialsFromJSON(ctx, credentials.ServiceAccount, json, opts) + // + // If you are loading your credential configuration from an untrusted source + // and have not mitigated the risks (e.g. by validating the configuration + // yourself), make these changes as soon as possible to prevent security + // risks to your environment. + // + // Regardless of the method used, it is always your responsibility to + // validate configurations received from external sources. + // + // For more details see: + // https://cloud.google.com/docs/authentication/external/externally-sourced-credentials CredentialsJSON []byte // UseSelfSignedJWT directs service account based credentials to create a // self-signed JWT with the private key found in the file, skipping any @@ -227,6 +309,61 @@ type DetectOptions struct { Logger *slog.Logger } +// NewCredentialsFromFile creates a [cloud.google.com/go/auth.Credentials] from +// the provided file. The credType argument specifies the expected credential +// type. If the file content does not match the expected type, an error is +// returned. +// +// Important: If you accept a credential configuration (credential +// JSON/File/Stream) from an external source for authentication to Google +// Cloud Platform, you must validate it before providing it to any Google +// API or library. Providing an unvalidated credential configuration to +// Google APIs can compromise the security of your systems and data. For +// more information, refer to [Validate credential configurations from +// external sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). +func NewCredentialsFromFile(credType CredType, filename string, opts *DetectOptions) (*auth.Credentials, error) { + b, err := os.ReadFile(filename) + if err != nil { + return nil, err + } + return NewCredentialsFromJSON(credType, b, opts) +} + +// NewCredentialsFromJSON creates a [cloud.google.com/go/auth.Credentials] from +// the provided JSON bytes. The credType argument specifies the expected +// credential type. If the JSON does not match the expected type, an error is +// returned. +// +// Important: If you accept a credential configuration (credential +// JSON/File/Stream) from an external source for authentication to Google +// Cloud Platform, you must validate it before providing it to any Google +// API or library. Providing an unvalidated credential configuration to +// Google APIs can compromise the security of your systems and data. For +// more information, refer to [Validate credential configurations from +// external sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). +func NewCredentialsFromJSON(credType CredType, b []byte, opts *DetectOptions) (*auth.Credentials, error) { + if err := checkCredentialType(b, credType); err != nil { + return nil, err + } + // We can't use readCredentialsFileJSON because it does auto-detection + // for client_credentials.json which we don't support here (no type field). + // Instead, we call fileCredentials just as readCredentialsFileJSON does + // when it doesn't detect client_credentials.json. + return fileCredentials(b, opts) +} + +func checkCredentialType(b []byte, expected CredType) error { + + fileType, err := credsfile.ParseFileType(b) + if err != nil { + return err + } + if CredType(fileType) != expected { + return fmt.Errorf("credentials: expected type %q, found %q", expected, fileType) + } + return nil +} + func (o *DetectOptions) validate() error { if o == nil { return errors.New("credentials: options must be provided") diff --git a/vendor/cloud.google.com/go/auth/credentials/filetypes.go b/vendor/cloud.google.com/go/auth/credentials/filetypes.go index d2a04247023..f3737a5e8cc 100644 --- a/vendor/cloud.google.com/go/auth/credentials/filetypes.go +++ b/vendor/cloud.google.com/go/auth/credentials/filetypes.go @@ -28,18 +28,21 @@ import ( "cloud.google.com/go/auth/internal/trustboundary" ) +const cloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" + func fileCredentials(b []byte, opts *DetectOptions) (*auth.Credentials, error) { fileType, err := credsfile.ParseFileType(b) if err != nil { return nil, err } + if fileType == "" { + return nil, errors.New("credentials: unsupported unidentified file type") + } var projectID, universeDomain string var tp auth.TokenProvider - switch fileType { - case credsfile.UnknownCredType: - return nil, errors.New("credentials: unsupported unidentified file type") - case credsfile.ServiceAccountKey: + switch CredType(fileType) { + case ServiceAccount: f, err := credsfile.ParseServiceAccount(b) if err != nil { return nil, err @@ -50,7 +53,7 @@ func fileCredentials(b []byte, opts *DetectOptions) (*auth.Credentials, error) { } projectID = f.ProjectID universeDomain = resolveUniverseDomain(opts.UniverseDomain, f.UniverseDomain) - case credsfile.UserCredentialsKey: + case AuthorizedUser: f, err := credsfile.ParseUserCredentials(b) if err != nil { return nil, err @@ -60,7 +63,7 @@ func fileCredentials(b []byte, opts *DetectOptions) (*auth.Credentials, error) { return nil, err } universeDomain = f.UniverseDomain - case credsfile.ExternalAccountKey: + case ExternalAccount: f, err := credsfile.ParseExternalAccount(b) if err != nil { return nil, err @@ -70,7 +73,7 @@ func fileCredentials(b []byte, opts *DetectOptions) (*auth.Credentials, error) { return nil, err } universeDomain = resolveUniverseDomain(opts.UniverseDomain, f.UniverseDomain) - case credsfile.ExternalAccountAuthorizedUserKey: + case ExternalAccountAuthorizedUser: f, err := credsfile.ParseExternalAccountAuthorizedUser(b) if err != nil { return nil, err @@ -80,7 +83,7 @@ func fileCredentials(b []byte, opts *DetectOptions) (*auth.Credentials, error) { return nil, err } universeDomain = f.UniverseDomain - case credsfile.ImpersonatedServiceAccountKey: + case ImpersonatedServiceAccount: f, err := credsfile.ParseImpersonatedServiceAccount(b) if err != nil { return nil, err @@ -90,7 +93,7 @@ func fileCredentials(b []byte, opts *DetectOptions) (*auth.Credentials, error) { return nil, err } universeDomain = resolveUniverseDomain(opts.UniverseDomain, f.UniverseDomain) - case credsfile.GDCHServiceAccountKey: + case GDCHServiceAccount: f, err := credsfile.ParseGDCHServiceAccount(b) if err != nil { return nil, err @@ -275,14 +278,24 @@ func handleImpersonatedServiceAccount(f *credsfile.ImpersonatedServiceAccountFil return nil, errors.New("missing 'source_credentials' field or 'service_account_impersonation_url' in credentials") } - sourceTP, err := fileCredentials(f.CredSource, opts) + sourceOpts := *opts + + // Source credential needs IAM or Cloud Platform scope to call the + // iamcredentials endpoint. The scopes provided by the user are for the + // impersonated credentials. + sourceOpts.Scopes = []string{cloudPlatformScope} + sourceTP, err := fileCredentials(f.CredSource, &sourceOpts) if err != nil { return nil, err } ud := resolveUniverseDomain(opts.UniverseDomain, f.UniverseDomain) + scopes := opts.scopes() + if len(scopes) == 0 { + scopes = f.Scopes + } impOpts := &impersonate.Options{ URL: f.ServiceAccountImpersonationURL, - Scopes: opts.scopes(), + Scopes: scopes, Tp: sourceTP, Delegates: f.Delegates, Client: opts.client(), diff --git a/vendor/cloud.google.com/go/auth/grpctransport/grpctransport.go b/vendor/cloud.google.com/go/auth/grpctransport/grpctransport.go index 6bcd3ef5459..9b4b1f06e88 100644 --- a/vendor/cloud.google.com/go/auth/grpctransport/grpctransport.go +++ b/vendor/cloud.google.com/go/auth/grpctransport/grpctransport.go @@ -24,7 +24,6 @@ import ( "log/slog" "net/http" "os" - "sync" "cloud.google.com/go/auth" "cloud.google.com/go/auth/credentials" @@ -36,7 +35,6 @@ import ( "google.golang.org/grpc" grpccreds "google.golang.org/grpc/credentials" grpcinsecure "google.golang.org/grpc/credentials/insecure" - "google.golang.org/grpc/stats" ) const ( @@ -54,27 +52,6 @@ var ( timeoutDialerOption grpc.DialOption ) -// otelStatsHandler is a singleton otelgrpc.clientHandler to be used across -// all dial connections to avoid the memory leak documented in -// https://github.com/open-telemetry/opentelemetry-go-contrib/issues/4226 -// -// TODO: When this module depends on a version of otelgrpc containing the fix, -// replace this singleton with inline usage for simplicity. -// The fix should be in https://github.com/open-telemetry/opentelemetry-go/pull/5797. -var ( - initOtelStatsHandlerOnce sync.Once - otelStatsHandler stats.Handler -) - -// otelGRPCStatsHandler returns singleton otelStatsHandler for reuse across all -// dial connections. -func otelGRPCStatsHandler() stats.Handler { - initOtelStatsHandlerOnce.Do(func() { - otelStatsHandler = otelgrpc.NewClientHandler() - }) - return otelStatsHandler -} - // ClientCertProvider is a function that returns a TLS client certificate to be // used when opening TLS connections. It follows the same semantics as // [crypto/tls.Config.GetClientCertificate]. @@ -223,6 +200,15 @@ type InternalOptions struct { // SkipValidation bypasses validation on Options. It should only be used // internally for clients that needs more control over their transport. SkipValidation bool + // TelemetryAttributes specifies a map of telemetry attributes to be added + // to all OpenTelemetry signals, such as tracing and metrics, for purposes + // including representing the static identity of the client (e.g., service + // name, version). These attributes are expected to be consistent across all + // signals to enable cross-signal correlation. + // + // It should only be used internally by generated clients. Callers should not + // modify the map after it is passed in. + TelemetryAttributes map[string]string } // Dial returns a GRPCClientConnPool that can be used to communicate with a @@ -444,5 +430,5 @@ func addOpenTelemetryStatsHandler(dialOpts []grpc.DialOption, opts *Options) []g if opts.DisableTelemetry { return dialOpts } - return append(dialOpts, grpc.WithStatsHandler(otelGRPCStatsHandler())) + return append(dialOpts, grpc.WithStatsHandler(otelgrpc.NewClientHandler())) } diff --git a/vendor/cloud.google.com/go/auth/httptransport/httptransport.go b/vendor/cloud.google.com/go/auth/httptransport/httptransport.go index c9126535d72..bd693907f94 100644 --- a/vendor/cloud.google.com/go/auth/httptransport/httptransport.go +++ b/vendor/cloud.google.com/go/auth/httptransport/httptransport.go @@ -168,6 +168,15 @@ type InternalOptions struct { // for the credentials. It should only be used internally for clients that // need more control over their transport. The default is false. SkipUniverseDomainValidation bool + // TelemetryAttributes specifies a map of telemetry attributes to be added + // to all OpenTelemetry signals, such as tracing and metrics, for purposes + // including representing the static identity of the client (e.g., service + // name, version). These attributes are expected to be consistent across all + // signals to enable cross-signal correlation. + // + // It should only be used internally by generated clients. Callers should not + // modify the map after it is passed in. + TelemetryAttributes map[string]string } // AddAuthorizationMiddleware adds a middleware to the provided client's diff --git a/vendor/cloud.google.com/go/auth/internal/credsfile/credsfile.go b/vendor/cloud.google.com/go/auth/internal/credsfile/credsfile.go index 9cd4bed61b5..84aab8472a4 100644 --- a/vendor/cloud.google.com/go/auth/internal/credsfile/credsfile.go +++ b/vendor/cloud.google.com/go/auth/internal/credsfile/credsfile.go @@ -32,50 +32,6 @@ const ( userCredsFilename = "application_default_credentials.json" ) -// CredentialType represents different credential filetypes Google credentials -// can be. -type CredentialType int - -const ( - // UnknownCredType is an unidentified file type. - UnknownCredType CredentialType = iota - // UserCredentialsKey represents a user creds file type. - UserCredentialsKey - // ServiceAccountKey represents a service account file type. - ServiceAccountKey - // ImpersonatedServiceAccountKey represents a impersonated service account - // file type. - ImpersonatedServiceAccountKey - // ExternalAccountKey represents a external account file type. - ExternalAccountKey - // GDCHServiceAccountKey represents a GDCH file type. - GDCHServiceAccountKey - // ExternalAccountAuthorizedUserKey represents a external account authorized - // user file type. - ExternalAccountAuthorizedUserKey -) - -// parseCredentialType returns the associated filetype based on the parsed -// typeString provided. -func parseCredentialType(typeString string) CredentialType { - switch typeString { - case "service_account": - return ServiceAccountKey - case "authorized_user": - return UserCredentialsKey - case "impersonated_service_account": - return ImpersonatedServiceAccountKey - case "external_account": - return ExternalAccountKey - case "external_account_authorized_user": - return ExternalAccountAuthorizedUserKey - case "gdch_service_account": - return GDCHServiceAccountKey - default: - return UnknownCredType - } -} - // GetFileNameFromEnv returns the override if provided or detects a filename // from the environment. func GetFileNameFromEnv(override string) string { diff --git a/vendor/cloud.google.com/go/auth/internal/credsfile/filetype.go b/vendor/cloud.google.com/go/auth/internal/credsfile/filetype.go index 606347304cb..cbba2eb977d 100644 --- a/vendor/cloud.google.com/go/auth/internal/credsfile/filetype.go +++ b/vendor/cloud.google.com/go/auth/internal/credsfile/filetype.go @@ -140,6 +140,7 @@ type ImpersonatedServiceAccountFile struct { Type string `json:"type"` ServiceAccountImpersonationURL string `json:"service_account_impersonation_url"` Delegates []string `json:"delegates"` + Scopes []string `json:"scopes"` CredSource json.RawMessage `json:"source_credentials"` UniverseDomain string `json:"universe_domain"` } diff --git a/vendor/cloud.google.com/go/auth/internal/credsfile/parse.go b/vendor/cloud.google.com/go/auth/internal/credsfile/parse.go index a02b9f5df7e..f2cedb731cf 100644 --- a/vendor/cloud.google.com/go/auth/internal/credsfile/parse.go +++ b/vendor/cloud.google.com/go/auth/internal/credsfile/parse.go @@ -89,10 +89,11 @@ type fileTypeChecker struct { } // ParseFileType determines the [CredentialType] based on bytes provided. -func ParseFileType(b []byte) (CredentialType, error) { +// Only returns error for json.Unmarshal. +func ParseFileType(b []byte) (string, error) { var f fileTypeChecker if err := json.Unmarshal(b, &f); err != nil { - return 0, err + return "", err } - return parseCredentialType(f.Type), nil + return f.Type, nil } diff --git a/vendor/cloud.google.com/go/auth/internal/internal.go b/vendor/cloud.google.com/go/auth/internal/internal.go index 72a8a6b7a53..48e9bd9ece5 100644 --- a/vendor/cloud.google.com/go/auth/internal/internal.go +++ b/vendor/cloud.google.com/go/auth/internal/internal.go @@ -88,12 +88,13 @@ func ParseKey(key []byte) (crypto.Signer, error) { key = block.Bytes } var parsedKey crypto.PrivateKey - var err error - parsedKey, err = x509.ParsePKCS8PrivateKey(key) - if err != nil { - parsedKey, err = x509.ParsePKCS1PrivateKey(key) - if err != nil { - return nil, fmt.Errorf("private key should be a PEM or plain PKCS1 or PKCS8: %w", err) + + var errPKCS8, errPKCS1, errEC error + if parsedKey, errPKCS8 = x509.ParsePKCS8PrivateKey(key); errPKCS8 != nil { + if parsedKey, errPKCS1 = x509.ParsePKCS1PrivateKey(key); errPKCS1 != nil { + if parsedKey, errEC = x509.ParseECPrivateKey(key); errEC != nil { + return nil, fmt.Errorf("failed to parse private key. Tried PKCS8, PKCS1, and EC formats. Errors: [PKCS8: %v], [PKCS1: %v], [EC: %v]", errPKCS8, errPKCS1, errEC) + } } } parsed, ok := parsedKey.(crypto.Signer) diff --git a/vendor/cloud.google.com/go/auth/internal/version.go b/vendor/cloud.google.com/go/auth/internal/version.go index e2f56cf4d81..ec7f21a8a5c 100644 --- a/vendor/cloud.google.com/go/auth/internal/version.go +++ b/vendor/cloud.google.com/go/auth/internal/version.go @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,4 +17,4 @@ package internal // Version is the current tagged release of the library. -const Version = "0.17.0" +const Version = "0.18.1" diff --git a/vendor/cloud.google.com/go/go.work b/vendor/cloud.google.com/go/go.work index 474027f3945..fc77cf320fb 100644 --- a/vendor/cloud.google.com/go/go.work +++ b/vendor/cloud.google.com/go/go.work @@ -1,4 +1,4 @@ -go 1.23.0 +go 1.24.0 use ( . @@ -33,6 +33,7 @@ use ( ./bigtable ./billing ./binaryauthorization + ./capacityplanner ./certificatemanager ./channel ./chat @@ -79,6 +80,7 @@ use ( ./financialservices ./firestore ./functions + ./geminidataanalytics ./gkebackup ./gkeconnect ./gkehub @@ -101,11 +103,13 @@ use ( ./internal/librariangen ./internal/postprocessor ./internal/protoveneer + ./internal/stategen ./iot ./kms ./language ./licensemanager ./lifesciences + ./locationfinder ./logging ./longrunning ./lustre diff --git a/vendor/cloud.google.com/go/go.work.sum b/vendor/cloud.google.com/go/go.work.sum index 0db4a0f9aff..0fff97d259a 100644 --- a/vendor/cloud.google.com/go/go.work.sum +++ b/vendor/cloud.google.com/go/go.work.sum @@ -4,14 +4,19 @@ cloud.google.com/go/dataproc v1.12.0 h1:W47qHL3W4BPkAIbk4SWmIERwsWBaNnWm0P2sdx3Y cloud.google.com/go/gaming v1.9.0 h1:7vEhFnZmd931Mo7sZ6pJy7uQPDxF7m7v8xtBheG08tc= cloud.google.com/go/gaming v1.10.1 h1:5qZmZEWzMf8GEFgm9NeC3bjFRpt7x4S6U7oLbxaf7N8= cloud.google.com/go/resourcesettings v1.8.3 h1:13HOFU7v4cEvIHXSAQbinF4wp2Baybbq7q9FMctg1Ek= +codeberg.org/go-fonts/liberation v0.5.0/go.mod h1:zS/2e1354/mJ4pGzIIaEtm/59VFCFnYC7YV6YdGl5GU= +codeberg.org/go-latex/latex v0.1.0/go.mod h1:LA0q/AyWIYrqVd+A9Upkgsb+IqPcmSTKc9Dny04MHMw= +codeberg.org/go-pdf/fpdf v0.10.0/go.mod h1:Y0DGRAdZ0OmnZPvjbMp/1bYxmIPxm0ws4tfoPOc4LjU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9 h1:VpgP7xuJadIUuKccphEpTJnWhS2jkQyMt6Y7pJCD7fY= gioui.org v0.0.0-20210308172011-57750fc8a0a6 h1:K72hopUosKG3ntOPNG4OzzbuhxGuVf06fa2la1/H/Ho= git.sr.ht/~sbinet/gg v0.3.1 h1:LNhjNn8DerC8f9DHLz6lS0YYul/b602DUxDgGkd/Aik= +git.sr.ht/~sbinet/gg v0.6.0/go.mod h1:uucygbfC9wVPQIfrmwM2et0imr8L7KQWywX0xpFMm94= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc= github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.18.0 h1:ugYJK/neZQtQeh2jc5xNoDFiMQojlAkoqJMRb7vTu1U= github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.18.0/go.mod h1:Xx0VKh7GJ4si3rmElbh19Mejxz68ibWg/J30ZOMrqzU= github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.23.0/go.mod h1:p2puVVSKjQ84Qb1gzw2XHLs34WQyHTYFZLaVxypAFYs= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.29.0/go.mod h1:Cz6ft6Dkn3Et6l2v2a9/RpN7epQ1GtDlO6lj8bEcOvw= github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c h1:RGWPOewvKIROun94nF7v2cua9qP+thov/7M50KEoeSU= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= @@ -60,6 +65,7 @@ github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZ github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= github.com/bwesterb/go-ristretto v1.2.3 h1:1w53tCkGhCQ5djbat3+MH0BAQ5Kfgbt56UZQ/JMzngw= github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= +github.com/campoy/embedmd v1.0.0/go.mod h1:oxyr9RCiSXg0M3VJ3ks0UGfp98BpSSGr0kpiX3MzVl8= github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.4.1 h1:iKLQ0xPNFxR/2hzXZMrBo8f1j86j5WHzznCCQxV/b8g= @@ -87,6 +93,7 @@ github.com/go-fonts/latin-modern v0.2.0 h1:5/Tv1Ek/QCr20C6ZOz15vw3g7GELYL98KWr8H github.com/go-fonts/liberation v0.2.0 h1:jAkAWJP4S+OsrPLZM4/eC9iW7CtHy+HBXrEwZXWo5VM= github.com/go-fonts/stix v0.1.0 h1:UlZlgrvvmT/58o573ot7NFw0vZasZ5I6bcIft/oMdgg= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1 h1:QbL/5oDUmRBzO9/Z7Seo6zf912W/a6Sr4Eu0G/3Jho0= +github.com/go-jose/go-jose/v4 v4.1.1/go.mod h1:BdsZGqgdO3b6tTc6LSE56wcDbMMLuPsw5d4ZD5f94kA= github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81 h1:6zl3BbBhdnMkpSj2YY30qV3gDcVBGtFgVsV3+/i+mKQ= github.com/go-pdf/fpdf v0.6.0 h1:MlgtGIfsdMEEQJr2le6b/HNr1ZlQwxyWr77r2aj2U/8= github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= @@ -96,6 +103,7 @@ github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7a github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.2.1/go.mod h1:hRKAFb8wOxFROYNsT1bqfWnhX+b5MFeJM9r2ZSwg/KY= +github.com/goccmack/gocc v0.0.0-20230228185258-2292f9e40198/go.mod h1:DTh/Y2+NbnOVVoypCCQrovMPDKUGp4yZpSbWg5D0XIM= github.com/goccy/go-yaml v1.11.0 h1:n7Z+zx8S9f9KgzG6KtQKf+kwqXZlLNR2F6018Dgau54= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= @@ -209,26 +217,24 @@ go.opentelemetry.io/otel/sdk/metric v1.27.0/go.mod h1:we7jJVrYN2kh3mVBlswtPU22K0 go.opentelemetry.io/otel/trace v1.23.1/go.mod h1:4IpnpJFwr1mo/6HL8XIPJaE9y0+u1KcVmuW7dwFSVrI= go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= golang.org/x/image v0.0.0-20220302094943-723b81ca9867 h1:TcHcE0vrmgzNH1v3ppjcMGbhG5+9fMuvOmUYwNEF4q4= +golang.org/x/image v0.25.0/go.mod h1:tCAmOEGthTtkalusGp1g3xa2gke8J6c2N565dTyl9Rs= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028 h1:4+4C/Iv2U4fMZBiMCc98MG1In4gJY5YRhtpDNeDeHWs= golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs= golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= -golang.org/x/mod v0.26.0/go.mod h1:/j6NAhSk8iQ723BGAUyoAcn7SlD7s15Dp9Nd/SfeaFQ= golang.org/x/telemetry v0.0.0-20240208230135-b75ee8823808/go.mod h1:KG1lNk5ZFNssSZLrpVb4sMXKMpGwGXOxSG3rnu2gZQQ= golang.org/x/telemetry v0.0.0-20240521205824-bda55230c457 h1:zf5N6UOrA487eEFacMePxjXAJctxKmyjKUsjA11Uzuk= -golang.org/x/telemetry v0.0.0-20250710130107-8d8967aff50b/go.mod h1:4ZwOYna0/zsOKwuR5X/m0QFOJpSZvAxFfkQT+Erd9D4= golang.org/x/telemetry v0.0.0-20250807160809-1a19826ec488/go.mod h1:fGb/2+tgXXjhjHsTNdVEEMZNWA0quBnfrO+AfoDSAKw= golang.org/x/term v0.32.0 h1:DR4lr0TjUs3epypdhTOkMmuF5CDFJ/8pOnbzMZPQ7bg= -golang.org/x/term v0.34.0/go.mod h1:5jC53AEywhIVebHgPVeg0mj8OD3VO9OzclacVrqpaAw= golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= golang.org/x/tools v0.10.0 h1:tvDr/iQoUqNdohiYm0LmmKcBk+q86lb9EprIUFhHHGg= golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0= -golang.org/x/tools v0.35.0/go.mod h1:NKdj5HkL/73byiZSJjqJgKn3ep7KjFkBOkR/Hps3VPw= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0 h1:OE9mWmgKkjJyEmDAAtGMPjXu+YNeGvK9VTSHY6+Qihc= gonum.org/v1/plot v0.10.1 h1:dnifSs43YJuNMDzB7v8wV64O4ABBHReuAVAoBxqBqS4= +gonum.org/v1/plot v0.15.2/go.mod h1:DX+x+DWso3LTha+AdkJEv5Txvi+Tql3KAGkehP0/Ubg= google.golang.org/api v0.174.0/go.mod h1:aC7tB6j0HR1Nl0ni5ghpx6iLasmAX78Zkh/wgxAAjLg= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/genproto v0.0.0-20230725213213-b022f6e96895/go.mod h1:0ggbjUrZYpy1q+ANUS30SEoGZ53cdfwtbuG7Ptgy108= @@ -236,15 +242,21 @@ google.golang.org/genproto/googleapis/api v0.0.0-20230725213213-b022f6e96895/go. google.golang.org/genproto/googleapis/api v0.0.0-20240515191416-fc5f0ca64291/go.mod h1:RGnPtTG7r4i8sPlNyDeikXF99hMM+hN6QMm4ooG9g2g= google.golang.org/genproto/googleapis/api v0.0.0-20240930140551-af27646dc61f/go.mod h1:CLGoBuH1VHxAUXVPP8FfPwPEVJB6lz3URE5mY2SuayE= google.golang.org/genproto/googleapis/api v0.0.0-20250227231956-55c901821b1e h1:nsxey/MfoGzYNduN0NN/+hqP9iiCIYsrVbXb/8hjFM8= +google.golang.org/genproto/googleapis/api v0.0.0-20250707201910-8d1bb00bc6a7/go.mod h1:kXqgZtrWaf6qS3jZOCnCH7WYfrvFjkC51bM8fz3RsCA= +google.golang.org/genproto/googleapis/api v0.0.0-20250826171959-ef028d996bc1/go.mod h1:xUjFWUnWDpZ/C0Gu0qloASKFb6f8/QXiiXhSPFsD668= google.golang.org/genproto/googleapis/bytestream v0.0.0-20231120223509-83a465c0220f/go.mod h1:iIgEblxoG4klcXsG0d9cpoxJ4xndv6+1FkDROCHhPRI= google.golang.org/genproto/googleapis/bytestream v0.0.0-20240102182953-50ed04b92917/go.mod h1:O9TvT7A9NLgdqqF0JJXJ+axpaoYiEb8txGmkvy+AvLc= google.golang.org/genproto/googleapis/bytestream v0.0.0-20240513163218-0867130af1f8/go.mod h1:RCpt0+3mpEDPldc32vXBM8ADXlFL95T8Chxx0nv0/zE= google.golang.org/genproto/googleapis/bytestream v0.0.0-20250115164207-1a7da9e5054f h1:NtrhicUU5+S4TaE5AurusJUYfAo/QB8a+kbIXipuJeI= google.golang.org/genproto/googleapis/bytestream v0.0.0-20250303144028-a0af3efb3deb/go.mod h1:35wIojE/F1ptq1nfNDNjtowabHoMSA2qQs7+smpCO5s= google.golang.org/genproto/googleapis/bytestream v0.0.0-20250603155806-513f23925822 h1:zWFRixYR5QlotL+Uv3YfsPRENIrQFXiGs+iwqel6fOQ= +google.golang.org/genproto/googleapis/bytestream v0.0.0-20250818200422-3122310a409c/go.mod h1:1kGGe25NDrNJYgta9Rp2QLLXWS1FLVMMXNvihbhK0iE= google.golang.org/genproto/googleapis/rpc v0.0.0-20230725213213-b022f6e96895/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250707201910-8d1bb00bc6a7/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= +google.golang.org/grpc v1.75.0/go.mod h1:JtPAzKiq4v1xcAB2hydNlWI2RnF85XXcV0mhKXr2ecQ= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0 h1:rNBFJjBCOgVr9pWD7rs/knKL4FRTKgpZmsRfV214zcA= google.golang.org/grpc/examples v0.0.0-20230224211313-3775f633ce20 h1:MLBCGN1O7GzIx+cBiwfYPwtmZ41U3Mn/cotLJciaArI= +google.golang.org/protobuf v1.36.8/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= honnef.co/go/tools v0.1.3 h1:qTakTkI6ni6LFD5sBwwsdSO+AQqbSIxOauHTTQKZ/7o= lukechampine.com/uint128 v1.3.0 h1:cDdUVfRwDUDovz610ABgFD17nXD4/uDgVHl2sC3+sbo= diff --git a/vendor/cloud.google.com/go/internal/.repo-metadata-full.json b/vendor/cloud.google.com/go/internal/.repo-metadata-full.json index eaa1dab0939..134d3771e97 100644 --- a/vendor/cloud.google.com/go/internal/.repo-metadata-full.json +++ b/vendor/cloud.google.com/go/internal/.repo-metadata-full.json @@ -539,6 +539,16 @@ "release_level": "preview", "library_type": "GAPIC_AUTO" }, + "cloud.google.com/go/bigquery/datapolicies/apiv2": { + "api_shortname": "bigquerydatapolicy", + "distribution_name": "cloud.google.com/go/bigquery/datapolicies/apiv2", + "description": "BigQuery Data Policy API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/bigquery/latest/datapolicies/apiv2", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, "cloud.google.com/go/bigquery/datapolicies/apiv2beta1": { "api_shortname": "bigquerydatapolicy", "distribution_name": "cloud.google.com/go/bigquery/datapolicies/apiv2beta1", @@ -729,6 +739,16 @@ "release_level": "preview", "library_type": "GAPIC_AUTO" }, + "cloud.google.com/go/capacityplanner/apiv1beta": { + "api_shortname": "capacityplanner", + "distribution_name": "cloud.google.com/go/capacityplanner/apiv1beta", + "description": "Capacity Planner API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/capacityplanner/latest/apiv1beta", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, "cloud.google.com/go/certificatemanager/apiv1": { "api_shortname": "certificatemanager", "distribution_name": "cloud.google.com/go/certificatemanager/apiv1", @@ -1259,16 +1279,6 @@ "release_level": "preview", "library_type": "GAPIC_AUTO" }, - "cloud.google.com/go/dlp/apiv2": { - "api_shortname": "dlp", - "distribution_name": "cloud.google.com/go/dlp/apiv2", - "description": "Sensitive Data Protection (DLP)", - "language": "go", - "client_library_type": "generated", - "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/dlp/latest/apiv2", - "release_level": "stable", - "library_type": "GAPIC_AUTO" - }, "cloud.google.com/go/documentai/apiv1": { "api_shortname": "documentai", "distribution_name": "cloud.google.com/go/documentai/apiv1", @@ -1459,6 +1469,16 @@ "release_level": "preview", "library_type": "CORE" }, + "cloud.google.com/go/geminidataanalytics/apiv1beta": { + "api_shortname": "geminidataanalytics", + "distribution_name": "cloud.google.com/go/geminidataanalytics/apiv1beta", + "description": "Data Analytics API with Gemini", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/geminidataanalytics/latest/apiv1beta", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, "cloud.google.com/go/gkebackup/apiv1": { "api_shortname": "gkebackup", "distribution_name": "cloud.google.com/go/gkebackup/apiv1", @@ -1689,6 +1709,16 @@ "release_level": "preview", "library_type": "GAPIC_AUTO" }, + "cloud.google.com/go/locationfinder/apiv1": { + "api_shortname": "cloudlocationfinder", + "distribution_name": "cloud.google.com/go/locationfinder/apiv1", + "description": "Cloud Location Finder API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/locationfinder/latest/apiv1", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, "cloud.google.com/go/logging": { "api_shortname": "logging", "distribution_name": "cloud.google.com/go/logging", diff --git a/vendor/cloud.google.com/go/kms/apiv1/.repo-metadata.json b/vendor/cloud.google.com/go/kms/apiv1/.repo-metadata.json new file mode 100644 index 00000000000..86e5f301666 --- /dev/null +++ b/vendor/cloud.google.com/go/kms/apiv1/.repo-metadata.json @@ -0,0 +1,10 @@ +{ + "api_shortname": "cloudkms", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/kms/latest/apiv1", + "client_library_type": "generated", + "description": "Cloud Key Management Service (KMS) API", + "distribution_name": "cloud.google.com/go/kms/apiv1", + "language": "go", + "library_type": "GAPIC_AUTO", + "release_level": "stable" +} diff --git a/vendor/cloud.google.com/go/kms/apiv1/autokey_admin_client.go b/vendor/cloud.google.com/go/kms/apiv1/autokey_admin_client.go index 93e98452e8f..74578907b59 100644 --- a/vendor/cloud.google.com/go/kms/apiv1/autokey_admin_client.go +++ b/vendor/cloud.google.com/go/kms/apiv1/autokey_admin_client.go @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -66,6 +66,7 @@ func defaultAutokeyAdminGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultAudience("https://cloudkms.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), internaloption.EnableJwtWithScope(), + internaloption.AllowHardBoundTokens("MTLS_S2A"), internaloption.EnableNewAuthLibrary(), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/vendor/cloud.google.com/go/kms/apiv1/autokey_client.go b/vendor/cloud.google.com/go/kms/apiv1/autokey_client.go index 4ba085578b1..867c22a1554 100644 --- a/vendor/cloud.google.com/go/kms/apiv1/autokey_client.go +++ b/vendor/cloud.google.com/go/kms/apiv1/autokey_client.go @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -68,6 +68,7 @@ func defaultAutokeyGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultAudience("https://cloudkms.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), internaloption.EnableJwtWithScope(), + internaloption.AllowHardBoundTokens("MTLS_S2A"), internaloption.EnableNewAuthLibrary(), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/vendor/cloud.google.com/go/kms/apiv1/auxiliary.go b/vendor/cloud.google.com/go/kms/apiv1/auxiliary.go index 36e6bf84c1f..e727a61927e 100644 --- a/vendor/cloud.google.com/go/kms/apiv1/auxiliary.go +++ b/vendor/cloud.google.com/go/kms/apiv1/auxiliary.go @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -91,6 +91,198 @@ func (op *CreateKeyHandleOperation) Name() string { return op.lro.Name() } +// CreateSingleTenantHsmInstanceOperation manages a long-running operation from CreateSingleTenantHsmInstance. +type CreateSingleTenantHsmInstanceOperation struct { + lro *longrunning.Operation + pollPath string +} + +// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. +// +// See documentation of Poll for error-handling information. +func (op *CreateSingleTenantHsmInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*kmspb.SingleTenantHsmInstance, error) { + opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) + var resp kmspb.SingleTenantHsmInstance + if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { + return nil, err + } + return &resp, nil +} + +// Poll fetches the latest state of the long-running operation. +// +// Poll also fetches the latest metadata, which can be retrieved by Metadata. +// +// If Poll fails, the error is returned and op is unmodified. If Poll succeeds and +// the operation has completed with failure, the error is returned and op.Done will return true. +// If Poll succeeds and the operation has completed successfully, +// op.Done will return true, and the response of the operation is returned. +// If Poll succeeds and the operation has not completed, the returned response and error are both nil. +func (op *CreateSingleTenantHsmInstanceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*kmspb.SingleTenantHsmInstance, error) { + opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) + var resp kmspb.SingleTenantHsmInstance + if err := op.lro.Poll(ctx, &resp, opts...); err != nil { + return nil, err + } + if !op.Done() { + return nil, nil + } + return &resp, nil +} + +// Metadata returns metadata associated with the long-running operation. +// Metadata itself does not contact the server, but Poll does. +// To get the latest metadata, call this method after a successful call to Poll. +// If the metadata is not available, the returned metadata and error are both nil. +func (op *CreateSingleTenantHsmInstanceOperation) Metadata() (*kmspb.CreateSingleTenantHsmInstanceMetadata, error) { + var meta kmspb.CreateSingleTenantHsmInstanceMetadata + if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { + return nil, nil + } else if err != nil { + return nil, err + } + return &meta, nil +} + +// Done reports whether the long-running operation has completed. +func (op *CreateSingleTenantHsmInstanceOperation) Done() bool { + return op.lro.Done() +} + +// Name returns the name of the long-running operation. +// The name is assigned by the server and is unique within the service from which the operation is created. +func (op *CreateSingleTenantHsmInstanceOperation) Name() string { + return op.lro.Name() +} + +// CreateSingleTenantHsmInstanceProposalOperation manages a long-running operation from CreateSingleTenantHsmInstanceProposal. +type CreateSingleTenantHsmInstanceProposalOperation struct { + lro *longrunning.Operation + pollPath string +} + +// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. +// +// See documentation of Poll for error-handling information. +func (op *CreateSingleTenantHsmInstanceProposalOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*kmspb.SingleTenantHsmInstanceProposal, error) { + opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) + var resp kmspb.SingleTenantHsmInstanceProposal + if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { + return nil, err + } + return &resp, nil +} + +// Poll fetches the latest state of the long-running operation. +// +// Poll also fetches the latest metadata, which can be retrieved by Metadata. +// +// If Poll fails, the error is returned and op is unmodified. If Poll succeeds and +// the operation has completed with failure, the error is returned and op.Done will return true. +// If Poll succeeds and the operation has completed successfully, +// op.Done will return true, and the response of the operation is returned. +// If Poll succeeds and the operation has not completed, the returned response and error are both nil. +func (op *CreateSingleTenantHsmInstanceProposalOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*kmspb.SingleTenantHsmInstanceProposal, error) { + opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) + var resp kmspb.SingleTenantHsmInstanceProposal + if err := op.lro.Poll(ctx, &resp, opts...); err != nil { + return nil, err + } + if !op.Done() { + return nil, nil + } + return &resp, nil +} + +// Metadata returns metadata associated with the long-running operation. +// Metadata itself does not contact the server, but Poll does. +// To get the latest metadata, call this method after a successful call to Poll. +// If the metadata is not available, the returned metadata and error are both nil. +func (op *CreateSingleTenantHsmInstanceProposalOperation) Metadata() (*kmspb.CreateSingleTenantHsmInstanceProposalMetadata, error) { + var meta kmspb.CreateSingleTenantHsmInstanceProposalMetadata + if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { + return nil, nil + } else if err != nil { + return nil, err + } + return &meta, nil +} + +// Done reports whether the long-running operation has completed. +func (op *CreateSingleTenantHsmInstanceProposalOperation) Done() bool { + return op.lro.Done() +} + +// Name returns the name of the long-running operation. +// The name is assigned by the server and is unique within the service from which the operation is created. +func (op *CreateSingleTenantHsmInstanceProposalOperation) Name() string { + return op.lro.Name() +} + +// ExecuteSingleTenantHsmInstanceProposalOperation manages a long-running operation from ExecuteSingleTenantHsmInstanceProposal. +type ExecuteSingleTenantHsmInstanceProposalOperation struct { + lro *longrunning.Operation + pollPath string +} + +// Wait blocks until the long-running operation is completed, returning the response and any errors encountered. +// +// See documentation of Poll for error-handling information. +func (op *ExecuteSingleTenantHsmInstanceProposalOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*kmspb.ExecuteSingleTenantHsmInstanceProposalResponse, error) { + opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) + var resp kmspb.ExecuteSingleTenantHsmInstanceProposalResponse + if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil { + return nil, err + } + return &resp, nil +} + +// Poll fetches the latest state of the long-running operation. +// +// Poll also fetches the latest metadata, which can be retrieved by Metadata. +// +// If Poll fails, the error is returned and op is unmodified. If Poll succeeds and +// the operation has completed with failure, the error is returned and op.Done will return true. +// If Poll succeeds and the operation has completed successfully, +// op.Done will return true, and the response of the operation is returned. +// If Poll succeeds and the operation has not completed, the returned response and error are both nil. +func (op *ExecuteSingleTenantHsmInstanceProposalOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*kmspb.ExecuteSingleTenantHsmInstanceProposalResponse, error) { + opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...) + var resp kmspb.ExecuteSingleTenantHsmInstanceProposalResponse + if err := op.lro.Poll(ctx, &resp, opts...); err != nil { + return nil, err + } + if !op.Done() { + return nil, nil + } + return &resp, nil +} + +// Metadata returns metadata associated with the long-running operation. +// Metadata itself does not contact the server, but Poll does. +// To get the latest metadata, call this method after a successful call to Poll. +// If the metadata is not available, the returned metadata and error are both nil. +func (op *ExecuteSingleTenantHsmInstanceProposalOperation) Metadata() (*kmspb.ExecuteSingleTenantHsmInstanceProposalMetadata, error) { + var meta kmspb.ExecuteSingleTenantHsmInstanceProposalMetadata + if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata { + return nil, nil + } else if err != nil { + return nil, err + } + return &meta, nil +} + +// Done reports whether the long-running operation has completed. +func (op *ExecuteSingleTenantHsmInstanceProposalOperation) Done() bool { + return op.lro.Done() +} + +// Name returns the name of the long-running operation. +// The name is assigned by the server and is unique within the service from which the operation is created. +func (op *ExecuteSingleTenantHsmInstanceProposalOperation) Name() string { + return op.lro.Name() +} + // CryptoKeyIterator manages a stream of *kmspb.CryptoKey. type CryptoKeyIterator struct { items []*kmspb.CryptoKey @@ -419,3 +611,97 @@ func (it *LocationIterator) takeBuf() interface{} { it.items = nil return b } + +// SingleTenantHsmInstanceIterator manages a stream of *kmspb.SingleTenantHsmInstance. +type SingleTenantHsmInstanceIterator struct { + items []*kmspb.SingleTenantHsmInstance + pageInfo *iterator.PageInfo + nextFunc func() error + + // Response is the raw response for the current page. + // It must be cast to the RPC response type. + // Calling Next() or InternalFetch() updates this value. + Response interface{} + + // InternalFetch is for use by the Google Cloud Libraries only. + // It is not part of the stable interface of this package. + // + // InternalFetch returns results from a single call to the underlying RPC. + // The number of results is no greater than pageSize. + // If there are no more results, nextPageToken is empty and err is nil. + InternalFetch func(pageSize int, pageToken string) (results []*kmspb.SingleTenantHsmInstance, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. +func (it *SingleTenantHsmInstanceIterator) PageInfo() *iterator.PageInfo { + return it.pageInfo +} + +// Next returns the next result. Its second return value is iterator.Done if there are no more +// results. Once Next returns Done, all subsequent calls will return Done. +func (it *SingleTenantHsmInstanceIterator) Next() (*kmspb.SingleTenantHsmInstance, error) { + var item *kmspb.SingleTenantHsmInstance + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *SingleTenantHsmInstanceIterator) bufLen() int { + return len(it.items) +} + +func (it *SingleTenantHsmInstanceIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} + +// SingleTenantHsmInstanceProposalIterator manages a stream of *kmspb.SingleTenantHsmInstanceProposal. +type SingleTenantHsmInstanceProposalIterator struct { + items []*kmspb.SingleTenantHsmInstanceProposal + pageInfo *iterator.PageInfo + nextFunc func() error + + // Response is the raw response for the current page. + // It must be cast to the RPC response type. + // Calling Next() or InternalFetch() updates this value. + Response interface{} + + // InternalFetch is for use by the Google Cloud Libraries only. + // It is not part of the stable interface of this package. + // + // InternalFetch returns results from a single call to the underlying RPC. + // The number of results is no greater than pageSize. + // If there are no more results, nextPageToken is empty and err is nil. + InternalFetch func(pageSize int, pageToken string) (results []*kmspb.SingleTenantHsmInstanceProposal, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details. +func (it *SingleTenantHsmInstanceProposalIterator) PageInfo() *iterator.PageInfo { + return it.pageInfo +} + +// Next returns the next result. Its second return value is iterator.Done if there are no more +// results. Once Next returns Done, all subsequent calls will return Done. +func (it *SingleTenantHsmInstanceProposalIterator) Next() (*kmspb.SingleTenantHsmInstanceProposal, error) { + var item *kmspb.SingleTenantHsmInstanceProposal + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *SingleTenantHsmInstanceProposalIterator) bufLen() int { + return len(it.items) +} + +func (it *SingleTenantHsmInstanceProposalIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} diff --git a/vendor/cloud.google.com/go/kms/apiv1/auxiliary_go123.go b/vendor/cloud.google.com/go/kms/apiv1/auxiliary_go123.go index b8517f3815e..4b3427d62d7 100644 --- a/vendor/cloud.google.com/go/kms/apiv1/auxiliary_go123.go +++ b/vendor/cloud.google.com/go/kms/apiv1/auxiliary_go123.go @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -67,3 +67,15 @@ func (it *KeyRingIterator) All() iter.Seq2[*kmspb.KeyRing, error] { func (it *LocationIterator) All() iter.Seq2[*locationpb.Location, error] { return iterator.RangeAdapter(it.Next) } + +// All returns an iterator. If an error is returned by the iterator, the +// iterator will stop after that iteration. +func (it *SingleTenantHsmInstanceIterator) All() iter.Seq2[*kmspb.SingleTenantHsmInstance, error] { + return iterator.RangeAdapter(it.Next) +} + +// All returns an iterator. If an error is returned by the iterator, the +// iterator will stop after that iteration. +func (it *SingleTenantHsmInstanceProposalIterator) All() iter.Seq2[*kmspb.SingleTenantHsmInstanceProposal, error] { + return iterator.RangeAdapter(it.Next) +} diff --git a/vendor/cloud.google.com/go/kms/apiv1/doc.go b/vendor/cloud.google.com/go/kms/apiv1/doc.go index 7f85be3e6ca..f167b1ff721 100644 --- a/vendor/cloud.google.com/go/kms/apiv1/doc.go +++ b/vendor/cloud.google.com/go/kms/apiv1/doc.go @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/vendor/cloud.google.com/go/kms/apiv1/ekm_client.go b/vendor/cloud.google.com/go/kms/apiv1/ekm_client.go index 0282a7bacb3..142db86bc68 100644 --- a/vendor/cloud.google.com/go/kms/apiv1/ekm_client.go +++ b/vendor/cloud.google.com/go/kms/apiv1/ekm_client.go @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -70,6 +70,7 @@ func defaultEkmGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultAudience("https://cloudkms.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), internaloption.EnableJwtWithScope(), + internaloption.AllowHardBoundTokens("MTLS_S2A"), internaloption.EnableNewAuthLibrary(), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), diff --git a/vendor/cloud.google.com/go/kms/apiv1/gapic_metadata.json b/vendor/cloud.google.com/go/kms/apiv1/gapic_metadata.json index 47b250252cc..79e313dd414 100644 --- a/vendor/cloud.google.com/go/kms/apiv1/gapic_metadata.json +++ b/vendor/cloud.google.com/go/kms/apiv1/gapic_metadata.json @@ -357,6 +357,170 @@ } } }, + "HsmManagement": { + "clients": { + "grpc": { + "libraryClient": "HsmManagementClient", + "rpcs": { + "ApproveSingleTenantHsmInstanceProposal": { + "methods": [ + "ApproveSingleTenantHsmInstanceProposal" + ] + }, + "CreateSingleTenantHsmInstance": { + "methods": [ + "CreateSingleTenantHsmInstance" + ] + }, + "CreateSingleTenantHsmInstanceProposal": { + "methods": [ + "CreateSingleTenantHsmInstanceProposal" + ] + }, + "DeleteSingleTenantHsmInstanceProposal": { + "methods": [ + "DeleteSingleTenantHsmInstanceProposal" + ] + }, + "ExecuteSingleTenantHsmInstanceProposal": { + "methods": [ + "ExecuteSingleTenantHsmInstanceProposal" + ] + }, + "GetIamPolicy": { + "methods": [ + "GetIamPolicy" + ] + }, + "GetLocation": { + "methods": [ + "GetLocation" + ] + }, + "GetOperation": { + "methods": [ + "GetOperation" + ] + }, + "GetSingleTenantHsmInstance": { + "methods": [ + "GetSingleTenantHsmInstance" + ] + }, + "GetSingleTenantHsmInstanceProposal": { + "methods": [ + "GetSingleTenantHsmInstanceProposal" + ] + }, + "ListLocations": { + "methods": [ + "ListLocations" + ] + }, + "ListSingleTenantHsmInstanceProposals": { + "methods": [ + "ListSingleTenantHsmInstanceProposals" + ] + }, + "ListSingleTenantHsmInstances": { + "methods": [ + "ListSingleTenantHsmInstances" + ] + }, + "SetIamPolicy": { + "methods": [ + "SetIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "TestIamPermissions" + ] + } + } + }, + "rest": { + "libraryClient": "HsmManagementClient", + "rpcs": { + "ApproveSingleTenantHsmInstanceProposal": { + "methods": [ + "ApproveSingleTenantHsmInstanceProposal" + ] + }, + "CreateSingleTenantHsmInstance": { + "methods": [ + "CreateSingleTenantHsmInstance" + ] + }, + "CreateSingleTenantHsmInstanceProposal": { + "methods": [ + "CreateSingleTenantHsmInstanceProposal" + ] + }, + "DeleteSingleTenantHsmInstanceProposal": { + "methods": [ + "DeleteSingleTenantHsmInstanceProposal" + ] + }, + "ExecuteSingleTenantHsmInstanceProposal": { + "methods": [ + "ExecuteSingleTenantHsmInstanceProposal" + ] + }, + "GetIamPolicy": { + "methods": [ + "GetIamPolicy" + ] + }, + "GetLocation": { + "methods": [ + "GetLocation" + ] + }, + "GetOperation": { + "methods": [ + "GetOperation" + ] + }, + "GetSingleTenantHsmInstance": { + "methods": [ + "GetSingleTenantHsmInstance" + ] + }, + "GetSingleTenantHsmInstanceProposal": { + "methods": [ + "GetSingleTenantHsmInstanceProposal" + ] + }, + "ListLocations": { + "methods": [ + "ListLocations" + ] + }, + "ListSingleTenantHsmInstanceProposals": { + "methods": [ + "ListSingleTenantHsmInstanceProposals" + ] + }, + "ListSingleTenantHsmInstances": { + "methods": [ + "ListSingleTenantHsmInstances" + ] + }, + "SetIamPolicy": { + "methods": [ + "SetIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "TestIamPermissions" + ] + } + } + } + } + }, "KeyManagementService": { "clients": { "grpc": { @@ -392,6 +556,11 @@ "CreateKeyRing" ] }, + "Decapsulate": { + "methods": [ + "Decapsulate" + ] + }, "Decrypt": { "methods": [ "Decrypt" @@ -567,6 +736,11 @@ "CreateKeyRing" ] }, + "Decapsulate": { + "methods": [ + "Decapsulate" + ] + }, "Decrypt": { "methods": [ "Decrypt" diff --git a/vendor/cloud.google.com/go/kms/apiv1/helpers.go b/vendor/cloud.google.com/go/kms/apiv1/helpers.go index 3d2c4349939..535d7f76a55 100644 --- a/vendor/cloud.google.com/go/kms/apiv1/helpers.go +++ b/vendor/cloud.google.com/go/kms/apiv1/helpers.go @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/vendor/cloud.google.com/go/kms/apiv1/hsm_management_client.go b/vendor/cloud.google.com/go/kms/apiv1/hsm_management_client.go new file mode 100644 index 00000000000..a7d4967da17 --- /dev/null +++ b/vendor/cloud.google.com/go/kms/apiv1/hsm_management_client.go @@ -0,0 +1,2080 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go_gapic. DO NOT EDIT. + +package kms + +import ( + "bytes" + "context" + "fmt" + "log/slog" + "math" + "net/http" + "net/url" + "time" + + iampb "cloud.google.com/go/iam/apiv1/iampb" + kmspb "cloud.google.com/go/kms/apiv1/kmspb" + "cloud.google.com/go/longrunning" + lroauto "cloud.google.com/go/longrunning/autogen" + longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/iterator" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + gtransport "google.golang.org/api/transport/grpc" + httptransport "google.golang.org/api/transport/http" + locationpb "google.golang.org/genproto/googleapis/cloud/location" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/protobuf/encoding/protojson" + "google.golang.org/protobuf/proto" +) + +var newHsmManagementClientHook clientHook + +// HsmManagementCallOptions contains the retry settings for each method of HsmManagementClient. +type HsmManagementCallOptions struct { + ListSingleTenantHsmInstances []gax.CallOption + GetSingleTenantHsmInstance []gax.CallOption + CreateSingleTenantHsmInstance []gax.CallOption + CreateSingleTenantHsmInstanceProposal []gax.CallOption + ApproveSingleTenantHsmInstanceProposal []gax.CallOption + ExecuteSingleTenantHsmInstanceProposal []gax.CallOption + GetSingleTenantHsmInstanceProposal []gax.CallOption + ListSingleTenantHsmInstanceProposals []gax.CallOption + DeleteSingleTenantHsmInstanceProposal []gax.CallOption + GetLocation []gax.CallOption + ListLocations []gax.CallOption + GetIamPolicy []gax.CallOption + SetIamPolicy []gax.CallOption + TestIamPermissions []gax.CallOption + GetOperation []gax.CallOption +} + +func defaultHsmManagementGRPCClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("cloudkms.googleapis.com:443"), + internaloption.WithDefaultEndpointTemplate("cloudkms.UNIVERSE_DOMAIN:443"), + internaloption.WithDefaultMTLSEndpoint("cloudkms.mtls.googleapis.com:443"), + internaloption.WithDefaultUniverseDomain("googleapis.com"), + internaloption.WithDefaultAudience("https://cloudkms.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableJwtWithScope(), + internaloption.AllowHardBoundTokens("MTLS_S2A"), + internaloption.EnableNewAuthLibrary(), + option.WithGRPCDialOption(grpc.WithDefaultCallOptions( + grpc.MaxCallRecvMsgSize(math.MaxInt32))), + } +} + +func defaultHsmManagementCallOptions() *HsmManagementCallOptions { + return &HsmManagementCallOptions{ + ListSingleTenantHsmInstances: []gax.CallOption{ + gax.WithTimeout(60000 * time.Millisecond), + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + codes.DeadlineExceeded, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + GetSingleTenantHsmInstance: []gax.CallOption{ + gax.WithTimeout(60000 * time.Millisecond), + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + codes.DeadlineExceeded, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + CreateSingleTenantHsmInstance: []gax.CallOption{ + gax.WithTimeout(60000 * time.Millisecond), + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + codes.DeadlineExceeded, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + CreateSingleTenantHsmInstanceProposal: []gax.CallOption{ + gax.WithTimeout(60000 * time.Millisecond), + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + codes.DeadlineExceeded, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + ApproveSingleTenantHsmInstanceProposal: []gax.CallOption{ + gax.WithTimeout(60000 * time.Millisecond), + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + codes.DeadlineExceeded, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + ExecuteSingleTenantHsmInstanceProposal: []gax.CallOption{ + gax.WithTimeout(60000 * time.Millisecond), + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + codes.DeadlineExceeded, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + GetSingleTenantHsmInstanceProposal: []gax.CallOption{ + gax.WithTimeout(60000 * time.Millisecond), + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + codes.DeadlineExceeded, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + ListSingleTenantHsmInstanceProposals: []gax.CallOption{ + gax.WithTimeout(60000 * time.Millisecond), + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + codes.DeadlineExceeded, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + DeleteSingleTenantHsmInstanceProposal: []gax.CallOption{ + gax.WithTimeout(60000 * time.Millisecond), + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.Unavailable, + codes.DeadlineExceeded, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }) + }), + }, + GetLocation: []gax.CallOption{}, + ListLocations: []gax.CallOption{}, + GetIamPolicy: []gax.CallOption{}, + SetIamPolicy: []gax.CallOption{}, + TestIamPermissions: []gax.CallOption{}, + GetOperation: []gax.CallOption{}, + } +} + +func defaultHsmManagementRESTCallOptions() *HsmManagementCallOptions { + return &HsmManagementCallOptions{ + ListSingleTenantHsmInstances: []gax.CallOption{ + gax.WithTimeout(60000 * time.Millisecond), + gax.WithRetry(func() gax.Retryer { + return gax.OnHTTPCodes(gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }, + http.StatusServiceUnavailable, + http.StatusGatewayTimeout) + }), + }, + GetSingleTenantHsmInstance: []gax.CallOption{ + gax.WithTimeout(60000 * time.Millisecond), + gax.WithRetry(func() gax.Retryer { + return gax.OnHTTPCodes(gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }, + http.StatusServiceUnavailable, + http.StatusGatewayTimeout) + }), + }, + CreateSingleTenantHsmInstance: []gax.CallOption{ + gax.WithTimeout(60000 * time.Millisecond), + gax.WithRetry(func() gax.Retryer { + return gax.OnHTTPCodes(gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }, + http.StatusServiceUnavailable, + http.StatusGatewayTimeout) + }), + }, + CreateSingleTenantHsmInstanceProposal: []gax.CallOption{ + gax.WithTimeout(60000 * time.Millisecond), + gax.WithRetry(func() gax.Retryer { + return gax.OnHTTPCodes(gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }, + http.StatusServiceUnavailable, + http.StatusGatewayTimeout) + }), + }, + ApproveSingleTenantHsmInstanceProposal: []gax.CallOption{ + gax.WithTimeout(60000 * time.Millisecond), + gax.WithRetry(func() gax.Retryer { + return gax.OnHTTPCodes(gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }, + http.StatusServiceUnavailable, + http.StatusGatewayTimeout) + }), + }, + ExecuteSingleTenantHsmInstanceProposal: []gax.CallOption{ + gax.WithTimeout(60000 * time.Millisecond), + gax.WithRetry(func() gax.Retryer { + return gax.OnHTTPCodes(gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }, + http.StatusServiceUnavailable, + http.StatusGatewayTimeout) + }), + }, + GetSingleTenantHsmInstanceProposal: []gax.CallOption{ + gax.WithTimeout(60000 * time.Millisecond), + gax.WithRetry(func() gax.Retryer { + return gax.OnHTTPCodes(gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }, + http.StatusServiceUnavailable, + http.StatusGatewayTimeout) + }), + }, + ListSingleTenantHsmInstanceProposals: []gax.CallOption{ + gax.WithTimeout(60000 * time.Millisecond), + gax.WithRetry(func() gax.Retryer { + return gax.OnHTTPCodes(gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }, + http.StatusServiceUnavailable, + http.StatusGatewayTimeout) + }), + }, + DeleteSingleTenantHsmInstanceProposal: []gax.CallOption{ + gax.WithTimeout(60000 * time.Millisecond), + gax.WithRetry(func() gax.Retryer { + return gax.OnHTTPCodes(gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 60000 * time.Millisecond, + Multiplier: 1.30, + }, + http.StatusServiceUnavailable, + http.StatusGatewayTimeout) + }), + }, + GetLocation: []gax.CallOption{}, + ListLocations: []gax.CallOption{}, + GetIamPolicy: []gax.CallOption{}, + SetIamPolicy: []gax.CallOption{}, + TestIamPermissions: []gax.CallOption{}, + GetOperation: []gax.CallOption{}, + } +} + +// internalHsmManagementClient is an interface that defines the methods available from Cloud Key Management Service (KMS) API. +type internalHsmManagementClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + ListSingleTenantHsmInstances(context.Context, *kmspb.ListSingleTenantHsmInstancesRequest, ...gax.CallOption) *SingleTenantHsmInstanceIterator + GetSingleTenantHsmInstance(context.Context, *kmspb.GetSingleTenantHsmInstanceRequest, ...gax.CallOption) (*kmspb.SingleTenantHsmInstance, error) + CreateSingleTenantHsmInstance(context.Context, *kmspb.CreateSingleTenantHsmInstanceRequest, ...gax.CallOption) (*CreateSingleTenantHsmInstanceOperation, error) + CreateSingleTenantHsmInstanceOperation(name string) *CreateSingleTenantHsmInstanceOperation + CreateSingleTenantHsmInstanceProposal(context.Context, *kmspb.CreateSingleTenantHsmInstanceProposalRequest, ...gax.CallOption) (*CreateSingleTenantHsmInstanceProposalOperation, error) + CreateSingleTenantHsmInstanceProposalOperation(name string) *CreateSingleTenantHsmInstanceProposalOperation + ApproveSingleTenantHsmInstanceProposal(context.Context, *kmspb.ApproveSingleTenantHsmInstanceProposalRequest, ...gax.CallOption) (*kmspb.ApproveSingleTenantHsmInstanceProposalResponse, error) + ExecuteSingleTenantHsmInstanceProposal(context.Context, *kmspb.ExecuteSingleTenantHsmInstanceProposalRequest, ...gax.CallOption) (*ExecuteSingleTenantHsmInstanceProposalOperation, error) + ExecuteSingleTenantHsmInstanceProposalOperation(name string) *ExecuteSingleTenantHsmInstanceProposalOperation + GetSingleTenantHsmInstanceProposal(context.Context, *kmspb.GetSingleTenantHsmInstanceProposalRequest, ...gax.CallOption) (*kmspb.SingleTenantHsmInstanceProposal, error) + ListSingleTenantHsmInstanceProposals(context.Context, *kmspb.ListSingleTenantHsmInstanceProposalsRequest, ...gax.CallOption) *SingleTenantHsmInstanceProposalIterator + DeleteSingleTenantHsmInstanceProposal(context.Context, *kmspb.DeleteSingleTenantHsmInstanceProposalRequest, ...gax.CallOption) error + GetLocation(context.Context, *locationpb.GetLocationRequest, ...gax.CallOption) (*locationpb.Location, error) + ListLocations(context.Context, *locationpb.ListLocationsRequest, ...gax.CallOption) *LocationIterator + GetIamPolicy(context.Context, *iampb.GetIamPolicyRequest, ...gax.CallOption) (*iampb.Policy, error) + SetIamPolicy(context.Context, *iampb.SetIamPolicyRequest, ...gax.CallOption) (*iampb.Policy, error) + TestIamPermissions(context.Context, *iampb.TestIamPermissionsRequest, ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) + GetOperation(context.Context, *longrunningpb.GetOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error) +} + +// HsmManagementClient is a client for interacting with Cloud Key Management Service (KMS) API. +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +// +// # Google Cloud HSM Management Service +// +// Provides interfaces for managing HSM instances. +// +// Implements a REST model with the following objects: +// +// SingleTenantHsmInstance +// +// SingleTenantHsmInstanceProposal +type HsmManagementClient struct { + // The internal transport-dependent client. + internalClient internalHsmManagementClient + + // The call options for this service. + CallOptions *HsmManagementCallOptions + + // LROClient is used internally to handle long-running operations. + // It is exposed so that its CallOptions can be modified if required. + // Users should not Close this client. + LROClient *lroauto.OperationsClient +} + +// Wrapper methods routed to the internal client. + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *HsmManagementClient) Close() error { + return c.internalClient.Close() +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *HsmManagementClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated: Connections are now pooled so this method does not always +// return the same resource. +func (c *HsmManagementClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// ListSingleTenantHsmInstances lists +// SingleTenantHsmInstances. +func (c *HsmManagementClient) ListSingleTenantHsmInstances(ctx context.Context, req *kmspb.ListSingleTenantHsmInstancesRequest, opts ...gax.CallOption) *SingleTenantHsmInstanceIterator { + return c.internalClient.ListSingleTenantHsmInstances(ctx, req, opts...) +} + +// GetSingleTenantHsmInstance returns metadata for a given +// SingleTenantHsmInstance. +func (c *HsmManagementClient) GetSingleTenantHsmInstance(ctx context.Context, req *kmspb.GetSingleTenantHsmInstanceRequest, opts ...gax.CallOption) (*kmspb.SingleTenantHsmInstance, error) { + return c.internalClient.GetSingleTenantHsmInstance(ctx, req, opts...) +} + +// CreateSingleTenantHsmInstance creates a new +// SingleTenantHsmInstance in a +// given Project and Location. User must create a RegisterTwoFactorAuthKeys +// proposal with this single-tenant HSM instance to finish setup of the +// instance. +func (c *HsmManagementClient) CreateSingleTenantHsmInstance(ctx context.Context, req *kmspb.CreateSingleTenantHsmInstanceRequest, opts ...gax.CallOption) (*CreateSingleTenantHsmInstanceOperation, error) { + return c.internalClient.CreateSingleTenantHsmInstance(ctx, req, opts...) +} + +// CreateSingleTenantHsmInstanceOperation returns a new CreateSingleTenantHsmInstanceOperation from a given name. +// The name must be that of a previously created CreateSingleTenantHsmInstanceOperation, possibly from a different process. +func (c *HsmManagementClient) CreateSingleTenantHsmInstanceOperation(name string) *CreateSingleTenantHsmInstanceOperation { + return c.internalClient.CreateSingleTenantHsmInstanceOperation(name) +} + +// CreateSingleTenantHsmInstanceProposal creates a new +// SingleTenantHsmInstanceProposal +// for a given +// SingleTenantHsmInstance. +func (c *HsmManagementClient) CreateSingleTenantHsmInstanceProposal(ctx context.Context, req *kmspb.CreateSingleTenantHsmInstanceProposalRequest, opts ...gax.CallOption) (*CreateSingleTenantHsmInstanceProposalOperation, error) { + return c.internalClient.CreateSingleTenantHsmInstanceProposal(ctx, req, opts...) +} + +// CreateSingleTenantHsmInstanceProposalOperation returns a new CreateSingleTenantHsmInstanceProposalOperation from a given name. +// The name must be that of a previously created CreateSingleTenantHsmInstanceProposalOperation, possibly from a different process. +func (c *HsmManagementClient) CreateSingleTenantHsmInstanceProposalOperation(name string) *CreateSingleTenantHsmInstanceProposalOperation { + return c.internalClient.CreateSingleTenantHsmInstanceProposalOperation(name) +} + +// ApproveSingleTenantHsmInstanceProposal approves a +// SingleTenantHsmInstanceProposal +// for a given +// SingleTenantHsmInstance. The +// proposal must be in the +// PENDING +// state. +func (c *HsmManagementClient) ApproveSingleTenantHsmInstanceProposal(ctx context.Context, req *kmspb.ApproveSingleTenantHsmInstanceProposalRequest, opts ...gax.CallOption) (*kmspb.ApproveSingleTenantHsmInstanceProposalResponse, error) { + return c.internalClient.ApproveSingleTenantHsmInstanceProposal(ctx, req, opts...) +} + +// ExecuteSingleTenantHsmInstanceProposal executes a +// SingleTenantHsmInstanceProposal +// for a given +// SingleTenantHsmInstance. The +// proposal must be in the +// APPROVED +// state. +func (c *HsmManagementClient) ExecuteSingleTenantHsmInstanceProposal(ctx context.Context, req *kmspb.ExecuteSingleTenantHsmInstanceProposalRequest, opts ...gax.CallOption) (*ExecuteSingleTenantHsmInstanceProposalOperation, error) { + return c.internalClient.ExecuteSingleTenantHsmInstanceProposal(ctx, req, opts...) +} + +// ExecuteSingleTenantHsmInstanceProposalOperation returns a new ExecuteSingleTenantHsmInstanceProposalOperation from a given name. +// The name must be that of a previously created ExecuteSingleTenantHsmInstanceProposalOperation, possibly from a different process. +func (c *HsmManagementClient) ExecuteSingleTenantHsmInstanceProposalOperation(name string) *ExecuteSingleTenantHsmInstanceProposalOperation { + return c.internalClient.ExecuteSingleTenantHsmInstanceProposalOperation(name) +} + +// GetSingleTenantHsmInstanceProposal returns metadata for a given +// SingleTenantHsmInstanceProposal. +func (c *HsmManagementClient) GetSingleTenantHsmInstanceProposal(ctx context.Context, req *kmspb.GetSingleTenantHsmInstanceProposalRequest, opts ...gax.CallOption) (*kmspb.SingleTenantHsmInstanceProposal, error) { + return c.internalClient.GetSingleTenantHsmInstanceProposal(ctx, req, opts...) +} + +// ListSingleTenantHsmInstanceProposals lists +// SingleTenantHsmInstanceProposals. +func (c *HsmManagementClient) ListSingleTenantHsmInstanceProposals(ctx context.Context, req *kmspb.ListSingleTenantHsmInstanceProposalsRequest, opts ...gax.CallOption) *SingleTenantHsmInstanceProposalIterator { + return c.internalClient.ListSingleTenantHsmInstanceProposals(ctx, req, opts...) +} + +// DeleteSingleTenantHsmInstanceProposal deletes a +// SingleTenantHsmInstanceProposal. +func (c *HsmManagementClient) DeleteSingleTenantHsmInstanceProposal(ctx context.Context, req *kmspb.DeleteSingleTenantHsmInstanceProposalRequest, opts ...gax.CallOption) error { + return c.internalClient.DeleteSingleTenantHsmInstanceProposal(ctx, req, opts...) +} + +// GetLocation gets information about a location. +func (c *HsmManagementClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error) { + return c.internalClient.GetLocation(ctx, req, opts...) +} + +// ListLocations lists information about the supported locations for this service. +func (c *HsmManagementClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator { + return c.internalClient.ListLocations(ctx, req, opts...) +} + +// GetIamPolicy gets the access control policy for a resource. Returns an empty policy +// if the resource exists and does not have a policy set. +func (c *HsmManagementClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { + return c.internalClient.GetIamPolicy(ctx, req, opts...) +} + +// SetIamPolicy sets the access control policy on the specified resource. Replaces +// any existing policy. +// +// Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED +// errors. +func (c *HsmManagementClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { + return c.internalClient.SetIamPolicy(ctx, req, opts...) +} + +// TestIamPermissions returns permissions that a caller has on the specified resource. If the +// resource does not exist, this will return an empty set of +// permissions, not a NOT_FOUND error. +// +// Note: This operation is designed to be used for building +// permission-aware UIs and command-line tools, not for authorization +// checking. This operation may “fail open” without warning. +func (c *HsmManagementClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) { + return c.internalClient.TestIamPermissions(ctx, req, opts...) +} + +// GetOperation is a utility method from google.longrunning.Operations. +func (c *HsmManagementClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { + return c.internalClient.GetOperation(ctx, req, opts...) +} + +// hsmManagementGRPCClient is a client for interacting with Cloud Key Management Service (KMS) API over gRPC transport. +// +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type hsmManagementGRPCClient struct { + // Connection pool of gRPC connections to the service. + connPool gtransport.ConnPool + + // Points back to the CallOptions field of the containing HsmManagementClient + CallOptions **HsmManagementCallOptions + + // The gRPC API client. + hsmManagementClient kmspb.HsmManagementClient + + // LROClient is used internally to handle long-running operations. + // It is exposed so that its CallOptions can be modified if required. + // Users should not Close this client. + LROClient **lroauto.OperationsClient + + operationsClient longrunningpb.OperationsClient + + iamPolicyClient iampb.IAMPolicyClient + + locationsClient locationpb.LocationsClient + + // The x-goog-* metadata to be sent with each request. + xGoogHeaders []string + + logger *slog.Logger +} + +// NewHsmManagementClient creates a new hsm management client based on gRPC. +// The returned client must be Closed when it is done being used to clean up its underlying connections. +// +// # Google Cloud HSM Management Service +// +// Provides interfaces for managing HSM instances. +// +// Implements a REST model with the following objects: +// +// SingleTenantHsmInstance +// +// SingleTenantHsmInstanceProposal +func NewHsmManagementClient(ctx context.Context, opts ...option.ClientOption) (*HsmManagementClient, error) { + clientOpts := defaultHsmManagementGRPCClientOptions() + if newHsmManagementClientHook != nil { + hookOpts, err := newHsmManagementClientHook(ctx, clientHookParams{}) + if err != nil { + return nil, err + } + clientOpts = append(clientOpts, hookOpts...) + } + + connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...) + if err != nil { + return nil, err + } + client := HsmManagementClient{CallOptions: defaultHsmManagementCallOptions()} + + c := &hsmManagementGRPCClient{ + connPool: connPool, + hsmManagementClient: kmspb.NewHsmManagementClient(connPool), + CallOptions: &client.CallOptions, + logger: internaloption.GetLogger(opts), + operationsClient: longrunningpb.NewOperationsClient(connPool), + iamPolicyClient: iampb.NewIAMPolicyClient(connPool), + locationsClient: locationpb.NewLocationsClient(connPool), + } + c.setGoogleClientInfo() + + client.internalClient = c + + client.LROClient, err = lroauto.NewOperationsClient(ctx, gtransport.WithConnPool(connPool)) + if err != nil { + // This error "should not happen", since we are just reusing old connection pool + // and never actually need to dial. + // If this does happen, we could leak connp. However, we cannot close conn: + // If the user invoked the constructor with option.WithGRPCConn, + // we would close a connection that's still in use. + // TODO: investigate error conditions. + return nil, err + } + c.LROClient = &client.LROClient + return &client, nil +} + +// Connection returns a connection to the API service. +// +// Deprecated: Connections are now pooled so this method does not always +// return the same resource. +func (c *hsmManagementGRPCClient) Connection() *grpc.ClientConn { + return c.connPool.Conn() +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *hsmManagementGRPCClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", gax.GoVersion}, keyval...) + kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version, "pb", protoVersion) + c.xGoogHeaders = []string{ + "x-goog-api-client", gax.XGoogHeader(kv...), + } +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *hsmManagementGRPCClient) Close() error { + return c.connPool.Close() +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type hsmManagementRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // LROClient is used internally to handle long-running operations. + // It is exposed so that its CallOptions can be modified if required. + // Users should not Close this client. + LROClient **lroauto.OperationsClient + + // The x-goog-* headers to be sent with each request. + xGoogHeaders []string + + // Points back to the CallOptions field of the containing HsmManagementClient + CallOptions **HsmManagementCallOptions + + logger *slog.Logger +} + +// NewHsmManagementRESTClient creates a new hsm management rest client. +// +// # Google Cloud HSM Management Service +// +// Provides interfaces for managing HSM instances. +// +// Implements a REST model with the following objects: +// +// SingleTenantHsmInstance +// +// SingleTenantHsmInstanceProposal +func NewHsmManagementRESTClient(ctx context.Context, opts ...option.ClientOption) (*HsmManagementClient, error) { + clientOpts := append(defaultHsmManagementRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + callOpts := defaultHsmManagementRESTCallOptions() + c := &hsmManagementRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + CallOptions: &callOpts, + logger: internaloption.GetLogger(opts), + } + c.setGoogleClientInfo() + + lroOpts := []option.ClientOption{ + option.WithHTTPClient(httpClient), + option.WithEndpoint(endpoint), + } + opClient, err := lroauto.NewOperationsRESTClient(ctx, lroOpts...) + if err != nil { + return nil, err + } + c.LROClient = &opClient + + return &HsmManagementClient{internalClient: c, CallOptions: callOpts}, nil +} + +func defaultHsmManagementRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("https://cloudkms.googleapis.com"), + internaloption.WithDefaultEndpointTemplate("https://cloudkms.UNIVERSE_DOMAIN"), + internaloption.WithDefaultMTLSEndpoint("https://cloudkms.mtls.googleapis.com"), + internaloption.WithDefaultUniverseDomain("googleapis.com"), + internaloption.WithDefaultAudience("https://cloudkms.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + internaloption.EnableNewAuthLibrary(), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *hsmManagementRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", gax.GoVersion}, keyval...) + kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN", "pb", protoVersion) + c.xGoogHeaders = []string{ + "x-goog-api-client", gax.XGoogHeader(kv...), + } +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *hsmManagementRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated: This method always returns nil. +func (c *hsmManagementRESTClient) Connection() *grpc.ClientConn { + return nil +} +func (c *hsmManagementGRPCClient) ListSingleTenantHsmInstances(ctx context.Context, req *kmspb.ListSingleTenantHsmInstancesRequest, opts ...gax.CallOption) *SingleTenantHsmInstanceIterator { + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} + + hds = append(c.xGoogHeaders, hds...) + ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + opts = append((*c.CallOptions).ListSingleTenantHsmInstances[0:len((*c.CallOptions).ListSingleTenantHsmInstances):len((*c.CallOptions).ListSingleTenantHsmInstances)], opts...) + it := &SingleTenantHsmInstanceIterator{} + req = proto.Clone(req).(*kmspb.ListSingleTenantHsmInstancesRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*kmspb.SingleTenantHsmInstance, string, error) { + resp := &kmspb.ListSingleTenantHsmInstancesResponse{} + if pageToken != "" { + req.PageToken = pageToken + } + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else if pageSize != 0 { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = executeRPC(ctx, c.hsmManagementClient.ListSingleTenantHsmInstances, req, settings.GRPC, c.logger, "ListSingleTenantHsmInstances") + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetSingleTenantHsmInstances(), resp.GetNextPageToken(), nil + } + fetch := func(pageSize int, pageToken string) (string, error) { + items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) + if err != nil { + return "", err + } + it.items = append(it.items, items...) + return nextPageToken, nil + } + + it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) + it.pageInfo.MaxSize = int(req.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + + return it +} + +func (c *hsmManagementGRPCClient) GetSingleTenantHsmInstance(ctx context.Context, req *kmspb.GetSingleTenantHsmInstanceRequest, opts ...gax.CallOption) (*kmspb.SingleTenantHsmInstance, error) { + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} + + hds = append(c.xGoogHeaders, hds...) + ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + opts = append((*c.CallOptions).GetSingleTenantHsmInstance[0:len((*c.CallOptions).GetSingleTenantHsmInstance):len((*c.CallOptions).GetSingleTenantHsmInstance)], opts...) + var resp *kmspb.SingleTenantHsmInstance + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = executeRPC(ctx, c.hsmManagementClient.GetSingleTenantHsmInstance, req, settings.GRPC, c.logger, "GetSingleTenantHsmInstance") + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *hsmManagementGRPCClient) CreateSingleTenantHsmInstance(ctx context.Context, req *kmspb.CreateSingleTenantHsmInstanceRequest, opts ...gax.CallOption) (*CreateSingleTenantHsmInstanceOperation, error) { + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} + + hds = append(c.xGoogHeaders, hds...) + ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + opts = append((*c.CallOptions).CreateSingleTenantHsmInstance[0:len((*c.CallOptions).CreateSingleTenantHsmInstance):len((*c.CallOptions).CreateSingleTenantHsmInstance)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = executeRPC(ctx, c.hsmManagementClient.CreateSingleTenantHsmInstance, req, settings.GRPC, c.logger, "CreateSingleTenantHsmInstance") + return err + }, opts...) + if err != nil { + return nil, err + } + return &CreateSingleTenantHsmInstanceOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, resp), + }, nil +} + +func (c *hsmManagementGRPCClient) CreateSingleTenantHsmInstanceProposal(ctx context.Context, req *kmspb.CreateSingleTenantHsmInstanceProposalRequest, opts ...gax.CallOption) (*CreateSingleTenantHsmInstanceProposalOperation, error) { + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} + + hds = append(c.xGoogHeaders, hds...) + ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + opts = append((*c.CallOptions).CreateSingleTenantHsmInstanceProposal[0:len((*c.CallOptions).CreateSingleTenantHsmInstanceProposal):len((*c.CallOptions).CreateSingleTenantHsmInstanceProposal)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = executeRPC(ctx, c.hsmManagementClient.CreateSingleTenantHsmInstanceProposal, req, settings.GRPC, c.logger, "CreateSingleTenantHsmInstanceProposal") + return err + }, opts...) + if err != nil { + return nil, err + } + return &CreateSingleTenantHsmInstanceProposalOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, resp), + }, nil +} + +func (c *hsmManagementGRPCClient) ApproveSingleTenantHsmInstanceProposal(ctx context.Context, req *kmspb.ApproveSingleTenantHsmInstanceProposalRequest, opts ...gax.CallOption) (*kmspb.ApproveSingleTenantHsmInstanceProposalResponse, error) { + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} + + hds = append(c.xGoogHeaders, hds...) + ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + opts = append((*c.CallOptions).ApproveSingleTenantHsmInstanceProposal[0:len((*c.CallOptions).ApproveSingleTenantHsmInstanceProposal):len((*c.CallOptions).ApproveSingleTenantHsmInstanceProposal)], opts...) + var resp *kmspb.ApproveSingleTenantHsmInstanceProposalResponse + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = executeRPC(ctx, c.hsmManagementClient.ApproveSingleTenantHsmInstanceProposal, req, settings.GRPC, c.logger, "ApproveSingleTenantHsmInstanceProposal") + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *hsmManagementGRPCClient) ExecuteSingleTenantHsmInstanceProposal(ctx context.Context, req *kmspb.ExecuteSingleTenantHsmInstanceProposalRequest, opts ...gax.CallOption) (*ExecuteSingleTenantHsmInstanceProposalOperation, error) { + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} + + hds = append(c.xGoogHeaders, hds...) + ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + opts = append((*c.CallOptions).ExecuteSingleTenantHsmInstanceProposal[0:len((*c.CallOptions).ExecuteSingleTenantHsmInstanceProposal):len((*c.CallOptions).ExecuteSingleTenantHsmInstanceProposal)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = executeRPC(ctx, c.hsmManagementClient.ExecuteSingleTenantHsmInstanceProposal, req, settings.GRPC, c.logger, "ExecuteSingleTenantHsmInstanceProposal") + return err + }, opts...) + if err != nil { + return nil, err + } + return &ExecuteSingleTenantHsmInstanceProposalOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, resp), + }, nil +} + +func (c *hsmManagementGRPCClient) GetSingleTenantHsmInstanceProposal(ctx context.Context, req *kmspb.GetSingleTenantHsmInstanceProposalRequest, opts ...gax.CallOption) (*kmspb.SingleTenantHsmInstanceProposal, error) { + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} + + hds = append(c.xGoogHeaders, hds...) + ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + opts = append((*c.CallOptions).GetSingleTenantHsmInstanceProposal[0:len((*c.CallOptions).GetSingleTenantHsmInstanceProposal):len((*c.CallOptions).GetSingleTenantHsmInstanceProposal)], opts...) + var resp *kmspb.SingleTenantHsmInstanceProposal + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = executeRPC(ctx, c.hsmManagementClient.GetSingleTenantHsmInstanceProposal, req, settings.GRPC, c.logger, "GetSingleTenantHsmInstanceProposal") + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *hsmManagementGRPCClient) ListSingleTenantHsmInstanceProposals(ctx context.Context, req *kmspb.ListSingleTenantHsmInstanceProposalsRequest, opts ...gax.CallOption) *SingleTenantHsmInstanceProposalIterator { + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} + + hds = append(c.xGoogHeaders, hds...) + ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + opts = append((*c.CallOptions).ListSingleTenantHsmInstanceProposals[0:len((*c.CallOptions).ListSingleTenantHsmInstanceProposals):len((*c.CallOptions).ListSingleTenantHsmInstanceProposals)], opts...) + it := &SingleTenantHsmInstanceProposalIterator{} + req = proto.Clone(req).(*kmspb.ListSingleTenantHsmInstanceProposalsRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*kmspb.SingleTenantHsmInstanceProposal, string, error) { + resp := &kmspb.ListSingleTenantHsmInstanceProposalsResponse{} + if pageToken != "" { + req.PageToken = pageToken + } + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else if pageSize != 0 { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = executeRPC(ctx, c.hsmManagementClient.ListSingleTenantHsmInstanceProposals, req, settings.GRPC, c.logger, "ListSingleTenantHsmInstanceProposals") + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetSingleTenantHsmInstanceProposals(), resp.GetNextPageToken(), nil + } + fetch := func(pageSize int, pageToken string) (string, error) { + items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) + if err != nil { + return "", err + } + it.items = append(it.items, items...) + return nextPageToken, nil + } + + it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) + it.pageInfo.MaxSize = int(req.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + + return it +} + +func (c *hsmManagementGRPCClient) DeleteSingleTenantHsmInstanceProposal(ctx context.Context, req *kmspb.DeleteSingleTenantHsmInstanceProposalRequest, opts ...gax.CallOption) error { + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} + + hds = append(c.xGoogHeaders, hds...) + ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + opts = append((*c.CallOptions).DeleteSingleTenantHsmInstanceProposal[0:len((*c.CallOptions).DeleteSingleTenantHsmInstanceProposal):len((*c.CallOptions).DeleteSingleTenantHsmInstanceProposal)], opts...) + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + _, err = executeRPC(ctx, c.hsmManagementClient.DeleteSingleTenantHsmInstanceProposal, req, settings.GRPC, c.logger, "DeleteSingleTenantHsmInstanceProposal") + return err + }, opts...) + return err +} + +func (c *hsmManagementGRPCClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error) { + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} + + hds = append(c.xGoogHeaders, hds...) + ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + opts = append((*c.CallOptions).GetLocation[0:len((*c.CallOptions).GetLocation):len((*c.CallOptions).GetLocation)], opts...) + var resp *locationpb.Location + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = executeRPC(ctx, c.locationsClient.GetLocation, req, settings.GRPC, c.logger, "GetLocation") + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *hsmManagementGRPCClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator { + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} + + hds = append(c.xGoogHeaders, hds...) + ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + opts = append((*c.CallOptions).ListLocations[0:len((*c.CallOptions).ListLocations):len((*c.CallOptions).ListLocations)], opts...) + it := &LocationIterator{} + req = proto.Clone(req).(*locationpb.ListLocationsRequest) + it.InternalFetch = func(pageSize int, pageToken string) ([]*locationpb.Location, string, error) { + resp := &locationpb.ListLocationsResponse{} + if pageToken != "" { + req.PageToken = pageToken + } + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else if pageSize != 0 { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = executeRPC(ctx, c.locationsClient.ListLocations, req, settings.GRPC, c.logger, "ListLocations") + return err + }, opts...) + if err != nil { + return nil, "", err + } + + it.Response = resp + return resp.GetLocations(), resp.GetNextPageToken(), nil + } + fetch := func(pageSize int, pageToken string) (string, error) { + items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) + if err != nil { + return "", err + } + it.items = append(it.items, items...) + return nextPageToken, nil + } + + it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) + it.pageInfo.MaxSize = int(req.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + + return it +} + +func (c *hsmManagementGRPCClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource()))} + + hds = append(c.xGoogHeaders, hds...) + ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + opts = append((*c.CallOptions).GetIamPolicy[0:len((*c.CallOptions).GetIamPolicy):len((*c.CallOptions).GetIamPolicy)], opts...) + var resp *iampb.Policy + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = executeRPC(ctx, c.iamPolicyClient.GetIamPolicy, req, settings.GRPC, c.logger, "GetIamPolicy") + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *hsmManagementGRPCClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource()))} + + hds = append(c.xGoogHeaders, hds...) + ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + opts = append((*c.CallOptions).SetIamPolicy[0:len((*c.CallOptions).SetIamPolicy):len((*c.CallOptions).SetIamPolicy)], opts...) + var resp *iampb.Policy + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = executeRPC(ctx, c.iamPolicyClient.SetIamPolicy, req, settings.GRPC, c.logger, "SetIamPolicy") + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *hsmManagementGRPCClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) { + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource()))} + + hds = append(c.xGoogHeaders, hds...) + ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + opts = append((*c.CallOptions).TestIamPermissions[0:len((*c.CallOptions).TestIamPermissions):len((*c.CallOptions).TestIamPermissions)], opts...) + var resp *iampb.TestIamPermissionsResponse + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = executeRPC(ctx, c.iamPolicyClient.TestIamPermissions, req, settings.GRPC, c.logger, "TestIamPermissions") + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *hsmManagementGRPCClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} + + hds = append(c.xGoogHeaders, hds...) + ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = executeRPC(ctx, c.operationsClient.GetOperation, req, settings.GRPC, c.logger, "GetOperation") + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + +// ListSingleTenantHsmInstances lists +// SingleTenantHsmInstances. +func (c *hsmManagementRESTClient) ListSingleTenantHsmInstances(ctx context.Context, req *kmspb.ListSingleTenantHsmInstancesRequest, opts ...gax.CallOption) *SingleTenantHsmInstanceIterator { + it := &SingleTenantHsmInstanceIterator{} + req = proto.Clone(req).(*kmspb.ListSingleTenantHsmInstancesRequest) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + it.InternalFetch = func(pageSize int, pageToken string) ([]*kmspb.SingleTenantHsmInstance, string, error) { + resp := &kmspb.ListSingleTenantHsmInstancesResponse{} + if pageToken != "" { + req.PageToken = pageToken + } + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else if pageSize != 0 { + req.PageSize = int32(pageSize) + } + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, "", err + } + baseUrl.Path += fmt.Sprintf("/v1/%v/singleTenantHsmInstances", req.GetParent()) + + params := url.Values{} + params.Add("$alt", "json;enum-encoding=int") + if req.GetFilter() != "" { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req.GetOrderBy() != "" { + params.Add("orderBy", fmt.Sprintf("%v", req.GetOrderBy())) + } + if req.GetPageSize() != 0 { + params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize())) + } + if req.GetPageToken() != "" { + params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken())) + } + if req.GetShowDeleted() { + params.Add("showDeleted", fmt.Sprintf("%v", req.GetShowDeleted())) + } + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + hds := append(c.xGoogHeaders, "Content-Type", "application/json") + headers := gax.BuildHeaders(ctx, hds...) + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) + if err != nil { + return err + } + httpReq.Header = headers + + buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListSingleTenantHsmInstances") + if err != nil { + return err + } + if err := unm.Unmarshal(buf, resp); err != nil { + return err + } + + return nil + }, opts...) + if e != nil { + return nil, "", e + } + it.Response = resp + return resp.GetSingleTenantHsmInstances(), resp.GetNextPageToken(), nil + } + + fetch := func(pageSize int, pageToken string) (string, error) { + items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) + if err != nil { + return "", err + } + it.items = append(it.items, items...) + return nextPageToken, nil + } + + it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) + it.pageInfo.MaxSize = int(req.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + + return it +} + +// GetSingleTenantHsmInstance returns metadata for a given +// SingleTenantHsmInstance. +func (c *hsmManagementRESTClient) GetSingleTenantHsmInstance(ctx context.Context, req *kmspb.GetSingleTenantHsmInstanceRequest, opts ...gax.CallOption) (*kmspb.SingleTenantHsmInstance, error) { + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) + + params := url.Values{} + params.Add("$alt", "json;enum-encoding=int") + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} + + hds = append(c.xGoogHeaders, hds...) + hds = append(hds, "Content-Type", "application/json") + headers := gax.BuildHeaders(ctx, hds...) + opts = append((*c.CallOptions).GetSingleTenantHsmInstance[0:len((*c.CallOptions).GetSingleTenantHsmInstance):len((*c.CallOptions).GetSingleTenantHsmInstance)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &kmspb.SingleTenantHsmInstance{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetSingleTenantHsmInstance") + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return err + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + return resp, nil +} + +// CreateSingleTenantHsmInstance creates a new +// SingleTenantHsmInstance in a +// given Project and Location. User must create a RegisterTwoFactorAuthKeys +// proposal with this single-tenant HSM instance to finish setup of the +// instance. +func (c *hsmManagementRESTClient) CreateSingleTenantHsmInstance(ctx context.Context, req *kmspb.CreateSingleTenantHsmInstanceRequest, opts ...gax.CallOption) (*CreateSingleTenantHsmInstanceOperation, error) { + m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} + body := req.GetSingleTenantHsmInstance() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/v1/%v/singleTenantHsmInstances", req.GetParent()) + + params := url.Values{} + params.Add("$alt", "json;enum-encoding=int") + if req.GetSingleTenantHsmInstanceId() != "" { + params.Add("singleTenantHsmInstanceId", fmt.Sprintf("%v", req.GetSingleTenantHsmInstanceId())) + } + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} + + hds = append(c.xGoogHeaders, hds...) + hds = append(hds, "Content-Type", "application/json") + headers := gax.BuildHeaders(ctx, hds...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &longrunningpb.Operation{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "CreateSingleTenantHsmInstance") + if err != nil { + return err + } + if err := unm.Unmarshal(buf, resp); err != nil { + return err + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + + override := fmt.Sprintf("/v1/%s", resp.GetName()) + return &CreateSingleTenantHsmInstanceOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, resp), + pollPath: override, + }, nil +} + +// CreateSingleTenantHsmInstanceProposal creates a new +// SingleTenantHsmInstanceProposal +// for a given +// SingleTenantHsmInstance. +func (c *hsmManagementRESTClient) CreateSingleTenantHsmInstanceProposal(ctx context.Context, req *kmspb.CreateSingleTenantHsmInstanceProposalRequest, opts ...gax.CallOption) (*CreateSingleTenantHsmInstanceProposalOperation, error) { + m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} + body := req.GetSingleTenantHsmInstanceProposal() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/v1/%v/proposals", req.GetParent()) + + params := url.Values{} + params.Add("$alt", "json;enum-encoding=int") + if req.GetSingleTenantHsmInstanceProposalId() != "" { + params.Add("singleTenantHsmInstanceProposalId", fmt.Sprintf("%v", req.GetSingleTenantHsmInstanceProposalId())) + } + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))} + + hds = append(c.xGoogHeaders, hds...) + hds = append(hds, "Content-Type", "application/json") + headers := gax.BuildHeaders(ctx, hds...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &longrunningpb.Operation{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "CreateSingleTenantHsmInstanceProposal") + if err != nil { + return err + } + if err := unm.Unmarshal(buf, resp); err != nil { + return err + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + + override := fmt.Sprintf("/v1/%s", resp.GetName()) + return &CreateSingleTenantHsmInstanceProposalOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, resp), + pollPath: override, + }, nil +} + +// ApproveSingleTenantHsmInstanceProposal approves a +// SingleTenantHsmInstanceProposal +// for a given +// SingleTenantHsmInstance. The +// proposal must be in the +// PENDING +// state. +func (c *hsmManagementRESTClient) ApproveSingleTenantHsmInstanceProposal(ctx context.Context, req *kmspb.ApproveSingleTenantHsmInstanceProposalRequest, opts ...gax.CallOption) (*kmspb.ApproveSingleTenantHsmInstanceProposalResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/v1/%v:approve", req.GetName()) + + params := url.Values{} + params.Add("$alt", "json;enum-encoding=int") + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} + + hds = append(c.xGoogHeaders, hds...) + hds = append(hds, "Content-Type", "application/json") + headers := gax.BuildHeaders(ctx, hds...) + opts = append((*c.CallOptions).ApproveSingleTenantHsmInstanceProposal[0:len((*c.CallOptions).ApproveSingleTenantHsmInstanceProposal):len((*c.CallOptions).ApproveSingleTenantHsmInstanceProposal)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &kmspb.ApproveSingleTenantHsmInstanceProposalResponse{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "ApproveSingleTenantHsmInstanceProposal") + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return err + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + return resp, nil +} + +// ExecuteSingleTenantHsmInstanceProposal executes a +// SingleTenantHsmInstanceProposal +// for a given +// SingleTenantHsmInstance. The +// proposal must be in the +// APPROVED +// state. +func (c *hsmManagementRESTClient) ExecuteSingleTenantHsmInstanceProposal(ctx context.Context, req *kmspb.ExecuteSingleTenantHsmInstanceProposalRequest, opts ...gax.CallOption) (*ExecuteSingleTenantHsmInstanceProposalOperation, error) { + m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/v1/%v:execute", req.GetName()) + + params := url.Values{} + params.Add("$alt", "json;enum-encoding=int") + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} + + hds = append(c.xGoogHeaders, hds...) + hds = append(hds, "Content-Type", "application/json") + headers := gax.BuildHeaders(ctx, hds...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &longrunningpb.Operation{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "ExecuteSingleTenantHsmInstanceProposal") + if err != nil { + return err + } + if err := unm.Unmarshal(buf, resp); err != nil { + return err + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + + override := fmt.Sprintf("/v1/%s", resp.GetName()) + return &ExecuteSingleTenantHsmInstanceProposalOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, resp), + pollPath: override, + }, nil +} + +// GetSingleTenantHsmInstanceProposal returns metadata for a given +// SingleTenantHsmInstanceProposal. +func (c *hsmManagementRESTClient) GetSingleTenantHsmInstanceProposal(ctx context.Context, req *kmspb.GetSingleTenantHsmInstanceProposalRequest, opts ...gax.CallOption) (*kmspb.SingleTenantHsmInstanceProposal, error) { + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) + + params := url.Values{} + params.Add("$alt", "json;enum-encoding=int") + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} + + hds = append(c.xGoogHeaders, hds...) + hds = append(hds, "Content-Type", "application/json") + headers := gax.BuildHeaders(ctx, hds...) + opts = append((*c.CallOptions).GetSingleTenantHsmInstanceProposal[0:len((*c.CallOptions).GetSingleTenantHsmInstanceProposal):len((*c.CallOptions).GetSingleTenantHsmInstanceProposal)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &kmspb.SingleTenantHsmInstanceProposal{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetSingleTenantHsmInstanceProposal") + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return err + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + return resp, nil +} + +// ListSingleTenantHsmInstanceProposals lists +// SingleTenantHsmInstanceProposals. +func (c *hsmManagementRESTClient) ListSingleTenantHsmInstanceProposals(ctx context.Context, req *kmspb.ListSingleTenantHsmInstanceProposalsRequest, opts ...gax.CallOption) *SingleTenantHsmInstanceProposalIterator { + it := &SingleTenantHsmInstanceProposalIterator{} + req = proto.Clone(req).(*kmspb.ListSingleTenantHsmInstanceProposalsRequest) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + it.InternalFetch = func(pageSize int, pageToken string) ([]*kmspb.SingleTenantHsmInstanceProposal, string, error) { + resp := &kmspb.ListSingleTenantHsmInstanceProposalsResponse{} + if pageToken != "" { + req.PageToken = pageToken + } + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else if pageSize != 0 { + req.PageSize = int32(pageSize) + } + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, "", err + } + baseUrl.Path += fmt.Sprintf("/v1/%v/proposals", req.GetParent()) + + params := url.Values{} + params.Add("$alt", "json;enum-encoding=int") + if req.GetFilter() != "" { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req.GetOrderBy() != "" { + params.Add("orderBy", fmt.Sprintf("%v", req.GetOrderBy())) + } + if req.GetPageSize() != 0 { + params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize())) + } + if req.GetPageToken() != "" { + params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken())) + } + if req.GetShowDeleted() { + params.Add("showDeleted", fmt.Sprintf("%v", req.GetShowDeleted())) + } + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + hds := append(c.xGoogHeaders, "Content-Type", "application/json") + headers := gax.BuildHeaders(ctx, hds...) + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) + if err != nil { + return err + } + httpReq.Header = headers + + buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListSingleTenantHsmInstanceProposals") + if err != nil { + return err + } + if err := unm.Unmarshal(buf, resp); err != nil { + return err + } + + return nil + }, opts...) + if e != nil { + return nil, "", e + } + it.Response = resp + return resp.GetSingleTenantHsmInstanceProposals(), resp.GetNextPageToken(), nil + } + + fetch := func(pageSize int, pageToken string) (string, error) { + items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) + if err != nil { + return "", err + } + it.items = append(it.items, items...) + return nextPageToken, nil + } + + it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) + it.pageInfo.MaxSize = int(req.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + + return it +} + +// DeleteSingleTenantHsmInstanceProposal deletes a +// SingleTenantHsmInstanceProposal. +func (c *hsmManagementRESTClient) DeleteSingleTenantHsmInstanceProposal(ctx context.Context, req *kmspb.DeleteSingleTenantHsmInstanceProposalRequest, opts ...gax.CallOption) error { + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return err + } + baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) + + params := url.Values{} + params.Add("$alt", "json;enum-encoding=int") + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} + + hds = append(c.xGoogHeaders, hds...) + hds = append(hds, "Content-Type", "application/json") + headers := gax.BuildHeaders(ctx, hds...) + return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + _, err = executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "DeleteSingleTenantHsmInstanceProposal") + return err + }, opts...) +} + +// GetLocation gets information about a location. +func (c *hsmManagementRESTClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error) { + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) + + params := url.Values{} + params.Add("$alt", "json;enum-encoding=int") + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} + + hds = append(c.xGoogHeaders, hds...) + hds = append(hds, "Content-Type", "application/json") + headers := gax.BuildHeaders(ctx, hds...) + opts = append((*c.CallOptions).GetLocation[0:len((*c.CallOptions).GetLocation):len((*c.CallOptions).GetLocation)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &locationpb.Location{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetLocation") + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return err + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + return resp, nil +} + +// ListLocations lists information about the supported locations for this service. +func (c *hsmManagementRESTClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator { + it := &LocationIterator{} + req = proto.Clone(req).(*locationpb.ListLocationsRequest) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + it.InternalFetch = func(pageSize int, pageToken string) ([]*locationpb.Location, string, error) { + resp := &locationpb.ListLocationsResponse{} + if pageToken != "" { + req.PageToken = pageToken + } + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else if pageSize != 0 { + req.PageSize = int32(pageSize) + } + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, "", err + } + baseUrl.Path += fmt.Sprintf("/v1/%v/locations", req.GetName()) + + params := url.Values{} + params.Add("$alt", "json;enum-encoding=int") + if req.GetFilter() != "" { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req.GetPageSize() != 0 { + params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize())) + } + if req.GetPageToken() != "" { + params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken())) + } + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + hds := append(c.xGoogHeaders, "Content-Type", "application/json") + headers := gax.BuildHeaders(ctx, hds...) + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) + if err != nil { + return err + } + httpReq.Header = headers + + buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "ListLocations") + if err != nil { + return err + } + if err := unm.Unmarshal(buf, resp); err != nil { + return err + } + + return nil + }, opts...) + if e != nil { + return nil, "", e + } + it.Response = resp + return resp.GetLocations(), resp.GetNextPageToken(), nil + } + + fetch := func(pageSize int, pageToken string) (string, error) { + items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) + if err != nil { + return "", err + } + it.items = append(it.items, items...) + return nextPageToken, nil + } + + it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) + it.pageInfo.MaxSize = int(req.GetPageSize()) + it.pageInfo.Token = req.GetPageToken() + + return it +} + +// GetIamPolicy gets the access control policy for a resource. Returns an empty policy +// if the resource exists and does not have a policy set. +func (c *hsmManagementRESTClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/v1/%v:getIamPolicy", req.GetResource()) + + params := url.Values{} + params.Add("$alt", "json;enum-encoding=int") + if req.GetOptions().GetRequestedPolicyVersion() != 0 { + params.Add("options.requestedPolicyVersion", fmt.Sprintf("%v", req.GetOptions().GetRequestedPolicyVersion())) + } + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource()))} + + hds = append(c.xGoogHeaders, hds...) + hds = append(hds, "Content-Type", "application/json") + headers := gax.BuildHeaders(ctx, hds...) + opts = append((*c.CallOptions).GetIamPolicy[0:len((*c.CallOptions).GetIamPolicy):len((*c.CallOptions).GetIamPolicy)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &iampb.Policy{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetIamPolicy") + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return err + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + return resp, nil +} + +// SetIamPolicy sets the access control policy on the specified resource. Replaces +// any existing policy. +// +// Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED +// errors. +func (c *hsmManagementRESTClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { + m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/v1/%v:setIamPolicy", req.GetResource()) + + params := url.Values{} + params.Add("$alt", "json;enum-encoding=int") + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource()))} + + hds = append(c.xGoogHeaders, hds...) + hds = append(hds, "Content-Type", "application/json") + headers := gax.BuildHeaders(ctx, hds...) + opts = append((*c.CallOptions).SetIamPolicy[0:len((*c.CallOptions).SetIamPolicy):len((*c.CallOptions).SetIamPolicy)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &iampb.Policy{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "SetIamPolicy") + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return err + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + return resp, nil +} + +// TestIamPermissions returns permissions that a caller has on the specified resource. If the +// resource does not exist, this will return an empty set of +// permissions, not a NOT_FOUND error. +// +// Note: This operation is designed to be used for building +// permission-aware UIs and command-line tools, not for authorization +// checking. This operation may “fail open” without warning. +func (c *hsmManagementRESTClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/v1/%v:testIamPermissions", req.GetResource()) + + params := url.Values{} + params.Add("$alt", "json;enum-encoding=int") + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "resource", url.QueryEscape(req.GetResource()))} + + hds = append(c.xGoogHeaders, hds...) + hds = append(hds, "Content-Type", "application/json") + headers := gax.BuildHeaders(ctx, hds...) + opts = append((*c.CallOptions).TestIamPermissions[0:len((*c.CallOptions).TestIamPermissions):len((*c.CallOptions).TestIamPermissions)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &iampb.TestIamPermissionsResponse{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "TestIamPermissions") + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return err + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + return resp, nil +} + +// GetOperation is a utility method from google.longrunning.Operations. +func (c *hsmManagementRESTClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/v1/%v", req.GetName()) + + params := url.Values{} + params.Add("$alt", "json;enum-encoding=int") + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} + + hds = append(c.xGoogHeaders, hds...) + hds = append(hds, "Content-Type", "application/json") + headers := gax.BuildHeaders(ctx, hds...) + opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &longrunningpb.Operation{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, nil, "GetOperation") + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return err + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + return resp, nil +} + +// CreateSingleTenantHsmInstanceOperation returns a new CreateSingleTenantHsmInstanceOperation from a given name. +// The name must be that of a previously created CreateSingleTenantHsmInstanceOperation, possibly from a different process. +func (c *hsmManagementGRPCClient) CreateSingleTenantHsmInstanceOperation(name string) *CreateSingleTenantHsmInstanceOperation { + return &CreateSingleTenantHsmInstanceOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), + } +} + +// CreateSingleTenantHsmInstanceOperation returns a new CreateSingleTenantHsmInstanceOperation from a given name. +// The name must be that of a previously created CreateSingleTenantHsmInstanceOperation, possibly from a different process. +func (c *hsmManagementRESTClient) CreateSingleTenantHsmInstanceOperation(name string) *CreateSingleTenantHsmInstanceOperation { + override := fmt.Sprintf("/v1/%s", name) + return &CreateSingleTenantHsmInstanceOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), + pollPath: override, + } +} + +// CreateSingleTenantHsmInstanceProposalOperation returns a new CreateSingleTenantHsmInstanceProposalOperation from a given name. +// The name must be that of a previously created CreateSingleTenantHsmInstanceProposalOperation, possibly from a different process. +func (c *hsmManagementGRPCClient) CreateSingleTenantHsmInstanceProposalOperation(name string) *CreateSingleTenantHsmInstanceProposalOperation { + return &CreateSingleTenantHsmInstanceProposalOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), + } +} + +// CreateSingleTenantHsmInstanceProposalOperation returns a new CreateSingleTenantHsmInstanceProposalOperation from a given name. +// The name must be that of a previously created CreateSingleTenantHsmInstanceProposalOperation, possibly from a different process. +func (c *hsmManagementRESTClient) CreateSingleTenantHsmInstanceProposalOperation(name string) *CreateSingleTenantHsmInstanceProposalOperation { + override := fmt.Sprintf("/v1/%s", name) + return &CreateSingleTenantHsmInstanceProposalOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), + pollPath: override, + } +} + +// ExecuteSingleTenantHsmInstanceProposalOperation returns a new ExecuteSingleTenantHsmInstanceProposalOperation from a given name. +// The name must be that of a previously created ExecuteSingleTenantHsmInstanceProposalOperation, possibly from a different process. +func (c *hsmManagementGRPCClient) ExecuteSingleTenantHsmInstanceProposalOperation(name string) *ExecuteSingleTenantHsmInstanceProposalOperation { + return &ExecuteSingleTenantHsmInstanceProposalOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), + } +} + +// ExecuteSingleTenantHsmInstanceProposalOperation returns a new ExecuteSingleTenantHsmInstanceProposalOperation from a given name. +// The name must be that of a previously created ExecuteSingleTenantHsmInstanceProposalOperation, possibly from a different process. +func (c *hsmManagementRESTClient) ExecuteSingleTenantHsmInstanceProposalOperation(name string) *ExecuteSingleTenantHsmInstanceProposalOperation { + override := fmt.Sprintf("/v1/%s", name) + return &ExecuteSingleTenantHsmInstanceProposalOperation{ + lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}), + pollPath: override, + } +} diff --git a/vendor/cloud.google.com/go/kms/apiv1/key_management_client.go b/vendor/cloud.google.com/go/kms/apiv1/key_management_client.go index 3246c31c21f..ca27f08ca08 100644 --- a/vendor/cloud.google.com/go/kms/apiv1/key_management_client.go +++ b/vendor/cloud.google.com/go/kms/apiv1/key_management_client.go @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -73,6 +73,7 @@ type KeyManagementCallOptions struct { AsymmetricDecrypt []gax.CallOption MacSign []gax.CallOption MacVerify []gax.CallOption + Decapsulate []gax.CallOption GenerateRandomBytes []gax.CallOption GetLocation []gax.CallOption ListLocations []gax.CallOption @@ -91,6 +92,7 @@ func defaultKeyManagementGRPCClientOptions() []option.ClientOption { internaloption.WithDefaultAudience("https://cloudkms.googleapis.com/"), internaloption.WithDefaultScopes(DefaultAuthScopes()...), internaloption.EnableJwtWithScope(), + internaloption.AllowHardBoundTokens("MTLS_S2A"), internaloption.EnableNewAuthLibrary(), option.WithGRPCDialOption(grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt32))), @@ -406,6 +408,7 @@ func defaultKeyManagementCallOptions() *KeyManagementCallOptions { }) }), }, + Decapsulate: []gax.CallOption{}, GenerateRandomBytes: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { @@ -714,6 +717,7 @@ func defaultKeyManagementRESTCallOptions() *KeyManagementCallOptions { http.StatusGatewayTimeout) }), }, + Decapsulate: []gax.CallOption{}, GenerateRandomBytes: []gax.CallOption{ gax.WithTimeout(60000 * time.Millisecond), gax.WithRetry(func() gax.Retryer { @@ -767,6 +771,7 @@ type internalKeyManagementClient interface { AsymmetricDecrypt(context.Context, *kmspb.AsymmetricDecryptRequest, ...gax.CallOption) (*kmspb.AsymmetricDecryptResponse, error) MacSign(context.Context, *kmspb.MacSignRequest, ...gax.CallOption) (*kmspb.MacSignResponse, error) MacVerify(context.Context, *kmspb.MacVerifyRequest, ...gax.CallOption) (*kmspb.MacVerifyResponse, error) + Decapsulate(context.Context, *kmspb.DecapsulateRequest, ...gax.CallOption) (*kmspb.DecapsulateResponse, error) GenerateRandomBytes(context.Context, *kmspb.GenerateRandomBytesRequest, ...gax.CallOption) (*kmspb.GenerateRandomBytesResponse, error) GetLocation(context.Context, *locationpb.GetLocationRequest, ...gax.CallOption) (*locationpb.Location, error) ListLocations(context.Context, *locationpb.ListLocationsRequest, ...gax.CallOption) *LocationIterator @@ -1061,6 +1066,15 @@ func (c *KeyManagementClient) MacVerify(ctx context.Context, req *kmspb.MacVerif return c.internalClient.MacVerify(ctx, req, opts...) } +// Decapsulate decapsulates data that was encapsulated with a public key retrieved from +// GetPublicKey +// corresponding to a CryptoKeyVersion +// with CryptoKey.purpose +// KEY_ENCAPSULATION. +func (c *KeyManagementClient) Decapsulate(ctx context.Context, req *kmspb.DecapsulateRequest, opts ...gax.CallOption) (*kmspb.DecapsulateResponse, error) { + return c.internalClient.Decapsulate(ctx, req, opts...) +} + // GenerateRandomBytes generate random bytes using the Cloud KMS randomness source in the provided // location. func (c *KeyManagementClient) GenerateRandomBytes(ctx context.Context, req *kmspb.GenerateRandomBytesRequest, opts ...gax.CallOption) (*kmspb.GenerateRandomBytesResponse, error) { @@ -1896,6 +1910,24 @@ func (c *keyManagementGRPCClient) MacVerify(ctx context.Context, req *kmspb.MacV return resp, nil } +func (c *keyManagementGRPCClient) Decapsulate(ctx context.Context, req *kmspb.DecapsulateRequest, opts ...gax.CallOption) (*kmspb.DecapsulateResponse, error) { + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} + + hds = append(c.xGoogHeaders, hds...) + ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...) + opts = append((*c.CallOptions).Decapsulate[0:len((*c.CallOptions).Decapsulate):len((*c.CallOptions).Decapsulate)], opts...) + var resp *kmspb.DecapsulateResponse + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = executeRPC(ctx, c.keyManagementClient.Decapsulate, req, settings.GRPC, c.logger, "Decapsulate") + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + func (c *keyManagementGRPCClient) GenerateRandomBytes(ctx context.Context, req *kmspb.GenerateRandomBytesRequest, opts ...gax.CallOption) (*kmspb.GenerateRandomBytesResponse, error) { hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "location", url.QueryEscape(req.GetLocation()))} @@ -3780,6 +3812,66 @@ func (c *keyManagementRESTClient) MacVerify(ctx context.Context, req *kmspb.MacV return resp, nil } +// Decapsulate decapsulates data that was encapsulated with a public key retrieved from +// GetPublicKey +// corresponding to a CryptoKeyVersion +// with CryptoKey.purpose +// KEY_ENCAPSULATION. +func (c *keyManagementRESTClient) Decapsulate(ctx context.Context, req *kmspb.DecapsulateRequest, opts ...gax.CallOption) (*kmspb.DecapsulateResponse, error) { + m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true} + jsonReq, err := m.Marshal(req) + if err != nil { + return nil, err + } + + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/v1/%v:decapsulate", req.GetName()) + + params := url.Values{} + params.Add("$alt", "json;enum-encoding=int") + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))} + + hds = append(c.xGoogHeaders, hds...) + hds = append(hds, "Content-Type", "application/json") + headers := gax.BuildHeaders(ctx, hds...) + opts = append((*c.CallOptions).Decapsulate[0:len((*c.CallOptions).Decapsulate):len((*c.CallOptions).Decapsulate)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &kmspb.DecapsulateResponse{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + buf, err := executeHTTPRequest(ctx, c.httpClient, httpReq, c.logger, jsonReq, "Decapsulate") + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return err + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + return resp, nil +} + // GenerateRandomBytes generate random bytes using the Cloud KMS randomness source in the provided // location. func (c *keyManagementRESTClient) GenerateRandomBytes(ctx context.Context, req *kmspb.GenerateRandomBytesRequest, opts ...gax.CallOption) (*kmspb.GenerateRandomBytesResponse, error) { diff --git a/vendor/cloud.google.com/go/kms/apiv1/kmspb/autokey.pb.go b/vendor/cloud.google.com/go/kms/apiv1/kmspb/autokey.pb.go index 6f12a2532ed..85bb725473a 100644 --- a/vendor/cloud.google.com/go/kms/apiv1/kmspb/autokey.pb.go +++ b/vendor/cloud.google.com/go/kms/apiv1/kmspb/autokey.pb.go @@ -21,16 +21,13 @@ package kmspb import ( + reflect "reflect" + sync "sync" + longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" - context "context" _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) const ( @@ -613,173 +610,3 @@ func file_google_cloud_kms_v1_autokey_proto_init() { file_google_cloud_kms_v1_autokey_proto_goTypes = nil file_google_cloud_kms_v1_autokey_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// AutokeyClient is the client API for Autokey service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type AutokeyClient interface { - // Creates a new [KeyHandle][google.cloud.kms.v1.KeyHandle], triggering the - // provisioning of a new [CryptoKey][google.cloud.kms.v1.CryptoKey] for CMEK - // use with the given resource type in the configured key project and the same - // location. [GetOperation][google.longrunning.Operations.GetOperation] should - // be used to resolve the resulting long-running operation and get the - // resulting [KeyHandle][google.cloud.kms.v1.KeyHandle] and - // [CryptoKey][google.cloud.kms.v1.CryptoKey]. - CreateKeyHandle(ctx context.Context, in *CreateKeyHandleRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) - // Returns the [KeyHandle][google.cloud.kms.v1.KeyHandle]. - GetKeyHandle(ctx context.Context, in *GetKeyHandleRequest, opts ...grpc.CallOption) (*KeyHandle, error) - // Lists [KeyHandles][google.cloud.kms.v1.KeyHandle]. - ListKeyHandles(ctx context.Context, in *ListKeyHandlesRequest, opts ...grpc.CallOption) (*ListKeyHandlesResponse, error) -} - -type autokeyClient struct { - cc grpc.ClientConnInterface -} - -func NewAutokeyClient(cc grpc.ClientConnInterface) AutokeyClient { - return &autokeyClient{cc} -} - -func (c *autokeyClient) CreateKeyHandle(ctx context.Context, in *CreateKeyHandleRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) { - out := new(longrunningpb.Operation) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.Autokey/CreateKeyHandle", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *autokeyClient) GetKeyHandle(ctx context.Context, in *GetKeyHandleRequest, opts ...grpc.CallOption) (*KeyHandle, error) { - out := new(KeyHandle) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.Autokey/GetKeyHandle", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *autokeyClient) ListKeyHandles(ctx context.Context, in *ListKeyHandlesRequest, opts ...grpc.CallOption) (*ListKeyHandlesResponse, error) { - out := new(ListKeyHandlesResponse) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.Autokey/ListKeyHandles", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// AutokeyServer is the server API for Autokey service. -type AutokeyServer interface { - // Creates a new [KeyHandle][google.cloud.kms.v1.KeyHandle], triggering the - // provisioning of a new [CryptoKey][google.cloud.kms.v1.CryptoKey] for CMEK - // use with the given resource type in the configured key project and the same - // location. [GetOperation][google.longrunning.Operations.GetOperation] should - // be used to resolve the resulting long-running operation and get the - // resulting [KeyHandle][google.cloud.kms.v1.KeyHandle] and - // [CryptoKey][google.cloud.kms.v1.CryptoKey]. - CreateKeyHandle(context.Context, *CreateKeyHandleRequest) (*longrunningpb.Operation, error) - // Returns the [KeyHandle][google.cloud.kms.v1.KeyHandle]. - GetKeyHandle(context.Context, *GetKeyHandleRequest) (*KeyHandle, error) - // Lists [KeyHandles][google.cloud.kms.v1.KeyHandle]. - ListKeyHandles(context.Context, *ListKeyHandlesRequest) (*ListKeyHandlesResponse, error) -} - -// UnimplementedAutokeyServer can be embedded to have forward compatible implementations. -type UnimplementedAutokeyServer struct { -} - -func (*UnimplementedAutokeyServer) CreateKeyHandle(context.Context, *CreateKeyHandleRequest) (*longrunningpb.Operation, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateKeyHandle not implemented") -} -func (*UnimplementedAutokeyServer) GetKeyHandle(context.Context, *GetKeyHandleRequest) (*KeyHandle, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetKeyHandle not implemented") -} -func (*UnimplementedAutokeyServer) ListKeyHandles(context.Context, *ListKeyHandlesRequest) (*ListKeyHandlesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListKeyHandles not implemented") -} - -func RegisterAutokeyServer(s *grpc.Server, srv AutokeyServer) { - s.RegisterService(&_Autokey_serviceDesc, srv) -} - -func _Autokey_CreateKeyHandle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateKeyHandleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AutokeyServer).CreateKeyHandle(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.Autokey/CreateKeyHandle", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AutokeyServer).CreateKeyHandle(ctx, req.(*CreateKeyHandleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Autokey_GetKeyHandle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetKeyHandleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AutokeyServer).GetKeyHandle(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.Autokey/GetKeyHandle", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AutokeyServer).GetKeyHandle(ctx, req.(*GetKeyHandleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Autokey_ListKeyHandles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListKeyHandlesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AutokeyServer).ListKeyHandles(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.Autokey/ListKeyHandles", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AutokeyServer).ListKeyHandles(ctx, req.(*ListKeyHandlesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Autokey_serviceDesc = grpc.ServiceDesc{ - ServiceName: "google.cloud.kms.v1.Autokey", - HandlerType: (*AutokeyServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "CreateKeyHandle", - Handler: _Autokey_CreateKeyHandle_Handler, - }, - { - MethodName: "GetKeyHandle", - Handler: _Autokey_GetKeyHandle_Handler, - }, - { - MethodName: "ListKeyHandles", - Handler: _Autokey_ListKeyHandles_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "google/cloud/kms/v1/autokey.proto", -} diff --git a/vendor/cloud.google.com/go/kms/apiv1/kmspb/autokey_admin.pb.go b/vendor/cloud.google.com/go/kms/apiv1/kmspb/autokey_admin.pb.go index e0569d61142..edae5613414 100644 --- a/vendor/cloud.google.com/go/kms/apiv1/kmspb/autokey_admin.pb.go +++ b/vendor/cloud.google.com/go/kms/apiv1/kmspb/autokey_admin.pb.go @@ -21,16 +21,13 @@ package kmspb import ( - context "context" + reflect "reflect" + sync "sync" + _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" - reflect "reflect" - sync "sync" ) const ( @@ -581,175 +578,3 @@ func file_google_cloud_kms_v1_autokey_admin_proto_init() { file_google_cloud_kms_v1_autokey_admin_proto_goTypes = nil file_google_cloud_kms_v1_autokey_admin_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// AutokeyAdminClient is the client API for AutokeyAdmin service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type AutokeyAdminClient interface { - // Updates the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] for a - // folder. The caller must have both `cloudkms.autokeyConfigs.update` - // permission on the parent folder and `cloudkms.cryptoKeys.setIamPolicy` - // permission on the provided key project. A - // [KeyHandle][google.cloud.kms.v1.KeyHandle] creation in the folder's - // descendant projects will use this configuration to determine where to - // create the resulting [CryptoKey][google.cloud.kms.v1.CryptoKey]. - UpdateAutokeyConfig(ctx context.Context, in *UpdateAutokeyConfigRequest, opts ...grpc.CallOption) (*AutokeyConfig, error) - // Returns the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] for a - // folder. - GetAutokeyConfig(ctx context.Context, in *GetAutokeyConfigRequest, opts ...grpc.CallOption) (*AutokeyConfig, error) - // Returns the effective Cloud KMS Autokey configuration for a given project. - ShowEffectiveAutokeyConfig(ctx context.Context, in *ShowEffectiveAutokeyConfigRequest, opts ...grpc.CallOption) (*ShowEffectiveAutokeyConfigResponse, error) -} - -type autokeyAdminClient struct { - cc grpc.ClientConnInterface -} - -func NewAutokeyAdminClient(cc grpc.ClientConnInterface) AutokeyAdminClient { - return &autokeyAdminClient{cc} -} - -func (c *autokeyAdminClient) UpdateAutokeyConfig(ctx context.Context, in *UpdateAutokeyConfigRequest, opts ...grpc.CallOption) (*AutokeyConfig, error) { - out := new(AutokeyConfig) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.AutokeyAdmin/UpdateAutokeyConfig", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *autokeyAdminClient) GetAutokeyConfig(ctx context.Context, in *GetAutokeyConfigRequest, opts ...grpc.CallOption) (*AutokeyConfig, error) { - out := new(AutokeyConfig) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.AutokeyAdmin/GetAutokeyConfig", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *autokeyAdminClient) ShowEffectiveAutokeyConfig(ctx context.Context, in *ShowEffectiveAutokeyConfigRequest, opts ...grpc.CallOption) (*ShowEffectiveAutokeyConfigResponse, error) { - out := new(ShowEffectiveAutokeyConfigResponse) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.AutokeyAdmin/ShowEffectiveAutokeyConfig", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// AutokeyAdminServer is the server API for AutokeyAdmin service. -type AutokeyAdminServer interface { - // Updates the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] for a - // folder. The caller must have both `cloudkms.autokeyConfigs.update` - // permission on the parent folder and `cloudkms.cryptoKeys.setIamPolicy` - // permission on the provided key project. A - // [KeyHandle][google.cloud.kms.v1.KeyHandle] creation in the folder's - // descendant projects will use this configuration to determine where to - // create the resulting [CryptoKey][google.cloud.kms.v1.CryptoKey]. - UpdateAutokeyConfig(context.Context, *UpdateAutokeyConfigRequest) (*AutokeyConfig, error) - // Returns the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] for a - // folder. - GetAutokeyConfig(context.Context, *GetAutokeyConfigRequest) (*AutokeyConfig, error) - // Returns the effective Cloud KMS Autokey configuration for a given project. - ShowEffectiveAutokeyConfig(context.Context, *ShowEffectiveAutokeyConfigRequest) (*ShowEffectiveAutokeyConfigResponse, error) -} - -// UnimplementedAutokeyAdminServer can be embedded to have forward compatible implementations. -type UnimplementedAutokeyAdminServer struct { -} - -func (*UnimplementedAutokeyAdminServer) UpdateAutokeyConfig(context.Context, *UpdateAutokeyConfigRequest) (*AutokeyConfig, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateAutokeyConfig not implemented") -} -func (*UnimplementedAutokeyAdminServer) GetAutokeyConfig(context.Context, *GetAutokeyConfigRequest) (*AutokeyConfig, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetAutokeyConfig not implemented") -} -func (*UnimplementedAutokeyAdminServer) ShowEffectiveAutokeyConfig(context.Context, *ShowEffectiveAutokeyConfigRequest) (*ShowEffectiveAutokeyConfigResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ShowEffectiveAutokeyConfig not implemented") -} - -func RegisterAutokeyAdminServer(s *grpc.Server, srv AutokeyAdminServer) { - s.RegisterService(&_AutokeyAdmin_serviceDesc, srv) -} - -func _AutokeyAdmin_UpdateAutokeyConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateAutokeyConfigRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AutokeyAdminServer).UpdateAutokeyConfig(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.AutokeyAdmin/UpdateAutokeyConfig", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AutokeyAdminServer).UpdateAutokeyConfig(ctx, req.(*UpdateAutokeyConfigRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AutokeyAdmin_GetAutokeyConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetAutokeyConfigRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AutokeyAdminServer).GetAutokeyConfig(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.AutokeyAdmin/GetAutokeyConfig", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AutokeyAdminServer).GetAutokeyConfig(ctx, req.(*GetAutokeyConfigRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AutokeyAdmin_ShowEffectiveAutokeyConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ShowEffectiveAutokeyConfigRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AutokeyAdminServer).ShowEffectiveAutokeyConfig(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.AutokeyAdmin/ShowEffectiveAutokeyConfig", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AutokeyAdminServer).ShowEffectiveAutokeyConfig(ctx, req.(*ShowEffectiveAutokeyConfigRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _AutokeyAdmin_serviceDesc = grpc.ServiceDesc{ - ServiceName: "google.cloud.kms.v1.AutokeyAdmin", - HandlerType: (*AutokeyAdminServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "UpdateAutokeyConfig", - Handler: _AutokeyAdmin_UpdateAutokeyConfig_Handler, - }, - { - MethodName: "GetAutokeyConfig", - Handler: _AutokeyAdmin_GetAutokeyConfig_Handler, - }, - { - MethodName: "ShowEffectiveAutokeyConfig", - Handler: _AutokeyAdmin_ShowEffectiveAutokeyConfig_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "google/cloud/kms/v1/autokey_admin.proto", -} diff --git a/vendor/cloud.google.com/go/kms/apiv1/kmspb/autokey_admin_grpc.pb.go b/vendor/cloud.google.com/go/kms/apiv1/kmspb/autokey_admin_grpc.pb.go new file mode 100644 index 00000000000..40fa0dc918b --- /dev/null +++ b/vendor/cloud.google.com/go/kms/apiv1/kmspb/autokey_admin_grpc.pb.go @@ -0,0 +1,216 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.7 +// source: google/cloud/kms/v1/autokey_admin.proto + +package kmspb + +import ( + context "context" + + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + AutokeyAdmin_UpdateAutokeyConfig_FullMethodName = "/google.cloud.kms.v1.AutokeyAdmin/UpdateAutokeyConfig" + AutokeyAdmin_GetAutokeyConfig_FullMethodName = "/google.cloud.kms.v1.AutokeyAdmin/GetAutokeyConfig" + AutokeyAdmin_ShowEffectiveAutokeyConfig_FullMethodName = "/google.cloud.kms.v1.AutokeyAdmin/ShowEffectiveAutokeyConfig" +) + +// AutokeyAdminClient is the client API for AutokeyAdmin service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type AutokeyAdminClient interface { + // Updates the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] for a + // folder. The caller must have both `cloudkms.autokeyConfigs.update` + // permission on the parent folder and `cloudkms.cryptoKeys.setIamPolicy` + // permission on the provided key project. A + // [KeyHandle][google.cloud.kms.v1.KeyHandle] creation in the folder's + // descendant projects will use this configuration to determine where to + // create the resulting [CryptoKey][google.cloud.kms.v1.CryptoKey]. + UpdateAutokeyConfig(ctx context.Context, in *UpdateAutokeyConfigRequest, opts ...grpc.CallOption) (*AutokeyConfig, error) + // Returns the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] for a + // folder. + GetAutokeyConfig(ctx context.Context, in *GetAutokeyConfigRequest, opts ...grpc.CallOption) (*AutokeyConfig, error) + // Returns the effective Cloud KMS Autokey configuration for a given project. + ShowEffectiveAutokeyConfig(ctx context.Context, in *ShowEffectiveAutokeyConfigRequest, opts ...grpc.CallOption) (*ShowEffectiveAutokeyConfigResponse, error) +} + +type autokeyAdminClient struct { + cc grpc.ClientConnInterface +} + +func NewAutokeyAdminClient(cc grpc.ClientConnInterface) AutokeyAdminClient { + return &autokeyAdminClient{cc} +} + +func (c *autokeyAdminClient) UpdateAutokeyConfig(ctx context.Context, in *UpdateAutokeyConfigRequest, opts ...grpc.CallOption) (*AutokeyConfig, error) { + out := new(AutokeyConfig) + err := c.cc.Invoke(ctx, AutokeyAdmin_UpdateAutokeyConfig_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *autokeyAdminClient) GetAutokeyConfig(ctx context.Context, in *GetAutokeyConfigRequest, opts ...grpc.CallOption) (*AutokeyConfig, error) { + out := new(AutokeyConfig) + err := c.cc.Invoke(ctx, AutokeyAdmin_GetAutokeyConfig_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *autokeyAdminClient) ShowEffectiveAutokeyConfig(ctx context.Context, in *ShowEffectiveAutokeyConfigRequest, opts ...grpc.CallOption) (*ShowEffectiveAutokeyConfigResponse, error) { + out := new(ShowEffectiveAutokeyConfigResponse) + err := c.cc.Invoke(ctx, AutokeyAdmin_ShowEffectiveAutokeyConfig_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AutokeyAdminServer is the server API for AutokeyAdmin service. +// All implementations should embed UnimplementedAutokeyAdminServer +// for forward compatibility +type AutokeyAdminServer interface { + // Updates the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] for a + // folder. The caller must have both `cloudkms.autokeyConfigs.update` + // permission on the parent folder and `cloudkms.cryptoKeys.setIamPolicy` + // permission on the provided key project. A + // [KeyHandle][google.cloud.kms.v1.KeyHandle] creation in the folder's + // descendant projects will use this configuration to determine where to + // create the resulting [CryptoKey][google.cloud.kms.v1.CryptoKey]. + UpdateAutokeyConfig(context.Context, *UpdateAutokeyConfigRequest) (*AutokeyConfig, error) + // Returns the [AutokeyConfig][google.cloud.kms.v1.AutokeyConfig] for a + // folder. + GetAutokeyConfig(context.Context, *GetAutokeyConfigRequest) (*AutokeyConfig, error) + // Returns the effective Cloud KMS Autokey configuration for a given project. + ShowEffectiveAutokeyConfig(context.Context, *ShowEffectiveAutokeyConfigRequest) (*ShowEffectiveAutokeyConfigResponse, error) +} + +// UnimplementedAutokeyAdminServer should be embedded to have forward compatible implementations. +type UnimplementedAutokeyAdminServer struct { +} + +func (UnimplementedAutokeyAdminServer) UpdateAutokeyConfig(context.Context, *UpdateAutokeyConfigRequest) (*AutokeyConfig, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateAutokeyConfig not implemented") +} +func (UnimplementedAutokeyAdminServer) GetAutokeyConfig(context.Context, *GetAutokeyConfigRequest) (*AutokeyConfig, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAutokeyConfig not implemented") +} +func (UnimplementedAutokeyAdminServer) ShowEffectiveAutokeyConfig(context.Context, *ShowEffectiveAutokeyConfigRequest) (*ShowEffectiveAutokeyConfigResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ShowEffectiveAutokeyConfig not implemented") +} + +// UnsafeAutokeyAdminServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to AutokeyAdminServer will +// result in compilation errors. +type UnsafeAutokeyAdminServer interface { + mustEmbedUnimplementedAutokeyAdminServer() +} + +func RegisterAutokeyAdminServer(s grpc.ServiceRegistrar, srv AutokeyAdminServer) { + s.RegisterService(&AutokeyAdmin_ServiceDesc, srv) +} + +func _AutokeyAdmin_UpdateAutokeyConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateAutokeyConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AutokeyAdminServer).UpdateAutokeyConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AutokeyAdmin_UpdateAutokeyConfig_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AutokeyAdminServer).UpdateAutokeyConfig(ctx, req.(*UpdateAutokeyConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AutokeyAdmin_GetAutokeyConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAutokeyConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AutokeyAdminServer).GetAutokeyConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AutokeyAdmin_GetAutokeyConfig_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AutokeyAdminServer).GetAutokeyConfig(ctx, req.(*GetAutokeyConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AutokeyAdmin_ShowEffectiveAutokeyConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ShowEffectiveAutokeyConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AutokeyAdminServer).ShowEffectiveAutokeyConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AutokeyAdmin_ShowEffectiveAutokeyConfig_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AutokeyAdminServer).ShowEffectiveAutokeyConfig(ctx, req.(*ShowEffectiveAutokeyConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// AutokeyAdmin_ServiceDesc is the grpc.ServiceDesc for AutokeyAdmin service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var AutokeyAdmin_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "google.cloud.kms.v1.AutokeyAdmin", + HandlerType: (*AutokeyAdminServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateAutokeyConfig", + Handler: _AutokeyAdmin_UpdateAutokeyConfig_Handler, + }, + { + MethodName: "GetAutokeyConfig", + Handler: _AutokeyAdmin_GetAutokeyConfig_Handler, + }, + { + MethodName: "ShowEffectiveAutokeyConfig", + Handler: _AutokeyAdmin_ShowEffectiveAutokeyConfig_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/cloud/kms/v1/autokey_admin.proto", +} diff --git a/vendor/cloud.google.com/go/kms/apiv1/kmspb/autokey_grpc.pb.go b/vendor/cloud.google.com/go/kms/apiv1/kmspb/autokey_grpc.pb.go new file mode 100644 index 00000000000..323e72ab80d --- /dev/null +++ b/vendor/cloud.google.com/go/kms/apiv1/kmspb/autokey_grpc.pb.go @@ -0,0 +1,215 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.7 +// source: google/cloud/kms/v1/autokey.proto + +package kmspb + +import ( + context "context" + + longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Autokey_CreateKeyHandle_FullMethodName = "/google.cloud.kms.v1.Autokey/CreateKeyHandle" + Autokey_GetKeyHandle_FullMethodName = "/google.cloud.kms.v1.Autokey/GetKeyHandle" + Autokey_ListKeyHandles_FullMethodName = "/google.cloud.kms.v1.Autokey/ListKeyHandles" +) + +// AutokeyClient is the client API for Autokey service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type AutokeyClient interface { + // Creates a new [KeyHandle][google.cloud.kms.v1.KeyHandle], triggering the + // provisioning of a new [CryptoKey][google.cloud.kms.v1.CryptoKey] for CMEK + // use with the given resource type in the configured key project and the same + // location. [GetOperation][google.longrunning.Operations.GetOperation] should + // be used to resolve the resulting long-running operation and get the + // resulting [KeyHandle][google.cloud.kms.v1.KeyHandle] and + // [CryptoKey][google.cloud.kms.v1.CryptoKey]. + CreateKeyHandle(ctx context.Context, in *CreateKeyHandleRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) + // Returns the [KeyHandle][google.cloud.kms.v1.KeyHandle]. + GetKeyHandle(ctx context.Context, in *GetKeyHandleRequest, opts ...grpc.CallOption) (*KeyHandle, error) + // Lists [KeyHandles][google.cloud.kms.v1.KeyHandle]. + ListKeyHandles(ctx context.Context, in *ListKeyHandlesRequest, opts ...grpc.CallOption) (*ListKeyHandlesResponse, error) +} + +type autokeyClient struct { + cc grpc.ClientConnInterface +} + +func NewAutokeyClient(cc grpc.ClientConnInterface) AutokeyClient { + return &autokeyClient{cc} +} + +func (c *autokeyClient) CreateKeyHandle(ctx context.Context, in *CreateKeyHandleRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) { + out := new(longrunningpb.Operation) + err := c.cc.Invoke(ctx, Autokey_CreateKeyHandle_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *autokeyClient) GetKeyHandle(ctx context.Context, in *GetKeyHandleRequest, opts ...grpc.CallOption) (*KeyHandle, error) { + out := new(KeyHandle) + err := c.cc.Invoke(ctx, Autokey_GetKeyHandle_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *autokeyClient) ListKeyHandles(ctx context.Context, in *ListKeyHandlesRequest, opts ...grpc.CallOption) (*ListKeyHandlesResponse, error) { + out := new(ListKeyHandlesResponse) + err := c.cc.Invoke(ctx, Autokey_ListKeyHandles_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AutokeyServer is the server API for Autokey service. +// All implementations should embed UnimplementedAutokeyServer +// for forward compatibility +type AutokeyServer interface { + // Creates a new [KeyHandle][google.cloud.kms.v1.KeyHandle], triggering the + // provisioning of a new [CryptoKey][google.cloud.kms.v1.CryptoKey] for CMEK + // use with the given resource type in the configured key project and the same + // location. [GetOperation][google.longrunning.Operations.GetOperation] should + // be used to resolve the resulting long-running operation and get the + // resulting [KeyHandle][google.cloud.kms.v1.KeyHandle] and + // [CryptoKey][google.cloud.kms.v1.CryptoKey]. + CreateKeyHandle(context.Context, *CreateKeyHandleRequest) (*longrunningpb.Operation, error) + // Returns the [KeyHandle][google.cloud.kms.v1.KeyHandle]. + GetKeyHandle(context.Context, *GetKeyHandleRequest) (*KeyHandle, error) + // Lists [KeyHandles][google.cloud.kms.v1.KeyHandle]. + ListKeyHandles(context.Context, *ListKeyHandlesRequest) (*ListKeyHandlesResponse, error) +} + +// UnimplementedAutokeyServer should be embedded to have forward compatible implementations. +type UnimplementedAutokeyServer struct { +} + +func (UnimplementedAutokeyServer) CreateKeyHandle(context.Context, *CreateKeyHandleRequest) (*longrunningpb.Operation, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateKeyHandle not implemented") +} +func (UnimplementedAutokeyServer) GetKeyHandle(context.Context, *GetKeyHandleRequest) (*KeyHandle, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetKeyHandle not implemented") +} +func (UnimplementedAutokeyServer) ListKeyHandles(context.Context, *ListKeyHandlesRequest) (*ListKeyHandlesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListKeyHandles not implemented") +} + +// UnsafeAutokeyServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to AutokeyServer will +// result in compilation errors. +type UnsafeAutokeyServer interface { + mustEmbedUnimplementedAutokeyServer() +} + +func RegisterAutokeyServer(s grpc.ServiceRegistrar, srv AutokeyServer) { + s.RegisterService(&Autokey_ServiceDesc, srv) +} + +func _Autokey_CreateKeyHandle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateKeyHandleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AutokeyServer).CreateKeyHandle(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Autokey_CreateKeyHandle_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AutokeyServer).CreateKeyHandle(ctx, req.(*CreateKeyHandleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Autokey_GetKeyHandle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetKeyHandleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AutokeyServer).GetKeyHandle(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Autokey_GetKeyHandle_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AutokeyServer).GetKeyHandle(ctx, req.(*GetKeyHandleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Autokey_ListKeyHandles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListKeyHandlesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AutokeyServer).ListKeyHandles(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Autokey_ListKeyHandles_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AutokeyServer).ListKeyHandles(ctx, req.(*ListKeyHandlesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Autokey_ServiceDesc is the grpc.ServiceDesc for Autokey service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Autokey_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "google.cloud.kms.v1.Autokey", + HandlerType: (*AutokeyServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateKeyHandle", + Handler: _Autokey_CreateKeyHandle_Handler, + }, + { + MethodName: "GetKeyHandle", + Handler: _Autokey_GetKeyHandle_Handler, + }, + { + MethodName: "ListKeyHandles", + Handler: _Autokey_ListKeyHandles_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/cloud/kms/v1/autokey.proto", +} diff --git a/vendor/cloud.google.com/go/kms/apiv1/kmspb/ekm_service.pb.go b/vendor/cloud.google.com/go/kms/apiv1/kmspb/ekm_service.pb.go index 13f4e252415..73af2e9fc20 100644 --- a/vendor/cloud.google.com/go/kms/apiv1/kmspb/ekm_service.pb.go +++ b/vendor/cloud.google.com/go/kms/apiv1/kmspb/ekm_service.pb.go @@ -21,17 +21,14 @@ package kmspb import ( - context "context" + reflect "reflect" + sync "sync" + _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" ) const ( @@ -1458,329 +1455,3 @@ func file_google_cloud_kms_v1_ekm_service_proto_init() { file_google_cloud_kms_v1_ekm_service_proto_goTypes = nil file_google_cloud_kms_v1_ekm_service_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// EkmServiceClient is the client API for EkmService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type EkmServiceClient interface { - // Lists [EkmConnections][google.cloud.kms.v1.EkmConnection]. - ListEkmConnections(ctx context.Context, in *ListEkmConnectionsRequest, opts ...grpc.CallOption) (*ListEkmConnectionsResponse, error) - // Returns metadata for a given - // [EkmConnection][google.cloud.kms.v1.EkmConnection]. - GetEkmConnection(ctx context.Context, in *GetEkmConnectionRequest, opts ...grpc.CallOption) (*EkmConnection, error) - // Creates a new [EkmConnection][google.cloud.kms.v1.EkmConnection] in a given - // Project and Location. - CreateEkmConnection(ctx context.Context, in *CreateEkmConnectionRequest, opts ...grpc.CallOption) (*EkmConnection, error) - // Updates an [EkmConnection][google.cloud.kms.v1.EkmConnection]'s metadata. - UpdateEkmConnection(ctx context.Context, in *UpdateEkmConnectionRequest, opts ...grpc.CallOption) (*EkmConnection, error) - // Returns the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton resource - // for a given project and location. - GetEkmConfig(ctx context.Context, in *GetEkmConfigRequest, opts ...grpc.CallOption) (*EkmConfig, error) - // Updates the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton resource - // for a given project and location. - UpdateEkmConfig(ctx context.Context, in *UpdateEkmConfigRequest, opts ...grpc.CallOption) (*EkmConfig, error) - // Verifies that Cloud KMS can successfully connect to the external key - // manager specified by an [EkmConnection][google.cloud.kms.v1.EkmConnection]. - // If there is an error connecting to the EKM, this method returns a - // FAILED_PRECONDITION status containing structured information as described - // at https://cloud.google.com/kms/docs/reference/ekm_errors. - VerifyConnectivity(ctx context.Context, in *VerifyConnectivityRequest, opts ...grpc.CallOption) (*VerifyConnectivityResponse, error) -} - -type ekmServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewEkmServiceClient(cc grpc.ClientConnInterface) EkmServiceClient { - return &ekmServiceClient{cc} -} - -func (c *ekmServiceClient) ListEkmConnections(ctx context.Context, in *ListEkmConnectionsRequest, opts ...grpc.CallOption) (*ListEkmConnectionsResponse, error) { - out := new(ListEkmConnectionsResponse) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.EkmService/ListEkmConnections", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *ekmServiceClient) GetEkmConnection(ctx context.Context, in *GetEkmConnectionRequest, opts ...grpc.CallOption) (*EkmConnection, error) { - out := new(EkmConnection) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.EkmService/GetEkmConnection", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *ekmServiceClient) CreateEkmConnection(ctx context.Context, in *CreateEkmConnectionRequest, opts ...grpc.CallOption) (*EkmConnection, error) { - out := new(EkmConnection) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.EkmService/CreateEkmConnection", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *ekmServiceClient) UpdateEkmConnection(ctx context.Context, in *UpdateEkmConnectionRequest, opts ...grpc.CallOption) (*EkmConnection, error) { - out := new(EkmConnection) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.EkmService/UpdateEkmConnection", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *ekmServiceClient) GetEkmConfig(ctx context.Context, in *GetEkmConfigRequest, opts ...grpc.CallOption) (*EkmConfig, error) { - out := new(EkmConfig) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.EkmService/GetEkmConfig", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *ekmServiceClient) UpdateEkmConfig(ctx context.Context, in *UpdateEkmConfigRequest, opts ...grpc.CallOption) (*EkmConfig, error) { - out := new(EkmConfig) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.EkmService/UpdateEkmConfig", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *ekmServiceClient) VerifyConnectivity(ctx context.Context, in *VerifyConnectivityRequest, opts ...grpc.CallOption) (*VerifyConnectivityResponse, error) { - out := new(VerifyConnectivityResponse) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.EkmService/VerifyConnectivity", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// EkmServiceServer is the server API for EkmService service. -type EkmServiceServer interface { - // Lists [EkmConnections][google.cloud.kms.v1.EkmConnection]. - ListEkmConnections(context.Context, *ListEkmConnectionsRequest) (*ListEkmConnectionsResponse, error) - // Returns metadata for a given - // [EkmConnection][google.cloud.kms.v1.EkmConnection]. - GetEkmConnection(context.Context, *GetEkmConnectionRequest) (*EkmConnection, error) - // Creates a new [EkmConnection][google.cloud.kms.v1.EkmConnection] in a given - // Project and Location. - CreateEkmConnection(context.Context, *CreateEkmConnectionRequest) (*EkmConnection, error) - // Updates an [EkmConnection][google.cloud.kms.v1.EkmConnection]'s metadata. - UpdateEkmConnection(context.Context, *UpdateEkmConnectionRequest) (*EkmConnection, error) - // Returns the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton resource - // for a given project and location. - GetEkmConfig(context.Context, *GetEkmConfigRequest) (*EkmConfig, error) - // Updates the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton resource - // for a given project and location. - UpdateEkmConfig(context.Context, *UpdateEkmConfigRequest) (*EkmConfig, error) - // Verifies that Cloud KMS can successfully connect to the external key - // manager specified by an [EkmConnection][google.cloud.kms.v1.EkmConnection]. - // If there is an error connecting to the EKM, this method returns a - // FAILED_PRECONDITION status containing structured information as described - // at https://cloud.google.com/kms/docs/reference/ekm_errors. - VerifyConnectivity(context.Context, *VerifyConnectivityRequest) (*VerifyConnectivityResponse, error) -} - -// UnimplementedEkmServiceServer can be embedded to have forward compatible implementations. -type UnimplementedEkmServiceServer struct { -} - -func (*UnimplementedEkmServiceServer) ListEkmConnections(context.Context, *ListEkmConnectionsRequest) (*ListEkmConnectionsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListEkmConnections not implemented") -} -func (*UnimplementedEkmServiceServer) GetEkmConnection(context.Context, *GetEkmConnectionRequest) (*EkmConnection, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetEkmConnection not implemented") -} -func (*UnimplementedEkmServiceServer) CreateEkmConnection(context.Context, *CreateEkmConnectionRequest) (*EkmConnection, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateEkmConnection not implemented") -} -func (*UnimplementedEkmServiceServer) UpdateEkmConnection(context.Context, *UpdateEkmConnectionRequest) (*EkmConnection, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateEkmConnection not implemented") -} -func (*UnimplementedEkmServiceServer) GetEkmConfig(context.Context, *GetEkmConfigRequest) (*EkmConfig, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetEkmConfig not implemented") -} -func (*UnimplementedEkmServiceServer) UpdateEkmConfig(context.Context, *UpdateEkmConfigRequest) (*EkmConfig, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateEkmConfig not implemented") -} -func (*UnimplementedEkmServiceServer) VerifyConnectivity(context.Context, *VerifyConnectivityRequest) (*VerifyConnectivityResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method VerifyConnectivity not implemented") -} - -func RegisterEkmServiceServer(s *grpc.Server, srv EkmServiceServer) { - s.RegisterService(&_EkmService_serviceDesc, srv) -} - -func _EkmService_ListEkmConnections_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListEkmConnectionsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(EkmServiceServer).ListEkmConnections(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.EkmService/ListEkmConnections", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(EkmServiceServer).ListEkmConnections(ctx, req.(*ListEkmConnectionsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _EkmService_GetEkmConnection_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetEkmConnectionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(EkmServiceServer).GetEkmConnection(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.EkmService/GetEkmConnection", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(EkmServiceServer).GetEkmConnection(ctx, req.(*GetEkmConnectionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _EkmService_CreateEkmConnection_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateEkmConnectionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(EkmServiceServer).CreateEkmConnection(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.EkmService/CreateEkmConnection", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(EkmServiceServer).CreateEkmConnection(ctx, req.(*CreateEkmConnectionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _EkmService_UpdateEkmConnection_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateEkmConnectionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(EkmServiceServer).UpdateEkmConnection(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.EkmService/UpdateEkmConnection", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(EkmServiceServer).UpdateEkmConnection(ctx, req.(*UpdateEkmConnectionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _EkmService_GetEkmConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetEkmConfigRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(EkmServiceServer).GetEkmConfig(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.EkmService/GetEkmConfig", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(EkmServiceServer).GetEkmConfig(ctx, req.(*GetEkmConfigRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _EkmService_UpdateEkmConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateEkmConfigRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(EkmServiceServer).UpdateEkmConfig(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.EkmService/UpdateEkmConfig", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(EkmServiceServer).UpdateEkmConfig(ctx, req.(*UpdateEkmConfigRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _EkmService_VerifyConnectivity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(VerifyConnectivityRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(EkmServiceServer).VerifyConnectivity(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.EkmService/VerifyConnectivity", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(EkmServiceServer).VerifyConnectivity(ctx, req.(*VerifyConnectivityRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _EkmService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "google.cloud.kms.v1.EkmService", - HandlerType: (*EkmServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListEkmConnections", - Handler: _EkmService_ListEkmConnections_Handler, - }, - { - MethodName: "GetEkmConnection", - Handler: _EkmService_GetEkmConnection_Handler, - }, - { - MethodName: "CreateEkmConnection", - Handler: _EkmService_CreateEkmConnection_Handler, - }, - { - MethodName: "UpdateEkmConnection", - Handler: _EkmService_UpdateEkmConnection_Handler, - }, - { - MethodName: "GetEkmConfig", - Handler: _EkmService_GetEkmConfig_Handler, - }, - { - MethodName: "UpdateEkmConfig", - Handler: _EkmService_UpdateEkmConfig_Handler, - }, - { - MethodName: "VerifyConnectivity", - Handler: _EkmService_VerifyConnectivity_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "google/cloud/kms/v1/ekm_service.proto", -} diff --git a/vendor/cloud.google.com/go/kms/apiv1/kmspb/ekm_service_grpc.pb.go b/vendor/cloud.google.com/go/kms/apiv1/kmspb/ekm_service_grpc.pb.go new file mode 100644 index 00000000000..57506c0da57 --- /dev/null +++ b/vendor/cloud.google.com/go/kms/apiv1/kmspb/ekm_service_grpc.pb.go @@ -0,0 +1,374 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.7 +// source: google/cloud/kms/v1/ekm_service.proto + +package kmspb + +import ( + context "context" + + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + EkmService_ListEkmConnections_FullMethodName = "/google.cloud.kms.v1.EkmService/ListEkmConnections" + EkmService_GetEkmConnection_FullMethodName = "/google.cloud.kms.v1.EkmService/GetEkmConnection" + EkmService_CreateEkmConnection_FullMethodName = "/google.cloud.kms.v1.EkmService/CreateEkmConnection" + EkmService_UpdateEkmConnection_FullMethodName = "/google.cloud.kms.v1.EkmService/UpdateEkmConnection" + EkmService_GetEkmConfig_FullMethodName = "/google.cloud.kms.v1.EkmService/GetEkmConfig" + EkmService_UpdateEkmConfig_FullMethodName = "/google.cloud.kms.v1.EkmService/UpdateEkmConfig" + EkmService_VerifyConnectivity_FullMethodName = "/google.cloud.kms.v1.EkmService/VerifyConnectivity" +) + +// EkmServiceClient is the client API for EkmService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type EkmServiceClient interface { + // Lists [EkmConnections][google.cloud.kms.v1.EkmConnection]. + ListEkmConnections(ctx context.Context, in *ListEkmConnectionsRequest, opts ...grpc.CallOption) (*ListEkmConnectionsResponse, error) + // Returns metadata for a given + // [EkmConnection][google.cloud.kms.v1.EkmConnection]. + GetEkmConnection(ctx context.Context, in *GetEkmConnectionRequest, opts ...grpc.CallOption) (*EkmConnection, error) + // Creates a new [EkmConnection][google.cloud.kms.v1.EkmConnection] in a given + // Project and Location. + CreateEkmConnection(ctx context.Context, in *CreateEkmConnectionRequest, opts ...grpc.CallOption) (*EkmConnection, error) + // Updates an [EkmConnection][google.cloud.kms.v1.EkmConnection]'s metadata. + UpdateEkmConnection(ctx context.Context, in *UpdateEkmConnectionRequest, opts ...grpc.CallOption) (*EkmConnection, error) + // Returns the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton resource + // for a given project and location. + GetEkmConfig(ctx context.Context, in *GetEkmConfigRequest, opts ...grpc.CallOption) (*EkmConfig, error) + // Updates the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton resource + // for a given project and location. + UpdateEkmConfig(ctx context.Context, in *UpdateEkmConfigRequest, opts ...grpc.CallOption) (*EkmConfig, error) + // Verifies that Cloud KMS can successfully connect to the external key + // manager specified by an [EkmConnection][google.cloud.kms.v1.EkmConnection]. + // If there is an error connecting to the EKM, this method returns a + // FAILED_PRECONDITION status containing structured information as described + // at https://cloud.google.com/kms/docs/reference/ekm_errors. + VerifyConnectivity(ctx context.Context, in *VerifyConnectivityRequest, opts ...grpc.CallOption) (*VerifyConnectivityResponse, error) +} + +type ekmServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewEkmServiceClient(cc grpc.ClientConnInterface) EkmServiceClient { + return &ekmServiceClient{cc} +} + +func (c *ekmServiceClient) ListEkmConnections(ctx context.Context, in *ListEkmConnectionsRequest, opts ...grpc.CallOption) (*ListEkmConnectionsResponse, error) { + out := new(ListEkmConnectionsResponse) + err := c.cc.Invoke(ctx, EkmService_ListEkmConnections_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *ekmServiceClient) GetEkmConnection(ctx context.Context, in *GetEkmConnectionRequest, opts ...grpc.CallOption) (*EkmConnection, error) { + out := new(EkmConnection) + err := c.cc.Invoke(ctx, EkmService_GetEkmConnection_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *ekmServiceClient) CreateEkmConnection(ctx context.Context, in *CreateEkmConnectionRequest, opts ...grpc.CallOption) (*EkmConnection, error) { + out := new(EkmConnection) + err := c.cc.Invoke(ctx, EkmService_CreateEkmConnection_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *ekmServiceClient) UpdateEkmConnection(ctx context.Context, in *UpdateEkmConnectionRequest, opts ...grpc.CallOption) (*EkmConnection, error) { + out := new(EkmConnection) + err := c.cc.Invoke(ctx, EkmService_UpdateEkmConnection_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *ekmServiceClient) GetEkmConfig(ctx context.Context, in *GetEkmConfigRequest, opts ...grpc.CallOption) (*EkmConfig, error) { + out := new(EkmConfig) + err := c.cc.Invoke(ctx, EkmService_GetEkmConfig_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *ekmServiceClient) UpdateEkmConfig(ctx context.Context, in *UpdateEkmConfigRequest, opts ...grpc.CallOption) (*EkmConfig, error) { + out := new(EkmConfig) + err := c.cc.Invoke(ctx, EkmService_UpdateEkmConfig_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *ekmServiceClient) VerifyConnectivity(ctx context.Context, in *VerifyConnectivityRequest, opts ...grpc.CallOption) (*VerifyConnectivityResponse, error) { + out := new(VerifyConnectivityResponse) + err := c.cc.Invoke(ctx, EkmService_VerifyConnectivity_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// EkmServiceServer is the server API for EkmService service. +// All implementations should embed UnimplementedEkmServiceServer +// for forward compatibility +type EkmServiceServer interface { + // Lists [EkmConnections][google.cloud.kms.v1.EkmConnection]. + ListEkmConnections(context.Context, *ListEkmConnectionsRequest) (*ListEkmConnectionsResponse, error) + // Returns metadata for a given + // [EkmConnection][google.cloud.kms.v1.EkmConnection]. + GetEkmConnection(context.Context, *GetEkmConnectionRequest) (*EkmConnection, error) + // Creates a new [EkmConnection][google.cloud.kms.v1.EkmConnection] in a given + // Project and Location. + CreateEkmConnection(context.Context, *CreateEkmConnectionRequest) (*EkmConnection, error) + // Updates an [EkmConnection][google.cloud.kms.v1.EkmConnection]'s metadata. + UpdateEkmConnection(context.Context, *UpdateEkmConnectionRequest) (*EkmConnection, error) + // Returns the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton resource + // for a given project and location. + GetEkmConfig(context.Context, *GetEkmConfigRequest) (*EkmConfig, error) + // Updates the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton resource + // for a given project and location. + UpdateEkmConfig(context.Context, *UpdateEkmConfigRequest) (*EkmConfig, error) + // Verifies that Cloud KMS can successfully connect to the external key + // manager specified by an [EkmConnection][google.cloud.kms.v1.EkmConnection]. + // If there is an error connecting to the EKM, this method returns a + // FAILED_PRECONDITION status containing structured information as described + // at https://cloud.google.com/kms/docs/reference/ekm_errors. + VerifyConnectivity(context.Context, *VerifyConnectivityRequest) (*VerifyConnectivityResponse, error) +} + +// UnimplementedEkmServiceServer should be embedded to have forward compatible implementations. +type UnimplementedEkmServiceServer struct { +} + +func (UnimplementedEkmServiceServer) ListEkmConnections(context.Context, *ListEkmConnectionsRequest) (*ListEkmConnectionsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListEkmConnections not implemented") +} +func (UnimplementedEkmServiceServer) GetEkmConnection(context.Context, *GetEkmConnectionRequest) (*EkmConnection, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetEkmConnection not implemented") +} +func (UnimplementedEkmServiceServer) CreateEkmConnection(context.Context, *CreateEkmConnectionRequest) (*EkmConnection, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateEkmConnection not implemented") +} +func (UnimplementedEkmServiceServer) UpdateEkmConnection(context.Context, *UpdateEkmConnectionRequest) (*EkmConnection, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateEkmConnection not implemented") +} +func (UnimplementedEkmServiceServer) GetEkmConfig(context.Context, *GetEkmConfigRequest) (*EkmConfig, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetEkmConfig not implemented") +} +func (UnimplementedEkmServiceServer) UpdateEkmConfig(context.Context, *UpdateEkmConfigRequest) (*EkmConfig, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateEkmConfig not implemented") +} +func (UnimplementedEkmServiceServer) VerifyConnectivity(context.Context, *VerifyConnectivityRequest) (*VerifyConnectivityResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method VerifyConnectivity not implemented") +} + +// UnsafeEkmServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to EkmServiceServer will +// result in compilation errors. +type UnsafeEkmServiceServer interface { + mustEmbedUnimplementedEkmServiceServer() +} + +func RegisterEkmServiceServer(s grpc.ServiceRegistrar, srv EkmServiceServer) { + s.RegisterService(&EkmService_ServiceDesc, srv) +} + +func _EkmService_ListEkmConnections_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListEkmConnectionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EkmServiceServer).ListEkmConnections(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: EkmService_ListEkmConnections_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EkmServiceServer).ListEkmConnections(ctx, req.(*ListEkmConnectionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _EkmService_GetEkmConnection_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetEkmConnectionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EkmServiceServer).GetEkmConnection(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: EkmService_GetEkmConnection_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EkmServiceServer).GetEkmConnection(ctx, req.(*GetEkmConnectionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _EkmService_CreateEkmConnection_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateEkmConnectionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EkmServiceServer).CreateEkmConnection(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: EkmService_CreateEkmConnection_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EkmServiceServer).CreateEkmConnection(ctx, req.(*CreateEkmConnectionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _EkmService_UpdateEkmConnection_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateEkmConnectionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EkmServiceServer).UpdateEkmConnection(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: EkmService_UpdateEkmConnection_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EkmServiceServer).UpdateEkmConnection(ctx, req.(*UpdateEkmConnectionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _EkmService_GetEkmConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetEkmConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EkmServiceServer).GetEkmConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: EkmService_GetEkmConfig_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EkmServiceServer).GetEkmConfig(ctx, req.(*GetEkmConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _EkmService_UpdateEkmConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateEkmConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EkmServiceServer).UpdateEkmConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: EkmService_UpdateEkmConfig_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EkmServiceServer).UpdateEkmConfig(ctx, req.(*UpdateEkmConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _EkmService_VerifyConnectivity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(VerifyConnectivityRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EkmServiceServer).VerifyConnectivity(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: EkmService_VerifyConnectivity_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EkmServiceServer).VerifyConnectivity(ctx, req.(*VerifyConnectivityRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// EkmService_ServiceDesc is the grpc.ServiceDesc for EkmService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var EkmService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "google.cloud.kms.v1.EkmService", + HandlerType: (*EkmServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListEkmConnections", + Handler: _EkmService_ListEkmConnections_Handler, + }, + { + MethodName: "GetEkmConnection", + Handler: _EkmService_GetEkmConnection_Handler, + }, + { + MethodName: "CreateEkmConnection", + Handler: _EkmService_CreateEkmConnection_Handler, + }, + { + MethodName: "UpdateEkmConnection", + Handler: _EkmService_UpdateEkmConnection_Handler, + }, + { + MethodName: "GetEkmConfig", + Handler: _EkmService_GetEkmConfig_Handler, + }, + { + MethodName: "UpdateEkmConfig", + Handler: _EkmService_UpdateEkmConfig_Handler, + }, + { + MethodName: "VerifyConnectivity", + Handler: _EkmService_VerifyConnectivity_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/cloud/kms/v1/ekm_service.proto", +} diff --git a/vendor/cloud.google.com/go/kms/apiv1/kmspb/hsm_management.pb.go b/vendor/cloud.google.com/go/kms/apiv1/kmspb/hsm_management.pb.go new file mode 100644 index 00000000000..27640a8c6b2 --- /dev/null +++ b/vendor/cloud.google.com/go/kms/apiv1/kmspb/hsm_management.pb.go @@ -0,0 +1,3442 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.35.2 +// protoc v4.25.7 +// source: google/cloud/kms/v1/hsm_management.proto + +package kmspb + +import ( + reflect "reflect" + sync "sync" + + longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" + emptypb "google.golang.org/protobuf/types/known/emptypb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// The set of states of a +// [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance]. +type SingleTenantHsmInstance_State int32 + +const ( + // Not specified. + SingleTenantHsmInstance_STATE_UNSPECIFIED SingleTenantHsmInstance_State = 0 + // The + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] is + // being created. + SingleTenantHsmInstance_CREATING SingleTenantHsmInstance_State = 1 + // The + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] is + // waiting for 2FA keys to be registered. This can be done by calling + // [CreateSingleTenantHsmInstanceProposal][google.cloud.kms.v1.HsmManagement.CreateSingleTenantHsmInstanceProposal] + // with the [RegisterTwoFactorAuthKeys][] operation. + SingleTenantHsmInstance_PENDING_TWO_FACTOR_AUTH_REGISTRATION SingleTenantHsmInstance_State = 2 + // The + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] is + // ready to use. A + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] + // must be in the + // [ACTIVE][google.cloud.kms.v1.SingleTenantHsmInstance.State.ACTIVE] state + // for all [CryptoKeys][google.cloud.kms.v1.CryptoKey] created within the + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] to + // be usable. + SingleTenantHsmInstance_ACTIVE SingleTenantHsmInstance_State = 3 + // The + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] is + // being disabled. + SingleTenantHsmInstance_DISABLING SingleTenantHsmInstance_State = 4 + // The + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] is + // disabled. + SingleTenantHsmInstance_DISABLED SingleTenantHsmInstance_State = 5 + // The + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] is + // being deleted. Requests to the instance will be rejected in this state. + SingleTenantHsmInstance_DELETING SingleTenantHsmInstance_State = 6 + // The + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] + // has been deleted. + SingleTenantHsmInstance_DELETED SingleTenantHsmInstance_State = 7 + // The + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] + // has failed and can not be recovered or used. + SingleTenantHsmInstance_FAILED SingleTenantHsmInstance_State = 8 +) + +// Enum value maps for SingleTenantHsmInstance_State. +var ( + SingleTenantHsmInstance_State_name = map[int32]string{ + 0: "STATE_UNSPECIFIED", + 1: "CREATING", + 2: "PENDING_TWO_FACTOR_AUTH_REGISTRATION", + 3: "ACTIVE", + 4: "DISABLING", + 5: "DISABLED", + 6: "DELETING", + 7: "DELETED", + 8: "FAILED", + } + SingleTenantHsmInstance_State_value = map[string]int32{ + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "PENDING_TWO_FACTOR_AUTH_REGISTRATION": 2, + "ACTIVE": 3, + "DISABLING": 4, + "DISABLED": 5, + "DELETING": 6, + "DELETED": 7, + "FAILED": 8, + } +) + +func (x SingleTenantHsmInstance_State) Enum() *SingleTenantHsmInstance_State { + p := new(SingleTenantHsmInstance_State) + *p = x + return p +} + +func (x SingleTenantHsmInstance_State) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SingleTenantHsmInstance_State) Descriptor() protoreflect.EnumDescriptor { + return file_google_cloud_kms_v1_hsm_management_proto_enumTypes[0].Descriptor() +} + +func (SingleTenantHsmInstance_State) Type() protoreflect.EnumType { + return &file_google_cloud_kms_v1_hsm_management_proto_enumTypes[0] +} + +func (x SingleTenantHsmInstance_State) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use SingleTenantHsmInstance_State.Descriptor instead. +func (SingleTenantHsmInstance_State) EnumDescriptor() ([]byte, []int) { + return file_google_cloud_kms_v1_hsm_management_proto_rawDescGZIP(), []int{0, 0} +} + +// The set of states of a +// [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal]. +type SingleTenantHsmInstanceProposal_State int32 + +const ( + // Not specified. + SingleTenantHsmInstanceProposal_STATE_UNSPECIFIED SingleTenantHsmInstanceProposal_State = 0 + // The + // [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] + // is being created. + SingleTenantHsmInstanceProposal_CREATING SingleTenantHsmInstanceProposal_State = 1 + // The + // [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] + // is pending approval. + SingleTenantHsmInstanceProposal_PENDING SingleTenantHsmInstanceProposal_State = 2 + // The + // [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] + // has been approved. + SingleTenantHsmInstanceProposal_APPROVED SingleTenantHsmInstanceProposal_State = 3 + // The + // [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] + // is being executed. + SingleTenantHsmInstanceProposal_RUNNING SingleTenantHsmInstanceProposal_State = 4 + // The + // [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] + // has been executed successfully. + SingleTenantHsmInstanceProposal_SUCCEEDED SingleTenantHsmInstanceProposal_State = 5 + // The + // [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] + // has failed. + SingleTenantHsmInstanceProposal_FAILED SingleTenantHsmInstanceProposal_State = 6 + // The + // [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] + // has been deleted and will be purged after the purge_time. + SingleTenantHsmInstanceProposal_DELETED SingleTenantHsmInstanceProposal_State = 7 +) + +// Enum value maps for SingleTenantHsmInstanceProposal_State. +var ( + SingleTenantHsmInstanceProposal_State_name = map[int32]string{ + 0: "STATE_UNSPECIFIED", + 1: "CREATING", + 2: "PENDING", + 3: "APPROVED", + 4: "RUNNING", + 5: "SUCCEEDED", + 6: "FAILED", + 7: "DELETED", + } + SingleTenantHsmInstanceProposal_State_value = map[string]int32{ + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "PENDING": 2, + "APPROVED": 3, + "RUNNING": 4, + "SUCCEEDED": 5, + "FAILED": 6, + "DELETED": 7, + } +) + +func (x SingleTenantHsmInstanceProposal_State) Enum() *SingleTenantHsmInstanceProposal_State { + p := new(SingleTenantHsmInstanceProposal_State) + *p = x + return p +} + +func (x SingleTenantHsmInstanceProposal_State) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SingleTenantHsmInstanceProposal_State) Descriptor() protoreflect.EnumDescriptor { + return file_google_cloud_kms_v1_hsm_management_proto_enumTypes[1].Descriptor() +} + +func (SingleTenantHsmInstanceProposal_State) Type() protoreflect.EnumType { + return &file_google_cloud_kms_v1_hsm_management_proto_enumTypes[1] +} + +func (x SingleTenantHsmInstanceProposal_State) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use SingleTenantHsmInstanceProposal_State.Descriptor instead. +func (SingleTenantHsmInstanceProposal_State) EnumDescriptor() ([]byte, []int) { + return file_google_cloud_kms_v1_hsm_management_proto_rawDescGZIP(), []int{1, 0} +} + +// A [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] +// represents a single-tenant HSM instance. It can be used for creating +// [CryptoKeys][google.cloud.kms.v1.CryptoKey] with a +// [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of +// [HSM_SINGLE_TENANT][CryptoKeyVersion.ProtectionLevel.HSM_SINGLE_TENANT], as +// well as performing cryptographic operations using keys created within the +// [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance]. +type SingleTenantHsmInstance struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Identifier. The resource name for this + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] in + // the format `projects/*/locations/*/singleTenantHsmInstances/*`. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Output only. The time at which the + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] was + // created. + CreateTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + // Output only. The state of the + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance]. + State SingleTenantHsmInstance_State `protobuf:"varint,3,opt,name=state,proto3,enum=google.cloud.kms.v1.SingleTenantHsmInstance_State" json:"state,omitempty"` + // Required. The quorum auth configuration for the + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance]. + QuorumAuth *SingleTenantHsmInstance_QuorumAuth `protobuf:"bytes,4,opt,name=quorum_auth,json=quorumAuth,proto3" json:"quorum_auth,omitempty"` + // Output only. The time at which the + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] was + // deleted. + DeleteTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=delete_time,json=deleteTime,proto3" json:"delete_time,omitempty"` + // Output only. The system-defined duration that an instance can remain + // unrefreshed until it is automatically disabled. This will have a value of + // 120 days. + UnrefreshedDurationUntilDisable *durationpb.Duration `protobuf:"bytes,6,opt,name=unrefreshed_duration_until_disable,json=unrefreshedDurationUntilDisable,proto3" json:"unrefreshed_duration_until_disable,omitempty"` + // Output only. The time at which the instance will be automatically disabled + // if not refreshed. This field is updated upon creation and after each + // successful refresh operation and enable. A + // [RefreshSingleTenantHsmInstance][] operation must be made via a + // [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] + // before this time otherwise the + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] will + // become disabled. + DisableTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=disable_time,json=disableTime,proto3" json:"disable_time,omitempty"` +} + +func (x *SingleTenantHsmInstance) Reset() { + *x = SingleTenantHsmInstance{} + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SingleTenantHsmInstance) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SingleTenantHsmInstance) ProtoMessage() {} + +func (x *SingleTenantHsmInstance) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SingleTenantHsmInstance.ProtoReflect.Descriptor instead. +func (*SingleTenantHsmInstance) Descriptor() ([]byte, []int) { + return file_google_cloud_kms_v1_hsm_management_proto_rawDescGZIP(), []int{0} +} + +func (x *SingleTenantHsmInstance) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *SingleTenantHsmInstance) GetCreateTime() *timestamppb.Timestamp { + if x != nil { + return x.CreateTime + } + return nil +} + +func (x *SingleTenantHsmInstance) GetState() SingleTenantHsmInstance_State { + if x != nil { + return x.State + } + return SingleTenantHsmInstance_STATE_UNSPECIFIED +} + +func (x *SingleTenantHsmInstance) GetQuorumAuth() *SingleTenantHsmInstance_QuorumAuth { + if x != nil { + return x.QuorumAuth + } + return nil +} + +func (x *SingleTenantHsmInstance) GetDeleteTime() *timestamppb.Timestamp { + if x != nil { + return x.DeleteTime + } + return nil +} + +func (x *SingleTenantHsmInstance) GetUnrefreshedDurationUntilDisable() *durationpb.Duration { + if x != nil { + return x.UnrefreshedDurationUntilDisable + } + return nil +} + +func (x *SingleTenantHsmInstance) GetDisableTime() *timestamppb.Timestamp { + if x != nil { + return x.DisableTime + } + return nil +} + +// A +// [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] +// represents a proposal to perform an operation on a +// [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance]. +type SingleTenantHsmInstanceProposal struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Identifier. The resource name for this + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] in + // the format `projects/*/locations/*/singleTenantHsmInstances/*/proposals/*`. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Output only. The time at which the + // [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] + // was created. + CreateTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + // Output only. The state of the + // [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal]. + State SingleTenantHsmInstanceProposal_State `protobuf:"varint,3,opt,name=state,proto3,enum=google.cloud.kms.v1.SingleTenantHsmInstanceProposal_State" json:"state,omitempty"` + // Output only. The root cause of the most recent failure. Only present if + // [state][google.cloud.kms.v1.SingleTenantHsmInstanceProposal.state] is + // [FAILED][SingleTenantHsmInstanceProposal.FAILED]. + FailureReason string `protobuf:"bytes,4,opt,name=failure_reason,json=failureReason,proto3" json:"failure_reason,omitempty"` + // The approval parameters for the + // [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal]. + // The type of parameters is determined by the operation being proposed. + // + // Types that are assignable to ApprovalParameters: + // + // *SingleTenantHsmInstanceProposal_QuorumParameters_ + // *SingleTenantHsmInstanceProposal_RequiredActionQuorumParameters_ + ApprovalParameters isSingleTenantHsmInstanceProposal_ApprovalParameters `protobuf_oneof:"approval_parameters"` + // The expiration of the + // [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal]. + // If not set, the + // [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] + // will expire in 1 day. The maximum expire time is 7 days. The minimum expire + // time is 5 minutes. + // + // Types that are assignable to Expiration: + // + // *SingleTenantHsmInstanceProposal_ExpireTime + // *SingleTenantHsmInstanceProposal_Ttl + Expiration isSingleTenantHsmInstanceProposal_Expiration `protobuf_oneof:"expiration"` + // Output only. The time at which the + // [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] + // was deleted. + DeleteTime *timestamppb.Timestamp `protobuf:"bytes,15,opt,name=delete_time,json=deleteTime,proto3" json:"delete_time,omitempty"` + // Output only. The time at which the soft-deleted + // [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] + // will be permanently purged. This field is only populated + // when the state is DELETED and will be set a time after expiration of the + // proposal, i.e. >= expire_time or (create_time + ttl). + PurgeTime *timestamppb.Timestamp `protobuf:"bytes,16,opt,name=purge_time,json=purgeTime,proto3" json:"purge_time,omitempty"` + // The operation to perform on the + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance]. + // + // Types that are assignable to Operation: + // + // *SingleTenantHsmInstanceProposal_RegisterTwoFactorAuthKeys_ + // *SingleTenantHsmInstanceProposal_DisableSingleTenantHsmInstance_ + // *SingleTenantHsmInstanceProposal_EnableSingleTenantHsmInstance_ + // *SingleTenantHsmInstanceProposal_DeleteSingleTenantHsmInstance_ + // *SingleTenantHsmInstanceProposal_AddQuorumMember_ + // *SingleTenantHsmInstanceProposal_RemoveQuorumMember_ + // *SingleTenantHsmInstanceProposal_RefreshSingleTenantHsmInstance_ + Operation isSingleTenantHsmInstanceProposal_Operation `protobuf_oneof:"operation"` +} + +func (x *SingleTenantHsmInstanceProposal) Reset() { + *x = SingleTenantHsmInstanceProposal{} + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SingleTenantHsmInstanceProposal) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SingleTenantHsmInstanceProposal) ProtoMessage() {} + +func (x *SingleTenantHsmInstanceProposal) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SingleTenantHsmInstanceProposal.ProtoReflect.Descriptor instead. +func (*SingleTenantHsmInstanceProposal) Descriptor() ([]byte, []int) { + return file_google_cloud_kms_v1_hsm_management_proto_rawDescGZIP(), []int{1} +} + +func (x *SingleTenantHsmInstanceProposal) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *SingleTenantHsmInstanceProposal) GetCreateTime() *timestamppb.Timestamp { + if x != nil { + return x.CreateTime + } + return nil +} + +func (x *SingleTenantHsmInstanceProposal) GetState() SingleTenantHsmInstanceProposal_State { + if x != nil { + return x.State + } + return SingleTenantHsmInstanceProposal_STATE_UNSPECIFIED +} + +func (x *SingleTenantHsmInstanceProposal) GetFailureReason() string { + if x != nil { + return x.FailureReason + } + return "" +} + +func (m *SingleTenantHsmInstanceProposal) GetApprovalParameters() isSingleTenantHsmInstanceProposal_ApprovalParameters { + if m != nil { + return m.ApprovalParameters + } + return nil +} + +func (x *SingleTenantHsmInstanceProposal) GetQuorumParameters() *SingleTenantHsmInstanceProposal_QuorumParameters { + if x, ok := x.GetApprovalParameters().(*SingleTenantHsmInstanceProposal_QuorumParameters_); ok { + return x.QuorumParameters + } + return nil +} + +func (x *SingleTenantHsmInstanceProposal) GetRequiredActionQuorumParameters() *SingleTenantHsmInstanceProposal_RequiredActionQuorumParameters { + if x, ok := x.GetApprovalParameters().(*SingleTenantHsmInstanceProposal_RequiredActionQuorumParameters_); ok { + return x.RequiredActionQuorumParameters + } + return nil +} + +func (m *SingleTenantHsmInstanceProposal) GetExpiration() isSingleTenantHsmInstanceProposal_Expiration { + if m != nil { + return m.Expiration + } + return nil +} + +func (x *SingleTenantHsmInstanceProposal) GetExpireTime() *timestamppb.Timestamp { + if x, ok := x.GetExpiration().(*SingleTenantHsmInstanceProposal_ExpireTime); ok { + return x.ExpireTime + } + return nil +} + +func (x *SingleTenantHsmInstanceProposal) GetTtl() *durationpb.Duration { + if x, ok := x.GetExpiration().(*SingleTenantHsmInstanceProposal_Ttl); ok { + return x.Ttl + } + return nil +} + +func (x *SingleTenantHsmInstanceProposal) GetDeleteTime() *timestamppb.Timestamp { + if x != nil { + return x.DeleteTime + } + return nil +} + +func (x *SingleTenantHsmInstanceProposal) GetPurgeTime() *timestamppb.Timestamp { + if x != nil { + return x.PurgeTime + } + return nil +} + +func (m *SingleTenantHsmInstanceProposal) GetOperation() isSingleTenantHsmInstanceProposal_Operation { + if m != nil { + return m.Operation + } + return nil +} + +func (x *SingleTenantHsmInstanceProposal) GetRegisterTwoFactorAuthKeys() *SingleTenantHsmInstanceProposal_RegisterTwoFactorAuthKeys { + if x, ok := x.GetOperation().(*SingleTenantHsmInstanceProposal_RegisterTwoFactorAuthKeys_); ok { + return x.RegisterTwoFactorAuthKeys + } + return nil +} + +func (x *SingleTenantHsmInstanceProposal) GetDisableSingleTenantHsmInstance() *SingleTenantHsmInstanceProposal_DisableSingleTenantHsmInstance { + if x, ok := x.GetOperation().(*SingleTenantHsmInstanceProposal_DisableSingleTenantHsmInstance_); ok { + return x.DisableSingleTenantHsmInstance + } + return nil +} + +func (x *SingleTenantHsmInstanceProposal) GetEnableSingleTenantHsmInstance() *SingleTenantHsmInstanceProposal_EnableSingleTenantHsmInstance { + if x, ok := x.GetOperation().(*SingleTenantHsmInstanceProposal_EnableSingleTenantHsmInstance_); ok { + return x.EnableSingleTenantHsmInstance + } + return nil +} + +func (x *SingleTenantHsmInstanceProposal) GetDeleteSingleTenantHsmInstance() *SingleTenantHsmInstanceProposal_DeleteSingleTenantHsmInstance { + if x, ok := x.GetOperation().(*SingleTenantHsmInstanceProposal_DeleteSingleTenantHsmInstance_); ok { + return x.DeleteSingleTenantHsmInstance + } + return nil +} + +func (x *SingleTenantHsmInstanceProposal) GetAddQuorumMember() *SingleTenantHsmInstanceProposal_AddQuorumMember { + if x, ok := x.GetOperation().(*SingleTenantHsmInstanceProposal_AddQuorumMember_); ok { + return x.AddQuorumMember + } + return nil +} + +func (x *SingleTenantHsmInstanceProposal) GetRemoveQuorumMember() *SingleTenantHsmInstanceProposal_RemoveQuorumMember { + if x, ok := x.GetOperation().(*SingleTenantHsmInstanceProposal_RemoveQuorumMember_); ok { + return x.RemoveQuorumMember + } + return nil +} + +func (x *SingleTenantHsmInstanceProposal) GetRefreshSingleTenantHsmInstance() *SingleTenantHsmInstanceProposal_RefreshSingleTenantHsmInstance { + if x, ok := x.GetOperation().(*SingleTenantHsmInstanceProposal_RefreshSingleTenantHsmInstance_); ok { + return x.RefreshSingleTenantHsmInstance + } + return nil +} + +type isSingleTenantHsmInstanceProposal_ApprovalParameters interface { + isSingleTenantHsmInstanceProposal_ApprovalParameters() +} + +type SingleTenantHsmInstanceProposal_QuorumParameters_ struct { + // Output only. The quorum approval parameters for the + // [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal]. + QuorumParameters *SingleTenantHsmInstanceProposal_QuorumParameters `protobuf:"bytes,5,opt,name=quorum_parameters,json=quorumParameters,proto3,oneof"` +} + +type SingleTenantHsmInstanceProposal_RequiredActionQuorumParameters_ struct { + // Output only. Parameters for an approval of a + // [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] + // that has both required challenges and a quorum. + RequiredActionQuorumParameters *SingleTenantHsmInstanceProposal_RequiredActionQuorumParameters `protobuf:"bytes,14,opt,name=required_action_quorum_parameters,json=requiredActionQuorumParameters,proto3,oneof"` +} + +func (*SingleTenantHsmInstanceProposal_QuorumParameters_) isSingleTenantHsmInstanceProposal_ApprovalParameters() { +} + +func (*SingleTenantHsmInstanceProposal_RequiredActionQuorumParameters_) isSingleTenantHsmInstanceProposal_ApprovalParameters() { +} + +type isSingleTenantHsmInstanceProposal_Expiration interface { + isSingleTenantHsmInstanceProposal_Expiration() +} + +type SingleTenantHsmInstanceProposal_ExpireTime struct { + // The time at which the + // [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] + // will expire if not approved and executed. + ExpireTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=expire_time,json=expireTime,proto3,oneof"` +} + +type SingleTenantHsmInstanceProposal_Ttl struct { + // Input only. The TTL for the + // [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal]. + // Proposals will expire after this duration. + Ttl *durationpb.Duration `protobuf:"bytes,7,opt,name=ttl,proto3,oneof"` +} + +func (*SingleTenantHsmInstanceProposal_ExpireTime) isSingleTenantHsmInstanceProposal_Expiration() {} + +func (*SingleTenantHsmInstanceProposal_Ttl) isSingleTenantHsmInstanceProposal_Expiration() {} + +type isSingleTenantHsmInstanceProposal_Operation interface { + isSingleTenantHsmInstanceProposal_Operation() +} + +type SingleTenantHsmInstanceProposal_RegisterTwoFactorAuthKeys_ struct { + // Register 2FA keys for the + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance]. + // This operation requires all N Challenges to be signed by 2FA keys. The + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] + // must be in the + // [PENDING_TWO_FACTOR_AUTH_REGISTRATION][google.cloud.kms.v1.SingleTenantHsmInstance.State.PENDING_TWO_FACTOR_AUTH_REGISTRATION] + // state to perform this operation. + RegisterTwoFactorAuthKeys *SingleTenantHsmInstanceProposal_RegisterTwoFactorAuthKeys `protobuf:"bytes,8,opt,name=register_two_factor_auth_keys,json=registerTwoFactorAuthKeys,proto3,oneof"` +} + +type SingleTenantHsmInstanceProposal_DisableSingleTenantHsmInstance_ struct { + // Disable the + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance]. + // The + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] + // must be in the + // [ACTIVE][google.cloud.kms.v1.SingleTenantHsmInstance.State.ACTIVE] state + // to perform this operation. + DisableSingleTenantHsmInstance *SingleTenantHsmInstanceProposal_DisableSingleTenantHsmInstance `protobuf:"bytes,9,opt,name=disable_single_tenant_hsm_instance,json=disableSingleTenantHsmInstance,proto3,oneof"` +} + +type SingleTenantHsmInstanceProposal_EnableSingleTenantHsmInstance_ struct { + // Enable the + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance]. + // The + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] + // must be in the + // [DISABLED][google.cloud.kms.v1.SingleTenantHsmInstance.State.DISABLED] + // state to perform this operation. + EnableSingleTenantHsmInstance *SingleTenantHsmInstanceProposal_EnableSingleTenantHsmInstance `protobuf:"bytes,10,opt,name=enable_single_tenant_hsm_instance,json=enableSingleTenantHsmInstance,proto3,oneof"` +} + +type SingleTenantHsmInstanceProposal_DeleteSingleTenantHsmInstance_ struct { + // Delete the + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance]. + // Deleting a + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] + // will make all [CryptoKeys][google.cloud.kms.v1.CryptoKey] attached to the + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] + // unusable. The + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] + // must be in the + // [DISABLED][google.cloud.kms.v1.SingleTenantHsmInstance.State.DISABLED] or + // [PENDING_TWO_FACTOR_AUTH_REGISTRATION][google.cloud.kms.v1.SingleTenantHsmInstance.State.PENDING_TWO_FACTOR_AUTH_REGISTRATION] + // state to perform this operation. + DeleteSingleTenantHsmInstance *SingleTenantHsmInstanceProposal_DeleteSingleTenantHsmInstance `protobuf:"bytes,11,opt,name=delete_single_tenant_hsm_instance,json=deleteSingleTenantHsmInstance,proto3,oneof"` +} + +type SingleTenantHsmInstanceProposal_AddQuorumMember_ struct { + // Add a quorum member to the + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance]. + // This will increase the + // [total_approver_count][google.cloud.kms.v1.SingleTenantHsmInstance.QuorumAuth.total_approver_count] + // by 1. The + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] + // must be in the + // [ACTIVE][google.cloud.kms.v1.SingleTenantHsmInstance.State.ACTIVE] state + // to perform this operation. + AddQuorumMember *SingleTenantHsmInstanceProposal_AddQuorumMember `protobuf:"bytes,12,opt,name=add_quorum_member,json=addQuorumMember,proto3,oneof"` +} + +type SingleTenantHsmInstanceProposal_RemoveQuorumMember_ struct { + // Remove a quorum member from the + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance]. + // This will reduce + // [total_approver_count][google.cloud.kms.v1.SingleTenantHsmInstance.QuorumAuth.total_approver_count] + // by 1. The + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] + // must be in the + // [ACTIVE][google.cloud.kms.v1.SingleTenantHsmInstance.State.ACTIVE] state + // to perform this operation. + RemoveQuorumMember *SingleTenantHsmInstanceProposal_RemoveQuorumMember `protobuf:"bytes,13,opt,name=remove_quorum_member,json=removeQuorumMember,proto3,oneof"` +} + +type SingleTenantHsmInstanceProposal_RefreshSingleTenantHsmInstance_ struct { + // Refreshes the + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance]. + // This operation must be performed periodically to keep the + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] + // active. This operation must be performed before + // [unrefreshed_duration_until_disable][google.cloud.kms.v1.SingleTenantHsmInstance.unrefreshed_duration_until_disable] + // has passed. The + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] + // must be in the + // [ACTIVE][google.cloud.kms.v1.SingleTenantHsmInstance.State.ACTIVE] state + // to perform this operation. + RefreshSingleTenantHsmInstance *SingleTenantHsmInstanceProposal_RefreshSingleTenantHsmInstance `protobuf:"bytes,17,opt,name=refresh_single_tenant_hsm_instance,json=refreshSingleTenantHsmInstance,proto3,oneof"` +} + +func (*SingleTenantHsmInstanceProposal_RegisterTwoFactorAuthKeys_) isSingleTenantHsmInstanceProposal_Operation() { +} + +func (*SingleTenantHsmInstanceProposal_DisableSingleTenantHsmInstance_) isSingleTenantHsmInstanceProposal_Operation() { +} + +func (*SingleTenantHsmInstanceProposal_EnableSingleTenantHsmInstance_) isSingleTenantHsmInstanceProposal_Operation() { +} + +func (*SingleTenantHsmInstanceProposal_DeleteSingleTenantHsmInstance_) isSingleTenantHsmInstanceProposal_Operation() { +} + +func (*SingleTenantHsmInstanceProposal_AddQuorumMember_) isSingleTenantHsmInstanceProposal_Operation() { +} + +func (*SingleTenantHsmInstanceProposal_RemoveQuorumMember_) isSingleTenantHsmInstanceProposal_Operation() { +} + +func (*SingleTenantHsmInstanceProposal_RefreshSingleTenantHsmInstance_) isSingleTenantHsmInstanceProposal_Operation() { +} + +// A challenge to be signed by a 2FA key. +type Challenge struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Output only. The challenge to be signed by the 2FA key indicated by the + // public key. + Challenge []byte `protobuf:"bytes,1,opt,name=challenge,proto3" json:"challenge,omitempty"` + // Output only. The public key associated with the 2FA key that should sign + // the challenge. + PublicKeyPem string `protobuf:"bytes,2,opt,name=public_key_pem,json=publicKeyPem,proto3" json:"public_key_pem,omitempty"` +} + +func (x *Challenge) Reset() { + *x = Challenge{} + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Challenge) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Challenge) ProtoMessage() {} + +func (x *Challenge) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Challenge.ProtoReflect.Descriptor instead. +func (*Challenge) Descriptor() ([]byte, []int) { + return file_google_cloud_kms_v1_hsm_management_proto_rawDescGZIP(), []int{2} +} + +func (x *Challenge) GetChallenge() []byte { + if x != nil { + return x.Challenge + } + return nil +} + +func (x *Challenge) GetPublicKeyPem() string { + if x != nil { + return x.PublicKeyPem + } + return "" +} + +// A reply to a challenge signed by a 2FA key. +type ChallengeReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. The signed challenge associated with the 2FA key. + // The signature must be RSASSA-PKCS1 v1.5 with a SHA256 digest. + SignedChallenge []byte `protobuf:"bytes,1,opt,name=signed_challenge,json=signedChallenge,proto3" json:"signed_challenge,omitempty"` + // Required. The public key associated with the 2FA key. + PublicKeyPem string `protobuf:"bytes,2,opt,name=public_key_pem,json=publicKeyPem,proto3" json:"public_key_pem,omitempty"` +} + +func (x *ChallengeReply) Reset() { + *x = ChallengeReply{} + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ChallengeReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChallengeReply) ProtoMessage() {} + +func (x *ChallengeReply) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChallengeReply.ProtoReflect.Descriptor instead. +func (*ChallengeReply) Descriptor() ([]byte, []int) { + return file_google_cloud_kms_v1_hsm_management_proto_rawDescGZIP(), []int{3} +} + +func (x *ChallengeReply) GetSignedChallenge() []byte { + if x != nil { + return x.SignedChallenge + } + return nil +} + +func (x *ChallengeReply) GetPublicKeyPem() string { + if x != nil { + return x.PublicKeyPem + } + return "" +} + +// Request message for +// [HsmManagement.ListSingleTenantHsmInstances][google.cloud.kms.v1.HsmManagement.ListSingleTenantHsmInstances]. +type ListSingleTenantHsmInstancesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. The resource name of the location associated with the + // [SingleTenantHsmInstances][google.cloud.kms.v1.SingleTenantHsmInstance] to + // list, in the format `projects/*/locations/*`. + Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` + // Optional. Optional limit on the number of + // [SingleTenantHsmInstances][google.cloud.kms.v1.SingleTenantHsmInstance] to + // include in the response. Further + // [SingleTenantHsmInstances][google.cloud.kms.v1.SingleTenantHsmInstance] can + // subsequently be + // obtained by including the + // [ListSingleTenantHsmInstancesResponse.next_page_token][google.cloud.kms.v1.ListSingleTenantHsmInstancesResponse.next_page_token] + // in a subsequent request. If unspecified, the server will pick an + // appropriate default. + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + // Optional. Optional pagination token, returned earlier via + // [ListSingleTenantHsmInstancesResponse.next_page_token][google.cloud.kms.v1.ListSingleTenantHsmInstancesResponse.next_page_token]. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` + // Optional. Only include resources that match the filter in the response. For + // more information, see + // [Sorting and filtering list + // results](https://cloud.google.com/kms/docs/sorting-and-filtering). + Filter string `protobuf:"bytes,4,opt,name=filter,proto3" json:"filter,omitempty"` + // Optional. Specify how the results should be sorted. If not specified, the + // results will be sorted in the default order. For more information, see + // [Sorting and filtering list + // results](https://cloud.google.com/kms/docs/sorting-and-filtering). + OrderBy string `protobuf:"bytes,5,opt,name=order_by,json=orderBy,proto3" json:"order_by,omitempty"` + // Optional. If set to true, + // [HsmManagement.ListSingleTenantHsmInstances][google.cloud.kms.v1.HsmManagement.ListSingleTenantHsmInstances] + // will also return + // [SingleTenantHsmInstances][google.cloud.kms.v1.SingleTenantHsmInstance] in + // DELETED state. + ShowDeleted bool `protobuf:"varint,6,opt,name=show_deleted,json=showDeleted,proto3" json:"show_deleted,omitempty"` +} + +func (x *ListSingleTenantHsmInstancesRequest) Reset() { + *x = ListSingleTenantHsmInstancesRequest{} + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListSingleTenantHsmInstancesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListSingleTenantHsmInstancesRequest) ProtoMessage() {} + +func (x *ListSingleTenantHsmInstancesRequest) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListSingleTenantHsmInstancesRequest.ProtoReflect.Descriptor instead. +func (*ListSingleTenantHsmInstancesRequest) Descriptor() ([]byte, []int) { + return file_google_cloud_kms_v1_hsm_management_proto_rawDescGZIP(), []int{4} +} + +func (x *ListSingleTenantHsmInstancesRequest) GetParent() string { + if x != nil { + return x.Parent + } + return "" +} + +func (x *ListSingleTenantHsmInstancesRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListSingleTenantHsmInstancesRequest) GetPageToken() string { + if x != nil { + return x.PageToken + } + return "" +} + +func (x *ListSingleTenantHsmInstancesRequest) GetFilter() string { + if x != nil { + return x.Filter + } + return "" +} + +func (x *ListSingleTenantHsmInstancesRequest) GetOrderBy() string { + if x != nil { + return x.OrderBy + } + return "" +} + +func (x *ListSingleTenantHsmInstancesRequest) GetShowDeleted() bool { + if x != nil { + return x.ShowDeleted + } + return false +} + +// Response message for +// [HsmManagement.ListSingleTenantHsmInstances][google.cloud.kms.v1.HsmManagement.ListSingleTenantHsmInstances]. +type ListSingleTenantHsmInstancesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The list of + // [SingleTenantHsmInstances][google.cloud.kms.v1.SingleTenantHsmInstance]. + SingleTenantHsmInstances []*SingleTenantHsmInstance `protobuf:"bytes,1,rep,name=single_tenant_hsm_instances,json=singleTenantHsmInstances,proto3" json:"single_tenant_hsm_instances,omitempty"` + // A token to retrieve next page of results. Pass this value in + // [ListSingleTenantHsmInstancesRequest.page_token][google.cloud.kms.v1.ListSingleTenantHsmInstancesRequest.page_token] + // to retrieve the next page of results. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` + // The total number of + // [SingleTenantHsmInstances][google.cloud.kms.v1.SingleTenantHsmInstance] + // that matched the query. + // + // This field is not populated if + // [ListSingleTenantHsmInstancesRequest.filter][google.cloud.kms.v1.ListSingleTenantHsmInstancesRequest.filter] + // is applied. + TotalSize int32 `protobuf:"varint,3,opt,name=total_size,json=totalSize,proto3" json:"total_size,omitempty"` +} + +func (x *ListSingleTenantHsmInstancesResponse) Reset() { + *x = ListSingleTenantHsmInstancesResponse{} + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListSingleTenantHsmInstancesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListSingleTenantHsmInstancesResponse) ProtoMessage() {} + +func (x *ListSingleTenantHsmInstancesResponse) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListSingleTenantHsmInstancesResponse.ProtoReflect.Descriptor instead. +func (*ListSingleTenantHsmInstancesResponse) Descriptor() ([]byte, []int) { + return file_google_cloud_kms_v1_hsm_management_proto_rawDescGZIP(), []int{5} +} + +func (x *ListSingleTenantHsmInstancesResponse) GetSingleTenantHsmInstances() []*SingleTenantHsmInstance { + if x != nil { + return x.SingleTenantHsmInstances + } + return nil +} + +func (x *ListSingleTenantHsmInstancesResponse) GetNextPageToken() string { + if x != nil { + return x.NextPageToken + } + return "" +} + +func (x *ListSingleTenantHsmInstancesResponse) GetTotalSize() int32 { + if x != nil { + return x.TotalSize + } + return 0 +} + +// Request message for +// [HsmManagement.GetSingleTenantHsmInstance][google.cloud.kms.v1.HsmManagement.GetSingleTenantHsmInstance]. +type GetSingleTenantHsmInstanceRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. The [name][google.cloud.kms.v1.SingleTenantHsmInstance.name] of + // the [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] + // to get. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *GetSingleTenantHsmInstanceRequest) Reset() { + *x = GetSingleTenantHsmInstanceRequest{} + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetSingleTenantHsmInstanceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetSingleTenantHsmInstanceRequest) ProtoMessage() {} + +func (x *GetSingleTenantHsmInstanceRequest) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetSingleTenantHsmInstanceRequest.ProtoReflect.Descriptor instead. +func (*GetSingleTenantHsmInstanceRequest) Descriptor() ([]byte, []int) { + return file_google_cloud_kms_v1_hsm_management_proto_rawDescGZIP(), []int{6} +} + +func (x *GetSingleTenantHsmInstanceRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +// Request message for +// [HsmManagement.CreateSingleTenantHsmInstance][google.cloud.kms.v1.HsmManagement.CreateSingleTenantHsmInstance]. +type CreateSingleTenantHsmInstanceRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. The resource name of the location associated with the + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance], in + // the format `projects/*/locations/*`. + Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` + // Optional. It must be unique within a location and match the regular + // expression `[a-zA-Z0-9_-]{1,63}`. + SingleTenantHsmInstanceId string `protobuf:"bytes,2,opt,name=single_tenant_hsm_instance_id,json=singleTenantHsmInstanceId,proto3" json:"single_tenant_hsm_instance_id,omitempty"` + // Required. An + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] with + // initial field values. + SingleTenantHsmInstance *SingleTenantHsmInstance `protobuf:"bytes,3,opt,name=single_tenant_hsm_instance,json=singleTenantHsmInstance,proto3" json:"single_tenant_hsm_instance,omitempty"` +} + +func (x *CreateSingleTenantHsmInstanceRequest) Reset() { + *x = CreateSingleTenantHsmInstanceRequest{} + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateSingleTenantHsmInstanceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateSingleTenantHsmInstanceRequest) ProtoMessage() {} + +func (x *CreateSingleTenantHsmInstanceRequest) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateSingleTenantHsmInstanceRequest.ProtoReflect.Descriptor instead. +func (*CreateSingleTenantHsmInstanceRequest) Descriptor() ([]byte, []int) { + return file_google_cloud_kms_v1_hsm_management_proto_rawDescGZIP(), []int{7} +} + +func (x *CreateSingleTenantHsmInstanceRequest) GetParent() string { + if x != nil { + return x.Parent + } + return "" +} + +func (x *CreateSingleTenantHsmInstanceRequest) GetSingleTenantHsmInstanceId() string { + if x != nil { + return x.SingleTenantHsmInstanceId + } + return "" +} + +func (x *CreateSingleTenantHsmInstanceRequest) GetSingleTenantHsmInstance() *SingleTenantHsmInstance { + if x != nil { + return x.SingleTenantHsmInstance + } + return nil +} + +// Metadata message for +// [CreateSingleTenantHsmInstance][google.cloud.kms.v1.HsmManagement.CreateSingleTenantHsmInstance] +// long-running operation response. +type CreateSingleTenantHsmInstanceMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CreateSingleTenantHsmInstanceMetadata) Reset() { + *x = CreateSingleTenantHsmInstanceMetadata{} + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateSingleTenantHsmInstanceMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateSingleTenantHsmInstanceMetadata) ProtoMessage() {} + +func (x *CreateSingleTenantHsmInstanceMetadata) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateSingleTenantHsmInstanceMetadata.ProtoReflect.Descriptor instead. +func (*CreateSingleTenantHsmInstanceMetadata) Descriptor() ([]byte, []int) { + return file_google_cloud_kms_v1_hsm_management_proto_rawDescGZIP(), []int{8} +} + +// Request message for +// [HsmManagement.CreateSingleTenantHsmInstanceProposal][google.cloud.kms.v1.HsmManagement.CreateSingleTenantHsmInstanceProposal]. +type CreateSingleTenantHsmInstanceProposalRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. The [name][google.cloud.kms.v1.SingleTenantHsmInstance.name] of + // the [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] + // associated with the + // [SingleTenantHsmInstanceProposals][google.cloud.kms.v1.SingleTenantHsmInstanceProposal]. + Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` + // Optional. It must be unique within a location and match the regular + // expression `[a-zA-Z0-9_-]{1,63}`. + SingleTenantHsmInstanceProposalId string `protobuf:"bytes,2,opt,name=single_tenant_hsm_instance_proposal_id,json=singleTenantHsmInstanceProposalId,proto3" json:"single_tenant_hsm_instance_proposal_id,omitempty"` + // Required. The + // [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] + // to create. + SingleTenantHsmInstanceProposal *SingleTenantHsmInstanceProposal `protobuf:"bytes,3,opt,name=single_tenant_hsm_instance_proposal,json=singleTenantHsmInstanceProposal,proto3" json:"single_tenant_hsm_instance_proposal,omitempty"` +} + +func (x *CreateSingleTenantHsmInstanceProposalRequest) Reset() { + *x = CreateSingleTenantHsmInstanceProposalRequest{} + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateSingleTenantHsmInstanceProposalRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateSingleTenantHsmInstanceProposalRequest) ProtoMessage() {} + +func (x *CreateSingleTenantHsmInstanceProposalRequest) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateSingleTenantHsmInstanceProposalRequest.ProtoReflect.Descriptor instead. +func (*CreateSingleTenantHsmInstanceProposalRequest) Descriptor() ([]byte, []int) { + return file_google_cloud_kms_v1_hsm_management_proto_rawDescGZIP(), []int{9} +} + +func (x *CreateSingleTenantHsmInstanceProposalRequest) GetParent() string { + if x != nil { + return x.Parent + } + return "" +} + +func (x *CreateSingleTenantHsmInstanceProposalRequest) GetSingleTenantHsmInstanceProposalId() string { + if x != nil { + return x.SingleTenantHsmInstanceProposalId + } + return "" +} + +func (x *CreateSingleTenantHsmInstanceProposalRequest) GetSingleTenantHsmInstanceProposal() *SingleTenantHsmInstanceProposal { + if x != nil { + return x.SingleTenantHsmInstanceProposal + } + return nil +} + +// Metadata message for +// [CreateSingleTenantHsmInstanceProposal][google.cloud.kms.v1.HsmManagement.CreateSingleTenantHsmInstanceProposal] +// long-running operation response. +type CreateSingleTenantHsmInstanceProposalMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CreateSingleTenantHsmInstanceProposalMetadata) Reset() { + *x = CreateSingleTenantHsmInstanceProposalMetadata{} + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateSingleTenantHsmInstanceProposalMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateSingleTenantHsmInstanceProposalMetadata) ProtoMessage() {} + +func (x *CreateSingleTenantHsmInstanceProposalMetadata) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateSingleTenantHsmInstanceProposalMetadata.ProtoReflect.Descriptor instead. +func (*CreateSingleTenantHsmInstanceProposalMetadata) Descriptor() ([]byte, []int) { + return file_google_cloud_kms_v1_hsm_management_proto_rawDescGZIP(), []int{10} +} + +// Request message for +// [HsmManagement.GetSingleTenantHsmInstanceProposal][google.cloud.kms.v1.HsmManagement.GetSingleTenantHsmInstanceProposal]. +type GetSingleTenantHsmInstanceProposalRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. The + // [name][google.cloud.kms.v1.SingleTenantHsmInstanceProposal.name] of the + // [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] + // to get. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *GetSingleTenantHsmInstanceProposalRequest) Reset() { + *x = GetSingleTenantHsmInstanceProposalRequest{} + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetSingleTenantHsmInstanceProposalRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetSingleTenantHsmInstanceProposalRequest) ProtoMessage() {} + +func (x *GetSingleTenantHsmInstanceProposalRequest) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetSingleTenantHsmInstanceProposalRequest.ProtoReflect.Descriptor instead. +func (*GetSingleTenantHsmInstanceProposalRequest) Descriptor() ([]byte, []int) { + return file_google_cloud_kms_v1_hsm_management_proto_rawDescGZIP(), []int{11} +} + +func (x *GetSingleTenantHsmInstanceProposalRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +// Request message for +// [HsmManagement.ApproveSingleTenantHsmInstanceProposal][google.cloud.kms.v1.HsmManagement.ApproveSingleTenantHsmInstanceProposal]. +type ApproveSingleTenantHsmInstanceProposalRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. The + // [name][google.cloud.kms.v1.SingleTenantHsmInstanceProposal.name] of the + // [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] + // to approve. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // The approval payload. The type of approval payload must correspond to the + // type of approval_parameters in the proposal. + // + // Types that are assignable to ApprovalPayload: + // + // *ApproveSingleTenantHsmInstanceProposalRequest_QuorumReply_ + // *ApproveSingleTenantHsmInstanceProposalRequest_RequiredActionQuorumReply_ + ApprovalPayload isApproveSingleTenantHsmInstanceProposalRequest_ApprovalPayload `protobuf_oneof:"approval_payload"` +} + +func (x *ApproveSingleTenantHsmInstanceProposalRequest) Reset() { + *x = ApproveSingleTenantHsmInstanceProposalRequest{} + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ApproveSingleTenantHsmInstanceProposalRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApproveSingleTenantHsmInstanceProposalRequest) ProtoMessage() {} + +func (x *ApproveSingleTenantHsmInstanceProposalRequest) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ApproveSingleTenantHsmInstanceProposalRequest.ProtoReflect.Descriptor instead. +func (*ApproveSingleTenantHsmInstanceProposalRequest) Descriptor() ([]byte, []int) { + return file_google_cloud_kms_v1_hsm_management_proto_rawDescGZIP(), []int{12} +} + +func (x *ApproveSingleTenantHsmInstanceProposalRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (m *ApproveSingleTenantHsmInstanceProposalRequest) GetApprovalPayload() isApproveSingleTenantHsmInstanceProposalRequest_ApprovalPayload { + if m != nil { + return m.ApprovalPayload + } + return nil +} + +func (x *ApproveSingleTenantHsmInstanceProposalRequest) GetQuorumReply() *ApproveSingleTenantHsmInstanceProposalRequest_QuorumReply { + if x, ok := x.GetApprovalPayload().(*ApproveSingleTenantHsmInstanceProposalRequest_QuorumReply_); ok { + return x.QuorumReply + } + return nil +} + +func (x *ApproveSingleTenantHsmInstanceProposalRequest) GetRequiredActionQuorumReply() *ApproveSingleTenantHsmInstanceProposalRequest_RequiredActionQuorumReply { + if x, ok := x.GetApprovalPayload().(*ApproveSingleTenantHsmInstanceProposalRequest_RequiredActionQuorumReply_); ok { + return x.RequiredActionQuorumReply + } + return nil +} + +type isApproveSingleTenantHsmInstanceProposalRequest_ApprovalPayload interface { + isApproveSingleTenantHsmInstanceProposalRequest_ApprovalPayload() +} + +type ApproveSingleTenantHsmInstanceProposalRequest_QuorumReply_ struct { + // Required. The reply to + // [QuorumParameters][google.cloud.kms.v1.SingleTenantHsmInstanceProposal.QuorumParameters] + // for approving the proposal. + QuorumReply *ApproveSingleTenantHsmInstanceProposalRequest_QuorumReply `protobuf:"bytes,2,opt,name=quorum_reply,json=quorumReply,proto3,oneof"` +} + +type ApproveSingleTenantHsmInstanceProposalRequest_RequiredActionQuorumReply_ struct { + // Required. The reply to + // [RequiredActionQuorumParameters][google.cloud.kms.v1.SingleTenantHsmInstanceProposal.RequiredActionQuorumParameters] + // for approving the proposal. + RequiredActionQuorumReply *ApproveSingleTenantHsmInstanceProposalRequest_RequiredActionQuorumReply `protobuf:"bytes,3,opt,name=required_action_quorum_reply,json=requiredActionQuorumReply,proto3,oneof"` +} + +func (*ApproveSingleTenantHsmInstanceProposalRequest_QuorumReply_) isApproveSingleTenantHsmInstanceProposalRequest_ApprovalPayload() { +} + +func (*ApproveSingleTenantHsmInstanceProposalRequest_RequiredActionQuorumReply_) isApproveSingleTenantHsmInstanceProposalRequest_ApprovalPayload() { +} + +// Response message for +// [HsmManagement.ApproveSingleTenantHsmInstanceProposal][google.cloud.kms.v1.HsmManagement.ApproveSingleTenantHsmInstanceProposal]. +type ApproveSingleTenantHsmInstanceProposalResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ApproveSingleTenantHsmInstanceProposalResponse) Reset() { + *x = ApproveSingleTenantHsmInstanceProposalResponse{} + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ApproveSingleTenantHsmInstanceProposalResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApproveSingleTenantHsmInstanceProposalResponse) ProtoMessage() {} + +func (x *ApproveSingleTenantHsmInstanceProposalResponse) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ApproveSingleTenantHsmInstanceProposalResponse.ProtoReflect.Descriptor instead. +func (*ApproveSingleTenantHsmInstanceProposalResponse) Descriptor() ([]byte, []int) { + return file_google_cloud_kms_v1_hsm_management_proto_rawDescGZIP(), []int{13} +} + +// Request message for +// [HsmManagement.ExecuteSingleTenantHsmInstanceProposal][google.cloud.kms.v1.HsmManagement.ExecuteSingleTenantHsmInstanceProposal]. +type ExecuteSingleTenantHsmInstanceProposalRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. The + // [name][google.cloud.kms.v1.SingleTenantHsmInstanceProposal.name] of the + // [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] + // to execute. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *ExecuteSingleTenantHsmInstanceProposalRequest) Reset() { + *x = ExecuteSingleTenantHsmInstanceProposalRequest{} + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ExecuteSingleTenantHsmInstanceProposalRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExecuteSingleTenantHsmInstanceProposalRequest) ProtoMessage() {} + +func (x *ExecuteSingleTenantHsmInstanceProposalRequest) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExecuteSingleTenantHsmInstanceProposalRequest.ProtoReflect.Descriptor instead. +func (*ExecuteSingleTenantHsmInstanceProposalRequest) Descriptor() ([]byte, []int) { + return file_google_cloud_kms_v1_hsm_management_proto_rawDescGZIP(), []int{14} +} + +func (x *ExecuteSingleTenantHsmInstanceProposalRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +// Response message for +// [HsmManagement.ExecuteSingleTenantHsmInstanceProposal][google.cloud.kms.v1.HsmManagement.ExecuteSingleTenantHsmInstanceProposal]. +type ExecuteSingleTenantHsmInstanceProposalResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ExecuteSingleTenantHsmInstanceProposalResponse) Reset() { + *x = ExecuteSingleTenantHsmInstanceProposalResponse{} + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ExecuteSingleTenantHsmInstanceProposalResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExecuteSingleTenantHsmInstanceProposalResponse) ProtoMessage() {} + +func (x *ExecuteSingleTenantHsmInstanceProposalResponse) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExecuteSingleTenantHsmInstanceProposalResponse.ProtoReflect.Descriptor instead. +func (*ExecuteSingleTenantHsmInstanceProposalResponse) Descriptor() ([]byte, []int) { + return file_google_cloud_kms_v1_hsm_management_proto_rawDescGZIP(), []int{15} +} + +// Metadata message for +// [ExecuteSingleTenantHsmInstanceProposal][google.cloud.kms.v1.HsmManagement.ExecuteSingleTenantHsmInstanceProposal] +// long-running operation response. +type ExecuteSingleTenantHsmInstanceProposalMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ExecuteSingleTenantHsmInstanceProposalMetadata) Reset() { + *x = ExecuteSingleTenantHsmInstanceProposalMetadata{} + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ExecuteSingleTenantHsmInstanceProposalMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExecuteSingleTenantHsmInstanceProposalMetadata) ProtoMessage() {} + +func (x *ExecuteSingleTenantHsmInstanceProposalMetadata) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExecuteSingleTenantHsmInstanceProposalMetadata.ProtoReflect.Descriptor instead. +func (*ExecuteSingleTenantHsmInstanceProposalMetadata) Descriptor() ([]byte, []int) { + return file_google_cloud_kms_v1_hsm_management_proto_rawDescGZIP(), []int{16} +} + +// Request message for +// [HsmManagement.ListSingleTenantHsmInstanceProposals][google.cloud.kms.v1.HsmManagement.ListSingleTenantHsmInstanceProposals]. +type ListSingleTenantHsmInstanceProposalsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. The resource name of the single tenant HSM instance associated + // with the + // [SingleTenantHsmInstanceProposals][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] + // to list, in the format `projects/*/locations/*/singleTenantHsmInstances/*`. + Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` + // Optional. Optional limit on the number of + // [SingleTenantHsmInstanceProposals][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] + // to include in the response. Further + // [SingleTenantHsmInstanceProposals][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] + // can subsequently be obtained by including the + // [ListSingleTenantHsmInstanceProposalsResponse.next_page_token][google.cloud.kms.v1.ListSingleTenantHsmInstanceProposalsResponse.next_page_token] + // in a subsequent request. If unspecified, the server will pick an + // appropriate default. + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + // Optional. Optional pagination token, returned earlier via + // [ListSingleTenantHsmInstanceProposalsResponse.next_page_token][google.cloud.kms.v1.ListSingleTenantHsmInstanceProposalsResponse.next_page_token]. + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` + // Optional. Only include resources that match the filter in the response. For + // more information, see + // [Sorting and filtering list + // results](https://cloud.google.com/kms/docs/sorting-and-filtering). + Filter string `protobuf:"bytes,4,opt,name=filter,proto3" json:"filter,omitempty"` + // Optional. Specify how the results should be sorted. If not specified, the + // results will be sorted in the default order. For more information, see + // [Sorting and filtering list + // results](https://cloud.google.com/kms/docs/sorting-and-filtering). + OrderBy string `protobuf:"bytes,5,opt,name=order_by,json=orderBy,proto3" json:"order_by,omitempty"` + // Optional. If set to true, + // [HsmManagement.ListSingleTenantHsmInstanceProposals][google.cloud.kms.v1.HsmManagement.ListSingleTenantHsmInstanceProposals] + // will also return + // [SingleTenantHsmInstanceProposals][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] + // in DELETED state. + ShowDeleted bool `protobuf:"varint,6,opt,name=show_deleted,json=showDeleted,proto3" json:"show_deleted,omitempty"` +} + +func (x *ListSingleTenantHsmInstanceProposalsRequest) Reset() { + *x = ListSingleTenantHsmInstanceProposalsRequest{} + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListSingleTenantHsmInstanceProposalsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListSingleTenantHsmInstanceProposalsRequest) ProtoMessage() {} + +func (x *ListSingleTenantHsmInstanceProposalsRequest) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListSingleTenantHsmInstanceProposalsRequest.ProtoReflect.Descriptor instead. +func (*ListSingleTenantHsmInstanceProposalsRequest) Descriptor() ([]byte, []int) { + return file_google_cloud_kms_v1_hsm_management_proto_rawDescGZIP(), []int{17} +} + +func (x *ListSingleTenantHsmInstanceProposalsRequest) GetParent() string { + if x != nil { + return x.Parent + } + return "" +} + +func (x *ListSingleTenantHsmInstanceProposalsRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListSingleTenantHsmInstanceProposalsRequest) GetPageToken() string { + if x != nil { + return x.PageToken + } + return "" +} + +func (x *ListSingleTenantHsmInstanceProposalsRequest) GetFilter() string { + if x != nil { + return x.Filter + } + return "" +} + +func (x *ListSingleTenantHsmInstanceProposalsRequest) GetOrderBy() string { + if x != nil { + return x.OrderBy + } + return "" +} + +func (x *ListSingleTenantHsmInstanceProposalsRequest) GetShowDeleted() bool { + if x != nil { + return x.ShowDeleted + } + return false +} + +// Response message for +// [HsmManagement.ListSingleTenantHsmInstanceProposals][google.cloud.kms.v1.HsmManagement.ListSingleTenantHsmInstanceProposals]. +type ListSingleTenantHsmInstanceProposalsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The list of + // [SingleTenantHsmInstanceProposals][google.cloud.kms.v1.SingleTenantHsmInstanceProposal]. + SingleTenantHsmInstanceProposals []*SingleTenantHsmInstanceProposal `protobuf:"bytes,1,rep,name=single_tenant_hsm_instance_proposals,json=singleTenantHsmInstanceProposals,proto3" json:"single_tenant_hsm_instance_proposals,omitempty"` + // A token to retrieve next page of results. Pass this value in + // [ListSingleTenantHsmInstanceProposalsRequest.page_token][google.cloud.kms.v1.ListSingleTenantHsmInstanceProposalsRequest.page_token] + // to retrieve the next page of results. + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` + // The total number of + // [SingleTenantHsmInstanceProposals][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] + // that matched the query. + // + // This field is not populated if + // [ListSingleTenantHsmInstanceProposalsRequest.filter][google.cloud.kms.v1.ListSingleTenantHsmInstanceProposalsRequest.filter] + // is applied. + TotalSize int32 `protobuf:"varint,3,opt,name=total_size,json=totalSize,proto3" json:"total_size,omitempty"` +} + +func (x *ListSingleTenantHsmInstanceProposalsResponse) Reset() { + *x = ListSingleTenantHsmInstanceProposalsResponse{} + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListSingleTenantHsmInstanceProposalsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListSingleTenantHsmInstanceProposalsResponse) ProtoMessage() {} + +func (x *ListSingleTenantHsmInstanceProposalsResponse) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListSingleTenantHsmInstanceProposalsResponse.ProtoReflect.Descriptor instead. +func (*ListSingleTenantHsmInstanceProposalsResponse) Descriptor() ([]byte, []int) { + return file_google_cloud_kms_v1_hsm_management_proto_rawDescGZIP(), []int{18} +} + +func (x *ListSingleTenantHsmInstanceProposalsResponse) GetSingleTenantHsmInstanceProposals() []*SingleTenantHsmInstanceProposal { + if x != nil { + return x.SingleTenantHsmInstanceProposals + } + return nil +} + +func (x *ListSingleTenantHsmInstanceProposalsResponse) GetNextPageToken() string { + if x != nil { + return x.NextPageToken + } + return "" +} + +func (x *ListSingleTenantHsmInstanceProposalsResponse) GetTotalSize() int32 { + if x != nil { + return x.TotalSize + } + return 0 +} + +// Request message for +// [HsmManagement.DeleteSingleTenantHsmInstanceProposal][google.cloud.kms.v1.HsmManagement.DeleteSingleTenantHsmInstanceProposal]. +type DeleteSingleTenantHsmInstanceProposalRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. The + // [name][google.cloud.kms.v1.SingleTenantHsmInstanceProposal.name] of the + // [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] + // to delete. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *DeleteSingleTenantHsmInstanceProposalRequest) Reset() { + *x = DeleteSingleTenantHsmInstanceProposalRequest{} + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteSingleTenantHsmInstanceProposalRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteSingleTenantHsmInstanceProposalRequest) ProtoMessage() {} + +func (x *DeleteSingleTenantHsmInstanceProposalRequest) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[19] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteSingleTenantHsmInstanceProposalRequest.ProtoReflect.Descriptor instead. +func (*DeleteSingleTenantHsmInstanceProposalRequest) Descriptor() ([]byte, []int) { + return file_google_cloud_kms_v1_hsm_management_proto_rawDescGZIP(), []int{19} +} + +func (x *DeleteSingleTenantHsmInstanceProposalRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +// Configuration for M of N quorum auth. +type SingleTenantHsmInstance_QuorumAuth struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. The total number of approvers. This is the N value used + // for M of N quorum auth. Must be greater than or equal to 3 and less than + // or equal to 16. + TotalApproverCount int32 `protobuf:"varint,1,opt,name=total_approver_count,json=totalApproverCount,proto3" json:"total_approver_count,omitempty"` + // Output only. The required numbers of approvers. The M value used for M of + // N quorum auth. Must be greater than or equal to 2 and less than or equal + // to + // [total_approver_count][google.cloud.kms.v1.SingleTenantHsmInstance.QuorumAuth.total_approver_count] + // - 1. + RequiredApproverCount int32 `protobuf:"varint,2,opt,name=required_approver_count,json=requiredApproverCount,proto3" json:"required_approver_count,omitempty"` + // Output only. The public keys associated with the 2FA keys for M of N + // quorum auth. + TwoFactorPublicKeyPems []string `protobuf:"bytes,3,rep,name=two_factor_public_key_pems,json=twoFactorPublicKeyPems,proto3" json:"two_factor_public_key_pems,omitempty"` +} + +func (x *SingleTenantHsmInstance_QuorumAuth) Reset() { + *x = SingleTenantHsmInstance_QuorumAuth{} + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SingleTenantHsmInstance_QuorumAuth) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SingleTenantHsmInstance_QuorumAuth) ProtoMessage() {} + +func (x *SingleTenantHsmInstance_QuorumAuth) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[20] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SingleTenantHsmInstance_QuorumAuth.ProtoReflect.Descriptor instead. +func (*SingleTenantHsmInstance_QuorumAuth) Descriptor() ([]byte, []int) { + return file_google_cloud_kms_v1_hsm_management_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *SingleTenantHsmInstance_QuorumAuth) GetTotalApproverCount() int32 { + if x != nil { + return x.TotalApproverCount + } + return 0 +} + +func (x *SingleTenantHsmInstance_QuorumAuth) GetRequiredApproverCount() int32 { + if x != nil { + return x.RequiredApproverCount + } + return 0 +} + +func (x *SingleTenantHsmInstance_QuorumAuth) GetTwoFactorPublicKeyPems() []string { + if x != nil { + return x.TwoFactorPublicKeyPems + } + return nil +} + +// Parameters of quorum approval for the +// [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal]. +type SingleTenantHsmInstanceProposal_QuorumParameters struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Output only. The required numbers of approvers. This is the M value used + // for M of N quorum auth. It is less than the number of public keys. + RequiredApproverCount int32 `protobuf:"varint,1,opt,name=required_approver_count,json=requiredApproverCount,proto3" json:"required_approver_count,omitempty"` + // Output only. The challenges to be signed by 2FA keys for quorum auth. M + // of N of these challenges are required to be signed to approve the + // operation. + Challenges []*Challenge `protobuf:"bytes,2,rep,name=challenges,proto3" json:"challenges,omitempty"` + // Output only. The public keys associated with the 2FA keys that have + // already approved the + // [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] + // by signing the challenge. + ApprovedTwoFactorPublicKeyPems []string `protobuf:"bytes,3,rep,name=approved_two_factor_public_key_pems,json=approvedTwoFactorPublicKeyPems,proto3" json:"approved_two_factor_public_key_pems,omitempty"` +} + +func (x *SingleTenantHsmInstanceProposal_QuorumParameters) Reset() { + *x = SingleTenantHsmInstanceProposal_QuorumParameters{} + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SingleTenantHsmInstanceProposal_QuorumParameters) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SingleTenantHsmInstanceProposal_QuorumParameters) ProtoMessage() {} + +func (x *SingleTenantHsmInstanceProposal_QuorumParameters) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[21] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SingleTenantHsmInstanceProposal_QuorumParameters.ProtoReflect.Descriptor instead. +func (*SingleTenantHsmInstanceProposal_QuorumParameters) Descriptor() ([]byte, []int) { + return file_google_cloud_kms_v1_hsm_management_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *SingleTenantHsmInstanceProposal_QuorumParameters) GetRequiredApproverCount() int32 { + if x != nil { + return x.RequiredApproverCount + } + return 0 +} + +func (x *SingleTenantHsmInstanceProposal_QuorumParameters) GetChallenges() []*Challenge { + if x != nil { + return x.Challenges + } + return nil +} + +func (x *SingleTenantHsmInstanceProposal_QuorumParameters) GetApprovedTwoFactorPublicKeyPems() []string { + if x != nil { + return x.ApprovedTwoFactorPublicKeyPems + } + return nil +} + +// Parameters for an approval that has both required challenges and a +// quorum. +type SingleTenantHsmInstanceProposal_RequiredActionQuorumParameters struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Output only. A list of specific challenges that must be signed. + // For some operations, this will contain a single challenge. + RequiredChallenges []*Challenge `protobuf:"bytes,1,rep,name=required_challenges,json=requiredChallenges,proto3" json:"required_challenges,omitempty"` + // Output only. The required number of quorum approvers. This is the M value + // used for M of N quorum auth. It is less than the number of public keys. + RequiredApproverCount int32 `protobuf:"varint,2,opt,name=required_approver_count,json=requiredApproverCount,proto3" json:"required_approver_count,omitempty"` + // Output only. The challenges to be signed by 2FA keys for quorum auth. M + // of N of these challenges are required to be signed to approve the + // operation. + QuorumChallenges []*Challenge `protobuf:"bytes,3,rep,name=quorum_challenges,json=quorumChallenges,proto3" json:"quorum_challenges,omitempty"` + // Output only. The public keys associated with the 2FA keys that have + // already approved the + // [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] + // by signing the challenge. + ApprovedTwoFactorPublicKeyPems []string `protobuf:"bytes,4,rep,name=approved_two_factor_public_key_pems,json=approvedTwoFactorPublicKeyPems,proto3" json:"approved_two_factor_public_key_pems,omitempty"` +} + +func (x *SingleTenantHsmInstanceProposal_RequiredActionQuorumParameters) Reset() { + *x = SingleTenantHsmInstanceProposal_RequiredActionQuorumParameters{} + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SingleTenantHsmInstanceProposal_RequiredActionQuorumParameters) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SingleTenantHsmInstanceProposal_RequiredActionQuorumParameters) ProtoMessage() {} + +func (x *SingleTenantHsmInstanceProposal_RequiredActionQuorumParameters) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[22] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SingleTenantHsmInstanceProposal_RequiredActionQuorumParameters.ProtoReflect.Descriptor instead. +func (*SingleTenantHsmInstanceProposal_RequiredActionQuorumParameters) Descriptor() ([]byte, []int) { + return file_google_cloud_kms_v1_hsm_management_proto_rawDescGZIP(), []int{1, 1} +} + +func (x *SingleTenantHsmInstanceProposal_RequiredActionQuorumParameters) GetRequiredChallenges() []*Challenge { + if x != nil { + return x.RequiredChallenges + } + return nil +} + +func (x *SingleTenantHsmInstanceProposal_RequiredActionQuorumParameters) GetRequiredApproverCount() int32 { + if x != nil { + return x.RequiredApproverCount + } + return 0 +} + +func (x *SingleTenantHsmInstanceProposal_RequiredActionQuorumParameters) GetQuorumChallenges() []*Challenge { + if x != nil { + return x.QuorumChallenges + } + return nil +} + +func (x *SingleTenantHsmInstanceProposal_RequiredActionQuorumParameters) GetApprovedTwoFactorPublicKeyPems() []string { + if x != nil { + return x.ApprovedTwoFactorPublicKeyPems + } + return nil +} + +// Register 2FA keys for the +// [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance]. +// This operation requires all Challenges to be signed by 2FA keys. The +// [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] must +// be in the +// [PENDING_TWO_FACTOR_AUTH_REGISTRATION][google.cloud.kms.v1.SingleTenantHsmInstance.State.PENDING_TWO_FACTOR_AUTH_REGISTRATION] +// state to perform this operation. +type SingleTenantHsmInstanceProposal_RegisterTwoFactorAuthKeys struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. The required numbers of approvers to set for the + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance]. + // This is the M value used for M of N quorum auth. Must be greater than or + // equal to 2 and less than or equal to + // [total_approver_count][google.cloud.kms.v1.SingleTenantHsmInstance.QuorumAuth.total_approver_count] + // - 1. + RequiredApproverCount int32 `protobuf:"varint,1,opt,name=required_approver_count,json=requiredApproverCount,proto3" json:"required_approver_count,omitempty"` + // Required. The public keys associated with the 2FA keys for M of N quorum + // auth. Public keys must be associated with RSA 2048 keys. + TwoFactorPublicKeyPems []string `protobuf:"bytes,2,rep,name=two_factor_public_key_pems,json=twoFactorPublicKeyPems,proto3" json:"two_factor_public_key_pems,omitempty"` +} + +func (x *SingleTenantHsmInstanceProposal_RegisterTwoFactorAuthKeys) Reset() { + *x = SingleTenantHsmInstanceProposal_RegisterTwoFactorAuthKeys{} + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SingleTenantHsmInstanceProposal_RegisterTwoFactorAuthKeys) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SingleTenantHsmInstanceProposal_RegisterTwoFactorAuthKeys) ProtoMessage() {} + +func (x *SingleTenantHsmInstanceProposal_RegisterTwoFactorAuthKeys) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[23] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SingleTenantHsmInstanceProposal_RegisterTwoFactorAuthKeys.ProtoReflect.Descriptor instead. +func (*SingleTenantHsmInstanceProposal_RegisterTwoFactorAuthKeys) Descriptor() ([]byte, []int) { + return file_google_cloud_kms_v1_hsm_management_proto_rawDescGZIP(), []int{1, 2} +} + +func (x *SingleTenantHsmInstanceProposal_RegisterTwoFactorAuthKeys) GetRequiredApproverCount() int32 { + if x != nil { + return x.RequiredApproverCount + } + return 0 +} + +func (x *SingleTenantHsmInstanceProposal_RegisterTwoFactorAuthKeys) GetTwoFactorPublicKeyPems() []string { + if x != nil { + return x.TwoFactorPublicKeyPems + } + return nil +} + +// Disable the +// [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance]. The +// [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] must +// be in the +// [ACTIVE][google.cloud.kms.v1.SingleTenantHsmInstance.State.ACTIVE] state to +// perform this operation. +type SingleTenantHsmInstanceProposal_DisableSingleTenantHsmInstance struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *SingleTenantHsmInstanceProposal_DisableSingleTenantHsmInstance) Reset() { + *x = SingleTenantHsmInstanceProposal_DisableSingleTenantHsmInstance{} + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SingleTenantHsmInstanceProposal_DisableSingleTenantHsmInstance) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SingleTenantHsmInstanceProposal_DisableSingleTenantHsmInstance) ProtoMessage() {} + +func (x *SingleTenantHsmInstanceProposal_DisableSingleTenantHsmInstance) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[24] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SingleTenantHsmInstanceProposal_DisableSingleTenantHsmInstance.ProtoReflect.Descriptor instead. +func (*SingleTenantHsmInstanceProposal_DisableSingleTenantHsmInstance) Descriptor() ([]byte, []int) { + return file_google_cloud_kms_v1_hsm_management_proto_rawDescGZIP(), []int{1, 3} +} + +// Enable the +// [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance]. The +// [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] must +// be in the +// [DISABLED][google.cloud.kms.v1.SingleTenantHsmInstance.State.DISABLED] +// state to perform this operation. +type SingleTenantHsmInstanceProposal_EnableSingleTenantHsmInstance struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *SingleTenantHsmInstanceProposal_EnableSingleTenantHsmInstance) Reset() { + *x = SingleTenantHsmInstanceProposal_EnableSingleTenantHsmInstance{} + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SingleTenantHsmInstanceProposal_EnableSingleTenantHsmInstance) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SingleTenantHsmInstanceProposal_EnableSingleTenantHsmInstance) ProtoMessage() {} + +func (x *SingleTenantHsmInstanceProposal_EnableSingleTenantHsmInstance) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[25] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SingleTenantHsmInstanceProposal_EnableSingleTenantHsmInstance.ProtoReflect.Descriptor instead. +func (*SingleTenantHsmInstanceProposal_EnableSingleTenantHsmInstance) Descriptor() ([]byte, []int) { + return file_google_cloud_kms_v1_hsm_management_proto_rawDescGZIP(), []int{1, 4} +} + +// Delete the +// [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance]. +// Deleting a +// [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] will +// make all [CryptoKeys][google.cloud.kms.v1.CryptoKey] attached to the +// [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] +// unusable. The +// [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] must +// not be in the +// [DELETING][google.cloud.kms.v1.SingleTenantHsmInstance.State.DELETING] or +// [DELETED][google.cloud.kms.v1.SingleTenantHsmInstance.State.DELETED] state +// to perform this operation. +type SingleTenantHsmInstanceProposal_DeleteSingleTenantHsmInstance struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *SingleTenantHsmInstanceProposal_DeleteSingleTenantHsmInstance) Reset() { + *x = SingleTenantHsmInstanceProposal_DeleteSingleTenantHsmInstance{} + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SingleTenantHsmInstanceProposal_DeleteSingleTenantHsmInstance) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SingleTenantHsmInstanceProposal_DeleteSingleTenantHsmInstance) ProtoMessage() {} + +func (x *SingleTenantHsmInstanceProposal_DeleteSingleTenantHsmInstance) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[26] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SingleTenantHsmInstanceProposal_DeleteSingleTenantHsmInstance.ProtoReflect.Descriptor instead. +func (*SingleTenantHsmInstanceProposal_DeleteSingleTenantHsmInstance) Descriptor() ([]byte, []int) { + return file_google_cloud_kms_v1_hsm_management_proto_rawDescGZIP(), []int{1, 5} +} + +// Add a quorum member to the +// [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance]. +// This will increase the +// [total_approver_count][google.cloud.kms.v1.SingleTenantHsmInstance.QuorumAuth.total_approver_count] +// by 1. The +// [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] must +// be in the +// [ACTIVE][google.cloud.kms.v1.SingleTenantHsmInstance.State.ACTIVE] state to +// perform this operation. +type SingleTenantHsmInstanceProposal_AddQuorumMember struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. The public key associated with the 2FA key for the new quorum + // member to add. Public keys must be associated with RSA 2048 keys. + TwoFactorPublicKeyPem string `protobuf:"bytes,1,opt,name=two_factor_public_key_pem,json=twoFactorPublicKeyPem,proto3" json:"two_factor_public_key_pem,omitempty"` +} + +func (x *SingleTenantHsmInstanceProposal_AddQuorumMember) Reset() { + *x = SingleTenantHsmInstanceProposal_AddQuorumMember{} + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SingleTenantHsmInstanceProposal_AddQuorumMember) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SingleTenantHsmInstanceProposal_AddQuorumMember) ProtoMessage() {} + +func (x *SingleTenantHsmInstanceProposal_AddQuorumMember) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[27] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SingleTenantHsmInstanceProposal_AddQuorumMember.ProtoReflect.Descriptor instead. +func (*SingleTenantHsmInstanceProposal_AddQuorumMember) Descriptor() ([]byte, []int) { + return file_google_cloud_kms_v1_hsm_management_proto_rawDescGZIP(), []int{1, 6} +} + +func (x *SingleTenantHsmInstanceProposal_AddQuorumMember) GetTwoFactorPublicKeyPem() string { + if x != nil { + return x.TwoFactorPublicKeyPem + } + return "" +} + +// Remove a quorum member from the +// [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance]. +// This will reduce +// [total_approver_count][google.cloud.kms.v1.SingleTenantHsmInstance.QuorumAuth.total_approver_count] +// by 1. The +// [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] must +// be in the +// [ACTIVE][google.cloud.kms.v1.SingleTenantHsmInstance.State.ACTIVE] state to +// perform this operation. +type SingleTenantHsmInstanceProposal_RemoveQuorumMember struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. The public key associated with the 2FA key for the quorum + // member to remove. Public keys must be associated with RSA 2048 keys. + TwoFactorPublicKeyPem string `protobuf:"bytes,1,opt,name=two_factor_public_key_pem,json=twoFactorPublicKeyPem,proto3" json:"two_factor_public_key_pem,omitempty"` +} + +func (x *SingleTenantHsmInstanceProposal_RemoveQuorumMember) Reset() { + *x = SingleTenantHsmInstanceProposal_RemoveQuorumMember{} + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SingleTenantHsmInstanceProposal_RemoveQuorumMember) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SingleTenantHsmInstanceProposal_RemoveQuorumMember) ProtoMessage() {} + +func (x *SingleTenantHsmInstanceProposal_RemoveQuorumMember) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[28] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SingleTenantHsmInstanceProposal_RemoveQuorumMember.ProtoReflect.Descriptor instead. +func (*SingleTenantHsmInstanceProposal_RemoveQuorumMember) Descriptor() ([]byte, []int) { + return file_google_cloud_kms_v1_hsm_management_proto_rawDescGZIP(), []int{1, 7} +} + +func (x *SingleTenantHsmInstanceProposal_RemoveQuorumMember) GetTwoFactorPublicKeyPem() string { + if x != nil { + return x.TwoFactorPublicKeyPem + } + return "" +} + +// Refreshes the +// [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance]. +// This operation must be performed periodically to keep the +// [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] +// active. This operation must be performed before +// [unrefreshed_duration_until_disable][google.cloud.kms.v1.SingleTenantHsmInstance.unrefreshed_duration_until_disable] +// has passed. The +// [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] must +// be in the +// [ACTIVE][google.cloud.kms.v1.SingleTenantHsmInstance.State.ACTIVE] state to +// perform this operation. +type SingleTenantHsmInstanceProposal_RefreshSingleTenantHsmInstance struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *SingleTenantHsmInstanceProposal_RefreshSingleTenantHsmInstance) Reset() { + *x = SingleTenantHsmInstanceProposal_RefreshSingleTenantHsmInstance{} + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SingleTenantHsmInstanceProposal_RefreshSingleTenantHsmInstance) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SingleTenantHsmInstanceProposal_RefreshSingleTenantHsmInstance) ProtoMessage() {} + +func (x *SingleTenantHsmInstanceProposal_RefreshSingleTenantHsmInstance) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[29] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SingleTenantHsmInstanceProposal_RefreshSingleTenantHsmInstance.ProtoReflect.Descriptor instead. +func (*SingleTenantHsmInstanceProposal_RefreshSingleTenantHsmInstance) Descriptor() ([]byte, []int) { + return file_google_cloud_kms_v1_hsm_management_proto_rawDescGZIP(), []int{1, 8} +} + +// The reply to +// [QuorumParameters][google.cloud.kms.v1.SingleTenantHsmInstanceProposal.QuorumParameters] +// for approving the proposal. +type ApproveSingleTenantHsmInstanceProposalRequest_QuorumReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. The challenge replies to approve the proposal. Challenge + // replies can be sent across multiple requests. The proposal will be + // approved when + // [required_approver_count][google.cloud.kms.v1.SingleTenantHsmInstanceProposal.QuorumParameters.required_approver_count] + // challenge replies are provided. + ChallengeReplies []*ChallengeReply `protobuf:"bytes,1,rep,name=challenge_replies,json=challengeReplies,proto3" json:"challenge_replies,omitempty"` +} + +func (x *ApproveSingleTenantHsmInstanceProposalRequest_QuorumReply) Reset() { + *x = ApproveSingleTenantHsmInstanceProposalRequest_QuorumReply{} + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ApproveSingleTenantHsmInstanceProposalRequest_QuorumReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApproveSingleTenantHsmInstanceProposalRequest_QuorumReply) ProtoMessage() {} + +func (x *ApproveSingleTenantHsmInstanceProposalRequest_QuorumReply) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[30] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ApproveSingleTenantHsmInstanceProposalRequest_QuorumReply.ProtoReflect.Descriptor instead. +func (*ApproveSingleTenantHsmInstanceProposalRequest_QuorumReply) Descriptor() ([]byte, []int) { + return file_google_cloud_kms_v1_hsm_management_proto_rawDescGZIP(), []int{12, 0} +} + +func (x *ApproveSingleTenantHsmInstanceProposalRequest_QuorumReply) GetChallengeReplies() []*ChallengeReply { + if x != nil { + return x.ChallengeReplies + } + return nil +} + +// The reply to +// [RequiredActionQuorumParameters][google.cloud.kms.v1.SingleTenantHsmInstanceProposal.RequiredActionQuorumParameters] +// for approving the proposal. +type ApproveSingleTenantHsmInstanceProposalRequest_RequiredActionQuorumReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. All required challenges must be signed for the proposal to be + // approved. These can be sent across multiple requests. + RequiredChallengeReplies []*ChallengeReply `protobuf:"bytes,1,rep,name=required_challenge_replies,json=requiredChallengeReplies,proto3" json:"required_challenge_replies,omitempty"` + // Required. Quorum members' signed challenge replies. These can be provided + // across multiple requests. The proposal will be approved when + // [required_approver_count][google.cloud.kms.v1.SingleTenantHsmInstanceProposal.RequiredActionQuorumParameters.required_approver_count] + // quorum_challenge_replies are provided and when all + // required_challenge_replies are provided. + QuorumChallengeReplies []*ChallengeReply `protobuf:"bytes,2,rep,name=quorum_challenge_replies,json=quorumChallengeReplies,proto3" json:"quorum_challenge_replies,omitempty"` +} + +func (x *ApproveSingleTenantHsmInstanceProposalRequest_RequiredActionQuorumReply) Reset() { + *x = ApproveSingleTenantHsmInstanceProposalRequest_RequiredActionQuorumReply{} + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ApproveSingleTenantHsmInstanceProposalRequest_RequiredActionQuorumReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApproveSingleTenantHsmInstanceProposalRequest_RequiredActionQuorumReply) ProtoMessage() {} + +func (x *ApproveSingleTenantHsmInstanceProposalRequest_RequiredActionQuorumReply) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_kms_v1_hsm_management_proto_msgTypes[31] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ApproveSingleTenantHsmInstanceProposalRequest_RequiredActionQuorumReply.ProtoReflect.Descriptor instead. +func (*ApproveSingleTenantHsmInstanceProposalRequest_RequiredActionQuorumReply) Descriptor() ([]byte, []int) { + return file_google_cloud_kms_v1_hsm_management_proto_rawDescGZIP(), []int{12, 1} +} + +func (x *ApproveSingleTenantHsmInstanceProposalRequest_RequiredActionQuorumReply) GetRequiredChallengeReplies() []*ChallengeReply { + if x != nil { + return x.RequiredChallengeReplies + } + return nil +} + +func (x *ApproveSingleTenantHsmInstanceProposalRequest_RequiredActionQuorumReply) GetQuorumChallengeReplies() []*ChallengeReply { + if x != nil { + return x.QuorumChallengeReplies + } + return nil +} + +var File_google_cloud_kms_v1_hsm_management_proto protoreflect.FileDescriptor + +var file_google_cloud_kms_v1_hsm_management_proto_rawDesc = []byte{ + 0x0a, 0x28, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x6b, + 0x6d, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x68, 0x73, 0x6d, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, + 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x1a, + 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, + 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x23, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x6c, 0x6f, 0x6e, 0x67, 0x72, + 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x2f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xcc, 0x08, 0x0a, 0x17, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, + 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, + 0x65, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x03, 0xe0, 0x41, 0x08, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, + 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x4d, 0x0a, 0x05, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x32, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, + 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x42, + 0x03, 0xe0, 0x41, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x5d, 0x0a, 0x0b, 0x71, + 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x37, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, + 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, + 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x51, + 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x41, 0x75, 0x74, 0x68, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0a, + 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x41, 0x75, 0x74, 0x68, 0x12, 0x40, 0x0a, 0x0b, 0x64, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, + 0x52, 0x0a, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x6b, 0x0a, 0x22, + 0x75, 0x6e, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x65, 0x64, 0x5f, 0x64, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x75, 0x6e, 0x74, 0x69, 0x6c, 0x5f, 0x64, 0x69, 0x73, 0x61, 0x62, + 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x1f, 0x75, 0x6e, 0x72, 0x65, 0x66, 0x72, + 0x65, 0x73, 0x68, 0x65, 0x64, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x6e, 0x74, + 0x69, 0x6c, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x42, 0x0a, 0x0c, 0x64, 0x69, 0x73, + 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, + 0x52, 0x0b, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x1a, 0xc1, 0x01, + 0x0a, 0x0a, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x41, 0x75, 0x74, 0x68, 0x12, 0x35, 0x0a, 0x14, + 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x72, 0x5f, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, + 0x12, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x72, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x12, 0x3b, 0x0a, 0x17, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x5f, + 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x15, 0x72, 0x65, 0x71, 0x75, 0x69, + 0x72, 0x65, 0x64, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x3f, 0x0a, 0x1a, 0x74, 0x77, 0x6f, 0x5f, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x70, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x70, 0x65, 0x6d, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x16, 0x74, 0x77, 0x6f, 0x46, 0x61, + 0x63, 0x74, 0x6f, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x50, 0x65, 0x6d, + 0x73, 0x22, 0xa6, 0x01, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x53, + 0x54, 0x41, 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, + 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x52, 0x45, 0x41, 0x54, 0x49, 0x4e, 0x47, 0x10, 0x01, + 0x12, 0x28, 0x0a, 0x24, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x54, 0x57, 0x4f, 0x5f, + 0x46, 0x41, 0x43, 0x54, 0x4f, 0x52, 0x5f, 0x41, 0x55, 0x54, 0x48, 0x5f, 0x52, 0x45, 0x47, 0x49, + 0x53, 0x54, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x43, + 0x54, 0x49, 0x56, 0x45, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x44, 0x49, 0x53, 0x41, 0x42, 0x4c, + 0x49, 0x4e, 0x47, 0x10, 0x04, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x49, 0x53, 0x41, 0x42, 0x4c, 0x45, + 0x44, 0x10, 0x05, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x49, 0x4e, 0x47, 0x10, + 0x06, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x44, 0x10, 0x07, 0x12, 0x0a, + 0x0a, 0x06, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x08, 0x3a, 0xc7, 0x01, 0xea, 0x41, 0xc3, + 0x01, 0x0a, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x53, 0x69, 0x6e, 0x67, 0x6c, + 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, + 0x63, 0x65, 0x12, 0x5d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2f, 0x7b, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x73, 0x69, 0x6e, 0x67, + 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, + 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x5f, 0x74, 0x65, 0x6e, + 0x61, 0x6e, 0x74, 0x5f, 0x68, 0x73, 0x6d, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x7d, 0x2a, 0x18, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, + 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x32, 0x17, 0x73, 0x69, 0x6e, + 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, + 0x61, 0x6e, 0x63, 0x65, 0x22, 0xda, 0x19, 0x0a, 0x1f, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, + 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x08, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, + 0x69, 0x6d, 0x65, 0x12, 0x55, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x3a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, + 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, + 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x42, 0x03, + 0xe0, 0x41, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2a, 0x0a, 0x0e, 0x66, 0x61, + 0x69, 0x6c, 0x75, 0x72, 0x65, 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0d, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, + 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x79, 0x0a, 0x11, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x45, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, + 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, + 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x2e, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x48, 0x00, 0x52, + 0x10, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, + 0x73, 0x12, 0xa5, 0x01, 0x0a, 0x21, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x5f, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x53, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, + 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, + 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x61, 0x6c, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x41, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, + 0x72, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x48, 0x00, 0x52, 0x1e, 0x72, 0x65, 0x71, 0x75, 0x69, + 0x72, 0x65, 0x64, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x3d, 0x0a, 0x0b, 0x65, 0x78, 0x70, + 0x69, 0x72, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x01, 0x52, 0x0a, 0x65, 0x78, + 0x70, 0x69, 0x72, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x32, 0x0a, 0x03, 0x74, 0x74, 0x6c, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x42, 0x03, 0xe0, 0x41, 0x04, 0x48, 0x01, 0x52, 0x03, 0x74, 0x74, 0x6c, 0x12, 0x40, 0x0a, 0x0b, + 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, + 0x41, 0x03, 0x52, 0x0a, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3e, + 0x0a, 0x0a, 0x70, 0x75, 0x72, 0x67, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x10, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, + 0xe0, 0x41, 0x03, 0x52, 0x09, 0x70, 0x75, 0x72, 0x67, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x92, + 0x01, 0x0a, 0x1d, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x74, 0x77, 0x6f, 0x5f, + 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6b, 0x65, 0x79, 0x73, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x4e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x6e, + 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, + 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x2e, 0x52, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x65, 0x72, 0x54, 0x77, 0x6f, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x41, 0x75, + 0x74, 0x68, 0x4b, 0x65, 0x79, 0x73, 0x48, 0x02, 0x52, 0x19, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x65, 0x72, 0x54, 0x77, 0x6f, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x41, 0x75, 0x74, 0x68, 0x4b, + 0x65, 0x79, 0x73, 0x12, 0xa1, 0x01, 0x0a, 0x22, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, + 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x5f, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x68, 0x73, + 0x6d, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x53, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, + 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, + 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x2e, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x69, + 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, + 0x74, 0x61, 0x6e, 0x63, 0x65, 0x48, 0x02, 0x52, 0x1e, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, + 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x9e, 0x01, 0x0a, 0x21, 0x65, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x5f, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x5f, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, + 0x5f, 0x68, 0x73, 0x6d, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x52, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, + 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, + 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, + 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x2e, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x48, 0x02, 0x52, 0x1d, 0x65, 0x6e, 0x61, 0x62, 0x6c, + 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, + 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x9e, 0x01, 0x0a, 0x21, 0x64, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x5f, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x5f, 0x74, 0x65, 0x6e, 0x61, 0x6e, + 0x74, 0x5f, 0x68, 0x73, 0x6d, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x0b, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x52, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x6e, 0x67, 0x6c, + 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, + 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, + 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x48, 0x02, 0x52, 0x1d, 0x64, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, + 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x72, 0x0a, 0x11, 0x61, 0x64, 0x64, + 0x5f, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x5f, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x0c, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x44, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x6e, 0x67, 0x6c, + 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, + 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x2e, 0x41, 0x64, 0x64, 0x51, 0x75, + 0x6f, 0x72, 0x75, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x48, 0x02, 0x52, 0x0f, 0x61, 0x64, + 0x64, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x7b, 0x0a, + 0x14, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x5f, 0x6d, + 0x65, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x47, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, + 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, + 0x6c, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x4d, 0x65, + 0x6d, 0x62, 0x65, 0x72, 0x48, 0x02, 0x52, 0x12, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x51, 0x75, + 0x6f, 0x72, 0x75, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0xa1, 0x01, 0x0a, 0x22, 0x72, + 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x5f, 0x74, 0x65, + 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x68, 0x73, 0x6d, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, + 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x53, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, + 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, + 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x2e, 0x52, 0x65, + 0x66, 0x72, 0x65, 0x73, 0x68, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, + 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x48, 0x02, 0x52, 0x1e, + 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, + 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x1a, 0xe6, + 0x01, 0x0a, 0x10, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, + 0x65, 0x72, 0x73, 0x12, 0x3b, 0x0a, 0x17, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x5f, + 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x15, 0x72, 0x65, 0x71, 0x75, 0x69, + 0x72, 0x65, 0x64, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x43, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6c, 0x6c, + 0x65, 0x6e, 0x67, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x63, 0x68, 0x61, 0x6c, 0x6c, + 0x65, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x50, 0x0a, 0x23, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, + 0x64, 0x5f, 0x74, 0x77, 0x6f, 0x5f, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x70, 0x75, 0x62, + 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x70, 0x65, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x1e, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, + 0x64, 0x54, 0x77, 0x6f, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x4b, 0x65, 0x79, 0x50, 0x65, 0x6d, 0x73, 0x1a, 0xd7, 0x02, 0x0a, 0x1e, 0x52, 0x65, 0x71, 0x75, + 0x69, 0x72, 0x65, 0x64, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x54, 0x0a, 0x13, 0x72, 0x65, + 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, + 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x12, 0x72, 0x65, + 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x73, + 0x12, 0x3b, 0x0a, 0x17, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x61, 0x70, 0x70, + 0x72, 0x6f, 0x76, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x05, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x15, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, + 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x50, 0x0a, + 0x11, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x5f, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, + 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, + 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x10, 0x71, + 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x73, 0x12, + 0x50, 0x0a, 0x23, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x5f, 0x74, 0x77, 0x6f, 0x5f, + 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, + 0x79, 0x5f, 0x70, 0x65, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, + 0x03, 0x52, 0x1e, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x54, 0x77, 0x6f, 0x46, 0x61, + 0x63, 0x74, 0x6f, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x50, 0x65, 0x6d, + 0x73, 0x1a, 0x99, 0x01, 0x0a, 0x19, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x54, 0x77, + 0x6f, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x41, 0x75, 0x74, 0x68, 0x4b, 0x65, 0x79, 0x73, 0x12, + 0x3b, 0x0a, 0x17, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x61, 0x70, 0x70, 0x72, + 0x6f, 0x76, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x15, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x41, + 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x3f, 0x0a, 0x1a, + 0x74, 0x77, 0x6f, 0x5f, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x70, 0x65, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, + 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x16, 0x74, 0x77, 0x6f, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, + 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x50, 0x65, 0x6d, 0x73, 0x1a, 0x20, 0x0a, + 0x1e, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, + 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x1a, + 0x1f, 0x0a, 0x1d, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, + 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x1a, 0x1f, 0x0a, 0x1d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, + 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, + 0x65, 0x1a, 0x50, 0x0a, 0x0f, 0x41, 0x64, 0x64, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x4d, 0x65, + 0x6d, 0x62, 0x65, 0x72, 0x12, 0x3d, 0x0a, 0x19, 0x74, 0x77, 0x6f, 0x5f, 0x66, 0x61, 0x63, 0x74, + 0x6f, 0x72, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x70, 0x65, + 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x15, 0x74, 0x77, + 0x6f, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, + 0x50, 0x65, 0x6d, 0x1a, 0x53, 0x0a, 0x12, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x51, 0x75, 0x6f, + 0x72, 0x75, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x3d, 0x0a, 0x19, 0x74, 0x77, 0x6f, + 0x5f, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, + 0x65, 0x79, 0x5f, 0x70, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, + 0x02, 0x52, 0x15, 0x74, 0x77, 0x6f, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x50, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x4b, 0x65, 0x79, 0x50, 0x65, 0x6d, 0x1a, 0x20, 0x0a, 0x1e, 0x52, 0x65, 0x66, 0x72, + 0x65, 0x73, 0x68, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, + 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x22, 0x7c, 0x0a, 0x05, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x53, + 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x52, + 0x45, 0x41, 0x54, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x45, 0x4e, 0x44, + 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x41, 0x50, 0x50, 0x52, 0x4f, 0x56, 0x45, + 0x44, 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x55, 0x4e, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x04, + 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x55, 0x43, 0x43, 0x45, 0x45, 0x44, 0x45, 0x44, 0x10, 0x05, 0x12, + 0x0a, 0x0a, 0x06, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x06, 0x12, 0x0b, 0x0a, 0x07, 0x44, + 0x45, 0x4c, 0x45, 0x54, 0x45, 0x44, 0x10, 0x07, 0x3a, 0xf4, 0x01, 0xea, 0x41, 0xf0, 0x01, 0x0a, + 0x37, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, + 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x72, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x6c, 0x6f, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x7d, 0x2f, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, + 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x73, 0x69, 0x6e, 0x67, + 0x6c, 0x65, 0x5f, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x68, 0x73, 0x6d, 0x5f, 0x69, 0x6e, + 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x7d, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, + 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x7d, 0x2a, 0x20, 0x73, 0x69, + 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, + 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x32, 0x1f, + 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x42, + 0x15, 0x0a, 0x13, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x5f, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x42, 0x0c, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0b, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x22, 0x59, 0x0a, 0x09, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x12, 0x21, + 0x0a, 0x09, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x09, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, + 0x65, 0x12, 0x29, 0x0a, 0x0e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x5f, + 0x70, 0x65, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0c, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x50, 0x65, 0x6d, 0x22, 0x6b, 0x0a, 0x0e, + 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x2e, + 0x0a, 0x10, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, + 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0f, 0x73, + 0x69, 0x67, 0x6e, 0x65, 0x64, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x12, 0x29, + 0x0a, 0x0e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x70, 0x65, 0x6d, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0c, 0x70, 0x75, 0x62, + 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x50, 0x65, 0x6d, 0x22, 0x93, 0x02, 0x0a, 0x23, 0x4c, 0x69, + 0x73, 0x74, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, + 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x41, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x29, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x23, 0x0a, 0x21, 0x6c, 0x6f, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x70, 0x61, + 0x72, 0x65, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x08, 0x70, 0x61, + 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x22, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, + 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1b, 0x0a, 0x06, 0x66, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, + 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, + 0x5f, 0x62, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x07, + 0x6f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x79, 0x12, 0x26, 0x0a, 0x0c, 0x73, 0x68, 0x6f, 0x77, 0x5f, + 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, + 0x41, 0x01, 0x52, 0x0b, 0x73, 0x68, 0x6f, 0x77, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x22, + 0xda, 0x01, 0x0a, 0x24, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, + 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6b, 0x0a, 0x1b, 0x73, 0x69, 0x6e, 0x67, + 0x6c, 0x65, 0x5f, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x68, 0x73, 0x6d, 0x5f, 0x69, 0x6e, + 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, + 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, + 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x18, 0x73, 0x69, 0x6e, + 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, + 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, + 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, + 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x0a, + 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x70, 0x0a, 0x21, + 0x47, 0x65, 0x74, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, + 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x4b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x37, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x31, 0x0a, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, + 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, + 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xa0, + 0x02, 0x0a, 0x24, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, + 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x41, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x29, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x23, 0x0a, + 0x21, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x45, 0x0a, 0x1d, 0x73, 0x69, + 0x6e, 0x67, 0x6c, 0x65, 0x5f, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x68, 0x73, 0x6d, 0x5f, + 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x19, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, + 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x49, + 0x64, 0x12, 0x6e, 0x0a, 0x1a, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x5f, 0x74, 0x65, 0x6e, 0x61, + 0x6e, 0x74, 0x5f, 0x68, 0x73, 0x6d, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, + 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x6e, 0x67, + 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, + 0x6e, 0x63, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x17, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, + 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, + 0x65, 0x22, 0x27, 0x0a, 0x25, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, + 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, + 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0xe1, 0x02, 0x0a, 0x2c, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, + 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, + 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4f, 0x0a, 0x06, 0x70, + 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x37, 0xe0, 0x41, 0x02, + 0xfa, 0x41, 0x31, 0x0a, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x53, 0x69, 0x6e, + 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, + 0x61, 0x6e, 0x63, 0x65, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x56, 0x0a, 0x26, + 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x5f, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x68, 0x73, + 0x6d, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, + 0x01, 0x52, 0x21, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, + 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x61, 0x6c, 0x49, 0x64, 0x12, 0x87, 0x01, 0x0a, 0x23, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x5f, + 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x68, 0x73, 0x6d, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, + 0x6e, 0x63, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, + 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, + 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x1f, 0x73, + 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, + 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x22, 0x2f, + 0x0a, 0x2d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, + 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, + 0x80, 0x01, 0x0a, 0x29, 0x47, 0x65, 0x74, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, + 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x53, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x3f, 0xe0, 0x41, 0x02, + 0xfa, 0x41, 0x39, 0x0a, 0x37, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x53, 0x69, 0x6e, + 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, + 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x22, 0x89, 0x06, 0x0a, 0x2d, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x53, 0x69, + 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, + 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x53, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x3f, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x39, 0x0a, 0x37, 0x63, 0x6c, 0x6f, 0x75, + 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, + 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x61, 0x6c, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x78, 0x0a, 0x0c, 0x71, 0x75, 0x6f, + 0x72, 0x75, 0x6d, 0x5f, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x4e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, + 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x53, 0x69, 0x6e, + 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, + 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x2e, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x42, + 0x03, 0xe0, 0x41, 0x02, 0x48, 0x00, 0x52, 0x0b, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x52, 0x65, + 0x70, 0x6c, 0x79, 0x12, 0xa4, 0x01, 0x0a, 0x1c, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, + 0x5f, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x5f, 0x72, + 0x65, 0x70, 0x6c, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x5c, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, + 0x2e, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, + 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, + 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x51, 0x75, 0x6f, + 0x72, 0x75, 0x6d, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x48, 0x00, 0x52, + 0x19, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x51, + 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x1a, 0x64, 0x0a, 0x0b, 0x51, 0x75, + 0x6f, 0x72, 0x75, 0x6d, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x55, 0x0a, 0x11, 0x63, 0x68, 0x61, + 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x5f, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x65, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6c, 0x6c, + 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x10, + 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x65, 0x73, + 0x1a, 0xe7, 0x01, 0x0a, 0x19, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x41, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x66, + 0x0a, 0x1a, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x63, 0x68, 0x61, 0x6c, 0x6c, + 0x65, 0x6e, 0x67, 0x65, 0x5f, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, + 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, + 0x67, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x18, 0x72, 0x65, + 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, + 0x65, 0x70, 0x6c, 0x69, 0x65, 0x73, 0x12, 0x62, 0x0a, 0x18, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, + 0x5f, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x5f, 0x72, 0x65, 0x70, 0x6c, 0x69, + 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, + 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x42, 0x03, 0xe0, + 0x41, 0x02, 0x52, 0x16, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, + 0x6e, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x65, 0x73, 0x42, 0x12, 0x0a, 0x10, 0x61, 0x70, + 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x30, + 0x0a, 0x2e, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, + 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x84, 0x01, 0x0a, 0x2d, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x53, 0x69, 0x6e, 0x67, + 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, + 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x53, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x3f, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x39, 0x0a, 0x37, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, + 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, + 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, + 0x6c, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x30, 0x0a, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, + 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, + 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, 0x0a, 0x2e, 0x45, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, + 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x61, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0xa9, 0x02, 0x0a, 0x2b, + 0x4c, 0x69, 0x73, 0x74, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, + 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4f, 0x0a, 0x06, 0x70, + 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x37, 0xe0, 0x41, 0x02, + 0xfa, 0x41, 0x31, 0x0a, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x53, 0x69, 0x6e, + 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, + 0x61, 0x6e, 0x63, 0x65, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x09, + 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x22, + 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x12, 0x1b, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, + 0x1e, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x62, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x79, 0x12, + 0x26, 0x0a, 0x0c, 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0b, 0x73, 0x68, 0x6f, 0x77, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x22, 0xfc, 0x01, 0x0a, 0x2c, 0x4c, 0x69, 0x73, 0x74, + 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x84, 0x01, 0x0a, 0x24, 0x73, 0x69, 0x6e, + 0x67, 0x6c, 0x65, 0x5f, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x68, 0x73, 0x6d, 0x5f, 0x69, + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, + 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, + 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x20, 0x73, + 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, + 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x12, + 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, + 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, + 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x74, + 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x83, 0x01, 0x0a, 0x2c, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, + 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x53, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x3f, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x39, 0x0a, 0x37, 0x63, + 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, + 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, + 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x32, 0xa3, 0x15, 0x0a, + 0x0d, 0x48, 0x73, 0x6d, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0xe2, + 0x01, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, + 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, + 0x38, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, + 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, + 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, + 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, + 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4d, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x3e, 0x12, 0x3c, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, + 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x73, 0x69, 0x6e, 0x67, 0x6c, + 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, + 0x63, 0x65, 0x73, 0x12, 0xcf, 0x01, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x53, 0x69, 0x6e, 0x67, 0x6c, + 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, + 0x63, 0x65, 0x12, 0x36, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, + 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x69, 0x6e, 0x67, + 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, + 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, + 0x2e, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, + 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x22, 0x4b, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3e, 0x12, 0x3c, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, + 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, + 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, + 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xe1, 0x02, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x39, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, + 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6c, 0x6f, 0x6e, 0x67, + 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x22, 0xe5, 0x01, 0xca, 0x41, 0x40, 0x0a, 0x17, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, + 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x12, 0x25, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, + 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xda, 0x41, 0x3f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, + 0x2c, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x5f, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x68, + 0x73, 0x6d, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x2c, 0x73, 0x69, 0x6e, 0x67, + 0x6c, 0x65, 0x5f, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x68, 0x73, 0x6d, 0x5f, 0x69, 0x6e, + 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x5a, 0x3a, + 0x1a, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x5f, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x68, + 0x73, 0x6d, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x22, 0x3c, 0x2f, 0x76, 0x31, + 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, + 0x2f, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, + 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0xa8, 0x03, 0x0a, 0x25, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, + 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x61, 0x6c, 0x12, 0x41, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, + 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x6c, 0x6f, 0x6e, 0x67, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x2e, 0x4f, 0x70, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x9c, 0x02, 0xca, 0x41, 0x50, 0x0a, 0x1f, 0x53, 0x69, 0x6e, + 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, + 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x2d, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, + 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x61, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xda, 0x41, 0x51, 0x70, 0x61, + 0x72, 0x65, 0x6e, 0x74, 0x2c, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x5f, 0x74, 0x65, 0x6e, 0x61, + 0x6e, 0x74, 0x5f, 0x68, 0x73, 0x6d, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, + 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x2c, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x5f, + 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x68, 0x73, 0x6d, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, + 0x6e, 0x63, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x6f, 0x3a, 0x23, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x5f, 0x74, 0x65, + 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x68, 0x73, 0x6d, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, + 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x22, 0x48, 0x2f, 0x76, 0x31, 0x2f, + 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, + 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x73, + 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, + 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x61, 0x6c, 0x73, 0x12, 0xa2, 0x02, 0x0a, 0x26, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, + 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, + 0x42, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, + 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x53, 0x69, 0x6e, + 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, + 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x43, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, + 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, + 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, + 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x6f, 0xda, 0x41, 0x11, 0x6e, 0x61, 0x6d, + 0x65, 0x2c, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x5f, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x55, 0x3a, 0x01, 0x2a, 0x22, 0x50, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, + 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, + 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, + 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x2f, 0x2a, + 0x7d, 0x3a, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x12, 0xd3, 0x02, 0x0a, 0x26, 0x45, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, + 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, + 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x42, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, + 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, + 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x6c, 0x6f, 0x6e, 0x67, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x2e, 0x4f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xc5, 0x01, 0xca, 0x41, 0x60, 0x0a, 0x2e, 0x45, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, + 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x45, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, + 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xda, 0x41, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x55, 0x3a, 0x01, 0x2a, 0x22, 0x50, 0x2f, + 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, + 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x61, 0x6c, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x12, + 0xf3, 0x01, 0x0a, 0x22, 0x47, 0x65, 0x74, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, + 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x3e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, + 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x6e, + 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, + 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x22, 0x57, 0xda, 0x41, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x4a, 0x12, 0x48, 0x2f, 0x76, 0x31, + 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, + 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x73, 0x69, + 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, + 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, + 0x6c, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x86, 0x02, 0x0a, 0x24, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x69, + 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, + 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x12, 0x40, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, + 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x41, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, + 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x69, 0x6e, 0x67, 0x6c, + 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, + 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x59, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x4a, 0x12, 0x48, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, + 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, + 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x12, 0xdb, + 0x01, 0x0a, 0x25, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, + 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x41, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, + 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, + 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x22, 0x57, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x4a, 0x2a, 0x48, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, 0x65, 0x6e, 0x61, 0x6e, + 0x74, 0x48, 0x73, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x2f, + 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x2f, 0x2a, 0x7d, 0x1a, 0x74, 0xca, 0x41, + 0x17, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0xd2, 0x41, 0x57, 0x68, 0x74, 0x74, 0x70, 0x73, + 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, + 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, + 0x2d, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2c, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, + 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, + 0x6d, 0x73, 0x42, 0x86, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x12, + 0x48, 0x73, 0x6d, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x29, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x6b, 0x6d, 0x73, 0x2f, 0x61, 0x70, + 0x69, 0x76, 0x31, 0x2f, 0x6b, 0x6d, 0x73, 0x70, 0x62, 0x3b, 0x6b, 0x6d, 0x73, 0x70, 0x62, 0xaa, + 0x02, 0x13, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x4b, + 0x6d, 0x73, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x13, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5c, 0x43, + 0x6c, 0x6f, 0x75, 0x64, 0x5c, 0x4b, 0x6d, 0x73, 0x5c, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_google_cloud_kms_v1_hsm_management_proto_rawDescOnce sync.Once + file_google_cloud_kms_v1_hsm_management_proto_rawDescData = file_google_cloud_kms_v1_hsm_management_proto_rawDesc +) + +func file_google_cloud_kms_v1_hsm_management_proto_rawDescGZIP() []byte { + file_google_cloud_kms_v1_hsm_management_proto_rawDescOnce.Do(func() { + file_google_cloud_kms_v1_hsm_management_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_cloud_kms_v1_hsm_management_proto_rawDescData) + }) + return file_google_cloud_kms_v1_hsm_management_proto_rawDescData +} + +var file_google_cloud_kms_v1_hsm_management_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_google_cloud_kms_v1_hsm_management_proto_msgTypes = make([]protoimpl.MessageInfo, 32) +var file_google_cloud_kms_v1_hsm_management_proto_goTypes = []any{ + (SingleTenantHsmInstance_State)(0), // 0: google.cloud.kms.v1.SingleTenantHsmInstance.State + (SingleTenantHsmInstanceProposal_State)(0), // 1: google.cloud.kms.v1.SingleTenantHsmInstanceProposal.State + (*SingleTenantHsmInstance)(nil), // 2: google.cloud.kms.v1.SingleTenantHsmInstance + (*SingleTenantHsmInstanceProposal)(nil), // 3: google.cloud.kms.v1.SingleTenantHsmInstanceProposal + (*Challenge)(nil), // 4: google.cloud.kms.v1.Challenge + (*ChallengeReply)(nil), // 5: google.cloud.kms.v1.ChallengeReply + (*ListSingleTenantHsmInstancesRequest)(nil), // 6: google.cloud.kms.v1.ListSingleTenantHsmInstancesRequest + (*ListSingleTenantHsmInstancesResponse)(nil), // 7: google.cloud.kms.v1.ListSingleTenantHsmInstancesResponse + (*GetSingleTenantHsmInstanceRequest)(nil), // 8: google.cloud.kms.v1.GetSingleTenantHsmInstanceRequest + (*CreateSingleTenantHsmInstanceRequest)(nil), // 9: google.cloud.kms.v1.CreateSingleTenantHsmInstanceRequest + (*CreateSingleTenantHsmInstanceMetadata)(nil), // 10: google.cloud.kms.v1.CreateSingleTenantHsmInstanceMetadata + (*CreateSingleTenantHsmInstanceProposalRequest)(nil), // 11: google.cloud.kms.v1.CreateSingleTenantHsmInstanceProposalRequest + (*CreateSingleTenantHsmInstanceProposalMetadata)(nil), // 12: google.cloud.kms.v1.CreateSingleTenantHsmInstanceProposalMetadata + (*GetSingleTenantHsmInstanceProposalRequest)(nil), // 13: google.cloud.kms.v1.GetSingleTenantHsmInstanceProposalRequest + (*ApproveSingleTenantHsmInstanceProposalRequest)(nil), // 14: google.cloud.kms.v1.ApproveSingleTenantHsmInstanceProposalRequest + (*ApproveSingleTenantHsmInstanceProposalResponse)(nil), // 15: google.cloud.kms.v1.ApproveSingleTenantHsmInstanceProposalResponse + (*ExecuteSingleTenantHsmInstanceProposalRequest)(nil), // 16: google.cloud.kms.v1.ExecuteSingleTenantHsmInstanceProposalRequest + (*ExecuteSingleTenantHsmInstanceProposalResponse)(nil), // 17: google.cloud.kms.v1.ExecuteSingleTenantHsmInstanceProposalResponse + (*ExecuteSingleTenantHsmInstanceProposalMetadata)(nil), // 18: google.cloud.kms.v1.ExecuteSingleTenantHsmInstanceProposalMetadata + (*ListSingleTenantHsmInstanceProposalsRequest)(nil), // 19: google.cloud.kms.v1.ListSingleTenantHsmInstanceProposalsRequest + (*ListSingleTenantHsmInstanceProposalsResponse)(nil), // 20: google.cloud.kms.v1.ListSingleTenantHsmInstanceProposalsResponse + (*DeleteSingleTenantHsmInstanceProposalRequest)(nil), // 21: google.cloud.kms.v1.DeleteSingleTenantHsmInstanceProposalRequest + (*SingleTenantHsmInstance_QuorumAuth)(nil), // 22: google.cloud.kms.v1.SingleTenantHsmInstance.QuorumAuth + (*SingleTenantHsmInstanceProposal_QuorumParameters)(nil), // 23: google.cloud.kms.v1.SingleTenantHsmInstanceProposal.QuorumParameters + (*SingleTenantHsmInstanceProposal_RequiredActionQuorumParameters)(nil), // 24: google.cloud.kms.v1.SingleTenantHsmInstanceProposal.RequiredActionQuorumParameters + (*SingleTenantHsmInstanceProposal_RegisterTwoFactorAuthKeys)(nil), // 25: google.cloud.kms.v1.SingleTenantHsmInstanceProposal.RegisterTwoFactorAuthKeys + (*SingleTenantHsmInstanceProposal_DisableSingleTenantHsmInstance)(nil), // 26: google.cloud.kms.v1.SingleTenantHsmInstanceProposal.DisableSingleTenantHsmInstance + (*SingleTenantHsmInstanceProposal_EnableSingleTenantHsmInstance)(nil), // 27: google.cloud.kms.v1.SingleTenantHsmInstanceProposal.EnableSingleTenantHsmInstance + (*SingleTenantHsmInstanceProposal_DeleteSingleTenantHsmInstance)(nil), // 28: google.cloud.kms.v1.SingleTenantHsmInstanceProposal.DeleteSingleTenantHsmInstance + (*SingleTenantHsmInstanceProposal_AddQuorumMember)(nil), // 29: google.cloud.kms.v1.SingleTenantHsmInstanceProposal.AddQuorumMember + (*SingleTenantHsmInstanceProposal_RemoveQuorumMember)(nil), // 30: google.cloud.kms.v1.SingleTenantHsmInstanceProposal.RemoveQuorumMember + (*SingleTenantHsmInstanceProposal_RefreshSingleTenantHsmInstance)(nil), // 31: google.cloud.kms.v1.SingleTenantHsmInstanceProposal.RefreshSingleTenantHsmInstance + (*ApproveSingleTenantHsmInstanceProposalRequest_QuorumReply)(nil), // 32: google.cloud.kms.v1.ApproveSingleTenantHsmInstanceProposalRequest.QuorumReply + (*ApproveSingleTenantHsmInstanceProposalRequest_RequiredActionQuorumReply)(nil), // 33: google.cloud.kms.v1.ApproveSingleTenantHsmInstanceProposalRequest.RequiredActionQuorumReply + (*timestamppb.Timestamp)(nil), // 34: google.protobuf.Timestamp + (*durationpb.Duration)(nil), // 35: google.protobuf.Duration + (*longrunningpb.Operation)(nil), // 36: google.longrunning.Operation + (*emptypb.Empty)(nil), // 37: google.protobuf.Empty +} +var file_google_cloud_kms_v1_hsm_management_proto_depIdxs = []int32{ + 34, // 0: google.cloud.kms.v1.SingleTenantHsmInstance.create_time:type_name -> google.protobuf.Timestamp + 0, // 1: google.cloud.kms.v1.SingleTenantHsmInstance.state:type_name -> google.cloud.kms.v1.SingleTenantHsmInstance.State + 22, // 2: google.cloud.kms.v1.SingleTenantHsmInstance.quorum_auth:type_name -> google.cloud.kms.v1.SingleTenantHsmInstance.QuorumAuth + 34, // 3: google.cloud.kms.v1.SingleTenantHsmInstance.delete_time:type_name -> google.protobuf.Timestamp + 35, // 4: google.cloud.kms.v1.SingleTenantHsmInstance.unrefreshed_duration_until_disable:type_name -> google.protobuf.Duration + 34, // 5: google.cloud.kms.v1.SingleTenantHsmInstance.disable_time:type_name -> google.protobuf.Timestamp + 34, // 6: google.cloud.kms.v1.SingleTenantHsmInstanceProposal.create_time:type_name -> google.protobuf.Timestamp + 1, // 7: google.cloud.kms.v1.SingleTenantHsmInstanceProposal.state:type_name -> google.cloud.kms.v1.SingleTenantHsmInstanceProposal.State + 23, // 8: google.cloud.kms.v1.SingleTenantHsmInstanceProposal.quorum_parameters:type_name -> google.cloud.kms.v1.SingleTenantHsmInstanceProposal.QuorumParameters + 24, // 9: google.cloud.kms.v1.SingleTenantHsmInstanceProposal.required_action_quorum_parameters:type_name -> google.cloud.kms.v1.SingleTenantHsmInstanceProposal.RequiredActionQuorumParameters + 34, // 10: google.cloud.kms.v1.SingleTenantHsmInstanceProposal.expire_time:type_name -> google.protobuf.Timestamp + 35, // 11: google.cloud.kms.v1.SingleTenantHsmInstanceProposal.ttl:type_name -> google.protobuf.Duration + 34, // 12: google.cloud.kms.v1.SingleTenantHsmInstanceProposal.delete_time:type_name -> google.protobuf.Timestamp + 34, // 13: google.cloud.kms.v1.SingleTenantHsmInstanceProposal.purge_time:type_name -> google.protobuf.Timestamp + 25, // 14: google.cloud.kms.v1.SingleTenantHsmInstanceProposal.register_two_factor_auth_keys:type_name -> google.cloud.kms.v1.SingleTenantHsmInstanceProposal.RegisterTwoFactorAuthKeys + 26, // 15: google.cloud.kms.v1.SingleTenantHsmInstanceProposal.disable_single_tenant_hsm_instance:type_name -> google.cloud.kms.v1.SingleTenantHsmInstanceProposal.DisableSingleTenantHsmInstance + 27, // 16: google.cloud.kms.v1.SingleTenantHsmInstanceProposal.enable_single_tenant_hsm_instance:type_name -> google.cloud.kms.v1.SingleTenantHsmInstanceProposal.EnableSingleTenantHsmInstance + 28, // 17: google.cloud.kms.v1.SingleTenantHsmInstanceProposal.delete_single_tenant_hsm_instance:type_name -> google.cloud.kms.v1.SingleTenantHsmInstanceProposal.DeleteSingleTenantHsmInstance + 29, // 18: google.cloud.kms.v1.SingleTenantHsmInstanceProposal.add_quorum_member:type_name -> google.cloud.kms.v1.SingleTenantHsmInstanceProposal.AddQuorumMember + 30, // 19: google.cloud.kms.v1.SingleTenantHsmInstanceProposal.remove_quorum_member:type_name -> google.cloud.kms.v1.SingleTenantHsmInstanceProposal.RemoveQuorumMember + 31, // 20: google.cloud.kms.v1.SingleTenantHsmInstanceProposal.refresh_single_tenant_hsm_instance:type_name -> google.cloud.kms.v1.SingleTenantHsmInstanceProposal.RefreshSingleTenantHsmInstance + 2, // 21: google.cloud.kms.v1.ListSingleTenantHsmInstancesResponse.single_tenant_hsm_instances:type_name -> google.cloud.kms.v1.SingleTenantHsmInstance + 2, // 22: google.cloud.kms.v1.CreateSingleTenantHsmInstanceRequest.single_tenant_hsm_instance:type_name -> google.cloud.kms.v1.SingleTenantHsmInstance + 3, // 23: google.cloud.kms.v1.CreateSingleTenantHsmInstanceProposalRequest.single_tenant_hsm_instance_proposal:type_name -> google.cloud.kms.v1.SingleTenantHsmInstanceProposal + 32, // 24: google.cloud.kms.v1.ApproveSingleTenantHsmInstanceProposalRequest.quorum_reply:type_name -> google.cloud.kms.v1.ApproveSingleTenantHsmInstanceProposalRequest.QuorumReply + 33, // 25: google.cloud.kms.v1.ApproveSingleTenantHsmInstanceProposalRequest.required_action_quorum_reply:type_name -> google.cloud.kms.v1.ApproveSingleTenantHsmInstanceProposalRequest.RequiredActionQuorumReply + 3, // 26: google.cloud.kms.v1.ListSingleTenantHsmInstanceProposalsResponse.single_tenant_hsm_instance_proposals:type_name -> google.cloud.kms.v1.SingleTenantHsmInstanceProposal + 4, // 27: google.cloud.kms.v1.SingleTenantHsmInstanceProposal.QuorumParameters.challenges:type_name -> google.cloud.kms.v1.Challenge + 4, // 28: google.cloud.kms.v1.SingleTenantHsmInstanceProposal.RequiredActionQuorumParameters.required_challenges:type_name -> google.cloud.kms.v1.Challenge + 4, // 29: google.cloud.kms.v1.SingleTenantHsmInstanceProposal.RequiredActionQuorumParameters.quorum_challenges:type_name -> google.cloud.kms.v1.Challenge + 5, // 30: google.cloud.kms.v1.ApproveSingleTenantHsmInstanceProposalRequest.QuorumReply.challenge_replies:type_name -> google.cloud.kms.v1.ChallengeReply + 5, // 31: google.cloud.kms.v1.ApproveSingleTenantHsmInstanceProposalRequest.RequiredActionQuorumReply.required_challenge_replies:type_name -> google.cloud.kms.v1.ChallengeReply + 5, // 32: google.cloud.kms.v1.ApproveSingleTenantHsmInstanceProposalRequest.RequiredActionQuorumReply.quorum_challenge_replies:type_name -> google.cloud.kms.v1.ChallengeReply + 6, // 33: google.cloud.kms.v1.HsmManagement.ListSingleTenantHsmInstances:input_type -> google.cloud.kms.v1.ListSingleTenantHsmInstancesRequest + 8, // 34: google.cloud.kms.v1.HsmManagement.GetSingleTenantHsmInstance:input_type -> google.cloud.kms.v1.GetSingleTenantHsmInstanceRequest + 9, // 35: google.cloud.kms.v1.HsmManagement.CreateSingleTenantHsmInstance:input_type -> google.cloud.kms.v1.CreateSingleTenantHsmInstanceRequest + 11, // 36: google.cloud.kms.v1.HsmManagement.CreateSingleTenantHsmInstanceProposal:input_type -> google.cloud.kms.v1.CreateSingleTenantHsmInstanceProposalRequest + 14, // 37: google.cloud.kms.v1.HsmManagement.ApproveSingleTenantHsmInstanceProposal:input_type -> google.cloud.kms.v1.ApproveSingleTenantHsmInstanceProposalRequest + 16, // 38: google.cloud.kms.v1.HsmManagement.ExecuteSingleTenantHsmInstanceProposal:input_type -> google.cloud.kms.v1.ExecuteSingleTenantHsmInstanceProposalRequest + 13, // 39: google.cloud.kms.v1.HsmManagement.GetSingleTenantHsmInstanceProposal:input_type -> google.cloud.kms.v1.GetSingleTenantHsmInstanceProposalRequest + 19, // 40: google.cloud.kms.v1.HsmManagement.ListSingleTenantHsmInstanceProposals:input_type -> google.cloud.kms.v1.ListSingleTenantHsmInstanceProposalsRequest + 21, // 41: google.cloud.kms.v1.HsmManagement.DeleteSingleTenantHsmInstanceProposal:input_type -> google.cloud.kms.v1.DeleteSingleTenantHsmInstanceProposalRequest + 7, // 42: google.cloud.kms.v1.HsmManagement.ListSingleTenantHsmInstances:output_type -> google.cloud.kms.v1.ListSingleTenantHsmInstancesResponse + 2, // 43: google.cloud.kms.v1.HsmManagement.GetSingleTenantHsmInstance:output_type -> google.cloud.kms.v1.SingleTenantHsmInstance + 36, // 44: google.cloud.kms.v1.HsmManagement.CreateSingleTenantHsmInstance:output_type -> google.longrunning.Operation + 36, // 45: google.cloud.kms.v1.HsmManagement.CreateSingleTenantHsmInstanceProposal:output_type -> google.longrunning.Operation + 15, // 46: google.cloud.kms.v1.HsmManagement.ApproveSingleTenantHsmInstanceProposal:output_type -> google.cloud.kms.v1.ApproveSingleTenantHsmInstanceProposalResponse + 36, // 47: google.cloud.kms.v1.HsmManagement.ExecuteSingleTenantHsmInstanceProposal:output_type -> google.longrunning.Operation + 3, // 48: google.cloud.kms.v1.HsmManagement.GetSingleTenantHsmInstanceProposal:output_type -> google.cloud.kms.v1.SingleTenantHsmInstanceProposal + 20, // 49: google.cloud.kms.v1.HsmManagement.ListSingleTenantHsmInstanceProposals:output_type -> google.cloud.kms.v1.ListSingleTenantHsmInstanceProposalsResponse + 37, // 50: google.cloud.kms.v1.HsmManagement.DeleteSingleTenantHsmInstanceProposal:output_type -> google.protobuf.Empty + 42, // [42:51] is the sub-list for method output_type + 33, // [33:42] is the sub-list for method input_type + 33, // [33:33] is the sub-list for extension type_name + 33, // [33:33] is the sub-list for extension extendee + 0, // [0:33] is the sub-list for field type_name +} + +func init() { file_google_cloud_kms_v1_hsm_management_proto_init() } +func file_google_cloud_kms_v1_hsm_management_proto_init() { + if File_google_cloud_kms_v1_hsm_management_proto != nil { + return + } + file_google_cloud_kms_v1_hsm_management_proto_msgTypes[1].OneofWrappers = []any{ + (*SingleTenantHsmInstanceProposal_QuorumParameters_)(nil), + (*SingleTenantHsmInstanceProposal_RequiredActionQuorumParameters_)(nil), + (*SingleTenantHsmInstanceProposal_ExpireTime)(nil), + (*SingleTenantHsmInstanceProposal_Ttl)(nil), + (*SingleTenantHsmInstanceProposal_RegisterTwoFactorAuthKeys_)(nil), + (*SingleTenantHsmInstanceProposal_DisableSingleTenantHsmInstance_)(nil), + (*SingleTenantHsmInstanceProposal_EnableSingleTenantHsmInstance_)(nil), + (*SingleTenantHsmInstanceProposal_DeleteSingleTenantHsmInstance_)(nil), + (*SingleTenantHsmInstanceProposal_AddQuorumMember_)(nil), + (*SingleTenantHsmInstanceProposal_RemoveQuorumMember_)(nil), + (*SingleTenantHsmInstanceProposal_RefreshSingleTenantHsmInstance_)(nil), + } + file_google_cloud_kms_v1_hsm_management_proto_msgTypes[12].OneofWrappers = []any{ + (*ApproveSingleTenantHsmInstanceProposalRequest_QuorumReply_)(nil), + (*ApproveSingleTenantHsmInstanceProposalRequest_RequiredActionQuorumReply_)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_google_cloud_kms_v1_hsm_management_proto_rawDesc, + NumEnums: 2, + NumMessages: 32, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_google_cloud_kms_v1_hsm_management_proto_goTypes, + DependencyIndexes: file_google_cloud_kms_v1_hsm_management_proto_depIdxs, + EnumInfos: file_google_cloud_kms_v1_hsm_management_proto_enumTypes, + MessageInfos: file_google_cloud_kms_v1_hsm_management_proto_msgTypes, + }.Build() + File_google_cloud_kms_v1_hsm_management_proto = out.File + file_google_cloud_kms_v1_hsm_management_proto_rawDesc = nil + file_google_cloud_kms_v1_hsm_management_proto_goTypes = nil + file_google_cloud_kms_v1_hsm_management_proto_depIdxs = nil +} diff --git a/vendor/cloud.google.com/go/kms/apiv1/kmspb/hsm_management_grpc.pb.go b/vendor/cloud.google.com/go/kms/apiv1/kmspb/hsm_management_grpc.pb.go new file mode 100644 index 00000000000..aff6657c954 --- /dev/null +++ b/vendor/cloud.google.com/go/kms/apiv1/kmspb/hsm_management_grpc.pb.go @@ -0,0 +1,486 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.7 +// source: google/cloud/kms/v1/hsm_management.proto + +package kmspb + +import ( + context "context" + + longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + HsmManagement_ListSingleTenantHsmInstances_FullMethodName = "/google.cloud.kms.v1.HsmManagement/ListSingleTenantHsmInstances" + HsmManagement_GetSingleTenantHsmInstance_FullMethodName = "/google.cloud.kms.v1.HsmManagement/GetSingleTenantHsmInstance" + HsmManagement_CreateSingleTenantHsmInstance_FullMethodName = "/google.cloud.kms.v1.HsmManagement/CreateSingleTenantHsmInstance" + HsmManagement_CreateSingleTenantHsmInstanceProposal_FullMethodName = "/google.cloud.kms.v1.HsmManagement/CreateSingleTenantHsmInstanceProposal" + HsmManagement_ApproveSingleTenantHsmInstanceProposal_FullMethodName = "/google.cloud.kms.v1.HsmManagement/ApproveSingleTenantHsmInstanceProposal" + HsmManagement_ExecuteSingleTenantHsmInstanceProposal_FullMethodName = "/google.cloud.kms.v1.HsmManagement/ExecuteSingleTenantHsmInstanceProposal" + HsmManagement_GetSingleTenantHsmInstanceProposal_FullMethodName = "/google.cloud.kms.v1.HsmManagement/GetSingleTenantHsmInstanceProposal" + HsmManagement_ListSingleTenantHsmInstanceProposals_FullMethodName = "/google.cloud.kms.v1.HsmManagement/ListSingleTenantHsmInstanceProposals" + HsmManagement_DeleteSingleTenantHsmInstanceProposal_FullMethodName = "/google.cloud.kms.v1.HsmManagement/DeleteSingleTenantHsmInstanceProposal" +) + +// HsmManagementClient is the client API for HsmManagement service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type HsmManagementClient interface { + // Lists + // [SingleTenantHsmInstances][google.cloud.kms.v1.SingleTenantHsmInstance]. + ListSingleTenantHsmInstances(ctx context.Context, in *ListSingleTenantHsmInstancesRequest, opts ...grpc.CallOption) (*ListSingleTenantHsmInstancesResponse, error) + // Returns metadata for a given + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance]. + GetSingleTenantHsmInstance(ctx context.Context, in *GetSingleTenantHsmInstanceRequest, opts ...grpc.CallOption) (*SingleTenantHsmInstance, error) + // Creates a new + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] in a + // given Project and Location. User must create a RegisterTwoFactorAuthKeys + // proposal with this single-tenant HSM instance to finish setup of the + // instance. + CreateSingleTenantHsmInstance(ctx context.Context, in *CreateSingleTenantHsmInstanceRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) + // Creates a new + // [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] + // for a given + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance]. + CreateSingleTenantHsmInstanceProposal(ctx context.Context, in *CreateSingleTenantHsmInstanceProposalRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) + // Approves a + // [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] + // for a given + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance]. The + // proposal must be in the + // [PENDING][google.cloud.kms.v1.SingleTenantHsmInstanceProposal.State.PENDING] + // state. + ApproveSingleTenantHsmInstanceProposal(ctx context.Context, in *ApproveSingleTenantHsmInstanceProposalRequest, opts ...grpc.CallOption) (*ApproveSingleTenantHsmInstanceProposalResponse, error) + // Executes a + // [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] + // for a given + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance]. The + // proposal must be in the + // [APPROVED][google.cloud.kms.v1.SingleTenantHsmInstanceProposal.State.APPROVED] + // state. + ExecuteSingleTenantHsmInstanceProposal(ctx context.Context, in *ExecuteSingleTenantHsmInstanceProposalRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) + // Returns metadata for a given + // [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal]. + GetSingleTenantHsmInstanceProposal(ctx context.Context, in *GetSingleTenantHsmInstanceProposalRequest, opts ...grpc.CallOption) (*SingleTenantHsmInstanceProposal, error) + // Lists + // [SingleTenantHsmInstanceProposals][google.cloud.kms.v1.SingleTenantHsmInstanceProposal]. + ListSingleTenantHsmInstanceProposals(ctx context.Context, in *ListSingleTenantHsmInstanceProposalsRequest, opts ...grpc.CallOption) (*ListSingleTenantHsmInstanceProposalsResponse, error) + // Deletes a + // [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal]. + DeleteSingleTenantHsmInstanceProposal(ctx context.Context, in *DeleteSingleTenantHsmInstanceProposalRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type hsmManagementClient struct { + cc grpc.ClientConnInterface +} + +func NewHsmManagementClient(cc grpc.ClientConnInterface) HsmManagementClient { + return &hsmManagementClient{cc} +} + +func (c *hsmManagementClient) ListSingleTenantHsmInstances(ctx context.Context, in *ListSingleTenantHsmInstancesRequest, opts ...grpc.CallOption) (*ListSingleTenantHsmInstancesResponse, error) { + out := new(ListSingleTenantHsmInstancesResponse) + err := c.cc.Invoke(ctx, HsmManagement_ListSingleTenantHsmInstances_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *hsmManagementClient) GetSingleTenantHsmInstance(ctx context.Context, in *GetSingleTenantHsmInstanceRequest, opts ...grpc.CallOption) (*SingleTenantHsmInstance, error) { + out := new(SingleTenantHsmInstance) + err := c.cc.Invoke(ctx, HsmManagement_GetSingleTenantHsmInstance_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *hsmManagementClient) CreateSingleTenantHsmInstance(ctx context.Context, in *CreateSingleTenantHsmInstanceRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) { + out := new(longrunningpb.Operation) + err := c.cc.Invoke(ctx, HsmManagement_CreateSingleTenantHsmInstance_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *hsmManagementClient) CreateSingleTenantHsmInstanceProposal(ctx context.Context, in *CreateSingleTenantHsmInstanceProposalRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) { + out := new(longrunningpb.Operation) + err := c.cc.Invoke(ctx, HsmManagement_CreateSingleTenantHsmInstanceProposal_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *hsmManagementClient) ApproveSingleTenantHsmInstanceProposal(ctx context.Context, in *ApproveSingleTenantHsmInstanceProposalRequest, opts ...grpc.CallOption) (*ApproveSingleTenantHsmInstanceProposalResponse, error) { + out := new(ApproveSingleTenantHsmInstanceProposalResponse) + err := c.cc.Invoke(ctx, HsmManagement_ApproveSingleTenantHsmInstanceProposal_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *hsmManagementClient) ExecuteSingleTenantHsmInstanceProposal(ctx context.Context, in *ExecuteSingleTenantHsmInstanceProposalRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) { + out := new(longrunningpb.Operation) + err := c.cc.Invoke(ctx, HsmManagement_ExecuteSingleTenantHsmInstanceProposal_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *hsmManagementClient) GetSingleTenantHsmInstanceProposal(ctx context.Context, in *GetSingleTenantHsmInstanceProposalRequest, opts ...grpc.CallOption) (*SingleTenantHsmInstanceProposal, error) { + out := new(SingleTenantHsmInstanceProposal) + err := c.cc.Invoke(ctx, HsmManagement_GetSingleTenantHsmInstanceProposal_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *hsmManagementClient) ListSingleTenantHsmInstanceProposals(ctx context.Context, in *ListSingleTenantHsmInstanceProposalsRequest, opts ...grpc.CallOption) (*ListSingleTenantHsmInstanceProposalsResponse, error) { + out := new(ListSingleTenantHsmInstanceProposalsResponse) + err := c.cc.Invoke(ctx, HsmManagement_ListSingleTenantHsmInstanceProposals_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *hsmManagementClient) DeleteSingleTenantHsmInstanceProposal(ctx context.Context, in *DeleteSingleTenantHsmInstanceProposalRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, HsmManagement_DeleteSingleTenantHsmInstanceProposal_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// HsmManagementServer is the server API for HsmManagement service. +// All implementations should embed UnimplementedHsmManagementServer +// for forward compatibility +type HsmManagementServer interface { + // Lists + // [SingleTenantHsmInstances][google.cloud.kms.v1.SingleTenantHsmInstance]. + ListSingleTenantHsmInstances(context.Context, *ListSingleTenantHsmInstancesRequest) (*ListSingleTenantHsmInstancesResponse, error) + // Returns metadata for a given + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance]. + GetSingleTenantHsmInstance(context.Context, *GetSingleTenantHsmInstanceRequest) (*SingleTenantHsmInstance, error) + // Creates a new + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance] in a + // given Project and Location. User must create a RegisterTwoFactorAuthKeys + // proposal with this single-tenant HSM instance to finish setup of the + // instance. + CreateSingleTenantHsmInstance(context.Context, *CreateSingleTenantHsmInstanceRequest) (*longrunningpb.Operation, error) + // Creates a new + // [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] + // for a given + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance]. + CreateSingleTenantHsmInstanceProposal(context.Context, *CreateSingleTenantHsmInstanceProposalRequest) (*longrunningpb.Operation, error) + // Approves a + // [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] + // for a given + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance]. The + // proposal must be in the + // [PENDING][google.cloud.kms.v1.SingleTenantHsmInstanceProposal.State.PENDING] + // state. + ApproveSingleTenantHsmInstanceProposal(context.Context, *ApproveSingleTenantHsmInstanceProposalRequest) (*ApproveSingleTenantHsmInstanceProposalResponse, error) + // Executes a + // [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal] + // for a given + // [SingleTenantHsmInstance][google.cloud.kms.v1.SingleTenantHsmInstance]. The + // proposal must be in the + // [APPROVED][google.cloud.kms.v1.SingleTenantHsmInstanceProposal.State.APPROVED] + // state. + ExecuteSingleTenantHsmInstanceProposal(context.Context, *ExecuteSingleTenantHsmInstanceProposalRequest) (*longrunningpb.Operation, error) + // Returns metadata for a given + // [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal]. + GetSingleTenantHsmInstanceProposal(context.Context, *GetSingleTenantHsmInstanceProposalRequest) (*SingleTenantHsmInstanceProposal, error) + // Lists + // [SingleTenantHsmInstanceProposals][google.cloud.kms.v1.SingleTenantHsmInstanceProposal]. + ListSingleTenantHsmInstanceProposals(context.Context, *ListSingleTenantHsmInstanceProposalsRequest) (*ListSingleTenantHsmInstanceProposalsResponse, error) + // Deletes a + // [SingleTenantHsmInstanceProposal][google.cloud.kms.v1.SingleTenantHsmInstanceProposal]. + DeleteSingleTenantHsmInstanceProposal(context.Context, *DeleteSingleTenantHsmInstanceProposalRequest) (*emptypb.Empty, error) +} + +// UnimplementedHsmManagementServer should be embedded to have forward compatible implementations. +type UnimplementedHsmManagementServer struct { +} + +func (UnimplementedHsmManagementServer) ListSingleTenantHsmInstances(context.Context, *ListSingleTenantHsmInstancesRequest) (*ListSingleTenantHsmInstancesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListSingleTenantHsmInstances not implemented") +} +func (UnimplementedHsmManagementServer) GetSingleTenantHsmInstance(context.Context, *GetSingleTenantHsmInstanceRequest) (*SingleTenantHsmInstance, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetSingleTenantHsmInstance not implemented") +} +func (UnimplementedHsmManagementServer) CreateSingleTenantHsmInstance(context.Context, *CreateSingleTenantHsmInstanceRequest) (*longrunningpb.Operation, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateSingleTenantHsmInstance not implemented") +} +func (UnimplementedHsmManagementServer) CreateSingleTenantHsmInstanceProposal(context.Context, *CreateSingleTenantHsmInstanceProposalRequest) (*longrunningpb.Operation, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateSingleTenantHsmInstanceProposal not implemented") +} +func (UnimplementedHsmManagementServer) ApproveSingleTenantHsmInstanceProposal(context.Context, *ApproveSingleTenantHsmInstanceProposalRequest) (*ApproveSingleTenantHsmInstanceProposalResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ApproveSingleTenantHsmInstanceProposal not implemented") +} +func (UnimplementedHsmManagementServer) ExecuteSingleTenantHsmInstanceProposal(context.Context, *ExecuteSingleTenantHsmInstanceProposalRequest) (*longrunningpb.Operation, error) { + return nil, status.Errorf(codes.Unimplemented, "method ExecuteSingleTenantHsmInstanceProposal not implemented") +} +func (UnimplementedHsmManagementServer) GetSingleTenantHsmInstanceProposal(context.Context, *GetSingleTenantHsmInstanceProposalRequest) (*SingleTenantHsmInstanceProposal, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetSingleTenantHsmInstanceProposal not implemented") +} +func (UnimplementedHsmManagementServer) ListSingleTenantHsmInstanceProposals(context.Context, *ListSingleTenantHsmInstanceProposalsRequest) (*ListSingleTenantHsmInstanceProposalsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListSingleTenantHsmInstanceProposals not implemented") +} +func (UnimplementedHsmManagementServer) DeleteSingleTenantHsmInstanceProposal(context.Context, *DeleteSingleTenantHsmInstanceProposalRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteSingleTenantHsmInstanceProposal not implemented") +} + +// UnsafeHsmManagementServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to HsmManagementServer will +// result in compilation errors. +type UnsafeHsmManagementServer interface { + mustEmbedUnimplementedHsmManagementServer() +} + +func RegisterHsmManagementServer(s grpc.ServiceRegistrar, srv HsmManagementServer) { + s.RegisterService(&HsmManagement_ServiceDesc, srv) +} + +func _HsmManagement_ListSingleTenantHsmInstances_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListSingleTenantHsmInstancesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HsmManagementServer).ListSingleTenantHsmInstances(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: HsmManagement_ListSingleTenantHsmInstances_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HsmManagementServer).ListSingleTenantHsmInstances(ctx, req.(*ListSingleTenantHsmInstancesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _HsmManagement_GetSingleTenantHsmInstance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetSingleTenantHsmInstanceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HsmManagementServer).GetSingleTenantHsmInstance(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: HsmManagement_GetSingleTenantHsmInstance_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HsmManagementServer).GetSingleTenantHsmInstance(ctx, req.(*GetSingleTenantHsmInstanceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _HsmManagement_CreateSingleTenantHsmInstance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateSingleTenantHsmInstanceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HsmManagementServer).CreateSingleTenantHsmInstance(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: HsmManagement_CreateSingleTenantHsmInstance_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HsmManagementServer).CreateSingleTenantHsmInstance(ctx, req.(*CreateSingleTenantHsmInstanceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _HsmManagement_CreateSingleTenantHsmInstanceProposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateSingleTenantHsmInstanceProposalRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HsmManagementServer).CreateSingleTenantHsmInstanceProposal(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: HsmManagement_CreateSingleTenantHsmInstanceProposal_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HsmManagementServer).CreateSingleTenantHsmInstanceProposal(ctx, req.(*CreateSingleTenantHsmInstanceProposalRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _HsmManagement_ApproveSingleTenantHsmInstanceProposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ApproveSingleTenantHsmInstanceProposalRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HsmManagementServer).ApproveSingleTenantHsmInstanceProposal(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: HsmManagement_ApproveSingleTenantHsmInstanceProposal_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HsmManagementServer).ApproveSingleTenantHsmInstanceProposal(ctx, req.(*ApproveSingleTenantHsmInstanceProposalRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _HsmManagement_ExecuteSingleTenantHsmInstanceProposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ExecuteSingleTenantHsmInstanceProposalRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HsmManagementServer).ExecuteSingleTenantHsmInstanceProposal(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: HsmManagement_ExecuteSingleTenantHsmInstanceProposal_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HsmManagementServer).ExecuteSingleTenantHsmInstanceProposal(ctx, req.(*ExecuteSingleTenantHsmInstanceProposalRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _HsmManagement_GetSingleTenantHsmInstanceProposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetSingleTenantHsmInstanceProposalRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HsmManagementServer).GetSingleTenantHsmInstanceProposal(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: HsmManagement_GetSingleTenantHsmInstanceProposal_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HsmManagementServer).GetSingleTenantHsmInstanceProposal(ctx, req.(*GetSingleTenantHsmInstanceProposalRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _HsmManagement_ListSingleTenantHsmInstanceProposals_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListSingleTenantHsmInstanceProposalsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HsmManagementServer).ListSingleTenantHsmInstanceProposals(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: HsmManagement_ListSingleTenantHsmInstanceProposals_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HsmManagementServer).ListSingleTenantHsmInstanceProposals(ctx, req.(*ListSingleTenantHsmInstanceProposalsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _HsmManagement_DeleteSingleTenantHsmInstanceProposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteSingleTenantHsmInstanceProposalRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HsmManagementServer).DeleteSingleTenantHsmInstanceProposal(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: HsmManagement_DeleteSingleTenantHsmInstanceProposal_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HsmManagementServer).DeleteSingleTenantHsmInstanceProposal(ctx, req.(*DeleteSingleTenantHsmInstanceProposalRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// HsmManagement_ServiceDesc is the grpc.ServiceDesc for HsmManagement service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var HsmManagement_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "google.cloud.kms.v1.HsmManagement", + HandlerType: (*HsmManagementServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListSingleTenantHsmInstances", + Handler: _HsmManagement_ListSingleTenantHsmInstances_Handler, + }, + { + MethodName: "GetSingleTenantHsmInstance", + Handler: _HsmManagement_GetSingleTenantHsmInstance_Handler, + }, + { + MethodName: "CreateSingleTenantHsmInstance", + Handler: _HsmManagement_CreateSingleTenantHsmInstance_Handler, + }, + { + MethodName: "CreateSingleTenantHsmInstanceProposal", + Handler: _HsmManagement_CreateSingleTenantHsmInstanceProposal_Handler, + }, + { + MethodName: "ApproveSingleTenantHsmInstanceProposal", + Handler: _HsmManagement_ApproveSingleTenantHsmInstanceProposal_Handler, + }, + { + MethodName: "ExecuteSingleTenantHsmInstanceProposal", + Handler: _HsmManagement_ExecuteSingleTenantHsmInstanceProposal_Handler, + }, + { + MethodName: "GetSingleTenantHsmInstanceProposal", + Handler: _HsmManagement_GetSingleTenantHsmInstanceProposal_Handler, + }, + { + MethodName: "ListSingleTenantHsmInstanceProposals", + Handler: _HsmManagement_ListSingleTenantHsmInstanceProposals_Handler, + }, + { + MethodName: "DeleteSingleTenantHsmInstanceProposal", + Handler: _HsmManagement_DeleteSingleTenantHsmInstanceProposal_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/cloud/kms/v1/hsm_management.proto", +} diff --git a/vendor/cloud.google.com/go/kms/apiv1/kmspb/resources.pb.go b/vendor/cloud.google.com/go/kms/apiv1/kmspb/resources.pb.go index 4ba8029e406..3914d208ec3 100644 --- a/vendor/cloud.google.com/go/kms/apiv1/kmspb/resources.pb.go +++ b/vendor/cloud.google.com/go/kms/apiv1/kmspb/resources.pb.go @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,14 +21,15 @@ package kmspb import ( + reflect "reflect" + sync "sync" + _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" durationpb "google.golang.org/protobuf/types/known/durationpb" timestamppb "google.golang.org/protobuf/types/known/timestamppb" wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" - reflect "reflect" - sync "sync" ) const ( @@ -54,6 +55,8 @@ const ( ProtectionLevel_EXTERNAL ProtectionLevel = 3 // Crypto operations are performed in an EKM-over-VPC backend. ProtectionLevel_EXTERNAL_VPC ProtectionLevel = 4 + // Crypto operations are performed in a single-tenant HSM. + ProtectionLevel_HSM_SINGLE_TENANT ProtectionLevel = 5 ) // Enum value maps for ProtectionLevel. @@ -64,6 +67,7 @@ var ( 2: "HSM", 3: "EXTERNAL", 4: "EXTERNAL_VPC", + 5: "HSM_SINGLE_TENANT", } ProtectionLevel_value = map[string]int32{ "PROTECTION_LEVEL_UNSPECIFIED": 0, @@ -71,6 +75,7 @@ var ( "HSM": 2, "EXTERNAL": 3, "EXTERNAL_VPC": 4, + "HSM_SINGLE_TENANT": 5, } ) @@ -125,6 +130,12 @@ const ( AccessReason_GOOGLE_INITIATED_SYSTEM_OPERATION AccessReason = 6 // No reason is expected for this key request. AccessReason_REASON_NOT_EXPECTED AccessReason = 7 + // Deprecated: This code is no longer generated by + // Google Cloud. The GOOGLE_RESPONSE_TO_PRODUCTION_ALERT justification codes + // available in both Key Access Justifications and Access Transparency logs + // provide customer-visible signals of emergency access in more precise + // contexts. + // // Customer uses their account to perform any access to their own data which // their IAM policy authorizes, and one of the following is true: // @@ -133,7 +144,15 @@ const ( // - A Google-initiated emergency access operation has interacted with a // resource in the same project or folder as the currently accessed resource // within the past 7 days. + // + // Deprecated: Marked as deprecated in google/cloud/kms/v1/resources.proto. AccessReason_MODIFIED_CUSTOMER_INITIATED_ACCESS AccessReason = 8 + // Deprecated: This code is no longer generated by + // Google Cloud. The GOOGLE_RESPONSE_TO_PRODUCTION_ALERT justification codes + // available in both Key Access Justifications and Access Transparency logs + // provide customer-visible signals of emergency access in more precise + // contexts. + // // Google systems access customer data to help optimize the structure of the // data or quality for future uses by the customer, and one of the following // is true: @@ -143,6 +162,8 @@ const ( // - A Google-initiated emergency access operation has interacted with a // resource in the same project or folder as the currently accessed resource // within the past 7 days. + // + // Deprecated: Marked as deprecated in google/cloud/kms/v1/resources.proto. AccessReason_MODIFIED_GOOGLE_INITIATED_SYSTEM_OPERATION AccessReason = 9 // Google-initiated access to maintain system reliability. AccessReason_GOOGLE_RESPONSE_TO_PRODUCTION_ALERT AccessReason = 10 @@ -253,17 +274,23 @@ const ( // [CryptoKeys][google.cloud.kms.v1.CryptoKey] with this purpose may be used // with [MacSign][google.cloud.kms.v1.KeyManagementService.MacSign]. CryptoKey_MAC CryptoKey_CryptoKeyPurpose = 9 + // [CryptoKeys][google.cloud.kms.v1.CryptoKey] with this purpose may be used + // with + // [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] + // and [Decapsulate][google.cloud.kms.v1.KeyManagementService.Decapsulate]. + CryptoKey_KEY_ENCAPSULATION CryptoKey_CryptoKeyPurpose = 10 ) // Enum value maps for CryptoKey_CryptoKeyPurpose. var ( CryptoKey_CryptoKeyPurpose_name = map[int32]string{ - 0: "CRYPTO_KEY_PURPOSE_UNSPECIFIED", - 1: "ENCRYPT_DECRYPT", - 5: "ASYMMETRIC_SIGN", - 6: "ASYMMETRIC_DECRYPT", - 7: "RAW_ENCRYPT_DECRYPT", - 9: "MAC", + 0: "CRYPTO_KEY_PURPOSE_UNSPECIFIED", + 1: "ENCRYPT_DECRYPT", + 5: "ASYMMETRIC_SIGN", + 6: "ASYMMETRIC_DECRYPT", + 7: "RAW_ENCRYPT_DECRYPT", + 9: "MAC", + 10: "KEY_ENCAPSULATION", } CryptoKey_CryptoKeyPurpose_value = map[string]int32{ "CRYPTO_KEY_PURPOSE_UNSPECIFIED": 0, @@ -272,6 +299,7 @@ var ( "ASYMMETRIC_DECRYPT": 6, "RAW_ENCRYPT_DECRYPT": 7, "MAC": 9, + "KEY_ENCAPSULATION": 10, } ) @@ -489,6 +517,13 @@ const ( CryptoKeyVersion_HMAC_SHA224 CryptoKeyVersion_CryptoKeyVersionAlgorithm = 36 // Algorithm representing symmetric encryption by an external key manager. CryptoKeyVersion_EXTERNAL_SYMMETRIC_ENCRYPTION CryptoKeyVersion_CryptoKeyVersionAlgorithm = 18 + // ML-KEM-768 (FIPS 203) + CryptoKeyVersion_ML_KEM_768 CryptoKeyVersion_CryptoKeyVersionAlgorithm = 47 + // ML-KEM-1024 (FIPS 203) + CryptoKeyVersion_ML_KEM_1024 CryptoKeyVersion_CryptoKeyVersionAlgorithm = 48 + // X-Wing hybrid KEM combining ML-KEM-768 with X25519 following + // datatracker.ietf.org/doc/draft-connolly-cfrg-xwing-kem/. + CryptoKeyVersion_KEM_XWING CryptoKeyVersion_CryptoKeyVersionAlgorithm = 63 // The post-quantum Module-Lattice-Based Digital Signature Algorithm, at // security level 3. Randomized version. CryptoKeyVersion_PQ_SIGN_ML_DSA_65 CryptoKeyVersion_CryptoKeyVersionAlgorithm = 56 @@ -536,6 +571,9 @@ var ( 35: "HMAC_SHA512", 36: "HMAC_SHA224", 18: "EXTERNAL_SYMMETRIC_ENCRYPTION", + 47: "ML_KEM_768", + 48: "ML_KEM_1024", + 63: "KEM_XWING", 56: "PQ_SIGN_ML_DSA_65", 57: "PQ_SIGN_SLH_DSA_SHA2_128S", } @@ -576,6 +614,9 @@ var ( "HMAC_SHA512": 35, "HMAC_SHA224": 36, "EXTERNAL_SYMMETRIC_ENCRYPTION": 18, + "ML_KEM_768": 47, + "ML_KEM_1024": 48, + "KEM_XWING": 63, "PQ_SIGN_ML_DSA_65": 56, "PQ_SIGN_SLH_DSA_SHA2_128S": 57, } @@ -807,10 +848,16 @@ const ( // and [Textual Encoding of Subject Public Key Info] // (https://tools.ietf.org/html/rfc7468#section-13) for more information. PublicKey_PEM PublicKey_PublicKeyFormat = 1 + // The returned public key will be encoded in DER format (the + // PrivateKeyInfo structure from RFC 5208). + PublicKey_DER PublicKey_PublicKeyFormat = 2 // This is supported only for PQC algorithms. // The key material is returned in the format defined by NIST PQC // standards (FIPS 203, FIPS 204, and FIPS 205). PublicKey_NIST_PQC PublicKey_PublicKeyFormat = 3 + // The returned public key is in raw bytes format defined in its standard + // https://datatracker.ietf.org/doc/draft-connolly-cfrg-xwing-kem. + PublicKey_XWING_RAW_BYTES PublicKey_PublicKeyFormat = 4 ) // Enum value maps for PublicKey_PublicKeyFormat. @@ -818,12 +865,16 @@ var ( PublicKey_PublicKeyFormat_name = map[int32]string{ 0: "PUBLIC_KEY_FORMAT_UNSPECIFIED", 1: "PEM", + 2: "DER", 3: "NIST_PQC", + 4: "XWING_RAW_BYTES", } PublicKey_PublicKeyFormat_value = map[string]int32{ "PUBLIC_KEY_FORMAT_UNSPECIFIED": 0, "PEM": 1, + "DER": 2, "NIST_PQC": 3, + "XWING_RAW_BYTES": 4, } ) @@ -1159,7 +1210,12 @@ type CryptoKey struct { // if [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] have a // [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of // [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC], with the - // resource name in the format `projects/*/locations/*/ekmConnections/*`. + // resource name in the format `projects/*/locations/*/ekmConnections/*`. Only + // applicable if [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] + // have a [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of + // [HSM_SINGLE_TENANT][google.cloud.kms.v1.ProtectionLevel.HSM_SINGLE_TENANT], + // with the resource name in the format + // `projects/*/locations/*/singleTenantHsmInstances/*`. // Note, this list is non-exhaustive and may apply to additional // [ProtectionLevels][google.cloud.kms.v1.ProtectionLevel] in the future. CryptoKeyBackend string `protobuf:"bytes,15,opt,name=crypto_key_backend,json=cryptoKeyBackend,proto3" json:"crypto_key_backend,omitempty"` @@ -1972,6 +2028,15 @@ type ImportJob struct { // [ImportMethod][google.cloud.kms.v1.ImportJob.ImportMethod] is one with a // protection level of [HSM][google.cloud.kms.v1.ProtectionLevel.HSM]. Attestation *KeyOperationAttestation `protobuf:"bytes,8,opt,name=attestation,proto3" json:"attestation,omitempty"` + // Immutable. The resource name of the backend environment where the key + // material for the wrapping key resides and where all related cryptographic + // operations are performed. Currently, this field is only populated for keys + // stored in HSM_SINGLE_TENANT. Note, this list is non-exhaustive and may + // apply to additional [ProtectionLevels][google.cloud.kms.v1.ProtectionLevel] + // in the future. + // Supported resources: + // * `"projects/*/locations/*/singleTenantHsmInstances/*"` + CryptoKeyBackend string `protobuf:"bytes,11,opt,name=crypto_key_backend,json=cryptoKeyBackend,proto3" json:"crypto_key_backend,omitempty"` } func (x *ImportJob) Reset() { @@ -2074,6 +2139,13 @@ func (x *ImportJob) GetAttestation() *KeyOperationAttestation { return nil } +func (x *ImportJob) GetCryptoKeyBackend() string { + if x != nil { + return x.CryptoKeyBackend + } + return "" +} + // ExternalProtectionLevelOptions stores a group of additional fields for // configuring a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] that // are specific to the [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL] @@ -2343,7 +2415,7 @@ var file_google_cloud_kms_v1_resources_proto_rawDesc = []byte{ 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x7b, 0x6b, 0x65, 0x79, 0x5f, 0x72, 0x69, 0x6e, 0x67, - 0x7d, 0x22, 0xd4, 0x09, 0x0a, 0x09, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x12, + 0x7d, 0x22, 0xeb, 0x09, 0x0a, 0x09, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x44, 0x0a, 0x07, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, @@ -2401,7 +2473,7 @@ var file_google_cloud_kms_v1_resources_proto_rawDesc = []byte{ 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x9a, 0x01, 0x0a, 0x10, 0x43, 0x72, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xb1, 0x01, 0x0a, 0x10, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x50, 0x75, 0x72, 0x70, 0x6f, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x1e, 0x43, 0x52, 0x59, 0x50, 0x54, 0x4f, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x50, 0x55, 0x52, 0x50, 0x4f, 0x53, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, @@ -2411,420 +2483,432 @@ var file_google_cloud_kms_v1_resources_proto_rawDesc = []byte{ 0x41, 0x53, 0x59, 0x4d, 0x4d, 0x45, 0x54, 0x52, 0x49, 0x43, 0x5f, 0x44, 0x45, 0x43, 0x52, 0x59, 0x50, 0x54, 0x10, 0x06, 0x12, 0x17, 0x0a, 0x13, 0x52, 0x41, 0x57, 0x5f, 0x45, 0x4e, 0x43, 0x52, 0x59, 0x50, 0x54, 0x5f, 0x44, 0x45, 0x43, 0x52, 0x59, 0x50, 0x54, 0x10, 0x07, 0x12, 0x07, 0x0a, - 0x03, 0x4d, 0x41, 0x43, 0x10, 0x09, 0x3a, 0x7b, 0xea, 0x41, 0x78, 0x0a, 0x21, 0x63, 0x6c, 0x6f, - 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x12, 0x53, - 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x7d, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x6c, 0x6f, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, - 0x2f, 0x7b, 0x6b, 0x65, 0x79, 0x5f, 0x72, 0x69, 0x6e, 0x67, 0x7d, 0x2f, 0x63, 0x72, 0x79, 0x70, - 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x2f, 0x7b, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x6b, - 0x65, 0x79, 0x7d, 0x42, 0x13, 0x0a, 0x11, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x22, 0xcf, 0x01, 0x0a, 0x18, 0x43, 0x72, 0x79, - 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x65, 0x6d, - 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x4f, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, - 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x62, 0x0a, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, - 0x74, 0x68, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, - 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x22, 0x83, 0x04, 0x0a, 0x17, 0x4b, - 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x5b, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, - 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x06, 0x66, 0x6f, 0x72, - 0x6d, 0x61, 0x74, 0x12, 0x1d, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, - 0x6e, 0x74, 0x12, 0x64, 0x0a, 0x0b, 0x63, 0x65, 0x72, 0x74, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, - 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, - 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x63, 0x65, - 0x72, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x1a, 0x98, 0x01, 0x0a, 0x11, 0x43, 0x65, 0x72, - 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x12, 0x21, - 0x0a, 0x0c, 0x63, 0x61, 0x76, 0x69, 0x75, 0x6d, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x61, 0x76, 0x69, 0x75, 0x6d, 0x43, 0x65, 0x72, 0x74, - 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5f, 0x63, 0x61, 0x72, 0x64, - 0x5f, 0x63, 0x65, 0x72, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x43, 0x61, 0x72, 0x64, 0x43, 0x65, 0x72, 0x74, 0x73, 0x12, 0x34, 0x0a, - 0x16, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x14, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x50, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x65, - 0x72, 0x74, 0x73, 0x22, 0x6b, 0x0a, 0x11, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x22, 0x0a, 0x1e, 0x41, 0x54, 0x54, 0x45, - 0x53, 0x54, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x55, - 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x14, - 0x43, 0x41, 0x56, 0x49, 0x55, 0x4d, 0x5f, 0x56, 0x31, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x52, 0x45, - 0x53, 0x53, 0x45, 0x44, 0x10, 0x03, 0x12, 0x18, 0x0a, 0x14, 0x43, 0x41, 0x56, 0x49, 0x55, 0x4d, - 0x5f, 0x56, 0x32, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x52, 0x45, 0x53, 0x53, 0x45, 0x44, 0x10, 0x04, - 0x22, 0xbf, 0x15, 0x0a, 0x10, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x51, - 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3b, 0x2e, + 0x03, 0x4d, 0x41, 0x43, 0x10, 0x09, 0x12, 0x15, 0x0a, 0x11, 0x4b, 0x45, 0x59, 0x5f, 0x45, 0x4e, + 0x43, 0x41, 0x50, 0x53, 0x55, 0x4c, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x0a, 0x3a, 0x7b, 0xea, + 0x41, 0x78, 0x0a, 0x21, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x72, 0x79, 0x70, + 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x12, 0x53, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, + 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x6b, + 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x7b, 0x6b, 0x65, 0x79, 0x5f, 0x72, 0x69, 0x6e, + 0x67, 0x7d, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x2f, 0x7b, 0x63, + 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x7d, 0x42, 0x13, 0x0a, 0x11, 0x72, 0x6f, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x22, + 0xcf, 0x01, 0x0a, 0x18, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x4f, 0x0a, 0x10, + 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, + 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x0f, 0x70, 0x72, + 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x62, 0x0a, + 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x3f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, + 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, + 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, + 0x6d, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, + 0x6d, 0x22, 0x83, 0x04, 0x0a, 0x17, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x5b, 0x0a, + 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, - 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, - 0x65, 0x12, 0x54, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, - 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, - 0x6c, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x62, 0x0a, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, - 0x69, 0x74, 0x68, 0x6d, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3f, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, - 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x42, 0x03, 0xe0, 0x41, 0x03, - 0x52, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x53, 0x0a, 0x0b, 0x61, - 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, - 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x03, - 0xe0, 0x41, 0x03, 0x52, 0x0b, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x40, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, - 0x6d, 0x65, 0x12, 0x44, 0x0a, 0x0d, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x74, - 0x69, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0c, 0x67, 0x65, 0x6e, 0x65, - 0x72, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x42, 0x0a, 0x0c, 0x64, 0x65, 0x73, 0x74, - 0x72, 0x6f, 0x79, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, - 0x0b, 0x64, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x4d, 0x0a, 0x12, - 0x64, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x69, - 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x10, 0x64, 0x65, 0x73, 0x74, 0x72, - 0x6f, 0x79, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0a, 0x69, - 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x6a, 0x6f, 0x62, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x03, 0xe0, 0x41, 0x03, 0x52, 0x09, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x12, - 0x40, 0x0a, 0x0b, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0f, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x69, 0x6d, - 0x65, 0x12, 0x37, 0x0a, 0x15, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x66, 0x61, 0x69, 0x6c, - 0x75, 0x72, 0x65, 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x13, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x46, 0x61, 0x69, - 0x6c, 0x75, 0x72, 0x65, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x19, 0x67, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, - 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x13, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, - 0x41, 0x03, 0x52, 0x17, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x61, - 0x69, 0x6c, 0x75, 0x72, 0x65, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x52, 0x0a, 0x23, 0x65, - 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x5f, 0x72, 0x65, 0x61, 0x73, - 0x6f, 0x6e, 0x18, 0x14, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x20, 0x65, - 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x65, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, - 0x7e, 0x0a, 0x21, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x74, - 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x6f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, - 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, - 0x1e, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, - 0x30, 0x0a, 0x11, 0x72, 0x65, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x65, 0x6c, 0x69, 0x67, - 0x69, 0x62, 0x6c, 0x65, 0x18, 0x12, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, - 0x10, 0x72, 0x65, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x45, 0x6c, 0x69, 0x67, 0x69, 0x62, 0x6c, - 0x65, 0x22, 0x98, 0x08, 0x0a, 0x19, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, - 0x2c, 0x0a, 0x28, 0x43, 0x52, 0x59, 0x50, 0x54, 0x4f, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x56, 0x45, - 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x41, 0x4c, 0x47, 0x4f, 0x52, 0x49, 0x54, 0x48, 0x4d, 0x5f, - 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1f, 0x0a, - 0x1b, 0x47, 0x4f, 0x4f, 0x47, 0x4c, 0x45, 0x5f, 0x53, 0x59, 0x4d, 0x4d, 0x45, 0x54, 0x52, 0x49, - 0x43, 0x5f, 0x45, 0x4e, 0x43, 0x52, 0x59, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x0f, - 0x0a, 0x0b, 0x41, 0x45, 0x53, 0x5f, 0x31, 0x32, 0x38, 0x5f, 0x47, 0x43, 0x4d, 0x10, 0x29, 0x12, - 0x0f, 0x0a, 0x0b, 0x41, 0x45, 0x53, 0x5f, 0x32, 0x35, 0x36, 0x5f, 0x47, 0x43, 0x4d, 0x10, 0x13, - 0x12, 0x0f, 0x0a, 0x0b, 0x41, 0x45, 0x53, 0x5f, 0x31, 0x32, 0x38, 0x5f, 0x43, 0x42, 0x43, 0x10, - 0x2a, 0x12, 0x0f, 0x0a, 0x0b, 0x41, 0x45, 0x53, 0x5f, 0x32, 0x35, 0x36, 0x5f, 0x43, 0x42, 0x43, - 0x10, 0x2b, 0x12, 0x0f, 0x0a, 0x0b, 0x41, 0x45, 0x53, 0x5f, 0x31, 0x32, 0x38, 0x5f, 0x43, 0x54, - 0x52, 0x10, 0x2c, 0x12, 0x0f, 0x0a, 0x0b, 0x41, 0x45, 0x53, 0x5f, 0x32, 0x35, 0x36, 0x5f, 0x43, - 0x54, 0x52, 0x10, 0x2d, 0x12, 0x1c, 0x0a, 0x18, 0x52, 0x53, 0x41, 0x5f, 0x53, 0x49, 0x47, 0x4e, - 0x5f, 0x50, 0x53, 0x53, 0x5f, 0x32, 0x30, 0x34, 0x38, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, - 0x10, 0x02, 0x12, 0x1c, 0x0a, 0x18, 0x52, 0x53, 0x41, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x50, - 0x53, 0x53, 0x5f, 0x33, 0x30, 0x37, 0x32, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x03, - 0x12, 0x1c, 0x0a, 0x18, 0x52, 0x53, 0x41, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x50, 0x53, 0x53, - 0x5f, 0x34, 0x30, 0x39, 0x36, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x04, 0x12, 0x1c, - 0x0a, 0x18, 0x52, 0x53, 0x41, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x50, 0x53, 0x53, 0x5f, 0x34, - 0x30, 0x39, 0x36, 0x5f, 0x53, 0x48, 0x41, 0x35, 0x31, 0x32, 0x10, 0x0f, 0x12, 0x1e, 0x0a, 0x1a, - 0x52, 0x53, 0x41, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x50, 0x4b, 0x43, 0x53, 0x31, 0x5f, 0x32, - 0x30, 0x34, 0x38, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x05, 0x12, 0x1e, 0x0a, 0x1a, - 0x52, 0x53, 0x41, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x50, 0x4b, 0x43, 0x53, 0x31, 0x5f, 0x33, - 0x30, 0x37, 0x32, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x06, 0x12, 0x1e, 0x0a, 0x1a, - 0x52, 0x53, 0x41, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x50, 0x4b, 0x43, 0x53, 0x31, 0x5f, 0x34, - 0x30, 0x39, 0x36, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x07, 0x12, 0x1e, 0x0a, 0x1a, - 0x52, 0x53, 0x41, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x50, 0x4b, 0x43, 0x53, 0x31, 0x5f, 0x34, - 0x30, 0x39, 0x36, 0x5f, 0x53, 0x48, 0x41, 0x35, 0x31, 0x32, 0x10, 0x10, 0x12, 0x1b, 0x0a, 0x17, - 0x52, 0x53, 0x41, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x52, 0x41, 0x57, 0x5f, 0x50, 0x4b, 0x43, - 0x53, 0x31, 0x5f, 0x32, 0x30, 0x34, 0x38, 0x10, 0x1c, 0x12, 0x1b, 0x0a, 0x17, 0x52, 0x53, 0x41, - 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x52, 0x41, 0x57, 0x5f, 0x50, 0x4b, 0x43, 0x53, 0x31, 0x5f, - 0x33, 0x30, 0x37, 0x32, 0x10, 0x1d, 0x12, 0x1b, 0x0a, 0x17, 0x52, 0x53, 0x41, 0x5f, 0x53, 0x49, - 0x47, 0x4e, 0x5f, 0x52, 0x41, 0x57, 0x5f, 0x50, 0x4b, 0x43, 0x53, 0x31, 0x5f, 0x34, 0x30, 0x39, - 0x36, 0x10, 0x1e, 0x12, 0x20, 0x0a, 0x1c, 0x52, 0x53, 0x41, 0x5f, 0x44, 0x45, 0x43, 0x52, 0x59, - 0x50, 0x54, 0x5f, 0x4f, 0x41, 0x45, 0x50, 0x5f, 0x32, 0x30, 0x34, 0x38, 0x5f, 0x53, 0x48, 0x41, - 0x32, 0x35, 0x36, 0x10, 0x08, 0x12, 0x20, 0x0a, 0x1c, 0x52, 0x53, 0x41, 0x5f, 0x44, 0x45, 0x43, - 0x52, 0x59, 0x50, 0x54, 0x5f, 0x4f, 0x41, 0x45, 0x50, 0x5f, 0x33, 0x30, 0x37, 0x32, 0x5f, 0x53, - 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x09, 0x12, 0x20, 0x0a, 0x1c, 0x52, 0x53, 0x41, 0x5f, 0x44, - 0x45, 0x43, 0x52, 0x59, 0x50, 0x54, 0x5f, 0x4f, 0x41, 0x45, 0x50, 0x5f, 0x34, 0x30, 0x39, 0x36, - 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x0a, 0x12, 0x20, 0x0a, 0x1c, 0x52, 0x53, 0x41, - 0x5f, 0x44, 0x45, 0x43, 0x52, 0x59, 0x50, 0x54, 0x5f, 0x4f, 0x41, 0x45, 0x50, 0x5f, 0x34, 0x30, - 0x39, 0x36, 0x5f, 0x53, 0x48, 0x41, 0x35, 0x31, 0x32, 0x10, 0x11, 0x12, 0x1e, 0x0a, 0x1a, 0x52, - 0x53, 0x41, 0x5f, 0x44, 0x45, 0x43, 0x52, 0x59, 0x50, 0x54, 0x5f, 0x4f, 0x41, 0x45, 0x50, 0x5f, - 0x32, 0x30, 0x34, 0x38, 0x5f, 0x53, 0x48, 0x41, 0x31, 0x10, 0x25, 0x12, 0x1e, 0x0a, 0x1a, 0x52, - 0x53, 0x41, 0x5f, 0x44, 0x45, 0x43, 0x52, 0x59, 0x50, 0x54, 0x5f, 0x4f, 0x41, 0x45, 0x50, 0x5f, - 0x33, 0x30, 0x37, 0x32, 0x5f, 0x53, 0x48, 0x41, 0x31, 0x10, 0x26, 0x12, 0x1e, 0x0a, 0x1a, 0x52, - 0x53, 0x41, 0x5f, 0x44, 0x45, 0x43, 0x52, 0x59, 0x50, 0x54, 0x5f, 0x4f, 0x41, 0x45, 0x50, 0x5f, - 0x34, 0x30, 0x39, 0x36, 0x5f, 0x53, 0x48, 0x41, 0x31, 0x10, 0x27, 0x12, 0x17, 0x0a, 0x13, 0x45, - 0x43, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x50, 0x32, 0x35, 0x36, 0x5f, 0x53, 0x48, 0x41, 0x32, - 0x35, 0x36, 0x10, 0x0c, 0x12, 0x17, 0x0a, 0x13, 0x45, 0x43, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, - 0x50, 0x33, 0x38, 0x34, 0x5f, 0x53, 0x48, 0x41, 0x33, 0x38, 0x34, 0x10, 0x0d, 0x12, 0x1c, 0x0a, - 0x18, 0x45, 0x43, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x53, 0x45, 0x43, 0x50, 0x32, 0x35, 0x36, - 0x4b, 0x31, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x1f, 0x12, 0x13, 0x0a, 0x0f, 0x45, - 0x43, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x45, 0x44, 0x32, 0x35, 0x35, 0x31, 0x39, 0x10, 0x28, - 0x12, 0x0f, 0x0a, 0x0b, 0x48, 0x4d, 0x41, 0x43, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, - 0x20, 0x12, 0x0d, 0x0a, 0x09, 0x48, 0x4d, 0x41, 0x43, 0x5f, 0x53, 0x48, 0x41, 0x31, 0x10, 0x21, - 0x12, 0x0f, 0x0a, 0x0b, 0x48, 0x4d, 0x41, 0x43, 0x5f, 0x53, 0x48, 0x41, 0x33, 0x38, 0x34, 0x10, - 0x22, 0x12, 0x0f, 0x0a, 0x0b, 0x48, 0x4d, 0x41, 0x43, 0x5f, 0x53, 0x48, 0x41, 0x35, 0x31, 0x32, - 0x10, 0x23, 0x12, 0x0f, 0x0a, 0x0b, 0x48, 0x4d, 0x41, 0x43, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x32, - 0x34, 0x10, 0x24, 0x12, 0x21, 0x0a, 0x1d, 0x45, 0x58, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x5f, - 0x53, 0x59, 0x4d, 0x4d, 0x45, 0x54, 0x52, 0x49, 0x43, 0x5f, 0x45, 0x4e, 0x43, 0x52, 0x59, 0x50, - 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x12, 0x12, 0x15, 0x0a, 0x11, 0x50, 0x51, 0x5f, 0x53, 0x49, 0x47, - 0x4e, 0x5f, 0x4d, 0x4c, 0x5f, 0x44, 0x53, 0x41, 0x5f, 0x36, 0x35, 0x10, 0x38, 0x12, 0x1d, 0x0a, - 0x19, 0x50, 0x51, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x53, 0x4c, 0x48, 0x5f, 0x44, 0x53, 0x41, - 0x5f, 0x53, 0x48, 0x41, 0x32, 0x5f, 0x31, 0x32, 0x38, 0x53, 0x10, 0x39, 0x22, 0x9b, 0x02, 0x0a, - 0x15, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x28, 0x0a, 0x24, 0x43, 0x52, 0x59, 0x50, 0x54, 0x4f, - 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x54, 0x41, - 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, - 0x12, 0x16, 0x0a, 0x12, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x47, 0x45, 0x4e, 0x45, - 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x05, 0x12, 0x0b, 0x0a, 0x07, 0x45, 0x4e, 0x41, 0x42, - 0x4c, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x49, 0x53, 0x41, 0x42, 0x4c, 0x45, - 0x44, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x44, 0x45, 0x53, 0x54, 0x52, 0x4f, 0x59, 0x45, 0x44, - 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x44, 0x45, 0x53, 0x54, 0x52, 0x4f, 0x59, 0x5f, 0x53, 0x43, - 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x44, 0x10, 0x04, 0x12, 0x12, 0x0a, 0x0e, 0x50, 0x45, 0x4e, - 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x49, 0x4d, 0x50, 0x4f, 0x52, 0x54, 0x10, 0x06, 0x12, 0x11, 0x0a, - 0x0d, 0x49, 0x4d, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x07, - 0x12, 0x15, 0x0a, 0x11, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x46, - 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x08, 0x12, 0x20, 0x0a, 0x1c, 0x50, 0x45, 0x4e, 0x44, 0x49, - 0x4e, 0x47, 0x5f, 0x45, 0x58, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x5f, 0x44, 0x45, 0x53, 0x54, - 0x52, 0x55, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x09, 0x12, 0x1f, 0x0a, 0x1b, 0x45, 0x58, 0x54, - 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x5f, 0x44, 0x45, 0x53, 0x54, 0x52, 0x55, 0x43, 0x54, 0x49, 0x4f, - 0x4e, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x0a, 0x22, 0x49, 0x0a, 0x14, 0x43, 0x72, - 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x56, 0x69, - 0x65, 0x77, 0x12, 0x27, 0x0a, 0x23, 0x43, 0x52, 0x59, 0x50, 0x54, 0x4f, 0x5f, 0x4b, 0x45, 0x59, - 0x5f, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x56, 0x49, 0x45, 0x57, 0x5f, 0x55, 0x4e, - 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x46, - 0x55, 0x4c, 0x4c, 0x10, 0x01, 0x3a, 0xaa, 0x01, 0xea, 0x41, 0xa6, 0x01, 0x0a, 0x28, 0x63, 0x6c, - 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, - 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x7a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, - 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, - 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x7b, 0x6b, 0x65, 0x79, 0x5f, 0x72, 0x69, - 0x6e, 0x67, 0x7d, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x2f, 0x7b, - 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x7d, 0x2f, 0x63, 0x72, 0x79, 0x70, - 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x63, - 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x7d, 0x22, 0x6b, 0x0a, 0x0f, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, - 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x44, 0x0a, 0x0f, 0x63, 0x72, 0x63, - 0x33, 0x32, 0x63, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, - 0x0e, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x22, - 0xbc, 0x05, 0x0a, 0x09, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x10, 0x0a, - 0x03, 0x70, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x65, 0x6d, 0x12, - 0x5d, 0x0a, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x3f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, - 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, - 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, - 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, - 0x74, 0x68, 0x6d, 0x52, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x3a, - 0x0a, 0x0a, 0x70, 0x65, 0x6d, 0x5f, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, - 0x09, 0x70, 0x65, 0x6d, 0x43, 0x72, 0x63, 0x33, 0x32, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x4f, - 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x65, 0x76, - 0x65, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, - 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x0f, - 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, - 0x5a, 0x0a, 0x11, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x66, 0x6f, - 0x72, 0x6d, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2e, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, - 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x4b, 0x65, 0x79, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x52, 0x0f, 0x70, 0x75, 0x62, 0x6c, - 0x69, 0x63, 0x4b, 0x65, 0x79, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x43, 0x0a, 0x0a, 0x70, - 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, - 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, - 0x64, 0x44, 0x61, 0x74, 0x61, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, - 0x22, 0x4b, 0x0a, 0x0f, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x46, 0x6f, 0x72, - 0x6d, 0x61, 0x74, 0x12, 0x21, 0x0a, 0x1d, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x5f, 0x4b, 0x45, - 0x59, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, - 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x50, 0x45, 0x4d, 0x10, 0x01, 0x12, - 0x0c, 0x0a, 0x08, 0x4e, 0x49, 0x53, 0x54, 0x5f, 0x50, 0x51, 0x43, 0x10, 0x03, 0x3a, 0xae, 0x01, - 0xea, 0x41, 0xaa, 0x01, 0x0a, 0x21, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x50, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x84, 0x01, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x6c, 0x6f, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x7d, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x7b, 0x6b, 0x65, 0x79, 0x5f, - 0x72, 0x69, 0x6e, 0x67, 0x7d, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, - 0x2f, 0x7b, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x7d, 0x2f, 0x63, 0x72, - 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, - 0x7b, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x76, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x22, 0xd4, - 0x09, 0x0a, 0x09, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x12, 0x17, 0x0a, 0x04, + 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x42, 0x03, 0xe0, + 0x41, 0x03, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x1d, 0x0a, 0x07, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x03, 0xe0, 0x41, 0x03, + 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x64, 0x0a, 0x0b, 0x63, 0x65, 0x72, + 0x74, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3e, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x42, 0x03, + 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x63, 0x65, 0x72, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x1a, + 0x98, 0x01, 0x0a, 0x11, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, + 0x68, 0x61, 0x69, 0x6e, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x61, 0x76, 0x69, 0x75, 0x6d, 0x5f, + 0x63, 0x65, 0x72, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x61, 0x76, + 0x69, 0x75, 0x6d, 0x43, 0x65, 0x72, 0x74, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x5f, 0x63, 0x61, 0x72, 0x64, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x0f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x43, 0x61, 0x72, 0x64, 0x43, + 0x65, 0x72, 0x74, 0x73, 0x12, 0x34, 0x0a, 0x16, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5f, 0x70, + 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x14, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x50, 0x61, 0x72, 0x74, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x65, 0x72, 0x74, 0x73, 0x22, 0x6b, 0x0a, 0x11, 0x41, 0x74, + 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, + 0x22, 0x0a, 0x1e, 0x41, 0x54, 0x54, 0x45, 0x53, 0x54, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x46, + 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, + 0x44, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x14, 0x43, 0x41, 0x56, 0x49, 0x55, 0x4d, 0x5f, 0x56, 0x31, + 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x52, 0x45, 0x53, 0x53, 0x45, 0x44, 0x10, 0x03, 0x12, 0x18, 0x0a, + 0x14, 0x43, 0x41, 0x56, 0x49, 0x55, 0x4d, 0x5f, 0x56, 0x32, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x52, + 0x45, 0x53, 0x53, 0x45, 0x44, 0x10, 0x04, 0x22, 0xef, 0x15, 0x0a, 0x10, 0x43, 0x72, 0x79, 0x70, + 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x58, 0x0a, 0x0d, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, - 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, - 0x76, 0x31, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x2e, 0x49, 0x6d, 0x70, - 0x6f, 0x72, 0x74, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x42, 0x06, 0xe0, 0x41, 0x02, 0xe0, 0x41, - 0x05, 0x52, 0x0c, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, - 0x57, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x65, - 0x76, 0x65, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x42, - 0x06, 0xe0, 0x41, 0x02, 0xe0, 0x41, 0x05, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x40, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, - 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x44, 0x0a, 0x0d, 0x67, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, - 0x41, 0x03, 0x52, 0x0c, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, - 0x12, 0x40, 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x51, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, + 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x72, 0x79, 0x70, + 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x54, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x74, + 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, + 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0f, 0x70, + 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x62, + 0x0a, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x3f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, + 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, + 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, + 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, + 0x68, 0x6d, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, + 0x68, 0x6d, 0x12, 0x53, 0x0a, 0x0b, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, + 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0b, 0x61, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x44, 0x0a, 0x0d, 0x67, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, + 0x03, 0x52, 0x0c, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, + 0x42, 0x0a, 0x0c, 0x64, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x54, 0x69, - 0x6d, 0x65, 0x12, 0x4b, 0x0a, 0x11, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x5f, 0x65, 0x76, 0x65, - 0x6e, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0f, - 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, - 0x48, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2d, + 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x54, + 0x69, 0x6d, 0x65, 0x12, 0x4d, 0x0a, 0x12, 0x64, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x5f, 0x65, + 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, + 0x52, 0x10, 0x64, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x69, + 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0a, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x6a, 0x6f, 0x62, + 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x09, 0x69, 0x6d, 0x70, + 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x12, 0x40, 0x0a, 0x0b, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x69, 0x6d, + 0x70, 0x6f, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x37, 0x0a, 0x15, 0x69, 0x6d, 0x70, 0x6f, + 0x72, 0x74, 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, + 0x6e, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x13, 0x69, 0x6d, + 0x70, 0x6f, 0x72, 0x74, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x52, 0x65, 0x61, 0x73, 0x6f, + 0x6e, 0x12, 0x3f, 0x0a, 0x19, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x13, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x17, 0x67, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x52, 0x65, 0x61, 0x73, + 0x6f, 0x6e, 0x12, 0x52, 0x0a, 0x23, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x64, + 0x65, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x75, + 0x72, 0x65, 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x14, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x03, 0xe0, 0x41, 0x03, 0x52, 0x20, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x65, + 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, + 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x7e, 0x0a, 0x21, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, + 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x65, + 0x76, 0x65, 0x6c, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, + 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x1e, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x30, 0x0a, 0x11, 0x72, 0x65, 0x69, 0x6d, 0x70, 0x6f, + 0x72, 0x74, 0x5f, 0x65, 0x6c, 0x69, 0x67, 0x69, 0x62, 0x6c, 0x65, 0x18, 0x12, 0x20, 0x01, 0x28, + 0x08, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x10, 0x72, 0x65, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, + 0x45, 0x6c, 0x69, 0x67, 0x69, 0x62, 0x6c, 0x65, 0x22, 0xc8, 0x08, 0x0a, 0x19, 0x43, 0x72, 0x79, + 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x6c, 0x67, + 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x2c, 0x0a, 0x28, 0x43, 0x52, 0x59, 0x50, 0x54, 0x4f, + 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x41, 0x4c, 0x47, + 0x4f, 0x52, 0x49, 0x54, 0x48, 0x4d, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, + 0x45, 0x44, 0x10, 0x00, 0x12, 0x1f, 0x0a, 0x1b, 0x47, 0x4f, 0x4f, 0x47, 0x4c, 0x45, 0x5f, 0x53, + 0x59, 0x4d, 0x4d, 0x45, 0x54, 0x52, 0x49, 0x43, 0x5f, 0x45, 0x4e, 0x43, 0x52, 0x59, 0x50, 0x54, + 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x41, 0x45, 0x53, 0x5f, 0x31, 0x32, 0x38, + 0x5f, 0x47, 0x43, 0x4d, 0x10, 0x29, 0x12, 0x0f, 0x0a, 0x0b, 0x41, 0x45, 0x53, 0x5f, 0x32, 0x35, + 0x36, 0x5f, 0x47, 0x43, 0x4d, 0x10, 0x13, 0x12, 0x0f, 0x0a, 0x0b, 0x41, 0x45, 0x53, 0x5f, 0x31, + 0x32, 0x38, 0x5f, 0x43, 0x42, 0x43, 0x10, 0x2a, 0x12, 0x0f, 0x0a, 0x0b, 0x41, 0x45, 0x53, 0x5f, + 0x32, 0x35, 0x36, 0x5f, 0x43, 0x42, 0x43, 0x10, 0x2b, 0x12, 0x0f, 0x0a, 0x0b, 0x41, 0x45, 0x53, + 0x5f, 0x31, 0x32, 0x38, 0x5f, 0x43, 0x54, 0x52, 0x10, 0x2c, 0x12, 0x0f, 0x0a, 0x0b, 0x41, 0x45, + 0x53, 0x5f, 0x32, 0x35, 0x36, 0x5f, 0x43, 0x54, 0x52, 0x10, 0x2d, 0x12, 0x1c, 0x0a, 0x18, 0x52, + 0x53, 0x41, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x50, 0x53, 0x53, 0x5f, 0x32, 0x30, 0x34, 0x38, + 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x02, 0x12, 0x1c, 0x0a, 0x18, 0x52, 0x53, 0x41, + 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x50, 0x53, 0x53, 0x5f, 0x33, 0x30, 0x37, 0x32, 0x5f, 0x53, + 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x03, 0x12, 0x1c, 0x0a, 0x18, 0x52, 0x53, 0x41, 0x5f, 0x53, + 0x49, 0x47, 0x4e, 0x5f, 0x50, 0x53, 0x53, 0x5f, 0x34, 0x30, 0x39, 0x36, 0x5f, 0x53, 0x48, 0x41, + 0x32, 0x35, 0x36, 0x10, 0x04, 0x12, 0x1c, 0x0a, 0x18, 0x52, 0x53, 0x41, 0x5f, 0x53, 0x49, 0x47, + 0x4e, 0x5f, 0x50, 0x53, 0x53, 0x5f, 0x34, 0x30, 0x39, 0x36, 0x5f, 0x53, 0x48, 0x41, 0x35, 0x31, + 0x32, 0x10, 0x0f, 0x12, 0x1e, 0x0a, 0x1a, 0x52, 0x53, 0x41, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, + 0x50, 0x4b, 0x43, 0x53, 0x31, 0x5f, 0x32, 0x30, 0x34, 0x38, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, + 0x36, 0x10, 0x05, 0x12, 0x1e, 0x0a, 0x1a, 0x52, 0x53, 0x41, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, + 0x50, 0x4b, 0x43, 0x53, 0x31, 0x5f, 0x33, 0x30, 0x37, 0x32, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, + 0x36, 0x10, 0x06, 0x12, 0x1e, 0x0a, 0x1a, 0x52, 0x53, 0x41, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, + 0x50, 0x4b, 0x43, 0x53, 0x31, 0x5f, 0x34, 0x30, 0x39, 0x36, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, + 0x36, 0x10, 0x07, 0x12, 0x1e, 0x0a, 0x1a, 0x52, 0x53, 0x41, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, + 0x50, 0x4b, 0x43, 0x53, 0x31, 0x5f, 0x34, 0x30, 0x39, 0x36, 0x5f, 0x53, 0x48, 0x41, 0x35, 0x31, + 0x32, 0x10, 0x10, 0x12, 0x1b, 0x0a, 0x17, 0x52, 0x53, 0x41, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, + 0x52, 0x41, 0x57, 0x5f, 0x50, 0x4b, 0x43, 0x53, 0x31, 0x5f, 0x32, 0x30, 0x34, 0x38, 0x10, 0x1c, + 0x12, 0x1b, 0x0a, 0x17, 0x52, 0x53, 0x41, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x52, 0x41, 0x57, + 0x5f, 0x50, 0x4b, 0x43, 0x53, 0x31, 0x5f, 0x33, 0x30, 0x37, 0x32, 0x10, 0x1d, 0x12, 0x1b, 0x0a, + 0x17, 0x52, 0x53, 0x41, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x52, 0x41, 0x57, 0x5f, 0x50, 0x4b, + 0x43, 0x53, 0x31, 0x5f, 0x34, 0x30, 0x39, 0x36, 0x10, 0x1e, 0x12, 0x20, 0x0a, 0x1c, 0x52, 0x53, + 0x41, 0x5f, 0x44, 0x45, 0x43, 0x52, 0x59, 0x50, 0x54, 0x5f, 0x4f, 0x41, 0x45, 0x50, 0x5f, 0x32, + 0x30, 0x34, 0x38, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x08, 0x12, 0x20, 0x0a, 0x1c, + 0x52, 0x53, 0x41, 0x5f, 0x44, 0x45, 0x43, 0x52, 0x59, 0x50, 0x54, 0x5f, 0x4f, 0x41, 0x45, 0x50, + 0x5f, 0x33, 0x30, 0x37, 0x32, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x09, 0x12, 0x20, + 0x0a, 0x1c, 0x52, 0x53, 0x41, 0x5f, 0x44, 0x45, 0x43, 0x52, 0x59, 0x50, 0x54, 0x5f, 0x4f, 0x41, + 0x45, 0x50, 0x5f, 0x34, 0x30, 0x39, 0x36, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x0a, + 0x12, 0x20, 0x0a, 0x1c, 0x52, 0x53, 0x41, 0x5f, 0x44, 0x45, 0x43, 0x52, 0x59, 0x50, 0x54, 0x5f, + 0x4f, 0x41, 0x45, 0x50, 0x5f, 0x34, 0x30, 0x39, 0x36, 0x5f, 0x53, 0x48, 0x41, 0x35, 0x31, 0x32, + 0x10, 0x11, 0x12, 0x1e, 0x0a, 0x1a, 0x52, 0x53, 0x41, 0x5f, 0x44, 0x45, 0x43, 0x52, 0x59, 0x50, + 0x54, 0x5f, 0x4f, 0x41, 0x45, 0x50, 0x5f, 0x32, 0x30, 0x34, 0x38, 0x5f, 0x53, 0x48, 0x41, 0x31, + 0x10, 0x25, 0x12, 0x1e, 0x0a, 0x1a, 0x52, 0x53, 0x41, 0x5f, 0x44, 0x45, 0x43, 0x52, 0x59, 0x50, + 0x54, 0x5f, 0x4f, 0x41, 0x45, 0x50, 0x5f, 0x33, 0x30, 0x37, 0x32, 0x5f, 0x53, 0x48, 0x41, 0x31, + 0x10, 0x26, 0x12, 0x1e, 0x0a, 0x1a, 0x52, 0x53, 0x41, 0x5f, 0x44, 0x45, 0x43, 0x52, 0x59, 0x50, + 0x54, 0x5f, 0x4f, 0x41, 0x45, 0x50, 0x5f, 0x34, 0x30, 0x39, 0x36, 0x5f, 0x53, 0x48, 0x41, 0x31, + 0x10, 0x27, 0x12, 0x17, 0x0a, 0x13, 0x45, 0x43, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x50, 0x32, + 0x35, 0x36, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x0c, 0x12, 0x17, 0x0a, 0x13, 0x45, + 0x43, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x50, 0x33, 0x38, 0x34, 0x5f, 0x53, 0x48, 0x41, 0x33, + 0x38, 0x34, 0x10, 0x0d, 0x12, 0x1c, 0x0a, 0x18, 0x45, 0x43, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, + 0x53, 0x45, 0x43, 0x50, 0x32, 0x35, 0x36, 0x4b, 0x31, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, + 0x10, 0x1f, 0x12, 0x13, 0x0a, 0x0f, 0x45, 0x43, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x45, 0x44, + 0x32, 0x35, 0x35, 0x31, 0x39, 0x10, 0x28, 0x12, 0x0f, 0x0a, 0x0b, 0x48, 0x4d, 0x41, 0x43, 0x5f, + 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x20, 0x12, 0x0d, 0x0a, 0x09, 0x48, 0x4d, 0x41, 0x43, + 0x5f, 0x53, 0x48, 0x41, 0x31, 0x10, 0x21, 0x12, 0x0f, 0x0a, 0x0b, 0x48, 0x4d, 0x41, 0x43, 0x5f, + 0x53, 0x48, 0x41, 0x33, 0x38, 0x34, 0x10, 0x22, 0x12, 0x0f, 0x0a, 0x0b, 0x48, 0x4d, 0x41, 0x43, + 0x5f, 0x53, 0x48, 0x41, 0x35, 0x31, 0x32, 0x10, 0x23, 0x12, 0x0f, 0x0a, 0x0b, 0x48, 0x4d, 0x41, + 0x43, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x32, 0x34, 0x10, 0x24, 0x12, 0x21, 0x0a, 0x1d, 0x45, 0x58, + 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x5f, 0x53, 0x59, 0x4d, 0x4d, 0x45, 0x54, 0x52, 0x49, 0x43, + 0x5f, 0x45, 0x4e, 0x43, 0x52, 0x59, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x12, 0x12, 0x0e, 0x0a, + 0x0a, 0x4d, 0x4c, 0x5f, 0x4b, 0x45, 0x4d, 0x5f, 0x37, 0x36, 0x38, 0x10, 0x2f, 0x12, 0x0f, 0x0a, + 0x0b, 0x4d, 0x4c, 0x5f, 0x4b, 0x45, 0x4d, 0x5f, 0x31, 0x30, 0x32, 0x34, 0x10, 0x30, 0x12, 0x0d, + 0x0a, 0x09, 0x4b, 0x45, 0x4d, 0x5f, 0x58, 0x57, 0x49, 0x4e, 0x47, 0x10, 0x3f, 0x12, 0x15, 0x0a, + 0x11, 0x50, 0x51, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x4d, 0x4c, 0x5f, 0x44, 0x53, 0x41, 0x5f, + 0x36, 0x35, 0x10, 0x38, 0x12, 0x1d, 0x0a, 0x19, 0x50, 0x51, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, + 0x53, 0x4c, 0x48, 0x5f, 0x44, 0x53, 0x41, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x5f, 0x31, 0x32, 0x38, + 0x53, 0x10, 0x39, 0x22, 0x9b, 0x02, 0x0a, 0x15, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, + 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x28, 0x0a, + 0x24, 0x43, 0x52, 0x59, 0x50, 0x54, 0x4f, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x56, 0x45, 0x52, 0x53, + 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, + 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x50, 0x45, 0x4e, 0x44, 0x49, + 0x4e, 0x47, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x05, 0x12, + 0x0b, 0x0a, 0x07, 0x45, 0x4e, 0x41, 0x42, 0x4c, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, + 0x44, 0x49, 0x53, 0x41, 0x42, 0x4c, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x44, 0x45, + 0x53, 0x54, 0x52, 0x4f, 0x59, 0x45, 0x44, 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x44, 0x45, 0x53, + 0x54, 0x52, 0x4f, 0x59, 0x5f, 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x44, 0x10, 0x04, + 0x12, 0x12, 0x0a, 0x0e, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x49, 0x4d, 0x50, 0x4f, + 0x52, 0x54, 0x10, 0x06, 0x12, 0x11, 0x0a, 0x0d, 0x49, 0x4d, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x46, + 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x07, 0x12, 0x15, 0x0a, 0x11, 0x47, 0x45, 0x4e, 0x45, 0x52, + 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x08, 0x12, 0x20, + 0x0a, 0x1c, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x45, 0x58, 0x54, 0x45, 0x52, 0x4e, + 0x41, 0x4c, 0x5f, 0x44, 0x45, 0x53, 0x54, 0x52, 0x55, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x09, + 0x12, 0x1f, 0x0a, 0x1b, 0x45, 0x58, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x5f, 0x44, 0x45, 0x53, + 0x54, 0x52, 0x55, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, + 0x0a, 0x22, 0x49, 0x0a, 0x14, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x56, 0x69, 0x65, 0x77, 0x12, 0x27, 0x0a, 0x23, 0x43, 0x52, 0x59, + 0x50, 0x54, 0x4f, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x5f, + 0x56, 0x49, 0x45, 0x57, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, + 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x55, 0x4c, 0x4c, 0x10, 0x01, 0x3a, 0xaa, 0x01, 0xea, + 0x41, 0xa6, 0x01, 0x0a, 0x28, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x72, 0x79, + 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x7a, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x7d, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x6c, 0x6f, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, + 0x7b, 0x6b, 0x65, 0x79, 0x5f, 0x72, 0x69, 0x6e, 0x67, 0x7d, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, + 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x2f, 0x7b, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x6b, 0x65, + 0x79, 0x7d, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, + 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x7d, 0x22, 0x6b, 0x0a, 0x0f, 0x43, 0x68, 0x65, + 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, + 0x12, 0x44, 0x0a, 0x0f, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, + 0x73, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, + 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0e, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x43, 0x68, + 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x22, 0xda, 0x05, 0x0a, 0x09, 0x50, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x4b, 0x65, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x70, 0x65, 0x6d, 0x12, 0x5d, 0x0a, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, + 0x74, 0x68, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, + 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x52, 0x09, 0x61, 0x6c, 0x67, 0x6f, + 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x3a, 0x0a, 0x0a, 0x70, 0x65, 0x6d, 0x5f, 0x63, 0x72, 0x63, + 0x33, 0x32, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, + 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x09, 0x70, 0x65, 0x6d, 0x43, 0x72, 0x63, 0x33, 0x32, + 0x63, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x4f, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, + 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x5a, 0x0a, 0x11, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x2e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, + 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, + 0x79, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x46, 0x6f, 0x72, 0x6d, 0x61, + 0x74, 0x52, 0x0f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x46, 0x6f, 0x72, 0x6d, + 0x61, 0x74, 0x12, 0x43, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, + 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x52, 0x09, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x22, 0x69, 0x0a, 0x0f, 0x50, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x4b, 0x65, 0x79, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x21, 0x0a, 0x1d, 0x50, 0x55, + 0x42, 0x4c, 0x49, 0x43, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, + 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a, + 0x03, 0x50, 0x45, 0x4d, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x44, 0x45, 0x52, 0x10, 0x02, 0x12, + 0x0c, 0x0a, 0x08, 0x4e, 0x49, 0x53, 0x54, 0x5f, 0x50, 0x51, 0x43, 0x10, 0x03, 0x12, 0x13, 0x0a, + 0x0f, 0x58, 0x57, 0x49, 0x4e, 0x47, 0x5f, 0x52, 0x41, 0x57, 0x5f, 0x42, 0x59, 0x54, 0x45, 0x53, + 0x10, 0x04, 0x3a, 0xae, 0x01, 0xea, 0x41, 0xaa, 0x01, 0x0a, 0x21, 0x63, 0x6c, 0x6f, 0x75, 0x64, + 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x84, 0x01, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x7d, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x6c, 0x6f, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, + 0x7b, 0x6b, 0x65, 0x79, 0x5f, 0x72, 0x69, 0x6e, 0x67, 0x7d, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, + 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x2f, 0x7b, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x6b, 0x65, + 0x79, 0x7d, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, + 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x4b, 0x65, 0x79, 0x22, 0x8d, 0x0a, 0x0a, 0x09, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, + 0x62, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x03, 0xe0, 0x41, 0x03, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x58, 0x0a, 0x0d, 0x69, 0x6d, + 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, + 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, + 0x62, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x42, 0x06, + 0xe0, 0x41, 0x02, 0xe0, 0x41, 0x05, 0x52, 0x0c, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x65, + 0x74, 0x68, 0x6f, 0x64, 0x12, 0x57, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, - 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x2e, 0x49, - 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x65, 0x42, 0x03, 0xe0, - 0x41, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x54, 0x0a, 0x0a, 0x70, 0x75, 0x62, - 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, - 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x2e, 0x57, 0x72, - 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x42, - 0x03, 0xe0, 0x41, 0x03, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, - 0x53, 0x0a, 0x0b, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, - 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x4f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0b, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x25, 0x0a, 0x11, 0x57, 0x72, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, - 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x65, 0x6d, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x65, 0x6d, 0x22, 0xe5, 0x01, 0x0a, 0x0c, - 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x1d, 0x0a, 0x19, - 0x49, 0x4d, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x4d, 0x45, 0x54, 0x48, 0x4f, 0x44, 0x5f, 0x55, 0x4e, - 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x1a, 0x52, - 0x53, 0x41, 0x5f, 0x4f, 0x41, 0x45, 0x50, 0x5f, 0x33, 0x30, 0x37, 0x32, 0x5f, 0x53, 0x48, 0x41, - 0x31, 0x5f, 0x41, 0x45, 0x53, 0x5f, 0x32, 0x35, 0x36, 0x10, 0x01, 0x12, 0x1e, 0x0a, 0x1a, 0x52, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, + 0x65, 0x76, 0x65, 0x6c, 0x42, 0x06, 0xe0, 0x41, 0x02, 0xe0, 0x41, 0x05, 0x52, 0x0f, 0x70, 0x72, + 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x40, 0x0a, + 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, + 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, + 0x44, 0x0a, 0x0d, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0c, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x65, 0x78, 0x70, + 0x69, 0x72, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x4b, 0x0a, 0x11, 0x65, 0x78, 0x70, 0x69, 0x72, + 0x65, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, + 0xe0, 0x41, 0x03, 0x52, 0x0f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x54, 0x69, 0x6d, 0x65, 0x12, 0x48, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, + 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, + 0x4a, 0x6f, 0x62, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x54, + 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, + 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, + 0x6f, 0x62, 0x2e, 0x57, 0x72, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x50, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x4b, 0x65, 0x79, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x4b, 0x65, 0x79, 0x12, 0x53, 0x0a, 0x0b, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, + 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0b, 0x61, 0x74, + 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x0a, 0x12, 0x63, 0x72, 0x79, + 0x70, 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x18, + 0x0b, 0x20, 0x01, 0x28, 0x09, 0x42, 0x09, 0xe0, 0x41, 0x05, 0xfa, 0x41, 0x03, 0x0a, 0x01, 0x2a, + 0x52, 0x10, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x42, 0x61, 0x63, 0x6b, 0x65, + 0x6e, 0x64, 0x1a, 0x25, 0x0a, 0x11, 0x57, 0x72, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x50, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x65, 0x6d, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x65, 0x6d, 0x22, 0xe5, 0x01, 0x0a, 0x0c, 0x49, 0x6d, + 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x1d, 0x0a, 0x19, 0x49, 0x4d, + 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x4d, 0x45, 0x54, 0x48, 0x4f, 0x44, 0x5f, 0x55, 0x4e, 0x53, 0x50, + 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x1a, 0x52, 0x53, 0x41, + 0x5f, 0x4f, 0x41, 0x45, 0x50, 0x5f, 0x33, 0x30, 0x37, 0x32, 0x5f, 0x53, 0x48, 0x41, 0x31, 0x5f, + 0x41, 0x45, 0x53, 0x5f, 0x32, 0x35, 0x36, 0x10, 0x01, 0x12, 0x1e, 0x0a, 0x1a, 0x52, 0x53, 0x41, + 0x5f, 0x4f, 0x41, 0x45, 0x50, 0x5f, 0x34, 0x30, 0x39, 0x36, 0x5f, 0x53, 0x48, 0x41, 0x31, 0x5f, + 0x41, 0x45, 0x53, 0x5f, 0x32, 0x35, 0x36, 0x10, 0x02, 0x12, 0x20, 0x0a, 0x1c, 0x52, 0x53, 0x41, + 0x5f, 0x4f, 0x41, 0x45, 0x50, 0x5f, 0x33, 0x30, 0x37, 0x32, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, + 0x36, 0x5f, 0x41, 0x45, 0x53, 0x5f, 0x32, 0x35, 0x36, 0x10, 0x03, 0x12, 0x20, 0x0a, 0x1c, 0x52, 0x53, 0x41, 0x5f, 0x4f, 0x41, 0x45, 0x50, 0x5f, 0x34, 0x30, 0x39, 0x36, 0x5f, 0x53, 0x48, 0x41, - 0x31, 0x5f, 0x41, 0x45, 0x53, 0x5f, 0x32, 0x35, 0x36, 0x10, 0x02, 0x12, 0x20, 0x0a, 0x1c, 0x52, - 0x53, 0x41, 0x5f, 0x4f, 0x41, 0x45, 0x50, 0x5f, 0x33, 0x30, 0x37, 0x32, 0x5f, 0x53, 0x48, 0x41, - 0x32, 0x35, 0x36, 0x5f, 0x41, 0x45, 0x53, 0x5f, 0x32, 0x35, 0x36, 0x10, 0x03, 0x12, 0x20, 0x0a, - 0x1c, 0x52, 0x53, 0x41, 0x5f, 0x4f, 0x41, 0x45, 0x50, 0x5f, 0x34, 0x30, 0x39, 0x36, 0x5f, 0x53, - 0x48, 0x41, 0x32, 0x35, 0x36, 0x5f, 0x41, 0x45, 0x53, 0x5f, 0x32, 0x35, 0x36, 0x10, 0x04, 0x12, - 0x18, 0x0a, 0x14, 0x52, 0x53, 0x41, 0x5f, 0x4f, 0x41, 0x45, 0x50, 0x5f, 0x33, 0x30, 0x37, 0x32, - 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x05, 0x12, 0x18, 0x0a, 0x14, 0x52, 0x53, 0x41, - 0x5f, 0x4f, 0x41, 0x45, 0x50, 0x5f, 0x34, 0x30, 0x39, 0x36, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, - 0x36, 0x10, 0x06, 0x22, 0x63, 0x0a, 0x0e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x20, 0x0a, 0x1c, 0x49, 0x4d, 0x50, 0x4f, 0x52, 0x54, 0x5f, - 0x4a, 0x4f, 0x42, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, - 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x50, 0x45, 0x4e, 0x44, 0x49, - 0x4e, 0x47, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x12, - 0x0a, 0x0a, 0x06, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x45, - 0x58, 0x50, 0x49, 0x52, 0x45, 0x44, 0x10, 0x03, 0x3a, 0x7b, 0xea, 0x41, 0x78, 0x0a, 0x21, 0x63, - 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, - 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, - 0x12, 0x53, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, - 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, - 0x67, 0x73, 0x2f, 0x7b, 0x6b, 0x65, 0x79, 0x5f, 0x72, 0x69, 0x6e, 0x67, 0x7d, 0x2f, 0x69, 0x6d, - 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x73, 0x2f, 0x7b, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, - 0x5f, 0x6a, 0x6f, 0x62, 0x7d, 0x22, 0x81, 0x01, 0x0a, 0x1e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, - 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x28, 0x0a, 0x10, 0x65, 0x78, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x75, 0x72, 0x69, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0e, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x4b, 0x65, 0x79, 0x55, - 0x72, 0x69, 0x12, 0x35, 0x0a, 0x17, 0x65, 0x6b, 0x6d, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x14, 0x65, 0x6b, 0x6d, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x74, 0x68, 0x22, 0x78, 0x0a, 0x1d, 0x4b, 0x65, 0x79, - 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x57, 0x0a, 0x16, 0x61, 0x6c, - 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x72, 0x65, 0x61, - 0x73, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, - 0x2e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x52, 0x14, 0x61, - 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x61, 0x73, - 0x6f, 0x6e, 0x73, 0x2a, 0x6a, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x20, 0x0a, 0x1c, 0x50, 0x52, 0x4f, 0x54, 0x45, 0x43, - 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, - 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x4f, 0x46, 0x54, - 0x57, 0x41, 0x52, 0x45, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x48, 0x53, 0x4d, 0x10, 0x02, 0x12, - 0x0c, 0x0a, 0x08, 0x45, 0x58, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x10, 0x03, 0x12, 0x10, 0x0a, - 0x0c, 0x45, 0x58, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x5f, 0x56, 0x50, 0x43, 0x10, 0x04, 0x2a, - 0xab, 0x03, 0x0a, 0x0c, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, - 0x12, 0x16, 0x0a, 0x12, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, - 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x1a, 0x43, 0x55, 0x53, 0x54, - 0x4f, 0x4d, 0x45, 0x52, 0x5f, 0x49, 0x4e, 0x49, 0x54, 0x49, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x53, - 0x55, 0x50, 0x50, 0x4f, 0x52, 0x54, 0x10, 0x01, 0x12, 0x1c, 0x0a, 0x18, 0x47, 0x4f, 0x4f, 0x47, - 0x4c, 0x45, 0x5f, 0x49, 0x4e, 0x49, 0x54, 0x49, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x53, 0x45, 0x52, - 0x56, 0x49, 0x43, 0x45, 0x10, 0x02, 0x12, 0x1c, 0x0a, 0x18, 0x54, 0x48, 0x49, 0x52, 0x44, 0x5f, - 0x50, 0x41, 0x52, 0x54, 0x59, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x45, - 0x53, 0x54, 0x10, 0x03, 0x12, 0x1b, 0x0a, 0x17, 0x47, 0x4f, 0x4f, 0x47, 0x4c, 0x45, 0x5f, 0x49, - 0x4e, 0x49, 0x54, 0x49, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x52, 0x45, 0x56, 0x49, 0x45, 0x57, 0x10, - 0x04, 0x12, 0x1d, 0x0a, 0x19, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x45, 0x52, 0x5f, 0x49, 0x4e, - 0x49, 0x54, 0x49, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x05, - 0x12, 0x25, 0x0a, 0x21, 0x47, 0x4f, 0x4f, 0x47, 0x4c, 0x45, 0x5f, 0x49, 0x4e, 0x49, 0x54, 0x49, - 0x41, 0x54, 0x45, 0x44, 0x5f, 0x53, 0x59, 0x53, 0x54, 0x45, 0x4d, 0x5f, 0x4f, 0x50, 0x45, 0x52, - 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x06, 0x12, 0x17, 0x0a, 0x13, 0x52, 0x45, 0x41, 0x53, 0x4f, - 0x4e, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x45, 0x58, 0x50, 0x45, 0x43, 0x54, 0x45, 0x44, 0x10, 0x07, - 0x12, 0x26, 0x0a, 0x22, 0x4d, 0x4f, 0x44, 0x49, 0x46, 0x49, 0x45, 0x44, 0x5f, 0x43, 0x55, 0x53, - 0x54, 0x4f, 0x4d, 0x45, 0x52, 0x5f, 0x49, 0x4e, 0x49, 0x54, 0x49, 0x41, 0x54, 0x45, 0x44, 0x5f, - 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x08, 0x12, 0x2e, 0x0a, 0x2a, 0x4d, 0x4f, 0x44, 0x49, - 0x46, 0x49, 0x45, 0x44, 0x5f, 0x47, 0x4f, 0x4f, 0x47, 0x4c, 0x45, 0x5f, 0x49, 0x4e, 0x49, 0x54, - 0x49, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x53, 0x59, 0x53, 0x54, 0x45, 0x4d, 0x5f, 0x4f, 0x50, 0x45, - 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x09, 0x12, 0x27, 0x0a, 0x23, 0x47, 0x4f, 0x4f, 0x47, - 0x4c, 0x45, 0x5f, 0x52, 0x45, 0x53, 0x50, 0x4f, 0x4e, 0x53, 0x45, 0x5f, 0x54, 0x4f, 0x5f, 0x50, - 0x52, 0x4f, 0x44, 0x55, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x41, 0x4c, 0x45, 0x52, 0x54, 0x10, - 0x0a, 0x12, 0x2a, 0x0a, 0x26, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x45, 0x52, 0x5f, 0x41, 0x55, - 0x54, 0x48, 0x4f, 0x52, 0x49, 0x5a, 0x45, 0x44, 0x5f, 0x57, 0x4f, 0x52, 0x4b, 0x46, 0x4c, 0x4f, - 0x57, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x49, 0x4e, 0x47, 0x10, 0x0b, 0x42, 0x85, 0x01, - 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, - 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x11, 0x4b, 0x6d, 0x73, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x29, - 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x67, 0x6f, 0x2f, 0x6b, 0x6d, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x31, 0x2f, 0x6b, 0x6d, - 0x73, 0x70, 0x62, 0x3b, 0x6b, 0x6d, 0x73, 0x70, 0x62, 0xaa, 0x02, 0x13, 0x47, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x4b, 0x6d, 0x73, 0x2e, 0x56, 0x31, 0xca, - 0x02, 0x13, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5c, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x5c, 0x4b, - 0x6d, 0x73, 0x5c, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x32, 0x35, 0x36, 0x5f, 0x41, 0x45, 0x53, 0x5f, 0x32, 0x35, 0x36, 0x10, 0x04, 0x12, 0x18, 0x0a, + 0x14, 0x52, 0x53, 0x41, 0x5f, 0x4f, 0x41, 0x45, 0x50, 0x5f, 0x33, 0x30, 0x37, 0x32, 0x5f, 0x53, + 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x05, 0x12, 0x18, 0x0a, 0x14, 0x52, 0x53, 0x41, 0x5f, 0x4f, + 0x41, 0x45, 0x50, 0x5f, 0x34, 0x30, 0x39, 0x36, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, + 0x06, 0x22, 0x63, 0x0a, 0x0e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x12, 0x20, 0x0a, 0x1c, 0x49, 0x4d, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x4a, 0x4f, + 0x42, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, + 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, + 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x0a, 0x0a, + 0x06, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x45, 0x58, 0x50, + 0x49, 0x52, 0x45, 0x44, 0x10, 0x03, 0x3a, 0x7b, 0xea, 0x41, 0x78, 0x0a, 0x21, 0x63, 0x6c, 0x6f, + 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x12, 0x53, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x7d, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x6c, 0x6f, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, + 0x2f, 0x7b, 0x6b, 0x65, 0x79, 0x5f, 0x72, 0x69, 0x6e, 0x67, 0x7d, 0x2f, 0x69, 0x6d, 0x70, 0x6f, + 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x73, 0x2f, 0x7b, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x6a, + 0x6f, 0x62, 0x7d, 0x22, 0x81, 0x01, 0x0a, 0x1e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x28, 0x0a, 0x10, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, + 0x61, 0x6c, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x75, 0x72, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0e, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x4b, 0x65, 0x79, 0x55, 0x72, 0x69, + 0x12, 0x35, 0x0a, 0x17, 0x65, 0x6b, 0x6d, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x14, 0x65, 0x6b, 0x6d, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x4b, 0x65, 0x79, 0x50, 0x61, 0x74, 0x68, 0x22, 0x78, 0x0a, 0x1d, 0x4b, 0x65, 0x79, 0x41, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x4a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x57, 0x0a, 0x16, 0x61, 0x6c, 0x6c, 0x6f, + 0x77, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, + 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x52, 0x14, 0x61, 0x6c, 0x6c, + 0x6f, 0x77, 0x65, 0x64, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, + 0x73, 0x2a, 0x81, 0x01, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x20, 0x0a, 0x1c, 0x50, 0x52, 0x4f, 0x54, 0x45, 0x43, 0x54, + 0x49, 0x4f, 0x4e, 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, + 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x4f, 0x46, 0x54, 0x57, + 0x41, 0x52, 0x45, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x48, 0x53, 0x4d, 0x10, 0x02, 0x12, 0x0c, + 0x0a, 0x08, 0x45, 0x58, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x10, 0x03, 0x12, 0x10, 0x0a, 0x0c, + 0x45, 0x58, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x5f, 0x56, 0x50, 0x43, 0x10, 0x04, 0x12, 0x15, + 0x0a, 0x11, 0x48, 0x53, 0x4d, 0x5f, 0x53, 0x49, 0x4e, 0x47, 0x4c, 0x45, 0x5f, 0x54, 0x45, 0x4e, + 0x41, 0x4e, 0x54, 0x10, 0x05, 0x2a, 0xb3, 0x03, 0x0a, 0x0c, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, + 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x12, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, + 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1e, + 0x0a, 0x1a, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x45, 0x52, 0x5f, 0x49, 0x4e, 0x49, 0x54, 0x49, + 0x41, 0x54, 0x45, 0x44, 0x5f, 0x53, 0x55, 0x50, 0x50, 0x4f, 0x52, 0x54, 0x10, 0x01, 0x12, 0x1c, + 0x0a, 0x18, 0x47, 0x4f, 0x4f, 0x47, 0x4c, 0x45, 0x5f, 0x49, 0x4e, 0x49, 0x54, 0x49, 0x41, 0x54, + 0x45, 0x44, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x10, 0x02, 0x12, 0x1c, 0x0a, 0x18, + 0x54, 0x48, 0x49, 0x52, 0x44, 0x5f, 0x50, 0x41, 0x52, 0x54, 0x59, 0x5f, 0x44, 0x41, 0x54, 0x41, + 0x5f, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x10, 0x03, 0x12, 0x1b, 0x0a, 0x17, 0x47, 0x4f, + 0x4f, 0x47, 0x4c, 0x45, 0x5f, 0x49, 0x4e, 0x49, 0x54, 0x49, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x52, + 0x45, 0x56, 0x49, 0x45, 0x57, 0x10, 0x04, 0x12, 0x1d, 0x0a, 0x19, 0x43, 0x55, 0x53, 0x54, 0x4f, + 0x4d, 0x45, 0x52, 0x5f, 0x49, 0x4e, 0x49, 0x54, 0x49, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x41, 0x43, + 0x43, 0x45, 0x53, 0x53, 0x10, 0x05, 0x12, 0x25, 0x0a, 0x21, 0x47, 0x4f, 0x4f, 0x47, 0x4c, 0x45, + 0x5f, 0x49, 0x4e, 0x49, 0x54, 0x49, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x53, 0x59, 0x53, 0x54, 0x45, + 0x4d, 0x5f, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x06, 0x12, 0x17, 0x0a, + 0x13, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x45, 0x58, 0x50, 0x45, + 0x43, 0x54, 0x45, 0x44, 0x10, 0x07, 0x12, 0x2a, 0x0a, 0x22, 0x4d, 0x4f, 0x44, 0x49, 0x46, 0x49, + 0x45, 0x44, 0x5f, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x45, 0x52, 0x5f, 0x49, 0x4e, 0x49, 0x54, + 0x49, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x08, 0x1a, 0x02, + 0x08, 0x01, 0x12, 0x32, 0x0a, 0x2a, 0x4d, 0x4f, 0x44, 0x49, 0x46, 0x49, 0x45, 0x44, 0x5f, 0x47, + 0x4f, 0x4f, 0x47, 0x4c, 0x45, 0x5f, 0x49, 0x4e, 0x49, 0x54, 0x49, 0x41, 0x54, 0x45, 0x44, 0x5f, + 0x53, 0x59, 0x53, 0x54, 0x45, 0x4d, 0x5f, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, + 0x10, 0x09, 0x1a, 0x02, 0x08, 0x01, 0x12, 0x27, 0x0a, 0x23, 0x47, 0x4f, 0x4f, 0x47, 0x4c, 0x45, + 0x5f, 0x52, 0x45, 0x53, 0x50, 0x4f, 0x4e, 0x53, 0x45, 0x5f, 0x54, 0x4f, 0x5f, 0x50, 0x52, 0x4f, + 0x44, 0x55, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x41, 0x4c, 0x45, 0x52, 0x54, 0x10, 0x0a, 0x12, + 0x2a, 0x0a, 0x26, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x45, 0x52, 0x5f, 0x41, 0x55, 0x54, 0x48, + 0x4f, 0x52, 0x49, 0x5a, 0x45, 0x44, 0x5f, 0x57, 0x4f, 0x52, 0x4b, 0x46, 0x4c, 0x4f, 0x57, 0x5f, + 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x49, 0x4e, 0x47, 0x10, 0x0b, 0x42, 0x85, 0x01, 0x0a, 0x17, + 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, + 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x11, 0x4b, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x29, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, + 0x6f, 0x2f, 0x6b, 0x6d, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x31, 0x2f, 0x6b, 0x6d, 0x73, 0x70, + 0x62, 0x3b, 0x6b, 0x6d, 0x73, 0x70, 0x62, 0xaa, 0x02, 0x13, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x4b, 0x6d, 0x73, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x13, + 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5c, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x5c, 0x4b, 0x6d, 0x73, + 0x5c, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/vendor/cloud.google.com/go/kms/apiv1/kmspb/service.pb.go b/vendor/cloud.google.com/go/kms/apiv1/kmspb/service.pb.go index 0f8a7a94f0f..bfdc116e48e 100644 --- a/vendor/cloud.google.com/go/kms/apiv1/kmspb/service.pb.go +++ b/vendor/cloud.google.com/go/kms/apiv1/kmspb/service.pb.go @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,17 +21,14 @@ package kmspb import ( - context "context" + reflect "reflect" + sync "sync" + _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" - reflect "reflect" - sync "sync" ) const ( @@ -2787,6 +2784,94 @@ func (x *MacVerifyRequest) GetMacCrc32C() *wrapperspb.Int64Value { return nil } +// Request message for +// [KeyManagementService.Decapsulate][google.cloud.kms.v1.KeyManagementService.Decapsulate]. +type DecapsulateRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. The resource name of the + // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + // decapsulation. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Required. The ciphertext produced from encapsulation with the + // named [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public + // key(s). + Ciphertext []byte `protobuf:"bytes,2,opt,name=ciphertext,proto3" json:"ciphertext,omitempty"` + // Optional. A CRC32C checksum of the + // [DecapsulateRequest.ciphertext][google.cloud.kms.v1.DecapsulateRequest.ciphertext]. + // If specified, + // [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + // verify the integrity of the received + // [DecapsulateRequest.ciphertext][google.cloud.kms.v1.DecapsulateRequest.ciphertext] + // using this checksum. + // [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will + // report an error if the checksum verification fails. If you receive a + // checksum error, your client should verify that + // CRC32C([DecapsulateRequest.ciphertext][google.cloud.kms.v1.DecapsulateRequest.ciphertext]) + // is equal to + // [DecapsulateRequest.ciphertext_crc32c][google.cloud.kms.v1.DecapsulateRequest.ciphertext_crc32c], + // and if so, perform a limited number of retries. A persistent mismatch may + // indicate an issue in your computation of the CRC32C checksum. Note: This + // field is defined as int64 for reasons of compatibility across different + // languages. However, it is a non-negative integer, which will never exceed + // 2^32-1, and can be safely downconverted to uint32 in languages that support + // this type. + CiphertextCrc32C *wrapperspb.Int64Value `protobuf:"bytes,3,opt,name=ciphertext_crc32c,json=ciphertextCrc32c,proto3" json:"ciphertext_crc32c,omitempty"` +} + +func (x *DecapsulateRequest) Reset() { + *x = DecapsulateRequest{} + mi := &file_google_cloud_kms_v1_service_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DecapsulateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DecapsulateRequest) ProtoMessage() {} + +func (x *DecapsulateRequest) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_kms_v1_service_proto_msgTypes[31] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DecapsulateRequest.ProtoReflect.Descriptor instead. +func (*DecapsulateRequest) Descriptor() ([]byte, []int) { + return file_google_cloud_kms_v1_service_proto_rawDescGZIP(), []int{31} +} + +func (x *DecapsulateRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *DecapsulateRequest) GetCiphertext() []byte { + if x != nil { + return x.Ciphertext + } + return nil +} + +func (x *DecapsulateRequest) GetCiphertextCrc32C() *wrapperspb.Int64Value { + if x != nil { + return x.CiphertextCrc32C + } + return nil +} + // Request message for // [KeyManagementService.GenerateRandomBytes][google.cloud.kms.v1.KeyManagementService.GenerateRandomBytes]. type GenerateRandomBytesRequest struct { @@ -2809,7 +2894,7 @@ type GenerateRandomBytesRequest struct { func (x *GenerateRandomBytesRequest) Reset() { *x = GenerateRandomBytesRequest{} - mi := &file_google_cloud_kms_v1_service_proto_msgTypes[31] + mi := &file_google_cloud_kms_v1_service_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2821,7 +2906,7 @@ func (x *GenerateRandomBytesRequest) String() string { func (*GenerateRandomBytesRequest) ProtoMessage() {} func (x *GenerateRandomBytesRequest) ProtoReflect() protoreflect.Message { - mi := &file_google_cloud_kms_v1_service_proto_msgTypes[31] + mi := &file_google_cloud_kms_v1_service_proto_msgTypes[32] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2834,7 +2919,7 @@ func (x *GenerateRandomBytesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GenerateRandomBytesRequest.ProtoReflect.Descriptor instead. func (*GenerateRandomBytesRequest) Descriptor() ([]byte, []int) { - return file_google_cloud_kms_v1_service_proto_rawDescGZIP(), []int{31} + return file_google_cloud_kms_v1_service_proto_rawDescGZIP(), []int{32} } func (x *GenerateRandomBytesRequest) GetLocation() string { @@ -2924,7 +3009,7 @@ type EncryptResponse struct { func (x *EncryptResponse) Reset() { *x = EncryptResponse{} - mi := &file_google_cloud_kms_v1_service_proto_msgTypes[32] + mi := &file_google_cloud_kms_v1_service_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2936,7 +3021,7 @@ func (x *EncryptResponse) String() string { func (*EncryptResponse) ProtoMessage() {} func (x *EncryptResponse) ProtoReflect() protoreflect.Message { - mi := &file_google_cloud_kms_v1_service_proto_msgTypes[32] + mi := &file_google_cloud_kms_v1_service_proto_msgTypes[33] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2949,7 +3034,7 @@ func (x *EncryptResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use EncryptResponse.ProtoReflect.Descriptor instead. func (*EncryptResponse) Descriptor() ([]byte, []int) { - return file_google_cloud_kms_v1_service_proto_rawDescGZIP(), []int{32} + return file_google_cloud_kms_v1_service_proto_rawDescGZIP(), []int{33} } func (x *EncryptResponse) GetName() string { @@ -3032,7 +3117,7 @@ type DecryptResponse struct { func (x *DecryptResponse) Reset() { *x = DecryptResponse{} - mi := &file_google_cloud_kms_v1_service_proto_msgTypes[33] + mi := &file_google_cloud_kms_v1_service_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3044,7 +3129,7 @@ func (x *DecryptResponse) String() string { func (*DecryptResponse) ProtoMessage() {} func (x *DecryptResponse) ProtoReflect() protoreflect.Message { - mi := &file_google_cloud_kms_v1_service_proto_msgTypes[33] + mi := &file_google_cloud_kms_v1_service_proto_msgTypes[34] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3057,7 +3142,7 @@ func (x *DecryptResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DecryptResponse.ProtoReflect.Descriptor instead. func (*DecryptResponse) Descriptor() ([]byte, []int) { - return file_google_cloud_kms_v1_service_proto_rawDescGZIP(), []int{33} + return file_google_cloud_kms_v1_service_proto_rawDescGZIP(), []int{34} } func (x *DecryptResponse) GetPlaintext() []byte { @@ -3184,7 +3269,7 @@ type RawEncryptResponse struct { func (x *RawEncryptResponse) Reset() { *x = RawEncryptResponse{} - mi := &file_google_cloud_kms_v1_service_proto_msgTypes[34] + mi := &file_google_cloud_kms_v1_service_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3196,7 +3281,7 @@ func (x *RawEncryptResponse) String() string { func (*RawEncryptResponse) ProtoMessage() {} func (x *RawEncryptResponse) ProtoReflect() protoreflect.Message { - mi := &file_google_cloud_kms_v1_service_proto_msgTypes[34] + mi := &file_google_cloud_kms_v1_service_proto_msgTypes[35] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3209,7 +3294,7 @@ func (x *RawEncryptResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RawEncryptResponse.ProtoReflect.Descriptor instead. func (*RawEncryptResponse) Descriptor() ([]byte, []int) { - return file_google_cloud_kms_v1_service_proto_rawDescGZIP(), []int{34} + return file_google_cloud_kms_v1_service_proto_rawDescGZIP(), []int{35} } func (x *RawEncryptResponse) GetCiphertext() []byte { @@ -3357,7 +3442,7 @@ type RawDecryptResponse struct { func (x *RawDecryptResponse) Reset() { *x = RawDecryptResponse{} - mi := &file_google_cloud_kms_v1_service_proto_msgTypes[35] + mi := &file_google_cloud_kms_v1_service_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3369,7 +3454,7 @@ func (x *RawDecryptResponse) String() string { func (*RawDecryptResponse) ProtoMessage() {} func (x *RawDecryptResponse) ProtoReflect() protoreflect.Message { - mi := &file_google_cloud_kms_v1_service_proto_msgTypes[35] + mi := &file_google_cloud_kms_v1_service_proto_msgTypes[36] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3382,7 +3467,7 @@ func (x *RawDecryptResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RawDecryptResponse.ProtoReflect.Descriptor instead. func (*RawDecryptResponse) Descriptor() ([]byte, []int) { - return file_google_cloud_kms_v1_service_proto_rawDescGZIP(), []int{35} + return file_google_cloud_kms_v1_service_proto_rawDescGZIP(), []int{36} } func (x *RawDecryptResponse) GetPlaintext() []byte { @@ -3491,7 +3576,7 @@ type AsymmetricSignResponse struct { func (x *AsymmetricSignResponse) Reset() { *x = AsymmetricSignResponse{} - mi := &file_google_cloud_kms_v1_service_proto_msgTypes[36] + mi := &file_google_cloud_kms_v1_service_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3503,7 +3588,7 @@ func (x *AsymmetricSignResponse) String() string { func (*AsymmetricSignResponse) ProtoMessage() {} func (x *AsymmetricSignResponse) ProtoReflect() protoreflect.Message { - mi := &file_google_cloud_kms_v1_service_proto_msgTypes[36] + mi := &file_google_cloud_kms_v1_service_proto_msgTypes[37] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3516,7 +3601,7 @@ func (x *AsymmetricSignResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use AsymmetricSignResponse.ProtoReflect.Descriptor instead. func (*AsymmetricSignResponse) Descriptor() ([]byte, []int) { - return file_google_cloud_kms_v1_service_proto_rawDescGZIP(), []int{36} + return file_google_cloud_kms_v1_service_proto_rawDescGZIP(), []int{37} } func (x *AsymmetricSignResponse) GetSignature() []byte { @@ -3607,7 +3692,7 @@ type AsymmetricDecryptResponse struct { func (x *AsymmetricDecryptResponse) Reset() { *x = AsymmetricDecryptResponse{} - mi := &file_google_cloud_kms_v1_service_proto_msgTypes[37] + mi := &file_google_cloud_kms_v1_service_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3619,7 +3704,7 @@ func (x *AsymmetricDecryptResponse) String() string { func (*AsymmetricDecryptResponse) ProtoMessage() {} func (x *AsymmetricDecryptResponse) ProtoReflect() protoreflect.Message { - mi := &file_google_cloud_kms_v1_service_proto_msgTypes[37] + mi := &file_google_cloud_kms_v1_service_proto_msgTypes[38] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3632,7 +3717,7 @@ func (x *AsymmetricDecryptResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use AsymmetricDecryptResponse.ProtoReflect.Descriptor instead. func (*AsymmetricDecryptResponse) Descriptor() ([]byte, []int) { - return file_google_cloud_kms_v1_service_proto_rawDescGZIP(), []int{37} + return file_google_cloud_kms_v1_service_proto_rawDescGZIP(), []int{38} } func (x *AsymmetricDecryptResponse) GetPlaintext() []byte { @@ -3712,7 +3797,7 @@ type MacSignResponse struct { func (x *MacSignResponse) Reset() { *x = MacSignResponse{} - mi := &file_google_cloud_kms_v1_service_proto_msgTypes[38] + mi := &file_google_cloud_kms_v1_service_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3724,7 +3809,7 @@ func (x *MacSignResponse) String() string { func (*MacSignResponse) ProtoMessage() {} func (x *MacSignResponse) ProtoReflect() protoreflect.Message { - mi := &file_google_cloud_kms_v1_service_proto_msgTypes[38] + mi := &file_google_cloud_kms_v1_service_proto_msgTypes[39] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3737,7 +3822,7 @@ func (x *MacSignResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use MacSignResponse.ProtoReflect.Descriptor instead. func (*MacSignResponse) Descriptor() ([]byte, []int) { - return file_google_cloud_kms_v1_service_proto_rawDescGZIP(), []int{38} + return file_google_cloud_kms_v1_service_proto_rawDescGZIP(), []int{39} } func (x *MacSignResponse) GetName() string { @@ -3835,7 +3920,7 @@ type MacVerifyResponse struct { func (x *MacVerifyResponse) Reset() { *x = MacVerifyResponse{} - mi := &file_google_cloud_kms_v1_service_proto_msgTypes[39] + mi := &file_google_cloud_kms_v1_service_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3847,7 +3932,7 @@ func (x *MacVerifyResponse) String() string { func (*MacVerifyResponse) ProtoMessage() {} func (x *MacVerifyResponse) ProtoReflect() protoreflect.Message { - mi := &file_google_cloud_kms_v1_service_proto_msgTypes[39] + mi := &file_google_cloud_kms_v1_service_proto_msgTypes[40] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3860,7 +3945,7 @@ func (x *MacVerifyResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use MacVerifyResponse.ProtoReflect.Descriptor instead. func (*MacVerifyResponse) Descriptor() ([]byte, []int) { - return file_google_cloud_kms_v1_service_proto_rawDescGZIP(), []int{39} + return file_google_cloud_kms_v1_service_proto_rawDescGZIP(), []int{40} } func (x *MacVerifyResponse) GetName() string { @@ -3905,6 +3990,125 @@ func (x *MacVerifyResponse) GetProtectionLevel() ProtectionLevel { return ProtectionLevel_PROTECTION_LEVEL_UNSPECIFIED } +// Response message for +// [KeyManagementService.Decapsulate][google.cloud.kms.v1.KeyManagementService.Decapsulate]. +type DecapsulateResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The resource name of the + // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for + // decapsulation. Check this field to verify that the intended resource was + // used for decapsulation. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // The decapsulated shared_secret originally encapsulated with the matching + // public key. + SharedSecret []byte `protobuf:"bytes,2,opt,name=shared_secret,json=sharedSecret,proto3" json:"shared_secret,omitempty"` + // Integrity verification field. A CRC32C checksum of the returned + // [DecapsulateResponse.shared_secret][google.cloud.kms.v1.DecapsulateResponse.shared_secret]. + // An integrity check of + // [DecapsulateResponse.shared_secret][google.cloud.kms.v1.DecapsulateResponse.shared_secret] + // can be performed by computing the CRC32C checksum of + // [DecapsulateResponse.shared_secret][google.cloud.kms.v1.DecapsulateResponse.shared_secret] + // and comparing your results to this field. Discard the response in case of + // non-matching checksum values, and perform a limited number of retries. A + // persistent mismatch may indicate an issue in your computation of the CRC32C + // checksum. Note: receiving this response message indicates that + // [KeyManagementService][google.cloud.kms.v1.KeyManagementService] is able to + // successfully decrypt the + // [ciphertext][google.cloud.kms.v1.DecapsulateRequest.ciphertext]. Note: This + // field is defined as int64 for reasons of compatibility across different + // languages. However, it is a non-negative integer, which will never exceed + // 2^32-1, and can be safely downconverted to uint32 in languages that support + // this type. + SharedSecretCrc32C *int64 `protobuf:"varint,3,opt,name=shared_secret_crc32c,json=sharedSecretCrc32c,proto3,oneof" json:"shared_secret_crc32c,omitempty"` + // Integrity verification field. A flag indicating whether + // [DecapsulateRequest.ciphertext_crc32c][google.cloud.kms.v1.DecapsulateRequest.ciphertext_crc32c] + // was received by + // [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used + // for the integrity verification of the + // [ciphertext][google.cloud.kms.v1.DecapsulateRequest.ciphertext]. A false + // value of this field indicates either that + // [DecapsulateRequest.ciphertext_crc32c][google.cloud.kms.v1.DecapsulateRequest.ciphertext_crc32c] + // was left unset or that it was not delivered to + // [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've + // set + // [DecapsulateRequest.ciphertext_crc32c][google.cloud.kms.v1.DecapsulateRequest.ciphertext_crc32c] + // but this field is still false, discard the response and perform a limited + // number of retries. + VerifiedCiphertextCrc32C bool `protobuf:"varint,4,opt,name=verified_ciphertext_crc32c,json=verifiedCiphertextCrc32c,proto3" json:"verified_ciphertext_crc32c,omitempty"` + // The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the + // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in + // decapsulation. + ProtectionLevel ProtectionLevel `protobuf:"varint,5,opt,name=protection_level,json=protectionLevel,proto3,enum=google.cloud.kms.v1.ProtectionLevel" json:"protection_level,omitempty"` +} + +func (x *DecapsulateResponse) Reset() { + *x = DecapsulateResponse{} + mi := &file_google_cloud_kms_v1_service_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DecapsulateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DecapsulateResponse) ProtoMessage() {} + +func (x *DecapsulateResponse) ProtoReflect() protoreflect.Message { + mi := &file_google_cloud_kms_v1_service_proto_msgTypes[41] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DecapsulateResponse.ProtoReflect.Descriptor instead. +func (*DecapsulateResponse) Descriptor() ([]byte, []int) { + return file_google_cloud_kms_v1_service_proto_rawDescGZIP(), []int{41} +} + +func (x *DecapsulateResponse) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *DecapsulateResponse) GetSharedSecret() []byte { + if x != nil { + return x.SharedSecret + } + return nil +} + +func (x *DecapsulateResponse) GetSharedSecretCrc32C() int64 { + if x != nil && x.SharedSecretCrc32C != nil { + return *x.SharedSecretCrc32C + } + return 0 +} + +func (x *DecapsulateResponse) GetVerifiedCiphertextCrc32C() bool { + if x != nil { + return x.VerifiedCiphertextCrc32C + } + return false +} + +func (x *DecapsulateResponse) GetProtectionLevel() ProtectionLevel { + if x != nil { + return x.ProtectionLevel + } + return ProtectionLevel_PROTECTION_LEVEL_UNSPECIFIED +} + // Response message for // [KeyManagementService.GenerateRandomBytes][google.cloud.kms.v1.KeyManagementService.GenerateRandomBytes]. type GenerateRandomBytesResponse struct { @@ -3932,7 +4136,7 @@ type GenerateRandomBytesResponse struct { func (x *GenerateRandomBytesResponse) Reset() { *x = GenerateRandomBytesResponse{} - mi := &file_google_cloud_kms_v1_service_proto_msgTypes[40] + mi := &file_google_cloud_kms_v1_service_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3944,7 +4148,7 @@ func (x *GenerateRandomBytesResponse) String() string { func (*GenerateRandomBytesResponse) ProtoMessage() {} func (x *GenerateRandomBytesResponse) ProtoReflect() protoreflect.Message { - mi := &file_google_cloud_kms_v1_service_proto_msgTypes[40] + mi := &file_google_cloud_kms_v1_service_proto_msgTypes[42] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3957,7 +4161,7 @@ func (x *GenerateRandomBytesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GenerateRandomBytesResponse.ProtoReflect.Descriptor instead. func (*GenerateRandomBytesResponse) Descriptor() ([]byte, []int) { - return file_google_cloud_kms_v1_service_proto_rawDescGZIP(), []int{40} + return file_google_cloud_kms_v1_service_proto_rawDescGZIP(), []int{42} } func (x *GenerateRandomBytesResponse) GetData() []byte { @@ -3992,7 +4196,7 @@ type Digest struct { func (x *Digest) Reset() { *x = Digest{} - mi := &file_google_cloud_kms_v1_service_proto_msgTypes[41] + mi := &file_google_cloud_kms_v1_service_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4004,7 +4208,7 @@ func (x *Digest) String() string { func (*Digest) ProtoMessage() {} func (x *Digest) ProtoReflect() protoreflect.Message { - mi := &file_google_cloud_kms_v1_service_proto_msgTypes[41] + mi := &file_google_cloud_kms_v1_service_proto_msgTypes[43] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4017,7 +4221,7 @@ func (x *Digest) ProtoReflect() protoreflect.Message { // Deprecated: Use Digest.ProtoReflect.Descriptor instead. func (*Digest) Descriptor() ([]byte, []int) { - return file_google_cloud_kms_v1_service_proto_rawDescGZIP(), []int{41} + return file_google_cloud_kms_v1_service_proto_rawDescGZIP(), []int{43} } func (m *Digest) GetDigest() isDigest_Digest { @@ -4090,11 +4294,16 @@ type LocationMetadata struct { // [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL] can be created in // this location. EkmAvailable bool `protobuf:"varint,2,opt,name=ekm_available,json=ekmAvailable,proto3" json:"ekm_available,omitempty"` + // Indicates whether [CryptoKeys][google.cloud.kms.v1.CryptoKey] with + // [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level] + // [HSM_SINGLE_TENANT][google.cloud.kms.v1.ProtectionLevel.HSM_SINGLE_TENANT] + // can be created in this location. + HsmSingleTenantAvailable bool `protobuf:"varint,3,opt,name=hsm_single_tenant_available,json=hsmSingleTenantAvailable,proto3" json:"hsm_single_tenant_available,omitempty"` } func (x *LocationMetadata) Reset() { *x = LocationMetadata{} - mi := &file_google_cloud_kms_v1_service_proto_msgTypes[42] + mi := &file_google_cloud_kms_v1_service_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4106,7 +4315,7 @@ func (x *LocationMetadata) String() string { func (*LocationMetadata) ProtoMessage() {} func (x *LocationMetadata) ProtoReflect() protoreflect.Message { - mi := &file_google_cloud_kms_v1_service_proto_msgTypes[42] + mi := &file_google_cloud_kms_v1_service_proto_msgTypes[44] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4119,7 +4328,7 @@ func (x *LocationMetadata) ProtoReflect() protoreflect.Message { // Deprecated: Use LocationMetadata.ProtoReflect.Descriptor instead. func (*LocationMetadata) Descriptor() ([]byte, []int) { - return file_google_cloud_kms_v1_service_proto_rawDescGZIP(), []int{42} + return file_google_cloud_kms_v1_service_proto_rawDescGZIP(), []int{44} } func (x *LocationMetadata) GetHsmAvailable() bool { @@ -4136,6 +4345,13 @@ func (x *LocationMetadata) GetEkmAvailable() bool { return false } +func (x *LocationMetadata) GetHsmSingleTenantAvailable() bool { + if x != nil { + return x.HsmSingleTenantAvailable + } + return false +} + var File_google_cloud_kms_v1_service_proto protoreflect.FileDescriptor var file_google_cloud_kms_v1_service_proto_rawDesc = []byte{ @@ -4598,147 +4814,55 @@ var file_google_cloud_kms_v1_service_proto_rawDesc = []byte{ 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x09, 0x6d, 0x61, 0x63, 0x43, 0x72, - 0x63, 0x33, 0x32, 0x63, 0x22, 0xac, 0x01, 0x0a, 0x1a, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x65, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x21, 0x0a, 0x0c, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x42, 0x79, 0x74, - 0x65, 0x73, 0x12, 0x4f, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, - 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, - 0x65, 0x6c, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, - 0x76, 0x65, 0x6c, 0x22, 0xfe, 0x02, 0x0a, 0x0f, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x63, - 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x0a, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x12, 0x48, 0x0a, 0x11, 0x63, - 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x52, 0x10, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x43, - 0x72, 0x63, 0x33, 0x32, 0x63, 0x12, 0x3a, 0x0a, 0x19, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, - 0x64, 0x5f, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x63, 0x72, 0x63, 0x33, - 0x32, 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, - 0x65, 0x64, 0x50, 0x6c, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x43, 0x72, 0x63, 0x33, 0x32, - 0x63, 0x12, 0x60, 0x0a, 0x2d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x61, 0x64, - 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, - 0x69, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x63, 0x72, 0x63, 0x33, - 0x32, 0x63, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x29, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, - 0x65, 0x64, 0x41, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x41, 0x75, 0x74, 0x68, - 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x43, 0x72, 0x63, - 0x33, 0x32, 0x63, 0x12, 0x4f, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, + 0x63, 0x33, 0x32, 0x63, 0x22, 0xce, 0x01, 0x0a, 0x12, 0x44, 0x65, 0x63, 0x61, 0x70, 0x73, 0x75, + 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x44, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x30, 0xe0, 0x41, 0x02, 0xfa, 0x41, + 0x2a, 0x0a, 0x28, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x72, 0x79, 0x70, 0x74, + 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x23, 0x0a, 0x0a, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0a, 0x63, 0x69, 0x70, 0x68, + 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x12, 0x4d, 0x0a, 0x11, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, + 0x74, 0x65, 0x78, 0x74, 0x5f, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x03, + 0xe0, 0x41, 0x01, 0x52, 0x10, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x43, + 0x72, 0x63, 0x33, 0x32, 0x63, 0x22, 0xac, 0x01, 0x0a, 0x1a, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, + 0x74, 0x65, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x21, 0x0a, 0x0c, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x42, 0x79, + 0x74, 0x65, 0x73, 0x12, 0x4f, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, - 0x65, 0x76, 0x65, 0x6c, 0x22, 0xeb, 0x01, 0x0a, 0x0f, 0x44, 0x65, 0x63, 0x72, 0x79, 0x70, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x6c, 0x61, 0x69, - 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x6c, 0x61, - 0x69, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x46, 0x0a, 0x10, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x74, - 0x65, 0x78, 0x74, 0x5f, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0f, 0x70, - 0x6c, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x43, 0x72, 0x63, 0x33, 0x32, 0x63, 0x12, 0x21, - 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x75, 0x73, 0x65, 0x64, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, - 0x79, 0x12, 0x4f, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, - 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, - 0x6c, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, - 0x65, 0x6c, 0x22, 0x87, 0x05, 0x0a, 0x12, 0x52, 0x61, 0x77, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x69, 0x70, - 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x63, - 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x12, 0x33, 0x0a, 0x15, 0x69, 0x6e, 0x69, - 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x76, 0x65, 0x63, 0x74, - 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x14, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, - 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x1d, - 0x0a, 0x0a, 0x74, 0x61, 0x67, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x09, 0x74, 0x61, 0x67, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x48, 0x0a, - 0x11, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x63, 0x72, 0x63, 0x33, - 0x32, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x10, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, - 0x74, 0x43, 0x72, 0x63, 0x33, 0x32, 0x63, 0x12, 0x5d, 0x0a, 0x1c, 0x69, 0x6e, 0x69, 0x74, 0x69, - 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, - 0x5f, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x1a, 0x69, 0x6e, 0x69, 0x74, - 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, + 0x65, 0x76, 0x65, 0x6c, 0x22, 0xfe, 0x02, 0x0a, 0x0f, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, + 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x0a, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x12, 0x48, 0x0a, 0x11, + 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x63, 0x72, 0x63, 0x33, 0x32, + 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x10, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x43, 0x72, 0x63, 0x33, 0x32, 0x63, 0x12, 0x3a, 0x0a, 0x19, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x63, 0x72, 0x63, - 0x33, 0x32, 0x63, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, 0x76, 0x65, 0x72, 0x69, 0x66, + 0x33, 0x32, 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x50, 0x6c, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x43, 0x72, 0x63, 0x33, 0x32, 0x63, 0x12, 0x60, 0x0a, 0x2d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x63, 0x72, 0x63, - 0x33, 0x32, 0x63, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x29, 0x76, 0x65, 0x72, 0x69, 0x66, + 0x33, 0x32, 0x63, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x29, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x41, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x43, 0x72, - 0x63, 0x33, 0x32, 0x63, 0x12, 0x51, 0x0a, 0x25, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, - 0x5f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x18, 0x0a, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x22, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x49, 0x6e, 0x69, - 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x65, 0x63, 0x74, 0x6f, - 0x72, 0x43, 0x72, 0x63, 0x33, 0x32, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x4f, 0x0a, 0x10, 0x70, - 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, - 0x09, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, - 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x74, - 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x0f, 0x70, 0x72, 0x6f, - 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0xbe, 0x03, 0x0a, - 0x12, 0x52, 0x61, 0x77, 0x44, 0x65, 0x63, 0x72, 0x79, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x78, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x78, - 0x74, 0x12, 0x46, 0x0a, 0x10, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x63, - 0x72, 0x63, 0x33, 0x32, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, - 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0f, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x74, - 0x65, 0x78, 0x74, 0x43, 0x72, 0x63, 0x33, 0x32, 0x63, 0x12, 0x4f, 0x0a, 0x10, 0x70, 0x72, 0x6f, - 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, - 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x74, 0x65, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x3c, 0x0a, 0x1a, 0x76, 0x65, - 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, - 0x74, 0x5f, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x18, - 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x43, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, - 0x78, 0x74, 0x43, 0x72, 0x63, 0x33, 0x32, 0x63, 0x12, 0x60, 0x0a, 0x2d, 0x76, 0x65, 0x72, 0x69, - 0x66, 0x69, 0x65, 0x64, 0x5f, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, - 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x64, 0x61, - 0x74, 0x61, 0x5f, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x29, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x41, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, - 0x6e, 0x61, 0x6c, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x64, - 0x44, 0x61, 0x74, 0x61, 0x43, 0x72, 0x63, 0x33, 0x32, 0x63, 0x12, 0x51, 0x0a, 0x25, 0x76, 0x65, - 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x63, 0x72, 0x63, - 0x33, 0x32, 0x63, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x22, 0x76, 0x65, 0x72, 0x69, 0x66, - 0x69, 0x65, 0x64, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x43, 0x72, 0x63, 0x33, 0x32, 0x63, 0x22, 0xcb, 0x02, - 0x0a, 0x16, 0x41, 0x73, 0x79, 0x6d, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x53, 0x69, 0x67, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x46, 0x0a, 0x10, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x5f, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0f, 0x73, - 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x43, 0x72, 0x63, 0x33, 0x32, 0x63, 0x12, 0x34, - 0x0a, 0x16, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, - 0x74, 0x5f, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, - 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x43, 0x72, - 0x63, 0x33, 0x32, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x30, 0x0a, 0x14, 0x76, 0x65, 0x72, 0x69, - 0x66, 0x69, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, - 0x44, 0x61, 0x74, 0x61, 0x43, 0x72, 0x63, 0x33, 0x32, 0x63, 0x12, 0x4f, 0x0a, 0x10, 0x70, 0x72, - 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, - 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x65, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x74, - 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0x90, 0x02, 0x0a, 0x19, - 0x41, 0x73, 0x79, 0x6d, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x44, 0x65, 0x63, 0x72, 0x79, 0x70, + 0x63, 0x33, 0x32, 0x63, 0x12, 0x4f, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, + 0x65, 0x76, 0x65, 0x6c, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0xeb, 0x01, 0x0a, 0x0f, 0x44, 0x65, 0x63, 0x72, 0x79, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x46, 0x0a, 0x10, 0x70, 0x6c, 0x61, 0x69, 0x6e, @@ -4746,304 +4870,418 @@ var file_google_cloud_kms_v1_service_proto_rawDesc = []byte{ 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0f, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x43, 0x72, 0x63, 0x33, 0x32, 0x63, 0x12, - 0x3c, 0x0a, 0x1a, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x63, 0x69, 0x70, 0x68, - 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x18, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x43, 0x69, 0x70, - 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x43, 0x72, 0x63, 0x33, 0x32, 0x63, 0x12, 0x4f, 0x0a, - 0x10, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x65, 0x76, 0x65, - 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, - 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x0f, 0x70, - 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0xf6, - 0x01, 0x0a, 0x0f, 0x4d, 0x61, 0x63, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x61, 0x63, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6d, 0x61, 0x63, 0x12, 0x3a, 0x0a, 0x0a, 0x6d, 0x61, 0x63, 0x5f, - 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, - 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x09, 0x6d, 0x61, 0x63, 0x43, 0x72, - 0x63, 0x33, 0x32, 0x63, 0x12, 0x30, 0x0a, 0x14, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, - 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x12, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, - 0x43, 0x72, 0x63, 0x33, 0x32, 0x63, 0x12, 0x4f, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, - 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0xb2, 0x02, 0x0a, 0x11, 0x4d, 0x61, 0x63, 0x56, - 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x76, - 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x63, 0x72, 0x63, - 0x33, 0x32, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x76, 0x65, 0x72, 0x69, 0x66, - 0x69, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x43, 0x72, 0x63, 0x33, 0x32, 0x63, 0x12, 0x2e, 0x0a, - 0x13, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x6d, 0x61, 0x63, 0x5f, 0x63, 0x72, - 0x63, 0x33, 0x32, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x76, 0x65, 0x72, 0x69, - 0x66, 0x69, 0x65, 0x64, 0x4d, 0x61, 0x63, 0x43, 0x72, 0x63, 0x33, 0x32, 0x63, 0x12, 0x3c, 0x0a, - 0x1a, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, - 0x73, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x18, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x53, 0x75, 0x63, 0x63, 0x65, - 0x73, 0x73, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x69, 0x74, 0x79, 0x12, 0x4f, 0x0a, 0x10, 0x70, - 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, + 0x21, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x75, 0x73, 0x65, 0x64, 0x50, 0x72, 0x69, 0x6d, 0x61, + 0x72, 0x79, 0x12, 0x4f, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, + 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, + 0x65, 0x6c, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, + 0x76, 0x65, 0x6c, 0x22, 0x87, 0x05, 0x0a, 0x12, 0x52, 0x61, 0x77, 0x45, 0x6e, 0x63, 0x72, 0x79, + 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x69, + 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, + 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x12, 0x33, 0x0a, 0x15, 0x69, 0x6e, + 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x76, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x14, 0x69, 0x6e, 0x69, 0x74, 0x69, + 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, + 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x67, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x61, 0x67, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x48, + 0x0a, 0x11, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x63, 0x72, 0x63, + 0x33, 0x32, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, + 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x10, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, + 0x78, 0x74, 0x43, 0x72, 0x63, 0x33, 0x32, 0x63, 0x12, 0x5d, 0x0a, 0x1c, 0x69, 0x6e, 0x69, 0x74, + 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x76, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x5f, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x1a, 0x69, 0x6e, 0x69, + 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x43, 0x72, 0x63, 0x33, 0x32, 0x63, 0x12, 0x3a, 0x0a, 0x19, 0x76, 0x65, 0x72, 0x69, 0x66, + 0x69, 0x65, 0x64, 0x5f, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x63, 0x72, + 0x63, 0x33, 0x32, 0x63, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, 0x76, 0x65, 0x72, 0x69, + 0x66, 0x69, 0x65, 0x64, 0x50, 0x6c, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x43, 0x72, 0x63, + 0x33, 0x32, 0x63, 0x12, 0x60, 0x0a, 0x2d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, + 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x65, + 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x63, 0x72, + 0x63, 0x33, 0x32, 0x63, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x29, 0x76, 0x65, 0x72, 0x69, + 0x66, 0x69, 0x65, 0x64, 0x41, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x41, 0x75, + 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x43, + 0x72, 0x63, 0x33, 0x32, 0x63, 0x12, 0x51, 0x0a, 0x25, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, + 0x64, 0x5f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x18, 0x0a, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x22, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x49, 0x6e, + 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x43, 0x72, 0x63, 0x33, 0x32, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x4f, 0x0a, 0x10, + 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, + 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x0f, 0x70, 0x72, + 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0xbe, 0x03, + 0x0a, 0x12, 0x52, 0x61, 0x77, 0x44, 0x65, 0x63, 0x72, 0x79, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x78, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x74, 0x65, + 0x78, 0x74, 0x12, 0x46, 0x0a, 0x10, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x5f, + 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, + 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0f, 0x70, 0x6c, 0x61, 0x69, 0x6e, + 0x74, 0x65, 0x78, 0x74, 0x43, 0x72, 0x63, 0x33, 0x32, 0x63, 0x12, 0x4f, 0x0a, 0x10, 0x70, 0x72, + 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x74, + 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x3c, 0x0a, 0x1a, 0x76, + 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, + 0x78, 0x74, 0x5f, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x18, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x43, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, + 0x65, 0x78, 0x74, 0x43, 0x72, 0x63, 0x33, 0x32, 0x63, 0x12, 0x60, 0x0a, 0x2d, 0x76, 0x65, 0x72, + 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, + 0x5f, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x64, + 0x61, 0x74, 0x61, 0x5f, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x29, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x41, 0x64, 0x64, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x61, 0x6c, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x64, 0x44, 0x61, 0x74, 0x61, 0x43, 0x72, 0x63, 0x33, 0x32, 0x63, 0x12, 0x51, 0x0a, 0x25, 0x76, + 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, + 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x63, 0x72, + 0x63, 0x33, 0x32, 0x63, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x22, 0x76, 0x65, 0x72, 0x69, + 0x66, 0x69, 0x65, 0x64, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x43, 0x72, 0x63, 0x33, 0x32, 0x63, 0x22, 0xcb, + 0x02, 0x0a, 0x16, 0x41, 0x73, 0x79, 0x6d, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x53, 0x69, 0x67, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x46, 0x0a, 0x10, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x5f, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0f, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x43, 0x72, 0x63, 0x33, 0x32, 0x63, 0x12, + 0x34, 0x0a, 0x16, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x64, 0x69, 0x67, 0x65, + 0x73, 0x74, 0x5f, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x14, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x43, + 0x72, 0x63, 0x33, 0x32, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x30, 0x0a, 0x14, 0x76, 0x65, 0x72, + 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x63, 0x72, 0x63, 0x33, 0x32, + 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, + 0x64, 0x44, 0x61, 0x74, 0x61, 0x43, 0x72, 0x63, 0x33, 0x32, 0x63, 0x12, 0x4f, 0x0a, 0x10, 0x70, + 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x0f, 0x70, 0x72, 0x6f, - 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0x6f, 0x0a, 0x1b, - 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x42, 0x79, - 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, - 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, - 0x3c, 0x0a, 0x0b, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x52, 0x0a, 0x64, 0x61, 0x74, 0x61, 0x43, 0x72, 0x63, 0x33, 0x32, 0x63, 0x22, 0x60, 0x0a, - 0x06, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x06, 0x73, 0x68, 0x61, 0x32, 0x35, - 0x36, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x06, 0x73, 0x68, 0x61, 0x32, 0x35, - 0x36, 0x12, 0x18, 0x0a, 0x06, 0x73, 0x68, 0x61, 0x33, 0x38, 0x34, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0c, 0x48, 0x00, 0x52, 0x06, 0x73, 0x68, 0x61, 0x33, 0x38, 0x34, 0x12, 0x18, 0x0a, 0x06, 0x73, - 0x68, 0x61, 0x35, 0x31, 0x32, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x06, 0x73, - 0x68, 0x61, 0x35, 0x31, 0x32, 0x42, 0x08, 0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x22, - 0x5c, 0x0a, 0x10, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x12, 0x23, 0x0a, 0x0d, 0x68, 0x73, 0x6d, 0x5f, 0x61, 0x76, 0x61, 0x69, 0x6c, - 0x61, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x68, 0x73, 0x6d, 0x41, - 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x6b, 0x6d, 0x5f, - 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x0c, 0x65, 0x6b, 0x6d, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x32, 0x90, 0x2e, - 0x0a, 0x14, 0x4b, 0x65, 0x79, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xa2, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x4b, - 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x28, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, - 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x65, 0x79, 0x52, - 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3d, 0xda, 0x41, - 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, - 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, - 0x2a, 0x7d, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x12, 0xb5, 0x01, 0x0a, 0x0e, - 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x2a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, - 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, - 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4a, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, - 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3b, 0x12, 0x39, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, - 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, - 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x6b, 0x65, 0x79, - 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, - 0x65, 0x79, 0x73, 0x12, 0xde, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x79, 0x70, - 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x31, 0x2e, + 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0x90, 0x02, 0x0a, + 0x19, 0x41, 0x73, 0x79, 0x6d, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x44, 0x65, 0x63, 0x72, 0x79, + 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x6c, + 0x61, 0x69, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, + 0x6c, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x46, 0x0a, 0x10, 0x70, 0x6c, 0x61, 0x69, + 0x6e, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, + 0x0f, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x43, 0x72, 0x63, 0x33, 0x32, 0x63, + 0x12, 0x3c, 0x0a, 0x1a, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x63, 0x69, 0x70, + 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x18, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x43, 0x69, + 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x43, 0x72, 0x63, 0x33, 0x32, 0x63, 0x12, 0x4f, + 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x65, 0x76, + 0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, + 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x0f, + 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x22, + 0xf6, 0x01, 0x0a, 0x0f, 0x4d, 0x61, 0x63, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x61, 0x63, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6d, 0x61, 0x63, 0x12, 0x3a, 0x0a, 0x0a, 0x6d, 0x61, 0x63, + 0x5f, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x09, 0x6d, 0x61, 0x63, 0x43, + 0x72, 0x63, 0x33, 0x32, 0x63, 0x12, 0x30, 0x0a, 0x14, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, + 0x64, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x12, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x44, 0x61, 0x74, + 0x61, 0x43, 0x72, 0x63, 0x33, 0x32, 0x63, 0x12, 0x4f, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x74, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, + 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0xb2, 0x02, 0x0a, 0x11, 0x4d, 0x61, 0x63, + 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x30, 0x0a, 0x14, + 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x63, 0x72, + 0x63, 0x33, 0x32, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x76, 0x65, 0x72, 0x69, + 0x66, 0x69, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x43, 0x72, 0x63, 0x33, 0x32, 0x63, 0x12, 0x2e, + 0x0a, 0x13, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x6d, 0x61, 0x63, 0x5f, 0x63, + 0x72, 0x63, 0x33, 0x32, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x76, 0x65, 0x72, + 0x69, 0x66, 0x69, 0x65, 0x64, 0x4d, 0x61, 0x63, 0x43, 0x72, 0x63, 0x33, 0x32, 0x63, 0x12, 0x3c, + 0x0a, 0x1a, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x73, 0x75, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x18, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x53, 0x75, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x69, 0x74, 0x79, 0x12, 0x4f, 0x0a, 0x10, + 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, + 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x0f, 0x70, 0x72, + 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0xad, 0x02, + 0x0a, 0x13, 0x44, 0x65, 0x63, 0x61, 0x70, 0x73, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x68, 0x61, + 0x72, 0x65, 0x64, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x0c, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x35, + 0x0a, 0x14, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, + 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x12, + 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x43, 0x72, 0x63, 0x33, + 0x32, 0x63, 0x88, 0x01, 0x01, 0x12, 0x3c, 0x0a, 0x1a, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, + 0x64, 0x5f, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x63, 0x72, 0x63, + 0x33, 0x32, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x18, 0x76, 0x65, 0x72, 0x69, 0x66, + 0x69, 0x65, 0x64, 0x43, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x43, 0x72, 0x63, + 0x33, 0x32, 0x63, 0x12, 0x4f, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, - 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, - 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x32, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, - 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x79, 0x70, 0x74, - 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5e, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x4f, 0x12, 0x4d, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, - 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, - 0x67, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x2f, - 0x2a, 0x7d, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x73, 0x12, 0xb5, 0x01, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6d, 0x70, - 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x73, 0x12, 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, - 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6d, - 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x4a, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x3b, 0x12, 0x39, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x2a, - 0x7d, 0x2f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x73, 0x12, 0x8f, 0x01, 0x0a, - 0x0a, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x12, 0x26, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, - 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, - 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x69, 0x6e, - 0x67, 0x22, 0x3b, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, - 0x12, 0x2c, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, + 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, + 0x76, 0x65, 0x6c, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, + 0x65, 0x76, 0x65, 0x6c, 0x42, 0x17, 0x0a, 0x15, 0x5f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x5f, + 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x22, 0x6f, 0x0a, + 0x1b, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x42, + 0x79, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, + 0x12, 0x3c, 0x0a, 0x0b, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x52, 0x0a, 0x64, 0x61, 0x74, 0x61, 0x43, 0x72, 0x63, 0x33, 0x32, 0x63, 0x22, 0x60, + 0x0a, 0x06, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x06, 0x73, 0x68, 0x61, 0x32, + 0x35, 0x36, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x06, 0x73, 0x68, 0x61, 0x32, + 0x35, 0x36, 0x12, 0x18, 0x0a, 0x06, 0x73, 0x68, 0x61, 0x33, 0x38, 0x34, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0c, 0x48, 0x00, 0x52, 0x06, 0x73, 0x68, 0x61, 0x33, 0x38, 0x34, 0x12, 0x18, 0x0a, 0x06, + 0x73, 0x68, 0x61, 0x35, 0x31, 0x32, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x06, + 0x73, 0x68, 0x61, 0x35, 0x31, 0x32, 0x42, 0x08, 0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, + 0x22, 0x9b, 0x01, 0x0a, 0x10, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x23, 0x0a, 0x0d, 0x68, 0x73, 0x6d, 0x5f, 0x61, 0x76, 0x61, + 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x68, 0x73, + 0x6d, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x6b, + 0x6d, 0x5f, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x0c, 0x65, 0x6b, 0x6d, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x12, + 0x3d, 0x0a, 0x1b, 0x68, 0x73, 0x6d, 0x5f, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x5f, 0x74, 0x65, + 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x18, 0x68, 0x73, 0x6d, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x54, + 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x32, 0xd9, + 0x2f, 0x0a, 0x14, 0x4b, 0x65, 0x79, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xa2, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, + 0x4b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x28, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, + 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x65, 0x79, + 0x52, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3d, 0xda, + 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, + 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x2f, 0x2a, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xa2, - 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x12, - 0x28, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, - 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, - 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x22, 0x48, 0xda, 0x41, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3b, 0x12, 0x39, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, - 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, - 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, - 0x6e, 0x67, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, - 0x2f, 0x2a, 0x7d, 0x12, 0xcb, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x43, 0x72, 0x79, 0x70, 0x74, - 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2f, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, - 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, - 0x76, 0x31, 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x22, 0x5c, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x4f, 0x12, 0x4d, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x2a, 0x2f, - 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, - 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, - 0x7d, 0x12, 0xc0, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, - 0x65, 0x79, 0x12, 0x28, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, - 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x75, 0x62, 0x6c, - 0x69, 0x63, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, - 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x22, 0x66, 0xda, 0x41, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x59, 0x12, 0x57, 0x2f, 0x76, 0x31, - 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, - 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x6b, 0x65, - 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, - 0x65, 0x79, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x4b, 0x65, 0x79, 0x12, 0xa2, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x49, 0x6d, 0x70, 0x6f, - 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x12, 0x28, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, - 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, - 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, - 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x22, - 0x48, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3b, 0x12, 0x39, - 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, - 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x2a, 0x2f, 0x69, 0x6d, 0x70, 0x6f, - 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xb6, 0x01, 0x0a, 0x0d, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x12, 0x29, 0x2e, 0x67, 0x6f, + 0x2f, 0x2a, 0x7d, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x12, 0xb5, 0x01, 0x0a, + 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x12, + 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, + 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, + 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, - 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, - 0x52, 0x69, 0x6e, 0x67, 0x22, 0x5c, 0xda, 0x41, 0x1b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c, - 0x6b, 0x65, 0x79, 0x5f, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x64, 0x2c, 0x6b, 0x65, 0x79, 0x5f, - 0x72, 0x69, 0x6e, 0x67, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x38, 0x3a, 0x08, 0x6b, 0x65, 0x79, 0x5f, - 0x72, 0x69, 0x6e, 0x67, 0x22, 0x2c, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, - 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, - 0x67, 0x73, 0x12, 0xcf, 0x01, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x72, 0x79, - 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x12, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, - 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, - 0x4b, 0x65, 0x79, 0x22, 0x6f, 0xda, 0x41, 0x1f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c, 0x63, - 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x69, 0x64, 0x2c, 0x63, 0x72, 0x79, - 0x70, 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x47, 0x3a, 0x0a, 0x63, - 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x22, 0x39, 0x2f, 0x76, 0x31, 0x2f, 0x7b, + 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4a, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, + 0x65, 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3b, 0x12, 0x39, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, - 0x4b, 0x65, 0x79, 0x73, 0x12, 0xfb, 0x01, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, - 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, - 0x32, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, - 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x72, 0x79, 0x70, - 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, - 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, - 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x85, 0x01, 0xda, 0x41, 0x19, - 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x6b, 0x65, - 0x79, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x63, 0x3a, - 0x12, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x76, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x22, 0x4d, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, - 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, - 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x2f, 0x2a, 0x7d, - 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x73, 0x12, 0xd4, 0x01, 0x0a, 0x16, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x43, 0x72, 0x79, - 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, - 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, - 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, - 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, - 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x5f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x59, - 0x3a, 0x01, 0x2a, 0x22, 0x54, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, - 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, - 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x2f, 0x2a, 0x7d, - 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x73, 0x3a, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x12, 0xcf, 0x01, 0x0a, 0x0f, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x12, 0x2b, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, - 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, - 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, - 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x22, 0x6f, 0xda, 0x41, 0x1f, 0x70, - 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x6a, 0x6f, 0x62, - 0x5f, 0x69, 0x64, 0x2c, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x6a, 0x6f, 0x62, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x47, 0x3a, 0x0a, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x6a, 0x6f, 0x62, - 0x22, 0x39, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x2a, 0x7d, - 0x2f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x73, 0x12, 0xd1, 0x01, 0x0a, 0x0f, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x12, - 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, - 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, 0x79, 0x70, - 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, - 0x76, 0x31, 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x22, 0x71, 0xda, 0x41, - 0x16, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x2c, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x52, 0x3a, 0x0a, 0x63, - 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x32, 0x44, 0x2f, 0x76, 0x31, 0x2f, 0x7b, - 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, + 0x4b, 0x65, 0x79, 0x73, 0x12, 0xde, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x79, + 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x31, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, + 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x32, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, + 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x72, 0x79, 0x70, + 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5e, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x4f, 0x12, 0x4d, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, + 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, + 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, + 0x6e, 0x67, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, + 0x2f, 0x2a, 0x7d, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0xb5, 0x01, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6d, + 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x73, 0x12, 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, + 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x4a, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x3b, 0x12, 0x39, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, - 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x2f, 0x2a, 0x7d, 0x12, - 0x93, 0x02, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, - 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x2e, 0x67, 0x6f, 0x6f, + 0x2a, 0x7d, 0x2f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x73, 0x12, 0x8f, 0x01, + 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x12, 0x26, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, + 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x69, + 0x6e, 0x67, 0x22, 0x3b, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x2e, 0x12, 0x2c, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2f, 0x2a, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x2a, 0x7d, 0x12, + 0xa2, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, + 0x12, 0x28, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, + 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, + 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, - 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, - 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, - 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x9d, 0x01, 0xda, 0x41, 0x1e, 0x63, 0x72, 0x79, 0x70, 0x74, - 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2c, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x76, 0x3a, - 0x12, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x76, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x32, 0x60, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, - 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x6e, 0x61, 0x6d, - 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, + 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x22, 0x48, 0xda, 0x41, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3b, 0x12, 0x39, 0x2f, 0x76, 0x31, 0x2f, 0x7b, + 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, + 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x6b, 0x65, 0x79, 0x52, + 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, + 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xcb, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x43, 0x72, 0x79, 0x70, + 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2f, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, + 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, + 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x5c, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x4f, 0x12, 0x4d, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x2a, + 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x72, + 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, + 0x2a, 0x7d, 0x12, 0xc0, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x4b, 0x65, 0x79, 0x12, 0x28, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, + 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x75, 0x62, + 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, + 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x22, 0x66, 0xda, + 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x59, 0x12, 0x57, 0x2f, 0x76, + 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, + 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x6b, + 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, + 0x4b, 0x65, 0x79, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0xa2, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x49, 0x6d, 0x70, + 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x12, 0x28, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, + 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, + 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, + 0x22, 0x48, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3b, 0x12, + 0x39, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, + 0x2a, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x2a, 0x2f, 0x69, 0x6d, 0x70, + 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xb6, 0x01, 0x0a, 0x0d, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x12, 0x29, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, + 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, + 0x79, 0x52, 0x69, 0x6e, 0x67, 0x22, 0x5c, 0xda, 0x41, 0x1b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, + 0x2c, 0x6b, 0x65, 0x79, 0x5f, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x64, 0x2c, 0x6b, 0x65, 0x79, + 0x5f, 0x72, 0x69, 0x6e, 0x67, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x38, 0x3a, 0x08, 0x6b, 0x65, 0x79, + 0x5f, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x2c, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, + 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, + 0x6e, 0x67, 0x73, 0x12, 0xcf, 0x01, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x72, + 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x12, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, + 0x6f, 0x4b, 0x65, 0x79, 0x22, 0x6f, 0xda, 0x41, 0x1f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c, + 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x69, 0x64, 0x2c, 0x63, 0x72, + 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x47, 0x3a, 0x0a, + 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x22, 0x39, 0x2f, 0x76, 0x31, 0x2f, + 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, + 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x6b, + 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, + 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x12, 0xfb, 0x01, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x12, 0x32, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, + 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x72, 0x79, + 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, + 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x85, 0x01, 0xda, 0x41, + 0x19, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x6b, + 0x65, 0x79, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x63, + 0x3a, 0x12, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x4d, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, + 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x2f, 0x2a, - 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xf2, 0x01, 0x0a, 0x1d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, - 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x39, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x50, 0x72, 0x69, - 0x6d, 0x61, 0x72, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, + 0x7d, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0xd4, 0x01, 0x0a, 0x16, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x43, 0x72, + 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x32, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x43, 0x72, 0x79, 0x70, 0x74, + 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, - 0x65, 0x79, 0x22, 0x76, 0xda, 0x41, 0x1a, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x63, 0x72, 0x79, 0x70, - 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, - 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x53, 0x3a, 0x01, 0x2a, 0x22, 0x4e, 0x2f, 0x76, 0x31, 0x2f, - 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, - 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x6b, 0x65, 0x79, - 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, - 0x79, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x69, 0x6d, - 0x61, 0x72, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0xde, 0x01, 0x0a, 0x17, 0x44, - 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x73, - 0x74, 0x72, 0x6f, 0x79, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x67, 0x6f, + 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x5f, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x59, 0x3a, 0x01, 0x2a, 0x22, 0x54, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, + 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, + 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x2f, 0x2a, + 0x7d, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x3a, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x12, 0xcf, 0x01, 0x0a, 0x0f, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x12, 0x2b, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6d, 0x70, 0x6f, 0x72, + 0x74, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, - 0x31, 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x22, 0x67, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x5a, 0x3a, 0x01, 0x2a, 0x22, 0x55, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, - 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, - 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x2f, 0x2a, 0x2f, 0x63, - 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, - 0x2f, 0x2a, 0x7d, 0x3a, 0x64, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x12, 0xde, 0x01, 0x0a, 0x17, - 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, + 0x31, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x22, 0x6f, 0xda, 0x41, 0x1f, + 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x6a, 0x6f, + 0x62, 0x5f, 0x69, 0x64, 0x2c, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x6a, 0x6f, 0x62, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x47, 0x3a, 0x0a, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x6a, 0x6f, + 0x62, 0x22, 0x39, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x2a, + 0x7d, 0x2f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x6f, 0x62, 0x73, 0x12, 0xd1, 0x01, 0x0a, + 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, + 0x12, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, + 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, 0x79, + 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, + 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x22, 0x71, 0xda, + 0x41, 0x16, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x2c, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x52, 0x3a, 0x0a, + 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x32, 0x44, 0x2f, 0x76, 0x31, 0x2f, + 0x7b, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x2e, 0x6e, 0x61, 0x6d, 0x65, + 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, + 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x2f, 0x2a, 0x7d, + 0x12, 0x93, 0x02, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, 0x79, 0x70, 0x74, + 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, + 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, + 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x9d, 0x01, 0xda, 0x41, 0x1e, 0x63, 0x72, 0x79, 0x70, + 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2c, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x76, + 0x3a, 0x12, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x32, 0x60, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x63, 0x72, 0x79, 0x70, 0x74, + 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x6e, 0x61, + 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, + 0x67, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x2f, + 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xf2, 0x01, 0x0a, 0x1d, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, + 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x39, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x50, 0x72, + 0x69, 0x6d, 0x61, 0x72, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, + 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, + 0x4b, 0x65, 0x79, 0x22, 0x76, 0xda, 0x41, 0x1a, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x63, 0x72, 0x79, + 0x70, 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, + 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x53, 0x3a, 0x01, 0x2a, 0x22, 0x4e, 0x2f, 0x76, 0x31, + 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, + 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x6b, 0x65, + 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, + 0x65, 0x79, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x69, + 0x6d, 0x61, 0x72, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0xde, 0x01, 0x0a, 0x17, + 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, - 0x73, 0x74, 0x6f, 0x72, 0x65, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, + 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, + 0x73, 0x74, 0x72, 0x6f, 0x79, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, @@ -5053,140 +5291,166 @@ var file_google_cloud_kms_v1_service_proto_rawDesc = []byte{ 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0xb4, 0x01, 0x0a, - 0x07, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x12, 0x23, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x45, - 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, + 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x64, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x12, 0xde, 0x01, 0x0a, + 0x17, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, + 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, + 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, - 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x5e, 0xda, 0x41, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x70, 0x6c, 0x61, - 0x69, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x47, 0x3a, 0x01, 0x2a, 0x22, - 0x42, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, - 0x2a, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, - 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x2f, 0x2a, 0x2a, 0x7d, 0x3a, 0x65, 0x6e, 0x63, 0x72, - 0x79, 0x70, 0x74, 0x12, 0xb4, 0x01, 0x0a, 0x07, 0x44, 0x65, 0x63, 0x72, 0x79, 0x70, 0x74, 0x12, - 0x23, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, - 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x63, 0x72, 0x79, 0x70, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, - 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x63, 0x72, 0x79, - 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5e, 0xda, 0x41, 0x0f, 0x6e, - 0x61, 0x6d, 0x65, 0x2c, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x46, 0x3a, 0x01, 0x2a, 0x22, 0x41, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, - 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, - 0x67, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x2f, - 0x2a, 0x7d, 0x3a, 0x64, 0x65, 0x63, 0x72, 0x79, 0x70, 0x74, 0x12, 0xc2, 0x01, 0x0a, 0x0a, 0x52, - 0x61, 0x77, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x12, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x67, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x5a, 0x3a, 0x01, 0x2a, 0x22, 0x55, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, + 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, + 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x2f, 0x2a, + 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0xb4, 0x01, + 0x0a, 0x07, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x12, 0x23, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x52, 0x61, 0x77, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x27, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, - 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x61, 0x77, 0x45, 0x6e, 0x63, 0x72, 0x79, - 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x63, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x5d, 0x3a, 0x01, 0x2a, 0x22, 0x58, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, - 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, - 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x2f, 0x2a, 0x2f, - 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x72, 0x61, 0x77, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x12, - 0xc2, 0x01, 0x0a, 0x0a, 0x52, 0x61, 0x77, 0x44, 0x65, 0x63, 0x72, 0x79, 0x70, 0x74, 0x12, 0x26, + 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, - 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x61, 0x77, 0x44, 0x65, 0x63, 0x72, 0x79, 0x70, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x61, 0x77, - 0x44, 0x65, 0x63, 0x72, 0x79, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x63, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x5d, 0x3a, 0x01, 0x2a, 0x22, 0x58, 0x2f, 0x76, 0x31, 0x2f, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5e, 0xda, 0x41, 0x0e, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x70, 0x6c, + 0x61, 0x69, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x47, 0x3a, 0x01, 0x2a, + 0x22, 0x42, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2f, 0x2a, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x72, + 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x2f, 0x2a, 0x2a, 0x7d, 0x3a, 0x65, 0x6e, 0x63, + 0x72, 0x79, 0x70, 0x74, 0x12, 0xb4, 0x01, 0x0a, 0x07, 0x44, 0x65, 0x63, 0x72, 0x79, 0x70, 0x74, + 0x12, 0x23, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, + 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x63, 0x72, 0x79, 0x70, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, + 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x63, 0x72, + 0x79, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5e, 0xda, 0x41, 0x0f, + 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x46, 0x3a, 0x01, 0x2a, 0x22, 0x41, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, + 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, + 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, + 0x6e, 0x67, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, + 0x2f, 0x2a, 0x7d, 0x3a, 0x64, 0x65, 0x63, 0x72, 0x79, 0x70, 0x74, 0x12, 0xc2, 0x01, 0x0a, 0x0a, + 0x52, 0x61, 0x77, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x12, 0x26, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, + 0x2e, 0x52, 0x61, 0x77, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, + 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x61, 0x77, 0x45, 0x6e, 0x63, 0x72, + 0x79, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x63, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x5d, 0x3a, 0x01, 0x2a, 0x22, 0x58, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, + 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, + 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x2f, 0x2a, + 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x72, 0x61, 0x77, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, + 0x12, 0xc2, 0x01, 0x0a, 0x0a, 0x52, 0x61, 0x77, 0x44, 0x65, 0x63, 0x72, 0x79, 0x70, 0x74, 0x12, + 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, + 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x61, 0x77, 0x44, 0x65, 0x63, 0x72, 0x79, 0x70, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x61, + 0x77, 0x44, 0x65, 0x63, 0x72, 0x79, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x63, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x5d, 0x3a, 0x01, 0x2a, 0x22, 0x58, 0x2f, 0x76, 0x31, + 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, + 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x6b, 0x65, + 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, + 0x65, 0x79, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x72, 0x61, 0x77, 0x44, 0x65, + 0x63, 0x72, 0x79, 0x70, 0x74, 0x12, 0xe0, 0x01, 0x0a, 0x0e, 0x41, 0x73, 0x79, 0x6d, 0x6d, 0x65, + 0x74, 0x72, 0x69, 0x63, 0x53, 0x69, 0x67, 0x6e, 0x12, 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, + 0x73, 0x79, 0x6d, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x73, 0x79, 0x6d, 0x6d, + 0x65, 0x74, 0x72, 0x69, 0x63, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x75, 0xda, 0x41, 0x0b, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x64, 0x69, 0x67, 0x65, 0x73, + 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x61, 0x3a, 0x01, 0x2a, 0x22, 0x5c, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x72, 0x61, 0x77, 0x44, 0x65, 0x63, - 0x72, 0x79, 0x70, 0x74, 0x12, 0xe0, 0x01, 0x0a, 0x0e, 0x41, 0x73, 0x79, 0x6d, 0x6d, 0x65, 0x74, - 0x72, 0x69, 0x63, 0x53, 0x69, 0x67, 0x6e, 0x12, 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x73, - 0x79, 0x6d, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, - 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x73, 0x79, 0x6d, 0x6d, 0x65, - 0x74, 0x72, 0x69, 0x63, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x75, 0xda, 0x41, 0x0b, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x61, 0x3a, 0x01, 0x2a, 0x22, 0x5c, 0x2f, 0x76, 0x31, 0x2f, 0x7b, - 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, - 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x6b, 0x65, 0x79, 0x52, - 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, - 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x61, 0x73, 0x79, 0x6d, 0x6d, 0x65, 0x74, - 0x72, 0x69, 0x63, 0x53, 0x69, 0x67, 0x6e, 0x12, 0xf0, 0x01, 0x0a, 0x11, 0x41, 0x73, 0x79, 0x6d, - 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x44, 0x65, 0x63, 0x72, 0x79, 0x70, 0x74, 0x12, 0x2d, 0x2e, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x61, 0x73, 0x79, 0x6d, 0x6d, 0x65, + 0x74, 0x72, 0x69, 0x63, 0x53, 0x69, 0x67, 0x6e, 0x12, 0xf0, 0x01, 0x0a, 0x11, 0x41, 0x73, 0x79, + 0x6d, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x44, 0x65, 0x63, 0x72, 0x79, 0x70, 0x74, 0x12, 0x2d, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x73, 0x79, 0x6d, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x44, + 0x65, 0x63, 0x72, 0x79, 0x70, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x73, 0x79, 0x6d, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x44, 0x65, - 0x63, 0x72, 0x79, 0x70, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x67, + 0x63, 0x72, 0x79, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x7c, 0xda, + 0x41, 0x0f, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, + 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x64, 0x3a, 0x01, 0x2a, 0x22, 0x5f, 0x2f, 0x76, 0x31, 0x2f, + 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, + 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x6b, 0x65, 0x79, + 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, + 0x79, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x61, 0x73, 0x79, 0x6d, 0x6d, 0x65, + 0x74, 0x72, 0x69, 0x63, 0x44, 0x65, 0x63, 0x72, 0x79, 0x70, 0x74, 0x12, 0xc2, 0x01, 0x0a, 0x07, + 0x4d, 0x61, 0x63, 0x53, 0x69, 0x67, 0x6e, 0x12, 0x23, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, + 0x63, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, - 0x76, 0x31, 0x2e, 0x41, 0x73, 0x79, 0x6d, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x44, 0x65, 0x63, - 0x72, 0x79, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x7c, 0xda, 0x41, - 0x0f, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x64, 0x3a, 0x01, 0x2a, 0x22, 0x5f, 0x2f, 0x76, 0x31, 0x2f, 0x7b, + 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x63, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x6c, 0xda, 0x41, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x64, 0x61, 0x74, 0x61, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x5a, 0x3a, 0x01, 0x2a, 0x22, 0x55, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x61, 0x73, 0x79, 0x6d, 0x6d, 0x65, 0x74, - 0x72, 0x69, 0x63, 0x44, 0x65, 0x63, 0x72, 0x79, 0x70, 0x74, 0x12, 0xc2, 0x01, 0x0a, 0x07, 0x4d, - 0x61, 0x63, 0x53, 0x69, 0x67, 0x6e, 0x12, 0x23, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x63, - 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, - 0x31, 0x2e, 0x4d, 0x61, 0x63, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x6c, 0xda, 0x41, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x64, 0x61, 0x74, 0x61, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x5a, 0x3a, 0x01, 0x2a, 0x22, 0x55, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x6d, 0x61, 0x63, 0x53, 0x69, 0x67, 0x6e, + 0x12, 0xce, 0x01, 0x0a, 0x09, 0x4d, 0x61, 0x63, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x12, 0x25, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x63, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, + 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x63, 0x56, + 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x72, 0xda, + 0x41, 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x64, 0x61, 0x74, 0x61, 0x2c, 0x6d, 0x61, 0x63, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x5c, 0x3a, 0x01, 0x2a, 0x22, 0x57, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x6d, 0x61, 0x63, 0x53, 0x69, 0x67, 0x6e, 0x12, - 0xce, 0x01, 0x0a, 0x09, 0x4d, 0x61, 0x63, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x12, 0x25, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, - 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x63, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, - 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x63, 0x56, 0x65, - 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x72, 0xda, 0x41, - 0x0d, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x64, 0x61, 0x74, 0x61, 0x2c, 0x6d, 0x61, 0x63, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x5c, 0x3a, 0x01, 0x2a, 0x22, 0x57, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, - 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, - 0x67, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x2f, - 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x6d, 0x61, 0x63, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, - 0x12, 0xe7, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x61, 0x6e, - 0x64, 0x6f, 0x6d, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, + 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x6d, 0x61, 0x63, 0x56, 0x65, 0x72, 0x69, 0x66, + 0x79, 0x12, 0xc6, 0x01, 0x0a, 0x0b, 0x44, 0x65, 0x63, 0x61, 0x70, 0x73, 0x75, 0x6c, 0x61, 0x74, + 0x65, 0x12, 0x27, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, + 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x63, 0x61, 0x70, 0x73, 0x75, 0x6c, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, + 0x2e, 0x44, 0x65, 0x63, 0x61, 0x70, 0x73, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x5e, 0x3a, 0x01, 0x2a, 0x22, + 0x59, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, + 0x2a, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, + 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, + 0x4b, 0x65, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x64, + 0x65, 0x63, 0x61, 0x70, 0x73, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x12, 0xe7, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x42, 0x79, 0x74, - 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x42, 0x79, - 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x6d, 0xda, 0x41, 0x26, - 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x5f, - 0x62, 0x79, 0x74, 0x65, 0x73, 0x2c, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3e, 0x3a, 0x01, 0x2a, 0x22, - 0x39, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x70, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, - 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x42, 0x79, 0x74, 0x65, 0x73, 0x1a, 0x74, 0xca, 0x41, 0x17, 0x63, - 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, - 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0xd2, 0x41, 0x57, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, - 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x70, - 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2c, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, - 0x77, 0x77, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, - 0x42, 0x7c, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, - 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x08, 0x4b, 0x6d, 0x73, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x29, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x6b, 0x6d, 0x73, - 0x2f, 0x61, 0x70, 0x69, 0x76, 0x31, 0x2f, 0x6b, 0x6d, 0x73, 0x70, 0x62, 0x3b, 0x6b, 0x6d, 0x73, - 0x70, 0x62, 0xaa, 0x02, 0x13, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, - 0x64, 0x2e, 0x4b, 0x6d, 0x73, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x13, 0x47, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x5c, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x5c, 0x4b, 0x6d, 0x73, 0x5c, 0x56, 0x31, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x73, 0x12, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, + 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x65, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, + 0x75, 0x64, 0x2e, 0x6b, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, + 0x74, 0x65, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x6d, 0xda, 0x41, 0x26, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2c, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x2c, + 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3e, 0x3a, 0x01, 0x2a, 0x22, 0x39, 0x2f, 0x76, 0x31, 0x2f, 0x7b, + 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x73, 0x2f, 0x2a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, + 0x3a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x42, + 0x79, 0x74, 0x65, 0x73, 0x1a, 0x74, 0xca, 0x41, 0x17, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, + 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, + 0xd2, 0x41, 0x57, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x75, + 0x74, 0x68, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, + 0x6d, 0x2c, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x75, 0x74, + 0x68, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x42, 0x7c, 0x0a, 0x17, 0x63, 0x6f, + 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6b, + 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x08, 0x4b, 0x6d, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x29, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x6b, 0x6d, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x31, + 0x2f, 0x6b, 0x6d, 0x73, 0x70, 0x62, 0x3b, 0x6b, 0x6d, 0x73, 0x70, 0x62, 0xaa, 0x02, 0x13, 0x47, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x4b, 0x6d, 0x73, 0x2e, + 0x56, 0x31, 0xca, 0x02, 0x13, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5c, 0x43, 0x6c, 0x6f, 0x75, + 0x64, 0x5c, 0x4b, 0x6d, 0x73, 0x5c, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -5201,7 +5465,7 @@ func file_google_cloud_kms_v1_service_proto_rawDescGZIP() []byte { return file_google_cloud_kms_v1_service_proto_rawDescData } -var file_google_cloud_kms_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 43) +var file_google_cloud_kms_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 45) var file_google_cloud_kms_v1_service_proto_goTypes = []any{ (*ListKeyRingsRequest)(nil), // 0: google.cloud.kms.v1.ListKeyRingsRequest (*ListCryptoKeysRequest)(nil), // 1: google.cloud.kms.v1.ListCryptoKeysRequest @@ -5234,143 +5498,149 @@ var file_google_cloud_kms_v1_service_proto_goTypes = []any{ (*AsymmetricDecryptRequest)(nil), // 28: google.cloud.kms.v1.AsymmetricDecryptRequest (*MacSignRequest)(nil), // 29: google.cloud.kms.v1.MacSignRequest (*MacVerifyRequest)(nil), // 30: google.cloud.kms.v1.MacVerifyRequest - (*GenerateRandomBytesRequest)(nil), // 31: google.cloud.kms.v1.GenerateRandomBytesRequest - (*EncryptResponse)(nil), // 32: google.cloud.kms.v1.EncryptResponse - (*DecryptResponse)(nil), // 33: google.cloud.kms.v1.DecryptResponse - (*RawEncryptResponse)(nil), // 34: google.cloud.kms.v1.RawEncryptResponse - (*RawDecryptResponse)(nil), // 35: google.cloud.kms.v1.RawDecryptResponse - (*AsymmetricSignResponse)(nil), // 36: google.cloud.kms.v1.AsymmetricSignResponse - (*AsymmetricDecryptResponse)(nil), // 37: google.cloud.kms.v1.AsymmetricDecryptResponse - (*MacSignResponse)(nil), // 38: google.cloud.kms.v1.MacSignResponse - (*MacVerifyResponse)(nil), // 39: google.cloud.kms.v1.MacVerifyResponse - (*GenerateRandomBytesResponse)(nil), // 40: google.cloud.kms.v1.GenerateRandomBytesResponse - (*Digest)(nil), // 41: google.cloud.kms.v1.Digest - (*LocationMetadata)(nil), // 42: google.cloud.kms.v1.LocationMetadata - (CryptoKeyVersion_CryptoKeyVersionView)(0), // 43: google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView - (*KeyRing)(nil), // 44: google.cloud.kms.v1.KeyRing - (*CryptoKey)(nil), // 45: google.cloud.kms.v1.CryptoKey - (*CryptoKeyVersion)(nil), // 46: google.cloud.kms.v1.CryptoKeyVersion - (*ImportJob)(nil), // 47: google.cloud.kms.v1.ImportJob - (PublicKey_PublicKeyFormat)(0), // 48: google.cloud.kms.v1.PublicKey.PublicKeyFormat - (CryptoKeyVersion_CryptoKeyVersionAlgorithm)(0), // 49: google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm - (*fieldmaskpb.FieldMask)(nil), // 50: google.protobuf.FieldMask - (*wrapperspb.Int64Value)(nil), // 51: google.protobuf.Int64Value - (ProtectionLevel)(0), // 52: google.cloud.kms.v1.ProtectionLevel - (*PublicKey)(nil), // 53: google.cloud.kms.v1.PublicKey + (*DecapsulateRequest)(nil), // 31: google.cloud.kms.v1.DecapsulateRequest + (*GenerateRandomBytesRequest)(nil), // 32: google.cloud.kms.v1.GenerateRandomBytesRequest + (*EncryptResponse)(nil), // 33: google.cloud.kms.v1.EncryptResponse + (*DecryptResponse)(nil), // 34: google.cloud.kms.v1.DecryptResponse + (*RawEncryptResponse)(nil), // 35: google.cloud.kms.v1.RawEncryptResponse + (*RawDecryptResponse)(nil), // 36: google.cloud.kms.v1.RawDecryptResponse + (*AsymmetricSignResponse)(nil), // 37: google.cloud.kms.v1.AsymmetricSignResponse + (*AsymmetricDecryptResponse)(nil), // 38: google.cloud.kms.v1.AsymmetricDecryptResponse + (*MacSignResponse)(nil), // 39: google.cloud.kms.v1.MacSignResponse + (*MacVerifyResponse)(nil), // 40: google.cloud.kms.v1.MacVerifyResponse + (*DecapsulateResponse)(nil), // 41: google.cloud.kms.v1.DecapsulateResponse + (*GenerateRandomBytesResponse)(nil), // 42: google.cloud.kms.v1.GenerateRandomBytesResponse + (*Digest)(nil), // 43: google.cloud.kms.v1.Digest + (*LocationMetadata)(nil), // 44: google.cloud.kms.v1.LocationMetadata + (CryptoKeyVersion_CryptoKeyVersionView)(0), // 45: google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView + (*KeyRing)(nil), // 46: google.cloud.kms.v1.KeyRing + (*CryptoKey)(nil), // 47: google.cloud.kms.v1.CryptoKey + (*CryptoKeyVersion)(nil), // 48: google.cloud.kms.v1.CryptoKeyVersion + (*ImportJob)(nil), // 49: google.cloud.kms.v1.ImportJob + (PublicKey_PublicKeyFormat)(0), // 50: google.cloud.kms.v1.PublicKey.PublicKeyFormat + (CryptoKeyVersion_CryptoKeyVersionAlgorithm)(0), // 51: google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm + (*fieldmaskpb.FieldMask)(nil), // 52: google.protobuf.FieldMask + (*wrapperspb.Int64Value)(nil), // 53: google.protobuf.Int64Value + (ProtectionLevel)(0), // 54: google.cloud.kms.v1.ProtectionLevel + (*PublicKey)(nil), // 55: google.cloud.kms.v1.PublicKey } var file_google_cloud_kms_v1_service_proto_depIdxs = []int32{ - 43, // 0: google.cloud.kms.v1.ListCryptoKeysRequest.version_view:type_name -> google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView - 43, // 1: google.cloud.kms.v1.ListCryptoKeyVersionsRequest.view:type_name -> google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView - 44, // 2: google.cloud.kms.v1.ListKeyRingsResponse.key_rings:type_name -> google.cloud.kms.v1.KeyRing - 45, // 3: google.cloud.kms.v1.ListCryptoKeysResponse.crypto_keys:type_name -> google.cloud.kms.v1.CryptoKey - 46, // 4: google.cloud.kms.v1.ListCryptoKeyVersionsResponse.crypto_key_versions:type_name -> google.cloud.kms.v1.CryptoKeyVersion - 47, // 5: google.cloud.kms.v1.ListImportJobsResponse.import_jobs:type_name -> google.cloud.kms.v1.ImportJob - 48, // 6: google.cloud.kms.v1.GetPublicKeyRequest.public_key_format:type_name -> google.cloud.kms.v1.PublicKey.PublicKeyFormat - 44, // 7: google.cloud.kms.v1.CreateKeyRingRequest.key_ring:type_name -> google.cloud.kms.v1.KeyRing - 45, // 8: google.cloud.kms.v1.CreateCryptoKeyRequest.crypto_key:type_name -> google.cloud.kms.v1.CryptoKey - 46, // 9: google.cloud.kms.v1.CreateCryptoKeyVersionRequest.crypto_key_version:type_name -> google.cloud.kms.v1.CryptoKeyVersion - 49, // 10: google.cloud.kms.v1.ImportCryptoKeyVersionRequest.algorithm:type_name -> google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm - 47, // 11: google.cloud.kms.v1.CreateImportJobRequest.import_job:type_name -> google.cloud.kms.v1.ImportJob - 45, // 12: google.cloud.kms.v1.UpdateCryptoKeyRequest.crypto_key:type_name -> google.cloud.kms.v1.CryptoKey - 50, // 13: google.cloud.kms.v1.UpdateCryptoKeyRequest.update_mask:type_name -> google.protobuf.FieldMask - 46, // 14: google.cloud.kms.v1.UpdateCryptoKeyVersionRequest.crypto_key_version:type_name -> google.cloud.kms.v1.CryptoKeyVersion - 50, // 15: google.cloud.kms.v1.UpdateCryptoKeyVersionRequest.update_mask:type_name -> google.protobuf.FieldMask - 51, // 16: google.cloud.kms.v1.EncryptRequest.plaintext_crc32c:type_name -> google.protobuf.Int64Value - 51, // 17: google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c:type_name -> google.protobuf.Int64Value - 51, // 18: google.cloud.kms.v1.DecryptRequest.ciphertext_crc32c:type_name -> google.protobuf.Int64Value - 51, // 19: google.cloud.kms.v1.DecryptRequest.additional_authenticated_data_crc32c:type_name -> google.protobuf.Int64Value - 51, // 20: google.cloud.kms.v1.RawEncryptRequest.plaintext_crc32c:type_name -> google.protobuf.Int64Value - 51, // 21: google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data_crc32c:type_name -> google.protobuf.Int64Value - 51, // 22: google.cloud.kms.v1.RawEncryptRequest.initialization_vector_crc32c:type_name -> google.protobuf.Int64Value - 51, // 23: google.cloud.kms.v1.RawDecryptRequest.ciphertext_crc32c:type_name -> google.protobuf.Int64Value - 51, // 24: google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data_crc32c:type_name -> google.protobuf.Int64Value - 51, // 25: google.cloud.kms.v1.RawDecryptRequest.initialization_vector_crc32c:type_name -> google.protobuf.Int64Value - 41, // 26: google.cloud.kms.v1.AsymmetricSignRequest.digest:type_name -> google.cloud.kms.v1.Digest - 51, // 27: google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c:type_name -> google.protobuf.Int64Value - 51, // 28: google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c:type_name -> google.protobuf.Int64Value - 51, // 29: google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c:type_name -> google.protobuf.Int64Value - 51, // 30: google.cloud.kms.v1.MacSignRequest.data_crc32c:type_name -> google.protobuf.Int64Value - 51, // 31: google.cloud.kms.v1.MacVerifyRequest.data_crc32c:type_name -> google.protobuf.Int64Value - 51, // 32: google.cloud.kms.v1.MacVerifyRequest.mac_crc32c:type_name -> google.protobuf.Int64Value - 52, // 33: google.cloud.kms.v1.GenerateRandomBytesRequest.protection_level:type_name -> google.cloud.kms.v1.ProtectionLevel - 51, // 34: google.cloud.kms.v1.EncryptResponse.ciphertext_crc32c:type_name -> google.protobuf.Int64Value - 52, // 35: google.cloud.kms.v1.EncryptResponse.protection_level:type_name -> google.cloud.kms.v1.ProtectionLevel - 51, // 36: google.cloud.kms.v1.DecryptResponse.plaintext_crc32c:type_name -> google.protobuf.Int64Value - 52, // 37: google.cloud.kms.v1.DecryptResponse.protection_level:type_name -> google.cloud.kms.v1.ProtectionLevel - 51, // 38: google.cloud.kms.v1.RawEncryptResponse.ciphertext_crc32c:type_name -> google.protobuf.Int64Value - 51, // 39: google.cloud.kms.v1.RawEncryptResponse.initialization_vector_crc32c:type_name -> google.protobuf.Int64Value - 52, // 40: google.cloud.kms.v1.RawEncryptResponse.protection_level:type_name -> google.cloud.kms.v1.ProtectionLevel - 51, // 41: google.cloud.kms.v1.RawDecryptResponse.plaintext_crc32c:type_name -> google.protobuf.Int64Value - 52, // 42: google.cloud.kms.v1.RawDecryptResponse.protection_level:type_name -> google.cloud.kms.v1.ProtectionLevel - 51, // 43: google.cloud.kms.v1.AsymmetricSignResponse.signature_crc32c:type_name -> google.protobuf.Int64Value - 52, // 44: google.cloud.kms.v1.AsymmetricSignResponse.protection_level:type_name -> google.cloud.kms.v1.ProtectionLevel - 51, // 45: google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext_crc32c:type_name -> google.protobuf.Int64Value - 52, // 46: google.cloud.kms.v1.AsymmetricDecryptResponse.protection_level:type_name -> google.cloud.kms.v1.ProtectionLevel - 51, // 47: google.cloud.kms.v1.MacSignResponse.mac_crc32c:type_name -> google.protobuf.Int64Value - 52, // 48: google.cloud.kms.v1.MacSignResponse.protection_level:type_name -> google.cloud.kms.v1.ProtectionLevel - 52, // 49: google.cloud.kms.v1.MacVerifyResponse.protection_level:type_name -> google.cloud.kms.v1.ProtectionLevel - 51, // 50: google.cloud.kms.v1.GenerateRandomBytesResponse.data_crc32c:type_name -> google.protobuf.Int64Value - 0, // 51: google.cloud.kms.v1.KeyManagementService.ListKeyRings:input_type -> google.cloud.kms.v1.ListKeyRingsRequest - 1, // 52: google.cloud.kms.v1.KeyManagementService.ListCryptoKeys:input_type -> google.cloud.kms.v1.ListCryptoKeysRequest - 2, // 53: google.cloud.kms.v1.KeyManagementService.ListCryptoKeyVersions:input_type -> google.cloud.kms.v1.ListCryptoKeyVersionsRequest - 3, // 54: google.cloud.kms.v1.KeyManagementService.ListImportJobs:input_type -> google.cloud.kms.v1.ListImportJobsRequest - 8, // 55: google.cloud.kms.v1.KeyManagementService.GetKeyRing:input_type -> google.cloud.kms.v1.GetKeyRingRequest - 9, // 56: google.cloud.kms.v1.KeyManagementService.GetCryptoKey:input_type -> google.cloud.kms.v1.GetCryptoKeyRequest - 10, // 57: google.cloud.kms.v1.KeyManagementService.GetCryptoKeyVersion:input_type -> google.cloud.kms.v1.GetCryptoKeyVersionRequest - 11, // 58: google.cloud.kms.v1.KeyManagementService.GetPublicKey:input_type -> google.cloud.kms.v1.GetPublicKeyRequest - 12, // 59: google.cloud.kms.v1.KeyManagementService.GetImportJob:input_type -> google.cloud.kms.v1.GetImportJobRequest - 13, // 60: google.cloud.kms.v1.KeyManagementService.CreateKeyRing:input_type -> google.cloud.kms.v1.CreateKeyRingRequest - 14, // 61: google.cloud.kms.v1.KeyManagementService.CreateCryptoKey:input_type -> google.cloud.kms.v1.CreateCryptoKeyRequest - 15, // 62: google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion:input_type -> google.cloud.kms.v1.CreateCryptoKeyVersionRequest - 16, // 63: google.cloud.kms.v1.KeyManagementService.ImportCryptoKeyVersion:input_type -> google.cloud.kms.v1.ImportCryptoKeyVersionRequest - 17, // 64: google.cloud.kms.v1.KeyManagementService.CreateImportJob:input_type -> google.cloud.kms.v1.CreateImportJobRequest - 18, // 65: google.cloud.kms.v1.KeyManagementService.UpdateCryptoKey:input_type -> google.cloud.kms.v1.UpdateCryptoKeyRequest - 19, // 66: google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyVersion:input_type -> google.cloud.kms.v1.UpdateCryptoKeyVersionRequest - 20, // 67: google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion:input_type -> google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest - 21, // 68: google.cloud.kms.v1.KeyManagementService.DestroyCryptoKeyVersion:input_type -> google.cloud.kms.v1.DestroyCryptoKeyVersionRequest - 22, // 69: google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion:input_type -> google.cloud.kms.v1.RestoreCryptoKeyVersionRequest - 23, // 70: google.cloud.kms.v1.KeyManagementService.Encrypt:input_type -> google.cloud.kms.v1.EncryptRequest - 24, // 71: google.cloud.kms.v1.KeyManagementService.Decrypt:input_type -> google.cloud.kms.v1.DecryptRequest - 25, // 72: google.cloud.kms.v1.KeyManagementService.RawEncrypt:input_type -> google.cloud.kms.v1.RawEncryptRequest - 26, // 73: google.cloud.kms.v1.KeyManagementService.RawDecrypt:input_type -> google.cloud.kms.v1.RawDecryptRequest - 27, // 74: google.cloud.kms.v1.KeyManagementService.AsymmetricSign:input_type -> google.cloud.kms.v1.AsymmetricSignRequest - 28, // 75: google.cloud.kms.v1.KeyManagementService.AsymmetricDecrypt:input_type -> google.cloud.kms.v1.AsymmetricDecryptRequest - 29, // 76: google.cloud.kms.v1.KeyManagementService.MacSign:input_type -> google.cloud.kms.v1.MacSignRequest - 30, // 77: google.cloud.kms.v1.KeyManagementService.MacVerify:input_type -> google.cloud.kms.v1.MacVerifyRequest - 31, // 78: google.cloud.kms.v1.KeyManagementService.GenerateRandomBytes:input_type -> google.cloud.kms.v1.GenerateRandomBytesRequest - 4, // 79: google.cloud.kms.v1.KeyManagementService.ListKeyRings:output_type -> google.cloud.kms.v1.ListKeyRingsResponse - 5, // 80: google.cloud.kms.v1.KeyManagementService.ListCryptoKeys:output_type -> google.cloud.kms.v1.ListCryptoKeysResponse - 6, // 81: google.cloud.kms.v1.KeyManagementService.ListCryptoKeyVersions:output_type -> google.cloud.kms.v1.ListCryptoKeyVersionsResponse - 7, // 82: google.cloud.kms.v1.KeyManagementService.ListImportJobs:output_type -> google.cloud.kms.v1.ListImportJobsResponse - 44, // 83: google.cloud.kms.v1.KeyManagementService.GetKeyRing:output_type -> google.cloud.kms.v1.KeyRing - 45, // 84: google.cloud.kms.v1.KeyManagementService.GetCryptoKey:output_type -> google.cloud.kms.v1.CryptoKey - 46, // 85: google.cloud.kms.v1.KeyManagementService.GetCryptoKeyVersion:output_type -> google.cloud.kms.v1.CryptoKeyVersion - 53, // 86: google.cloud.kms.v1.KeyManagementService.GetPublicKey:output_type -> google.cloud.kms.v1.PublicKey - 47, // 87: google.cloud.kms.v1.KeyManagementService.GetImportJob:output_type -> google.cloud.kms.v1.ImportJob - 44, // 88: google.cloud.kms.v1.KeyManagementService.CreateKeyRing:output_type -> google.cloud.kms.v1.KeyRing - 45, // 89: google.cloud.kms.v1.KeyManagementService.CreateCryptoKey:output_type -> google.cloud.kms.v1.CryptoKey - 46, // 90: google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion:output_type -> google.cloud.kms.v1.CryptoKeyVersion - 46, // 91: google.cloud.kms.v1.KeyManagementService.ImportCryptoKeyVersion:output_type -> google.cloud.kms.v1.CryptoKeyVersion - 47, // 92: google.cloud.kms.v1.KeyManagementService.CreateImportJob:output_type -> google.cloud.kms.v1.ImportJob - 45, // 93: google.cloud.kms.v1.KeyManagementService.UpdateCryptoKey:output_type -> google.cloud.kms.v1.CryptoKey - 46, // 94: google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyVersion:output_type -> google.cloud.kms.v1.CryptoKeyVersion - 45, // 95: google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion:output_type -> google.cloud.kms.v1.CryptoKey - 46, // 96: google.cloud.kms.v1.KeyManagementService.DestroyCryptoKeyVersion:output_type -> google.cloud.kms.v1.CryptoKeyVersion - 46, // 97: google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion:output_type -> google.cloud.kms.v1.CryptoKeyVersion - 32, // 98: google.cloud.kms.v1.KeyManagementService.Encrypt:output_type -> google.cloud.kms.v1.EncryptResponse - 33, // 99: google.cloud.kms.v1.KeyManagementService.Decrypt:output_type -> google.cloud.kms.v1.DecryptResponse - 34, // 100: google.cloud.kms.v1.KeyManagementService.RawEncrypt:output_type -> google.cloud.kms.v1.RawEncryptResponse - 35, // 101: google.cloud.kms.v1.KeyManagementService.RawDecrypt:output_type -> google.cloud.kms.v1.RawDecryptResponse - 36, // 102: google.cloud.kms.v1.KeyManagementService.AsymmetricSign:output_type -> google.cloud.kms.v1.AsymmetricSignResponse - 37, // 103: google.cloud.kms.v1.KeyManagementService.AsymmetricDecrypt:output_type -> google.cloud.kms.v1.AsymmetricDecryptResponse - 38, // 104: google.cloud.kms.v1.KeyManagementService.MacSign:output_type -> google.cloud.kms.v1.MacSignResponse - 39, // 105: google.cloud.kms.v1.KeyManagementService.MacVerify:output_type -> google.cloud.kms.v1.MacVerifyResponse - 40, // 106: google.cloud.kms.v1.KeyManagementService.GenerateRandomBytes:output_type -> google.cloud.kms.v1.GenerateRandomBytesResponse - 79, // [79:107] is the sub-list for method output_type - 51, // [51:79] is the sub-list for method input_type - 51, // [51:51] is the sub-list for extension type_name - 51, // [51:51] is the sub-list for extension extendee - 0, // [0:51] is the sub-list for field type_name + 45, // 0: google.cloud.kms.v1.ListCryptoKeysRequest.version_view:type_name -> google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView + 45, // 1: google.cloud.kms.v1.ListCryptoKeyVersionsRequest.view:type_name -> google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView + 46, // 2: google.cloud.kms.v1.ListKeyRingsResponse.key_rings:type_name -> google.cloud.kms.v1.KeyRing + 47, // 3: google.cloud.kms.v1.ListCryptoKeysResponse.crypto_keys:type_name -> google.cloud.kms.v1.CryptoKey + 48, // 4: google.cloud.kms.v1.ListCryptoKeyVersionsResponse.crypto_key_versions:type_name -> google.cloud.kms.v1.CryptoKeyVersion + 49, // 5: google.cloud.kms.v1.ListImportJobsResponse.import_jobs:type_name -> google.cloud.kms.v1.ImportJob + 50, // 6: google.cloud.kms.v1.GetPublicKeyRequest.public_key_format:type_name -> google.cloud.kms.v1.PublicKey.PublicKeyFormat + 46, // 7: google.cloud.kms.v1.CreateKeyRingRequest.key_ring:type_name -> google.cloud.kms.v1.KeyRing + 47, // 8: google.cloud.kms.v1.CreateCryptoKeyRequest.crypto_key:type_name -> google.cloud.kms.v1.CryptoKey + 48, // 9: google.cloud.kms.v1.CreateCryptoKeyVersionRequest.crypto_key_version:type_name -> google.cloud.kms.v1.CryptoKeyVersion + 51, // 10: google.cloud.kms.v1.ImportCryptoKeyVersionRequest.algorithm:type_name -> google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm + 49, // 11: google.cloud.kms.v1.CreateImportJobRequest.import_job:type_name -> google.cloud.kms.v1.ImportJob + 47, // 12: google.cloud.kms.v1.UpdateCryptoKeyRequest.crypto_key:type_name -> google.cloud.kms.v1.CryptoKey + 52, // 13: google.cloud.kms.v1.UpdateCryptoKeyRequest.update_mask:type_name -> google.protobuf.FieldMask + 48, // 14: google.cloud.kms.v1.UpdateCryptoKeyVersionRequest.crypto_key_version:type_name -> google.cloud.kms.v1.CryptoKeyVersion + 52, // 15: google.cloud.kms.v1.UpdateCryptoKeyVersionRequest.update_mask:type_name -> google.protobuf.FieldMask + 53, // 16: google.cloud.kms.v1.EncryptRequest.plaintext_crc32c:type_name -> google.protobuf.Int64Value + 53, // 17: google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c:type_name -> google.protobuf.Int64Value + 53, // 18: google.cloud.kms.v1.DecryptRequest.ciphertext_crc32c:type_name -> google.protobuf.Int64Value + 53, // 19: google.cloud.kms.v1.DecryptRequest.additional_authenticated_data_crc32c:type_name -> google.protobuf.Int64Value + 53, // 20: google.cloud.kms.v1.RawEncryptRequest.plaintext_crc32c:type_name -> google.protobuf.Int64Value + 53, // 21: google.cloud.kms.v1.RawEncryptRequest.additional_authenticated_data_crc32c:type_name -> google.protobuf.Int64Value + 53, // 22: google.cloud.kms.v1.RawEncryptRequest.initialization_vector_crc32c:type_name -> google.protobuf.Int64Value + 53, // 23: google.cloud.kms.v1.RawDecryptRequest.ciphertext_crc32c:type_name -> google.protobuf.Int64Value + 53, // 24: google.cloud.kms.v1.RawDecryptRequest.additional_authenticated_data_crc32c:type_name -> google.protobuf.Int64Value + 53, // 25: google.cloud.kms.v1.RawDecryptRequest.initialization_vector_crc32c:type_name -> google.protobuf.Int64Value + 43, // 26: google.cloud.kms.v1.AsymmetricSignRequest.digest:type_name -> google.cloud.kms.v1.Digest + 53, // 27: google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c:type_name -> google.protobuf.Int64Value + 53, // 28: google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c:type_name -> google.protobuf.Int64Value + 53, // 29: google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c:type_name -> google.protobuf.Int64Value + 53, // 30: google.cloud.kms.v1.MacSignRequest.data_crc32c:type_name -> google.protobuf.Int64Value + 53, // 31: google.cloud.kms.v1.MacVerifyRequest.data_crc32c:type_name -> google.protobuf.Int64Value + 53, // 32: google.cloud.kms.v1.MacVerifyRequest.mac_crc32c:type_name -> google.protobuf.Int64Value + 53, // 33: google.cloud.kms.v1.DecapsulateRequest.ciphertext_crc32c:type_name -> google.protobuf.Int64Value + 54, // 34: google.cloud.kms.v1.GenerateRandomBytesRequest.protection_level:type_name -> google.cloud.kms.v1.ProtectionLevel + 53, // 35: google.cloud.kms.v1.EncryptResponse.ciphertext_crc32c:type_name -> google.protobuf.Int64Value + 54, // 36: google.cloud.kms.v1.EncryptResponse.protection_level:type_name -> google.cloud.kms.v1.ProtectionLevel + 53, // 37: google.cloud.kms.v1.DecryptResponse.plaintext_crc32c:type_name -> google.protobuf.Int64Value + 54, // 38: google.cloud.kms.v1.DecryptResponse.protection_level:type_name -> google.cloud.kms.v1.ProtectionLevel + 53, // 39: google.cloud.kms.v1.RawEncryptResponse.ciphertext_crc32c:type_name -> google.protobuf.Int64Value + 53, // 40: google.cloud.kms.v1.RawEncryptResponse.initialization_vector_crc32c:type_name -> google.protobuf.Int64Value + 54, // 41: google.cloud.kms.v1.RawEncryptResponse.protection_level:type_name -> google.cloud.kms.v1.ProtectionLevel + 53, // 42: google.cloud.kms.v1.RawDecryptResponse.plaintext_crc32c:type_name -> google.protobuf.Int64Value + 54, // 43: google.cloud.kms.v1.RawDecryptResponse.protection_level:type_name -> google.cloud.kms.v1.ProtectionLevel + 53, // 44: google.cloud.kms.v1.AsymmetricSignResponse.signature_crc32c:type_name -> google.protobuf.Int64Value + 54, // 45: google.cloud.kms.v1.AsymmetricSignResponse.protection_level:type_name -> google.cloud.kms.v1.ProtectionLevel + 53, // 46: google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext_crc32c:type_name -> google.protobuf.Int64Value + 54, // 47: google.cloud.kms.v1.AsymmetricDecryptResponse.protection_level:type_name -> google.cloud.kms.v1.ProtectionLevel + 53, // 48: google.cloud.kms.v1.MacSignResponse.mac_crc32c:type_name -> google.protobuf.Int64Value + 54, // 49: google.cloud.kms.v1.MacSignResponse.protection_level:type_name -> google.cloud.kms.v1.ProtectionLevel + 54, // 50: google.cloud.kms.v1.MacVerifyResponse.protection_level:type_name -> google.cloud.kms.v1.ProtectionLevel + 54, // 51: google.cloud.kms.v1.DecapsulateResponse.protection_level:type_name -> google.cloud.kms.v1.ProtectionLevel + 53, // 52: google.cloud.kms.v1.GenerateRandomBytesResponse.data_crc32c:type_name -> google.protobuf.Int64Value + 0, // 53: google.cloud.kms.v1.KeyManagementService.ListKeyRings:input_type -> google.cloud.kms.v1.ListKeyRingsRequest + 1, // 54: google.cloud.kms.v1.KeyManagementService.ListCryptoKeys:input_type -> google.cloud.kms.v1.ListCryptoKeysRequest + 2, // 55: google.cloud.kms.v1.KeyManagementService.ListCryptoKeyVersions:input_type -> google.cloud.kms.v1.ListCryptoKeyVersionsRequest + 3, // 56: google.cloud.kms.v1.KeyManagementService.ListImportJobs:input_type -> google.cloud.kms.v1.ListImportJobsRequest + 8, // 57: google.cloud.kms.v1.KeyManagementService.GetKeyRing:input_type -> google.cloud.kms.v1.GetKeyRingRequest + 9, // 58: google.cloud.kms.v1.KeyManagementService.GetCryptoKey:input_type -> google.cloud.kms.v1.GetCryptoKeyRequest + 10, // 59: google.cloud.kms.v1.KeyManagementService.GetCryptoKeyVersion:input_type -> google.cloud.kms.v1.GetCryptoKeyVersionRequest + 11, // 60: google.cloud.kms.v1.KeyManagementService.GetPublicKey:input_type -> google.cloud.kms.v1.GetPublicKeyRequest + 12, // 61: google.cloud.kms.v1.KeyManagementService.GetImportJob:input_type -> google.cloud.kms.v1.GetImportJobRequest + 13, // 62: google.cloud.kms.v1.KeyManagementService.CreateKeyRing:input_type -> google.cloud.kms.v1.CreateKeyRingRequest + 14, // 63: google.cloud.kms.v1.KeyManagementService.CreateCryptoKey:input_type -> google.cloud.kms.v1.CreateCryptoKeyRequest + 15, // 64: google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion:input_type -> google.cloud.kms.v1.CreateCryptoKeyVersionRequest + 16, // 65: google.cloud.kms.v1.KeyManagementService.ImportCryptoKeyVersion:input_type -> google.cloud.kms.v1.ImportCryptoKeyVersionRequest + 17, // 66: google.cloud.kms.v1.KeyManagementService.CreateImportJob:input_type -> google.cloud.kms.v1.CreateImportJobRequest + 18, // 67: google.cloud.kms.v1.KeyManagementService.UpdateCryptoKey:input_type -> google.cloud.kms.v1.UpdateCryptoKeyRequest + 19, // 68: google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyVersion:input_type -> google.cloud.kms.v1.UpdateCryptoKeyVersionRequest + 20, // 69: google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion:input_type -> google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest + 21, // 70: google.cloud.kms.v1.KeyManagementService.DestroyCryptoKeyVersion:input_type -> google.cloud.kms.v1.DestroyCryptoKeyVersionRequest + 22, // 71: google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion:input_type -> google.cloud.kms.v1.RestoreCryptoKeyVersionRequest + 23, // 72: google.cloud.kms.v1.KeyManagementService.Encrypt:input_type -> google.cloud.kms.v1.EncryptRequest + 24, // 73: google.cloud.kms.v1.KeyManagementService.Decrypt:input_type -> google.cloud.kms.v1.DecryptRequest + 25, // 74: google.cloud.kms.v1.KeyManagementService.RawEncrypt:input_type -> google.cloud.kms.v1.RawEncryptRequest + 26, // 75: google.cloud.kms.v1.KeyManagementService.RawDecrypt:input_type -> google.cloud.kms.v1.RawDecryptRequest + 27, // 76: google.cloud.kms.v1.KeyManagementService.AsymmetricSign:input_type -> google.cloud.kms.v1.AsymmetricSignRequest + 28, // 77: google.cloud.kms.v1.KeyManagementService.AsymmetricDecrypt:input_type -> google.cloud.kms.v1.AsymmetricDecryptRequest + 29, // 78: google.cloud.kms.v1.KeyManagementService.MacSign:input_type -> google.cloud.kms.v1.MacSignRequest + 30, // 79: google.cloud.kms.v1.KeyManagementService.MacVerify:input_type -> google.cloud.kms.v1.MacVerifyRequest + 31, // 80: google.cloud.kms.v1.KeyManagementService.Decapsulate:input_type -> google.cloud.kms.v1.DecapsulateRequest + 32, // 81: google.cloud.kms.v1.KeyManagementService.GenerateRandomBytes:input_type -> google.cloud.kms.v1.GenerateRandomBytesRequest + 4, // 82: google.cloud.kms.v1.KeyManagementService.ListKeyRings:output_type -> google.cloud.kms.v1.ListKeyRingsResponse + 5, // 83: google.cloud.kms.v1.KeyManagementService.ListCryptoKeys:output_type -> google.cloud.kms.v1.ListCryptoKeysResponse + 6, // 84: google.cloud.kms.v1.KeyManagementService.ListCryptoKeyVersions:output_type -> google.cloud.kms.v1.ListCryptoKeyVersionsResponse + 7, // 85: google.cloud.kms.v1.KeyManagementService.ListImportJobs:output_type -> google.cloud.kms.v1.ListImportJobsResponse + 46, // 86: google.cloud.kms.v1.KeyManagementService.GetKeyRing:output_type -> google.cloud.kms.v1.KeyRing + 47, // 87: google.cloud.kms.v1.KeyManagementService.GetCryptoKey:output_type -> google.cloud.kms.v1.CryptoKey + 48, // 88: google.cloud.kms.v1.KeyManagementService.GetCryptoKeyVersion:output_type -> google.cloud.kms.v1.CryptoKeyVersion + 55, // 89: google.cloud.kms.v1.KeyManagementService.GetPublicKey:output_type -> google.cloud.kms.v1.PublicKey + 49, // 90: google.cloud.kms.v1.KeyManagementService.GetImportJob:output_type -> google.cloud.kms.v1.ImportJob + 46, // 91: google.cloud.kms.v1.KeyManagementService.CreateKeyRing:output_type -> google.cloud.kms.v1.KeyRing + 47, // 92: google.cloud.kms.v1.KeyManagementService.CreateCryptoKey:output_type -> google.cloud.kms.v1.CryptoKey + 48, // 93: google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion:output_type -> google.cloud.kms.v1.CryptoKeyVersion + 48, // 94: google.cloud.kms.v1.KeyManagementService.ImportCryptoKeyVersion:output_type -> google.cloud.kms.v1.CryptoKeyVersion + 49, // 95: google.cloud.kms.v1.KeyManagementService.CreateImportJob:output_type -> google.cloud.kms.v1.ImportJob + 47, // 96: google.cloud.kms.v1.KeyManagementService.UpdateCryptoKey:output_type -> google.cloud.kms.v1.CryptoKey + 48, // 97: google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyVersion:output_type -> google.cloud.kms.v1.CryptoKeyVersion + 47, // 98: google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion:output_type -> google.cloud.kms.v1.CryptoKey + 48, // 99: google.cloud.kms.v1.KeyManagementService.DestroyCryptoKeyVersion:output_type -> google.cloud.kms.v1.CryptoKeyVersion + 48, // 100: google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion:output_type -> google.cloud.kms.v1.CryptoKeyVersion + 33, // 101: google.cloud.kms.v1.KeyManagementService.Encrypt:output_type -> google.cloud.kms.v1.EncryptResponse + 34, // 102: google.cloud.kms.v1.KeyManagementService.Decrypt:output_type -> google.cloud.kms.v1.DecryptResponse + 35, // 103: google.cloud.kms.v1.KeyManagementService.RawEncrypt:output_type -> google.cloud.kms.v1.RawEncryptResponse + 36, // 104: google.cloud.kms.v1.KeyManagementService.RawDecrypt:output_type -> google.cloud.kms.v1.RawDecryptResponse + 37, // 105: google.cloud.kms.v1.KeyManagementService.AsymmetricSign:output_type -> google.cloud.kms.v1.AsymmetricSignResponse + 38, // 106: google.cloud.kms.v1.KeyManagementService.AsymmetricDecrypt:output_type -> google.cloud.kms.v1.AsymmetricDecryptResponse + 39, // 107: google.cloud.kms.v1.KeyManagementService.MacSign:output_type -> google.cloud.kms.v1.MacSignResponse + 40, // 108: google.cloud.kms.v1.KeyManagementService.MacVerify:output_type -> google.cloud.kms.v1.MacVerifyResponse + 41, // 109: google.cloud.kms.v1.KeyManagementService.Decapsulate:output_type -> google.cloud.kms.v1.DecapsulateResponse + 42, // 110: google.cloud.kms.v1.KeyManagementService.GenerateRandomBytes:output_type -> google.cloud.kms.v1.GenerateRandomBytesResponse + 82, // [82:111] is the sub-list for method output_type + 53, // [53:82] is the sub-list for method input_type + 53, // [53:53] is the sub-list for extension type_name + 53, // [53:53] is the sub-list for extension extendee + 0, // [0:53] is the sub-list for field type_name } func init() { file_google_cloud_kms_v1_service_proto_init() } @@ -5382,7 +5652,8 @@ func file_google_cloud_kms_v1_service_proto_init() { file_google_cloud_kms_v1_service_proto_msgTypes[16].OneofWrappers = []any{ (*ImportCryptoKeyVersionRequest_RsaAesWrappedKey)(nil), } - file_google_cloud_kms_v1_service_proto_msgTypes[41].OneofWrappers = []any{ + file_google_cloud_kms_v1_service_proto_msgTypes[41].OneofWrappers = []any{} + file_google_cloud_kms_v1_service_proto_msgTypes[43].OneofWrappers = []any{ (*Digest_Sha256)(nil), (*Digest_Sha384)(nil), (*Digest_Sha512)(nil), @@ -5393,7 +5664,7 @@ func file_google_cloud_kms_v1_service_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_google_cloud_kms_v1_service_proto_rawDesc, NumEnums: 0, - NumMessages: 43, + NumMessages: 45, NumExtensions: 0, NumServices: 1, }, @@ -5406,1315 +5677,3 @@ func file_google_cloud_kms_v1_service_proto_init() { file_google_cloud_kms_v1_service_proto_goTypes = nil file_google_cloud_kms_v1_service_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// KeyManagementServiceClient is the client API for KeyManagementService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type KeyManagementServiceClient interface { - // Lists [KeyRings][google.cloud.kms.v1.KeyRing]. - ListKeyRings(ctx context.Context, in *ListKeyRingsRequest, opts ...grpc.CallOption) (*ListKeyRingsResponse, error) - // Lists [CryptoKeys][google.cloud.kms.v1.CryptoKey]. - ListCryptoKeys(ctx context.Context, in *ListCryptoKeysRequest, opts ...grpc.CallOption) (*ListCryptoKeysResponse, error) - // Lists [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. - ListCryptoKeyVersions(ctx context.Context, in *ListCryptoKeyVersionsRequest, opts ...grpc.CallOption) (*ListCryptoKeyVersionsResponse, error) - // Lists [ImportJobs][google.cloud.kms.v1.ImportJob]. - ListImportJobs(ctx context.Context, in *ListImportJobsRequest, opts ...grpc.CallOption) (*ListImportJobsResponse, error) - // Returns metadata for a given [KeyRing][google.cloud.kms.v1.KeyRing]. - GetKeyRing(ctx context.Context, in *GetKeyRingRequest, opts ...grpc.CallOption) (*KeyRing, error) - // Returns metadata for a given [CryptoKey][google.cloud.kms.v1.CryptoKey], as - // well as its [primary][google.cloud.kms.v1.CryptoKey.primary] - // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. - GetCryptoKey(ctx context.Context, in *GetCryptoKeyRequest, opts ...grpc.CallOption) (*CryptoKey, error) - // Returns metadata for a given - // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. - GetCryptoKeyVersion(ctx context.Context, in *GetCryptoKeyVersionRequest, opts ...grpc.CallOption) (*CryptoKeyVersion, error) - // Returns the public key for the given - // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. The - // [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be - // [ASYMMETRIC_SIGN][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_SIGN] - // or - // [ASYMMETRIC_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_DECRYPT]. - GetPublicKey(ctx context.Context, in *GetPublicKeyRequest, opts ...grpc.CallOption) (*PublicKey, error) - // Returns metadata for a given [ImportJob][google.cloud.kms.v1.ImportJob]. - GetImportJob(ctx context.Context, in *GetImportJobRequest, opts ...grpc.CallOption) (*ImportJob, error) - // Create a new [KeyRing][google.cloud.kms.v1.KeyRing] in a given Project and - // Location. - CreateKeyRing(ctx context.Context, in *CreateKeyRingRequest, opts ...grpc.CallOption) (*KeyRing, error) - // Create a new [CryptoKey][google.cloud.kms.v1.CryptoKey] within a - // [KeyRing][google.cloud.kms.v1.KeyRing]. - // - // [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] and - // [CryptoKey.version_template.algorithm][google.cloud.kms.v1.CryptoKeyVersionTemplate.algorithm] - // are required. - CreateCryptoKey(ctx context.Context, in *CreateCryptoKeyRequest, opts ...grpc.CallOption) (*CryptoKey, error) - // Create a new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in a - // [CryptoKey][google.cloud.kms.v1.CryptoKey]. - // - // The server will assign the next sequential id. If unset, - // [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to - // [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED]. - CreateCryptoKeyVersion(ctx context.Context, in *CreateCryptoKeyVersionRequest, opts ...grpc.CallOption) (*CryptoKeyVersion, error) - // Import wrapped key material into a - // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. - // - // All requests must specify a [CryptoKey][google.cloud.kms.v1.CryptoKey]. If - // a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] is additionally - // specified in the request, key material will be reimported into that - // version. Otherwise, a new version will be created, and will be assigned the - // next sequential id within the [CryptoKey][google.cloud.kms.v1.CryptoKey]. - ImportCryptoKeyVersion(ctx context.Context, in *ImportCryptoKeyVersionRequest, opts ...grpc.CallOption) (*CryptoKeyVersion, error) - // Create a new [ImportJob][google.cloud.kms.v1.ImportJob] within a - // [KeyRing][google.cloud.kms.v1.KeyRing]. - // - // [ImportJob.import_method][google.cloud.kms.v1.ImportJob.import_method] is - // required. - CreateImportJob(ctx context.Context, in *CreateImportJobRequest, opts ...grpc.CallOption) (*ImportJob, error) - // Update a [CryptoKey][google.cloud.kms.v1.CryptoKey]. - UpdateCryptoKey(ctx context.Context, in *UpdateCryptoKeyRequest, opts ...grpc.CallOption) (*CryptoKey, error) - // Update a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s - // metadata. - // - // [state][google.cloud.kms.v1.CryptoKeyVersion.state] may be changed between - // [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED] - // and - // [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED] - // using this method. See - // [DestroyCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.DestroyCryptoKeyVersion] - // and - // [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] - // to move between other states. - UpdateCryptoKeyVersion(ctx context.Context, in *UpdateCryptoKeyVersionRequest, opts ...grpc.CallOption) (*CryptoKeyVersion, error) - // Update the version of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that - // will be used in - // [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. - // - // Returns an error if called on a key whose purpose is not - // [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. - UpdateCryptoKeyPrimaryVersion(ctx context.Context, in *UpdateCryptoKeyPrimaryVersionRequest, opts ...grpc.CallOption) (*CryptoKey, error) - // Schedule a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] for - // destruction. - // - // Upon calling this method, - // [CryptoKeyVersion.state][google.cloud.kms.v1.CryptoKeyVersion.state] will - // be set to - // [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED], - // and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will - // be set to the time - // [destroy_scheduled_duration][google.cloud.kms.v1.CryptoKey.destroy_scheduled_duration] - // in the future. At that time, the - // [state][google.cloud.kms.v1.CryptoKeyVersion.state] will automatically - // change to - // [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED], - // and the key material will be irrevocably destroyed. - // - // Before the - // [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] is - // reached, - // [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] - // may be called to reverse the process. - DestroyCryptoKeyVersion(ctx context.Context, in *DestroyCryptoKeyVersionRequest, opts ...grpc.CallOption) (*CryptoKeyVersion, error) - // Restore a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the - // [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED] - // state. - // - // Upon restoration of the CryptoKeyVersion, - // [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to - // [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED], - // and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will - // be cleared. - RestoreCryptoKeyVersion(ctx context.Context, in *RestoreCryptoKeyVersionRequest, opts ...grpc.CallOption) (*CryptoKeyVersion, error) - // Encrypts data, so that it can only be recovered by a call to - // [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. The - // [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be - // [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. - Encrypt(ctx context.Context, in *EncryptRequest, opts ...grpc.CallOption) (*EncryptResponse, error) - // Decrypts data that was protected by - // [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. The - // [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be - // [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. - Decrypt(ctx context.Context, in *DecryptRequest, opts ...grpc.CallOption) (*DecryptResponse, error) - // Encrypts data using portable cryptographic primitives. Most users should - // choose [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] and - // [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt] rather than - // their raw counterparts. The - // [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be - // [RAW_ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.RAW_ENCRYPT_DECRYPT]. - RawEncrypt(ctx context.Context, in *RawEncryptRequest, opts ...grpc.CallOption) (*RawEncryptResponse, error) - // Decrypts data that was originally encrypted using a raw cryptographic - // mechanism. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] - // must be - // [RAW_ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.RAW_ENCRYPT_DECRYPT]. - RawDecrypt(ctx context.Context, in *RawDecryptRequest, opts ...grpc.CallOption) (*RawDecryptResponse, error) - // Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] - // with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] - // ASYMMETRIC_SIGN, producing a signature that can be verified with the public - // key retrieved from - // [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey]. - AsymmetricSign(ctx context.Context, in *AsymmetricSignRequest, opts ...grpc.CallOption) (*AsymmetricSignResponse, error) - // Decrypts data that was encrypted with a public key retrieved from - // [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] - // corresponding to a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] - // with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] - // ASYMMETRIC_DECRYPT. - AsymmetricDecrypt(ctx context.Context, in *AsymmetricDecryptRequest, opts ...grpc.CallOption) (*AsymmetricDecryptResponse, error) - // Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] - // with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] MAC, - // producing a tag that can be verified by another source with the same key. - MacSign(ctx context.Context, in *MacSignRequest, opts ...grpc.CallOption) (*MacSignResponse, error) - // Verifies MAC tag using a - // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with - // [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] MAC, and returns - // a response that indicates whether or not the verification was successful. - MacVerify(ctx context.Context, in *MacVerifyRequest, opts ...grpc.CallOption) (*MacVerifyResponse, error) - // Generate random bytes using the Cloud KMS randomness source in the provided - // location. - GenerateRandomBytes(ctx context.Context, in *GenerateRandomBytesRequest, opts ...grpc.CallOption) (*GenerateRandomBytesResponse, error) -} - -type keyManagementServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewKeyManagementServiceClient(cc grpc.ClientConnInterface) KeyManagementServiceClient { - return &keyManagementServiceClient{cc} -} - -func (c *keyManagementServiceClient) ListKeyRings(ctx context.Context, in *ListKeyRingsRequest, opts ...grpc.CallOption) (*ListKeyRingsResponse, error) { - out := new(ListKeyRingsResponse) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.KeyManagementService/ListKeyRings", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *keyManagementServiceClient) ListCryptoKeys(ctx context.Context, in *ListCryptoKeysRequest, opts ...grpc.CallOption) (*ListCryptoKeysResponse, error) { - out := new(ListCryptoKeysResponse) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.KeyManagementService/ListCryptoKeys", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *keyManagementServiceClient) ListCryptoKeyVersions(ctx context.Context, in *ListCryptoKeyVersionsRequest, opts ...grpc.CallOption) (*ListCryptoKeyVersionsResponse, error) { - out := new(ListCryptoKeyVersionsResponse) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.KeyManagementService/ListCryptoKeyVersions", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *keyManagementServiceClient) ListImportJobs(ctx context.Context, in *ListImportJobsRequest, opts ...grpc.CallOption) (*ListImportJobsResponse, error) { - out := new(ListImportJobsResponse) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.KeyManagementService/ListImportJobs", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *keyManagementServiceClient) GetKeyRing(ctx context.Context, in *GetKeyRingRequest, opts ...grpc.CallOption) (*KeyRing, error) { - out := new(KeyRing) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.KeyManagementService/GetKeyRing", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *keyManagementServiceClient) GetCryptoKey(ctx context.Context, in *GetCryptoKeyRequest, opts ...grpc.CallOption) (*CryptoKey, error) { - out := new(CryptoKey) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.KeyManagementService/GetCryptoKey", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *keyManagementServiceClient) GetCryptoKeyVersion(ctx context.Context, in *GetCryptoKeyVersionRequest, opts ...grpc.CallOption) (*CryptoKeyVersion, error) { - out := new(CryptoKeyVersion) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.KeyManagementService/GetCryptoKeyVersion", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *keyManagementServiceClient) GetPublicKey(ctx context.Context, in *GetPublicKeyRequest, opts ...grpc.CallOption) (*PublicKey, error) { - out := new(PublicKey) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.KeyManagementService/GetPublicKey", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *keyManagementServiceClient) GetImportJob(ctx context.Context, in *GetImportJobRequest, opts ...grpc.CallOption) (*ImportJob, error) { - out := new(ImportJob) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.KeyManagementService/GetImportJob", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *keyManagementServiceClient) CreateKeyRing(ctx context.Context, in *CreateKeyRingRequest, opts ...grpc.CallOption) (*KeyRing, error) { - out := new(KeyRing) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.KeyManagementService/CreateKeyRing", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *keyManagementServiceClient) CreateCryptoKey(ctx context.Context, in *CreateCryptoKeyRequest, opts ...grpc.CallOption) (*CryptoKey, error) { - out := new(CryptoKey) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.KeyManagementService/CreateCryptoKey", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *keyManagementServiceClient) CreateCryptoKeyVersion(ctx context.Context, in *CreateCryptoKeyVersionRequest, opts ...grpc.CallOption) (*CryptoKeyVersion, error) { - out := new(CryptoKeyVersion) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.KeyManagementService/CreateCryptoKeyVersion", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *keyManagementServiceClient) ImportCryptoKeyVersion(ctx context.Context, in *ImportCryptoKeyVersionRequest, opts ...grpc.CallOption) (*CryptoKeyVersion, error) { - out := new(CryptoKeyVersion) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.KeyManagementService/ImportCryptoKeyVersion", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *keyManagementServiceClient) CreateImportJob(ctx context.Context, in *CreateImportJobRequest, opts ...grpc.CallOption) (*ImportJob, error) { - out := new(ImportJob) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.KeyManagementService/CreateImportJob", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *keyManagementServiceClient) UpdateCryptoKey(ctx context.Context, in *UpdateCryptoKeyRequest, opts ...grpc.CallOption) (*CryptoKey, error) { - out := new(CryptoKey) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.KeyManagementService/UpdateCryptoKey", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *keyManagementServiceClient) UpdateCryptoKeyVersion(ctx context.Context, in *UpdateCryptoKeyVersionRequest, opts ...grpc.CallOption) (*CryptoKeyVersion, error) { - out := new(CryptoKeyVersion) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.KeyManagementService/UpdateCryptoKeyVersion", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *keyManagementServiceClient) UpdateCryptoKeyPrimaryVersion(ctx context.Context, in *UpdateCryptoKeyPrimaryVersionRequest, opts ...grpc.CallOption) (*CryptoKey, error) { - out := new(CryptoKey) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.KeyManagementService/UpdateCryptoKeyPrimaryVersion", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *keyManagementServiceClient) DestroyCryptoKeyVersion(ctx context.Context, in *DestroyCryptoKeyVersionRequest, opts ...grpc.CallOption) (*CryptoKeyVersion, error) { - out := new(CryptoKeyVersion) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.KeyManagementService/DestroyCryptoKeyVersion", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *keyManagementServiceClient) RestoreCryptoKeyVersion(ctx context.Context, in *RestoreCryptoKeyVersionRequest, opts ...grpc.CallOption) (*CryptoKeyVersion, error) { - out := new(CryptoKeyVersion) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.KeyManagementService/RestoreCryptoKeyVersion", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *keyManagementServiceClient) Encrypt(ctx context.Context, in *EncryptRequest, opts ...grpc.CallOption) (*EncryptResponse, error) { - out := new(EncryptResponse) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.KeyManagementService/Encrypt", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *keyManagementServiceClient) Decrypt(ctx context.Context, in *DecryptRequest, opts ...grpc.CallOption) (*DecryptResponse, error) { - out := new(DecryptResponse) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.KeyManagementService/Decrypt", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *keyManagementServiceClient) RawEncrypt(ctx context.Context, in *RawEncryptRequest, opts ...grpc.CallOption) (*RawEncryptResponse, error) { - out := new(RawEncryptResponse) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.KeyManagementService/RawEncrypt", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *keyManagementServiceClient) RawDecrypt(ctx context.Context, in *RawDecryptRequest, opts ...grpc.CallOption) (*RawDecryptResponse, error) { - out := new(RawDecryptResponse) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.KeyManagementService/RawDecrypt", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *keyManagementServiceClient) AsymmetricSign(ctx context.Context, in *AsymmetricSignRequest, opts ...grpc.CallOption) (*AsymmetricSignResponse, error) { - out := new(AsymmetricSignResponse) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.KeyManagementService/AsymmetricSign", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *keyManagementServiceClient) AsymmetricDecrypt(ctx context.Context, in *AsymmetricDecryptRequest, opts ...grpc.CallOption) (*AsymmetricDecryptResponse, error) { - out := new(AsymmetricDecryptResponse) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.KeyManagementService/AsymmetricDecrypt", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *keyManagementServiceClient) MacSign(ctx context.Context, in *MacSignRequest, opts ...grpc.CallOption) (*MacSignResponse, error) { - out := new(MacSignResponse) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.KeyManagementService/MacSign", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *keyManagementServiceClient) MacVerify(ctx context.Context, in *MacVerifyRequest, opts ...grpc.CallOption) (*MacVerifyResponse, error) { - out := new(MacVerifyResponse) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.KeyManagementService/MacVerify", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *keyManagementServiceClient) GenerateRandomBytes(ctx context.Context, in *GenerateRandomBytesRequest, opts ...grpc.CallOption) (*GenerateRandomBytesResponse, error) { - out := new(GenerateRandomBytesResponse) - err := c.cc.Invoke(ctx, "/google.cloud.kms.v1.KeyManagementService/GenerateRandomBytes", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// KeyManagementServiceServer is the server API for KeyManagementService service. -type KeyManagementServiceServer interface { - // Lists [KeyRings][google.cloud.kms.v1.KeyRing]. - ListKeyRings(context.Context, *ListKeyRingsRequest) (*ListKeyRingsResponse, error) - // Lists [CryptoKeys][google.cloud.kms.v1.CryptoKey]. - ListCryptoKeys(context.Context, *ListCryptoKeysRequest) (*ListCryptoKeysResponse, error) - // Lists [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. - ListCryptoKeyVersions(context.Context, *ListCryptoKeyVersionsRequest) (*ListCryptoKeyVersionsResponse, error) - // Lists [ImportJobs][google.cloud.kms.v1.ImportJob]. - ListImportJobs(context.Context, *ListImportJobsRequest) (*ListImportJobsResponse, error) - // Returns metadata for a given [KeyRing][google.cloud.kms.v1.KeyRing]. - GetKeyRing(context.Context, *GetKeyRingRequest) (*KeyRing, error) - // Returns metadata for a given [CryptoKey][google.cloud.kms.v1.CryptoKey], as - // well as its [primary][google.cloud.kms.v1.CryptoKey.primary] - // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. - GetCryptoKey(context.Context, *GetCryptoKeyRequest) (*CryptoKey, error) - // Returns metadata for a given - // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. - GetCryptoKeyVersion(context.Context, *GetCryptoKeyVersionRequest) (*CryptoKeyVersion, error) - // Returns the public key for the given - // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. The - // [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be - // [ASYMMETRIC_SIGN][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_SIGN] - // or - // [ASYMMETRIC_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_DECRYPT]. - GetPublicKey(context.Context, *GetPublicKeyRequest) (*PublicKey, error) - // Returns metadata for a given [ImportJob][google.cloud.kms.v1.ImportJob]. - GetImportJob(context.Context, *GetImportJobRequest) (*ImportJob, error) - // Create a new [KeyRing][google.cloud.kms.v1.KeyRing] in a given Project and - // Location. - CreateKeyRing(context.Context, *CreateKeyRingRequest) (*KeyRing, error) - // Create a new [CryptoKey][google.cloud.kms.v1.CryptoKey] within a - // [KeyRing][google.cloud.kms.v1.KeyRing]. - // - // [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] and - // [CryptoKey.version_template.algorithm][google.cloud.kms.v1.CryptoKeyVersionTemplate.algorithm] - // are required. - CreateCryptoKey(context.Context, *CreateCryptoKeyRequest) (*CryptoKey, error) - // Create a new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in a - // [CryptoKey][google.cloud.kms.v1.CryptoKey]. - // - // The server will assign the next sequential id. If unset, - // [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to - // [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED]. - CreateCryptoKeyVersion(context.Context, *CreateCryptoKeyVersionRequest) (*CryptoKeyVersion, error) - // Import wrapped key material into a - // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. - // - // All requests must specify a [CryptoKey][google.cloud.kms.v1.CryptoKey]. If - // a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] is additionally - // specified in the request, key material will be reimported into that - // version. Otherwise, a new version will be created, and will be assigned the - // next sequential id within the [CryptoKey][google.cloud.kms.v1.CryptoKey]. - ImportCryptoKeyVersion(context.Context, *ImportCryptoKeyVersionRequest) (*CryptoKeyVersion, error) - // Create a new [ImportJob][google.cloud.kms.v1.ImportJob] within a - // [KeyRing][google.cloud.kms.v1.KeyRing]. - // - // [ImportJob.import_method][google.cloud.kms.v1.ImportJob.import_method] is - // required. - CreateImportJob(context.Context, *CreateImportJobRequest) (*ImportJob, error) - // Update a [CryptoKey][google.cloud.kms.v1.CryptoKey]. - UpdateCryptoKey(context.Context, *UpdateCryptoKeyRequest) (*CryptoKey, error) - // Update a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s - // metadata. - // - // [state][google.cloud.kms.v1.CryptoKeyVersion.state] may be changed between - // [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED] - // and - // [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED] - // using this method. See - // [DestroyCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.DestroyCryptoKeyVersion] - // and - // [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] - // to move between other states. - UpdateCryptoKeyVersion(context.Context, *UpdateCryptoKeyVersionRequest) (*CryptoKeyVersion, error) - // Update the version of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that - // will be used in - // [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. - // - // Returns an error if called on a key whose purpose is not - // [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. - UpdateCryptoKeyPrimaryVersion(context.Context, *UpdateCryptoKeyPrimaryVersionRequest) (*CryptoKey, error) - // Schedule a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] for - // destruction. - // - // Upon calling this method, - // [CryptoKeyVersion.state][google.cloud.kms.v1.CryptoKeyVersion.state] will - // be set to - // [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED], - // and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will - // be set to the time - // [destroy_scheduled_duration][google.cloud.kms.v1.CryptoKey.destroy_scheduled_duration] - // in the future. At that time, the - // [state][google.cloud.kms.v1.CryptoKeyVersion.state] will automatically - // change to - // [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED], - // and the key material will be irrevocably destroyed. - // - // Before the - // [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] is - // reached, - // [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] - // may be called to reverse the process. - DestroyCryptoKeyVersion(context.Context, *DestroyCryptoKeyVersionRequest) (*CryptoKeyVersion, error) - // Restore a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the - // [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED] - // state. - // - // Upon restoration of the CryptoKeyVersion, - // [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to - // [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED], - // and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will - // be cleared. - RestoreCryptoKeyVersion(context.Context, *RestoreCryptoKeyVersionRequest) (*CryptoKeyVersion, error) - // Encrypts data, so that it can only be recovered by a call to - // [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. The - // [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be - // [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. - Encrypt(context.Context, *EncryptRequest) (*EncryptResponse, error) - // Decrypts data that was protected by - // [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. The - // [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be - // [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. - Decrypt(context.Context, *DecryptRequest) (*DecryptResponse, error) - // Encrypts data using portable cryptographic primitives. Most users should - // choose [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] and - // [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt] rather than - // their raw counterparts. The - // [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be - // [RAW_ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.RAW_ENCRYPT_DECRYPT]. - RawEncrypt(context.Context, *RawEncryptRequest) (*RawEncryptResponse, error) - // Decrypts data that was originally encrypted using a raw cryptographic - // mechanism. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] - // must be - // [RAW_ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.RAW_ENCRYPT_DECRYPT]. - RawDecrypt(context.Context, *RawDecryptRequest) (*RawDecryptResponse, error) - // Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] - // with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] - // ASYMMETRIC_SIGN, producing a signature that can be verified with the public - // key retrieved from - // [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey]. - AsymmetricSign(context.Context, *AsymmetricSignRequest) (*AsymmetricSignResponse, error) - // Decrypts data that was encrypted with a public key retrieved from - // [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] - // corresponding to a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] - // with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] - // ASYMMETRIC_DECRYPT. - AsymmetricDecrypt(context.Context, *AsymmetricDecryptRequest) (*AsymmetricDecryptResponse, error) - // Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] - // with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] MAC, - // producing a tag that can be verified by another source with the same key. - MacSign(context.Context, *MacSignRequest) (*MacSignResponse, error) - // Verifies MAC tag using a - // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with - // [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] MAC, and returns - // a response that indicates whether or not the verification was successful. - MacVerify(context.Context, *MacVerifyRequest) (*MacVerifyResponse, error) - // Generate random bytes using the Cloud KMS randomness source in the provided - // location. - GenerateRandomBytes(context.Context, *GenerateRandomBytesRequest) (*GenerateRandomBytesResponse, error) -} - -// UnimplementedKeyManagementServiceServer can be embedded to have forward compatible implementations. -type UnimplementedKeyManagementServiceServer struct { -} - -func (*UnimplementedKeyManagementServiceServer) ListKeyRings(context.Context, *ListKeyRingsRequest) (*ListKeyRingsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListKeyRings not implemented") -} -func (*UnimplementedKeyManagementServiceServer) ListCryptoKeys(context.Context, *ListCryptoKeysRequest) (*ListCryptoKeysResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListCryptoKeys not implemented") -} -func (*UnimplementedKeyManagementServiceServer) ListCryptoKeyVersions(context.Context, *ListCryptoKeyVersionsRequest) (*ListCryptoKeyVersionsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListCryptoKeyVersions not implemented") -} -func (*UnimplementedKeyManagementServiceServer) ListImportJobs(context.Context, *ListImportJobsRequest) (*ListImportJobsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListImportJobs not implemented") -} -func (*UnimplementedKeyManagementServiceServer) GetKeyRing(context.Context, *GetKeyRingRequest) (*KeyRing, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetKeyRing not implemented") -} -func (*UnimplementedKeyManagementServiceServer) GetCryptoKey(context.Context, *GetCryptoKeyRequest) (*CryptoKey, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetCryptoKey not implemented") -} -func (*UnimplementedKeyManagementServiceServer) GetCryptoKeyVersion(context.Context, *GetCryptoKeyVersionRequest) (*CryptoKeyVersion, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetCryptoKeyVersion not implemented") -} -func (*UnimplementedKeyManagementServiceServer) GetPublicKey(context.Context, *GetPublicKeyRequest) (*PublicKey, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetPublicKey not implemented") -} -func (*UnimplementedKeyManagementServiceServer) GetImportJob(context.Context, *GetImportJobRequest) (*ImportJob, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetImportJob not implemented") -} -func (*UnimplementedKeyManagementServiceServer) CreateKeyRing(context.Context, *CreateKeyRingRequest) (*KeyRing, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateKeyRing not implemented") -} -func (*UnimplementedKeyManagementServiceServer) CreateCryptoKey(context.Context, *CreateCryptoKeyRequest) (*CryptoKey, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateCryptoKey not implemented") -} -func (*UnimplementedKeyManagementServiceServer) CreateCryptoKeyVersion(context.Context, *CreateCryptoKeyVersionRequest) (*CryptoKeyVersion, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateCryptoKeyVersion not implemented") -} -func (*UnimplementedKeyManagementServiceServer) ImportCryptoKeyVersion(context.Context, *ImportCryptoKeyVersionRequest) (*CryptoKeyVersion, error) { - return nil, status.Errorf(codes.Unimplemented, "method ImportCryptoKeyVersion not implemented") -} -func (*UnimplementedKeyManagementServiceServer) CreateImportJob(context.Context, *CreateImportJobRequest) (*ImportJob, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateImportJob not implemented") -} -func (*UnimplementedKeyManagementServiceServer) UpdateCryptoKey(context.Context, *UpdateCryptoKeyRequest) (*CryptoKey, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateCryptoKey not implemented") -} -func (*UnimplementedKeyManagementServiceServer) UpdateCryptoKeyVersion(context.Context, *UpdateCryptoKeyVersionRequest) (*CryptoKeyVersion, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateCryptoKeyVersion not implemented") -} -func (*UnimplementedKeyManagementServiceServer) UpdateCryptoKeyPrimaryVersion(context.Context, *UpdateCryptoKeyPrimaryVersionRequest) (*CryptoKey, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateCryptoKeyPrimaryVersion not implemented") -} -func (*UnimplementedKeyManagementServiceServer) DestroyCryptoKeyVersion(context.Context, *DestroyCryptoKeyVersionRequest) (*CryptoKeyVersion, error) { - return nil, status.Errorf(codes.Unimplemented, "method DestroyCryptoKeyVersion not implemented") -} -func (*UnimplementedKeyManagementServiceServer) RestoreCryptoKeyVersion(context.Context, *RestoreCryptoKeyVersionRequest) (*CryptoKeyVersion, error) { - return nil, status.Errorf(codes.Unimplemented, "method RestoreCryptoKeyVersion not implemented") -} -func (*UnimplementedKeyManagementServiceServer) Encrypt(context.Context, *EncryptRequest) (*EncryptResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Encrypt not implemented") -} -func (*UnimplementedKeyManagementServiceServer) Decrypt(context.Context, *DecryptRequest) (*DecryptResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Decrypt not implemented") -} -func (*UnimplementedKeyManagementServiceServer) RawEncrypt(context.Context, *RawEncryptRequest) (*RawEncryptResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RawEncrypt not implemented") -} -func (*UnimplementedKeyManagementServiceServer) RawDecrypt(context.Context, *RawDecryptRequest) (*RawDecryptResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RawDecrypt not implemented") -} -func (*UnimplementedKeyManagementServiceServer) AsymmetricSign(context.Context, *AsymmetricSignRequest) (*AsymmetricSignResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AsymmetricSign not implemented") -} -func (*UnimplementedKeyManagementServiceServer) AsymmetricDecrypt(context.Context, *AsymmetricDecryptRequest) (*AsymmetricDecryptResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AsymmetricDecrypt not implemented") -} -func (*UnimplementedKeyManagementServiceServer) MacSign(context.Context, *MacSignRequest) (*MacSignResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method MacSign not implemented") -} -func (*UnimplementedKeyManagementServiceServer) MacVerify(context.Context, *MacVerifyRequest) (*MacVerifyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method MacVerify not implemented") -} -func (*UnimplementedKeyManagementServiceServer) GenerateRandomBytes(context.Context, *GenerateRandomBytesRequest) (*GenerateRandomBytesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GenerateRandomBytes not implemented") -} - -func RegisterKeyManagementServiceServer(s *grpc.Server, srv KeyManagementServiceServer) { - s.RegisterService(&_KeyManagementService_serviceDesc, srv) -} - -func _KeyManagementService_ListKeyRings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListKeyRingsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeyManagementServiceServer).ListKeyRings(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.KeyManagementService/ListKeyRings", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeyManagementServiceServer).ListKeyRings(ctx, req.(*ListKeyRingsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KeyManagementService_ListCryptoKeys_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListCryptoKeysRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeyManagementServiceServer).ListCryptoKeys(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.KeyManagementService/ListCryptoKeys", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeyManagementServiceServer).ListCryptoKeys(ctx, req.(*ListCryptoKeysRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KeyManagementService_ListCryptoKeyVersions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListCryptoKeyVersionsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeyManagementServiceServer).ListCryptoKeyVersions(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.KeyManagementService/ListCryptoKeyVersions", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeyManagementServiceServer).ListCryptoKeyVersions(ctx, req.(*ListCryptoKeyVersionsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KeyManagementService_ListImportJobs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListImportJobsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeyManagementServiceServer).ListImportJobs(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.KeyManagementService/ListImportJobs", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeyManagementServiceServer).ListImportJobs(ctx, req.(*ListImportJobsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KeyManagementService_GetKeyRing_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetKeyRingRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeyManagementServiceServer).GetKeyRing(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.KeyManagementService/GetKeyRing", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeyManagementServiceServer).GetKeyRing(ctx, req.(*GetKeyRingRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KeyManagementService_GetCryptoKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetCryptoKeyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeyManagementServiceServer).GetCryptoKey(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.KeyManagementService/GetCryptoKey", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeyManagementServiceServer).GetCryptoKey(ctx, req.(*GetCryptoKeyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KeyManagementService_GetCryptoKeyVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetCryptoKeyVersionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeyManagementServiceServer).GetCryptoKeyVersion(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.KeyManagementService/GetCryptoKeyVersion", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeyManagementServiceServer).GetCryptoKeyVersion(ctx, req.(*GetCryptoKeyVersionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KeyManagementService_GetPublicKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetPublicKeyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeyManagementServiceServer).GetPublicKey(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.KeyManagementService/GetPublicKey", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeyManagementServiceServer).GetPublicKey(ctx, req.(*GetPublicKeyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KeyManagementService_GetImportJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetImportJobRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeyManagementServiceServer).GetImportJob(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.KeyManagementService/GetImportJob", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeyManagementServiceServer).GetImportJob(ctx, req.(*GetImportJobRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KeyManagementService_CreateKeyRing_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateKeyRingRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeyManagementServiceServer).CreateKeyRing(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.KeyManagementService/CreateKeyRing", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeyManagementServiceServer).CreateKeyRing(ctx, req.(*CreateKeyRingRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KeyManagementService_CreateCryptoKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateCryptoKeyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeyManagementServiceServer).CreateCryptoKey(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.KeyManagementService/CreateCryptoKey", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeyManagementServiceServer).CreateCryptoKey(ctx, req.(*CreateCryptoKeyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KeyManagementService_CreateCryptoKeyVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateCryptoKeyVersionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeyManagementServiceServer).CreateCryptoKeyVersion(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.KeyManagementService/CreateCryptoKeyVersion", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeyManagementServiceServer).CreateCryptoKeyVersion(ctx, req.(*CreateCryptoKeyVersionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KeyManagementService_ImportCryptoKeyVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ImportCryptoKeyVersionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeyManagementServiceServer).ImportCryptoKeyVersion(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.KeyManagementService/ImportCryptoKeyVersion", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeyManagementServiceServer).ImportCryptoKeyVersion(ctx, req.(*ImportCryptoKeyVersionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KeyManagementService_CreateImportJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateImportJobRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeyManagementServiceServer).CreateImportJob(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.KeyManagementService/CreateImportJob", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeyManagementServiceServer).CreateImportJob(ctx, req.(*CreateImportJobRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KeyManagementService_UpdateCryptoKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateCryptoKeyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeyManagementServiceServer).UpdateCryptoKey(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.KeyManagementService/UpdateCryptoKey", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeyManagementServiceServer).UpdateCryptoKey(ctx, req.(*UpdateCryptoKeyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KeyManagementService_UpdateCryptoKeyVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateCryptoKeyVersionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeyManagementServiceServer).UpdateCryptoKeyVersion(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.KeyManagementService/UpdateCryptoKeyVersion", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeyManagementServiceServer).UpdateCryptoKeyVersion(ctx, req.(*UpdateCryptoKeyVersionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KeyManagementService_UpdateCryptoKeyPrimaryVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateCryptoKeyPrimaryVersionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeyManagementServiceServer).UpdateCryptoKeyPrimaryVersion(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.KeyManagementService/UpdateCryptoKeyPrimaryVersion", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeyManagementServiceServer).UpdateCryptoKeyPrimaryVersion(ctx, req.(*UpdateCryptoKeyPrimaryVersionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KeyManagementService_DestroyCryptoKeyVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DestroyCryptoKeyVersionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeyManagementServiceServer).DestroyCryptoKeyVersion(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.KeyManagementService/DestroyCryptoKeyVersion", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeyManagementServiceServer).DestroyCryptoKeyVersion(ctx, req.(*DestroyCryptoKeyVersionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KeyManagementService_RestoreCryptoKeyVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RestoreCryptoKeyVersionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeyManagementServiceServer).RestoreCryptoKeyVersion(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.KeyManagementService/RestoreCryptoKeyVersion", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeyManagementServiceServer).RestoreCryptoKeyVersion(ctx, req.(*RestoreCryptoKeyVersionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KeyManagementService_Encrypt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(EncryptRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeyManagementServiceServer).Encrypt(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.KeyManagementService/Encrypt", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeyManagementServiceServer).Encrypt(ctx, req.(*EncryptRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KeyManagementService_Decrypt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DecryptRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeyManagementServiceServer).Decrypt(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.KeyManagementService/Decrypt", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeyManagementServiceServer).Decrypt(ctx, req.(*DecryptRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KeyManagementService_RawEncrypt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RawEncryptRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeyManagementServiceServer).RawEncrypt(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.KeyManagementService/RawEncrypt", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeyManagementServiceServer).RawEncrypt(ctx, req.(*RawEncryptRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KeyManagementService_RawDecrypt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RawDecryptRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeyManagementServiceServer).RawDecrypt(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.KeyManagementService/RawDecrypt", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeyManagementServiceServer).RawDecrypt(ctx, req.(*RawDecryptRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KeyManagementService_AsymmetricSign_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AsymmetricSignRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeyManagementServiceServer).AsymmetricSign(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.KeyManagementService/AsymmetricSign", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeyManagementServiceServer).AsymmetricSign(ctx, req.(*AsymmetricSignRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KeyManagementService_AsymmetricDecrypt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AsymmetricDecryptRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeyManagementServiceServer).AsymmetricDecrypt(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.KeyManagementService/AsymmetricDecrypt", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeyManagementServiceServer).AsymmetricDecrypt(ctx, req.(*AsymmetricDecryptRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KeyManagementService_MacSign_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MacSignRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeyManagementServiceServer).MacSign(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.KeyManagementService/MacSign", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeyManagementServiceServer).MacSign(ctx, req.(*MacSignRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KeyManagementService_MacVerify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MacVerifyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeyManagementServiceServer).MacVerify(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.KeyManagementService/MacVerify", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeyManagementServiceServer).MacVerify(ctx, req.(*MacVerifyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KeyManagementService_GenerateRandomBytes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GenerateRandomBytesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeyManagementServiceServer).GenerateRandomBytes(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.kms.v1.KeyManagementService/GenerateRandomBytes", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeyManagementServiceServer).GenerateRandomBytes(ctx, req.(*GenerateRandomBytesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _KeyManagementService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "google.cloud.kms.v1.KeyManagementService", - HandlerType: (*KeyManagementServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListKeyRings", - Handler: _KeyManagementService_ListKeyRings_Handler, - }, - { - MethodName: "ListCryptoKeys", - Handler: _KeyManagementService_ListCryptoKeys_Handler, - }, - { - MethodName: "ListCryptoKeyVersions", - Handler: _KeyManagementService_ListCryptoKeyVersions_Handler, - }, - { - MethodName: "ListImportJobs", - Handler: _KeyManagementService_ListImportJobs_Handler, - }, - { - MethodName: "GetKeyRing", - Handler: _KeyManagementService_GetKeyRing_Handler, - }, - { - MethodName: "GetCryptoKey", - Handler: _KeyManagementService_GetCryptoKey_Handler, - }, - { - MethodName: "GetCryptoKeyVersion", - Handler: _KeyManagementService_GetCryptoKeyVersion_Handler, - }, - { - MethodName: "GetPublicKey", - Handler: _KeyManagementService_GetPublicKey_Handler, - }, - { - MethodName: "GetImportJob", - Handler: _KeyManagementService_GetImportJob_Handler, - }, - { - MethodName: "CreateKeyRing", - Handler: _KeyManagementService_CreateKeyRing_Handler, - }, - { - MethodName: "CreateCryptoKey", - Handler: _KeyManagementService_CreateCryptoKey_Handler, - }, - { - MethodName: "CreateCryptoKeyVersion", - Handler: _KeyManagementService_CreateCryptoKeyVersion_Handler, - }, - { - MethodName: "ImportCryptoKeyVersion", - Handler: _KeyManagementService_ImportCryptoKeyVersion_Handler, - }, - { - MethodName: "CreateImportJob", - Handler: _KeyManagementService_CreateImportJob_Handler, - }, - { - MethodName: "UpdateCryptoKey", - Handler: _KeyManagementService_UpdateCryptoKey_Handler, - }, - { - MethodName: "UpdateCryptoKeyVersion", - Handler: _KeyManagementService_UpdateCryptoKeyVersion_Handler, - }, - { - MethodName: "UpdateCryptoKeyPrimaryVersion", - Handler: _KeyManagementService_UpdateCryptoKeyPrimaryVersion_Handler, - }, - { - MethodName: "DestroyCryptoKeyVersion", - Handler: _KeyManagementService_DestroyCryptoKeyVersion_Handler, - }, - { - MethodName: "RestoreCryptoKeyVersion", - Handler: _KeyManagementService_RestoreCryptoKeyVersion_Handler, - }, - { - MethodName: "Encrypt", - Handler: _KeyManagementService_Encrypt_Handler, - }, - { - MethodName: "Decrypt", - Handler: _KeyManagementService_Decrypt_Handler, - }, - { - MethodName: "RawEncrypt", - Handler: _KeyManagementService_RawEncrypt_Handler, - }, - { - MethodName: "RawDecrypt", - Handler: _KeyManagementService_RawDecrypt_Handler, - }, - { - MethodName: "AsymmetricSign", - Handler: _KeyManagementService_AsymmetricSign_Handler, - }, - { - MethodName: "AsymmetricDecrypt", - Handler: _KeyManagementService_AsymmetricDecrypt_Handler, - }, - { - MethodName: "MacSign", - Handler: _KeyManagementService_MacSign_Handler, - }, - { - MethodName: "MacVerify", - Handler: _KeyManagementService_MacVerify_Handler, - }, - { - MethodName: "GenerateRandomBytes", - Handler: _KeyManagementService_GenerateRandomBytes_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "google/cloud/kms/v1/service.proto", -} diff --git a/vendor/cloud.google.com/go/kms/apiv1/kmspb/service_grpc.pb.go b/vendor/cloud.google.com/go/kms/apiv1/kmspb/service_grpc.pb.go new file mode 100644 index 00000000000..7db4aad105a --- /dev/null +++ b/vendor/cloud.google.com/go/kms/apiv1/kmspb/service_grpc.pb.go @@ -0,0 +1,1428 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.7 +// source: google/cloud/kms/v1/service.proto + +package kmspb + +import ( + context "context" + + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + KeyManagementService_ListKeyRings_FullMethodName = "/google.cloud.kms.v1.KeyManagementService/ListKeyRings" + KeyManagementService_ListCryptoKeys_FullMethodName = "/google.cloud.kms.v1.KeyManagementService/ListCryptoKeys" + KeyManagementService_ListCryptoKeyVersions_FullMethodName = "/google.cloud.kms.v1.KeyManagementService/ListCryptoKeyVersions" + KeyManagementService_ListImportJobs_FullMethodName = "/google.cloud.kms.v1.KeyManagementService/ListImportJobs" + KeyManagementService_GetKeyRing_FullMethodName = "/google.cloud.kms.v1.KeyManagementService/GetKeyRing" + KeyManagementService_GetCryptoKey_FullMethodName = "/google.cloud.kms.v1.KeyManagementService/GetCryptoKey" + KeyManagementService_GetCryptoKeyVersion_FullMethodName = "/google.cloud.kms.v1.KeyManagementService/GetCryptoKeyVersion" + KeyManagementService_GetPublicKey_FullMethodName = "/google.cloud.kms.v1.KeyManagementService/GetPublicKey" + KeyManagementService_GetImportJob_FullMethodName = "/google.cloud.kms.v1.KeyManagementService/GetImportJob" + KeyManagementService_CreateKeyRing_FullMethodName = "/google.cloud.kms.v1.KeyManagementService/CreateKeyRing" + KeyManagementService_CreateCryptoKey_FullMethodName = "/google.cloud.kms.v1.KeyManagementService/CreateCryptoKey" + KeyManagementService_CreateCryptoKeyVersion_FullMethodName = "/google.cloud.kms.v1.KeyManagementService/CreateCryptoKeyVersion" + KeyManagementService_ImportCryptoKeyVersion_FullMethodName = "/google.cloud.kms.v1.KeyManagementService/ImportCryptoKeyVersion" + KeyManagementService_CreateImportJob_FullMethodName = "/google.cloud.kms.v1.KeyManagementService/CreateImportJob" + KeyManagementService_UpdateCryptoKey_FullMethodName = "/google.cloud.kms.v1.KeyManagementService/UpdateCryptoKey" + KeyManagementService_UpdateCryptoKeyVersion_FullMethodName = "/google.cloud.kms.v1.KeyManagementService/UpdateCryptoKeyVersion" + KeyManagementService_UpdateCryptoKeyPrimaryVersion_FullMethodName = "/google.cloud.kms.v1.KeyManagementService/UpdateCryptoKeyPrimaryVersion" + KeyManagementService_DestroyCryptoKeyVersion_FullMethodName = "/google.cloud.kms.v1.KeyManagementService/DestroyCryptoKeyVersion" + KeyManagementService_RestoreCryptoKeyVersion_FullMethodName = "/google.cloud.kms.v1.KeyManagementService/RestoreCryptoKeyVersion" + KeyManagementService_Encrypt_FullMethodName = "/google.cloud.kms.v1.KeyManagementService/Encrypt" + KeyManagementService_Decrypt_FullMethodName = "/google.cloud.kms.v1.KeyManagementService/Decrypt" + KeyManagementService_RawEncrypt_FullMethodName = "/google.cloud.kms.v1.KeyManagementService/RawEncrypt" + KeyManagementService_RawDecrypt_FullMethodName = "/google.cloud.kms.v1.KeyManagementService/RawDecrypt" + KeyManagementService_AsymmetricSign_FullMethodName = "/google.cloud.kms.v1.KeyManagementService/AsymmetricSign" + KeyManagementService_AsymmetricDecrypt_FullMethodName = "/google.cloud.kms.v1.KeyManagementService/AsymmetricDecrypt" + KeyManagementService_MacSign_FullMethodName = "/google.cloud.kms.v1.KeyManagementService/MacSign" + KeyManagementService_MacVerify_FullMethodName = "/google.cloud.kms.v1.KeyManagementService/MacVerify" + KeyManagementService_Decapsulate_FullMethodName = "/google.cloud.kms.v1.KeyManagementService/Decapsulate" + KeyManagementService_GenerateRandomBytes_FullMethodName = "/google.cloud.kms.v1.KeyManagementService/GenerateRandomBytes" +) + +// KeyManagementServiceClient is the client API for KeyManagementService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type KeyManagementServiceClient interface { + // Lists [KeyRings][google.cloud.kms.v1.KeyRing]. + ListKeyRings(ctx context.Context, in *ListKeyRingsRequest, opts ...grpc.CallOption) (*ListKeyRingsResponse, error) + // Lists [CryptoKeys][google.cloud.kms.v1.CryptoKey]. + ListCryptoKeys(ctx context.Context, in *ListCryptoKeysRequest, opts ...grpc.CallOption) (*ListCryptoKeysResponse, error) + // Lists [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. + ListCryptoKeyVersions(ctx context.Context, in *ListCryptoKeyVersionsRequest, opts ...grpc.CallOption) (*ListCryptoKeyVersionsResponse, error) + // Lists [ImportJobs][google.cloud.kms.v1.ImportJob]. + ListImportJobs(ctx context.Context, in *ListImportJobsRequest, opts ...grpc.CallOption) (*ListImportJobsResponse, error) + // Returns metadata for a given [KeyRing][google.cloud.kms.v1.KeyRing]. + GetKeyRing(ctx context.Context, in *GetKeyRingRequest, opts ...grpc.CallOption) (*KeyRing, error) + // Returns metadata for a given [CryptoKey][google.cloud.kms.v1.CryptoKey], as + // well as its [primary][google.cloud.kms.v1.CryptoKey.primary] + // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + GetCryptoKey(ctx context.Context, in *GetCryptoKeyRequest, opts ...grpc.CallOption) (*CryptoKey, error) + // Returns metadata for a given + // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + GetCryptoKeyVersion(ctx context.Context, in *GetCryptoKeyVersionRequest, opts ...grpc.CallOption) (*CryptoKeyVersion, error) + // Returns the public key for the given + // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. The + // [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be + // [ASYMMETRIC_SIGN][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_SIGN] + // or + // [ASYMMETRIC_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_DECRYPT]. + GetPublicKey(ctx context.Context, in *GetPublicKeyRequest, opts ...grpc.CallOption) (*PublicKey, error) + // Returns metadata for a given [ImportJob][google.cloud.kms.v1.ImportJob]. + GetImportJob(ctx context.Context, in *GetImportJobRequest, opts ...grpc.CallOption) (*ImportJob, error) + // Create a new [KeyRing][google.cloud.kms.v1.KeyRing] in a given Project and + // Location. + CreateKeyRing(ctx context.Context, in *CreateKeyRingRequest, opts ...grpc.CallOption) (*KeyRing, error) + // Create a new [CryptoKey][google.cloud.kms.v1.CryptoKey] within a + // [KeyRing][google.cloud.kms.v1.KeyRing]. + // + // [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] and + // [CryptoKey.version_template.algorithm][google.cloud.kms.v1.CryptoKeyVersionTemplate.algorithm] + // are required. + CreateCryptoKey(ctx context.Context, in *CreateCryptoKeyRequest, opts ...grpc.CallOption) (*CryptoKey, error) + // Create a new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in a + // [CryptoKey][google.cloud.kms.v1.CryptoKey]. + // + // The server will assign the next sequential id. If unset, + // [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to + // [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED]. + CreateCryptoKeyVersion(ctx context.Context, in *CreateCryptoKeyVersionRequest, opts ...grpc.CallOption) (*CryptoKeyVersion, error) + // Import wrapped key material into a + // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + // + // All requests must specify a [CryptoKey][google.cloud.kms.v1.CryptoKey]. If + // a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] is additionally + // specified in the request, key material will be reimported into that + // version. Otherwise, a new version will be created, and will be assigned the + // next sequential id within the [CryptoKey][google.cloud.kms.v1.CryptoKey]. + ImportCryptoKeyVersion(ctx context.Context, in *ImportCryptoKeyVersionRequest, opts ...grpc.CallOption) (*CryptoKeyVersion, error) + // Create a new [ImportJob][google.cloud.kms.v1.ImportJob] within a + // [KeyRing][google.cloud.kms.v1.KeyRing]. + // + // [ImportJob.import_method][google.cloud.kms.v1.ImportJob.import_method] is + // required. + CreateImportJob(ctx context.Context, in *CreateImportJobRequest, opts ...grpc.CallOption) (*ImportJob, error) + // Update a [CryptoKey][google.cloud.kms.v1.CryptoKey]. + UpdateCryptoKey(ctx context.Context, in *UpdateCryptoKeyRequest, opts ...grpc.CallOption) (*CryptoKey, error) + // Update a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s + // metadata. + // + // [state][google.cloud.kms.v1.CryptoKeyVersion.state] may be changed between + // [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED] + // and + // [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED] + // using this method. See + // [DestroyCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.DestroyCryptoKeyVersion] + // and + // [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] + // to move between other states. + UpdateCryptoKeyVersion(ctx context.Context, in *UpdateCryptoKeyVersionRequest, opts ...grpc.CallOption) (*CryptoKeyVersion, error) + // Update the version of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that + // will be used in + // [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. + // + // Returns an error if called on a key whose purpose is not + // [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. + UpdateCryptoKeyPrimaryVersion(ctx context.Context, in *UpdateCryptoKeyPrimaryVersionRequest, opts ...grpc.CallOption) (*CryptoKey, error) + // Schedule a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] for + // destruction. + // + // Upon calling this method, + // [CryptoKeyVersion.state][google.cloud.kms.v1.CryptoKeyVersion.state] will + // be set to + // [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED], + // and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will + // be set to the time + // [destroy_scheduled_duration][google.cloud.kms.v1.CryptoKey.destroy_scheduled_duration] + // in the future. At that time, the + // [state][google.cloud.kms.v1.CryptoKeyVersion.state] will automatically + // change to + // [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED], + // and the key material will be irrevocably destroyed. + // + // Before the + // [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] is + // reached, + // [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] + // may be called to reverse the process. + DestroyCryptoKeyVersion(ctx context.Context, in *DestroyCryptoKeyVersionRequest, opts ...grpc.CallOption) (*CryptoKeyVersion, error) + // Restore a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the + // [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED] + // state. + // + // Upon restoration of the CryptoKeyVersion, + // [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to + // [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED], + // and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will + // be cleared. + RestoreCryptoKeyVersion(ctx context.Context, in *RestoreCryptoKeyVersionRequest, opts ...grpc.CallOption) (*CryptoKeyVersion, error) + // Encrypts data, so that it can only be recovered by a call to + // [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. The + // [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be + // [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. + Encrypt(ctx context.Context, in *EncryptRequest, opts ...grpc.CallOption) (*EncryptResponse, error) + // Decrypts data that was protected by + // [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. The + // [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be + // [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. + Decrypt(ctx context.Context, in *DecryptRequest, opts ...grpc.CallOption) (*DecryptResponse, error) + // Encrypts data using portable cryptographic primitives. Most users should + // choose [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] and + // [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt] rather than + // their raw counterparts. The + // [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be + // [RAW_ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.RAW_ENCRYPT_DECRYPT]. + RawEncrypt(ctx context.Context, in *RawEncryptRequest, opts ...grpc.CallOption) (*RawEncryptResponse, error) + // Decrypts data that was originally encrypted using a raw cryptographic + // mechanism. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] + // must be + // [RAW_ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.RAW_ENCRYPT_DECRYPT]. + RawDecrypt(ctx context.Context, in *RawDecryptRequest, opts ...grpc.CallOption) (*RawDecryptResponse, error) + // Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] + // with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] + // ASYMMETRIC_SIGN, producing a signature that can be verified with the public + // key retrieved from + // [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey]. + AsymmetricSign(ctx context.Context, in *AsymmetricSignRequest, opts ...grpc.CallOption) (*AsymmetricSignResponse, error) + // Decrypts data that was encrypted with a public key retrieved from + // [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] + // corresponding to a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] + // with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] + // ASYMMETRIC_DECRYPT. + AsymmetricDecrypt(ctx context.Context, in *AsymmetricDecryptRequest, opts ...grpc.CallOption) (*AsymmetricDecryptResponse, error) + // Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] + // with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] MAC, + // producing a tag that can be verified by another source with the same key. + MacSign(ctx context.Context, in *MacSignRequest, opts ...grpc.CallOption) (*MacSignResponse, error) + // Verifies MAC tag using a + // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with + // [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] MAC, and returns + // a response that indicates whether or not the verification was successful. + MacVerify(ctx context.Context, in *MacVerifyRequest, opts ...grpc.CallOption) (*MacVerifyResponse, error) + // Decapsulates data that was encapsulated with a public key retrieved from + // [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] + // corresponding to a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] + // with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] + // KEY_ENCAPSULATION. + Decapsulate(ctx context.Context, in *DecapsulateRequest, opts ...grpc.CallOption) (*DecapsulateResponse, error) + // Generate random bytes using the Cloud KMS randomness source in the provided + // location. + GenerateRandomBytes(ctx context.Context, in *GenerateRandomBytesRequest, opts ...grpc.CallOption) (*GenerateRandomBytesResponse, error) +} + +type keyManagementServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewKeyManagementServiceClient(cc grpc.ClientConnInterface) KeyManagementServiceClient { + return &keyManagementServiceClient{cc} +} + +func (c *keyManagementServiceClient) ListKeyRings(ctx context.Context, in *ListKeyRingsRequest, opts ...grpc.CallOption) (*ListKeyRingsResponse, error) { + out := new(ListKeyRingsResponse) + err := c.cc.Invoke(ctx, KeyManagementService_ListKeyRings_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *keyManagementServiceClient) ListCryptoKeys(ctx context.Context, in *ListCryptoKeysRequest, opts ...grpc.CallOption) (*ListCryptoKeysResponse, error) { + out := new(ListCryptoKeysResponse) + err := c.cc.Invoke(ctx, KeyManagementService_ListCryptoKeys_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *keyManagementServiceClient) ListCryptoKeyVersions(ctx context.Context, in *ListCryptoKeyVersionsRequest, opts ...grpc.CallOption) (*ListCryptoKeyVersionsResponse, error) { + out := new(ListCryptoKeyVersionsResponse) + err := c.cc.Invoke(ctx, KeyManagementService_ListCryptoKeyVersions_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *keyManagementServiceClient) ListImportJobs(ctx context.Context, in *ListImportJobsRequest, opts ...grpc.CallOption) (*ListImportJobsResponse, error) { + out := new(ListImportJobsResponse) + err := c.cc.Invoke(ctx, KeyManagementService_ListImportJobs_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *keyManagementServiceClient) GetKeyRing(ctx context.Context, in *GetKeyRingRequest, opts ...grpc.CallOption) (*KeyRing, error) { + out := new(KeyRing) + err := c.cc.Invoke(ctx, KeyManagementService_GetKeyRing_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *keyManagementServiceClient) GetCryptoKey(ctx context.Context, in *GetCryptoKeyRequest, opts ...grpc.CallOption) (*CryptoKey, error) { + out := new(CryptoKey) + err := c.cc.Invoke(ctx, KeyManagementService_GetCryptoKey_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *keyManagementServiceClient) GetCryptoKeyVersion(ctx context.Context, in *GetCryptoKeyVersionRequest, opts ...grpc.CallOption) (*CryptoKeyVersion, error) { + out := new(CryptoKeyVersion) + err := c.cc.Invoke(ctx, KeyManagementService_GetCryptoKeyVersion_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *keyManagementServiceClient) GetPublicKey(ctx context.Context, in *GetPublicKeyRequest, opts ...grpc.CallOption) (*PublicKey, error) { + out := new(PublicKey) + err := c.cc.Invoke(ctx, KeyManagementService_GetPublicKey_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *keyManagementServiceClient) GetImportJob(ctx context.Context, in *GetImportJobRequest, opts ...grpc.CallOption) (*ImportJob, error) { + out := new(ImportJob) + err := c.cc.Invoke(ctx, KeyManagementService_GetImportJob_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *keyManagementServiceClient) CreateKeyRing(ctx context.Context, in *CreateKeyRingRequest, opts ...grpc.CallOption) (*KeyRing, error) { + out := new(KeyRing) + err := c.cc.Invoke(ctx, KeyManagementService_CreateKeyRing_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *keyManagementServiceClient) CreateCryptoKey(ctx context.Context, in *CreateCryptoKeyRequest, opts ...grpc.CallOption) (*CryptoKey, error) { + out := new(CryptoKey) + err := c.cc.Invoke(ctx, KeyManagementService_CreateCryptoKey_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *keyManagementServiceClient) CreateCryptoKeyVersion(ctx context.Context, in *CreateCryptoKeyVersionRequest, opts ...grpc.CallOption) (*CryptoKeyVersion, error) { + out := new(CryptoKeyVersion) + err := c.cc.Invoke(ctx, KeyManagementService_CreateCryptoKeyVersion_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *keyManagementServiceClient) ImportCryptoKeyVersion(ctx context.Context, in *ImportCryptoKeyVersionRequest, opts ...grpc.CallOption) (*CryptoKeyVersion, error) { + out := new(CryptoKeyVersion) + err := c.cc.Invoke(ctx, KeyManagementService_ImportCryptoKeyVersion_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *keyManagementServiceClient) CreateImportJob(ctx context.Context, in *CreateImportJobRequest, opts ...grpc.CallOption) (*ImportJob, error) { + out := new(ImportJob) + err := c.cc.Invoke(ctx, KeyManagementService_CreateImportJob_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *keyManagementServiceClient) UpdateCryptoKey(ctx context.Context, in *UpdateCryptoKeyRequest, opts ...grpc.CallOption) (*CryptoKey, error) { + out := new(CryptoKey) + err := c.cc.Invoke(ctx, KeyManagementService_UpdateCryptoKey_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *keyManagementServiceClient) UpdateCryptoKeyVersion(ctx context.Context, in *UpdateCryptoKeyVersionRequest, opts ...grpc.CallOption) (*CryptoKeyVersion, error) { + out := new(CryptoKeyVersion) + err := c.cc.Invoke(ctx, KeyManagementService_UpdateCryptoKeyVersion_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *keyManagementServiceClient) UpdateCryptoKeyPrimaryVersion(ctx context.Context, in *UpdateCryptoKeyPrimaryVersionRequest, opts ...grpc.CallOption) (*CryptoKey, error) { + out := new(CryptoKey) + err := c.cc.Invoke(ctx, KeyManagementService_UpdateCryptoKeyPrimaryVersion_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *keyManagementServiceClient) DestroyCryptoKeyVersion(ctx context.Context, in *DestroyCryptoKeyVersionRequest, opts ...grpc.CallOption) (*CryptoKeyVersion, error) { + out := new(CryptoKeyVersion) + err := c.cc.Invoke(ctx, KeyManagementService_DestroyCryptoKeyVersion_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *keyManagementServiceClient) RestoreCryptoKeyVersion(ctx context.Context, in *RestoreCryptoKeyVersionRequest, opts ...grpc.CallOption) (*CryptoKeyVersion, error) { + out := new(CryptoKeyVersion) + err := c.cc.Invoke(ctx, KeyManagementService_RestoreCryptoKeyVersion_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *keyManagementServiceClient) Encrypt(ctx context.Context, in *EncryptRequest, opts ...grpc.CallOption) (*EncryptResponse, error) { + out := new(EncryptResponse) + err := c.cc.Invoke(ctx, KeyManagementService_Encrypt_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *keyManagementServiceClient) Decrypt(ctx context.Context, in *DecryptRequest, opts ...grpc.CallOption) (*DecryptResponse, error) { + out := new(DecryptResponse) + err := c.cc.Invoke(ctx, KeyManagementService_Decrypt_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *keyManagementServiceClient) RawEncrypt(ctx context.Context, in *RawEncryptRequest, opts ...grpc.CallOption) (*RawEncryptResponse, error) { + out := new(RawEncryptResponse) + err := c.cc.Invoke(ctx, KeyManagementService_RawEncrypt_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *keyManagementServiceClient) RawDecrypt(ctx context.Context, in *RawDecryptRequest, opts ...grpc.CallOption) (*RawDecryptResponse, error) { + out := new(RawDecryptResponse) + err := c.cc.Invoke(ctx, KeyManagementService_RawDecrypt_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *keyManagementServiceClient) AsymmetricSign(ctx context.Context, in *AsymmetricSignRequest, opts ...grpc.CallOption) (*AsymmetricSignResponse, error) { + out := new(AsymmetricSignResponse) + err := c.cc.Invoke(ctx, KeyManagementService_AsymmetricSign_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *keyManagementServiceClient) AsymmetricDecrypt(ctx context.Context, in *AsymmetricDecryptRequest, opts ...grpc.CallOption) (*AsymmetricDecryptResponse, error) { + out := new(AsymmetricDecryptResponse) + err := c.cc.Invoke(ctx, KeyManagementService_AsymmetricDecrypt_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *keyManagementServiceClient) MacSign(ctx context.Context, in *MacSignRequest, opts ...grpc.CallOption) (*MacSignResponse, error) { + out := new(MacSignResponse) + err := c.cc.Invoke(ctx, KeyManagementService_MacSign_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *keyManagementServiceClient) MacVerify(ctx context.Context, in *MacVerifyRequest, opts ...grpc.CallOption) (*MacVerifyResponse, error) { + out := new(MacVerifyResponse) + err := c.cc.Invoke(ctx, KeyManagementService_MacVerify_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *keyManagementServiceClient) Decapsulate(ctx context.Context, in *DecapsulateRequest, opts ...grpc.CallOption) (*DecapsulateResponse, error) { + out := new(DecapsulateResponse) + err := c.cc.Invoke(ctx, KeyManagementService_Decapsulate_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *keyManagementServiceClient) GenerateRandomBytes(ctx context.Context, in *GenerateRandomBytesRequest, opts ...grpc.CallOption) (*GenerateRandomBytesResponse, error) { + out := new(GenerateRandomBytesResponse) + err := c.cc.Invoke(ctx, KeyManagementService_GenerateRandomBytes_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// KeyManagementServiceServer is the server API for KeyManagementService service. +// All implementations should embed UnimplementedKeyManagementServiceServer +// for forward compatibility +type KeyManagementServiceServer interface { + // Lists [KeyRings][google.cloud.kms.v1.KeyRing]. + ListKeyRings(context.Context, *ListKeyRingsRequest) (*ListKeyRingsResponse, error) + // Lists [CryptoKeys][google.cloud.kms.v1.CryptoKey]. + ListCryptoKeys(context.Context, *ListCryptoKeysRequest) (*ListCryptoKeysResponse, error) + // Lists [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. + ListCryptoKeyVersions(context.Context, *ListCryptoKeyVersionsRequest) (*ListCryptoKeyVersionsResponse, error) + // Lists [ImportJobs][google.cloud.kms.v1.ImportJob]. + ListImportJobs(context.Context, *ListImportJobsRequest) (*ListImportJobsResponse, error) + // Returns metadata for a given [KeyRing][google.cloud.kms.v1.KeyRing]. + GetKeyRing(context.Context, *GetKeyRingRequest) (*KeyRing, error) + // Returns metadata for a given [CryptoKey][google.cloud.kms.v1.CryptoKey], as + // well as its [primary][google.cloud.kms.v1.CryptoKey.primary] + // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + GetCryptoKey(context.Context, *GetCryptoKeyRequest) (*CryptoKey, error) + // Returns metadata for a given + // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + GetCryptoKeyVersion(context.Context, *GetCryptoKeyVersionRequest) (*CryptoKeyVersion, error) + // Returns the public key for the given + // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. The + // [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be + // [ASYMMETRIC_SIGN][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_SIGN] + // or + // [ASYMMETRIC_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_DECRYPT]. + GetPublicKey(context.Context, *GetPublicKeyRequest) (*PublicKey, error) + // Returns metadata for a given [ImportJob][google.cloud.kms.v1.ImportJob]. + GetImportJob(context.Context, *GetImportJobRequest) (*ImportJob, error) + // Create a new [KeyRing][google.cloud.kms.v1.KeyRing] in a given Project and + // Location. + CreateKeyRing(context.Context, *CreateKeyRingRequest) (*KeyRing, error) + // Create a new [CryptoKey][google.cloud.kms.v1.CryptoKey] within a + // [KeyRing][google.cloud.kms.v1.KeyRing]. + // + // [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] and + // [CryptoKey.version_template.algorithm][google.cloud.kms.v1.CryptoKeyVersionTemplate.algorithm] + // are required. + CreateCryptoKey(context.Context, *CreateCryptoKeyRequest) (*CryptoKey, error) + // Create a new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in a + // [CryptoKey][google.cloud.kms.v1.CryptoKey]. + // + // The server will assign the next sequential id. If unset, + // [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to + // [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED]. + CreateCryptoKeyVersion(context.Context, *CreateCryptoKeyVersionRequest) (*CryptoKeyVersion, error) + // Import wrapped key material into a + // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + // + // All requests must specify a [CryptoKey][google.cloud.kms.v1.CryptoKey]. If + // a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] is additionally + // specified in the request, key material will be reimported into that + // version. Otherwise, a new version will be created, and will be assigned the + // next sequential id within the [CryptoKey][google.cloud.kms.v1.CryptoKey]. + ImportCryptoKeyVersion(context.Context, *ImportCryptoKeyVersionRequest) (*CryptoKeyVersion, error) + // Create a new [ImportJob][google.cloud.kms.v1.ImportJob] within a + // [KeyRing][google.cloud.kms.v1.KeyRing]. + // + // [ImportJob.import_method][google.cloud.kms.v1.ImportJob.import_method] is + // required. + CreateImportJob(context.Context, *CreateImportJobRequest) (*ImportJob, error) + // Update a [CryptoKey][google.cloud.kms.v1.CryptoKey]. + UpdateCryptoKey(context.Context, *UpdateCryptoKeyRequest) (*CryptoKey, error) + // Update a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s + // metadata. + // + // [state][google.cloud.kms.v1.CryptoKeyVersion.state] may be changed between + // [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED] + // and + // [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED] + // using this method. See + // [DestroyCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.DestroyCryptoKeyVersion] + // and + // [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] + // to move between other states. + UpdateCryptoKeyVersion(context.Context, *UpdateCryptoKeyVersionRequest) (*CryptoKeyVersion, error) + // Update the version of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that + // will be used in + // [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. + // + // Returns an error if called on a key whose purpose is not + // [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. + UpdateCryptoKeyPrimaryVersion(context.Context, *UpdateCryptoKeyPrimaryVersionRequest) (*CryptoKey, error) + // Schedule a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] for + // destruction. + // + // Upon calling this method, + // [CryptoKeyVersion.state][google.cloud.kms.v1.CryptoKeyVersion.state] will + // be set to + // [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED], + // and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will + // be set to the time + // [destroy_scheduled_duration][google.cloud.kms.v1.CryptoKey.destroy_scheduled_duration] + // in the future. At that time, the + // [state][google.cloud.kms.v1.CryptoKeyVersion.state] will automatically + // change to + // [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED], + // and the key material will be irrevocably destroyed. + // + // Before the + // [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] is + // reached, + // [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] + // may be called to reverse the process. + DestroyCryptoKeyVersion(context.Context, *DestroyCryptoKeyVersionRequest) (*CryptoKeyVersion, error) + // Restore a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the + // [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED] + // state. + // + // Upon restoration of the CryptoKeyVersion, + // [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to + // [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED], + // and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will + // be cleared. + RestoreCryptoKeyVersion(context.Context, *RestoreCryptoKeyVersionRequest) (*CryptoKeyVersion, error) + // Encrypts data, so that it can only be recovered by a call to + // [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. The + // [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be + // [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. + Encrypt(context.Context, *EncryptRequest) (*EncryptResponse, error) + // Decrypts data that was protected by + // [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. The + // [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be + // [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. + Decrypt(context.Context, *DecryptRequest) (*DecryptResponse, error) + // Encrypts data using portable cryptographic primitives. Most users should + // choose [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] and + // [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt] rather than + // their raw counterparts. The + // [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be + // [RAW_ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.RAW_ENCRYPT_DECRYPT]. + RawEncrypt(context.Context, *RawEncryptRequest) (*RawEncryptResponse, error) + // Decrypts data that was originally encrypted using a raw cryptographic + // mechanism. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] + // must be + // [RAW_ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.RAW_ENCRYPT_DECRYPT]. + RawDecrypt(context.Context, *RawDecryptRequest) (*RawDecryptResponse, error) + // Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] + // with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] + // ASYMMETRIC_SIGN, producing a signature that can be verified with the public + // key retrieved from + // [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey]. + AsymmetricSign(context.Context, *AsymmetricSignRequest) (*AsymmetricSignResponse, error) + // Decrypts data that was encrypted with a public key retrieved from + // [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] + // corresponding to a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] + // with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] + // ASYMMETRIC_DECRYPT. + AsymmetricDecrypt(context.Context, *AsymmetricDecryptRequest) (*AsymmetricDecryptResponse, error) + // Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] + // with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] MAC, + // producing a tag that can be verified by another source with the same key. + MacSign(context.Context, *MacSignRequest) (*MacSignResponse, error) + // Verifies MAC tag using a + // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with + // [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] MAC, and returns + // a response that indicates whether or not the verification was successful. + MacVerify(context.Context, *MacVerifyRequest) (*MacVerifyResponse, error) + // Decapsulates data that was encapsulated with a public key retrieved from + // [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] + // corresponding to a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] + // with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] + // KEY_ENCAPSULATION. + Decapsulate(context.Context, *DecapsulateRequest) (*DecapsulateResponse, error) + // Generate random bytes using the Cloud KMS randomness source in the provided + // location. + GenerateRandomBytes(context.Context, *GenerateRandomBytesRequest) (*GenerateRandomBytesResponse, error) +} + +// UnimplementedKeyManagementServiceServer should be embedded to have forward compatible implementations. +type UnimplementedKeyManagementServiceServer struct { +} + +func (UnimplementedKeyManagementServiceServer) ListKeyRings(context.Context, *ListKeyRingsRequest) (*ListKeyRingsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListKeyRings not implemented") +} +func (UnimplementedKeyManagementServiceServer) ListCryptoKeys(context.Context, *ListCryptoKeysRequest) (*ListCryptoKeysResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListCryptoKeys not implemented") +} +func (UnimplementedKeyManagementServiceServer) ListCryptoKeyVersions(context.Context, *ListCryptoKeyVersionsRequest) (*ListCryptoKeyVersionsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListCryptoKeyVersions not implemented") +} +func (UnimplementedKeyManagementServiceServer) ListImportJobs(context.Context, *ListImportJobsRequest) (*ListImportJobsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListImportJobs not implemented") +} +func (UnimplementedKeyManagementServiceServer) GetKeyRing(context.Context, *GetKeyRingRequest) (*KeyRing, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetKeyRing not implemented") +} +func (UnimplementedKeyManagementServiceServer) GetCryptoKey(context.Context, *GetCryptoKeyRequest) (*CryptoKey, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetCryptoKey not implemented") +} +func (UnimplementedKeyManagementServiceServer) GetCryptoKeyVersion(context.Context, *GetCryptoKeyVersionRequest) (*CryptoKeyVersion, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetCryptoKeyVersion not implemented") +} +func (UnimplementedKeyManagementServiceServer) GetPublicKey(context.Context, *GetPublicKeyRequest) (*PublicKey, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPublicKey not implemented") +} +func (UnimplementedKeyManagementServiceServer) GetImportJob(context.Context, *GetImportJobRequest) (*ImportJob, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetImportJob not implemented") +} +func (UnimplementedKeyManagementServiceServer) CreateKeyRing(context.Context, *CreateKeyRingRequest) (*KeyRing, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateKeyRing not implemented") +} +func (UnimplementedKeyManagementServiceServer) CreateCryptoKey(context.Context, *CreateCryptoKeyRequest) (*CryptoKey, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateCryptoKey not implemented") +} +func (UnimplementedKeyManagementServiceServer) CreateCryptoKeyVersion(context.Context, *CreateCryptoKeyVersionRequest) (*CryptoKeyVersion, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateCryptoKeyVersion not implemented") +} +func (UnimplementedKeyManagementServiceServer) ImportCryptoKeyVersion(context.Context, *ImportCryptoKeyVersionRequest) (*CryptoKeyVersion, error) { + return nil, status.Errorf(codes.Unimplemented, "method ImportCryptoKeyVersion not implemented") +} +func (UnimplementedKeyManagementServiceServer) CreateImportJob(context.Context, *CreateImportJobRequest) (*ImportJob, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateImportJob not implemented") +} +func (UnimplementedKeyManagementServiceServer) UpdateCryptoKey(context.Context, *UpdateCryptoKeyRequest) (*CryptoKey, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateCryptoKey not implemented") +} +func (UnimplementedKeyManagementServiceServer) UpdateCryptoKeyVersion(context.Context, *UpdateCryptoKeyVersionRequest) (*CryptoKeyVersion, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateCryptoKeyVersion not implemented") +} +func (UnimplementedKeyManagementServiceServer) UpdateCryptoKeyPrimaryVersion(context.Context, *UpdateCryptoKeyPrimaryVersionRequest) (*CryptoKey, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateCryptoKeyPrimaryVersion not implemented") +} +func (UnimplementedKeyManagementServiceServer) DestroyCryptoKeyVersion(context.Context, *DestroyCryptoKeyVersionRequest) (*CryptoKeyVersion, error) { + return nil, status.Errorf(codes.Unimplemented, "method DestroyCryptoKeyVersion not implemented") +} +func (UnimplementedKeyManagementServiceServer) RestoreCryptoKeyVersion(context.Context, *RestoreCryptoKeyVersionRequest) (*CryptoKeyVersion, error) { + return nil, status.Errorf(codes.Unimplemented, "method RestoreCryptoKeyVersion not implemented") +} +func (UnimplementedKeyManagementServiceServer) Encrypt(context.Context, *EncryptRequest) (*EncryptResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Encrypt not implemented") +} +func (UnimplementedKeyManagementServiceServer) Decrypt(context.Context, *DecryptRequest) (*DecryptResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Decrypt not implemented") +} +func (UnimplementedKeyManagementServiceServer) RawEncrypt(context.Context, *RawEncryptRequest) (*RawEncryptResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RawEncrypt not implemented") +} +func (UnimplementedKeyManagementServiceServer) RawDecrypt(context.Context, *RawDecryptRequest) (*RawDecryptResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RawDecrypt not implemented") +} +func (UnimplementedKeyManagementServiceServer) AsymmetricSign(context.Context, *AsymmetricSignRequest) (*AsymmetricSignResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AsymmetricSign not implemented") +} +func (UnimplementedKeyManagementServiceServer) AsymmetricDecrypt(context.Context, *AsymmetricDecryptRequest) (*AsymmetricDecryptResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AsymmetricDecrypt not implemented") +} +func (UnimplementedKeyManagementServiceServer) MacSign(context.Context, *MacSignRequest) (*MacSignResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MacSign not implemented") +} +func (UnimplementedKeyManagementServiceServer) MacVerify(context.Context, *MacVerifyRequest) (*MacVerifyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MacVerify not implemented") +} +func (UnimplementedKeyManagementServiceServer) Decapsulate(context.Context, *DecapsulateRequest) (*DecapsulateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Decapsulate not implemented") +} +func (UnimplementedKeyManagementServiceServer) GenerateRandomBytes(context.Context, *GenerateRandomBytesRequest) (*GenerateRandomBytesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GenerateRandomBytes not implemented") +} + +// UnsafeKeyManagementServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to KeyManagementServiceServer will +// result in compilation errors. +type UnsafeKeyManagementServiceServer interface { + mustEmbedUnimplementedKeyManagementServiceServer() +} + +func RegisterKeyManagementServiceServer(s grpc.ServiceRegistrar, srv KeyManagementServiceServer) { + s.RegisterService(&KeyManagementService_ServiceDesc, srv) +} + +func _KeyManagementService_ListKeyRings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListKeyRingsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KeyManagementServiceServer).ListKeyRings(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KeyManagementService_ListKeyRings_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KeyManagementServiceServer).ListKeyRings(ctx, req.(*ListKeyRingsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _KeyManagementService_ListCryptoKeys_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListCryptoKeysRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KeyManagementServiceServer).ListCryptoKeys(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KeyManagementService_ListCryptoKeys_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KeyManagementServiceServer).ListCryptoKeys(ctx, req.(*ListCryptoKeysRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _KeyManagementService_ListCryptoKeyVersions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListCryptoKeyVersionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KeyManagementServiceServer).ListCryptoKeyVersions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KeyManagementService_ListCryptoKeyVersions_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KeyManagementServiceServer).ListCryptoKeyVersions(ctx, req.(*ListCryptoKeyVersionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _KeyManagementService_ListImportJobs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListImportJobsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KeyManagementServiceServer).ListImportJobs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KeyManagementService_ListImportJobs_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KeyManagementServiceServer).ListImportJobs(ctx, req.(*ListImportJobsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _KeyManagementService_GetKeyRing_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetKeyRingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KeyManagementServiceServer).GetKeyRing(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KeyManagementService_GetKeyRing_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KeyManagementServiceServer).GetKeyRing(ctx, req.(*GetKeyRingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _KeyManagementService_GetCryptoKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetCryptoKeyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KeyManagementServiceServer).GetCryptoKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KeyManagementService_GetCryptoKey_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KeyManagementServiceServer).GetCryptoKey(ctx, req.(*GetCryptoKeyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _KeyManagementService_GetCryptoKeyVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetCryptoKeyVersionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KeyManagementServiceServer).GetCryptoKeyVersion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KeyManagementService_GetCryptoKeyVersion_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KeyManagementServiceServer).GetCryptoKeyVersion(ctx, req.(*GetCryptoKeyVersionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _KeyManagementService_GetPublicKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetPublicKeyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KeyManagementServiceServer).GetPublicKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KeyManagementService_GetPublicKey_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KeyManagementServiceServer).GetPublicKey(ctx, req.(*GetPublicKeyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _KeyManagementService_GetImportJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetImportJobRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KeyManagementServiceServer).GetImportJob(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KeyManagementService_GetImportJob_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KeyManagementServiceServer).GetImportJob(ctx, req.(*GetImportJobRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _KeyManagementService_CreateKeyRing_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateKeyRingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KeyManagementServiceServer).CreateKeyRing(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KeyManagementService_CreateKeyRing_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KeyManagementServiceServer).CreateKeyRing(ctx, req.(*CreateKeyRingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _KeyManagementService_CreateCryptoKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateCryptoKeyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KeyManagementServiceServer).CreateCryptoKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KeyManagementService_CreateCryptoKey_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KeyManagementServiceServer).CreateCryptoKey(ctx, req.(*CreateCryptoKeyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _KeyManagementService_CreateCryptoKeyVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateCryptoKeyVersionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KeyManagementServiceServer).CreateCryptoKeyVersion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KeyManagementService_CreateCryptoKeyVersion_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KeyManagementServiceServer).CreateCryptoKeyVersion(ctx, req.(*CreateCryptoKeyVersionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _KeyManagementService_ImportCryptoKeyVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ImportCryptoKeyVersionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KeyManagementServiceServer).ImportCryptoKeyVersion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KeyManagementService_ImportCryptoKeyVersion_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KeyManagementServiceServer).ImportCryptoKeyVersion(ctx, req.(*ImportCryptoKeyVersionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _KeyManagementService_CreateImportJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateImportJobRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KeyManagementServiceServer).CreateImportJob(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KeyManagementService_CreateImportJob_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KeyManagementServiceServer).CreateImportJob(ctx, req.(*CreateImportJobRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _KeyManagementService_UpdateCryptoKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateCryptoKeyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KeyManagementServiceServer).UpdateCryptoKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KeyManagementService_UpdateCryptoKey_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KeyManagementServiceServer).UpdateCryptoKey(ctx, req.(*UpdateCryptoKeyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _KeyManagementService_UpdateCryptoKeyVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateCryptoKeyVersionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KeyManagementServiceServer).UpdateCryptoKeyVersion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KeyManagementService_UpdateCryptoKeyVersion_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KeyManagementServiceServer).UpdateCryptoKeyVersion(ctx, req.(*UpdateCryptoKeyVersionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _KeyManagementService_UpdateCryptoKeyPrimaryVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateCryptoKeyPrimaryVersionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KeyManagementServiceServer).UpdateCryptoKeyPrimaryVersion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KeyManagementService_UpdateCryptoKeyPrimaryVersion_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KeyManagementServiceServer).UpdateCryptoKeyPrimaryVersion(ctx, req.(*UpdateCryptoKeyPrimaryVersionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _KeyManagementService_DestroyCryptoKeyVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DestroyCryptoKeyVersionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KeyManagementServiceServer).DestroyCryptoKeyVersion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KeyManagementService_DestroyCryptoKeyVersion_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KeyManagementServiceServer).DestroyCryptoKeyVersion(ctx, req.(*DestroyCryptoKeyVersionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _KeyManagementService_RestoreCryptoKeyVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RestoreCryptoKeyVersionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KeyManagementServiceServer).RestoreCryptoKeyVersion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KeyManagementService_RestoreCryptoKeyVersion_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KeyManagementServiceServer).RestoreCryptoKeyVersion(ctx, req.(*RestoreCryptoKeyVersionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _KeyManagementService_Encrypt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EncryptRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KeyManagementServiceServer).Encrypt(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KeyManagementService_Encrypt_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KeyManagementServiceServer).Encrypt(ctx, req.(*EncryptRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _KeyManagementService_Decrypt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DecryptRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KeyManagementServiceServer).Decrypt(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KeyManagementService_Decrypt_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KeyManagementServiceServer).Decrypt(ctx, req.(*DecryptRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _KeyManagementService_RawEncrypt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RawEncryptRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KeyManagementServiceServer).RawEncrypt(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KeyManagementService_RawEncrypt_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KeyManagementServiceServer).RawEncrypt(ctx, req.(*RawEncryptRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _KeyManagementService_RawDecrypt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RawDecryptRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KeyManagementServiceServer).RawDecrypt(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KeyManagementService_RawDecrypt_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KeyManagementServiceServer).RawDecrypt(ctx, req.(*RawDecryptRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _KeyManagementService_AsymmetricSign_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AsymmetricSignRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KeyManagementServiceServer).AsymmetricSign(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KeyManagementService_AsymmetricSign_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KeyManagementServiceServer).AsymmetricSign(ctx, req.(*AsymmetricSignRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _KeyManagementService_AsymmetricDecrypt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AsymmetricDecryptRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KeyManagementServiceServer).AsymmetricDecrypt(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KeyManagementService_AsymmetricDecrypt_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KeyManagementServiceServer).AsymmetricDecrypt(ctx, req.(*AsymmetricDecryptRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _KeyManagementService_MacSign_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MacSignRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KeyManagementServiceServer).MacSign(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KeyManagementService_MacSign_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KeyManagementServiceServer).MacSign(ctx, req.(*MacSignRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _KeyManagementService_MacVerify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MacVerifyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KeyManagementServiceServer).MacVerify(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KeyManagementService_MacVerify_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KeyManagementServiceServer).MacVerify(ctx, req.(*MacVerifyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _KeyManagementService_Decapsulate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DecapsulateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KeyManagementServiceServer).Decapsulate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KeyManagementService_Decapsulate_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KeyManagementServiceServer).Decapsulate(ctx, req.(*DecapsulateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _KeyManagementService_GenerateRandomBytes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GenerateRandomBytesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KeyManagementServiceServer).GenerateRandomBytes(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KeyManagementService_GenerateRandomBytes_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KeyManagementServiceServer).GenerateRandomBytes(ctx, req.(*GenerateRandomBytesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// KeyManagementService_ServiceDesc is the grpc.ServiceDesc for KeyManagementService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var KeyManagementService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "google.cloud.kms.v1.KeyManagementService", + HandlerType: (*KeyManagementServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListKeyRings", + Handler: _KeyManagementService_ListKeyRings_Handler, + }, + { + MethodName: "ListCryptoKeys", + Handler: _KeyManagementService_ListCryptoKeys_Handler, + }, + { + MethodName: "ListCryptoKeyVersions", + Handler: _KeyManagementService_ListCryptoKeyVersions_Handler, + }, + { + MethodName: "ListImportJobs", + Handler: _KeyManagementService_ListImportJobs_Handler, + }, + { + MethodName: "GetKeyRing", + Handler: _KeyManagementService_GetKeyRing_Handler, + }, + { + MethodName: "GetCryptoKey", + Handler: _KeyManagementService_GetCryptoKey_Handler, + }, + { + MethodName: "GetCryptoKeyVersion", + Handler: _KeyManagementService_GetCryptoKeyVersion_Handler, + }, + { + MethodName: "GetPublicKey", + Handler: _KeyManagementService_GetPublicKey_Handler, + }, + { + MethodName: "GetImportJob", + Handler: _KeyManagementService_GetImportJob_Handler, + }, + { + MethodName: "CreateKeyRing", + Handler: _KeyManagementService_CreateKeyRing_Handler, + }, + { + MethodName: "CreateCryptoKey", + Handler: _KeyManagementService_CreateCryptoKey_Handler, + }, + { + MethodName: "CreateCryptoKeyVersion", + Handler: _KeyManagementService_CreateCryptoKeyVersion_Handler, + }, + { + MethodName: "ImportCryptoKeyVersion", + Handler: _KeyManagementService_ImportCryptoKeyVersion_Handler, + }, + { + MethodName: "CreateImportJob", + Handler: _KeyManagementService_CreateImportJob_Handler, + }, + { + MethodName: "UpdateCryptoKey", + Handler: _KeyManagementService_UpdateCryptoKey_Handler, + }, + { + MethodName: "UpdateCryptoKeyVersion", + Handler: _KeyManagementService_UpdateCryptoKeyVersion_Handler, + }, + { + MethodName: "UpdateCryptoKeyPrimaryVersion", + Handler: _KeyManagementService_UpdateCryptoKeyPrimaryVersion_Handler, + }, + { + MethodName: "DestroyCryptoKeyVersion", + Handler: _KeyManagementService_DestroyCryptoKeyVersion_Handler, + }, + { + MethodName: "RestoreCryptoKeyVersion", + Handler: _KeyManagementService_RestoreCryptoKeyVersion_Handler, + }, + { + MethodName: "Encrypt", + Handler: _KeyManagementService_Encrypt_Handler, + }, + { + MethodName: "Decrypt", + Handler: _KeyManagementService_Decrypt_Handler, + }, + { + MethodName: "RawEncrypt", + Handler: _KeyManagementService_RawEncrypt_Handler, + }, + { + MethodName: "RawDecrypt", + Handler: _KeyManagementService_RawDecrypt_Handler, + }, + { + MethodName: "AsymmetricSign", + Handler: _KeyManagementService_AsymmetricSign_Handler, + }, + { + MethodName: "AsymmetricDecrypt", + Handler: _KeyManagementService_AsymmetricDecrypt_Handler, + }, + { + MethodName: "MacSign", + Handler: _KeyManagementService_MacSign_Handler, + }, + { + MethodName: "MacVerify", + Handler: _KeyManagementService_MacVerify_Handler, + }, + { + MethodName: "Decapsulate", + Handler: _KeyManagementService_Decapsulate_Handler, + }, + { + MethodName: "GenerateRandomBytes", + Handler: _KeyManagementService_GenerateRandomBytes_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/cloud/kms/v1/service.proto", +} diff --git a/vendor/cloud.google.com/go/kms/internal/version.go b/vendor/cloud.google.com/go/kms/internal/version.go index eddfee04b0b..4db2871b8eb 100644 --- a/vendor/cloud.google.com/go/kms/internal/version.go +++ b/vendor/cloud.google.com/go/kms/internal/version.go @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,7 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +// Code generated by gapicgen. DO NOT EDIT. + package internal // Version is the current tagged release of the library. -const Version = "1.22.0" +const Version = "1.25.0" diff --git a/vendor/cloud.google.com/go/longrunning/CHANGES.md b/vendor/cloud.google.com/go/longrunning/CHANGES.md index ca0d28f167e..8f4b6459c5a 100644 --- a/vendor/cloud.google.com/go/longrunning/CHANGES.md +++ b/vendor/cloud.google.com/go/longrunning/CHANGES.md @@ -1,5 +1,18 @@ # Changes +## [0.8.0](https://github.com/googleapis/google-cloud-go/releases/tag/longrunning%2Fv0.8.0) (2026-01-08) + +### Bug Fixes + +* upgrade gRPC service registration func An update to Go gRPC Protobuf generation will change service registration function signatures to use an interface instead of a concrete type in generated .pb.go service files. This change should affect very few client library users. See release notes advisories in https://github.com/googleapis/google-cloud-go/pull/11025. ([185951b](https://github.com/googleapis/google-cloud-go/commit/185951b3bea9fb942979e81ce248ccdebb40d94b)) + +## [0.7.0](https://github.com/googleapis/google-cloud-go/releases/tag/longrunning%2Fv0.7.0) (2025-10-14) + +### Features + +* add ListOperations partial success flag +* add ListOperations unreachable resources + ## [0.6.7](https://github.com/googleapis/google-cloud-go/compare/longrunning/v0.6.6...longrunning/v0.6.7) (2025-04-15) @@ -180,3 +193,4 @@ ## v0.1.0 Initial release. + diff --git a/vendor/cloud.google.com/go/longrunning/autogen/.repo-metadata.json b/vendor/cloud.google.com/go/longrunning/autogen/.repo-metadata.json new file mode 100644 index 00000000000..23ee6e63f78 --- /dev/null +++ b/vendor/cloud.google.com/go/longrunning/autogen/.repo-metadata.json @@ -0,0 +1,10 @@ +{ + "api_shortname": "longrunning", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/longrunning/latest/autogen", + "client_library_type": "generated", + "description": "Long Running Operations API", + "distribution_name": "cloud.google.com/go/longrunning/autogen", + "language": "go", + "library_type": "GAPIC_AUTO", + "release_level": "stable" +} diff --git a/vendor/cloud.google.com/go/longrunning/autogen/helpers.go b/vendor/cloud.google.com/go/longrunning/autogen/helpers.go index 4ff8ce8b5ed..e81363c9da6 100644 --- a/vendor/cloud.google.com/go/longrunning/autogen/helpers.go +++ b/vendor/cloud.google.com/go/longrunning/autogen/helpers.go @@ -18,6 +18,7 @@ package longrunning import ( "context" + "fmt" "io" "log/slog" "net/http" @@ -28,10 +29,13 @@ import ( "google.golang.org/api/option" "google.golang.org/grpc" "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/runtime/protoimpl" ) const serviceName = "longrunning.googleapis.com" +var protoVersion = fmt.Sprintf("1.%d", protoimpl.MaxVersion) + // For more information on implementing a client constructor hook, see // https://github.com/googleapis/google-cloud-go/wiki/Customizing-constructors. type clientHookParams struct{} diff --git a/vendor/cloud.google.com/go/longrunning/autogen/longrunningpb/operations.pb.go b/vendor/cloud.google.com/go/longrunning/autogen/longrunningpb/operations.pb.go index d1a53c67926..cc84c0f14c3 100644 --- a/vendor/cloud.google.com/go/longrunning/autogen/longrunningpb/operations.pb.go +++ b/vendor/cloud.google.com/go/longrunning/autogen/longrunningpb/operations.pb.go @@ -15,21 +15,17 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/longrunning/operations.proto package longrunningpb import ( - context "context" reflect "reflect" sync "sync" _ "google.golang.org/genproto/googleapis/api/annotations" status "google.golang.org/genproto/googleapis/rpc/status" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status1 "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" descriptorpb "google.golang.org/protobuf/types/descriptorpb" @@ -237,6 +233,17 @@ type ListOperationsRequest struct { PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` // The standard list page token. PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` + // When set to `true`, operations that are reachable are returned as normal, + // and those that are unreachable are returned in the + // [ListOperationsResponse.unreachable] field. + // + // This can only be `true` when reading across collections e.g. when `parent` + // is set to `"projects/example/locations/-"`. + // + // This field is not by default supported and will result in an + // `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + // service or product specific documentation. + ReturnPartialSuccess bool `protobuf:"varint,5,opt,name=return_partial_success,json=returnPartialSuccess,proto3" json:"return_partial_success,omitempty"` } func (x *ListOperationsRequest) Reset() { @@ -297,6 +304,13 @@ func (x *ListOperationsRequest) GetPageToken() string { return "" } +func (x *ListOperationsRequest) GetReturnPartialSuccess() bool { + if x != nil { + return x.ReturnPartialSuccess + } + return false +} + // The response message for // [Operations.ListOperations][google.longrunning.Operations.ListOperations]. type ListOperationsResponse struct { @@ -308,6 +322,11 @@ type ListOperationsResponse struct { Operations []*Operation `protobuf:"bytes,1,rep,name=operations,proto3" json:"operations,omitempty"` // The standard List next-page token. NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` + // Unordered list. Unreachable resources. Populated when the request sets + // `ListOperationsRequest.return_partial_success` and reads across + // collections e.g. when attempting to list all resources across all supported + // locations. + Unreachable []string `protobuf:"bytes,3,rep,name=unreachable,proto3" json:"unreachable,omitempty"` } func (x *ListOperationsResponse) Reset() { @@ -354,6 +373,13 @@ func (x *ListOperationsResponse) GetNextPageToken() string { return "" } +func (x *ListOperationsResponse) GetUnreachable() []string { + if x != nil { + return x.Unreachable + } + return nil +} + // The request message for // [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]. type CancelOperationRequest struct { @@ -621,48 +647,56 @@ var file_google_longrunning_operations_proto_rawDesc = []byte{ 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, - 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, - 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0xcf, 0x01, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x30, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x08, 0x6d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x6f, 0x6e, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x64, 0x6f, 0x6e, 0x65, 0x12, 0x2a, 0x0a, 0x05, 0x65, - 0x72, 0x72, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x48, 0x00, - 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x32, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x48, - 0x00, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x08, 0x0a, 0x06, 0x72, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x29, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x4f, 0x70, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x22, 0x7f, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, - 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, - 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, - 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, - 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x22, 0x7f, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x0a, 0x6f, - 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6c, 0x6f, 0x6e, 0x67, 0x72, 0x75, 0x6e, - 0x6e, 0x69, 0x6e, 0x67, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, - 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, - 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x22, 0x2c, 0x0a, 0x16, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x4f, 0x70, 0x65, 0x72, + 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, + 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, + 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, + 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xcf, 0x01, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x30, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x08, + 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x6f, 0x6e, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x64, 0x6f, 0x6e, 0x65, 0x12, 0x2a, 0x0a, 0x05, + 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x48, + 0x00, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x32, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, + 0x48, 0x00, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x08, 0x0a, 0x06, + 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x29, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x4f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x22, 0xb5, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, + 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, + 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x12, 0x34, 0x0a, 0x16, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x5f, 0x70, 0x61, + 0x72, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x14, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x50, 0x61, 0x72, 0x74, 0x69, + 0x61, 0x6c, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0xa6, 0x01, 0x0a, 0x16, 0x4c, 0x69, + 0x73, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x6c, 0x6f, 0x6e, 0x67, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x2e, 0x4f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, + 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, + 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x25, 0x0a, 0x0b, 0x75, + 0x6e, 0x72, 0x65, 0x61, 0x63, 0x68, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, + 0x42, 0x03, 0xe0, 0x41, 0x06, 0x52, 0x0b, 0x75, 0x6e, 0x72, 0x65, 0x61, 0x63, 0x68, 0x61, 0x62, + 0x6c, 0x65, 0x22, 0x2c, 0x0a, 0x16, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x2c, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, @@ -729,18 +763,17 @@ var file_google_longrunning_operations_proto_rawDesc = []byte{ 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6c, 0x6f, 0x6e, 0x67, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0d, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, - 0x66, 0x6f, 0x42, 0xa5, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x66, 0x6f, 0x42, 0xa2, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6c, 0x6f, 0x6e, 0x67, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x42, 0x0f, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x43, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x6c, 0x6f, 0x6e, 0x67, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x6c, 0x6f, 0x6e, 0x67, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x70, 0x62, 0x3b, 0x6c, 0x6f, 0x6e, 0x67, 0x72, 0x75, 0x6e, 0x6e, - 0x69, 0x6e, 0x67, 0x70, 0x62, 0xf8, 0x01, 0x01, 0xa2, 0x02, 0x05, 0x47, 0x4c, 0x52, 0x55, 0x4e, - 0xaa, 0x02, 0x12, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x4c, 0x6f, 0x6e, 0x67, 0x52, 0x75, - 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0xca, 0x02, 0x12, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5c, 0x4c, - 0x6f, 0x6e, 0x67, 0x52, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x69, 0x6e, 0x67, 0x70, 0x62, 0xa2, 0x02, 0x05, 0x47, 0x4c, 0x52, 0x55, 0x4e, 0xaa, 0x02, 0x12, + 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x4c, 0x6f, 0x6e, 0x67, 0x52, 0x75, 0x6e, 0x6e, 0x69, + 0x6e, 0x67, 0xca, 0x02, 0x12, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5c, 0x4c, 0x6f, 0x6e, 0x67, + 0x52, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -825,285 +858,3 @@ func file_google_longrunning_operations_proto_init() { file_google_longrunning_operations_proto_goTypes = nil file_google_longrunning_operations_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// OperationsClient is the client API for Operations service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type OperationsClient interface { - // Lists operations that match the specified filter in the request. If the - // server doesn't support this method, it returns `UNIMPLEMENTED`. - ListOperations(ctx context.Context, in *ListOperationsRequest, opts ...grpc.CallOption) (*ListOperationsResponse, error) - // Gets the latest state of a long-running operation. Clients can use this - // method to poll the operation result at intervals as recommended by the API - // service. - GetOperation(ctx context.Context, in *GetOperationRequest, opts ...grpc.CallOption) (*Operation, error) - // Deletes a long-running operation. This method indicates that the client is - // no longer interested in the operation result. It does not cancel the - // operation. If the server doesn't support this method, it returns - // `google.rpc.Code.UNIMPLEMENTED`. - DeleteOperation(ctx context.Context, in *DeleteOperationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // Starts asynchronous cancellation on a long-running operation. The server - // makes a best effort to cancel the operation, but success is not - // guaranteed. If the server doesn't support this method, it returns - // `google.rpc.Code.UNIMPLEMENTED`. Clients can use - // [Operations.GetOperation][google.longrunning.Operations.GetOperation] or - // other methods to check whether the cancellation succeeded or whether the - // operation completed despite cancellation. On successful cancellation, - // the operation is not deleted; instead, it becomes an operation with - // an [Operation.error][google.longrunning.Operation.error] value with a - // [google.rpc.Status.code][google.rpc.Status.code] of `1`, corresponding to - // `Code.CANCELLED`. - CancelOperation(ctx context.Context, in *CancelOperationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // Waits until the specified long-running operation is done or reaches at most - // a specified timeout, returning the latest state. If the operation is - // already done, the latest state is immediately returned. If the timeout - // specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - // timeout is used. If the server does not support this method, it returns - // `google.rpc.Code.UNIMPLEMENTED`. - // Note that this method is on a best-effort basis. It may return the latest - // state before the specified timeout (including immediately), meaning even an - // immediate response is no guarantee that the operation is done. - WaitOperation(ctx context.Context, in *WaitOperationRequest, opts ...grpc.CallOption) (*Operation, error) -} - -type operationsClient struct { - cc grpc.ClientConnInterface -} - -func NewOperationsClient(cc grpc.ClientConnInterface) OperationsClient { - return &operationsClient{cc} -} - -func (c *operationsClient) ListOperations(ctx context.Context, in *ListOperationsRequest, opts ...grpc.CallOption) (*ListOperationsResponse, error) { - out := new(ListOperationsResponse) - err := c.cc.Invoke(ctx, "/google.longrunning.Operations/ListOperations", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *operationsClient) GetOperation(ctx context.Context, in *GetOperationRequest, opts ...grpc.CallOption) (*Operation, error) { - out := new(Operation) - err := c.cc.Invoke(ctx, "/google.longrunning.Operations/GetOperation", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *operationsClient) DeleteOperation(ctx context.Context, in *DeleteOperationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/google.longrunning.Operations/DeleteOperation", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *operationsClient) CancelOperation(ctx context.Context, in *CancelOperationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/google.longrunning.Operations/CancelOperation", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *operationsClient) WaitOperation(ctx context.Context, in *WaitOperationRequest, opts ...grpc.CallOption) (*Operation, error) { - out := new(Operation) - err := c.cc.Invoke(ctx, "/google.longrunning.Operations/WaitOperation", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// OperationsServer is the server API for Operations service. -type OperationsServer interface { - // Lists operations that match the specified filter in the request. If the - // server doesn't support this method, it returns `UNIMPLEMENTED`. - ListOperations(context.Context, *ListOperationsRequest) (*ListOperationsResponse, error) - // Gets the latest state of a long-running operation. Clients can use this - // method to poll the operation result at intervals as recommended by the API - // service. - GetOperation(context.Context, *GetOperationRequest) (*Operation, error) - // Deletes a long-running operation. This method indicates that the client is - // no longer interested in the operation result. It does not cancel the - // operation. If the server doesn't support this method, it returns - // `google.rpc.Code.UNIMPLEMENTED`. - DeleteOperation(context.Context, *DeleteOperationRequest) (*emptypb.Empty, error) - // Starts asynchronous cancellation on a long-running operation. The server - // makes a best effort to cancel the operation, but success is not - // guaranteed. If the server doesn't support this method, it returns - // `google.rpc.Code.UNIMPLEMENTED`. Clients can use - // [Operations.GetOperation][google.longrunning.Operations.GetOperation] or - // other methods to check whether the cancellation succeeded or whether the - // operation completed despite cancellation. On successful cancellation, - // the operation is not deleted; instead, it becomes an operation with - // an [Operation.error][google.longrunning.Operation.error] value with a - // [google.rpc.Status.code][google.rpc.Status.code] of `1`, corresponding to - // `Code.CANCELLED`. - CancelOperation(context.Context, *CancelOperationRequest) (*emptypb.Empty, error) - // Waits until the specified long-running operation is done or reaches at most - // a specified timeout, returning the latest state. If the operation is - // already done, the latest state is immediately returned. If the timeout - // specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - // timeout is used. If the server does not support this method, it returns - // `google.rpc.Code.UNIMPLEMENTED`. - // Note that this method is on a best-effort basis. It may return the latest - // state before the specified timeout (including immediately), meaning even an - // immediate response is no guarantee that the operation is done. - WaitOperation(context.Context, *WaitOperationRequest) (*Operation, error) -} - -// UnimplementedOperationsServer can be embedded to have forward compatible implementations. -type UnimplementedOperationsServer struct { -} - -func (*UnimplementedOperationsServer) ListOperations(context.Context, *ListOperationsRequest) (*ListOperationsResponse, error) { - return nil, status1.Errorf(codes.Unimplemented, "method ListOperations not implemented") -} -func (*UnimplementedOperationsServer) GetOperation(context.Context, *GetOperationRequest) (*Operation, error) { - return nil, status1.Errorf(codes.Unimplemented, "method GetOperation not implemented") -} -func (*UnimplementedOperationsServer) DeleteOperation(context.Context, *DeleteOperationRequest) (*emptypb.Empty, error) { - return nil, status1.Errorf(codes.Unimplemented, "method DeleteOperation not implemented") -} -func (*UnimplementedOperationsServer) CancelOperation(context.Context, *CancelOperationRequest) (*emptypb.Empty, error) { - return nil, status1.Errorf(codes.Unimplemented, "method CancelOperation not implemented") -} -func (*UnimplementedOperationsServer) WaitOperation(context.Context, *WaitOperationRequest) (*Operation, error) { - return nil, status1.Errorf(codes.Unimplemented, "method WaitOperation not implemented") -} - -func RegisterOperationsServer(s *grpc.Server, srv OperationsServer) { - s.RegisterService(&_Operations_serviceDesc, srv) -} - -func _Operations_ListOperations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListOperationsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OperationsServer).ListOperations(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.longrunning.Operations/ListOperations", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OperationsServer).ListOperations(ctx, req.(*ListOperationsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Operations_GetOperation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetOperationRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OperationsServer).GetOperation(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.longrunning.Operations/GetOperation", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OperationsServer).GetOperation(ctx, req.(*GetOperationRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Operations_DeleteOperation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteOperationRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OperationsServer).DeleteOperation(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.longrunning.Operations/DeleteOperation", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OperationsServer).DeleteOperation(ctx, req.(*DeleteOperationRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Operations_CancelOperation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CancelOperationRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OperationsServer).CancelOperation(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.longrunning.Operations/CancelOperation", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OperationsServer).CancelOperation(ctx, req.(*CancelOperationRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Operations_WaitOperation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(WaitOperationRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OperationsServer).WaitOperation(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.longrunning.Operations/WaitOperation", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OperationsServer).WaitOperation(ctx, req.(*WaitOperationRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Operations_serviceDesc = grpc.ServiceDesc{ - ServiceName: "google.longrunning.Operations", - HandlerType: (*OperationsServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListOperations", - Handler: _Operations_ListOperations_Handler, - }, - { - MethodName: "GetOperation", - Handler: _Operations_GetOperation_Handler, - }, - { - MethodName: "DeleteOperation", - Handler: _Operations_DeleteOperation_Handler, - }, - { - MethodName: "CancelOperation", - Handler: _Operations_CancelOperation_Handler, - }, - { - MethodName: "WaitOperation", - Handler: _Operations_WaitOperation_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "google/longrunning/operations.proto", -} diff --git a/vendor/cloud.google.com/go/longrunning/autogen/longrunningpb/operations_grpc.pb.go b/vendor/cloud.google.com/go/longrunning/autogen/longrunningpb/operations_grpc.pb.go new file mode 100644 index 00000000000..2b6407e49b7 --- /dev/null +++ b/vendor/cloud.google.com/go/longrunning/autogen/longrunningpb/operations_grpc.pb.go @@ -0,0 +1,329 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.7 +// source: google/longrunning/operations.proto + +package longrunningpb + +import ( + context "context" + + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Operations_ListOperations_FullMethodName = "/google.longrunning.Operations/ListOperations" + Operations_GetOperation_FullMethodName = "/google.longrunning.Operations/GetOperation" + Operations_DeleteOperation_FullMethodName = "/google.longrunning.Operations/DeleteOperation" + Operations_CancelOperation_FullMethodName = "/google.longrunning.Operations/CancelOperation" + Operations_WaitOperation_FullMethodName = "/google.longrunning.Operations/WaitOperation" +) + +// OperationsClient is the client API for Operations service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type OperationsClient interface { + // Lists operations that match the specified filter in the request. If the + // server doesn't support this method, it returns `UNIMPLEMENTED`. + ListOperations(ctx context.Context, in *ListOperationsRequest, opts ...grpc.CallOption) (*ListOperationsResponse, error) + // Gets the latest state of a long-running operation. Clients can use this + // method to poll the operation result at intervals as recommended by the API + // service. + GetOperation(ctx context.Context, in *GetOperationRequest, opts ...grpc.CallOption) (*Operation, error) + // Deletes a long-running operation. This method indicates that the client is + // no longer interested in the operation result. It does not cancel the + // operation. If the server doesn't support this method, it returns + // `google.rpc.Code.UNIMPLEMENTED`. + DeleteOperation(ctx context.Context, in *DeleteOperationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Starts asynchronous cancellation on a long-running operation. The server + // makes a best effort to cancel the operation, but success is not + // guaranteed. If the server doesn't support this method, it returns + // `google.rpc.Code.UNIMPLEMENTED`. Clients can use + // [Operations.GetOperation][google.longrunning.Operations.GetOperation] or + // other methods to check whether the cancellation succeeded or whether the + // operation completed despite cancellation. On successful cancellation, + // the operation is not deleted; instead, it becomes an operation with + // an [Operation.error][google.longrunning.Operation.error] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of `1`, corresponding to + // `Code.CANCELLED`. + CancelOperation(ctx context.Context, in *CancelOperationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Waits until the specified long-running operation is done or reaches at most + // a specified timeout, returning the latest state. If the operation is + // already done, the latest state is immediately returned. If the timeout + // specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + // timeout is used. If the server does not support this method, it returns + // `google.rpc.Code.UNIMPLEMENTED`. + // Note that this method is on a best-effort basis. It may return the latest + // state before the specified timeout (including immediately), meaning even an + // immediate response is no guarantee that the operation is done. + WaitOperation(ctx context.Context, in *WaitOperationRequest, opts ...grpc.CallOption) (*Operation, error) +} + +type operationsClient struct { + cc grpc.ClientConnInterface +} + +func NewOperationsClient(cc grpc.ClientConnInterface) OperationsClient { + return &operationsClient{cc} +} + +func (c *operationsClient) ListOperations(ctx context.Context, in *ListOperationsRequest, opts ...grpc.CallOption) (*ListOperationsResponse, error) { + out := new(ListOperationsResponse) + err := c.cc.Invoke(ctx, Operations_ListOperations_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *operationsClient) GetOperation(ctx context.Context, in *GetOperationRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := c.cc.Invoke(ctx, Operations_GetOperation_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *operationsClient) DeleteOperation(ctx context.Context, in *DeleteOperationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, Operations_DeleteOperation_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *operationsClient) CancelOperation(ctx context.Context, in *CancelOperationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, Operations_CancelOperation_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *operationsClient) WaitOperation(ctx context.Context, in *WaitOperationRequest, opts ...grpc.CallOption) (*Operation, error) { + out := new(Operation) + err := c.cc.Invoke(ctx, Operations_WaitOperation_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// OperationsServer is the server API for Operations service. +// All implementations should embed UnimplementedOperationsServer +// for forward compatibility +type OperationsServer interface { + // Lists operations that match the specified filter in the request. If the + // server doesn't support this method, it returns `UNIMPLEMENTED`. + ListOperations(context.Context, *ListOperationsRequest) (*ListOperationsResponse, error) + // Gets the latest state of a long-running operation. Clients can use this + // method to poll the operation result at intervals as recommended by the API + // service. + GetOperation(context.Context, *GetOperationRequest) (*Operation, error) + // Deletes a long-running operation. This method indicates that the client is + // no longer interested in the operation result. It does not cancel the + // operation. If the server doesn't support this method, it returns + // `google.rpc.Code.UNIMPLEMENTED`. + DeleteOperation(context.Context, *DeleteOperationRequest) (*emptypb.Empty, error) + // Starts asynchronous cancellation on a long-running operation. The server + // makes a best effort to cancel the operation, but success is not + // guaranteed. If the server doesn't support this method, it returns + // `google.rpc.Code.UNIMPLEMENTED`. Clients can use + // [Operations.GetOperation][google.longrunning.Operations.GetOperation] or + // other methods to check whether the cancellation succeeded or whether the + // operation completed despite cancellation. On successful cancellation, + // the operation is not deleted; instead, it becomes an operation with + // an [Operation.error][google.longrunning.Operation.error] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of `1`, corresponding to + // `Code.CANCELLED`. + CancelOperation(context.Context, *CancelOperationRequest) (*emptypb.Empty, error) + // Waits until the specified long-running operation is done or reaches at most + // a specified timeout, returning the latest state. If the operation is + // already done, the latest state is immediately returned. If the timeout + // specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + // timeout is used. If the server does not support this method, it returns + // `google.rpc.Code.UNIMPLEMENTED`. + // Note that this method is on a best-effort basis. It may return the latest + // state before the specified timeout (including immediately), meaning even an + // immediate response is no guarantee that the operation is done. + WaitOperation(context.Context, *WaitOperationRequest) (*Operation, error) +} + +// UnimplementedOperationsServer should be embedded to have forward compatible implementations. +type UnimplementedOperationsServer struct { +} + +func (UnimplementedOperationsServer) ListOperations(context.Context, *ListOperationsRequest) (*ListOperationsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListOperations not implemented") +} +func (UnimplementedOperationsServer) GetOperation(context.Context, *GetOperationRequest) (*Operation, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetOperation not implemented") +} +func (UnimplementedOperationsServer) DeleteOperation(context.Context, *DeleteOperationRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteOperation not implemented") +} +func (UnimplementedOperationsServer) CancelOperation(context.Context, *CancelOperationRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method CancelOperation not implemented") +} +func (UnimplementedOperationsServer) WaitOperation(context.Context, *WaitOperationRequest) (*Operation, error) { + return nil, status.Errorf(codes.Unimplemented, "method WaitOperation not implemented") +} + +// UnsafeOperationsServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to OperationsServer will +// result in compilation errors. +type UnsafeOperationsServer interface { + mustEmbedUnimplementedOperationsServer() +} + +func RegisterOperationsServer(s grpc.ServiceRegistrar, srv OperationsServer) { + s.RegisterService(&Operations_ServiceDesc, srv) +} + +func _Operations_ListOperations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListOperationsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OperationsServer).ListOperations(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Operations_ListOperations_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OperationsServer).ListOperations(ctx, req.(*ListOperationsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Operations_GetOperation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetOperationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OperationsServer).GetOperation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Operations_GetOperation_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OperationsServer).GetOperation(ctx, req.(*GetOperationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Operations_DeleteOperation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteOperationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OperationsServer).DeleteOperation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Operations_DeleteOperation_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OperationsServer).DeleteOperation(ctx, req.(*DeleteOperationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Operations_CancelOperation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CancelOperationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OperationsServer).CancelOperation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Operations_CancelOperation_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OperationsServer).CancelOperation(ctx, req.(*CancelOperationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Operations_WaitOperation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(WaitOperationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OperationsServer).WaitOperation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Operations_WaitOperation_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OperationsServer).WaitOperation(ctx, req.(*WaitOperationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Operations_ServiceDesc is the grpc.ServiceDesc for Operations service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Operations_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "google.longrunning.Operations", + HandlerType: (*OperationsServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListOperations", + Handler: _Operations_ListOperations_Handler, + }, + { + MethodName: "GetOperation", + Handler: _Operations_GetOperation_Handler, + }, + { + MethodName: "DeleteOperation", + Handler: _Operations_DeleteOperation_Handler, + }, + { + MethodName: "CancelOperation", + Handler: _Operations_CancelOperation_Handler, + }, + { + MethodName: "WaitOperation", + Handler: _Operations_WaitOperation_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/longrunning/operations.proto", +} diff --git a/vendor/cloud.google.com/go/longrunning/autogen/operations_client.go b/vendor/cloud.google.com/go/longrunning/autogen/operations_client.go index 57c8173e929..c4457848955 100644 --- a/vendor/cloud.google.com/go/longrunning/autogen/operations_client.go +++ b/vendor/cloud.google.com/go/longrunning/autogen/operations_client.go @@ -346,7 +346,7 @@ func (c *operationsGRPCClient) Connection() *grpc.ClientConn { // use by Google-written clients. func (c *operationsGRPCClient) setGoogleClientInfo(keyval ...string) { kv := append([]string{"gl-go", gax.GoVersion}, keyval...) - kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version) + kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version, "pb", protoVersion) c.xGoogHeaders = []string{ "x-goog-api-client", gax.XGoogHeader(kv...), } @@ -422,7 +422,7 @@ func defaultOperationsRESTClientOptions() []option.ClientOption { // use by Google-written clients. func (c *operationsRESTClient) setGoogleClientInfo(keyval ...string) { kv := append([]string{"gl-go", gax.GoVersion}, keyval...) - kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN") + kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN", "pb", protoVersion) c.xGoogHeaders = []string{ "x-goog-api-client", gax.XGoogHeader(kv...), } @@ -581,6 +581,9 @@ func (c *operationsRESTClient) ListOperations(ctx context.Context, req *longrunn if req.GetPageToken() != "" { params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken())) } + if req.GetReturnPartialSuccess() { + params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess())) + } baseUrl.RawQuery = params.Encode() diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/alert_policy_client.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/alert_policy_client.go index 9a9408f19bf..cc8c69c2401 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/alert_policy_client.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/alert_policy_client.go @@ -276,7 +276,7 @@ func (c *alertPolicyGRPCClient) Connection() *grpc.ClientConn { // use by Google-written clients. func (c *alertPolicyGRPCClient) setGoogleClientInfo(keyval ...string) { kv := append([]string{"gl-go", gax.GoVersion}, keyval...) - kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version) + kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version, "pb", protoVersion) c.xGoogHeaders = []string{ "x-goog-api-client", gax.XGoogHeader(kv...), } diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/group_client.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/group_client.go index a45e1aec278..7a9e076093b 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/group_client.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/group_client.go @@ -297,7 +297,7 @@ func (c *groupGRPCClient) Connection() *grpc.ClientConn { // use by Google-written clients. func (c *groupGRPCClient) setGoogleClientInfo(keyval ...string) { kv := append([]string{"gl-go", gax.GoVersion}, keyval...) - kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version) + kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version, "pb", protoVersion) c.xGoogHeaders = []string{ "x-goog-api-client", gax.XGoogHeader(kv...), } diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/helpers.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/helpers.go index 6719cac8635..b97da685e9d 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/helpers.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/helpers.go @@ -18,16 +18,20 @@ package monitoring import ( "context" + "fmt" "log/slog" "github.com/googleapis/gax-go/v2/internallog/grpclog" "google.golang.org/api/option" "google.golang.org/grpc" "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/runtime/protoimpl" ) const serviceName = "monitoring.googleapis.com" +var protoVersion = fmt.Sprintf("1.%d", protoimpl.MaxVersion) + // For more information on implementing a client constructor hook, see // https://github.com/googleapis/google-cloud-go/wiki/Customizing-constructors. type clientHookParams struct{} diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/metric_client.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/metric_client.go index 29eb4849d23..2ed8ccc133d 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/metric_client.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/metric_client.go @@ -335,7 +335,7 @@ func (c *metricGRPCClient) Connection() *grpc.ClientConn { // use by Google-written clients. func (c *metricGRPCClient) setGoogleClientInfo(keyval ...string) { kv := append([]string{"gl-go", gax.GoVersion}, keyval...) - kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version) + kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version, "pb", protoVersion) c.xGoogHeaders = []string{ "x-goog-api-client", gax.XGoogHeader(kv...), } diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert.pb.go index 24ca1414bb3..f735f032534 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert.pb.go @@ -15,15 +15,12 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/monitoring/v3/alert.proto package monitoringpb import ( - reflect "reflect" - sync "sync" - _ "google.golang.org/genproto/googleapis/api/annotations" status "google.golang.org/genproto/googleapis/rpc/status" timeofday "google.golang.org/genproto/googleapis/type/timeofday" @@ -31,6 +28,8 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" durationpb "google.golang.org/protobuf/types/known/durationpb" wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" + reflect "reflect" + sync "sync" ) const ( diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert_service.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert_service.pb.go index ba0c4f65f2c..5edc4a06df8 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert_service.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert_service.pb.go @@ -15,24 +15,19 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/monitoring/v3/alert_service.proto package monitoringpb import ( - context "context" - reflect "reflect" - sync "sync" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" emptypb "google.golang.org/protobuf/types/known/emptypb" fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" + reflect "reflect" + sync "sync" ) const ( @@ -695,267 +690,3 @@ func file_google_monitoring_v3_alert_service_proto_init() { file_google_monitoring_v3_alert_service_proto_goTypes = nil file_google_monitoring_v3_alert_service_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// AlertPolicyServiceClient is the client API for AlertPolicyService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type AlertPolicyServiceClient interface { - // Lists the existing alerting policies for the workspace. - ListAlertPolicies(ctx context.Context, in *ListAlertPoliciesRequest, opts ...grpc.CallOption) (*ListAlertPoliciesResponse, error) - // Gets a single alerting policy. - GetAlertPolicy(ctx context.Context, in *GetAlertPolicyRequest, opts ...grpc.CallOption) (*AlertPolicy, error) - // Creates a new alerting policy. - // - // Design your application to single-thread API calls that modify the state of - // alerting policies in a single project. This includes calls to - // CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. - CreateAlertPolicy(ctx context.Context, in *CreateAlertPolicyRequest, opts ...grpc.CallOption) (*AlertPolicy, error) - // Deletes an alerting policy. - // - // Design your application to single-thread API calls that modify the state of - // alerting policies in a single project. This includes calls to - // CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. - DeleteAlertPolicy(ctx context.Context, in *DeleteAlertPolicyRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // Updates an alerting policy. You can either replace the entire policy with - // a new one or replace only certain fields in the current alerting policy by - // specifying the fields to be updated via `updateMask`. Returns the - // updated alerting policy. - // - // Design your application to single-thread API calls that modify the state of - // alerting policies in a single project. This includes calls to - // CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. - UpdateAlertPolicy(ctx context.Context, in *UpdateAlertPolicyRequest, opts ...grpc.CallOption) (*AlertPolicy, error) -} - -type alertPolicyServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewAlertPolicyServiceClient(cc grpc.ClientConnInterface) AlertPolicyServiceClient { - return &alertPolicyServiceClient{cc} -} - -func (c *alertPolicyServiceClient) ListAlertPolicies(ctx context.Context, in *ListAlertPoliciesRequest, opts ...grpc.CallOption) (*ListAlertPoliciesResponse, error) { - out := new(ListAlertPoliciesResponse) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.AlertPolicyService/ListAlertPolicies", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *alertPolicyServiceClient) GetAlertPolicy(ctx context.Context, in *GetAlertPolicyRequest, opts ...grpc.CallOption) (*AlertPolicy, error) { - out := new(AlertPolicy) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.AlertPolicyService/GetAlertPolicy", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *alertPolicyServiceClient) CreateAlertPolicy(ctx context.Context, in *CreateAlertPolicyRequest, opts ...grpc.CallOption) (*AlertPolicy, error) { - out := new(AlertPolicy) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.AlertPolicyService/CreateAlertPolicy", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *alertPolicyServiceClient) DeleteAlertPolicy(ctx context.Context, in *DeleteAlertPolicyRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.AlertPolicyService/DeleteAlertPolicy", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *alertPolicyServiceClient) UpdateAlertPolicy(ctx context.Context, in *UpdateAlertPolicyRequest, opts ...grpc.CallOption) (*AlertPolicy, error) { - out := new(AlertPolicy) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.AlertPolicyService/UpdateAlertPolicy", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// AlertPolicyServiceServer is the server API for AlertPolicyService service. -type AlertPolicyServiceServer interface { - // Lists the existing alerting policies for the workspace. - ListAlertPolicies(context.Context, *ListAlertPoliciesRequest) (*ListAlertPoliciesResponse, error) - // Gets a single alerting policy. - GetAlertPolicy(context.Context, *GetAlertPolicyRequest) (*AlertPolicy, error) - // Creates a new alerting policy. - // - // Design your application to single-thread API calls that modify the state of - // alerting policies in a single project. This includes calls to - // CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. - CreateAlertPolicy(context.Context, *CreateAlertPolicyRequest) (*AlertPolicy, error) - // Deletes an alerting policy. - // - // Design your application to single-thread API calls that modify the state of - // alerting policies in a single project. This includes calls to - // CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. - DeleteAlertPolicy(context.Context, *DeleteAlertPolicyRequest) (*emptypb.Empty, error) - // Updates an alerting policy. You can either replace the entire policy with - // a new one or replace only certain fields in the current alerting policy by - // specifying the fields to be updated via `updateMask`. Returns the - // updated alerting policy. - // - // Design your application to single-thread API calls that modify the state of - // alerting policies in a single project. This includes calls to - // CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. - UpdateAlertPolicy(context.Context, *UpdateAlertPolicyRequest) (*AlertPolicy, error) -} - -// UnimplementedAlertPolicyServiceServer can be embedded to have forward compatible implementations. -type UnimplementedAlertPolicyServiceServer struct { -} - -func (*UnimplementedAlertPolicyServiceServer) ListAlertPolicies(context.Context, *ListAlertPoliciesRequest) (*ListAlertPoliciesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListAlertPolicies not implemented") -} -func (*UnimplementedAlertPolicyServiceServer) GetAlertPolicy(context.Context, *GetAlertPolicyRequest) (*AlertPolicy, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetAlertPolicy not implemented") -} -func (*UnimplementedAlertPolicyServiceServer) CreateAlertPolicy(context.Context, *CreateAlertPolicyRequest) (*AlertPolicy, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateAlertPolicy not implemented") -} -func (*UnimplementedAlertPolicyServiceServer) DeleteAlertPolicy(context.Context, *DeleteAlertPolicyRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteAlertPolicy not implemented") -} -func (*UnimplementedAlertPolicyServiceServer) UpdateAlertPolicy(context.Context, *UpdateAlertPolicyRequest) (*AlertPolicy, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateAlertPolicy not implemented") -} - -func RegisterAlertPolicyServiceServer(s *grpc.Server, srv AlertPolicyServiceServer) { - s.RegisterService(&_AlertPolicyService_serviceDesc, srv) -} - -func _AlertPolicyService_ListAlertPolicies_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListAlertPoliciesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AlertPolicyServiceServer).ListAlertPolicies(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.AlertPolicyService/ListAlertPolicies", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AlertPolicyServiceServer).ListAlertPolicies(ctx, req.(*ListAlertPoliciesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AlertPolicyService_GetAlertPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetAlertPolicyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AlertPolicyServiceServer).GetAlertPolicy(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.AlertPolicyService/GetAlertPolicy", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AlertPolicyServiceServer).GetAlertPolicy(ctx, req.(*GetAlertPolicyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AlertPolicyService_CreateAlertPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateAlertPolicyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AlertPolicyServiceServer).CreateAlertPolicy(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.AlertPolicyService/CreateAlertPolicy", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AlertPolicyServiceServer).CreateAlertPolicy(ctx, req.(*CreateAlertPolicyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AlertPolicyService_DeleteAlertPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteAlertPolicyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AlertPolicyServiceServer).DeleteAlertPolicy(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.AlertPolicyService/DeleteAlertPolicy", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AlertPolicyServiceServer).DeleteAlertPolicy(ctx, req.(*DeleteAlertPolicyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AlertPolicyService_UpdateAlertPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateAlertPolicyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AlertPolicyServiceServer).UpdateAlertPolicy(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.AlertPolicyService/UpdateAlertPolicy", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AlertPolicyServiceServer).UpdateAlertPolicy(ctx, req.(*UpdateAlertPolicyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _AlertPolicyService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "google.monitoring.v3.AlertPolicyService", - HandlerType: (*AlertPolicyServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListAlertPolicies", - Handler: _AlertPolicyService_ListAlertPolicies_Handler, - }, - { - MethodName: "GetAlertPolicy", - Handler: _AlertPolicyService_GetAlertPolicy_Handler, - }, - { - MethodName: "CreateAlertPolicy", - Handler: _AlertPolicyService_CreateAlertPolicy_Handler, - }, - { - MethodName: "DeleteAlertPolicy", - Handler: _AlertPolicyService_DeleteAlertPolicy_Handler, - }, - { - MethodName: "UpdateAlertPolicy", - Handler: _AlertPolicyService_UpdateAlertPolicy_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "google/monitoring/v3/alert_service.proto", -} diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert_service_grpc.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert_service_grpc.pb.go new file mode 100644 index 00000000000..ff3412fb4ca --- /dev/null +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/alert_service_grpc.pb.go @@ -0,0 +1,310 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.7 +// source: google/monitoring/v3/alert_service.proto + +package monitoringpb + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + AlertPolicyService_ListAlertPolicies_FullMethodName = "/google.monitoring.v3.AlertPolicyService/ListAlertPolicies" + AlertPolicyService_GetAlertPolicy_FullMethodName = "/google.monitoring.v3.AlertPolicyService/GetAlertPolicy" + AlertPolicyService_CreateAlertPolicy_FullMethodName = "/google.monitoring.v3.AlertPolicyService/CreateAlertPolicy" + AlertPolicyService_DeleteAlertPolicy_FullMethodName = "/google.monitoring.v3.AlertPolicyService/DeleteAlertPolicy" + AlertPolicyService_UpdateAlertPolicy_FullMethodName = "/google.monitoring.v3.AlertPolicyService/UpdateAlertPolicy" +) + +// AlertPolicyServiceClient is the client API for AlertPolicyService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type AlertPolicyServiceClient interface { + // Lists the existing alerting policies for the workspace. + ListAlertPolicies(ctx context.Context, in *ListAlertPoliciesRequest, opts ...grpc.CallOption) (*ListAlertPoliciesResponse, error) + // Gets a single alerting policy. + GetAlertPolicy(ctx context.Context, in *GetAlertPolicyRequest, opts ...grpc.CallOption) (*AlertPolicy, error) + // Creates a new alerting policy. + // + // Design your application to single-thread API calls that modify the state of + // alerting policies in a single project. This includes calls to + // CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. + CreateAlertPolicy(ctx context.Context, in *CreateAlertPolicyRequest, opts ...grpc.CallOption) (*AlertPolicy, error) + // Deletes an alerting policy. + // + // Design your application to single-thread API calls that modify the state of + // alerting policies in a single project. This includes calls to + // CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. + DeleteAlertPolicy(ctx context.Context, in *DeleteAlertPolicyRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Updates an alerting policy. You can either replace the entire policy with + // a new one or replace only certain fields in the current alerting policy by + // specifying the fields to be updated via `updateMask`. Returns the + // updated alerting policy. + // + // Design your application to single-thread API calls that modify the state of + // alerting policies in a single project. This includes calls to + // CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. + UpdateAlertPolicy(ctx context.Context, in *UpdateAlertPolicyRequest, opts ...grpc.CallOption) (*AlertPolicy, error) +} + +type alertPolicyServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewAlertPolicyServiceClient(cc grpc.ClientConnInterface) AlertPolicyServiceClient { + return &alertPolicyServiceClient{cc} +} + +func (c *alertPolicyServiceClient) ListAlertPolicies(ctx context.Context, in *ListAlertPoliciesRequest, opts ...grpc.CallOption) (*ListAlertPoliciesResponse, error) { + out := new(ListAlertPoliciesResponse) + err := c.cc.Invoke(ctx, AlertPolicyService_ListAlertPolicies_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *alertPolicyServiceClient) GetAlertPolicy(ctx context.Context, in *GetAlertPolicyRequest, opts ...grpc.CallOption) (*AlertPolicy, error) { + out := new(AlertPolicy) + err := c.cc.Invoke(ctx, AlertPolicyService_GetAlertPolicy_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *alertPolicyServiceClient) CreateAlertPolicy(ctx context.Context, in *CreateAlertPolicyRequest, opts ...grpc.CallOption) (*AlertPolicy, error) { + out := new(AlertPolicy) + err := c.cc.Invoke(ctx, AlertPolicyService_CreateAlertPolicy_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *alertPolicyServiceClient) DeleteAlertPolicy(ctx context.Context, in *DeleteAlertPolicyRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, AlertPolicyService_DeleteAlertPolicy_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *alertPolicyServiceClient) UpdateAlertPolicy(ctx context.Context, in *UpdateAlertPolicyRequest, opts ...grpc.CallOption) (*AlertPolicy, error) { + out := new(AlertPolicy) + err := c.cc.Invoke(ctx, AlertPolicyService_UpdateAlertPolicy_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AlertPolicyServiceServer is the server API for AlertPolicyService service. +// All implementations should embed UnimplementedAlertPolicyServiceServer +// for forward compatibility +type AlertPolicyServiceServer interface { + // Lists the existing alerting policies for the workspace. + ListAlertPolicies(context.Context, *ListAlertPoliciesRequest) (*ListAlertPoliciesResponse, error) + // Gets a single alerting policy. + GetAlertPolicy(context.Context, *GetAlertPolicyRequest) (*AlertPolicy, error) + // Creates a new alerting policy. + // + // Design your application to single-thread API calls that modify the state of + // alerting policies in a single project. This includes calls to + // CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. + CreateAlertPolicy(context.Context, *CreateAlertPolicyRequest) (*AlertPolicy, error) + // Deletes an alerting policy. + // + // Design your application to single-thread API calls that modify the state of + // alerting policies in a single project. This includes calls to + // CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. + DeleteAlertPolicy(context.Context, *DeleteAlertPolicyRequest) (*emptypb.Empty, error) + // Updates an alerting policy. You can either replace the entire policy with + // a new one or replace only certain fields in the current alerting policy by + // specifying the fields to be updated via `updateMask`. Returns the + // updated alerting policy. + // + // Design your application to single-thread API calls that modify the state of + // alerting policies in a single project. This includes calls to + // CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. + UpdateAlertPolicy(context.Context, *UpdateAlertPolicyRequest) (*AlertPolicy, error) +} + +// UnimplementedAlertPolicyServiceServer should be embedded to have forward compatible implementations. +type UnimplementedAlertPolicyServiceServer struct { +} + +func (UnimplementedAlertPolicyServiceServer) ListAlertPolicies(context.Context, *ListAlertPoliciesRequest) (*ListAlertPoliciesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListAlertPolicies not implemented") +} +func (UnimplementedAlertPolicyServiceServer) GetAlertPolicy(context.Context, *GetAlertPolicyRequest) (*AlertPolicy, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAlertPolicy not implemented") +} +func (UnimplementedAlertPolicyServiceServer) CreateAlertPolicy(context.Context, *CreateAlertPolicyRequest) (*AlertPolicy, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateAlertPolicy not implemented") +} +func (UnimplementedAlertPolicyServiceServer) DeleteAlertPolicy(context.Context, *DeleteAlertPolicyRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteAlertPolicy not implemented") +} +func (UnimplementedAlertPolicyServiceServer) UpdateAlertPolicy(context.Context, *UpdateAlertPolicyRequest) (*AlertPolicy, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateAlertPolicy not implemented") +} + +// UnsafeAlertPolicyServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to AlertPolicyServiceServer will +// result in compilation errors. +type UnsafeAlertPolicyServiceServer interface { + mustEmbedUnimplementedAlertPolicyServiceServer() +} + +func RegisterAlertPolicyServiceServer(s grpc.ServiceRegistrar, srv AlertPolicyServiceServer) { + s.RegisterService(&AlertPolicyService_ServiceDesc, srv) +} + +func _AlertPolicyService_ListAlertPolicies_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListAlertPoliciesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AlertPolicyServiceServer).ListAlertPolicies(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AlertPolicyService_ListAlertPolicies_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AlertPolicyServiceServer).ListAlertPolicies(ctx, req.(*ListAlertPoliciesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AlertPolicyService_GetAlertPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAlertPolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AlertPolicyServiceServer).GetAlertPolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AlertPolicyService_GetAlertPolicy_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AlertPolicyServiceServer).GetAlertPolicy(ctx, req.(*GetAlertPolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AlertPolicyService_CreateAlertPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateAlertPolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AlertPolicyServiceServer).CreateAlertPolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AlertPolicyService_CreateAlertPolicy_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AlertPolicyServiceServer).CreateAlertPolicy(ctx, req.(*CreateAlertPolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AlertPolicyService_DeleteAlertPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteAlertPolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AlertPolicyServiceServer).DeleteAlertPolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AlertPolicyService_DeleteAlertPolicy_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AlertPolicyServiceServer).DeleteAlertPolicy(ctx, req.(*DeleteAlertPolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AlertPolicyService_UpdateAlertPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateAlertPolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AlertPolicyServiceServer).UpdateAlertPolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AlertPolicyService_UpdateAlertPolicy_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AlertPolicyServiceServer).UpdateAlertPolicy(ctx, req.(*UpdateAlertPolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// AlertPolicyService_ServiceDesc is the grpc.ServiceDesc for AlertPolicyService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var AlertPolicyService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "google.monitoring.v3.AlertPolicyService", + HandlerType: (*AlertPolicyServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListAlertPolicies", + Handler: _AlertPolicyService_ListAlertPolicies_Handler, + }, + { + MethodName: "GetAlertPolicy", + Handler: _AlertPolicyService_GetAlertPolicy_Handler, + }, + { + MethodName: "CreateAlertPolicy", + Handler: _AlertPolicyService_CreateAlertPolicy_Handler, + }, + { + MethodName: "DeleteAlertPolicy", + Handler: _AlertPolicyService_DeleteAlertPolicy_Handler, + }, + { + MethodName: "UpdateAlertPolicy", + Handler: _AlertPolicyService_UpdateAlertPolicy_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/monitoring/v3/alert_service.proto", +} diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/common.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/common.pb.go index 81b8c8f5e46..d6d2047b675 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/common.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/common.pb.go @@ -15,20 +15,19 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/monitoring/v3/common.proto package monitoringpb import ( - reflect "reflect" - sync "sync" - distribution "google.golang.org/genproto/googleapis/api/distribution" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" durationpb "google.golang.org/protobuf/types/known/durationpb" timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" ) const ( diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/dropped_labels.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/dropped_labels.pb.go index 0c3ac5a1c8a..b9161423cb9 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/dropped_labels.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/dropped_labels.pb.go @@ -15,17 +15,16 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/monitoring/v3/dropped_labels.proto package monitoringpb import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group.pb.go index c35046ac71c..6cb42d2922d 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group.pb.go @@ -15,18 +15,17 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/monitoring/v3/group.proto package monitoringpb import ( - reflect "reflect" - sync "sync" - _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group_service.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group_service.pb.go index fbdf9ef54f1..a0552019c27 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group_service.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group_service.pb.go @@ -15,24 +15,19 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/monitoring/v3/group_service.proto package monitoringpb import ( - context "context" - reflect "reflect" - sync "sync" - _ "google.golang.org/genproto/googleapis/api/annotations" monitoredres "google.golang.org/genproto/googleapis/api/monitoredres" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" emptypb "google.golang.org/protobuf/types/known/emptypb" + reflect "reflect" + sync "sync" ) const ( @@ -929,277 +924,3 @@ func file_google_monitoring_v3_group_service_proto_init() { file_google_monitoring_v3_group_service_proto_goTypes = nil file_google_monitoring_v3_group_service_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// GroupServiceClient is the client API for GroupService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type GroupServiceClient interface { - // Lists the existing groups. - ListGroups(ctx context.Context, in *ListGroupsRequest, opts ...grpc.CallOption) (*ListGroupsResponse, error) - // Gets a single group. - GetGroup(ctx context.Context, in *GetGroupRequest, opts ...grpc.CallOption) (*Group, error) - // Creates a new group. - CreateGroup(ctx context.Context, in *CreateGroupRequest, opts ...grpc.CallOption) (*Group, error) - // Updates an existing group. - // You can change any group attributes except `name`. - UpdateGroup(ctx context.Context, in *UpdateGroupRequest, opts ...grpc.CallOption) (*Group, error) - // Deletes an existing group. - DeleteGroup(ctx context.Context, in *DeleteGroupRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // Lists the monitored resources that are members of a group. - ListGroupMembers(ctx context.Context, in *ListGroupMembersRequest, opts ...grpc.CallOption) (*ListGroupMembersResponse, error) -} - -type groupServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewGroupServiceClient(cc grpc.ClientConnInterface) GroupServiceClient { - return &groupServiceClient{cc} -} - -func (c *groupServiceClient) ListGroups(ctx context.Context, in *ListGroupsRequest, opts ...grpc.CallOption) (*ListGroupsResponse, error) { - out := new(ListGroupsResponse) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.GroupService/ListGroups", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *groupServiceClient) GetGroup(ctx context.Context, in *GetGroupRequest, opts ...grpc.CallOption) (*Group, error) { - out := new(Group) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.GroupService/GetGroup", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *groupServiceClient) CreateGroup(ctx context.Context, in *CreateGroupRequest, opts ...grpc.CallOption) (*Group, error) { - out := new(Group) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.GroupService/CreateGroup", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *groupServiceClient) UpdateGroup(ctx context.Context, in *UpdateGroupRequest, opts ...grpc.CallOption) (*Group, error) { - out := new(Group) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.GroupService/UpdateGroup", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *groupServiceClient) DeleteGroup(ctx context.Context, in *DeleteGroupRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.GroupService/DeleteGroup", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *groupServiceClient) ListGroupMembers(ctx context.Context, in *ListGroupMembersRequest, opts ...grpc.CallOption) (*ListGroupMembersResponse, error) { - out := new(ListGroupMembersResponse) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.GroupService/ListGroupMembers", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// GroupServiceServer is the server API for GroupService service. -type GroupServiceServer interface { - // Lists the existing groups. - ListGroups(context.Context, *ListGroupsRequest) (*ListGroupsResponse, error) - // Gets a single group. - GetGroup(context.Context, *GetGroupRequest) (*Group, error) - // Creates a new group. - CreateGroup(context.Context, *CreateGroupRequest) (*Group, error) - // Updates an existing group. - // You can change any group attributes except `name`. - UpdateGroup(context.Context, *UpdateGroupRequest) (*Group, error) - // Deletes an existing group. - DeleteGroup(context.Context, *DeleteGroupRequest) (*emptypb.Empty, error) - // Lists the monitored resources that are members of a group. - ListGroupMembers(context.Context, *ListGroupMembersRequest) (*ListGroupMembersResponse, error) -} - -// UnimplementedGroupServiceServer can be embedded to have forward compatible implementations. -type UnimplementedGroupServiceServer struct { -} - -func (*UnimplementedGroupServiceServer) ListGroups(context.Context, *ListGroupsRequest) (*ListGroupsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListGroups not implemented") -} -func (*UnimplementedGroupServiceServer) GetGroup(context.Context, *GetGroupRequest) (*Group, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetGroup not implemented") -} -func (*UnimplementedGroupServiceServer) CreateGroup(context.Context, *CreateGroupRequest) (*Group, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateGroup not implemented") -} -func (*UnimplementedGroupServiceServer) UpdateGroup(context.Context, *UpdateGroupRequest) (*Group, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateGroup not implemented") -} -func (*UnimplementedGroupServiceServer) DeleteGroup(context.Context, *DeleteGroupRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteGroup not implemented") -} -func (*UnimplementedGroupServiceServer) ListGroupMembers(context.Context, *ListGroupMembersRequest) (*ListGroupMembersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListGroupMembers not implemented") -} - -func RegisterGroupServiceServer(s *grpc.Server, srv GroupServiceServer) { - s.RegisterService(&_GroupService_serviceDesc, srv) -} - -func _GroupService_ListGroups_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListGroupsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(GroupServiceServer).ListGroups(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.GroupService/ListGroups", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GroupServiceServer).ListGroups(ctx, req.(*ListGroupsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _GroupService_GetGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetGroupRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(GroupServiceServer).GetGroup(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.GroupService/GetGroup", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GroupServiceServer).GetGroup(ctx, req.(*GetGroupRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _GroupService_CreateGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateGroupRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(GroupServiceServer).CreateGroup(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.GroupService/CreateGroup", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GroupServiceServer).CreateGroup(ctx, req.(*CreateGroupRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _GroupService_UpdateGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateGroupRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(GroupServiceServer).UpdateGroup(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.GroupService/UpdateGroup", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GroupServiceServer).UpdateGroup(ctx, req.(*UpdateGroupRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _GroupService_DeleteGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteGroupRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(GroupServiceServer).DeleteGroup(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.GroupService/DeleteGroup", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GroupServiceServer).DeleteGroup(ctx, req.(*DeleteGroupRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _GroupService_ListGroupMembers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListGroupMembersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(GroupServiceServer).ListGroupMembers(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.GroupService/ListGroupMembers", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GroupServiceServer).ListGroupMembers(ctx, req.(*ListGroupMembersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _GroupService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "google.monitoring.v3.GroupService", - HandlerType: (*GroupServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListGroups", - Handler: _GroupService_ListGroups_Handler, - }, - { - MethodName: "GetGroup", - Handler: _GroupService_GetGroup_Handler, - }, - { - MethodName: "CreateGroup", - Handler: _GroupService_CreateGroup_Handler, - }, - { - MethodName: "UpdateGroup", - Handler: _GroupService_UpdateGroup_Handler, - }, - { - MethodName: "DeleteGroup", - Handler: _GroupService_DeleteGroup_Handler, - }, - { - MethodName: "ListGroupMembers", - Handler: _GroupService_ListGroupMembers_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "google/monitoring/v3/group_service.proto", -} diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group_service_grpc.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group_service_grpc.pb.go new file mode 100644 index 00000000000..2828587eae1 --- /dev/null +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/group_service_grpc.pb.go @@ -0,0 +1,321 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.7 +// source: google/monitoring/v3/group_service.proto + +package monitoringpb + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + GroupService_ListGroups_FullMethodName = "/google.monitoring.v3.GroupService/ListGroups" + GroupService_GetGroup_FullMethodName = "/google.monitoring.v3.GroupService/GetGroup" + GroupService_CreateGroup_FullMethodName = "/google.monitoring.v3.GroupService/CreateGroup" + GroupService_UpdateGroup_FullMethodName = "/google.monitoring.v3.GroupService/UpdateGroup" + GroupService_DeleteGroup_FullMethodName = "/google.monitoring.v3.GroupService/DeleteGroup" + GroupService_ListGroupMembers_FullMethodName = "/google.monitoring.v3.GroupService/ListGroupMembers" +) + +// GroupServiceClient is the client API for GroupService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type GroupServiceClient interface { + // Lists the existing groups. + ListGroups(ctx context.Context, in *ListGroupsRequest, opts ...grpc.CallOption) (*ListGroupsResponse, error) + // Gets a single group. + GetGroup(ctx context.Context, in *GetGroupRequest, opts ...grpc.CallOption) (*Group, error) + // Creates a new group. + CreateGroup(ctx context.Context, in *CreateGroupRequest, opts ...grpc.CallOption) (*Group, error) + // Updates an existing group. + // You can change any group attributes except `name`. + UpdateGroup(ctx context.Context, in *UpdateGroupRequest, opts ...grpc.CallOption) (*Group, error) + // Deletes an existing group. + DeleteGroup(ctx context.Context, in *DeleteGroupRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Lists the monitored resources that are members of a group. + ListGroupMembers(ctx context.Context, in *ListGroupMembersRequest, opts ...grpc.CallOption) (*ListGroupMembersResponse, error) +} + +type groupServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewGroupServiceClient(cc grpc.ClientConnInterface) GroupServiceClient { + return &groupServiceClient{cc} +} + +func (c *groupServiceClient) ListGroups(ctx context.Context, in *ListGroupsRequest, opts ...grpc.CallOption) (*ListGroupsResponse, error) { + out := new(ListGroupsResponse) + err := c.cc.Invoke(ctx, GroupService_ListGroups_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupServiceClient) GetGroup(ctx context.Context, in *GetGroupRequest, opts ...grpc.CallOption) (*Group, error) { + out := new(Group) + err := c.cc.Invoke(ctx, GroupService_GetGroup_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupServiceClient) CreateGroup(ctx context.Context, in *CreateGroupRequest, opts ...grpc.CallOption) (*Group, error) { + out := new(Group) + err := c.cc.Invoke(ctx, GroupService_CreateGroup_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupServiceClient) UpdateGroup(ctx context.Context, in *UpdateGroupRequest, opts ...grpc.CallOption) (*Group, error) { + out := new(Group) + err := c.cc.Invoke(ctx, GroupService_UpdateGroup_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupServiceClient) DeleteGroup(ctx context.Context, in *DeleteGroupRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, GroupService_DeleteGroup_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupServiceClient) ListGroupMembers(ctx context.Context, in *ListGroupMembersRequest, opts ...grpc.CallOption) (*ListGroupMembersResponse, error) { + out := new(ListGroupMembersResponse) + err := c.cc.Invoke(ctx, GroupService_ListGroupMembers_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// GroupServiceServer is the server API for GroupService service. +// All implementations should embed UnimplementedGroupServiceServer +// for forward compatibility +type GroupServiceServer interface { + // Lists the existing groups. + ListGroups(context.Context, *ListGroupsRequest) (*ListGroupsResponse, error) + // Gets a single group. + GetGroup(context.Context, *GetGroupRequest) (*Group, error) + // Creates a new group. + CreateGroup(context.Context, *CreateGroupRequest) (*Group, error) + // Updates an existing group. + // You can change any group attributes except `name`. + UpdateGroup(context.Context, *UpdateGroupRequest) (*Group, error) + // Deletes an existing group. + DeleteGroup(context.Context, *DeleteGroupRequest) (*emptypb.Empty, error) + // Lists the monitored resources that are members of a group. + ListGroupMembers(context.Context, *ListGroupMembersRequest) (*ListGroupMembersResponse, error) +} + +// UnimplementedGroupServiceServer should be embedded to have forward compatible implementations. +type UnimplementedGroupServiceServer struct { +} + +func (UnimplementedGroupServiceServer) ListGroups(context.Context, *ListGroupsRequest) (*ListGroupsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListGroups not implemented") +} +func (UnimplementedGroupServiceServer) GetGroup(context.Context, *GetGroupRequest) (*Group, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetGroup not implemented") +} +func (UnimplementedGroupServiceServer) CreateGroup(context.Context, *CreateGroupRequest) (*Group, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateGroup not implemented") +} +func (UnimplementedGroupServiceServer) UpdateGroup(context.Context, *UpdateGroupRequest) (*Group, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateGroup not implemented") +} +func (UnimplementedGroupServiceServer) DeleteGroup(context.Context, *DeleteGroupRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteGroup not implemented") +} +func (UnimplementedGroupServiceServer) ListGroupMembers(context.Context, *ListGroupMembersRequest) (*ListGroupMembersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListGroupMembers not implemented") +} + +// UnsafeGroupServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to GroupServiceServer will +// result in compilation errors. +type UnsafeGroupServiceServer interface { + mustEmbedUnimplementedGroupServiceServer() +} + +func RegisterGroupServiceServer(s grpc.ServiceRegistrar, srv GroupServiceServer) { + s.RegisterService(&GroupService_ServiceDesc, srv) +} + +func _GroupService_ListGroups_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListGroupsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServiceServer).ListGroups(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: GroupService_ListGroups_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServiceServer).ListGroups(ctx, req.(*ListGroupsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _GroupService_GetGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetGroupRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServiceServer).GetGroup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: GroupService_GetGroup_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServiceServer).GetGroup(ctx, req.(*GetGroupRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _GroupService_CreateGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateGroupRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServiceServer).CreateGroup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: GroupService_CreateGroup_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServiceServer).CreateGroup(ctx, req.(*CreateGroupRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _GroupService_UpdateGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateGroupRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServiceServer).UpdateGroup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: GroupService_UpdateGroup_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServiceServer).UpdateGroup(ctx, req.(*UpdateGroupRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _GroupService_DeleteGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteGroupRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServiceServer).DeleteGroup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: GroupService_DeleteGroup_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServiceServer).DeleteGroup(ctx, req.(*DeleteGroupRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _GroupService_ListGroupMembers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListGroupMembersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServiceServer).ListGroupMembers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: GroupService_ListGroupMembers_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServiceServer).ListGroupMembers(ctx, req.(*ListGroupMembersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// GroupService_ServiceDesc is the grpc.ServiceDesc for GroupService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var GroupService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "google.monitoring.v3.GroupService", + HandlerType: (*GroupServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListGroups", + Handler: _GroupService_ListGroups_Handler, + }, + { + MethodName: "GetGroup", + Handler: _GroupService_GetGroup_Handler, + }, + { + MethodName: "CreateGroup", + Handler: _GroupService_CreateGroup_Handler, + }, + { + MethodName: "UpdateGroup", + Handler: _GroupService_UpdateGroup_Handler, + }, + { + MethodName: "DeleteGroup", + Handler: _GroupService_DeleteGroup_Handler, + }, + { + MethodName: "ListGroupMembers", + Handler: _GroupService_ListGroupMembers_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/monitoring/v3/group_service.proto", +} diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric.pb.go index ae7eea5b6fa..7aefb0a5ec6 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric.pb.go @@ -15,20 +15,19 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/monitoring/v3/metric.proto package monitoringpb import ( - reflect "reflect" - sync "sync" - label "google.golang.org/genproto/googleapis/api/label" metric "google.golang.org/genproto/googleapis/api/metric" monitoredres "google.golang.org/genproto/googleapis/api/monitoredres" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric_service.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric_service.pb.go index 39b9595241b..d4067d85949 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric_service.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric_service.pb.go @@ -15,26 +15,21 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/monitoring/v3/metric_service.proto package monitoringpb import ( - context "context" - reflect "reflect" - sync "sync" - _ "google.golang.org/genproto/googleapis/api/annotations" metric "google.golang.org/genproto/googleapis/api/metric" monitoredres "google.golang.org/genproto/googleapis/api/monitoredres" status "google.golang.org/genproto/googleapis/rpc/status" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status1 "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" emptypb "google.golang.org/protobuf/types/known/emptypb" + reflect "reflect" + sync "sync" ) const ( @@ -1863,431 +1858,3 @@ func file_google_monitoring_v3_metric_service_proto_init() { file_google_monitoring_v3_metric_service_proto_goTypes = nil file_google_monitoring_v3_metric_service_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// MetricServiceClient is the client API for MetricService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MetricServiceClient interface { - // Lists monitored resource descriptors that match a filter. - ListMonitoredResourceDescriptors(ctx context.Context, in *ListMonitoredResourceDescriptorsRequest, opts ...grpc.CallOption) (*ListMonitoredResourceDescriptorsResponse, error) - // Gets a single monitored resource descriptor. - GetMonitoredResourceDescriptor(ctx context.Context, in *GetMonitoredResourceDescriptorRequest, opts ...grpc.CallOption) (*monitoredres.MonitoredResourceDescriptor, error) - // Lists metric descriptors that match a filter. - ListMetricDescriptors(ctx context.Context, in *ListMetricDescriptorsRequest, opts ...grpc.CallOption) (*ListMetricDescriptorsResponse, error) - // Gets a single metric descriptor. - GetMetricDescriptor(ctx context.Context, in *GetMetricDescriptorRequest, opts ...grpc.CallOption) (*metric.MetricDescriptor, error) - // Creates a new metric descriptor. - // The creation is executed asynchronously. - // User-created metric descriptors define - // [custom metrics](https://cloud.google.com/monitoring/custom-metrics). - // The metric descriptor is updated if it already exists, - // except that metric labels are never removed. - CreateMetricDescriptor(ctx context.Context, in *CreateMetricDescriptorRequest, opts ...grpc.CallOption) (*metric.MetricDescriptor, error) - // Deletes a metric descriptor. Only user-created - // [custom metrics](https://cloud.google.com/monitoring/custom-metrics) can be - // deleted. - DeleteMetricDescriptor(ctx context.Context, in *DeleteMetricDescriptorRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // Lists time series that match a filter. - ListTimeSeries(ctx context.Context, in *ListTimeSeriesRequest, opts ...grpc.CallOption) (*ListTimeSeriesResponse, error) - // Creates or adds data to one or more time series. - // The response is empty if all time series in the request were written. - // If any time series could not be written, a corresponding failure message is - // included in the error response. - // This method does not support - // [resource locations constraint of an organization - // policy](https://cloud.google.com/resource-manager/docs/organization-policy/defining-locations#setting_the_organization_policy). - CreateTimeSeries(ctx context.Context, in *CreateTimeSeriesRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // Creates or adds data to one or more service time series. A service time - // series is a time series for a metric from a Google Cloud service. The - // response is empty if all time series in the request were written. If any - // time series could not be written, a corresponding failure message is - // included in the error response. This endpoint rejects writes to - // user-defined metrics. - // This method is only for use by Google Cloud services. Use - // [projects.timeSeries.create][google.monitoring.v3.MetricService.CreateTimeSeries] - // instead. - CreateServiceTimeSeries(ctx context.Context, in *CreateTimeSeriesRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) -} - -type metricServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewMetricServiceClient(cc grpc.ClientConnInterface) MetricServiceClient { - return &metricServiceClient{cc} -} - -func (c *metricServiceClient) ListMonitoredResourceDescriptors(ctx context.Context, in *ListMonitoredResourceDescriptorsRequest, opts ...grpc.CallOption) (*ListMonitoredResourceDescriptorsResponse, error) { - out := new(ListMonitoredResourceDescriptorsResponse) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.MetricService/ListMonitoredResourceDescriptors", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *metricServiceClient) GetMonitoredResourceDescriptor(ctx context.Context, in *GetMonitoredResourceDescriptorRequest, opts ...grpc.CallOption) (*monitoredres.MonitoredResourceDescriptor, error) { - out := new(monitoredres.MonitoredResourceDescriptor) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.MetricService/GetMonitoredResourceDescriptor", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *metricServiceClient) ListMetricDescriptors(ctx context.Context, in *ListMetricDescriptorsRequest, opts ...grpc.CallOption) (*ListMetricDescriptorsResponse, error) { - out := new(ListMetricDescriptorsResponse) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.MetricService/ListMetricDescriptors", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *metricServiceClient) GetMetricDescriptor(ctx context.Context, in *GetMetricDescriptorRequest, opts ...grpc.CallOption) (*metric.MetricDescriptor, error) { - out := new(metric.MetricDescriptor) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.MetricService/GetMetricDescriptor", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *metricServiceClient) CreateMetricDescriptor(ctx context.Context, in *CreateMetricDescriptorRequest, opts ...grpc.CallOption) (*metric.MetricDescriptor, error) { - out := new(metric.MetricDescriptor) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.MetricService/CreateMetricDescriptor", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *metricServiceClient) DeleteMetricDescriptor(ctx context.Context, in *DeleteMetricDescriptorRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.MetricService/DeleteMetricDescriptor", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *metricServiceClient) ListTimeSeries(ctx context.Context, in *ListTimeSeriesRequest, opts ...grpc.CallOption) (*ListTimeSeriesResponse, error) { - out := new(ListTimeSeriesResponse) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.MetricService/ListTimeSeries", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *metricServiceClient) CreateTimeSeries(ctx context.Context, in *CreateTimeSeriesRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.MetricService/CreateTimeSeries", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *metricServiceClient) CreateServiceTimeSeries(ctx context.Context, in *CreateTimeSeriesRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.MetricService/CreateServiceTimeSeries", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MetricServiceServer is the server API for MetricService service. -type MetricServiceServer interface { - // Lists monitored resource descriptors that match a filter. - ListMonitoredResourceDescriptors(context.Context, *ListMonitoredResourceDescriptorsRequest) (*ListMonitoredResourceDescriptorsResponse, error) - // Gets a single monitored resource descriptor. - GetMonitoredResourceDescriptor(context.Context, *GetMonitoredResourceDescriptorRequest) (*monitoredres.MonitoredResourceDescriptor, error) - // Lists metric descriptors that match a filter. - ListMetricDescriptors(context.Context, *ListMetricDescriptorsRequest) (*ListMetricDescriptorsResponse, error) - // Gets a single metric descriptor. - GetMetricDescriptor(context.Context, *GetMetricDescriptorRequest) (*metric.MetricDescriptor, error) - // Creates a new metric descriptor. - // The creation is executed asynchronously. - // User-created metric descriptors define - // [custom metrics](https://cloud.google.com/monitoring/custom-metrics). - // The metric descriptor is updated if it already exists, - // except that metric labels are never removed. - CreateMetricDescriptor(context.Context, *CreateMetricDescriptorRequest) (*metric.MetricDescriptor, error) - // Deletes a metric descriptor. Only user-created - // [custom metrics](https://cloud.google.com/monitoring/custom-metrics) can be - // deleted. - DeleteMetricDescriptor(context.Context, *DeleteMetricDescriptorRequest) (*emptypb.Empty, error) - // Lists time series that match a filter. - ListTimeSeries(context.Context, *ListTimeSeriesRequest) (*ListTimeSeriesResponse, error) - // Creates or adds data to one or more time series. - // The response is empty if all time series in the request were written. - // If any time series could not be written, a corresponding failure message is - // included in the error response. - // This method does not support - // [resource locations constraint of an organization - // policy](https://cloud.google.com/resource-manager/docs/organization-policy/defining-locations#setting_the_organization_policy). - CreateTimeSeries(context.Context, *CreateTimeSeriesRequest) (*emptypb.Empty, error) - // Creates or adds data to one or more service time series. A service time - // series is a time series for a metric from a Google Cloud service. The - // response is empty if all time series in the request were written. If any - // time series could not be written, a corresponding failure message is - // included in the error response. This endpoint rejects writes to - // user-defined metrics. - // This method is only for use by Google Cloud services. Use - // [projects.timeSeries.create][google.monitoring.v3.MetricService.CreateTimeSeries] - // instead. - CreateServiceTimeSeries(context.Context, *CreateTimeSeriesRequest) (*emptypb.Empty, error) -} - -// UnimplementedMetricServiceServer can be embedded to have forward compatible implementations. -type UnimplementedMetricServiceServer struct { -} - -func (*UnimplementedMetricServiceServer) ListMonitoredResourceDescriptors(context.Context, *ListMonitoredResourceDescriptorsRequest) (*ListMonitoredResourceDescriptorsResponse, error) { - return nil, status1.Errorf(codes.Unimplemented, "method ListMonitoredResourceDescriptors not implemented") -} -func (*UnimplementedMetricServiceServer) GetMonitoredResourceDescriptor(context.Context, *GetMonitoredResourceDescriptorRequest) (*monitoredres.MonitoredResourceDescriptor, error) { - return nil, status1.Errorf(codes.Unimplemented, "method GetMonitoredResourceDescriptor not implemented") -} -func (*UnimplementedMetricServiceServer) ListMetricDescriptors(context.Context, *ListMetricDescriptorsRequest) (*ListMetricDescriptorsResponse, error) { - return nil, status1.Errorf(codes.Unimplemented, "method ListMetricDescriptors not implemented") -} -func (*UnimplementedMetricServiceServer) GetMetricDescriptor(context.Context, *GetMetricDescriptorRequest) (*metric.MetricDescriptor, error) { - return nil, status1.Errorf(codes.Unimplemented, "method GetMetricDescriptor not implemented") -} -func (*UnimplementedMetricServiceServer) CreateMetricDescriptor(context.Context, *CreateMetricDescriptorRequest) (*metric.MetricDescriptor, error) { - return nil, status1.Errorf(codes.Unimplemented, "method CreateMetricDescriptor not implemented") -} -func (*UnimplementedMetricServiceServer) DeleteMetricDescriptor(context.Context, *DeleteMetricDescriptorRequest) (*emptypb.Empty, error) { - return nil, status1.Errorf(codes.Unimplemented, "method DeleteMetricDescriptor not implemented") -} -func (*UnimplementedMetricServiceServer) ListTimeSeries(context.Context, *ListTimeSeriesRequest) (*ListTimeSeriesResponse, error) { - return nil, status1.Errorf(codes.Unimplemented, "method ListTimeSeries not implemented") -} -func (*UnimplementedMetricServiceServer) CreateTimeSeries(context.Context, *CreateTimeSeriesRequest) (*emptypb.Empty, error) { - return nil, status1.Errorf(codes.Unimplemented, "method CreateTimeSeries not implemented") -} -func (*UnimplementedMetricServiceServer) CreateServiceTimeSeries(context.Context, *CreateTimeSeriesRequest) (*emptypb.Empty, error) { - return nil, status1.Errorf(codes.Unimplemented, "method CreateServiceTimeSeries not implemented") -} - -func RegisterMetricServiceServer(s *grpc.Server, srv MetricServiceServer) { - s.RegisterService(&_MetricService_serviceDesc, srv) -} - -func _MetricService_ListMonitoredResourceDescriptors_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListMonitoredResourceDescriptorsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MetricServiceServer).ListMonitoredResourceDescriptors(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.MetricService/ListMonitoredResourceDescriptors", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MetricServiceServer).ListMonitoredResourceDescriptors(ctx, req.(*ListMonitoredResourceDescriptorsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _MetricService_GetMonitoredResourceDescriptor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetMonitoredResourceDescriptorRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MetricServiceServer).GetMonitoredResourceDescriptor(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.MetricService/GetMonitoredResourceDescriptor", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MetricServiceServer).GetMonitoredResourceDescriptor(ctx, req.(*GetMonitoredResourceDescriptorRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _MetricService_ListMetricDescriptors_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListMetricDescriptorsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MetricServiceServer).ListMetricDescriptors(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.MetricService/ListMetricDescriptors", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MetricServiceServer).ListMetricDescriptors(ctx, req.(*ListMetricDescriptorsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _MetricService_GetMetricDescriptor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetMetricDescriptorRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MetricServiceServer).GetMetricDescriptor(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.MetricService/GetMetricDescriptor", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MetricServiceServer).GetMetricDescriptor(ctx, req.(*GetMetricDescriptorRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _MetricService_CreateMetricDescriptor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateMetricDescriptorRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MetricServiceServer).CreateMetricDescriptor(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.MetricService/CreateMetricDescriptor", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MetricServiceServer).CreateMetricDescriptor(ctx, req.(*CreateMetricDescriptorRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _MetricService_DeleteMetricDescriptor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteMetricDescriptorRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MetricServiceServer).DeleteMetricDescriptor(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.MetricService/DeleteMetricDescriptor", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MetricServiceServer).DeleteMetricDescriptor(ctx, req.(*DeleteMetricDescriptorRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _MetricService_ListTimeSeries_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListTimeSeriesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MetricServiceServer).ListTimeSeries(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.MetricService/ListTimeSeries", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MetricServiceServer).ListTimeSeries(ctx, req.(*ListTimeSeriesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _MetricService_CreateTimeSeries_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateTimeSeriesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MetricServiceServer).CreateTimeSeries(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.MetricService/CreateTimeSeries", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MetricServiceServer).CreateTimeSeries(ctx, req.(*CreateTimeSeriesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _MetricService_CreateServiceTimeSeries_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateTimeSeriesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MetricServiceServer).CreateServiceTimeSeries(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.MetricService/CreateServiceTimeSeries", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MetricServiceServer).CreateServiceTimeSeries(ctx, req.(*CreateTimeSeriesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _MetricService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "google.monitoring.v3.MetricService", - HandlerType: (*MetricServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListMonitoredResourceDescriptors", - Handler: _MetricService_ListMonitoredResourceDescriptors_Handler, - }, - { - MethodName: "GetMonitoredResourceDescriptor", - Handler: _MetricService_GetMonitoredResourceDescriptor_Handler, - }, - { - MethodName: "ListMetricDescriptors", - Handler: _MetricService_ListMetricDescriptors_Handler, - }, - { - MethodName: "GetMetricDescriptor", - Handler: _MetricService_GetMetricDescriptor_Handler, - }, - { - MethodName: "CreateMetricDescriptor", - Handler: _MetricService_CreateMetricDescriptor_Handler, - }, - { - MethodName: "DeleteMetricDescriptor", - Handler: _MetricService_DeleteMetricDescriptor_Handler, - }, - { - MethodName: "ListTimeSeries", - Handler: _MetricService_ListTimeSeries_Handler, - }, - { - MethodName: "CreateTimeSeries", - Handler: _MetricService_CreateTimeSeries_Handler, - }, - { - MethodName: "CreateServiceTimeSeries", - Handler: _MetricService_CreateServiceTimeSeries_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "google/monitoring/v3/metric_service.proto", -} diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric_service_grpc.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric_service_grpc.pb.go new file mode 100644 index 00000000000..b4a5478cf61 --- /dev/null +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/metric_service_grpc.pb.go @@ -0,0 +1,480 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.7 +// source: google/monitoring/v3/metric_service.proto + +package monitoringpb + +import ( + context "context" + metric "google.golang.org/genproto/googleapis/api/metric" + monitoredres "google.golang.org/genproto/googleapis/api/monitoredres" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + MetricService_ListMonitoredResourceDescriptors_FullMethodName = "/google.monitoring.v3.MetricService/ListMonitoredResourceDescriptors" + MetricService_GetMonitoredResourceDescriptor_FullMethodName = "/google.monitoring.v3.MetricService/GetMonitoredResourceDescriptor" + MetricService_ListMetricDescriptors_FullMethodName = "/google.monitoring.v3.MetricService/ListMetricDescriptors" + MetricService_GetMetricDescriptor_FullMethodName = "/google.monitoring.v3.MetricService/GetMetricDescriptor" + MetricService_CreateMetricDescriptor_FullMethodName = "/google.monitoring.v3.MetricService/CreateMetricDescriptor" + MetricService_DeleteMetricDescriptor_FullMethodName = "/google.monitoring.v3.MetricService/DeleteMetricDescriptor" + MetricService_ListTimeSeries_FullMethodName = "/google.monitoring.v3.MetricService/ListTimeSeries" + MetricService_CreateTimeSeries_FullMethodName = "/google.monitoring.v3.MetricService/CreateTimeSeries" + MetricService_CreateServiceTimeSeries_FullMethodName = "/google.monitoring.v3.MetricService/CreateServiceTimeSeries" +) + +// MetricServiceClient is the client API for MetricService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type MetricServiceClient interface { + // Lists monitored resource descriptors that match a filter. + ListMonitoredResourceDescriptors(ctx context.Context, in *ListMonitoredResourceDescriptorsRequest, opts ...grpc.CallOption) (*ListMonitoredResourceDescriptorsResponse, error) + // Gets a single monitored resource descriptor. + GetMonitoredResourceDescriptor(ctx context.Context, in *GetMonitoredResourceDescriptorRequest, opts ...grpc.CallOption) (*monitoredres.MonitoredResourceDescriptor, error) + // Lists metric descriptors that match a filter. + ListMetricDescriptors(ctx context.Context, in *ListMetricDescriptorsRequest, opts ...grpc.CallOption) (*ListMetricDescriptorsResponse, error) + // Gets a single metric descriptor. + GetMetricDescriptor(ctx context.Context, in *GetMetricDescriptorRequest, opts ...grpc.CallOption) (*metric.MetricDescriptor, error) + // Creates a new metric descriptor. + // The creation is executed asynchronously. + // User-created metric descriptors define + // [custom metrics](https://cloud.google.com/monitoring/custom-metrics). + // The metric descriptor is updated if it already exists, + // except that metric labels are never removed. + CreateMetricDescriptor(ctx context.Context, in *CreateMetricDescriptorRequest, opts ...grpc.CallOption) (*metric.MetricDescriptor, error) + // Deletes a metric descriptor. Only user-created + // [custom metrics](https://cloud.google.com/monitoring/custom-metrics) can be + // deleted. + DeleteMetricDescriptor(ctx context.Context, in *DeleteMetricDescriptorRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Lists time series that match a filter. + ListTimeSeries(ctx context.Context, in *ListTimeSeriesRequest, opts ...grpc.CallOption) (*ListTimeSeriesResponse, error) + // Creates or adds data to one or more time series. + // The response is empty if all time series in the request were written. + // If any time series could not be written, a corresponding failure message is + // included in the error response. + // This method does not support + // [resource locations constraint of an organization + // policy](https://cloud.google.com/resource-manager/docs/organization-policy/defining-locations#setting_the_organization_policy). + CreateTimeSeries(ctx context.Context, in *CreateTimeSeriesRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Creates or adds data to one or more service time series. A service time + // series is a time series for a metric from a Google Cloud service. The + // response is empty if all time series in the request were written. If any + // time series could not be written, a corresponding failure message is + // included in the error response. This endpoint rejects writes to + // user-defined metrics. + // This method is only for use by Google Cloud services. Use + // [projects.timeSeries.create][google.monitoring.v3.MetricService.CreateTimeSeries] + // instead. + CreateServiceTimeSeries(ctx context.Context, in *CreateTimeSeriesRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type metricServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewMetricServiceClient(cc grpc.ClientConnInterface) MetricServiceClient { + return &metricServiceClient{cc} +} + +func (c *metricServiceClient) ListMonitoredResourceDescriptors(ctx context.Context, in *ListMonitoredResourceDescriptorsRequest, opts ...grpc.CallOption) (*ListMonitoredResourceDescriptorsResponse, error) { + out := new(ListMonitoredResourceDescriptorsResponse) + err := c.cc.Invoke(ctx, MetricService_ListMonitoredResourceDescriptors_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *metricServiceClient) GetMonitoredResourceDescriptor(ctx context.Context, in *GetMonitoredResourceDescriptorRequest, opts ...grpc.CallOption) (*monitoredres.MonitoredResourceDescriptor, error) { + out := new(monitoredres.MonitoredResourceDescriptor) + err := c.cc.Invoke(ctx, MetricService_GetMonitoredResourceDescriptor_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *metricServiceClient) ListMetricDescriptors(ctx context.Context, in *ListMetricDescriptorsRequest, opts ...grpc.CallOption) (*ListMetricDescriptorsResponse, error) { + out := new(ListMetricDescriptorsResponse) + err := c.cc.Invoke(ctx, MetricService_ListMetricDescriptors_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *metricServiceClient) GetMetricDescriptor(ctx context.Context, in *GetMetricDescriptorRequest, opts ...grpc.CallOption) (*metric.MetricDescriptor, error) { + out := new(metric.MetricDescriptor) + err := c.cc.Invoke(ctx, MetricService_GetMetricDescriptor_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *metricServiceClient) CreateMetricDescriptor(ctx context.Context, in *CreateMetricDescriptorRequest, opts ...grpc.CallOption) (*metric.MetricDescriptor, error) { + out := new(metric.MetricDescriptor) + err := c.cc.Invoke(ctx, MetricService_CreateMetricDescriptor_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *metricServiceClient) DeleteMetricDescriptor(ctx context.Context, in *DeleteMetricDescriptorRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, MetricService_DeleteMetricDescriptor_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *metricServiceClient) ListTimeSeries(ctx context.Context, in *ListTimeSeriesRequest, opts ...grpc.CallOption) (*ListTimeSeriesResponse, error) { + out := new(ListTimeSeriesResponse) + err := c.cc.Invoke(ctx, MetricService_ListTimeSeries_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *metricServiceClient) CreateTimeSeries(ctx context.Context, in *CreateTimeSeriesRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, MetricService_CreateTimeSeries_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *metricServiceClient) CreateServiceTimeSeries(ctx context.Context, in *CreateTimeSeriesRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, MetricService_CreateServiceTimeSeries_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MetricServiceServer is the server API for MetricService service. +// All implementations should embed UnimplementedMetricServiceServer +// for forward compatibility +type MetricServiceServer interface { + // Lists monitored resource descriptors that match a filter. + ListMonitoredResourceDescriptors(context.Context, *ListMonitoredResourceDescriptorsRequest) (*ListMonitoredResourceDescriptorsResponse, error) + // Gets a single monitored resource descriptor. + GetMonitoredResourceDescriptor(context.Context, *GetMonitoredResourceDescriptorRequest) (*monitoredres.MonitoredResourceDescriptor, error) + // Lists metric descriptors that match a filter. + ListMetricDescriptors(context.Context, *ListMetricDescriptorsRequest) (*ListMetricDescriptorsResponse, error) + // Gets a single metric descriptor. + GetMetricDescriptor(context.Context, *GetMetricDescriptorRequest) (*metric.MetricDescriptor, error) + // Creates a new metric descriptor. + // The creation is executed asynchronously. + // User-created metric descriptors define + // [custom metrics](https://cloud.google.com/monitoring/custom-metrics). + // The metric descriptor is updated if it already exists, + // except that metric labels are never removed. + CreateMetricDescriptor(context.Context, *CreateMetricDescriptorRequest) (*metric.MetricDescriptor, error) + // Deletes a metric descriptor. Only user-created + // [custom metrics](https://cloud.google.com/monitoring/custom-metrics) can be + // deleted. + DeleteMetricDescriptor(context.Context, *DeleteMetricDescriptorRequest) (*emptypb.Empty, error) + // Lists time series that match a filter. + ListTimeSeries(context.Context, *ListTimeSeriesRequest) (*ListTimeSeriesResponse, error) + // Creates or adds data to one or more time series. + // The response is empty if all time series in the request were written. + // If any time series could not be written, a corresponding failure message is + // included in the error response. + // This method does not support + // [resource locations constraint of an organization + // policy](https://cloud.google.com/resource-manager/docs/organization-policy/defining-locations#setting_the_organization_policy). + CreateTimeSeries(context.Context, *CreateTimeSeriesRequest) (*emptypb.Empty, error) + // Creates or adds data to one or more service time series. A service time + // series is a time series for a metric from a Google Cloud service. The + // response is empty if all time series in the request were written. If any + // time series could not be written, a corresponding failure message is + // included in the error response. This endpoint rejects writes to + // user-defined metrics. + // This method is only for use by Google Cloud services. Use + // [projects.timeSeries.create][google.monitoring.v3.MetricService.CreateTimeSeries] + // instead. + CreateServiceTimeSeries(context.Context, *CreateTimeSeriesRequest) (*emptypb.Empty, error) +} + +// UnimplementedMetricServiceServer should be embedded to have forward compatible implementations. +type UnimplementedMetricServiceServer struct { +} + +func (UnimplementedMetricServiceServer) ListMonitoredResourceDescriptors(context.Context, *ListMonitoredResourceDescriptorsRequest) (*ListMonitoredResourceDescriptorsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListMonitoredResourceDescriptors not implemented") +} +func (UnimplementedMetricServiceServer) GetMonitoredResourceDescriptor(context.Context, *GetMonitoredResourceDescriptorRequest) (*monitoredres.MonitoredResourceDescriptor, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMonitoredResourceDescriptor not implemented") +} +func (UnimplementedMetricServiceServer) ListMetricDescriptors(context.Context, *ListMetricDescriptorsRequest) (*ListMetricDescriptorsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListMetricDescriptors not implemented") +} +func (UnimplementedMetricServiceServer) GetMetricDescriptor(context.Context, *GetMetricDescriptorRequest) (*metric.MetricDescriptor, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMetricDescriptor not implemented") +} +func (UnimplementedMetricServiceServer) CreateMetricDescriptor(context.Context, *CreateMetricDescriptorRequest) (*metric.MetricDescriptor, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateMetricDescriptor not implemented") +} +func (UnimplementedMetricServiceServer) DeleteMetricDescriptor(context.Context, *DeleteMetricDescriptorRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteMetricDescriptor not implemented") +} +func (UnimplementedMetricServiceServer) ListTimeSeries(context.Context, *ListTimeSeriesRequest) (*ListTimeSeriesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListTimeSeries not implemented") +} +func (UnimplementedMetricServiceServer) CreateTimeSeries(context.Context, *CreateTimeSeriesRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateTimeSeries not implemented") +} +func (UnimplementedMetricServiceServer) CreateServiceTimeSeries(context.Context, *CreateTimeSeriesRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateServiceTimeSeries not implemented") +} + +// UnsafeMetricServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MetricServiceServer will +// result in compilation errors. +type UnsafeMetricServiceServer interface { + mustEmbedUnimplementedMetricServiceServer() +} + +func RegisterMetricServiceServer(s grpc.ServiceRegistrar, srv MetricServiceServer) { + s.RegisterService(&MetricService_ServiceDesc, srv) +} + +func _MetricService_ListMonitoredResourceDescriptors_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListMonitoredResourceDescriptorsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricServiceServer).ListMonitoredResourceDescriptors(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MetricService_ListMonitoredResourceDescriptors_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricServiceServer).ListMonitoredResourceDescriptors(ctx, req.(*ListMonitoredResourceDescriptorsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MetricService_GetMonitoredResourceDescriptor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetMonitoredResourceDescriptorRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricServiceServer).GetMonitoredResourceDescriptor(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MetricService_GetMonitoredResourceDescriptor_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricServiceServer).GetMonitoredResourceDescriptor(ctx, req.(*GetMonitoredResourceDescriptorRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MetricService_ListMetricDescriptors_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListMetricDescriptorsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricServiceServer).ListMetricDescriptors(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MetricService_ListMetricDescriptors_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricServiceServer).ListMetricDescriptors(ctx, req.(*ListMetricDescriptorsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MetricService_GetMetricDescriptor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetMetricDescriptorRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricServiceServer).GetMetricDescriptor(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MetricService_GetMetricDescriptor_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricServiceServer).GetMetricDescriptor(ctx, req.(*GetMetricDescriptorRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MetricService_CreateMetricDescriptor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateMetricDescriptorRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricServiceServer).CreateMetricDescriptor(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MetricService_CreateMetricDescriptor_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricServiceServer).CreateMetricDescriptor(ctx, req.(*CreateMetricDescriptorRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MetricService_DeleteMetricDescriptor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteMetricDescriptorRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricServiceServer).DeleteMetricDescriptor(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MetricService_DeleteMetricDescriptor_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricServiceServer).DeleteMetricDescriptor(ctx, req.(*DeleteMetricDescriptorRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MetricService_ListTimeSeries_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListTimeSeriesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricServiceServer).ListTimeSeries(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MetricService_ListTimeSeries_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricServiceServer).ListTimeSeries(ctx, req.(*ListTimeSeriesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MetricService_CreateTimeSeries_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateTimeSeriesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricServiceServer).CreateTimeSeries(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MetricService_CreateTimeSeries_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricServiceServer).CreateTimeSeries(ctx, req.(*CreateTimeSeriesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MetricService_CreateServiceTimeSeries_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateTimeSeriesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricServiceServer).CreateServiceTimeSeries(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MetricService_CreateServiceTimeSeries_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricServiceServer).CreateServiceTimeSeries(ctx, req.(*CreateTimeSeriesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// MetricService_ServiceDesc is the grpc.ServiceDesc for MetricService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var MetricService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "google.monitoring.v3.MetricService", + HandlerType: (*MetricServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListMonitoredResourceDescriptors", + Handler: _MetricService_ListMonitoredResourceDescriptors_Handler, + }, + { + MethodName: "GetMonitoredResourceDescriptor", + Handler: _MetricService_GetMonitoredResourceDescriptor_Handler, + }, + { + MethodName: "ListMetricDescriptors", + Handler: _MetricService_ListMetricDescriptors_Handler, + }, + { + MethodName: "GetMetricDescriptor", + Handler: _MetricService_GetMetricDescriptor_Handler, + }, + { + MethodName: "CreateMetricDescriptor", + Handler: _MetricService_CreateMetricDescriptor_Handler, + }, + { + MethodName: "DeleteMetricDescriptor", + Handler: _MetricService_DeleteMetricDescriptor_Handler, + }, + { + MethodName: "ListTimeSeries", + Handler: _MetricService_ListTimeSeries_Handler, + }, + { + MethodName: "CreateTimeSeries", + Handler: _MetricService_CreateTimeSeries_Handler, + }, + { + MethodName: "CreateServiceTimeSeries", + Handler: _MetricService_CreateServiceTimeSeries_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/monitoring/v3/metric_service.proto", +} diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/mutation_record.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/mutation_record.pb.go index e03d89efe4d..820101962eb 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/mutation_record.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/mutation_record.pb.go @@ -15,18 +15,17 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/monitoring/v3/mutation_record.proto package monitoringpb import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" ) const ( diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification.pb.go index 0d5cacbecb0..b2f0806e893 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification.pb.go @@ -15,21 +15,20 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/monitoring/v3/notification.proto package monitoringpb import ( - reflect "reflect" - sync "sync" - api "google.golang.org/genproto/googleapis/api" _ "google.golang.org/genproto/googleapis/api/annotations" label "google.golang.org/genproto/googleapis/api/label" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" + reflect "reflect" + sync "sync" ) const ( diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification_service.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification_service.pb.go index fd0230036da..1270600b38f 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification_service.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification_service.pb.go @@ -15,25 +15,20 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/monitoring/v3/notification_service.proto package monitoringpb import ( - context "context" - reflect "reflect" - sync "sync" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" emptypb "google.golang.org/protobuf/types/known/emptypb" fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" ) const ( @@ -1297,523 +1292,3 @@ func file_google_monitoring_v3_notification_service_proto_init() { file_google_monitoring_v3_notification_service_proto_goTypes = nil file_google_monitoring_v3_notification_service_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// NotificationChannelServiceClient is the client API for NotificationChannelService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type NotificationChannelServiceClient interface { - // Lists the descriptors for supported channel types. The use of descriptors - // makes it possible for new channel types to be dynamically added. - ListNotificationChannelDescriptors(ctx context.Context, in *ListNotificationChannelDescriptorsRequest, opts ...grpc.CallOption) (*ListNotificationChannelDescriptorsResponse, error) - // Gets a single channel descriptor. The descriptor indicates which fields - // are expected / permitted for a notification channel of the given type. - GetNotificationChannelDescriptor(ctx context.Context, in *GetNotificationChannelDescriptorRequest, opts ...grpc.CallOption) (*NotificationChannelDescriptor, error) - // Lists the notification channels that have been created for the project. - // To list the types of notification channels that are supported, use - // the `ListNotificationChannelDescriptors` method. - ListNotificationChannels(ctx context.Context, in *ListNotificationChannelsRequest, opts ...grpc.CallOption) (*ListNotificationChannelsResponse, error) - // Gets a single notification channel. The channel includes the relevant - // configuration details with which the channel was created. However, the - // response may truncate or omit passwords, API keys, or other private key - // matter and thus the response may not be 100% identical to the information - // that was supplied in the call to the create method. - GetNotificationChannel(ctx context.Context, in *GetNotificationChannelRequest, opts ...grpc.CallOption) (*NotificationChannel, error) - // Creates a new notification channel, representing a single notification - // endpoint such as an email address, SMS number, or PagerDuty service. - // - // Design your application to single-thread API calls that modify the state of - // notification channels in a single project. This includes calls to - // CreateNotificationChannel, DeleteNotificationChannel and - // UpdateNotificationChannel. - CreateNotificationChannel(ctx context.Context, in *CreateNotificationChannelRequest, opts ...grpc.CallOption) (*NotificationChannel, error) - // Updates a notification channel. Fields not specified in the field mask - // remain unchanged. - // - // Design your application to single-thread API calls that modify the state of - // notification channels in a single project. This includes calls to - // CreateNotificationChannel, DeleteNotificationChannel and - // UpdateNotificationChannel. - UpdateNotificationChannel(ctx context.Context, in *UpdateNotificationChannelRequest, opts ...grpc.CallOption) (*NotificationChannel, error) - // Deletes a notification channel. - // - // Design your application to single-thread API calls that modify the state of - // notification channels in a single project. This includes calls to - // CreateNotificationChannel, DeleteNotificationChannel and - // UpdateNotificationChannel. - DeleteNotificationChannel(ctx context.Context, in *DeleteNotificationChannelRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // Causes a verification code to be delivered to the channel. The code - // can then be supplied in `VerifyNotificationChannel` to verify the channel. - SendNotificationChannelVerificationCode(ctx context.Context, in *SendNotificationChannelVerificationCodeRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // Requests a verification code for an already verified channel that can then - // be used in a call to VerifyNotificationChannel() on a different channel - // with an equivalent identity in the same or in a different project. This - // makes it possible to copy a channel between projects without requiring - // manual reverification of the channel. If the channel is not in the - // verified state, this method will fail (in other words, this may only be - // used if the SendNotificationChannelVerificationCode and - // VerifyNotificationChannel paths have already been used to put the given - // channel into the verified state). - // - // There is no guarantee that the verification codes returned by this method - // will be of a similar structure or form as the ones that are delivered - // to the channel via SendNotificationChannelVerificationCode; while - // VerifyNotificationChannel() will recognize both the codes delivered via - // SendNotificationChannelVerificationCode() and returned from - // GetNotificationChannelVerificationCode(), it is typically the case that - // the verification codes delivered via - // SendNotificationChannelVerificationCode() will be shorter and also - // have a shorter expiration (e.g. codes such as "G-123456") whereas - // GetVerificationCode() will typically return a much longer, websafe base - // 64 encoded string that has a longer expiration time. - GetNotificationChannelVerificationCode(ctx context.Context, in *GetNotificationChannelVerificationCodeRequest, opts ...grpc.CallOption) (*GetNotificationChannelVerificationCodeResponse, error) - // Verifies a `NotificationChannel` by proving receipt of the code - // delivered to the channel as a result of calling - // `SendNotificationChannelVerificationCode`. - VerifyNotificationChannel(ctx context.Context, in *VerifyNotificationChannelRequest, opts ...grpc.CallOption) (*NotificationChannel, error) -} - -type notificationChannelServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewNotificationChannelServiceClient(cc grpc.ClientConnInterface) NotificationChannelServiceClient { - return ¬ificationChannelServiceClient{cc} -} - -func (c *notificationChannelServiceClient) ListNotificationChannelDescriptors(ctx context.Context, in *ListNotificationChannelDescriptorsRequest, opts ...grpc.CallOption) (*ListNotificationChannelDescriptorsResponse, error) { - out := new(ListNotificationChannelDescriptorsResponse) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.NotificationChannelService/ListNotificationChannelDescriptors", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *notificationChannelServiceClient) GetNotificationChannelDescriptor(ctx context.Context, in *GetNotificationChannelDescriptorRequest, opts ...grpc.CallOption) (*NotificationChannelDescriptor, error) { - out := new(NotificationChannelDescriptor) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.NotificationChannelService/GetNotificationChannelDescriptor", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *notificationChannelServiceClient) ListNotificationChannels(ctx context.Context, in *ListNotificationChannelsRequest, opts ...grpc.CallOption) (*ListNotificationChannelsResponse, error) { - out := new(ListNotificationChannelsResponse) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.NotificationChannelService/ListNotificationChannels", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *notificationChannelServiceClient) GetNotificationChannel(ctx context.Context, in *GetNotificationChannelRequest, opts ...grpc.CallOption) (*NotificationChannel, error) { - out := new(NotificationChannel) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.NotificationChannelService/GetNotificationChannel", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *notificationChannelServiceClient) CreateNotificationChannel(ctx context.Context, in *CreateNotificationChannelRequest, opts ...grpc.CallOption) (*NotificationChannel, error) { - out := new(NotificationChannel) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.NotificationChannelService/CreateNotificationChannel", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *notificationChannelServiceClient) UpdateNotificationChannel(ctx context.Context, in *UpdateNotificationChannelRequest, opts ...grpc.CallOption) (*NotificationChannel, error) { - out := new(NotificationChannel) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.NotificationChannelService/UpdateNotificationChannel", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *notificationChannelServiceClient) DeleteNotificationChannel(ctx context.Context, in *DeleteNotificationChannelRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.NotificationChannelService/DeleteNotificationChannel", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *notificationChannelServiceClient) SendNotificationChannelVerificationCode(ctx context.Context, in *SendNotificationChannelVerificationCodeRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.NotificationChannelService/SendNotificationChannelVerificationCode", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *notificationChannelServiceClient) GetNotificationChannelVerificationCode(ctx context.Context, in *GetNotificationChannelVerificationCodeRequest, opts ...grpc.CallOption) (*GetNotificationChannelVerificationCodeResponse, error) { - out := new(GetNotificationChannelVerificationCodeResponse) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.NotificationChannelService/GetNotificationChannelVerificationCode", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *notificationChannelServiceClient) VerifyNotificationChannel(ctx context.Context, in *VerifyNotificationChannelRequest, opts ...grpc.CallOption) (*NotificationChannel, error) { - out := new(NotificationChannel) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.NotificationChannelService/VerifyNotificationChannel", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// NotificationChannelServiceServer is the server API for NotificationChannelService service. -type NotificationChannelServiceServer interface { - // Lists the descriptors for supported channel types. The use of descriptors - // makes it possible for new channel types to be dynamically added. - ListNotificationChannelDescriptors(context.Context, *ListNotificationChannelDescriptorsRequest) (*ListNotificationChannelDescriptorsResponse, error) - // Gets a single channel descriptor. The descriptor indicates which fields - // are expected / permitted for a notification channel of the given type. - GetNotificationChannelDescriptor(context.Context, *GetNotificationChannelDescriptorRequest) (*NotificationChannelDescriptor, error) - // Lists the notification channels that have been created for the project. - // To list the types of notification channels that are supported, use - // the `ListNotificationChannelDescriptors` method. - ListNotificationChannels(context.Context, *ListNotificationChannelsRequest) (*ListNotificationChannelsResponse, error) - // Gets a single notification channel. The channel includes the relevant - // configuration details with which the channel was created. However, the - // response may truncate or omit passwords, API keys, or other private key - // matter and thus the response may not be 100% identical to the information - // that was supplied in the call to the create method. - GetNotificationChannel(context.Context, *GetNotificationChannelRequest) (*NotificationChannel, error) - // Creates a new notification channel, representing a single notification - // endpoint such as an email address, SMS number, or PagerDuty service. - // - // Design your application to single-thread API calls that modify the state of - // notification channels in a single project. This includes calls to - // CreateNotificationChannel, DeleteNotificationChannel and - // UpdateNotificationChannel. - CreateNotificationChannel(context.Context, *CreateNotificationChannelRequest) (*NotificationChannel, error) - // Updates a notification channel. Fields not specified in the field mask - // remain unchanged. - // - // Design your application to single-thread API calls that modify the state of - // notification channels in a single project. This includes calls to - // CreateNotificationChannel, DeleteNotificationChannel and - // UpdateNotificationChannel. - UpdateNotificationChannel(context.Context, *UpdateNotificationChannelRequest) (*NotificationChannel, error) - // Deletes a notification channel. - // - // Design your application to single-thread API calls that modify the state of - // notification channels in a single project. This includes calls to - // CreateNotificationChannel, DeleteNotificationChannel and - // UpdateNotificationChannel. - DeleteNotificationChannel(context.Context, *DeleteNotificationChannelRequest) (*emptypb.Empty, error) - // Causes a verification code to be delivered to the channel. The code - // can then be supplied in `VerifyNotificationChannel` to verify the channel. - SendNotificationChannelVerificationCode(context.Context, *SendNotificationChannelVerificationCodeRequest) (*emptypb.Empty, error) - // Requests a verification code for an already verified channel that can then - // be used in a call to VerifyNotificationChannel() on a different channel - // with an equivalent identity in the same or in a different project. This - // makes it possible to copy a channel between projects without requiring - // manual reverification of the channel. If the channel is not in the - // verified state, this method will fail (in other words, this may only be - // used if the SendNotificationChannelVerificationCode and - // VerifyNotificationChannel paths have already been used to put the given - // channel into the verified state). - // - // There is no guarantee that the verification codes returned by this method - // will be of a similar structure or form as the ones that are delivered - // to the channel via SendNotificationChannelVerificationCode; while - // VerifyNotificationChannel() will recognize both the codes delivered via - // SendNotificationChannelVerificationCode() and returned from - // GetNotificationChannelVerificationCode(), it is typically the case that - // the verification codes delivered via - // SendNotificationChannelVerificationCode() will be shorter and also - // have a shorter expiration (e.g. codes such as "G-123456") whereas - // GetVerificationCode() will typically return a much longer, websafe base - // 64 encoded string that has a longer expiration time. - GetNotificationChannelVerificationCode(context.Context, *GetNotificationChannelVerificationCodeRequest) (*GetNotificationChannelVerificationCodeResponse, error) - // Verifies a `NotificationChannel` by proving receipt of the code - // delivered to the channel as a result of calling - // `SendNotificationChannelVerificationCode`. - VerifyNotificationChannel(context.Context, *VerifyNotificationChannelRequest) (*NotificationChannel, error) -} - -// UnimplementedNotificationChannelServiceServer can be embedded to have forward compatible implementations. -type UnimplementedNotificationChannelServiceServer struct { -} - -func (*UnimplementedNotificationChannelServiceServer) ListNotificationChannelDescriptors(context.Context, *ListNotificationChannelDescriptorsRequest) (*ListNotificationChannelDescriptorsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListNotificationChannelDescriptors not implemented") -} -func (*UnimplementedNotificationChannelServiceServer) GetNotificationChannelDescriptor(context.Context, *GetNotificationChannelDescriptorRequest) (*NotificationChannelDescriptor, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetNotificationChannelDescriptor not implemented") -} -func (*UnimplementedNotificationChannelServiceServer) ListNotificationChannels(context.Context, *ListNotificationChannelsRequest) (*ListNotificationChannelsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListNotificationChannels not implemented") -} -func (*UnimplementedNotificationChannelServiceServer) GetNotificationChannel(context.Context, *GetNotificationChannelRequest) (*NotificationChannel, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetNotificationChannel not implemented") -} -func (*UnimplementedNotificationChannelServiceServer) CreateNotificationChannel(context.Context, *CreateNotificationChannelRequest) (*NotificationChannel, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateNotificationChannel not implemented") -} -func (*UnimplementedNotificationChannelServiceServer) UpdateNotificationChannel(context.Context, *UpdateNotificationChannelRequest) (*NotificationChannel, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateNotificationChannel not implemented") -} -func (*UnimplementedNotificationChannelServiceServer) DeleteNotificationChannel(context.Context, *DeleteNotificationChannelRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteNotificationChannel not implemented") -} -func (*UnimplementedNotificationChannelServiceServer) SendNotificationChannelVerificationCode(context.Context, *SendNotificationChannelVerificationCodeRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method SendNotificationChannelVerificationCode not implemented") -} -func (*UnimplementedNotificationChannelServiceServer) GetNotificationChannelVerificationCode(context.Context, *GetNotificationChannelVerificationCodeRequest) (*GetNotificationChannelVerificationCodeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetNotificationChannelVerificationCode not implemented") -} -func (*UnimplementedNotificationChannelServiceServer) VerifyNotificationChannel(context.Context, *VerifyNotificationChannelRequest) (*NotificationChannel, error) { - return nil, status.Errorf(codes.Unimplemented, "method VerifyNotificationChannel not implemented") -} - -func RegisterNotificationChannelServiceServer(s *grpc.Server, srv NotificationChannelServiceServer) { - s.RegisterService(&_NotificationChannelService_serviceDesc, srv) -} - -func _NotificationChannelService_ListNotificationChannelDescriptors_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListNotificationChannelDescriptorsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NotificationChannelServiceServer).ListNotificationChannelDescriptors(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.NotificationChannelService/ListNotificationChannelDescriptors", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NotificationChannelServiceServer).ListNotificationChannelDescriptors(ctx, req.(*ListNotificationChannelDescriptorsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NotificationChannelService_GetNotificationChannelDescriptor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetNotificationChannelDescriptorRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NotificationChannelServiceServer).GetNotificationChannelDescriptor(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.NotificationChannelService/GetNotificationChannelDescriptor", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NotificationChannelServiceServer).GetNotificationChannelDescriptor(ctx, req.(*GetNotificationChannelDescriptorRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NotificationChannelService_ListNotificationChannels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListNotificationChannelsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NotificationChannelServiceServer).ListNotificationChannels(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.NotificationChannelService/ListNotificationChannels", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NotificationChannelServiceServer).ListNotificationChannels(ctx, req.(*ListNotificationChannelsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NotificationChannelService_GetNotificationChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetNotificationChannelRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NotificationChannelServiceServer).GetNotificationChannel(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.NotificationChannelService/GetNotificationChannel", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NotificationChannelServiceServer).GetNotificationChannel(ctx, req.(*GetNotificationChannelRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NotificationChannelService_CreateNotificationChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateNotificationChannelRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NotificationChannelServiceServer).CreateNotificationChannel(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.NotificationChannelService/CreateNotificationChannel", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NotificationChannelServiceServer).CreateNotificationChannel(ctx, req.(*CreateNotificationChannelRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NotificationChannelService_UpdateNotificationChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateNotificationChannelRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NotificationChannelServiceServer).UpdateNotificationChannel(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.NotificationChannelService/UpdateNotificationChannel", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NotificationChannelServiceServer).UpdateNotificationChannel(ctx, req.(*UpdateNotificationChannelRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NotificationChannelService_DeleteNotificationChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteNotificationChannelRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NotificationChannelServiceServer).DeleteNotificationChannel(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.NotificationChannelService/DeleteNotificationChannel", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NotificationChannelServiceServer).DeleteNotificationChannel(ctx, req.(*DeleteNotificationChannelRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NotificationChannelService_SendNotificationChannelVerificationCode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SendNotificationChannelVerificationCodeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NotificationChannelServiceServer).SendNotificationChannelVerificationCode(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.NotificationChannelService/SendNotificationChannelVerificationCode", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NotificationChannelServiceServer).SendNotificationChannelVerificationCode(ctx, req.(*SendNotificationChannelVerificationCodeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NotificationChannelService_GetNotificationChannelVerificationCode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetNotificationChannelVerificationCodeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NotificationChannelServiceServer).GetNotificationChannelVerificationCode(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.NotificationChannelService/GetNotificationChannelVerificationCode", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NotificationChannelServiceServer).GetNotificationChannelVerificationCode(ctx, req.(*GetNotificationChannelVerificationCodeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _NotificationChannelService_VerifyNotificationChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(VerifyNotificationChannelRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NotificationChannelServiceServer).VerifyNotificationChannel(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.NotificationChannelService/VerifyNotificationChannel", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NotificationChannelServiceServer).VerifyNotificationChannel(ctx, req.(*VerifyNotificationChannelRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _NotificationChannelService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "google.monitoring.v3.NotificationChannelService", - HandlerType: (*NotificationChannelServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListNotificationChannelDescriptors", - Handler: _NotificationChannelService_ListNotificationChannelDescriptors_Handler, - }, - { - MethodName: "GetNotificationChannelDescriptor", - Handler: _NotificationChannelService_GetNotificationChannelDescriptor_Handler, - }, - { - MethodName: "ListNotificationChannels", - Handler: _NotificationChannelService_ListNotificationChannels_Handler, - }, - { - MethodName: "GetNotificationChannel", - Handler: _NotificationChannelService_GetNotificationChannel_Handler, - }, - { - MethodName: "CreateNotificationChannel", - Handler: _NotificationChannelService_CreateNotificationChannel_Handler, - }, - { - MethodName: "UpdateNotificationChannel", - Handler: _NotificationChannelService_UpdateNotificationChannel_Handler, - }, - { - MethodName: "DeleteNotificationChannel", - Handler: _NotificationChannelService_DeleteNotificationChannel_Handler, - }, - { - MethodName: "SendNotificationChannelVerificationCode", - Handler: _NotificationChannelService_SendNotificationChannelVerificationCode_Handler, - }, - { - MethodName: "GetNotificationChannelVerificationCode", - Handler: _NotificationChannelService_GetNotificationChannelVerificationCode_Handler, - }, - { - MethodName: "VerifyNotificationChannel", - Handler: _NotificationChannelService_VerifyNotificationChannel_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "google/monitoring/v3/notification_service.proto", -} diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification_service_grpc.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification_service_grpc.pb.go new file mode 100644 index 00000000000..ec5c2fe1623 --- /dev/null +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/notification_service_grpc.pb.go @@ -0,0 +1,571 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.7 +// source: google/monitoring/v3/notification_service.proto + +package monitoringpb + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + NotificationChannelService_ListNotificationChannelDescriptors_FullMethodName = "/google.monitoring.v3.NotificationChannelService/ListNotificationChannelDescriptors" + NotificationChannelService_GetNotificationChannelDescriptor_FullMethodName = "/google.monitoring.v3.NotificationChannelService/GetNotificationChannelDescriptor" + NotificationChannelService_ListNotificationChannels_FullMethodName = "/google.monitoring.v3.NotificationChannelService/ListNotificationChannels" + NotificationChannelService_GetNotificationChannel_FullMethodName = "/google.monitoring.v3.NotificationChannelService/GetNotificationChannel" + NotificationChannelService_CreateNotificationChannel_FullMethodName = "/google.monitoring.v3.NotificationChannelService/CreateNotificationChannel" + NotificationChannelService_UpdateNotificationChannel_FullMethodName = "/google.monitoring.v3.NotificationChannelService/UpdateNotificationChannel" + NotificationChannelService_DeleteNotificationChannel_FullMethodName = "/google.monitoring.v3.NotificationChannelService/DeleteNotificationChannel" + NotificationChannelService_SendNotificationChannelVerificationCode_FullMethodName = "/google.monitoring.v3.NotificationChannelService/SendNotificationChannelVerificationCode" + NotificationChannelService_GetNotificationChannelVerificationCode_FullMethodName = "/google.monitoring.v3.NotificationChannelService/GetNotificationChannelVerificationCode" + NotificationChannelService_VerifyNotificationChannel_FullMethodName = "/google.monitoring.v3.NotificationChannelService/VerifyNotificationChannel" +) + +// NotificationChannelServiceClient is the client API for NotificationChannelService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type NotificationChannelServiceClient interface { + // Lists the descriptors for supported channel types. The use of descriptors + // makes it possible for new channel types to be dynamically added. + ListNotificationChannelDescriptors(ctx context.Context, in *ListNotificationChannelDescriptorsRequest, opts ...grpc.CallOption) (*ListNotificationChannelDescriptorsResponse, error) + // Gets a single channel descriptor. The descriptor indicates which fields + // are expected / permitted for a notification channel of the given type. + GetNotificationChannelDescriptor(ctx context.Context, in *GetNotificationChannelDescriptorRequest, opts ...grpc.CallOption) (*NotificationChannelDescriptor, error) + // Lists the notification channels that have been created for the project. + // To list the types of notification channels that are supported, use + // the `ListNotificationChannelDescriptors` method. + ListNotificationChannels(ctx context.Context, in *ListNotificationChannelsRequest, opts ...grpc.CallOption) (*ListNotificationChannelsResponse, error) + // Gets a single notification channel. The channel includes the relevant + // configuration details with which the channel was created. However, the + // response may truncate or omit passwords, API keys, or other private key + // matter and thus the response may not be 100% identical to the information + // that was supplied in the call to the create method. + GetNotificationChannel(ctx context.Context, in *GetNotificationChannelRequest, opts ...grpc.CallOption) (*NotificationChannel, error) + // Creates a new notification channel, representing a single notification + // endpoint such as an email address, SMS number, or PagerDuty service. + // + // Design your application to single-thread API calls that modify the state of + // notification channels in a single project. This includes calls to + // CreateNotificationChannel, DeleteNotificationChannel and + // UpdateNotificationChannel. + CreateNotificationChannel(ctx context.Context, in *CreateNotificationChannelRequest, opts ...grpc.CallOption) (*NotificationChannel, error) + // Updates a notification channel. Fields not specified in the field mask + // remain unchanged. + // + // Design your application to single-thread API calls that modify the state of + // notification channels in a single project. This includes calls to + // CreateNotificationChannel, DeleteNotificationChannel and + // UpdateNotificationChannel. + UpdateNotificationChannel(ctx context.Context, in *UpdateNotificationChannelRequest, opts ...grpc.CallOption) (*NotificationChannel, error) + // Deletes a notification channel. + // + // Design your application to single-thread API calls that modify the state of + // notification channels in a single project. This includes calls to + // CreateNotificationChannel, DeleteNotificationChannel and + // UpdateNotificationChannel. + DeleteNotificationChannel(ctx context.Context, in *DeleteNotificationChannelRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Causes a verification code to be delivered to the channel. The code + // can then be supplied in `VerifyNotificationChannel` to verify the channel. + SendNotificationChannelVerificationCode(ctx context.Context, in *SendNotificationChannelVerificationCodeRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Requests a verification code for an already verified channel that can then + // be used in a call to VerifyNotificationChannel() on a different channel + // with an equivalent identity in the same or in a different project. This + // makes it possible to copy a channel between projects without requiring + // manual reverification of the channel. If the channel is not in the + // verified state, this method will fail (in other words, this may only be + // used if the SendNotificationChannelVerificationCode and + // VerifyNotificationChannel paths have already been used to put the given + // channel into the verified state). + // + // There is no guarantee that the verification codes returned by this method + // will be of a similar structure or form as the ones that are delivered + // to the channel via SendNotificationChannelVerificationCode; while + // VerifyNotificationChannel() will recognize both the codes delivered via + // SendNotificationChannelVerificationCode() and returned from + // GetNotificationChannelVerificationCode(), it is typically the case that + // the verification codes delivered via + // SendNotificationChannelVerificationCode() will be shorter and also + // have a shorter expiration (e.g. codes such as "G-123456") whereas + // GetVerificationCode() will typically return a much longer, websafe base + // 64 encoded string that has a longer expiration time. + GetNotificationChannelVerificationCode(ctx context.Context, in *GetNotificationChannelVerificationCodeRequest, opts ...grpc.CallOption) (*GetNotificationChannelVerificationCodeResponse, error) + // Verifies a `NotificationChannel` by proving receipt of the code + // delivered to the channel as a result of calling + // `SendNotificationChannelVerificationCode`. + VerifyNotificationChannel(ctx context.Context, in *VerifyNotificationChannelRequest, opts ...grpc.CallOption) (*NotificationChannel, error) +} + +type notificationChannelServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewNotificationChannelServiceClient(cc grpc.ClientConnInterface) NotificationChannelServiceClient { + return ¬ificationChannelServiceClient{cc} +} + +func (c *notificationChannelServiceClient) ListNotificationChannelDescriptors(ctx context.Context, in *ListNotificationChannelDescriptorsRequest, opts ...grpc.CallOption) (*ListNotificationChannelDescriptorsResponse, error) { + out := new(ListNotificationChannelDescriptorsResponse) + err := c.cc.Invoke(ctx, NotificationChannelService_ListNotificationChannelDescriptors_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *notificationChannelServiceClient) GetNotificationChannelDescriptor(ctx context.Context, in *GetNotificationChannelDescriptorRequest, opts ...grpc.CallOption) (*NotificationChannelDescriptor, error) { + out := new(NotificationChannelDescriptor) + err := c.cc.Invoke(ctx, NotificationChannelService_GetNotificationChannelDescriptor_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *notificationChannelServiceClient) ListNotificationChannels(ctx context.Context, in *ListNotificationChannelsRequest, opts ...grpc.CallOption) (*ListNotificationChannelsResponse, error) { + out := new(ListNotificationChannelsResponse) + err := c.cc.Invoke(ctx, NotificationChannelService_ListNotificationChannels_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *notificationChannelServiceClient) GetNotificationChannel(ctx context.Context, in *GetNotificationChannelRequest, opts ...grpc.CallOption) (*NotificationChannel, error) { + out := new(NotificationChannel) + err := c.cc.Invoke(ctx, NotificationChannelService_GetNotificationChannel_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *notificationChannelServiceClient) CreateNotificationChannel(ctx context.Context, in *CreateNotificationChannelRequest, opts ...grpc.CallOption) (*NotificationChannel, error) { + out := new(NotificationChannel) + err := c.cc.Invoke(ctx, NotificationChannelService_CreateNotificationChannel_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *notificationChannelServiceClient) UpdateNotificationChannel(ctx context.Context, in *UpdateNotificationChannelRequest, opts ...grpc.CallOption) (*NotificationChannel, error) { + out := new(NotificationChannel) + err := c.cc.Invoke(ctx, NotificationChannelService_UpdateNotificationChannel_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *notificationChannelServiceClient) DeleteNotificationChannel(ctx context.Context, in *DeleteNotificationChannelRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, NotificationChannelService_DeleteNotificationChannel_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *notificationChannelServiceClient) SendNotificationChannelVerificationCode(ctx context.Context, in *SendNotificationChannelVerificationCodeRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, NotificationChannelService_SendNotificationChannelVerificationCode_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *notificationChannelServiceClient) GetNotificationChannelVerificationCode(ctx context.Context, in *GetNotificationChannelVerificationCodeRequest, opts ...grpc.CallOption) (*GetNotificationChannelVerificationCodeResponse, error) { + out := new(GetNotificationChannelVerificationCodeResponse) + err := c.cc.Invoke(ctx, NotificationChannelService_GetNotificationChannelVerificationCode_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *notificationChannelServiceClient) VerifyNotificationChannel(ctx context.Context, in *VerifyNotificationChannelRequest, opts ...grpc.CallOption) (*NotificationChannel, error) { + out := new(NotificationChannel) + err := c.cc.Invoke(ctx, NotificationChannelService_VerifyNotificationChannel_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// NotificationChannelServiceServer is the server API for NotificationChannelService service. +// All implementations should embed UnimplementedNotificationChannelServiceServer +// for forward compatibility +type NotificationChannelServiceServer interface { + // Lists the descriptors for supported channel types. The use of descriptors + // makes it possible for new channel types to be dynamically added. + ListNotificationChannelDescriptors(context.Context, *ListNotificationChannelDescriptorsRequest) (*ListNotificationChannelDescriptorsResponse, error) + // Gets a single channel descriptor. The descriptor indicates which fields + // are expected / permitted for a notification channel of the given type. + GetNotificationChannelDescriptor(context.Context, *GetNotificationChannelDescriptorRequest) (*NotificationChannelDescriptor, error) + // Lists the notification channels that have been created for the project. + // To list the types of notification channels that are supported, use + // the `ListNotificationChannelDescriptors` method. + ListNotificationChannels(context.Context, *ListNotificationChannelsRequest) (*ListNotificationChannelsResponse, error) + // Gets a single notification channel. The channel includes the relevant + // configuration details with which the channel was created. However, the + // response may truncate or omit passwords, API keys, or other private key + // matter and thus the response may not be 100% identical to the information + // that was supplied in the call to the create method. + GetNotificationChannel(context.Context, *GetNotificationChannelRequest) (*NotificationChannel, error) + // Creates a new notification channel, representing a single notification + // endpoint such as an email address, SMS number, or PagerDuty service. + // + // Design your application to single-thread API calls that modify the state of + // notification channels in a single project. This includes calls to + // CreateNotificationChannel, DeleteNotificationChannel and + // UpdateNotificationChannel. + CreateNotificationChannel(context.Context, *CreateNotificationChannelRequest) (*NotificationChannel, error) + // Updates a notification channel. Fields not specified in the field mask + // remain unchanged. + // + // Design your application to single-thread API calls that modify the state of + // notification channels in a single project. This includes calls to + // CreateNotificationChannel, DeleteNotificationChannel and + // UpdateNotificationChannel. + UpdateNotificationChannel(context.Context, *UpdateNotificationChannelRequest) (*NotificationChannel, error) + // Deletes a notification channel. + // + // Design your application to single-thread API calls that modify the state of + // notification channels in a single project. This includes calls to + // CreateNotificationChannel, DeleteNotificationChannel and + // UpdateNotificationChannel. + DeleteNotificationChannel(context.Context, *DeleteNotificationChannelRequest) (*emptypb.Empty, error) + // Causes a verification code to be delivered to the channel. The code + // can then be supplied in `VerifyNotificationChannel` to verify the channel. + SendNotificationChannelVerificationCode(context.Context, *SendNotificationChannelVerificationCodeRequest) (*emptypb.Empty, error) + // Requests a verification code for an already verified channel that can then + // be used in a call to VerifyNotificationChannel() on a different channel + // with an equivalent identity in the same or in a different project. This + // makes it possible to copy a channel between projects without requiring + // manual reverification of the channel. If the channel is not in the + // verified state, this method will fail (in other words, this may only be + // used if the SendNotificationChannelVerificationCode and + // VerifyNotificationChannel paths have already been used to put the given + // channel into the verified state). + // + // There is no guarantee that the verification codes returned by this method + // will be of a similar structure or form as the ones that are delivered + // to the channel via SendNotificationChannelVerificationCode; while + // VerifyNotificationChannel() will recognize both the codes delivered via + // SendNotificationChannelVerificationCode() and returned from + // GetNotificationChannelVerificationCode(), it is typically the case that + // the verification codes delivered via + // SendNotificationChannelVerificationCode() will be shorter and also + // have a shorter expiration (e.g. codes such as "G-123456") whereas + // GetVerificationCode() will typically return a much longer, websafe base + // 64 encoded string that has a longer expiration time. + GetNotificationChannelVerificationCode(context.Context, *GetNotificationChannelVerificationCodeRequest) (*GetNotificationChannelVerificationCodeResponse, error) + // Verifies a `NotificationChannel` by proving receipt of the code + // delivered to the channel as a result of calling + // `SendNotificationChannelVerificationCode`. + VerifyNotificationChannel(context.Context, *VerifyNotificationChannelRequest) (*NotificationChannel, error) +} + +// UnimplementedNotificationChannelServiceServer should be embedded to have forward compatible implementations. +type UnimplementedNotificationChannelServiceServer struct { +} + +func (UnimplementedNotificationChannelServiceServer) ListNotificationChannelDescriptors(context.Context, *ListNotificationChannelDescriptorsRequest) (*ListNotificationChannelDescriptorsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListNotificationChannelDescriptors not implemented") +} +func (UnimplementedNotificationChannelServiceServer) GetNotificationChannelDescriptor(context.Context, *GetNotificationChannelDescriptorRequest) (*NotificationChannelDescriptor, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetNotificationChannelDescriptor not implemented") +} +func (UnimplementedNotificationChannelServiceServer) ListNotificationChannels(context.Context, *ListNotificationChannelsRequest) (*ListNotificationChannelsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListNotificationChannels not implemented") +} +func (UnimplementedNotificationChannelServiceServer) GetNotificationChannel(context.Context, *GetNotificationChannelRequest) (*NotificationChannel, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetNotificationChannel not implemented") +} +func (UnimplementedNotificationChannelServiceServer) CreateNotificationChannel(context.Context, *CreateNotificationChannelRequest) (*NotificationChannel, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateNotificationChannel not implemented") +} +func (UnimplementedNotificationChannelServiceServer) UpdateNotificationChannel(context.Context, *UpdateNotificationChannelRequest) (*NotificationChannel, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateNotificationChannel not implemented") +} +func (UnimplementedNotificationChannelServiceServer) DeleteNotificationChannel(context.Context, *DeleteNotificationChannelRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteNotificationChannel not implemented") +} +func (UnimplementedNotificationChannelServiceServer) SendNotificationChannelVerificationCode(context.Context, *SendNotificationChannelVerificationCodeRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method SendNotificationChannelVerificationCode not implemented") +} +func (UnimplementedNotificationChannelServiceServer) GetNotificationChannelVerificationCode(context.Context, *GetNotificationChannelVerificationCodeRequest) (*GetNotificationChannelVerificationCodeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetNotificationChannelVerificationCode not implemented") +} +func (UnimplementedNotificationChannelServiceServer) VerifyNotificationChannel(context.Context, *VerifyNotificationChannelRequest) (*NotificationChannel, error) { + return nil, status.Errorf(codes.Unimplemented, "method VerifyNotificationChannel not implemented") +} + +// UnsafeNotificationChannelServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to NotificationChannelServiceServer will +// result in compilation errors. +type UnsafeNotificationChannelServiceServer interface { + mustEmbedUnimplementedNotificationChannelServiceServer() +} + +func RegisterNotificationChannelServiceServer(s grpc.ServiceRegistrar, srv NotificationChannelServiceServer) { + s.RegisterService(&NotificationChannelService_ServiceDesc, srv) +} + +func _NotificationChannelService_ListNotificationChannelDescriptors_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListNotificationChannelDescriptorsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NotificationChannelServiceServer).ListNotificationChannelDescriptors(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NotificationChannelService_ListNotificationChannelDescriptors_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NotificationChannelServiceServer).ListNotificationChannelDescriptors(ctx, req.(*ListNotificationChannelDescriptorsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NotificationChannelService_GetNotificationChannelDescriptor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetNotificationChannelDescriptorRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NotificationChannelServiceServer).GetNotificationChannelDescriptor(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NotificationChannelService_GetNotificationChannelDescriptor_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NotificationChannelServiceServer).GetNotificationChannelDescriptor(ctx, req.(*GetNotificationChannelDescriptorRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NotificationChannelService_ListNotificationChannels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListNotificationChannelsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NotificationChannelServiceServer).ListNotificationChannels(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NotificationChannelService_ListNotificationChannels_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NotificationChannelServiceServer).ListNotificationChannels(ctx, req.(*ListNotificationChannelsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NotificationChannelService_GetNotificationChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetNotificationChannelRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NotificationChannelServiceServer).GetNotificationChannel(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NotificationChannelService_GetNotificationChannel_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NotificationChannelServiceServer).GetNotificationChannel(ctx, req.(*GetNotificationChannelRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NotificationChannelService_CreateNotificationChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateNotificationChannelRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NotificationChannelServiceServer).CreateNotificationChannel(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NotificationChannelService_CreateNotificationChannel_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NotificationChannelServiceServer).CreateNotificationChannel(ctx, req.(*CreateNotificationChannelRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NotificationChannelService_UpdateNotificationChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateNotificationChannelRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NotificationChannelServiceServer).UpdateNotificationChannel(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NotificationChannelService_UpdateNotificationChannel_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NotificationChannelServiceServer).UpdateNotificationChannel(ctx, req.(*UpdateNotificationChannelRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NotificationChannelService_DeleteNotificationChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteNotificationChannelRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NotificationChannelServiceServer).DeleteNotificationChannel(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NotificationChannelService_DeleteNotificationChannel_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NotificationChannelServiceServer).DeleteNotificationChannel(ctx, req.(*DeleteNotificationChannelRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NotificationChannelService_SendNotificationChannelVerificationCode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SendNotificationChannelVerificationCodeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NotificationChannelServiceServer).SendNotificationChannelVerificationCode(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NotificationChannelService_SendNotificationChannelVerificationCode_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NotificationChannelServiceServer).SendNotificationChannelVerificationCode(ctx, req.(*SendNotificationChannelVerificationCodeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NotificationChannelService_GetNotificationChannelVerificationCode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetNotificationChannelVerificationCodeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NotificationChannelServiceServer).GetNotificationChannelVerificationCode(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NotificationChannelService_GetNotificationChannelVerificationCode_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NotificationChannelServiceServer).GetNotificationChannelVerificationCode(ctx, req.(*GetNotificationChannelVerificationCodeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NotificationChannelService_VerifyNotificationChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(VerifyNotificationChannelRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NotificationChannelServiceServer).VerifyNotificationChannel(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NotificationChannelService_VerifyNotificationChannel_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NotificationChannelServiceServer).VerifyNotificationChannel(ctx, req.(*VerifyNotificationChannelRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// NotificationChannelService_ServiceDesc is the grpc.ServiceDesc for NotificationChannelService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var NotificationChannelService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "google.monitoring.v3.NotificationChannelService", + HandlerType: (*NotificationChannelServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListNotificationChannelDescriptors", + Handler: _NotificationChannelService_ListNotificationChannelDescriptors_Handler, + }, + { + MethodName: "GetNotificationChannelDescriptor", + Handler: _NotificationChannelService_GetNotificationChannelDescriptor_Handler, + }, + { + MethodName: "ListNotificationChannels", + Handler: _NotificationChannelService_ListNotificationChannels_Handler, + }, + { + MethodName: "GetNotificationChannel", + Handler: _NotificationChannelService_GetNotificationChannel_Handler, + }, + { + MethodName: "CreateNotificationChannel", + Handler: _NotificationChannelService_CreateNotificationChannel_Handler, + }, + { + MethodName: "UpdateNotificationChannel", + Handler: _NotificationChannelService_UpdateNotificationChannel_Handler, + }, + { + MethodName: "DeleteNotificationChannel", + Handler: _NotificationChannelService_DeleteNotificationChannel_Handler, + }, + { + MethodName: "SendNotificationChannelVerificationCode", + Handler: _NotificationChannelService_SendNotificationChannelVerificationCode_Handler, + }, + { + MethodName: "GetNotificationChannelVerificationCode", + Handler: _NotificationChannelService_GetNotificationChannelVerificationCode_Handler, + }, + { + MethodName: "VerifyNotificationChannel", + Handler: _NotificationChannelService_VerifyNotificationChannel_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/monitoring/v3/notification_service.proto", +} diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/query_service.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/query_service.pb.go index 6402f18ca11..63741c4b6d8 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/query_service.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/query_service.pb.go @@ -15,21 +15,16 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/monitoring/v3/query_service.proto package monitoringpb import ( - context "context" - reflect "reflect" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" ) const ( @@ -128,94 +123,3 @@ func file_google_monitoring_v3_query_service_proto_init() { file_google_monitoring_v3_query_service_proto_goTypes = nil file_google_monitoring_v3_query_service_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// QueryServiceClient is the client API for QueryService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type QueryServiceClient interface { - // Deprecated: Do not use. - // Queries time series by using Monitoring Query Language (MQL). We recommend - // using PromQL instead of MQL. For more information about the status of MQL, - // see the [MQL deprecation - // notice](https://cloud.google.com/stackdriver/docs/deprecations/mql). - QueryTimeSeries(ctx context.Context, in *QueryTimeSeriesRequest, opts ...grpc.CallOption) (*QueryTimeSeriesResponse, error) -} - -type queryServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewQueryServiceClient(cc grpc.ClientConnInterface) QueryServiceClient { - return &queryServiceClient{cc} -} - -// Deprecated: Do not use. -func (c *queryServiceClient) QueryTimeSeries(ctx context.Context, in *QueryTimeSeriesRequest, opts ...grpc.CallOption) (*QueryTimeSeriesResponse, error) { - out := new(QueryTimeSeriesResponse) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.QueryService/QueryTimeSeries", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServiceServer is the server API for QueryService service. -type QueryServiceServer interface { - // Deprecated: Do not use. - // Queries time series by using Monitoring Query Language (MQL). We recommend - // using PromQL instead of MQL. For more information about the status of MQL, - // see the [MQL deprecation - // notice](https://cloud.google.com/stackdriver/docs/deprecations/mql). - QueryTimeSeries(context.Context, *QueryTimeSeriesRequest) (*QueryTimeSeriesResponse, error) -} - -// UnimplementedQueryServiceServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServiceServer struct { -} - -func (*UnimplementedQueryServiceServer) QueryTimeSeries(context.Context, *QueryTimeSeriesRequest) (*QueryTimeSeriesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryTimeSeries not implemented") -} - -func RegisterQueryServiceServer(s *grpc.Server, srv QueryServiceServer) { - s.RegisterService(&_QueryService_serviceDesc, srv) -} - -func _QueryService_QueryTimeSeries_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryTimeSeriesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServiceServer).QueryTimeSeries(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.QueryService/QueryTimeSeries", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServiceServer).QueryTimeSeries(ctx, req.(*QueryTimeSeriesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _QueryService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "google.monitoring.v3.QueryService", - HandlerType: (*QueryServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "QueryTimeSeries", - Handler: _QueryService_QueryTimeSeries_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "google/monitoring/v3/query_service.proto", -} diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/query_service_grpc.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/query_service_grpc.pb.go new file mode 100644 index 00000000000..403533951f0 --- /dev/null +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/query_service_grpc.pb.go @@ -0,0 +1,132 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.7 +// source: google/monitoring/v3/query_service.proto + +package monitoringpb + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + QueryService_QueryTimeSeries_FullMethodName = "/google.monitoring.v3.QueryService/QueryTimeSeries" +) + +// QueryServiceClient is the client API for QueryService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type QueryServiceClient interface { + // Deprecated: Do not use. + // Queries time series by using Monitoring Query Language (MQL). We recommend + // using PromQL instead of MQL. For more information about the status of MQL, + // see the [MQL deprecation + // notice](https://cloud.google.com/stackdriver/docs/deprecations/mql). + QueryTimeSeries(ctx context.Context, in *QueryTimeSeriesRequest, opts ...grpc.CallOption) (*QueryTimeSeriesResponse, error) +} + +type queryServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewQueryServiceClient(cc grpc.ClientConnInterface) QueryServiceClient { + return &queryServiceClient{cc} +} + +// Deprecated: Do not use. +func (c *queryServiceClient) QueryTimeSeries(ctx context.Context, in *QueryTimeSeriesRequest, opts ...grpc.CallOption) (*QueryTimeSeriesResponse, error) { + out := new(QueryTimeSeriesResponse) + err := c.cc.Invoke(ctx, QueryService_QueryTimeSeries_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServiceServer is the server API for QueryService service. +// All implementations should embed UnimplementedQueryServiceServer +// for forward compatibility +type QueryServiceServer interface { + // Deprecated: Do not use. + // Queries time series by using Monitoring Query Language (MQL). We recommend + // using PromQL instead of MQL. For more information about the status of MQL, + // see the [MQL deprecation + // notice](https://cloud.google.com/stackdriver/docs/deprecations/mql). + QueryTimeSeries(context.Context, *QueryTimeSeriesRequest) (*QueryTimeSeriesResponse, error) +} + +// UnimplementedQueryServiceServer should be embedded to have forward compatible implementations. +type UnimplementedQueryServiceServer struct { +} + +func (UnimplementedQueryServiceServer) QueryTimeSeries(context.Context, *QueryTimeSeriesRequest) (*QueryTimeSeriesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryTimeSeries not implemented") +} + +// UnsafeQueryServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to QueryServiceServer will +// result in compilation errors. +type UnsafeQueryServiceServer interface { + mustEmbedUnimplementedQueryServiceServer() +} + +func RegisterQueryServiceServer(s grpc.ServiceRegistrar, srv QueryServiceServer) { + s.RegisterService(&QueryService_ServiceDesc, srv) +} + +func _QueryService_QueryTimeSeries_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryTimeSeriesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServiceServer).QueryTimeSeries(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: QueryService_QueryTimeSeries_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServiceServer).QueryTimeSeries(ctx, req.(*QueryTimeSeriesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// QueryService_ServiceDesc is the grpc.ServiceDesc for QueryService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var QueryService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "google.monitoring.v3.QueryService", + HandlerType: (*QueryServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "QueryTimeSeries", + Handler: _QueryService_QueryTimeSeries_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/monitoring/v3/query_service.proto", +} diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service.pb.go index a9d2ae8cb67..07a209ac199 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service.pb.go @@ -15,20 +15,19 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/monitoring/v3/service.proto package monitoringpb import ( - reflect "reflect" - sync "sync" - _ "google.golang.org/genproto/googleapis/api/annotations" calendarperiod "google.golang.org/genproto/googleapis/type/calendarperiod" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" durationpb "google.golang.org/protobuf/types/known/durationpb" + reflect "reflect" + sync "sync" ) const ( diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service_service.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service_service.pb.go index 08c2e08e264..f08dfe56ad3 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service_service.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service_service.pb.go @@ -15,24 +15,19 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/monitoring/v3/service_service.proto package monitoringpb import ( - context "context" - reflect "reflect" - sync "sync" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" emptypb "google.golang.org/protobuf/types/known/emptypb" fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" + reflect "reflect" + sync "sync" ) const ( @@ -1200,427 +1195,3 @@ func file_google_monitoring_v3_service_service_proto_init() { file_google_monitoring_v3_service_service_proto_goTypes = nil file_google_monitoring_v3_service_service_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// ServiceMonitoringServiceClient is the client API for ServiceMonitoringService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type ServiceMonitoringServiceClient interface { - // Create a `Service`. - CreateService(ctx context.Context, in *CreateServiceRequest, opts ...grpc.CallOption) (*Service, error) - // Get the named `Service`. - GetService(ctx context.Context, in *GetServiceRequest, opts ...grpc.CallOption) (*Service, error) - // List `Service`s for this Metrics Scope. - ListServices(ctx context.Context, in *ListServicesRequest, opts ...grpc.CallOption) (*ListServicesResponse, error) - // Update this `Service`. - UpdateService(ctx context.Context, in *UpdateServiceRequest, opts ...grpc.CallOption) (*Service, error) - // Soft delete this `Service`. - DeleteService(ctx context.Context, in *DeleteServiceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // Create a `ServiceLevelObjective` for the given `Service`. - CreateServiceLevelObjective(ctx context.Context, in *CreateServiceLevelObjectiveRequest, opts ...grpc.CallOption) (*ServiceLevelObjective, error) - // Get a `ServiceLevelObjective` by name. - GetServiceLevelObjective(ctx context.Context, in *GetServiceLevelObjectiveRequest, opts ...grpc.CallOption) (*ServiceLevelObjective, error) - // List the `ServiceLevelObjective`s for the given `Service`. - ListServiceLevelObjectives(ctx context.Context, in *ListServiceLevelObjectivesRequest, opts ...grpc.CallOption) (*ListServiceLevelObjectivesResponse, error) - // Update the given `ServiceLevelObjective`. - UpdateServiceLevelObjective(ctx context.Context, in *UpdateServiceLevelObjectiveRequest, opts ...grpc.CallOption) (*ServiceLevelObjective, error) - // Delete the given `ServiceLevelObjective`. - DeleteServiceLevelObjective(ctx context.Context, in *DeleteServiceLevelObjectiveRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) -} - -type serviceMonitoringServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewServiceMonitoringServiceClient(cc grpc.ClientConnInterface) ServiceMonitoringServiceClient { - return &serviceMonitoringServiceClient{cc} -} - -func (c *serviceMonitoringServiceClient) CreateService(ctx context.Context, in *CreateServiceRequest, opts ...grpc.CallOption) (*Service, error) { - out := new(Service) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.ServiceMonitoringService/CreateService", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serviceMonitoringServiceClient) GetService(ctx context.Context, in *GetServiceRequest, opts ...grpc.CallOption) (*Service, error) { - out := new(Service) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.ServiceMonitoringService/GetService", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serviceMonitoringServiceClient) ListServices(ctx context.Context, in *ListServicesRequest, opts ...grpc.CallOption) (*ListServicesResponse, error) { - out := new(ListServicesResponse) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.ServiceMonitoringService/ListServices", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serviceMonitoringServiceClient) UpdateService(ctx context.Context, in *UpdateServiceRequest, opts ...grpc.CallOption) (*Service, error) { - out := new(Service) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.ServiceMonitoringService/UpdateService", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serviceMonitoringServiceClient) DeleteService(ctx context.Context, in *DeleteServiceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.ServiceMonitoringService/DeleteService", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serviceMonitoringServiceClient) CreateServiceLevelObjective(ctx context.Context, in *CreateServiceLevelObjectiveRequest, opts ...grpc.CallOption) (*ServiceLevelObjective, error) { - out := new(ServiceLevelObjective) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.ServiceMonitoringService/CreateServiceLevelObjective", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serviceMonitoringServiceClient) GetServiceLevelObjective(ctx context.Context, in *GetServiceLevelObjectiveRequest, opts ...grpc.CallOption) (*ServiceLevelObjective, error) { - out := new(ServiceLevelObjective) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.ServiceMonitoringService/GetServiceLevelObjective", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serviceMonitoringServiceClient) ListServiceLevelObjectives(ctx context.Context, in *ListServiceLevelObjectivesRequest, opts ...grpc.CallOption) (*ListServiceLevelObjectivesResponse, error) { - out := new(ListServiceLevelObjectivesResponse) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.ServiceMonitoringService/ListServiceLevelObjectives", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serviceMonitoringServiceClient) UpdateServiceLevelObjective(ctx context.Context, in *UpdateServiceLevelObjectiveRequest, opts ...grpc.CallOption) (*ServiceLevelObjective, error) { - out := new(ServiceLevelObjective) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.ServiceMonitoringService/UpdateServiceLevelObjective", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serviceMonitoringServiceClient) DeleteServiceLevelObjective(ctx context.Context, in *DeleteServiceLevelObjectiveRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.ServiceMonitoringService/DeleteServiceLevelObjective", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ServiceMonitoringServiceServer is the server API for ServiceMonitoringService service. -type ServiceMonitoringServiceServer interface { - // Create a `Service`. - CreateService(context.Context, *CreateServiceRequest) (*Service, error) - // Get the named `Service`. - GetService(context.Context, *GetServiceRequest) (*Service, error) - // List `Service`s for this Metrics Scope. - ListServices(context.Context, *ListServicesRequest) (*ListServicesResponse, error) - // Update this `Service`. - UpdateService(context.Context, *UpdateServiceRequest) (*Service, error) - // Soft delete this `Service`. - DeleteService(context.Context, *DeleteServiceRequest) (*emptypb.Empty, error) - // Create a `ServiceLevelObjective` for the given `Service`. - CreateServiceLevelObjective(context.Context, *CreateServiceLevelObjectiveRequest) (*ServiceLevelObjective, error) - // Get a `ServiceLevelObjective` by name. - GetServiceLevelObjective(context.Context, *GetServiceLevelObjectiveRequest) (*ServiceLevelObjective, error) - // List the `ServiceLevelObjective`s for the given `Service`. - ListServiceLevelObjectives(context.Context, *ListServiceLevelObjectivesRequest) (*ListServiceLevelObjectivesResponse, error) - // Update the given `ServiceLevelObjective`. - UpdateServiceLevelObjective(context.Context, *UpdateServiceLevelObjectiveRequest) (*ServiceLevelObjective, error) - // Delete the given `ServiceLevelObjective`. - DeleteServiceLevelObjective(context.Context, *DeleteServiceLevelObjectiveRequest) (*emptypb.Empty, error) -} - -// UnimplementedServiceMonitoringServiceServer can be embedded to have forward compatible implementations. -type UnimplementedServiceMonitoringServiceServer struct { -} - -func (*UnimplementedServiceMonitoringServiceServer) CreateService(context.Context, *CreateServiceRequest) (*Service, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateService not implemented") -} -func (*UnimplementedServiceMonitoringServiceServer) GetService(context.Context, *GetServiceRequest) (*Service, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetService not implemented") -} -func (*UnimplementedServiceMonitoringServiceServer) ListServices(context.Context, *ListServicesRequest) (*ListServicesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListServices not implemented") -} -func (*UnimplementedServiceMonitoringServiceServer) UpdateService(context.Context, *UpdateServiceRequest) (*Service, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateService not implemented") -} -func (*UnimplementedServiceMonitoringServiceServer) DeleteService(context.Context, *DeleteServiceRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteService not implemented") -} -func (*UnimplementedServiceMonitoringServiceServer) CreateServiceLevelObjective(context.Context, *CreateServiceLevelObjectiveRequest) (*ServiceLevelObjective, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateServiceLevelObjective not implemented") -} -func (*UnimplementedServiceMonitoringServiceServer) GetServiceLevelObjective(context.Context, *GetServiceLevelObjectiveRequest) (*ServiceLevelObjective, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetServiceLevelObjective not implemented") -} -func (*UnimplementedServiceMonitoringServiceServer) ListServiceLevelObjectives(context.Context, *ListServiceLevelObjectivesRequest) (*ListServiceLevelObjectivesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListServiceLevelObjectives not implemented") -} -func (*UnimplementedServiceMonitoringServiceServer) UpdateServiceLevelObjective(context.Context, *UpdateServiceLevelObjectiveRequest) (*ServiceLevelObjective, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateServiceLevelObjective not implemented") -} -func (*UnimplementedServiceMonitoringServiceServer) DeleteServiceLevelObjective(context.Context, *DeleteServiceLevelObjectiveRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteServiceLevelObjective not implemented") -} - -func RegisterServiceMonitoringServiceServer(s *grpc.Server, srv ServiceMonitoringServiceServer) { - s.RegisterService(&_ServiceMonitoringService_serviceDesc, srv) -} - -func _ServiceMonitoringService_CreateService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateServiceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServiceMonitoringServiceServer).CreateService(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.ServiceMonitoringService/CreateService", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceMonitoringServiceServer).CreateService(ctx, req.(*CreateServiceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ServiceMonitoringService_GetService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetServiceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServiceMonitoringServiceServer).GetService(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.ServiceMonitoringService/GetService", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceMonitoringServiceServer).GetService(ctx, req.(*GetServiceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ServiceMonitoringService_ListServices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListServicesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServiceMonitoringServiceServer).ListServices(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.ServiceMonitoringService/ListServices", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceMonitoringServiceServer).ListServices(ctx, req.(*ListServicesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ServiceMonitoringService_UpdateService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateServiceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServiceMonitoringServiceServer).UpdateService(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.ServiceMonitoringService/UpdateService", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceMonitoringServiceServer).UpdateService(ctx, req.(*UpdateServiceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ServiceMonitoringService_DeleteService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteServiceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServiceMonitoringServiceServer).DeleteService(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.ServiceMonitoringService/DeleteService", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceMonitoringServiceServer).DeleteService(ctx, req.(*DeleteServiceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ServiceMonitoringService_CreateServiceLevelObjective_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateServiceLevelObjectiveRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServiceMonitoringServiceServer).CreateServiceLevelObjective(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.ServiceMonitoringService/CreateServiceLevelObjective", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceMonitoringServiceServer).CreateServiceLevelObjective(ctx, req.(*CreateServiceLevelObjectiveRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ServiceMonitoringService_GetServiceLevelObjective_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetServiceLevelObjectiveRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServiceMonitoringServiceServer).GetServiceLevelObjective(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.ServiceMonitoringService/GetServiceLevelObjective", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceMonitoringServiceServer).GetServiceLevelObjective(ctx, req.(*GetServiceLevelObjectiveRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ServiceMonitoringService_ListServiceLevelObjectives_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListServiceLevelObjectivesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServiceMonitoringServiceServer).ListServiceLevelObjectives(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.ServiceMonitoringService/ListServiceLevelObjectives", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceMonitoringServiceServer).ListServiceLevelObjectives(ctx, req.(*ListServiceLevelObjectivesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ServiceMonitoringService_UpdateServiceLevelObjective_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateServiceLevelObjectiveRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServiceMonitoringServiceServer).UpdateServiceLevelObjective(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.ServiceMonitoringService/UpdateServiceLevelObjective", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceMonitoringServiceServer).UpdateServiceLevelObjective(ctx, req.(*UpdateServiceLevelObjectiveRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ServiceMonitoringService_DeleteServiceLevelObjective_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteServiceLevelObjectiveRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServiceMonitoringServiceServer).DeleteServiceLevelObjective(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.ServiceMonitoringService/DeleteServiceLevelObjective", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceMonitoringServiceServer).DeleteServiceLevelObjective(ctx, req.(*DeleteServiceLevelObjectiveRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _ServiceMonitoringService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "google.monitoring.v3.ServiceMonitoringService", - HandlerType: (*ServiceMonitoringServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "CreateService", - Handler: _ServiceMonitoringService_CreateService_Handler, - }, - { - MethodName: "GetService", - Handler: _ServiceMonitoringService_GetService_Handler, - }, - { - MethodName: "ListServices", - Handler: _ServiceMonitoringService_ListServices_Handler, - }, - { - MethodName: "UpdateService", - Handler: _ServiceMonitoringService_UpdateService_Handler, - }, - { - MethodName: "DeleteService", - Handler: _ServiceMonitoringService_DeleteService_Handler, - }, - { - MethodName: "CreateServiceLevelObjective", - Handler: _ServiceMonitoringService_CreateServiceLevelObjective_Handler, - }, - { - MethodName: "GetServiceLevelObjective", - Handler: _ServiceMonitoringService_GetServiceLevelObjective_Handler, - }, - { - MethodName: "ListServiceLevelObjectives", - Handler: _ServiceMonitoringService_ListServiceLevelObjectives_Handler, - }, - { - MethodName: "UpdateServiceLevelObjective", - Handler: _ServiceMonitoringService_UpdateServiceLevelObjective_Handler, - }, - { - MethodName: "DeleteServiceLevelObjective", - Handler: _ServiceMonitoringService_DeleteServiceLevelObjective_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "google/monitoring/v3/service_service.proto", -} diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service_service_grpc.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service_service_grpc.pb.go new file mode 100644 index 00000000000..bd7692b9502 --- /dev/null +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/service_service_grpc.pb.go @@ -0,0 +1,475 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.7 +// source: google/monitoring/v3/service_service.proto + +package monitoringpb + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + ServiceMonitoringService_CreateService_FullMethodName = "/google.monitoring.v3.ServiceMonitoringService/CreateService" + ServiceMonitoringService_GetService_FullMethodName = "/google.monitoring.v3.ServiceMonitoringService/GetService" + ServiceMonitoringService_ListServices_FullMethodName = "/google.monitoring.v3.ServiceMonitoringService/ListServices" + ServiceMonitoringService_UpdateService_FullMethodName = "/google.monitoring.v3.ServiceMonitoringService/UpdateService" + ServiceMonitoringService_DeleteService_FullMethodName = "/google.monitoring.v3.ServiceMonitoringService/DeleteService" + ServiceMonitoringService_CreateServiceLevelObjective_FullMethodName = "/google.monitoring.v3.ServiceMonitoringService/CreateServiceLevelObjective" + ServiceMonitoringService_GetServiceLevelObjective_FullMethodName = "/google.monitoring.v3.ServiceMonitoringService/GetServiceLevelObjective" + ServiceMonitoringService_ListServiceLevelObjectives_FullMethodName = "/google.monitoring.v3.ServiceMonitoringService/ListServiceLevelObjectives" + ServiceMonitoringService_UpdateServiceLevelObjective_FullMethodName = "/google.monitoring.v3.ServiceMonitoringService/UpdateServiceLevelObjective" + ServiceMonitoringService_DeleteServiceLevelObjective_FullMethodName = "/google.monitoring.v3.ServiceMonitoringService/DeleteServiceLevelObjective" +) + +// ServiceMonitoringServiceClient is the client API for ServiceMonitoringService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ServiceMonitoringServiceClient interface { + // Create a `Service`. + CreateService(ctx context.Context, in *CreateServiceRequest, opts ...grpc.CallOption) (*Service, error) + // Get the named `Service`. + GetService(ctx context.Context, in *GetServiceRequest, opts ...grpc.CallOption) (*Service, error) + // List `Service`s for this Metrics Scope. + ListServices(ctx context.Context, in *ListServicesRequest, opts ...grpc.CallOption) (*ListServicesResponse, error) + // Update this `Service`. + UpdateService(ctx context.Context, in *UpdateServiceRequest, opts ...grpc.CallOption) (*Service, error) + // Soft delete this `Service`. + DeleteService(ctx context.Context, in *DeleteServiceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Create a `ServiceLevelObjective` for the given `Service`. + CreateServiceLevelObjective(ctx context.Context, in *CreateServiceLevelObjectiveRequest, opts ...grpc.CallOption) (*ServiceLevelObjective, error) + // Get a `ServiceLevelObjective` by name. + GetServiceLevelObjective(ctx context.Context, in *GetServiceLevelObjectiveRequest, opts ...grpc.CallOption) (*ServiceLevelObjective, error) + // List the `ServiceLevelObjective`s for the given `Service`. + ListServiceLevelObjectives(ctx context.Context, in *ListServiceLevelObjectivesRequest, opts ...grpc.CallOption) (*ListServiceLevelObjectivesResponse, error) + // Update the given `ServiceLevelObjective`. + UpdateServiceLevelObjective(ctx context.Context, in *UpdateServiceLevelObjectiveRequest, opts ...grpc.CallOption) (*ServiceLevelObjective, error) + // Delete the given `ServiceLevelObjective`. + DeleteServiceLevelObjective(ctx context.Context, in *DeleteServiceLevelObjectiveRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) +} + +type serviceMonitoringServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewServiceMonitoringServiceClient(cc grpc.ClientConnInterface) ServiceMonitoringServiceClient { + return &serviceMonitoringServiceClient{cc} +} + +func (c *serviceMonitoringServiceClient) CreateService(ctx context.Context, in *CreateServiceRequest, opts ...grpc.CallOption) (*Service, error) { + out := new(Service) + err := c.cc.Invoke(ctx, ServiceMonitoringService_CreateService_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceMonitoringServiceClient) GetService(ctx context.Context, in *GetServiceRequest, opts ...grpc.CallOption) (*Service, error) { + out := new(Service) + err := c.cc.Invoke(ctx, ServiceMonitoringService_GetService_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceMonitoringServiceClient) ListServices(ctx context.Context, in *ListServicesRequest, opts ...grpc.CallOption) (*ListServicesResponse, error) { + out := new(ListServicesResponse) + err := c.cc.Invoke(ctx, ServiceMonitoringService_ListServices_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceMonitoringServiceClient) UpdateService(ctx context.Context, in *UpdateServiceRequest, opts ...grpc.CallOption) (*Service, error) { + out := new(Service) + err := c.cc.Invoke(ctx, ServiceMonitoringService_UpdateService_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceMonitoringServiceClient) DeleteService(ctx context.Context, in *DeleteServiceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, ServiceMonitoringService_DeleteService_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceMonitoringServiceClient) CreateServiceLevelObjective(ctx context.Context, in *CreateServiceLevelObjectiveRequest, opts ...grpc.CallOption) (*ServiceLevelObjective, error) { + out := new(ServiceLevelObjective) + err := c.cc.Invoke(ctx, ServiceMonitoringService_CreateServiceLevelObjective_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceMonitoringServiceClient) GetServiceLevelObjective(ctx context.Context, in *GetServiceLevelObjectiveRequest, opts ...grpc.CallOption) (*ServiceLevelObjective, error) { + out := new(ServiceLevelObjective) + err := c.cc.Invoke(ctx, ServiceMonitoringService_GetServiceLevelObjective_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceMonitoringServiceClient) ListServiceLevelObjectives(ctx context.Context, in *ListServiceLevelObjectivesRequest, opts ...grpc.CallOption) (*ListServiceLevelObjectivesResponse, error) { + out := new(ListServiceLevelObjectivesResponse) + err := c.cc.Invoke(ctx, ServiceMonitoringService_ListServiceLevelObjectives_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceMonitoringServiceClient) UpdateServiceLevelObjective(ctx context.Context, in *UpdateServiceLevelObjectiveRequest, opts ...grpc.CallOption) (*ServiceLevelObjective, error) { + out := new(ServiceLevelObjective) + err := c.cc.Invoke(ctx, ServiceMonitoringService_UpdateServiceLevelObjective_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceMonitoringServiceClient) DeleteServiceLevelObjective(ctx context.Context, in *DeleteServiceLevelObjectiveRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, ServiceMonitoringService_DeleteServiceLevelObjective_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ServiceMonitoringServiceServer is the server API for ServiceMonitoringService service. +// All implementations should embed UnimplementedServiceMonitoringServiceServer +// for forward compatibility +type ServiceMonitoringServiceServer interface { + // Create a `Service`. + CreateService(context.Context, *CreateServiceRequest) (*Service, error) + // Get the named `Service`. + GetService(context.Context, *GetServiceRequest) (*Service, error) + // List `Service`s for this Metrics Scope. + ListServices(context.Context, *ListServicesRequest) (*ListServicesResponse, error) + // Update this `Service`. + UpdateService(context.Context, *UpdateServiceRequest) (*Service, error) + // Soft delete this `Service`. + DeleteService(context.Context, *DeleteServiceRequest) (*emptypb.Empty, error) + // Create a `ServiceLevelObjective` for the given `Service`. + CreateServiceLevelObjective(context.Context, *CreateServiceLevelObjectiveRequest) (*ServiceLevelObjective, error) + // Get a `ServiceLevelObjective` by name. + GetServiceLevelObjective(context.Context, *GetServiceLevelObjectiveRequest) (*ServiceLevelObjective, error) + // List the `ServiceLevelObjective`s for the given `Service`. + ListServiceLevelObjectives(context.Context, *ListServiceLevelObjectivesRequest) (*ListServiceLevelObjectivesResponse, error) + // Update the given `ServiceLevelObjective`. + UpdateServiceLevelObjective(context.Context, *UpdateServiceLevelObjectiveRequest) (*ServiceLevelObjective, error) + // Delete the given `ServiceLevelObjective`. + DeleteServiceLevelObjective(context.Context, *DeleteServiceLevelObjectiveRequest) (*emptypb.Empty, error) +} + +// UnimplementedServiceMonitoringServiceServer should be embedded to have forward compatible implementations. +type UnimplementedServiceMonitoringServiceServer struct { +} + +func (UnimplementedServiceMonitoringServiceServer) CreateService(context.Context, *CreateServiceRequest) (*Service, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateService not implemented") +} +func (UnimplementedServiceMonitoringServiceServer) GetService(context.Context, *GetServiceRequest) (*Service, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetService not implemented") +} +func (UnimplementedServiceMonitoringServiceServer) ListServices(context.Context, *ListServicesRequest) (*ListServicesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListServices not implemented") +} +func (UnimplementedServiceMonitoringServiceServer) UpdateService(context.Context, *UpdateServiceRequest) (*Service, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateService not implemented") +} +func (UnimplementedServiceMonitoringServiceServer) DeleteService(context.Context, *DeleteServiceRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteService not implemented") +} +func (UnimplementedServiceMonitoringServiceServer) CreateServiceLevelObjective(context.Context, *CreateServiceLevelObjectiveRequest) (*ServiceLevelObjective, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateServiceLevelObjective not implemented") +} +func (UnimplementedServiceMonitoringServiceServer) GetServiceLevelObjective(context.Context, *GetServiceLevelObjectiveRequest) (*ServiceLevelObjective, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetServiceLevelObjective not implemented") +} +func (UnimplementedServiceMonitoringServiceServer) ListServiceLevelObjectives(context.Context, *ListServiceLevelObjectivesRequest) (*ListServiceLevelObjectivesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListServiceLevelObjectives not implemented") +} +func (UnimplementedServiceMonitoringServiceServer) UpdateServiceLevelObjective(context.Context, *UpdateServiceLevelObjectiveRequest) (*ServiceLevelObjective, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateServiceLevelObjective not implemented") +} +func (UnimplementedServiceMonitoringServiceServer) DeleteServiceLevelObjective(context.Context, *DeleteServiceLevelObjectiveRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteServiceLevelObjective not implemented") +} + +// UnsafeServiceMonitoringServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ServiceMonitoringServiceServer will +// result in compilation errors. +type UnsafeServiceMonitoringServiceServer interface { + mustEmbedUnimplementedServiceMonitoringServiceServer() +} + +func RegisterServiceMonitoringServiceServer(s grpc.ServiceRegistrar, srv ServiceMonitoringServiceServer) { + s.RegisterService(&ServiceMonitoringService_ServiceDesc, srv) +} + +func _ServiceMonitoringService_CreateService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateServiceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceMonitoringServiceServer).CreateService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ServiceMonitoringService_CreateService_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceMonitoringServiceServer).CreateService(ctx, req.(*CreateServiceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ServiceMonitoringService_GetService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetServiceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceMonitoringServiceServer).GetService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ServiceMonitoringService_GetService_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceMonitoringServiceServer).GetService(ctx, req.(*GetServiceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ServiceMonitoringService_ListServices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListServicesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceMonitoringServiceServer).ListServices(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ServiceMonitoringService_ListServices_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceMonitoringServiceServer).ListServices(ctx, req.(*ListServicesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ServiceMonitoringService_UpdateService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateServiceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceMonitoringServiceServer).UpdateService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ServiceMonitoringService_UpdateService_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceMonitoringServiceServer).UpdateService(ctx, req.(*UpdateServiceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ServiceMonitoringService_DeleteService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteServiceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceMonitoringServiceServer).DeleteService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ServiceMonitoringService_DeleteService_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceMonitoringServiceServer).DeleteService(ctx, req.(*DeleteServiceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ServiceMonitoringService_CreateServiceLevelObjective_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateServiceLevelObjectiveRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceMonitoringServiceServer).CreateServiceLevelObjective(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ServiceMonitoringService_CreateServiceLevelObjective_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceMonitoringServiceServer).CreateServiceLevelObjective(ctx, req.(*CreateServiceLevelObjectiveRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ServiceMonitoringService_GetServiceLevelObjective_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetServiceLevelObjectiveRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceMonitoringServiceServer).GetServiceLevelObjective(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ServiceMonitoringService_GetServiceLevelObjective_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceMonitoringServiceServer).GetServiceLevelObjective(ctx, req.(*GetServiceLevelObjectiveRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ServiceMonitoringService_ListServiceLevelObjectives_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListServiceLevelObjectivesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceMonitoringServiceServer).ListServiceLevelObjectives(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ServiceMonitoringService_ListServiceLevelObjectives_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceMonitoringServiceServer).ListServiceLevelObjectives(ctx, req.(*ListServiceLevelObjectivesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ServiceMonitoringService_UpdateServiceLevelObjective_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateServiceLevelObjectiveRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceMonitoringServiceServer).UpdateServiceLevelObjective(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ServiceMonitoringService_UpdateServiceLevelObjective_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceMonitoringServiceServer).UpdateServiceLevelObjective(ctx, req.(*UpdateServiceLevelObjectiveRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ServiceMonitoringService_DeleteServiceLevelObjective_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteServiceLevelObjectiveRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceMonitoringServiceServer).DeleteServiceLevelObjective(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ServiceMonitoringService_DeleteServiceLevelObjective_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceMonitoringServiceServer).DeleteServiceLevelObjective(ctx, req.(*DeleteServiceLevelObjectiveRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ServiceMonitoringService_ServiceDesc is the grpc.ServiceDesc for ServiceMonitoringService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ServiceMonitoringService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "google.monitoring.v3.ServiceMonitoringService", + HandlerType: (*ServiceMonitoringServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateService", + Handler: _ServiceMonitoringService_CreateService_Handler, + }, + { + MethodName: "GetService", + Handler: _ServiceMonitoringService_GetService_Handler, + }, + { + MethodName: "ListServices", + Handler: _ServiceMonitoringService_ListServices_Handler, + }, + { + MethodName: "UpdateService", + Handler: _ServiceMonitoringService_UpdateService_Handler, + }, + { + MethodName: "DeleteService", + Handler: _ServiceMonitoringService_DeleteService_Handler, + }, + { + MethodName: "CreateServiceLevelObjective", + Handler: _ServiceMonitoringService_CreateServiceLevelObjective_Handler, + }, + { + MethodName: "GetServiceLevelObjective", + Handler: _ServiceMonitoringService_GetServiceLevelObjective_Handler, + }, + { + MethodName: "ListServiceLevelObjectives", + Handler: _ServiceMonitoringService_ListServiceLevelObjectives_Handler, + }, + { + MethodName: "UpdateServiceLevelObjective", + Handler: _ServiceMonitoringService_UpdateServiceLevelObjective_Handler, + }, + { + MethodName: "DeleteServiceLevelObjective", + Handler: _ServiceMonitoringService_DeleteServiceLevelObjective_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/monitoring/v3/service_service.proto", +} diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze.pb.go index 861e045f2d4..39a2dc9f98e 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze.pb.go @@ -15,18 +15,17 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/monitoring/v3/snooze.proto package monitoringpb import ( - reflect "reflect" - sync "sync" - _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze_service.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze_service.pb.go index c562d60bcc7..094ab0d01e9 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze_service.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze_service.pb.go @@ -15,23 +15,18 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/monitoring/v3/snooze_service.proto package monitoringpb import ( - context "context" - reflect "reflect" - sync "sync" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" + reflect "reflect" + sync "sync" ) const ( @@ -587,207 +582,3 @@ func file_google_monitoring_v3_snooze_service_proto_init() { file_google_monitoring_v3_snooze_service_proto_goTypes = nil file_google_monitoring_v3_snooze_service_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// SnoozeServiceClient is the client API for SnoozeService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type SnoozeServiceClient interface { - // Creates a `Snooze` that will prevent alerts, which match the provided - // criteria, from being opened. The `Snooze` applies for a specific time - // interval. - CreateSnooze(ctx context.Context, in *CreateSnoozeRequest, opts ...grpc.CallOption) (*Snooze, error) - // Lists the `Snooze`s associated with a project. Can optionally pass in - // `filter`, which specifies predicates to match `Snooze`s. - ListSnoozes(ctx context.Context, in *ListSnoozesRequest, opts ...grpc.CallOption) (*ListSnoozesResponse, error) - // Retrieves a `Snooze` by `name`. - GetSnooze(ctx context.Context, in *GetSnoozeRequest, opts ...grpc.CallOption) (*Snooze, error) - // Updates a `Snooze`, identified by its `name`, with the parameters in the - // given `Snooze` object. - UpdateSnooze(ctx context.Context, in *UpdateSnoozeRequest, opts ...grpc.CallOption) (*Snooze, error) -} - -type snoozeServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewSnoozeServiceClient(cc grpc.ClientConnInterface) SnoozeServiceClient { - return &snoozeServiceClient{cc} -} - -func (c *snoozeServiceClient) CreateSnooze(ctx context.Context, in *CreateSnoozeRequest, opts ...grpc.CallOption) (*Snooze, error) { - out := new(Snooze) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.SnoozeService/CreateSnooze", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *snoozeServiceClient) ListSnoozes(ctx context.Context, in *ListSnoozesRequest, opts ...grpc.CallOption) (*ListSnoozesResponse, error) { - out := new(ListSnoozesResponse) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.SnoozeService/ListSnoozes", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *snoozeServiceClient) GetSnooze(ctx context.Context, in *GetSnoozeRequest, opts ...grpc.CallOption) (*Snooze, error) { - out := new(Snooze) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.SnoozeService/GetSnooze", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *snoozeServiceClient) UpdateSnooze(ctx context.Context, in *UpdateSnoozeRequest, opts ...grpc.CallOption) (*Snooze, error) { - out := new(Snooze) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.SnoozeService/UpdateSnooze", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// SnoozeServiceServer is the server API for SnoozeService service. -type SnoozeServiceServer interface { - // Creates a `Snooze` that will prevent alerts, which match the provided - // criteria, from being opened. The `Snooze` applies for a specific time - // interval. - CreateSnooze(context.Context, *CreateSnoozeRequest) (*Snooze, error) - // Lists the `Snooze`s associated with a project. Can optionally pass in - // `filter`, which specifies predicates to match `Snooze`s. - ListSnoozes(context.Context, *ListSnoozesRequest) (*ListSnoozesResponse, error) - // Retrieves a `Snooze` by `name`. - GetSnooze(context.Context, *GetSnoozeRequest) (*Snooze, error) - // Updates a `Snooze`, identified by its `name`, with the parameters in the - // given `Snooze` object. - UpdateSnooze(context.Context, *UpdateSnoozeRequest) (*Snooze, error) -} - -// UnimplementedSnoozeServiceServer can be embedded to have forward compatible implementations. -type UnimplementedSnoozeServiceServer struct { -} - -func (*UnimplementedSnoozeServiceServer) CreateSnooze(context.Context, *CreateSnoozeRequest) (*Snooze, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateSnooze not implemented") -} -func (*UnimplementedSnoozeServiceServer) ListSnoozes(context.Context, *ListSnoozesRequest) (*ListSnoozesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListSnoozes not implemented") -} -func (*UnimplementedSnoozeServiceServer) GetSnooze(context.Context, *GetSnoozeRequest) (*Snooze, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetSnooze not implemented") -} -func (*UnimplementedSnoozeServiceServer) UpdateSnooze(context.Context, *UpdateSnoozeRequest) (*Snooze, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateSnooze not implemented") -} - -func RegisterSnoozeServiceServer(s *grpc.Server, srv SnoozeServiceServer) { - s.RegisterService(&_SnoozeService_serviceDesc, srv) -} - -func _SnoozeService_CreateSnooze_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateSnoozeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SnoozeServiceServer).CreateSnooze(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.SnoozeService/CreateSnooze", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SnoozeServiceServer).CreateSnooze(ctx, req.(*CreateSnoozeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _SnoozeService_ListSnoozes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListSnoozesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SnoozeServiceServer).ListSnoozes(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.SnoozeService/ListSnoozes", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SnoozeServiceServer).ListSnoozes(ctx, req.(*ListSnoozesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _SnoozeService_GetSnooze_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetSnoozeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SnoozeServiceServer).GetSnooze(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.SnoozeService/GetSnooze", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SnoozeServiceServer).GetSnooze(ctx, req.(*GetSnoozeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _SnoozeService_UpdateSnooze_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateSnoozeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SnoozeServiceServer).UpdateSnooze(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.SnoozeService/UpdateSnooze", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SnoozeServiceServer).UpdateSnooze(ctx, req.(*UpdateSnoozeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _SnoozeService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "google.monitoring.v3.SnoozeService", - HandlerType: (*SnoozeServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "CreateSnooze", - Handler: _SnoozeService_CreateSnooze_Handler, - }, - { - MethodName: "ListSnoozes", - Handler: _SnoozeService_ListSnoozes_Handler, - }, - { - MethodName: "GetSnooze", - Handler: _SnoozeService_GetSnooze_Handler, - }, - { - MethodName: "UpdateSnooze", - Handler: _SnoozeService_UpdateSnooze_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "google/monitoring/v3/snooze_service.proto", -} diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze_service_grpc.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze_service_grpc.pb.go new file mode 100644 index 00000000000..0b7e4fa924c --- /dev/null +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/snooze_service_grpc.pb.go @@ -0,0 +1,248 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.7 +// source: google/monitoring/v3/snooze_service.proto + +package monitoringpb + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + SnoozeService_CreateSnooze_FullMethodName = "/google.monitoring.v3.SnoozeService/CreateSnooze" + SnoozeService_ListSnoozes_FullMethodName = "/google.monitoring.v3.SnoozeService/ListSnoozes" + SnoozeService_GetSnooze_FullMethodName = "/google.monitoring.v3.SnoozeService/GetSnooze" + SnoozeService_UpdateSnooze_FullMethodName = "/google.monitoring.v3.SnoozeService/UpdateSnooze" +) + +// SnoozeServiceClient is the client API for SnoozeService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type SnoozeServiceClient interface { + // Creates a `Snooze` that will prevent alerts, which match the provided + // criteria, from being opened. The `Snooze` applies for a specific time + // interval. + CreateSnooze(ctx context.Context, in *CreateSnoozeRequest, opts ...grpc.CallOption) (*Snooze, error) + // Lists the `Snooze`s associated with a project. Can optionally pass in + // `filter`, which specifies predicates to match `Snooze`s. + ListSnoozes(ctx context.Context, in *ListSnoozesRequest, opts ...grpc.CallOption) (*ListSnoozesResponse, error) + // Retrieves a `Snooze` by `name`. + GetSnooze(ctx context.Context, in *GetSnoozeRequest, opts ...grpc.CallOption) (*Snooze, error) + // Updates a `Snooze`, identified by its `name`, with the parameters in the + // given `Snooze` object. + UpdateSnooze(ctx context.Context, in *UpdateSnoozeRequest, opts ...grpc.CallOption) (*Snooze, error) +} + +type snoozeServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewSnoozeServiceClient(cc grpc.ClientConnInterface) SnoozeServiceClient { + return &snoozeServiceClient{cc} +} + +func (c *snoozeServiceClient) CreateSnooze(ctx context.Context, in *CreateSnoozeRequest, opts ...grpc.CallOption) (*Snooze, error) { + out := new(Snooze) + err := c.cc.Invoke(ctx, SnoozeService_CreateSnooze_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *snoozeServiceClient) ListSnoozes(ctx context.Context, in *ListSnoozesRequest, opts ...grpc.CallOption) (*ListSnoozesResponse, error) { + out := new(ListSnoozesResponse) + err := c.cc.Invoke(ctx, SnoozeService_ListSnoozes_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *snoozeServiceClient) GetSnooze(ctx context.Context, in *GetSnoozeRequest, opts ...grpc.CallOption) (*Snooze, error) { + out := new(Snooze) + err := c.cc.Invoke(ctx, SnoozeService_GetSnooze_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *snoozeServiceClient) UpdateSnooze(ctx context.Context, in *UpdateSnoozeRequest, opts ...grpc.CallOption) (*Snooze, error) { + out := new(Snooze) + err := c.cc.Invoke(ctx, SnoozeService_UpdateSnooze_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// SnoozeServiceServer is the server API for SnoozeService service. +// All implementations should embed UnimplementedSnoozeServiceServer +// for forward compatibility +type SnoozeServiceServer interface { + // Creates a `Snooze` that will prevent alerts, which match the provided + // criteria, from being opened. The `Snooze` applies for a specific time + // interval. + CreateSnooze(context.Context, *CreateSnoozeRequest) (*Snooze, error) + // Lists the `Snooze`s associated with a project. Can optionally pass in + // `filter`, which specifies predicates to match `Snooze`s. + ListSnoozes(context.Context, *ListSnoozesRequest) (*ListSnoozesResponse, error) + // Retrieves a `Snooze` by `name`. + GetSnooze(context.Context, *GetSnoozeRequest) (*Snooze, error) + // Updates a `Snooze`, identified by its `name`, with the parameters in the + // given `Snooze` object. + UpdateSnooze(context.Context, *UpdateSnoozeRequest) (*Snooze, error) +} + +// UnimplementedSnoozeServiceServer should be embedded to have forward compatible implementations. +type UnimplementedSnoozeServiceServer struct { +} + +func (UnimplementedSnoozeServiceServer) CreateSnooze(context.Context, *CreateSnoozeRequest) (*Snooze, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateSnooze not implemented") +} +func (UnimplementedSnoozeServiceServer) ListSnoozes(context.Context, *ListSnoozesRequest) (*ListSnoozesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListSnoozes not implemented") +} +func (UnimplementedSnoozeServiceServer) GetSnooze(context.Context, *GetSnoozeRequest) (*Snooze, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetSnooze not implemented") +} +func (UnimplementedSnoozeServiceServer) UpdateSnooze(context.Context, *UpdateSnoozeRequest) (*Snooze, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateSnooze not implemented") +} + +// UnsafeSnoozeServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to SnoozeServiceServer will +// result in compilation errors. +type UnsafeSnoozeServiceServer interface { + mustEmbedUnimplementedSnoozeServiceServer() +} + +func RegisterSnoozeServiceServer(s grpc.ServiceRegistrar, srv SnoozeServiceServer) { + s.RegisterService(&SnoozeService_ServiceDesc, srv) +} + +func _SnoozeService_CreateSnooze_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateSnoozeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SnoozeServiceServer).CreateSnooze(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SnoozeService_CreateSnooze_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SnoozeServiceServer).CreateSnooze(ctx, req.(*CreateSnoozeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SnoozeService_ListSnoozes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListSnoozesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SnoozeServiceServer).ListSnoozes(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SnoozeService_ListSnoozes_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SnoozeServiceServer).ListSnoozes(ctx, req.(*ListSnoozesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SnoozeService_GetSnooze_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetSnoozeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SnoozeServiceServer).GetSnooze(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SnoozeService_GetSnooze_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SnoozeServiceServer).GetSnooze(ctx, req.(*GetSnoozeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _SnoozeService_UpdateSnooze_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateSnoozeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SnoozeServiceServer).UpdateSnooze(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SnoozeService_UpdateSnooze_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SnoozeServiceServer).UpdateSnooze(ctx, req.(*UpdateSnoozeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// SnoozeService_ServiceDesc is the grpc.ServiceDesc for SnoozeService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var SnoozeService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "google.monitoring.v3.SnoozeService", + HandlerType: (*SnoozeServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateSnooze", + Handler: _SnoozeService_CreateSnooze_Handler, + }, + { + MethodName: "ListSnoozes", + Handler: _SnoozeService_ListSnoozes_Handler, + }, + { + MethodName: "GetSnooze", + Handler: _SnoozeService_GetSnooze_Handler, + }, + { + MethodName: "UpdateSnooze", + Handler: _SnoozeService_UpdateSnooze_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/monitoring/v3/snooze_service.proto", +} diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/span_context.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/span_context.pb.go index 23f42835f14..b9332612414 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/span_context.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/span_context.pb.go @@ -15,17 +15,16 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/monitoring/v3/span_context.proto package monitoringpb import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime.pb.go index f303ac25156..2e0fb6420a9 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime.pb.go @@ -15,20 +15,19 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/monitoring/v3/uptime.proto package monitoringpb import ( - reflect "reflect" - sync "sync" - _ "google.golang.org/genproto/googleapis/api/annotations" monitoredres "google.golang.org/genproto/googleapis/api/monitoredres" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" durationpb "google.golang.org/protobuf/types/known/durationpb" + reflect "reflect" + sync "sync" ) const ( diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime_service.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime_service.pb.go index 9ea159bbd2d..1ff646bc56a 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime_service.pb.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime_service.pb.go @@ -15,24 +15,19 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/monitoring/v3/uptime_service.proto package monitoringpb import ( - context "context" - reflect "reflect" - sync "sync" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" emptypb "google.golang.org/protobuf/types/known/emptypb" fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" + reflect "reflect" + sync "sync" ) const ( @@ -826,287 +821,3 @@ func file_google_monitoring_v3_uptime_service_proto_init() { file_google_monitoring_v3_uptime_service_proto_goTypes = nil file_google_monitoring_v3_uptime_service_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// UptimeCheckServiceClient is the client API for UptimeCheckService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type UptimeCheckServiceClient interface { - // Lists the existing valid Uptime check configurations for the project - // (leaving out any invalid configurations). - ListUptimeCheckConfigs(ctx context.Context, in *ListUptimeCheckConfigsRequest, opts ...grpc.CallOption) (*ListUptimeCheckConfigsResponse, error) - // Gets a single Uptime check configuration. - GetUptimeCheckConfig(ctx context.Context, in *GetUptimeCheckConfigRequest, opts ...grpc.CallOption) (*UptimeCheckConfig, error) - // Creates a new Uptime check configuration. - CreateUptimeCheckConfig(ctx context.Context, in *CreateUptimeCheckConfigRequest, opts ...grpc.CallOption) (*UptimeCheckConfig, error) - // Updates an Uptime check configuration. You can either replace the entire - // configuration with a new one or replace only certain fields in the current - // configuration by specifying the fields to be updated via `updateMask`. - // Returns the updated configuration. - UpdateUptimeCheckConfig(ctx context.Context, in *UpdateUptimeCheckConfigRequest, opts ...grpc.CallOption) (*UptimeCheckConfig, error) - // Deletes an Uptime check configuration. Note that this method will fail - // if the Uptime check configuration is referenced by an alert policy or - // other dependent configs that would be rendered invalid by the deletion. - DeleteUptimeCheckConfig(ctx context.Context, in *DeleteUptimeCheckConfigRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // Returns the list of IP addresses that checkers run from. - ListUptimeCheckIps(ctx context.Context, in *ListUptimeCheckIpsRequest, opts ...grpc.CallOption) (*ListUptimeCheckIpsResponse, error) -} - -type uptimeCheckServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewUptimeCheckServiceClient(cc grpc.ClientConnInterface) UptimeCheckServiceClient { - return &uptimeCheckServiceClient{cc} -} - -func (c *uptimeCheckServiceClient) ListUptimeCheckConfigs(ctx context.Context, in *ListUptimeCheckConfigsRequest, opts ...grpc.CallOption) (*ListUptimeCheckConfigsResponse, error) { - out := new(ListUptimeCheckConfigsResponse) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.UptimeCheckService/ListUptimeCheckConfigs", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *uptimeCheckServiceClient) GetUptimeCheckConfig(ctx context.Context, in *GetUptimeCheckConfigRequest, opts ...grpc.CallOption) (*UptimeCheckConfig, error) { - out := new(UptimeCheckConfig) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.UptimeCheckService/GetUptimeCheckConfig", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *uptimeCheckServiceClient) CreateUptimeCheckConfig(ctx context.Context, in *CreateUptimeCheckConfigRequest, opts ...grpc.CallOption) (*UptimeCheckConfig, error) { - out := new(UptimeCheckConfig) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.UptimeCheckService/CreateUptimeCheckConfig", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *uptimeCheckServiceClient) UpdateUptimeCheckConfig(ctx context.Context, in *UpdateUptimeCheckConfigRequest, opts ...grpc.CallOption) (*UptimeCheckConfig, error) { - out := new(UptimeCheckConfig) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.UptimeCheckService/UpdateUptimeCheckConfig", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *uptimeCheckServiceClient) DeleteUptimeCheckConfig(ctx context.Context, in *DeleteUptimeCheckConfigRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.UptimeCheckService/DeleteUptimeCheckConfig", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *uptimeCheckServiceClient) ListUptimeCheckIps(ctx context.Context, in *ListUptimeCheckIpsRequest, opts ...grpc.CallOption) (*ListUptimeCheckIpsResponse, error) { - out := new(ListUptimeCheckIpsResponse) - err := c.cc.Invoke(ctx, "/google.monitoring.v3.UptimeCheckService/ListUptimeCheckIps", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// UptimeCheckServiceServer is the server API for UptimeCheckService service. -type UptimeCheckServiceServer interface { - // Lists the existing valid Uptime check configurations for the project - // (leaving out any invalid configurations). - ListUptimeCheckConfigs(context.Context, *ListUptimeCheckConfigsRequest) (*ListUptimeCheckConfigsResponse, error) - // Gets a single Uptime check configuration. - GetUptimeCheckConfig(context.Context, *GetUptimeCheckConfigRequest) (*UptimeCheckConfig, error) - // Creates a new Uptime check configuration. - CreateUptimeCheckConfig(context.Context, *CreateUptimeCheckConfigRequest) (*UptimeCheckConfig, error) - // Updates an Uptime check configuration. You can either replace the entire - // configuration with a new one or replace only certain fields in the current - // configuration by specifying the fields to be updated via `updateMask`. - // Returns the updated configuration. - UpdateUptimeCheckConfig(context.Context, *UpdateUptimeCheckConfigRequest) (*UptimeCheckConfig, error) - // Deletes an Uptime check configuration. Note that this method will fail - // if the Uptime check configuration is referenced by an alert policy or - // other dependent configs that would be rendered invalid by the deletion. - DeleteUptimeCheckConfig(context.Context, *DeleteUptimeCheckConfigRequest) (*emptypb.Empty, error) - // Returns the list of IP addresses that checkers run from. - ListUptimeCheckIps(context.Context, *ListUptimeCheckIpsRequest) (*ListUptimeCheckIpsResponse, error) -} - -// UnimplementedUptimeCheckServiceServer can be embedded to have forward compatible implementations. -type UnimplementedUptimeCheckServiceServer struct { -} - -func (*UnimplementedUptimeCheckServiceServer) ListUptimeCheckConfigs(context.Context, *ListUptimeCheckConfigsRequest) (*ListUptimeCheckConfigsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListUptimeCheckConfigs not implemented") -} -func (*UnimplementedUptimeCheckServiceServer) GetUptimeCheckConfig(context.Context, *GetUptimeCheckConfigRequest) (*UptimeCheckConfig, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetUptimeCheckConfig not implemented") -} -func (*UnimplementedUptimeCheckServiceServer) CreateUptimeCheckConfig(context.Context, *CreateUptimeCheckConfigRequest) (*UptimeCheckConfig, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateUptimeCheckConfig not implemented") -} -func (*UnimplementedUptimeCheckServiceServer) UpdateUptimeCheckConfig(context.Context, *UpdateUptimeCheckConfigRequest) (*UptimeCheckConfig, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateUptimeCheckConfig not implemented") -} -func (*UnimplementedUptimeCheckServiceServer) DeleteUptimeCheckConfig(context.Context, *DeleteUptimeCheckConfigRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteUptimeCheckConfig not implemented") -} -func (*UnimplementedUptimeCheckServiceServer) ListUptimeCheckIps(context.Context, *ListUptimeCheckIpsRequest) (*ListUptimeCheckIpsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListUptimeCheckIps not implemented") -} - -func RegisterUptimeCheckServiceServer(s *grpc.Server, srv UptimeCheckServiceServer) { - s.RegisterService(&_UptimeCheckService_serviceDesc, srv) -} - -func _UptimeCheckService_ListUptimeCheckConfigs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListUptimeCheckConfigsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(UptimeCheckServiceServer).ListUptimeCheckConfigs(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.UptimeCheckService/ListUptimeCheckConfigs", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UptimeCheckServiceServer).ListUptimeCheckConfigs(ctx, req.(*ListUptimeCheckConfigsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _UptimeCheckService_GetUptimeCheckConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetUptimeCheckConfigRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(UptimeCheckServiceServer).GetUptimeCheckConfig(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.UptimeCheckService/GetUptimeCheckConfig", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UptimeCheckServiceServer).GetUptimeCheckConfig(ctx, req.(*GetUptimeCheckConfigRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _UptimeCheckService_CreateUptimeCheckConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateUptimeCheckConfigRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(UptimeCheckServiceServer).CreateUptimeCheckConfig(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.UptimeCheckService/CreateUptimeCheckConfig", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UptimeCheckServiceServer).CreateUptimeCheckConfig(ctx, req.(*CreateUptimeCheckConfigRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _UptimeCheckService_UpdateUptimeCheckConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateUptimeCheckConfigRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(UptimeCheckServiceServer).UpdateUptimeCheckConfig(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.UptimeCheckService/UpdateUptimeCheckConfig", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UptimeCheckServiceServer).UpdateUptimeCheckConfig(ctx, req.(*UpdateUptimeCheckConfigRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _UptimeCheckService_DeleteUptimeCheckConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteUptimeCheckConfigRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(UptimeCheckServiceServer).DeleteUptimeCheckConfig(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.UptimeCheckService/DeleteUptimeCheckConfig", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UptimeCheckServiceServer).DeleteUptimeCheckConfig(ctx, req.(*DeleteUptimeCheckConfigRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _UptimeCheckService_ListUptimeCheckIps_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListUptimeCheckIpsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(UptimeCheckServiceServer).ListUptimeCheckIps(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.monitoring.v3.UptimeCheckService/ListUptimeCheckIps", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UptimeCheckServiceServer).ListUptimeCheckIps(ctx, req.(*ListUptimeCheckIpsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _UptimeCheckService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "google.monitoring.v3.UptimeCheckService", - HandlerType: (*UptimeCheckServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListUptimeCheckConfigs", - Handler: _UptimeCheckService_ListUptimeCheckConfigs_Handler, - }, - { - MethodName: "GetUptimeCheckConfig", - Handler: _UptimeCheckService_GetUptimeCheckConfig_Handler, - }, - { - MethodName: "CreateUptimeCheckConfig", - Handler: _UptimeCheckService_CreateUptimeCheckConfig_Handler, - }, - { - MethodName: "UpdateUptimeCheckConfig", - Handler: _UptimeCheckService_UpdateUptimeCheckConfig_Handler, - }, - { - MethodName: "DeleteUptimeCheckConfig", - Handler: _UptimeCheckService_DeleteUptimeCheckConfig_Handler, - }, - { - MethodName: "ListUptimeCheckIps", - Handler: _UptimeCheckService_ListUptimeCheckIps_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "google/monitoring/v3/uptime_service.proto", -} diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime_service_grpc.pb.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime_service_grpc.pb.go new file mode 100644 index 00000000000..4fd7c67a3f9 --- /dev/null +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/monitoringpb/uptime_service_grpc.pb.go @@ -0,0 +1,331 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.7 +// source: google/monitoring/v3/uptime_service.proto + +package monitoringpb + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + UptimeCheckService_ListUptimeCheckConfigs_FullMethodName = "/google.monitoring.v3.UptimeCheckService/ListUptimeCheckConfigs" + UptimeCheckService_GetUptimeCheckConfig_FullMethodName = "/google.monitoring.v3.UptimeCheckService/GetUptimeCheckConfig" + UptimeCheckService_CreateUptimeCheckConfig_FullMethodName = "/google.monitoring.v3.UptimeCheckService/CreateUptimeCheckConfig" + UptimeCheckService_UpdateUptimeCheckConfig_FullMethodName = "/google.monitoring.v3.UptimeCheckService/UpdateUptimeCheckConfig" + UptimeCheckService_DeleteUptimeCheckConfig_FullMethodName = "/google.monitoring.v3.UptimeCheckService/DeleteUptimeCheckConfig" + UptimeCheckService_ListUptimeCheckIps_FullMethodName = "/google.monitoring.v3.UptimeCheckService/ListUptimeCheckIps" +) + +// UptimeCheckServiceClient is the client API for UptimeCheckService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type UptimeCheckServiceClient interface { + // Lists the existing valid Uptime check configurations for the project + // (leaving out any invalid configurations). + ListUptimeCheckConfigs(ctx context.Context, in *ListUptimeCheckConfigsRequest, opts ...grpc.CallOption) (*ListUptimeCheckConfigsResponse, error) + // Gets a single Uptime check configuration. + GetUptimeCheckConfig(ctx context.Context, in *GetUptimeCheckConfigRequest, opts ...grpc.CallOption) (*UptimeCheckConfig, error) + // Creates a new Uptime check configuration. + CreateUptimeCheckConfig(ctx context.Context, in *CreateUptimeCheckConfigRequest, opts ...grpc.CallOption) (*UptimeCheckConfig, error) + // Updates an Uptime check configuration. You can either replace the entire + // configuration with a new one or replace only certain fields in the current + // configuration by specifying the fields to be updated via `updateMask`. + // Returns the updated configuration. + UpdateUptimeCheckConfig(ctx context.Context, in *UpdateUptimeCheckConfigRequest, opts ...grpc.CallOption) (*UptimeCheckConfig, error) + // Deletes an Uptime check configuration. Note that this method will fail + // if the Uptime check configuration is referenced by an alert policy or + // other dependent configs that would be rendered invalid by the deletion. + DeleteUptimeCheckConfig(ctx context.Context, in *DeleteUptimeCheckConfigRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Returns the list of IP addresses that checkers run from. + ListUptimeCheckIps(ctx context.Context, in *ListUptimeCheckIpsRequest, opts ...grpc.CallOption) (*ListUptimeCheckIpsResponse, error) +} + +type uptimeCheckServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewUptimeCheckServiceClient(cc grpc.ClientConnInterface) UptimeCheckServiceClient { + return &uptimeCheckServiceClient{cc} +} + +func (c *uptimeCheckServiceClient) ListUptimeCheckConfigs(ctx context.Context, in *ListUptimeCheckConfigsRequest, opts ...grpc.CallOption) (*ListUptimeCheckConfigsResponse, error) { + out := new(ListUptimeCheckConfigsResponse) + err := c.cc.Invoke(ctx, UptimeCheckService_ListUptimeCheckConfigs_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *uptimeCheckServiceClient) GetUptimeCheckConfig(ctx context.Context, in *GetUptimeCheckConfigRequest, opts ...grpc.CallOption) (*UptimeCheckConfig, error) { + out := new(UptimeCheckConfig) + err := c.cc.Invoke(ctx, UptimeCheckService_GetUptimeCheckConfig_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *uptimeCheckServiceClient) CreateUptimeCheckConfig(ctx context.Context, in *CreateUptimeCheckConfigRequest, opts ...grpc.CallOption) (*UptimeCheckConfig, error) { + out := new(UptimeCheckConfig) + err := c.cc.Invoke(ctx, UptimeCheckService_CreateUptimeCheckConfig_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *uptimeCheckServiceClient) UpdateUptimeCheckConfig(ctx context.Context, in *UpdateUptimeCheckConfigRequest, opts ...grpc.CallOption) (*UptimeCheckConfig, error) { + out := new(UptimeCheckConfig) + err := c.cc.Invoke(ctx, UptimeCheckService_UpdateUptimeCheckConfig_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *uptimeCheckServiceClient) DeleteUptimeCheckConfig(ctx context.Context, in *DeleteUptimeCheckConfigRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, UptimeCheckService_DeleteUptimeCheckConfig_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *uptimeCheckServiceClient) ListUptimeCheckIps(ctx context.Context, in *ListUptimeCheckIpsRequest, opts ...grpc.CallOption) (*ListUptimeCheckIpsResponse, error) { + out := new(ListUptimeCheckIpsResponse) + err := c.cc.Invoke(ctx, UptimeCheckService_ListUptimeCheckIps_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// UptimeCheckServiceServer is the server API for UptimeCheckService service. +// All implementations should embed UnimplementedUptimeCheckServiceServer +// for forward compatibility +type UptimeCheckServiceServer interface { + // Lists the existing valid Uptime check configurations for the project + // (leaving out any invalid configurations). + ListUptimeCheckConfigs(context.Context, *ListUptimeCheckConfigsRequest) (*ListUptimeCheckConfigsResponse, error) + // Gets a single Uptime check configuration. + GetUptimeCheckConfig(context.Context, *GetUptimeCheckConfigRequest) (*UptimeCheckConfig, error) + // Creates a new Uptime check configuration. + CreateUptimeCheckConfig(context.Context, *CreateUptimeCheckConfigRequest) (*UptimeCheckConfig, error) + // Updates an Uptime check configuration. You can either replace the entire + // configuration with a new one or replace only certain fields in the current + // configuration by specifying the fields to be updated via `updateMask`. + // Returns the updated configuration. + UpdateUptimeCheckConfig(context.Context, *UpdateUptimeCheckConfigRequest) (*UptimeCheckConfig, error) + // Deletes an Uptime check configuration. Note that this method will fail + // if the Uptime check configuration is referenced by an alert policy or + // other dependent configs that would be rendered invalid by the deletion. + DeleteUptimeCheckConfig(context.Context, *DeleteUptimeCheckConfigRequest) (*emptypb.Empty, error) + // Returns the list of IP addresses that checkers run from. + ListUptimeCheckIps(context.Context, *ListUptimeCheckIpsRequest) (*ListUptimeCheckIpsResponse, error) +} + +// UnimplementedUptimeCheckServiceServer should be embedded to have forward compatible implementations. +type UnimplementedUptimeCheckServiceServer struct { +} + +func (UnimplementedUptimeCheckServiceServer) ListUptimeCheckConfigs(context.Context, *ListUptimeCheckConfigsRequest) (*ListUptimeCheckConfigsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListUptimeCheckConfigs not implemented") +} +func (UnimplementedUptimeCheckServiceServer) GetUptimeCheckConfig(context.Context, *GetUptimeCheckConfigRequest) (*UptimeCheckConfig, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUptimeCheckConfig not implemented") +} +func (UnimplementedUptimeCheckServiceServer) CreateUptimeCheckConfig(context.Context, *CreateUptimeCheckConfigRequest) (*UptimeCheckConfig, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateUptimeCheckConfig not implemented") +} +func (UnimplementedUptimeCheckServiceServer) UpdateUptimeCheckConfig(context.Context, *UpdateUptimeCheckConfigRequest) (*UptimeCheckConfig, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateUptimeCheckConfig not implemented") +} +func (UnimplementedUptimeCheckServiceServer) DeleteUptimeCheckConfig(context.Context, *DeleteUptimeCheckConfigRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteUptimeCheckConfig not implemented") +} +func (UnimplementedUptimeCheckServiceServer) ListUptimeCheckIps(context.Context, *ListUptimeCheckIpsRequest) (*ListUptimeCheckIpsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListUptimeCheckIps not implemented") +} + +// UnsafeUptimeCheckServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to UptimeCheckServiceServer will +// result in compilation errors. +type UnsafeUptimeCheckServiceServer interface { + mustEmbedUnimplementedUptimeCheckServiceServer() +} + +func RegisterUptimeCheckServiceServer(s grpc.ServiceRegistrar, srv UptimeCheckServiceServer) { + s.RegisterService(&UptimeCheckService_ServiceDesc, srv) +} + +func _UptimeCheckService_ListUptimeCheckConfigs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListUptimeCheckConfigsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UptimeCheckServiceServer).ListUptimeCheckConfigs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UptimeCheckService_ListUptimeCheckConfigs_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UptimeCheckServiceServer).ListUptimeCheckConfigs(ctx, req.(*ListUptimeCheckConfigsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UptimeCheckService_GetUptimeCheckConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUptimeCheckConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UptimeCheckServiceServer).GetUptimeCheckConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UptimeCheckService_GetUptimeCheckConfig_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UptimeCheckServiceServer).GetUptimeCheckConfig(ctx, req.(*GetUptimeCheckConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UptimeCheckService_CreateUptimeCheckConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateUptimeCheckConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UptimeCheckServiceServer).CreateUptimeCheckConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UptimeCheckService_CreateUptimeCheckConfig_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UptimeCheckServiceServer).CreateUptimeCheckConfig(ctx, req.(*CreateUptimeCheckConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UptimeCheckService_UpdateUptimeCheckConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateUptimeCheckConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UptimeCheckServiceServer).UpdateUptimeCheckConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UptimeCheckService_UpdateUptimeCheckConfig_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UptimeCheckServiceServer).UpdateUptimeCheckConfig(ctx, req.(*UpdateUptimeCheckConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UptimeCheckService_DeleteUptimeCheckConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteUptimeCheckConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UptimeCheckServiceServer).DeleteUptimeCheckConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UptimeCheckService_DeleteUptimeCheckConfig_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UptimeCheckServiceServer).DeleteUptimeCheckConfig(ctx, req.(*DeleteUptimeCheckConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UptimeCheckService_ListUptimeCheckIps_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListUptimeCheckIpsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UptimeCheckServiceServer).ListUptimeCheckIps(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UptimeCheckService_ListUptimeCheckIps_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UptimeCheckServiceServer).ListUptimeCheckIps(ctx, req.(*ListUptimeCheckIpsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// UptimeCheckService_ServiceDesc is the grpc.ServiceDesc for UptimeCheckService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var UptimeCheckService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "google.monitoring.v3.UptimeCheckService", + HandlerType: (*UptimeCheckServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListUptimeCheckConfigs", + Handler: _UptimeCheckService_ListUptimeCheckConfigs_Handler, + }, + { + MethodName: "GetUptimeCheckConfig", + Handler: _UptimeCheckService_GetUptimeCheckConfig_Handler, + }, + { + MethodName: "CreateUptimeCheckConfig", + Handler: _UptimeCheckService_CreateUptimeCheckConfig_Handler, + }, + { + MethodName: "UpdateUptimeCheckConfig", + Handler: _UptimeCheckService_UpdateUptimeCheckConfig_Handler, + }, + { + MethodName: "DeleteUptimeCheckConfig", + Handler: _UptimeCheckService_DeleteUptimeCheckConfig_Handler, + }, + { + MethodName: "ListUptimeCheckIps", + Handler: _UptimeCheckService_ListUptimeCheckIps_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "google/monitoring/v3/uptime_service.proto", +} diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/notification_channel_client.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/notification_channel_client.go index 3b36b219e53..6eac8ffe5ef 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/notification_channel_client.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/notification_channel_client.go @@ -381,7 +381,7 @@ func (c *notificationChannelGRPCClient) Connection() *grpc.ClientConn { // use by Google-written clients. func (c *notificationChannelGRPCClient) setGoogleClientInfo(keyval ...string) { kv := append([]string{"gl-go", gax.GoVersion}, keyval...) - kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version) + kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version, "pb", protoVersion) c.xGoogHeaders = []string{ "x-goog-api-client", gax.XGoogHeader(kv...), } diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/query_client.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/query_client.go index f792f2bd7e6..97fb19974d8 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/query_client.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/query_client.go @@ -183,7 +183,7 @@ func (c *queryGRPCClient) Connection() *grpc.ClientConn { // use by Google-written clients. func (c *queryGRPCClient) setGoogleClientInfo(keyval ...string) { kv := append([]string{"gl-go", gax.GoVersion}, keyval...) - kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version) + kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version, "pb", protoVersion) c.xGoogHeaders = []string{ "x-goog-api-client", gax.XGoogHeader(kv...), } diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/service_monitoring_client.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/service_monitoring_client.go index 7dc66e37307..580f76a2a29 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/service_monitoring_client.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/service_monitoring_client.go @@ -328,7 +328,7 @@ func (c *serviceMonitoringGRPCClient) Connection() *grpc.ClientConn { // use by Google-written clients. func (c *serviceMonitoringGRPCClient) setGoogleClientInfo(keyval ...string) { kv := append([]string{"gl-go", gax.GoVersion}, keyval...) - kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version) + kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version, "pb", protoVersion) c.xGoogHeaders = []string{ "x-goog-api-client", gax.XGoogHeader(kv...), } diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/snooze_client.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/snooze_client.go index 5b76a486bb1..52f36302fac 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/snooze_client.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/snooze_client.go @@ -234,7 +234,7 @@ func (c *snoozeGRPCClient) Connection() *grpc.ClientConn { // use by Google-written clients. func (c *snoozeGRPCClient) setGoogleClientInfo(keyval ...string) { kv := append([]string{"gl-go", gax.GoVersion}, keyval...) - kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version) + kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version, "pb", protoVersion) c.xGoogHeaders = []string{ "x-goog-api-client", gax.XGoogHeader(kv...), } diff --git a/vendor/cloud.google.com/go/monitoring/apiv3/v2/uptime_check_client.go b/vendor/cloud.google.com/go/monitoring/apiv3/v2/uptime_check_client.go index df0ec29575f..7e2aed8c800 100644 --- a/vendor/cloud.google.com/go/monitoring/apiv3/v2/uptime_check_client.go +++ b/vendor/cloud.google.com/go/monitoring/apiv3/v2/uptime_check_client.go @@ -284,7 +284,7 @@ func (c *uptimeCheckGRPCClient) Connection() *grpc.ClientConn { // use by Google-written clients. func (c *uptimeCheckGRPCClient) setGoogleClientInfo(keyval ...string) { kv := append([]string{"gl-go", gax.GoVersion}, keyval...) - kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version) + kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version, "pb", protoVersion) c.xGoogHeaders = []string{ "x-goog-api-client", gax.XGoogHeader(kv...), } diff --git a/vendor/cloud.google.com/go/monitoring/internal/version.go b/vendor/cloud.google.com/go/monitoring/internal/version.go index e199c1168a1..e68e8219435 100644 --- a/vendor/cloud.google.com/go/monitoring/internal/version.go +++ b/vendor/cloud.google.com/go/monitoring/internal/version.go @@ -15,4 +15,4 @@ package internal // Version is the current tagged release of the library. -const Version = "1.24.2" +const Version = "1.24.3" diff --git a/vendor/cloud.google.com/go/release-please-config-individual.json b/vendor/cloud.google.com/go/release-please-config-individual.json index 21785314983..32ea9f8208b 100644 --- a/vendor/cloud.google.com/go/release-please-config-individual.json +++ b/vendor/cloud.google.com/go/release-please-config-individual.json @@ -12,12 +12,8 @@ "component": "auth/oauth2adapt" }, "bigquery": { - "component": "bigquery" - }, - "bigquery/v2": { - "component": "bigquery/v2", - "prerelease": true, - "prerelease-type": "alpha" + "component": "bigquery", + "exclude-paths": ["bigquery/v2"] }, "bigtable": { "component": "bigtable" @@ -38,7 +34,8 @@ "component": "profiler" }, "pubsub": { - "component": "pubsub" + "component": "pubsub", + "exclude-paths": ["pubsub/v2"] }, "pubsub/v2": { "component": "pubsub/v2" diff --git a/vendor/cloud.google.com/go/release-please-config-yoshi-submodules.json b/vendor/cloud.google.com/go/release-please-config-yoshi-submodules.json index f4e9d103d69..a0b13db0253 100644 --- a/vendor/cloud.google.com/go/release-please-config-yoshi-submodules.json +++ b/vendor/cloud.google.com/go/release-please-config-yoshi-submodules.json @@ -81,6 +81,9 @@ "binaryauthorization": { "component": "binaryauthorization" }, + "capacityplanner": { + "component": "capacityplanner" + }, "certificatemanager": { "component": "certificatemanager" }, @@ -180,9 +183,6 @@ "discoveryengine": { "component": "discoveryengine" }, - "dlp": { - "component": "dlp" - }, "documentai": { "component": "documentai" }, @@ -210,6 +210,9 @@ "functions": { "component": "functions" }, + "geminidataanalytics": { + "component": "geminidataanalytics" + }, "gkebackup": { "component": "gkebackup" }, @@ -255,6 +258,9 @@ "lifesciences": { "component": "lifesciences" }, + "locationfinder": { + "component": "locationfinder" + }, "longrunning": { "component": "longrunning" }, diff --git a/vendor/cloud.google.com/go/storage/.repo-metadata.json b/vendor/cloud.google.com/go/storage/.repo-metadata.json new file mode 100644 index 00000000000..3eed725e335 --- /dev/null +++ b/vendor/cloud.google.com/go/storage/.repo-metadata.json @@ -0,0 +1,10 @@ +{ + "api_shortname": "storage", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/storage/latest", + "client_library_type": "manual", + "description": "Cloud Storage (GCS)", + "distribution_name": "cloud.google.com/go/storage", + "language": "go", + "library_type": "GAPIC_MANUAL", + "release_level": "stable" +} diff --git a/vendor/cloud.google.com/go/storage/CHANGES.md b/vendor/cloud.google.com/go/storage/CHANGES.md index c4872fbebb9..2490359359d 100644 --- a/vendor/cloud.google.com/go/storage/CHANGES.md +++ b/vendor/cloud.google.com/go/storage/CHANGES.md @@ -1,6 +1,40 @@ # Changes +## [1.58.0](https://github.com/googleapis/google-cloud-go/releases/tag/storage%2Fv1.58.0) (2025-12-03) + +### Features + +* calculate crc32c by default and pass checksum in trailing and per-chunk request (#13205) ([2ab1c77](https://github.com/googleapis/google-cloud-go/commit/2ab1c77826f2d9c9d02b977296a78cf0ba3bd8bf)) +* add support for partial success in ListBuckets (#13320) ([d91e47f](https://github.com/googleapis/google-cloud-go/commit/d91e47f2fc91a95ad4fd54e574b371e172a3889b)) +* add object contexts in Go GCS SDK (#13390) ([079c4d9](https://github.com/googleapis/google-cloud-go/commit/079c4d960a2bafa5d170e2b1c97b00ea8b7917d9)) + +### Bug Fixes + +* omit empty filter in http list object request (#13434) ([377eb13](https://github.com/googleapis/google-cloud-go/commit/377eb13bbadb4f455fac61c500f50ba9057890d4)) + +## [1.57.2](https://github.com/googleapis/google-cloud-go/releases/tag/storage%2Fv1.57.2) (2025-11-14) + +### Bug Fixes + +* Handle redirect on takeover. (#13354) ([b0f1362](https://github.com/googleapis/google-cloud-go/commit/b0f136268be1e4c629e288353bc277549ac5c663)) +* add env var to allow disabling bound token (#13236) ([cdaf6a6](https://github.com/googleapis/google-cloud-go/commit/cdaf6a6da006a19db932a74885ea3722b4e42311)) + +### Documentation + +* updates to docs and docs formatting ([93ca68d](https://github.com/googleapis/google-cloud-go/commit/93ca68d54b6d213f22e0d67ae01d135cf26d37c6)) + +## [1.57.1](https://github.com/googleapis/google-cloud-go/compare/storage/v1.57.0...storage/v1.57.1) (2025-10-28) + + +### Bug Fixes +* **storage:** Takeover idempotence ([#13230](https://github.com/googleapis/google-cloud-go/issues/13230)) ([cc5d2a1](https://github.com/googleapis/google-cloud-go/commit/cc5d2a12293a509a14da9bea8a86c8655eaf4a71)) +* **storage:** Copy metadata when using Copier with grpc ([#12919](https://github.com/googleapis/google-cloud-go/issues/12919)) ([57a2e80](https://github.com/googleapis/google-cloud-go/commit/57a2e804f690ec8d4c55fd1c73b0dafd5cff46e5)) +* **storage:** Fix takeover response handling ([#13239](https://github.com/googleapis/google-cloud-go/issues/13239)) ([26d75bc](https://github.com/googleapis/google-cloud-go/commit/26d75bc08e242348d26691877aba7fa68cf30f7f)) +* **storage:** Remove default timeout for gRPC operations ([#13022](https://github.com/googleapis/google-cloud-go/issues/13022)) ([b94c3ba](https://github.com/googleapis/google-cloud-go/commit/b94c3ba69994d9c56ae8f302449dd8df6f287296)) +* **storage:** Skip download of file outside of target dir ([#12945](https://github.com/googleapis/google-cloud-go/issues/12945)) ([6259aee](https://github.com/googleapis/google-cloud-go/commit/6259aeec393d0d996961cac38396daa57ad1a290)) +* **storage:** Upgrade gRPC service registration func ([8fffca2](https://github.com/googleapis/google-cloud-go/commit/8fffca2819fa3dc858c213aa0c503e0df331b084)) + ## [1.57.0](https://github.com/googleapis/google-cloud-go/compare/storage/v1.56.1...storage/v1.57.0) (2025-09-23) diff --git a/vendor/cloud.google.com/go/storage/bucket.go b/vendor/cloud.google.com/go/storage/bucket.go index a8e56ed1737..509d8693cfa 100644 --- a/vendor/cloud.google.com/go/storage/bucket.go +++ b/vendor/cloud.google.com/go/storage/bucket.go @@ -2331,6 +2331,11 @@ func (it *ObjectIterator) Next() (*ObjectAttrs, error) { // whose names begin with the prefix. By default, all buckets in the project // are returned. // +// To receive a partial list of buckets when some are unavailable, set the +// iterator's ReturnPartialSuccess field to true. You can then call the +// iterator's Unreachable method to retrieve the names of the unreachable +// buckets. +// // Note: The returned iterator is not safe for concurrent operations without explicit synchronization. func (c *Client) Buckets(ctx context.Context, projectID string) *BucketIterator { o := makeStorageOpts(true, c.retry, "") @@ -2343,12 +2348,24 @@ func (c *Client) Buckets(ctx context.Context, projectID string) *BucketIterator type BucketIterator struct { // Prefix restricts the iterator to buckets whose names begin with it. Prefix string - - ctx context.Context - projectID string - buckets []*BucketAttrs - pageInfo *iterator.PageInfo - nextFunc func() error + // If true, the iterator will return a partial result of buckets even if + // some buckets are unreachable. Call the Unreachable() method to retrieve the + // list of unreachable buckets. By default (false), the iterator will return + // an error if any buckets are unreachable. + ReturnPartialSuccess bool + + ctx context.Context + projectID string + buckets []*BucketAttrs + unreachable []string + pageInfo *iterator.PageInfo + nextFunc func() error +} + +// Unreachable returns a list of bucket names that could not be reached +// during the iteration if ReturnPartialSuccess was set to true. +func (it *BucketIterator) Unreachable() []string { + return it.unreachable } // Next returns the next result. Its second return value is iterator.Done if diff --git a/vendor/cloud.google.com/go/storage/client.go b/vendor/cloud.google.com/go/storage/client.go index 3e4aceaeb0c..8af94b902ac 100644 --- a/vendor/cloud.google.com/go/storage/client.go +++ b/vendor/cloud.google.com/go/storage/client.go @@ -265,6 +265,9 @@ type openWriterParams struct { // sendCRC32C - see `Writer.SendCRC32C`. // Optional. sendCRC32C bool + // disableAutoChecksum - see `Writer.DisableAutoChecksum`. + // Optional. + disableAutoChecksum bool // append - Write with appendable object semantics. // Optional. append bool diff --git a/vendor/cloud.google.com/go/storage/contexts.go b/vendor/cloud.google.com/go/storage/contexts.go new file mode 100644 index 00000000000..06ace64a55b --- /dev/null +++ b/vendor/cloud.google.com/go/storage/contexts.go @@ -0,0 +1,115 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package storage + +import ( + "time" + + "cloud.google.com/go/storage/internal/apiv2/storagepb" + raw "google.golang.org/api/storage/v1" +) + +// ObjectContexts is a container for custom object contexts. +type ObjectContexts struct { + Custom map[string]ObjectCustomContextPayload +} + +// ObjectCustomContextPayload holds the value of a user-defined object context and +// other metadata. To delete a key from Custom object contexts, set Delete as true. +type ObjectCustomContextPayload struct { + Value string + Delete bool + // Read-only fields. Any updates to CreateTime and UpdateTime will be ignored. + // These fields are handled by the server. + CreateTime time.Time + UpdateTime time.Time +} + +// toContexts converts the raw library's ObjectContexts type to the object contexts. +func toObjectContexts(c *raw.ObjectContexts) *ObjectContexts { + if c == nil { + return nil + } + customContexts := make(map[string]ObjectCustomContextPayload, len(c.Custom)) + for k, v := range c.Custom { + customContexts[k] = ObjectCustomContextPayload{ + Value: v.Value, + CreateTime: convertTime(v.CreateTime), + UpdateTime: convertTime(v.UpdateTime), + } + } + return &ObjectContexts{ + Custom: customContexts, + } +} + +// toRawObjectContexts converts the object contexts to the raw library's ObjectContexts type. +func toRawObjectContexts(c *ObjectContexts) *raw.ObjectContexts { + if c == nil { + return nil + } + customContexts := make(map[string]raw.ObjectCustomContextPayload) + for k, v := range c.Custom { + if v.Delete { + // If Delete is true, populate null fields to signify deletion. + customContexts[k] = raw.ObjectCustomContextPayload{NullFields: []string{k}} + } else { + customContexts[k] = raw.ObjectCustomContextPayload{ + Value: v.Value, + ForceSendFields: []string{k}, + } + } + } + return &raw.ObjectContexts{ + Custom: customContexts, + } +} + +func toObjectContextsFromProto(c *storagepb.ObjectContexts) *ObjectContexts { + if c == nil { + return nil + } + customContexts := make(map[string]ObjectCustomContextPayload, len(c.GetCustom())) + for k, v := range c.GetCustom() { + customContexts[k] = ObjectCustomContextPayload{ + Value: v.GetValue(), + CreateTime: v.GetCreateTime().AsTime(), + UpdateTime: v.GetUpdateTime().AsTime(), + } + } + return &ObjectContexts{ + Custom: customContexts, + } +} + +func toProtoObjectContexts(c *ObjectContexts) *storagepb.ObjectContexts { + if c == nil { + return nil + } + customContexts := make(map[string]*storagepb.ObjectCustomContextPayload) + for k, v := range c.Custom { + // To delete a key, it is added to gRPC fieldMask and with an empty value + // in gRPC request body. Hence, the key is skipped here in customContexts map. + // See grpcStorageClient.UpdateObject method for more details. + if !v.Delete { + customContexts[k] = &storagepb.ObjectCustomContextPayload{ + Value: v.Value, + } + } + } + return &storagepb.ObjectContexts{ + Custom: customContexts, + } +} diff --git a/vendor/cloud.google.com/go/storage/copy.go b/vendor/cloud.google.com/go/storage/copy.go index a0b9a2683c7..d10e377ffe5 100644 --- a/vendor/cloud.google.com/go/storage/copy.go +++ b/vendor/cloud.google.com/go/storage/copy.go @@ -18,8 +18,6 @@ import ( "context" "errors" "fmt" - - "cloud.google.com/go/internal/trace" ) // CopierFrom creates a Copier that can copy src to dst. @@ -82,8 +80,8 @@ type Copier struct { // Run performs the copy. func (c *Copier) Run(ctx context.Context) (attrs *ObjectAttrs, err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.Copier.Run") - defer func() { trace.EndSpan(ctx, err) }() + ctx, _ = startSpan(ctx, "Copier.Run") + defer func() { endSpan(ctx, err) }() if err := c.src.validate(); err != nil { return nil, err @@ -180,8 +178,8 @@ type Composer struct { // Run performs the compose operation. func (c *Composer) Run(ctx context.Context) (attrs *ObjectAttrs, err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.Composer.Run") - defer func() { trace.EndSpan(ctx, err) }() + ctx, _ = startSpan(ctx, "Composer.Run") + defer func() { endSpan(ctx, err) }() if err := c.dst.validate(); err != nil { return nil, err diff --git a/vendor/cloud.google.com/go/storage/grpc_client.go b/vendor/cloud.google.com/go/storage/grpc_client.go index 15de38df7ae..7dc3d0a189c 100644 --- a/vendor/cloud.google.com/go/storage/grpc_client.go +++ b/vendor/cloud.google.com/go/storage/grpc_client.go @@ -23,10 +23,10 @@ import ( "io" "log" "os" + "strconv" "sync" "cloud.google.com/go/iam/apiv1/iampb" - "cloud.google.com/go/internal/trace" gapic "cloud.google.com/go/storage/internal/apiv2" "cloud.google.com/go/storage/internal/apiv2/storagepb" "github.com/googleapis/gax-go/v2" @@ -102,8 +102,10 @@ func defaultGRPCOptions() []option.ClientOption { defaults = append(defaults, internaloption.AllowNonDefaultServiceAccount(true), internaloption.EnableDirectPath(true), - internaloption.EnableDirectPathXds(), - internaloption.AllowHardBoundTokens("ALTS")) + internaloption.EnableDirectPathXds()) + if disableBoundToken, _ := strconv.ParseBool(os.Getenv("STORAGE_DISABLE_DIRECTPATH_BOUND_TOKEN")); !disableBoundToken { + defaults = append(defaults, internaloption.AllowHardBoundTokens("ALTS")) + } } return defaults @@ -143,7 +145,7 @@ func newGRPCStorageClient(ctx context.Context, opts ...storageOption) (*grpcStor s := initSettings(opts...) s.clientOption = append(defaultGRPCOptions(), s.clientOption...) // Disable all gax-level retries in favor of retry logic in the veneer client. - s.gax = append(s.gax, gax.WithRetry(nil)) + s.gax = append(s.gax, gax.WithRetry(nil), gax.WithTimeout(0)) config := newStorageConfig(s.clientOption...) if config.readAPIWasSet { @@ -243,8 +245,9 @@ func (c *grpcStorageClient) ListBuckets(ctx context.Context, project string, opt // BucketIterator is returned to them from the veneer. if pageToken == "" { req := &storagepb.ListBucketsRequest{ - Parent: toProjectResource(it.projectID), - Prefix: it.Prefix, + Parent: toProjectResource(it.projectID), + Prefix: it.Prefix, + ReturnPartialSuccess: it.ReturnPartialSuccess, } gitr = c.raw.ListBuckets(ctx, req, s.gax...) } @@ -260,6 +263,9 @@ func (c *grpcStorageClient) ListBuckets(ctx context.Context, project string, opt it.buckets = append(it.buckets, b) } + if resp, ok := gitr.Response.(*storagepb.ListBucketsResponse); ok { + it.unreachable = resp.Unreachable + } return next, nil } it.pageInfo, it.nextFunc = iterator.NewPageInfo( @@ -454,6 +460,7 @@ func (c *grpcStorageClient) ListObjects(ctx context.Context, bucket string, q *Q ReadMask: q.toFieldMask(), // a nil Query still results in a "*" FieldMask SoftDeleted: it.query.SoftDeleted, IncludeFoldersAsPrefixes: it.query.IncludeFoldersAsPrefixes, + Filter: it.query.Filter, } if s.userProject != "" { ctx = setUserProjectMetadata(ctx, s.userProject) @@ -624,6 +631,18 @@ func (c *grpcStorageClient) UpdateObject(ctx context.Context, params *updateObje } } + if uattrs.Contexts != nil && uattrs.Contexts.Custom != nil { + if len(uattrs.Contexts.Custom) == 0 { + // pass fieldMask with no key value and empty map to delete all keys + fieldMask.Paths = append(fieldMask.Paths, "contexts.custom") + } else { + for key := range uattrs.Contexts.Custom { + // pass fieldMask with key value with empty value in map to delete key + fieldMask.Paths = append(fieldMask.Paths, fmt.Sprintf("contexts.custom.%s", key)) + } + } + } + req.UpdateMask = fieldMask if len(fieldMask.Paths) < 1 { @@ -953,14 +972,24 @@ func (c *grpcStorageClient) ComposeObject(ctx context.Context, req *composeObjec } func (c *grpcStorageClient) RewriteObject(ctx context.Context, req *rewriteObjectRequest, opts ...storageOption) (*rewriteObjectResponse, error) { s := callSettings(c.settings, opts...) - obj := req.dstObject.attrs.toProtoObject("") + + var dst *storagepb.Object + // If the destination object attributes are not set, do not include them + // in the request. This indicates that the object attributes should be + // copied from the source object. + if req.dstObject.attrs.isZero() { + dst = nil + } else { + dst = req.dstObject.attrs.toProtoObject("") + } + call := &storagepb.RewriteObjectRequest{ SourceBucket: bucketResourceName(globalProjectAlias, req.srcObject.bucket), SourceObject: req.srcObject.name, RewriteToken: req.token, DestinationBucket: bucketResourceName(globalProjectAlias, req.dstObject.bucket), DestinationName: req.dstObject.name, - Destination: obj, + Destination: dst, DestinationKmsKey: req.dstObject.keyName, DestinationPredefinedAcl: req.predefinedACL, CommonObjectRequestParams: toProtoCommonObjectRequestParams(req.dstObject.encryptionKey), @@ -1069,8 +1098,8 @@ func (c *grpcStorageClient) NewMultiRangeDownloader(ctx context.Context, params return nil, errors.New("storage: MultiRangeDownloader requires the experimental.WithGRPCBidiReads option") } - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.grpcStorageClient.NewMultiRangeDownloader") - defer func() { trace.EndSpan(ctx, err) }() + ctx, _ = startSpan(ctx, "grpcStorageClient.NewMultiRangeDownloader") + defer func() { endSpan(ctx, err) }() s := callSettings(c.settings, opts...) // Force the use of the custom codec to enable zero-copy reads. s.gax = append(s.gax, gax.WithGRPCOptions( @@ -1614,8 +1643,8 @@ func (c *grpcStorageClient) NewRangeReader(ctx context.Context, params *newRange return c.NewRangeReaderReadObject(ctx, params, opts...) } - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.grpcStorageClient.NewRangeReader") - defer func() { trace.EndSpan(ctx, err) }() + ctx, _ = startSpan(ctx, "grpcStorageClient.NewRangeReader") + defer func() { endSpan(ctx, err) }() s := callSettings(c.settings, opts...) diff --git a/vendor/cloud.google.com/go/storage/grpc_reader.go b/vendor/cloud.google.com/go/storage/grpc_reader.go index 14ec5048d8f..0fd848cad6a 100644 --- a/vendor/cloud.google.com/go/storage/grpc_reader.go +++ b/vendor/cloud.google.com/go/storage/grpc_reader.go @@ -22,7 +22,6 @@ import ( "hash/crc32" "io" - "cloud.google.com/go/internal/trace" "cloud.google.com/go/storage/internal/apiv2/storagepb" "github.com/googleapis/gax-go/v2" "google.golang.org/grpc" @@ -83,8 +82,8 @@ func (bytesCodecReadObject) Name() string { // NewRangeReaderReadObject is the legacy (non-bidi) implementation of reads. func (c *grpcStorageClient) NewRangeReaderReadObject(ctx context.Context, params *newRangeReaderParams, opts ...storageOption) (r *Reader, err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.grpcStorageClient.NewRangeReaderReadObject") - defer func() { trace.EndSpan(ctx, err) }() + ctx, _ = startSpan(ctx, "grpcStorageClient.NewRangeReaderReadObject") + defer func() { endSpan(ctx, err) }() s := callSettings(c.settings, opts...) diff --git a/vendor/cloud.google.com/go/storage/grpc_writer.go b/vendor/cloud.google.com/go/storage/grpc_writer.go index b4fa4c855c4..2af970ecb83 100644 --- a/vendor/cloud.google.com/go/storage/grpc_writer.go +++ b/vendor/cloud.google.com/go/storage/grpc_writer.go @@ -18,6 +18,7 @@ import ( "context" "errors" "fmt" + "hash/crc32" "io" "net/http" "net/url" @@ -51,6 +52,10 @@ func (w *gRPCWriter) Write(p []byte) (n int, err error) { case <-w.donec: return 0, w.streamResult case w.writesChan <- cmd: + // update fullObjectChecksum on every write and send it on finalWrite + if !w.disableAutoChecksum { + w.fullObjectChecksum = crc32.Update(w.fullObjectChecksum, crc32cTable, p) + } // write command successfully delivered to sender. We no longer own cmd. break } @@ -170,6 +175,7 @@ func (c *grpcStorageClient) OpenWriter(params *openWriterParams, opts ...storage flushSupported: params.append, sendCRC32C: params.sendCRC32C, + disableAutoChecksum: params.disableAutoChecksum, forceOneShot: params.chunkSize <= 0, forceEmptyContentType: params.forceEmptyContentType, append: params.append, @@ -239,8 +245,11 @@ type gRPCWriter struct { setSize func(int64) setTakeoverOffset func(int64) + fullObjectChecksum uint32 + flushSupported bool sendCRC32C bool + disableAutoChecksum bool forceOneShot bool forceEmptyContentType bool append bool @@ -785,25 +794,62 @@ func completion(r *storagepb.BidiWriteObjectResponse) *gRPCBidiWriteCompletion { } } -func bidiWriteObjectRequest(buf []byte, offset int64, flush, finishWrite bool) *storagepb.BidiWriteObjectRequest { +// Server contract expects full object checksum to be sent only on first or last write. +// Checksums of full object are already being sent on first Write during initialization of sender. +// Send objectChecksums only on final request and nil in other cases. +func bidiWriteObjectRequest(r gRPCBidiWriteRequest, bufChecksum *uint32, objectChecksums *storagepb.ObjectChecksums) *storagepb.BidiWriteObjectRequest { var data *storagepb.BidiWriteObjectRequest_ChecksummedData - if buf != nil { + if r.buf != nil { data = &storagepb.BidiWriteObjectRequest_ChecksummedData{ ChecksummedData: &storagepb.ChecksummedData{ - Content: buf, + Content: r.buf, + Crc32C: bufChecksum, }, } } req := &storagepb.BidiWriteObjectRequest{ - Data: data, - WriteOffset: offset, - FinishWrite: finishWrite, - Flush: flush, - StateLookup: flush, + Data: data, + WriteOffset: r.offset, + FinishWrite: r.finishWrite, + Flush: r.flush, + StateLookup: r.flush, + ObjectChecksums: objectChecksums, } return req } +type getObjectChecksumsParams struct { + fullObjectChecksum func() uint32 + finishWrite bool + sendCRC32C bool + disableAutoChecksum bool + attrs *ObjectAttrs +} + +// getObjectChecksums determines what checksum information to include in the final +// gRPC request +// +// function returns a populated ObjectChecksums only when finishWrite is true +// If CRC32C is disabled, it returns the user-provided checksum if available. +// If CRC32C is enabled, it returns the user-provided checksum if available, +// or the computed checksum of the entire object. +func getObjectChecksums(params *getObjectChecksumsParams) *storagepb.ObjectChecksums { + if !params.finishWrite { + return nil + } + + // send user's checksum on last write op if available + if params.sendCRC32C { + return toProtoChecksums(params.sendCRC32C, params.attrs) + } + if params.disableAutoChecksum { + return nil + } + return &storagepb.ObjectChecksums{ + Crc32C: proto.Uint32(params.fullObjectChecksum()), + } +} + type gRPCBidiWriteBufferSender interface { // connect implementations may attempt to establish a connection for issuing // writes. @@ -832,6 +878,9 @@ type gRPCOneshotBidiWriteBufferSender struct { bucket string firstMessage *storagepb.BidiWriteObjectRequest streamErr error + + checksumSettings func() (bool, bool, *ObjectAttrs) + fullObjectChecksum func() uint32 } func (w *gRPCWriter) newGRPCOneshotBidiWriteBufferSender() *gRPCOneshotBidiWriteBufferSender { @@ -843,11 +892,13 @@ func (w *gRPCWriter) newGRPCOneshotBidiWriteBufferSender() *gRPCOneshotBidiWrite WriteObjectSpec: w.spec, }, CommonObjectRequestParams: toProtoCommonObjectRequestParams(w.encryptionKey), - // For a non-resumable upload, checksums must be sent in this message. - // TODO: Currently the checksums are only sent on the first message - // of the stream, but in the future, we must also support sending it - // on the *last* message of the stream (instead of the first). - ObjectChecksums: toProtoChecksums(w.sendCRC32C, w.attrs), + ObjectChecksums: toProtoChecksums(w.sendCRC32C, w.attrs), + }, + checksumSettings: func() (bool, bool, *ObjectAttrs) { + return w.sendCRC32C, w.disableAutoChecksum, w.attrs + }, + fullObjectChecksum: func() uint32 { + return w.fullObjectChecksum }, } } @@ -888,7 +939,20 @@ func (s *gRPCOneshotBidiWriteBufferSender) connect(ctx context.Context, cs gRPCB continue } - req := bidiWriteObjectRequest(r.buf, r.offset, r.flush, r.finishWrite) + sendCrc32C, disableAutoChecksum, attrs := s.checksumSettings() + var bufChecksum *uint32 + if !disableAutoChecksum { + bufChecksum = proto.Uint32(crc32.Checksum(r.buf, crc32cTable)) + } + objectChecksums := getObjectChecksums(&getObjectChecksumsParams{ + fullObjectChecksum: s.fullObjectChecksum, + finishWrite: r.finishWrite, + sendCRC32C: sendCrc32C, + disableAutoChecksum: disableAutoChecksum, + attrs: attrs, + }) + req := bidiWriteObjectRequest(r, bufChecksum, objectChecksums) + if firstSend { proto.Merge(req, s.firstMessage) firstSend = false @@ -932,6 +996,9 @@ type gRPCResumableBidiWriteBufferSender struct { startWriteRequest *storagepb.StartResumableWriteRequest upid string + checksumSettings func() (bool, bool, *ObjectAttrs) + fullObjectChecksum func() uint32 + streamErr error } @@ -942,10 +1009,13 @@ func (w *gRPCWriter) newGRPCResumableBidiWriteBufferSender() *gRPCResumableBidiW startWriteRequest: &storagepb.StartResumableWriteRequest{ WriteObjectSpec: w.spec, CommonObjectRequestParams: toProtoCommonObjectRequestParams(w.encryptionKey), - // TODO: Currently the checksums are only sent on the request to initialize - // the upload, but in the future, we must also support sending it - // on the *last* message of the stream. - ObjectChecksums: toProtoChecksums(w.sendCRC32C, w.attrs), + ObjectChecksums: toProtoChecksums(w.sendCRC32C, w.attrs), + }, + checksumSettings: func() (bool, bool, *ObjectAttrs) { + return w.sendCRC32C, w.disableAutoChecksum, w.attrs + }, + fullObjectChecksum: func() uint32 { + return w.fullObjectChecksum }, } } @@ -1005,7 +1075,21 @@ func (s *gRPCResumableBidiWriteBufferSender) connect(ctx context.Context, cs gRP cs.requestAcks <- struct{}{} continue } - req := bidiWriteObjectRequest(r.buf, r.offset, r.flush, r.finishWrite) + + sendCrc32C, disableAutoChecksum, attrs := s.checksumSettings() + var bufChecksum *uint32 + if !disableAutoChecksum { + bufChecksum = proto.Uint32(crc32.Checksum(r.buf, crc32cTable)) + } + objectChecksums := getObjectChecksums(&getObjectChecksumsParams{ + fullObjectChecksum: s.fullObjectChecksum, + finishWrite: r.finishWrite, + sendCRC32C: sendCrc32C, + disableAutoChecksum: disableAutoChecksum, + attrs: attrs, + }) + req := bidiWriteObjectRequest(r, bufChecksum, objectChecksums) + if firstSend { req.FirstMessage = &storagepb.BidiWriteObjectRequest_UploadId{UploadId: s.upid} firstSend = false @@ -1169,8 +1253,8 @@ func (s *gRPCAppendBidiWriteBufferSender) handleStream(stream storagepb.Storage_ type gRPCAppendTakeoverBidiWriteBufferSender struct { gRPCAppendBidiWriteBufferSender - takeoverReported bool - setTakeoverOffset func(int64) + takeoverReported bool + handleTakeoverCompletion func(gRPCBidiWriteCompletion) } func writeObjectSpecAsAppendObjectSpec(s *storagepb.WriteObjectSpec, gen int64) *storagepb.AppendObjectSpec { @@ -1197,8 +1281,11 @@ func (w *gRPCWriter) newGRPCAppendTakeoverWriteBufferSender() *gRPCAppendTakeove objectChecksums: toProtoChecksums(w.sendCRC32C, w.attrs), finalizeOnClose: w.finalizeOnClose, }, - takeoverReported: false, - setTakeoverOffset: w.setTakeoverOffset, + takeoverReported: false, + handleTakeoverCompletion: func(c gRPCBidiWriteCompletion) { + w.handleCompletion(c) + w.setTakeoverOffset(c.flushOffset) + }, } } @@ -1226,7 +1313,8 @@ func (s *gRPCAppendTakeoverBidiWriteBufferSender) connect(ctx context.Context, c resp, err := stream.Recv() if err != nil { - s.streamErr = err + // A Recv() error may be a redirect. + s.streamErr = s.maybeHandleRedirectionError(err) close(cs.completions) return } @@ -1238,9 +1326,9 @@ func (s *gRPCAppendTakeoverBidiWriteBufferSender) connect(ctx context.Context, c return } - s.setTakeoverOffset(c.flushOffset) + s.maybeUpdateFirstMessage(resp) s.takeoverReported = true - cs.completions <- *c + s.handleTakeoverCompletion(*c) } go s.handleStream(stream, cs, firstSend) @@ -1315,7 +1403,14 @@ func (s *gRPCAppendBidiWriteBufferSender) maybeHandleRedirectionError(err error) func (s *gRPCAppendBidiWriteBufferSender) send(stream storagepb.Storage_BidiWriteObjectClient, buf []byte, offset int64, flush, finishWrite, sendFirstMessage bool) error { finalizeObject := finishWrite && s.finalizeOnClose flush = flush || finishWrite - req := bidiWriteObjectRequest(buf, offset, flush, finalizeObject) + r := gRPCBidiWriteRequest{ + buf: buf, + offset: offset, + flush: flush, + finishWrite: finalizeObject, + } + // TODO(b/453869602): implement default checksumming for appendable writes + req := bidiWriteObjectRequest(r, nil, nil) if finalizeObject { // appendable objects pass checksums on the finalize message only req.ObjectChecksums = s.objectChecksums diff --git a/vendor/cloud.google.com/go/storage/http_client.go b/vendor/cloud.google.com/go/storage/http_client.go index a4b601300dd..a055ed6015c 100644 --- a/vendor/cloud.google.com/go/storage/http_client.go +++ b/vendor/cloud.google.com/go/storage/http_client.go @@ -33,7 +33,6 @@ import ( "cloud.google.com/go/auth" "cloud.google.com/go/iam/apiv1/iampb" "cloud.google.com/go/internal/optional" - "cloud.google.com/go/internal/trace" "github.com/google/uuid" "github.com/googleapis/gax-go/v2/callctx" "google.golang.org/api/googleapi" @@ -225,6 +224,7 @@ func (c *httpStorageClient) ListBuckets(ctx context.Context, project string, opt req.Projection("full") req.Prefix(it.Prefix) req.PageToken(pageToken) + req.ReturnPartialSuccess(it.ReturnPartialSuccess) if pageSize > 0 { req.MaxResults(int64(pageSize)) } @@ -243,6 +243,7 @@ func (c *httpStorageClient) ListBuckets(ctx context.Context, project string, opt } it.buckets = append(it.buckets, b) } + it.unreachable = resp.Unreachable return resp.NextPageToken, nil } @@ -364,6 +365,12 @@ func (c *httpStorageClient) ListObjects(ctx context.Context, bucket string, q *Q req.IncludeTrailingDelimiter(it.query.IncludeTrailingDelimiter) req.MatchGlob(it.query.MatchGlob) req.IncludeFoldersAsPrefixes(it.query.IncludeFoldersAsPrefixes) + + // Cannot pass empty filter + if it.query.Filter != "" { + req.Filter(it.query.Filter) + } + if selection := it.query.toFieldSelection(); selection != "" { req.Fields("nextPageToken", googleapi.Field(selection)) } @@ -517,6 +524,19 @@ func (c *httpStorageClient) UpdateObject(ctx context.Context, params *updateObje forceSendFields = append(forceSendFields, "Retention") } } + + if uattrs.Contexts != nil && uattrs.Contexts.Custom != nil { + if len(uattrs.Contexts.Custom) == 0 { + // To delete all contexts, "Contexts" must be added to nullFields. + // Sending empty Custom map in the request body is a no-op without this. + nullFields = append(nullFields, "Contexts") + } else { + attrs.Contexts = uattrs.Contexts + // This is to ensure any new values or deletions are updated + forceSendFields = append(forceSendFields, "Contexts") + } + } + rawObj := attrs.toRawObject(params.bucket) rawObj.ForceSendFields = forceSendFields rawObj.NullFields = nullFields @@ -847,8 +867,8 @@ func (c *httpStorageClient) NewMultiRangeDownloader(ctx context.Context, params } func (c *httpStorageClient) NewRangeReader(ctx context.Context, params *newRangeReaderParams, opts ...storageOption) (r *Reader, err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.httpStorageClient.NewRangeReader") - defer func() { trace.EndSpan(ctx, err) }() + ctx, _ = startSpan(ctx, "httpStorageClient.NewRangeReader") + defer func() { endSpan(ctx, err) }() s := callSettings(c.settings, opts...) diff --git a/vendor/cloud.google.com/go/storage/internal/apiv2/.repo-metadata.json b/vendor/cloud.google.com/go/storage/internal/apiv2/.repo-metadata.json new file mode 100644 index 00000000000..3a58e6826f3 --- /dev/null +++ b/vendor/cloud.google.com/go/storage/internal/apiv2/.repo-metadata.json @@ -0,0 +1,10 @@ +{ + "api_shortname": "storage", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/storage/latest/internal/apiv2", + "client_library_type": "generated", + "description": "Cloud Storage API", + "distribution_name": "cloud.google.com/go/storage/internal/apiv2", + "language": "go", + "library_type": "GAPIC_AUTO", + "release_level": "stable" +} diff --git a/vendor/cloud.google.com/go/storage/internal/apiv2/storage_client.go b/vendor/cloud.google.com/go/storage/internal/apiv2/storage_client.go index 68133628c39..9936aa68d12 100644 --- a/vendor/cloud.google.com/go/storage/internal/apiv2/storage_client.go +++ b/vendor/cloud.google.com/go/storage/internal/apiv2/storage_client.go @@ -432,7 +432,8 @@ type internalClient interface { // // API Overview and Naming SyntaxThe Cloud Storage gRPC API allows applications to read and write data through // the abstractions of buckets and objects. For a description of these -// abstractions please see https://cloud.google.com/storage/docs (at https://cloud.google.com/storage/docs). +// abstractions please see Cloud Storage +// documentation (at https://cloud.google.com/storage/docs). // // Resources are named as follows: // @@ -440,18 +441,14 @@ type internalClient interface { // using strings like projects/123456 or projects/my-string-id. // // Buckets are named using string names of the form: -// projects/{project}/buckets/{bucket} -// For globally unique buckets, _ may be substituted for the project. +// projects/{project}/buckets/{bucket}. +// For globally unique buckets, _ might be substituted for the project. // // Objects are uniquely identified by their name along with the name of the // bucket they belong to, as separate strings in this API. For example: // -// ReadObjectRequest { -// bucket: ‘projects/_/buckets/my-bucket’ -// object: ‘my-object’ -// } -// Note that object names can contain / characters, which are treated as -// any other character (no special directory semantics). +// Note that object names can contain / characters, which are treated as +// any other character (no special directory semantics). type Client struct { // The internal transport-dependent client. internalClient internalClient @@ -484,40 +481,121 @@ func (c *Client) Connection() *grpc.ClientConn { } // DeleteBucket permanently deletes an empty bucket. +// The request fails if there are any live or +// noncurrent objects in the bucket, but the request succeeds if the +// bucket only contains soft-deleted objects or incomplete uploads, such +// as ongoing XML API multipart uploads. Does not permanently delete +// soft-deleted objects. +// +// When this API is used to delete a bucket containing an object that has a +// soft delete policy +// enabled, the object becomes soft deleted, and the +// softDeleteTime and hardDeleteTime properties are set on the +// object. +// +// Objects and multipart uploads that were in the bucket at the time of +// deletion are also retained for the specified retention duration. When +// a soft-deleted bucket reaches the end of its retention duration, it +// is permanently deleted. The hardDeleteTime of the bucket always +// equals +// or exceeds the expiration time of the last soft-deleted object in the +// bucket. +// +// IAM Permissions: +// +// Requires storage.buckets.delete IAM permission on the bucket. func (c *Client) DeleteBucket(ctx context.Context, req *storagepb.DeleteBucketRequest, opts ...gax.CallOption) error { return c.internalClient.DeleteBucket(ctx, req, opts...) } // GetBucket returns metadata for the specified bucket. +// +// IAM Permissions: +// +// Requires storage.buckets.get +// IAM permission on +// the bucket. Additionally, to return specific bucket metadata, the +// authenticated user must have the following permissions: +// +// To return the IAM policies: storage.buckets.getIamPolicy +// +// To return the bucket IP filtering rules: storage.buckets.getIpFilter func (c *Client) GetBucket(ctx context.Context, req *storagepb.GetBucketRequest, opts ...gax.CallOption) (*storagepb.Bucket, error) { return c.internalClient.GetBucket(ctx, req, opts...) } // CreateBucket creates a new bucket. +// +// IAM Permissions: +// +// Requires storage.buckets.create IAM permission on the bucket. +// Additionally, to enable specific bucket features, the authenticated user +// must have the following permissions: +// +// To enable object retention using the enableObjectRetention query +// parameter: storage.buckets.enableObjectRetention +// +// To set the bucket IP filtering rules: storage.buckets.setIpFilter func (c *Client) CreateBucket(ctx context.Context, req *storagepb.CreateBucketRequest, opts ...gax.CallOption) (*storagepb.Bucket, error) { return c.internalClient.CreateBucket(ctx, req, opts...) } -// ListBuckets retrieves a list of buckets for a given project. +// ListBuckets retrieves a list of buckets for a given project, ordered +// lexicographically by name. +// +// IAM Permissions: +// +// Requires storage.buckets.list IAM permission on the bucket. +// Additionally, to enable specific bucket features, the authenticated +// user must have the following permissions: +// +// To list the IAM policies: storage.buckets.getIamPolicy +// +// To list the bucket IP filtering rules: storage.buckets.getIpFilter func (c *Client) ListBuckets(ctx context.Context, req *storagepb.ListBucketsRequest, opts ...gax.CallOption) *BucketIterator { return c.internalClient.ListBuckets(ctx, req, opts...) } -// LockBucketRetentionPolicy locks retention policy on a bucket. +// LockBucketRetentionPolicy permanently locks the retention +// policy that is +// currently applied to the specified bucket. +// +// Caution: Locking a bucket is an +// irreversible action. Once you lock a bucket: +// +// You cannot remove the retention policy from the bucket. +// +// You cannot decrease the retention period for the policy. +// +// Once locked, you must delete the entire bucket in order to remove the +// bucket’s retention policy. However, before you can delete the bucket, you +// must delete all the objects in the bucket, which is only +// possible if all the objects have reached the retention period set by the +// retention policy. +// +// IAM Permissions: +// +// Requires storage.buckets.update IAM permission on the bucket. func (c *Client) LockBucketRetentionPolicy(ctx context.Context, req *storagepb.LockBucketRetentionPolicyRequest, opts ...gax.CallOption) (*storagepb.Bucket, error) { return c.internalClient.LockBucketRetentionPolicy(ctx, req, opts...) } -// GetIamPolicy gets the IAM policy for a specified bucket. +// GetIamPolicy gets the IAM policy for a specified bucket or managed folder. // The resource field in the request should be // projects/_/buckets/{bucket} for a bucket, or // projects/_/buckets/{bucket}/managedFolders/{managedFolder} // for a managed folder. +// +// IAM Permissions: +// +// Requires storage.buckets.getIamPolicy on the bucket or +// storage.managedFolders.getIamPolicy IAM permission on the +// managed folder. func (c *Client) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { return c.internalClient.GetIamPolicy(ctx, req, opts...) } -// SetIamPolicy updates an IAM policy for the specified bucket. +// SetIamPolicy updates an IAM policy for the specified bucket or managed folder. // The resource field in the request should be // projects/_/buckets/{bucket} for a bucket, or // projects/_/buckets/{bucket}/managedFolders/{managedFolder} @@ -527,9 +605,8 @@ func (c *Client) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyReques } // TestIamPermissions tests a set of permissions on the given bucket, object, or managed folder -// to see which, if any, are held by the caller. -// The resource field in the request should be -// projects/_/buckets/{bucket} for a bucket, +// to see which, if any, are held by the caller. The resource field in the +// request should be projects/_/buckets/{bucket} for a bucket, // projects/_/buckets/{bucket}/objects/{object} for an object, or // projects/_/buckets/{bucket}/managedFolders/{managedFolder} // for a managed folder. @@ -537,20 +614,42 @@ func (c *Client) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermi return c.internalClient.TestIamPermissions(ctx, req, opts...) } -// UpdateBucket updates a bucket. Equivalent to JSON API’s storage.buckets.patch method. +// UpdateBucket updates a bucket. Changes to the bucket are readable immediately after +// writing, but configuration changes might take time to propagate. This +// method supports patch semantics. +// +// IAM Permissions: +// +// Requires storage.buckets.update IAM permission on the bucket. +// Additionally, to enable specific bucket features, the authenticated user +// must have the following permissions: +// +// To set bucket IP filtering rules: storage.buckets.setIpFilter +// +// To update public access prevention policies or access control lists +// (ACLs): storage.buckets.setIamPolicy func (c *Client) UpdateBucket(ctx context.Context, req *storagepb.UpdateBucketRequest, opts ...gax.CallOption) (*storagepb.Bucket, error) { return c.internalClient.UpdateBucket(ctx, req, opts...) } // ComposeObject concatenates a list of existing objects into a new object in the same -// bucket. +// bucket. The existing source objects are unaffected by this operation. +// +// IAM Permissions: +// +// Requires the storage.objects.create and storage.objects.get IAM +// permissions to use this method. If the new composite object +// overwrites an existing object, the authenticated user must also have +// the storage.objects.delete permission. If the request body includes +// the retention property, the authenticated user must also have the +// storage.objects.setRetention IAM permission. func (c *Client) ComposeObject(ctx context.Context, req *storagepb.ComposeObjectRequest, opts ...gax.CallOption) (*storagepb.Object, error) { return c.internalClient.ComposeObject(ctx, req, opts...) } // DeleteObject deletes an object and its metadata. Deletions are permanent if versioning // is not enabled for the bucket, or if the generation parameter is used, or -// if soft delete (at https://cloud.google.com/storage/docs/soft-delete) is not +// if soft delete is not // enabled for the bucket. // When this API is used to delete an object from a bucket that has soft // delete policy enabled, the object becomes soft deleted, and the @@ -565,14 +664,56 @@ func (c *Client) ComposeObject(ctx context.Context, req *storagepb.ComposeObject // // IAM Permissions: // -// Requires storage.objects.delete -// IAM permission (at https://cloud.google.com/iam/docs/overview#permissions) on -// the bucket. +// Requires storage.objects.delete IAM permission on the bucket. func (c *Client) DeleteObject(ctx context.Context, req *storagepb.DeleteObjectRequest, opts ...gax.CallOption) error { return c.internalClient.DeleteObject(ctx, req, opts...) } -// RestoreObject restores a soft-deleted object. +// RestoreObject restores a +// soft-deleted object. +// When a soft-deleted object is restored, a new copy of that object is +// created in the same bucket and inherits the same metadata as the +// soft-deleted object. The inherited metadata is the metadata that existed +// when the original object became soft deleted, with the following +// exceptions: +// +// The createTime of the new object is set to the time at which the +// soft-deleted object was restored. +// +// The softDeleteTime and hardDeleteTime values are cleared. +// +// A new generation is assigned and the metageneration is reset to 1. +// +// If the soft-deleted object was in a bucket that had Autoclass enabled, +// the new object is +// restored to Standard storage. +// +// The restored object inherits the bucket’s default object ACL, unless +// copySourceAcl is true. +// +// If a live object using the same name already exists in the bucket and +// becomes overwritten, the live object becomes a noncurrent object if Object +// Versioning is enabled on the bucket. If Object Versioning is not enabled, +// the live object becomes soft deleted. +// +// IAM Permissions: +// +// Requires the following IAM permissions to use this method: +// +// storage.objects.restore +// +// storage.objects.create +// +// storage.objects.delete (only required if overwriting an existing +// object) +// +// storage.objects.getIamPolicy (only required if projection is full +// and the relevant bucket +// has uniform bucket-level access disabled) +// +// storage.objects.setIamPolicy (only required if copySourceAcl is +// true and the relevant +// bucket has uniform bucket-level access disabled) func (c *Client) RestoreObject(ctx context.Context, req *storagepb.RestoreObjectRequest, opts ...gax.CallOption) (*storagepb.Object, error) { return c.internalClient.RestoreObject(ctx, req, opts...) } @@ -580,9 +721,9 @@ func (c *Client) RestoreObject(ctx context.Context, req *storagepb.RestoreObject // CancelResumableWrite cancels an in-progress resumable upload. // // Any attempts to write to the resumable upload after cancelling the upload -// will fail. +// fail. // -// The behavior for currently in progress write operations is not guaranteed - +// The behavior for any in-progress write operations is not guaranteed; // they could either complete before the cancellation or fail if the // cancellation completes first. func (c *Client) CancelResumableWrite(ctx context.Context, req *storagepb.CancelResumableWriteRequest, opts ...gax.CallOption) (*storagepb.CancelResumableWriteResponse, error) { @@ -593,9 +734,8 @@ func (c *Client) CancelResumableWrite(ctx context.Context, req *storagepb.Cancel // // IAM Permissions: // -// Requires storage.objects.get -// IAM permission (at https://cloud.google.com/iam/docs/overview#permissions) on -// the bucket. To return object ACLs, the authenticated user must also have +// Requires storage.objects.get IAM permission on the bucket. +// To return object ACLs, the authenticated user must also have // the storage.objects.getIamPolicy permission. func (c *Client) GetObject(ctx context.Context, req *storagepb.GetObjectRequest, opts ...gax.CallOption) (*storagepb.Object, error) { return c.internalClient.GetObject(ctx, req, opts...) @@ -605,38 +745,34 @@ func (c *Client) GetObject(ctx context.Context, req *storagepb.GetObjectRequest, // // IAM Permissions: // -// Requires storage.objects.get -// IAM permission (at https://cloud.google.com/iam/docs/overview#permissions) on -// the bucket. +// Requires storage.objects.get IAM permission on the bucket. func (c *Client) ReadObject(ctx context.Context, req *storagepb.ReadObjectRequest, opts ...gax.CallOption) (storagepb.Storage_ReadObjectClient, error) { return c.internalClient.ReadObject(ctx, req, opts...) } // BidiReadObject reads an object’s data. // -// This is a bi-directional API with the added support for reading multiple -// ranges within one stream both within and across multiple messages. -// If the server encountered an error for any of the inputs, the stream will -// be closed with the relevant error code. -// Because the API allows for multiple outstanding requests, when the stream -// is closed the error response will contain a BidiReadObjectRangesError proto -// in the error extension describing the error for each outstanding read_id. +// This bi-directional API reads data from an object, allowing you to +// request multiple data ranges within a single stream, even across +// several messages. If an error occurs with any request, the stream +// closes with a relevant error code. Since you can have multiple +// outstanding requests, the error response includes a +// BidiReadObjectRangesError field detailing the specific error for +// each pending read_id. // // IAM Permissions: // -// # Requires storage.objects.get -// -// IAM permission (at https://cloud.google.com/iam/docs/overview#permissions) on -// the bucket. -// -// This API is currently in preview and is not yet available for general -// use. +// Requires storage.objects.get IAM permission on the bucket. func (c *Client) BidiReadObject(ctx context.Context, opts ...gax.CallOption) (storagepb.Storage_BidiReadObjectClient, error) { return c.internalClient.BidiReadObject(ctx, opts...) } // UpdateObject updates an object’s metadata. -// Equivalent to JSON API’s storage.objects.patch. +// Equivalent to JSON API’s storage.objects.patch method. +// +// IAM Permissions: +// +// Requires storage.objects.update IAM permission on the bucket. func (c *Client) UpdateObject(ctx context.Context, req *storagepb.UpdateObjectRequest, opts ...gax.CallOption) (*storagepb.Object, error) { return c.internalClient.UpdateObject(ctx, req, opts...) } @@ -661,10 +797,10 @@ func (c *Client) UpdateObject(ctx context.Context, req *storagepb.UpdateObjectRe // Check the result Status of the stream, to determine if writing can be // resumed on this stream or must be restarted from scratch (by calling // StartResumableWrite()). The resumable errors are DEADLINE_EXCEEDED, -// INTERNAL, and UNAVAILABLE. For each case, the client should use binary -// exponential backoff before retrying. Additionally, writes can be -// resumed after RESOURCE_EXHAUSTED errors, but only after taking -// appropriate measures, which may include reducing aggregate send rate +// INTERNAL, and UNAVAILABLE. For each case, the client should use +// binary exponential backoff before retrying. Additionally, writes can +// be resumed after RESOURCE_EXHAUSTED errors, but only after taking +// appropriate measures, which might include reducing aggregate send rate // across clients and/or requesting a quota increase for your project. // // If the call to WriteObject returns ABORTED, that indicates @@ -672,43 +808,43 @@ func (c *Client) UpdateObject(ctx context.Context, req *storagepb.UpdateObjectRe // multiple racing clients or by a single client where the previous // request was timed out on the client side but nonetheless reached the // server. In this case the client should take steps to prevent further -// concurrent writes (e.g., increase the timeouts, stop using more than -// one process to perform the upload, etc.), and then should follow the -// steps below for resuming the upload. +// concurrent writes. For example, increase the timeouts and stop using +// more than one process to perform the upload. Follow the steps below for +// resuming the upload. // // For resumable errors, the client should call QueryWriteStatus() and -// then continue writing from the returned persisted_size. This may be +// then continue writing from the returned persisted_size. This might be // less than the amount of data the client previously sent. Note also that // it is acceptable to send data starting at an offset earlier than the -// returned persisted_size; in this case, the service will skip data at +// returned persisted_size; in this case, the service skips data at // offsets that were already persisted (without checking that it matches // the previously written data), and write only the data starting from the -// persisted offset. Even though the data isn’t written, it may still +// persisted offset. Even though the data isn’t written, it might still // incur a performance cost over resuming at the correct write offset. // This behavior can make client-side handling simpler in some cases. // // Clients must only send data that is a multiple of 256 KiB per message, // unless the object is being finished with finish_write set to true. // -// The service will not view the object as complete until the client has +// The service does not view the object as complete until the client has // sent a WriteObjectRequest with finish_write set to true. Sending any // requests on a stream after sending a request with finish_write set to -// true will cause an error. The client should check the response it -// receives to determine how much data the service was able to commit and +// true causes an error. The client must check the response it +// receives to determine how much data the service is able to commit and // whether the service views the object as complete. // -// Attempting to resume an already finalized object will result in an OK +// Attempting to resume an already finalized object results in an OK // status, with a WriteObjectResponse containing the finalized object’s // metadata. // -// Alternatively, the BidiWriteObject operation may be used to write an +// Alternatively, you can use the BidiWriteObject operation to write an // object with controls over flushing and the ability to fetch the ability to // determine the current persisted size. // // IAM Permissions: // // Requires storage.objects.create -// IAM permission (at https://cloud.google.com/iam/docs/overview#permissions) on +// IAM permission on // the bucket. func (c *Client) WriteObject(ctx context.Context, opts ...gax.CallOption) (storagepb.Storage_WriteObjectClient, error) { return c.internalClient.WriteObject(ctx, opts...) @@ -720,15 +856,15 @@ func (c *Client) WriteObject(ctx context.Context, opts ...gax.CallOption) (stora // manual flushing of persisted state, and the ability to determine current // persisted size without closing the stream. // -// The client may specify one or both of the state_lookup and flush fields -// in each BidiWriteObjectRequest. If flush is specified, the data written -// so far will be persisted to storage. If state_lookup is specified, the -// service will respond with a BidiWriteObjectResponse that contains the +// The client might specify one or both of the state_lookup and flush +// fields in each BidiWriteObjectRequest. If flush is specified, the data +// written so far is persisted to storage. If state_lookup is specified, the +// service responds with a BidiWriteObjectResponse that contains the // persisted size. If both flush and state_lookup are specified, the flush -// will always occur before a state_lookup, so that both may be set in the -// same request and the returned state will be the state of the object -// post-flush. When the stream is closed, a BidiWriteObjectResponse will -// always be sent to the client, regardless of the value of state_lookup. +// always occurs before a state_lookup, so that both might be set in the +// same request and the returned state is the state of the object +// post-flush. When the stream is closed, a BidiWriteObjectResponse +// is always sent to the client, regardless of the value of state_lookup. func (c *Client) BidiWriteObject(ctx context.Context, opts ...gax.CallOption) (storagepb.Storage_BidiWriteObjectClient, error) { return c.internalClient.BidiWriteObject(ctx, opts...) } @@ -738,8 +874,8 @@ func (c *Client) BidiWriteObject(ctx context.Context, opts ...gax.CallOption) (s // IAM Permissions: // // The authenticated user requires storage.objects.list -// IAM permission (at https://cloud.google.com/iam/docs/overview#permissions) -// to use this method. To return object ACLs, the authenticated user must also +// IAM permission to use this method. To return object ACLs, the +// authenticated user must also // have the storage.objects.getIamPolicy permission. func (c *Client) ListObjects(ctx context.Context, req *storagepb.ListObjectsRequest, opts ...gax.CallOption) *ObjectIterator { return c.internalClient.ListObjects(ctx, req, opts...) @@ -753,7 +889,7 @@ func (c *Client) RewriteObject(ctx context.Context, req *storagepb.RewriteObject // StartResumableWrite starts a resumable write operation. This // method is part of the Resumable -// upload (at https://cloud.google.com/storage/docs/resumable-uploads) feature. +// upload feature. // This allows you to upload large objects in multiple chunks, which is more // resilient to network interruptions than a single upload. The validity // duration of the write operation, and the consequences of it becoming @@ -761,16 +897,14 @@ func (c *Client) RewriteObject(ctx context.Context, req *storagepb.RewriteObject // // IAM Permissions: // -// Requires storage.objects.create -// IAM permission (at https://cloud.google.com/iam/docs/overview#permissions) on -// the bucket. +// Requires storage.objects.create IAM permission on the bucket. func (c *Client) StartResumableWrite(ctx context.Context, req *storagepb.StartResumableWriteRequest, opts ...gax.CallOption) (*storagepb.StartResumableWriteResponse, error) { return c.internalClient.StartResumableWrite(ctx, req, opts...) } // QueryWriteStatus determines the persisted_size of an object that is being written. This // method is part of the resumable -// upload (at https://cloud.google.com/storage/docs/resumable-uploads) feature. +// upload feature. // The returned value is the size of the object that has been persisted so // far. The value can be used as the write_offset for the next Write() // call. @@ -790,6 +924,21 @@ func (c *Client) QueryWriteStatus(ctx context.Context, req *storagepb.QueryWrite } // MoveObject moves the source object to the destination object in the same bucket. +// This operation moves a source object to a destination object in the +// same bucket by renaming the object. The move itself is an atomic +// transaction, ensuring all steps either complete successfully or no +// changes are made. +// +// IAM Permissions: +// +// Requires the following IAM permissions to use this method: +// +// storage.objects.move +// +// storage.objects.create +// +// storage.objects.delete (only required if overwriting an existing +// object) func (c *Client) MoveObject(ctx context.Context, req *storagepb.MoveObjectRequest, opts ...gax.CallOption) (*storagepb.Object, error) { return c.internalClient.MoveObject(ctx, req, opts...) } @@ -818,7 +967,8 @@ type gRPCClient struct { // // API Overview and Naming SyntaxThe Cloud Storage gRPC API allows applications to read and write data through // the abstractions of buckets and objects. For a description of these -// abstractions please see https://cloud.google.com/storage/docs (at https://cloud.google.com/storage/docs). +// abstractions please see Cloud Storage +// documentation (at https://cloud.google.com/storage/docs). // // Resources are named as follows: // @@ -826,18 +976,14 @@ type gRPCClient struct { // using strings like projects/123456 or projects/my-string-id. // // Buckets are named using string names of the form: -// projects/{project}/buckets/{bucket} -// For globally unique buckets, _ may be substituted for the project. +// projects/{project}/buckets/{bucket}. +// For globally unique buckets, _ might be substituted for the project. // // Objects are uniquely identified by their name along with the name of the // bucket they belong to, as separate strings in this API. For example: // -// ReadObjectRequest { -// bucket: ‘projects/_/buckets/my-bucket’ -// object: ‘my-object’ -// } -// Note that object names can contain / characters, which are treated as -// any other character (no special directory semantics). +// Note that object names can contain / characters, which are treated as +// any other character (no special directory semantics). func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) { clientOpts := defaultGRPCClientOptions() if newClientHook != nil { diff --git a/vendor/cloud.google.com/go/storage/internal/apiv2/storagepb/storage.pb.go b/vendor/cloud.google.com/go/storage/internal/apiv2/storagepb/storage.pb.go index ee6639e49d8..b8cd9add525 100644 --- a/vendor/cloud.google.com/go/storage/internal/apiv2/storagepb/storage.pb.go +++ b/vendor/cloud.google.com/go/storage/internal/apiv2/storagepb/storage.pb.go @@ -21,22 +21,19 @@ package storagepb import ( + reflect "reflect" + sync "sync" + iampb "cloud.google.com/go/iam/apiv1/iampb" - context "context" _ "google.golang.org/genproto/googleapis/api/annotations" status "google.golang.org/genproto/googleapis/rpc/status" date "google.golang.org/genproto/googleapis/type/date" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status1 "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" durationpb "google.golang.org/protobuf/types/known/durationpb" emptypb "google.golang.org/protobuf/types/known/emptypb" fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" ) const ( @@ -52,8 +49,8 @@ type ServiceConstants_Values int32 const ( // Unused. Proto3 requires first enum to be 0. ServiceConstants_VALUES_UNSPECIFIED ServiceConstants_Values = 0 - // The maximum size chunk that can will be returned in a single - // ReadRequest. + // The maximum size chunk that can be returned in a single + // `ReadRequest`. // 2 MiB. ServiceConstants_MAX_READ_CHUNK_BYTES ServiceConstants_Values = 2097152 // The maximum size chunk that can be sent in a single WriteObjectRequest. @@ -186,11 +183,11 @@ type Object_Retention_Mode int32 const ( // No specified mode. Object is not under retention. Object_Retention_MODE_UNSPECIFIED Object_Retention_Mode = 0 - // Retention period may be decreased or increased. - // The Retention configuration may be removed. - // The mode may be changed to locked. + // Retention period might be decreased or increased. + // The Retention configuration might be removed. + // The mode might be changed to locked. Object_Retention_UNLOCKED Object_Retention_Mode = 1 - // Retention period may be increased. + // Retention period might be increased. // The Retention configuration cannot be removed. // The mode cannot be changed. Object_Retention_LOCKED Object_Retention_Mode = 2 @@ -237,7 +234,7 @@ func (Object_Retention_Mode) EnumDescriptor() ([]byte, []int) { return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{50, 0, 0} } -// Request message for DeleteBucket. +// Request message for [DeleteBucket][google.storage.v2.Storage.DeleteBucket]. type DeleteBucketRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -303,7 +300,7 @@ func (x *DeleteBucketRequest) GetIfMetagenerationNotMatch() int64 { return 0 } -// Request message for GetBucket. +// Request message for [GetBucket][google.storage.v2.Storage.GetBucket]. type GetBucketRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -311,15 +308,15 @@ type GetBucketRequest struct { // Required. Name of a bucket. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // If set, and if the bucket's current metageneration does not match the - // specified value, the request will return an error. + // If set, only gets the bucket metadata if its metageneration matches this + // value. IfMetagenerationMatch *int64 `protobuf:"varint,2,opt,name=if_metageneration_match,json=ifMetagenerationMatch,proto3,oneof" json:"if_metageneration_match,omitempty"` // If set, and if the bucket's current metageneration matches the specified - // value, the request will return an error. + // value, the request returns an error. IfMetagenerationNotMatch *int64 `protobuf:"varint,3,opt,name=if_metageneration_not_match,json=ifMetagenerationNotMatch,proto3,oneof" json:"if_metageneration_not_match,omitempty"` // Mask specifying which fields to read. - // A "*" field may be used to indicate all fields. - // If no mask is specified, will default to all fields. + // A `*` field might be used to indicate all fields. + // If no mask is specified, it defaults to all fields. ReadMask *fieldmaskpb.FieldMask `protobuf:"bytes,5,opt,name=read_mask,json=readMask,proto3,oneof" json:"read_mask,omitempty"` } @@ -381,35 +378,35 @@ func (x *GetBucketRequest) GetReadMask() *fieldmaskpb.FieldMask { return nil } -// Request message for CreateBucket. +// Request message for [CreateBucket][google.storage.v2.Storage.CreateBucket]. type CreateBucketRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Required. The project to which this bucket will belong. This field must - // either be empty or `projects/_`. The project ID that owns this bucket - // should be specified in the `bucket.project` field. + // Required. The project to which this bucket belongs. This field must either + // be empty or `projects/_`. The project ID that owns this bucket should be + // specified in the `bucket.project` field. Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` // Optional. Properties of the new bucket being inserted. // The name of the bucket is specified in the `bucket_id` field. Populating - // `bucket.name` field will result in an error. + // `bucket.name` field results in an error. // The project of the bucket must be specified in the `bucket.project` field. // This field must be in `projects/{projectIdentifier}` format, // {projectIdentifier} can be the project ID or project number. The `parent` // field must be either empty or `projects/_`. Bucket *Bucket `protobuf:"bytes,2,opt,name=bucket,proto3" json:"bucket,omitempty"` - // Required. The ID to use for this bucket, which will become the final - // component of the bucket's resource name. For example, the value `foo` might - // result in a bucket with the name `projects/123456/buckets/foo`. + // Required. The ID to use for this bucket, which becomes the final component + // of the bucket's resource name. For example, the value `foo` might result in + // a bucket with the name `projects/123456/buckets/foo`. BucketId string `protobuf:"bytes,3,opt,name=bucket_id,json=bucketId,proto3" json:"bucket_id,omitempty"` // Optional. Apply a predefined set of access controls to this bucket. - // Valid values are "authenticatedRead", "private", "projectPrivate", - // "publicRead", or "publicReadWrite". + // Valid values are `authenticatedRead`, `private`, `projectPrivate`, + // `publicRead`, or `publicReadWrite`. PredefinedAcl string `protobuf:"bytes,6,opt,name=predefined_acl,json=predefinedAcl,proto3" json:"predefined_acl,omitempty"` // Optional. Apply a predefined set of default object access controls to this - // bucket. Valid values are "authenticatedRead", "bucketOwnerFullControl", - // "bucketOwnerRead", "private", "projectPrivate", or "publicRead". + // bucket. Valid values are `authenticatedRead`, `bucketOwnerFullControl`, + // `bucketOwnerRead`, `private`, `projectPrivate`, or `publicRead`. PredefinedDefaultObjectAcl string `protobuf:"bytes,7,opt,name=predefined_default_object_acl,json=predefinedDefaultObjectAcl,proto3" json:"predefined_default_object_acl,omitempty"` // Optional. If true, enable object retention on the bucket. EnableObjectRetention bool `protobuf:"varint,9,opt,name=enable_object_retention,json=enableObjectRetention,proto3" json:"enable_object_retention,omitempty"` @@ -487,7 +484,7 @@ func (x *CreateBucketRequest) GetEnableObjectRetention() bool { return false } -// Request message for ListBuckets. +// Request message for [ListBuckets][google.storage.v2.Storage.ListBuckets]. type ListBucketsRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -496,9 +493,9 @@ type ListBucketsRequest struct { // Required. The project whose buckets we are listing. Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` // Optional. Maximum number of buckets to return in a single response. The - // service will use this parameter or 1,000 items, whichever is smaller. If - // "acl" is present in the read_mask, the service will use this parameter of - // 200 items, whichever is smaller. + // service uses this parameter or `1,000` items, whichever is smaller. If + // `acl` is present in the `read_mask`, the service uses this parameter of + // `200` items, whichever is smaller. PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` // Optional. A previously-returned page token representing part of the larger // set of results to view. @@ -506,10 +503,13 @@ type ListBucketsRequest struct { // Optional. Filter results to buckets whose names begin with this prefix. Prefix string `protobuf:"bytes,4,opt,name=prefix,proto3" json:"prefix,omitempty"` // Mask specifying which fields to read from each result. - // If no mask is specified, will default to all fields except items.owner, - // items.acl, and items.default_object_acl. - // * may be used to mean "all fields". + // If no mask is specified, it defaults to all fields except `items. + // owner`, `items.acl`, and `items.default_object_acl`. + // `*` might be used to mean "all fields". ReadMask *fieldmaskpb.FieldMask `protobuf:"bytes,5,opt,name=read_mask,json=readMask,proto3,oneof" json:"read_mask,omitempty"` + // Optional. Allows listing of buckets, even if there are buckets that are + // unreachable. + ReturnPartialSuccess bool `protobuf:"varint,9,opt,name=return_partial_success,json=returnPartialSuccess,proto3" json:"return_partial_success,omitempty"` } func (x *ListBucketsRequest) Reset() { @@ -577,7 +577,14 @@ func (x *ListBucketsRequest) GetReadMask() *fieldmaskpb.FieldMask { return nil } -// The result of a call to Buckets.ListBuckets +func (x *ListBucketsRequest) GetReturnPartialSuccess() bool { + if x != nil { + return x.ReturnPartialSuccess + } + return false +} + +// Response message for [ListBuckets][google.storage.v2.Storage.ListBuckets]. type ListBucketsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -588,6 +595,19 @@ type ListBucketsResponse struct { // The continuation token, used to page through large result sets. Provide // this value in a subsequent request to return the next page of results. NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` + // Unreachable resources. + // This field can only be present if the caller specified + // return_partial_success to be true in the request to receive indications + // of temporarily missing resources. + // unreachable might be: + // unreachable = [ + // + // "projects/_/buckets/bucket1", + // "projects/_/buckets/bucket2", + // "projects/_/buckets/bucket3", + // + // ] + Unreachable []string `protobuf:"bytes,3,rep,name=unreachable,proto3" json:"unreachable,omitempty"` } func (x *ListBucketsResponse) Reset() { @@ -634,7 +654,15 @@ func (x *ListBucketsResponse) GetNextPageToken() string { return "" } -// Request message for LockBucketRetentionPolicyRequest. +func (x *ListBucketsResponse) GetUnreachable() []string { + if x != nil { + return x.Unreachable + } + return nil +} + +// Request message for +// [LockBucketRetentionPolicy][google.storage.v2.Storage.LockBucketRetentionPolicy]. type LockBucketRetentionPolicyRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -691,35 +719,35 @@ func (x *LockBucketRetentionPolicyRequest) GetIfMetagenerationMatch() int64 { return 0 } -// Request for UpdateBucket method. +// Request for [UpdateBucket][google.storage.v2.Storage.UpdateBucket] method. type UpdateBucketRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Required. The bucket to update. - // The bucket's `name` field will be used to identify the bucket. + // The bucket's `name` field is used to identify the bucket. Bucket *Bucket `protobuf:"bytes,1,opt,name=bucket,proto3" json:"bucket,omitempty"` - // If set, will only modify the bucket if its metageneration matches this + // If set, the request modifies the bucket if its metageneration matches this // value. IfMetagenerationMatch *int64 `protobuf:"varint,2,opt,name=if_metageneration_match,json=ifMetagenerationMatch,proto3,oneof" json:"if_metageneration_match,omitempty"` - // If set, will only modify the bucket if its metageneration does not match - // this value. + // If set, the request modifies the bucket if its metageneration doesn't + // match this value. IfMetagenerationNotMatch *int64 `protobuf:"varint,3,opt,name=if_metageneration_not_match,json=ifMetagenerationNotMatch,proto3,oneof" json:"if_metageneration_not_match,omitempty"` // Optional. Apply a predefined set of access controls to this bucket. - // Valid values are "authenticatedRead", "private", "projectPrivate", - // "publicRead", or "publicReadWrite". + // Valid values are `authenticatedRead`, `private`, `projectPrivate`, + // `publicRead`, or `publicReadWrite`. PredefinedAcl string `protobuf:"bytes,8,opt,name=predefined_acl,json=predefinedAcl,proto3" json:"predefined_acl,omitempty"` // Optional. Apply a predefined set of default object access controls to this - // bucket. Valid values are "authenticatedRead", "bucketOwnerFullControl", - // "bucketOwnerRead", "private", "projectPrivate", or "publicRead". + // bucket. Valid values are `authenticatedRead`, `bucketOwnerFullControl`, + // `bucketOwnerRead`, `private`, `projectPrivate`, or `publicRead`. PredefinedDefaultObjectAcl string `protobuf:"bytes,9,opt,name=predefined_default_object_acl,json=predefinedDefaultObjectAcl,proto3" json:"predefined_default_object_acl,omitempty"` // Required. List of fields to be updated. // // To specify ALL fields, equivalent to the JSON API's "update" function, // specify a single field with the value `*`. Note: not recommended. If a new // field is introduced at a later time, an older client updating with the `*` - // may accidentally reset the new field's value. + // might accidentally reset the new field's value. // // Not specifying any fields is an error. UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,6,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` @@ -797,7 +825,7 @@ func (x *UpdateBucketRequest) GetUpdateMask() *fieldmaskpb.FieldMask { return nil } -// Request message for ComposeObject. +// Request message for [ComposeObject][google.storage.v2.Storage.ComposeObject]. type ComposeObjectRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -805,12 +833,12 @@ type ComposeObjectRequest struct { // Required. Properties of the resulting object. Destination *Object `protobuf:"bytes,1,opt,name=destination,proto3" json:"destination,omitempty"` - // Optional. The list of source objects that will be concatenated into a - // single object. + // Optional. The list of source objects that is concatenated into a single + // object. SourceObjects []*ComposeObjectRequest_SourceObject `protobuf:"bytes,2,rep,name=source_objects,json=sourceObjects,proto3" json:"source_objects,omitempty"` // Optional. Apply a predefined set of access controls to the destination - // object. Valid values are "authenticatedRead", "bucketOwnerFullControl", - // "bucketOwnerRead", "private", "projectPrivate", or "publicRead". + // object. Valid values are `authenticatedRead`, `bucketOwnerFullControl`, + // `bucketOwnerRead`, `private`, `projectPrivate`, or `publicRead`. DestinationPredefinedAcl string `protobuf:"bytes,9,opt,name=destination_predefined_acl,json=destinationPredefinedAcl,proto3" json:"destination_predefined_acl,omitempty"` // Makes the operation conditional on whether the object's current generation // matches the given value. Setting to 0 makes the operation succeed only if @@ -821,14 +849,14 @@ type ComposeObjectRequest struct { IfMetagenerationMatch *int64 `protobuf:"varint,5,opt,name=if_metageneration_match,json=ifMetagenerationMatch,proto3,oneof" json:"if_metageneration_match,omitempty"` // Optional. Resource name of the Cloud KMS key, of the form // `projects/my-project/locations/my-location/keyRings/my-kr/cryptoKeys/my-key`, - // that will be used to encrypt the object. Overrides the object + // that is used to encrypt the object. Overrides the object // metadata's `kms_key_name` value, if any. KmsKey string `protobuf:"bytes,6,opt,name=kms_key,json=kmsKey,proto3" json:"kms_key,omitempty"` // Optional. A set of parameters common to Storage API requests concerning an // object. CommonObjectRequestParams *CommonObjectRequestParams `protobuf:"bytes,7,opt,name=common_object_request_params,json=commonObjectRequestParams,proto3" json:"common_object_request_params,omitempty"` - // Optional. The checksums of the complete object. This will be validated - // against the combined checksums of the component objects. + // Optional. The checksums of the complete object. This is validated against + // the combined checksums of the component objects. ObjectChecksums *ObjectChecksums `protobuf:"bytes,10,opt,name=object_checksums,json=objectChecksums,proto3" json:"object_checksums,omitempty"` } @@ -918,8 +946,7 @@ func (x *ComposeObjectRequest) GetObjectChecksums() *ObjectChecksums { return nil } -// Message for deleting an object. -// `bucket` and `object` **must** be set. +// Request message for deleting an object. type DeleteObjectRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1040,7 +1067,8 @@ func (x *DeleteObjectRequest) GetCommonObjectRequestParams() *CommonObjectReques return nil } -// Message for restoring an object. +// Request message for +// [RestoreObject][google.storage.v2.Storage.RestoreObject]. // `bucket`, `object`, and `generation` **must** be set. type RestoreObjectRequest struct { state protoimpl.MessageState @@ -1074,7 +1102,7 @@ type RestoreObjectRequest struct { // Makes the operation conditional on whether the object's current // metageneration does not match the given value. IfMetagenerationNotMatch *int64 `protobuf:"varint,7,opt,name=if_metageneration_not_match,json=ifMetagenerationNotMatch,proto3,oneof" json:"if_metageneration_not_match,omitempty"` - // If false or unset, the bucket's default object ACL will be used. + // If false or unset, the bucket's default object ACL is used. // If true, copy the source object's access controls. // Return an error if bucket has UBLA enabled. CopySourceAcl *bool `protobuf:"varint,9,opt,name=copy_source_acl,json=copySourceAcl,proto3,oneof" json:"copy_source_acl,omitempty"` @@ -1183,8 +1211,8 @@ func (x *RestoreObjectRequest) GetCommonObjectRequestParams() *CommonObjectReque return nil } -// Message for canceling an in-progress resumable upload. -// `upload_id` **must** be set. +// Request message for +// [CancelResumableWrite][google.storage.v2.Storage.CancelResumableWrite]. type CancelResumableWriteRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1232,7 +1260,7 @@ func (x *CancelResumableWriteRequest) GetUploadId() string { return "" } -// Empty response message for canceling an in-progress resumable upload, will be +// Empty response message for canceling an in-progress resumable upload, is // extended as needed. type CancelResumableWriteResponse struct { state protoimpl.MessageState @@ -1270,7 +1298,7 @@ func (*CancelResumableWriteResponse) Descriptor() ([]byte, []int) { return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{11} } -// Request message for ReadObject. +// Request message for [ReadObject][google.storage.v2.Storage.ReadObject]. type ReadObjectRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1286,16 +1314,16 @@ type ReadObjectRequest struct { // Optional. The offset for the first byte to return in the read, relative to // the start of the object. // - // A negative `read_offset` value will be interpreted as the number of bytes + // A negative `read_offset` value is interpreted as the number of bytes // back from the end of the object to be returned. For example, if an object's - // length is 15 bytes, a ReadObjectRequest with `read_offset` = -5 and - // `read_limit` = 3 would return bytes 10 through 12 of the object. Requesting - // a negative offset with magnitude larger than the size of the object will - // return the entire object. + // length is `15` bytes, a `ReadObjectRequest` with `read_offset` = `-5` and + // `read_limit` = `3` would return bytes `10` through `12` of the object. + // Requesting a negative offset with magnitude larger than the size of the + // object returns the entire object. ReadOffset int64 `protobuf:"varint,4,opt,name=read_offset,json=readOffset,proto3" json:"read_offset,omitempty"` // Optional. The maximum number of `data` bytes the server is allowed to // return in the sum of all `Object` messages. A `read_limit` of zero - // indicates that there is no limit, and a negative `read_limit` will cause an + // indicates that there is no limit, and a negative `read_limit` causes an // error. // // If the stream returns fewer bytes than allowed by the `read_limit` and no @@ -1321,10 +1349,10 @@ type ReadObjectRequest struct { // object. CommonObjectRequestParams *CommonObjectRequestParams `protobuf:"bytes,10,opt,name=common_object_request_params,json=commonObjectRequestParams,proto3" json:"common_object_request_params,omitempty"` // Mask specifying which fields to read. - // The checksummed_data field and its children will always be present. - // If no mask is specified, will default to all fields except metadata.owner - // and metadata.acl. - // * may be used to mean "all fields". + // The `checksummed_data` field and its children are always present. + // If no mask is specified, it defaults to all fields except `metadata. + // owner` and `metadata.acl`. + // `*` might be used to mean "all fields". ReadMask *fieldmaskpb.FieldMask `protobuf:"bytes,12,opt,name=read_mask,json=readMask,proto3,oneof" json:"read_mask,omitempty"` } @@ -1435,7 +1463,7 @@ func (x *ReadObjectRequest) GetReadMask() *fieldmaskpb.FieldMask { return nil } -// Request message for GetObject. +// Request message for [GetObject][google.storage.v2.Storage.GetObject]. type GetObjectRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1469,15 +1497,15 @@ type GetObjectRequest struct { // object. CommonObjectRequestParams *CommonObjectRequestParams `protobuf:"bytes,8,opt,name=common_object_request_params,json=commonObjectRequestParams,proto3" json:"common_object_request_params,omitempty"` // Mask specifying which fields to read. - // If no mask is specified, will default to all fields except metadata.acl and - // metadata.owner. - // * may be used to mean "all fields". + // If no mask is specified, it defaults to all fields except `metadata. + // acl` and `metadata.owner`. + // `*` might be used to mean "all fields". ReadMask *fieldmaskpb.FieldMask `protobuf:"bytes,10,opt,name=read_mask,json=readMask,proto3,oneof" json:"read_mask,omitempty"` // Optional. Restore token used to differentiate soft-deleted objects with the // same name and generation. Only applicable for hierarchical namespace - // buckets and if soft_deleted is set to true. This parameter is optional, and - // is only required in the rare case when there are multiple soft-deleted - // objects with the same name and generation. + // buckets and if `soft_deleted` is set to `true`. This parameter is optional, + // and is only required in the rare case when there are multiple soft-deleted + // objects with the same `name` and `generation`. RestoreToken string `protobuf:"bytes,12,opt,name=restore_token,json=restoreToken,proto3" json:"restore_token,omitempty"` } @@ -1588,13 +1616,13 @@ func (x *GetObjectRequest) GetRestoreToken() string { return "" } -// Response message for ReadObject. +// Response message for [ReadObject][google.storage.v2.Storage.ReadObject]. type ReadObjectResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // A portion of the data for the object. The service **may** leave `data` + // A portion of the data for the object. The service might leave `data` // empty for any given `ReadResponse`. This enables the service to inform the // client that the request is still live while it is running an operation to // generate more data. @@ -1603,9 +1631,9 @@ type ReadObjectResponse struct { // the client should compute one of these checksums over the downloaded object // and compare it against the value provided here. ObjectChecksums *ObjectChecksums `protobuf:"bytes,2,opt,name=object_checksums,json=objectChecksums,proto3" json:"object_checksums,omitempty"` - // If read_offset and or read_limit was specified on the - // ReadObjectRequest, ContentRange will be populated on the first - // ReadObjectResponse message of the read stream. + // If `read_offset` and or `read_limit` is specified on the + // `ReadObjectRequest`, `ContentRange` is populated on the first + // `ReadObjectResponse` message of the read stream. ContentRange *ContentRange `protobuf:"bytes,3,opt,name=content_range,json=contentRange,proto3" json:"content_range,omitempty"` // Metadata of the object whose media is being returned. // Only populated in the first response in the stream. @@ -1702,13 +1730,12 @@ type BidiReadObjectSpec struct { // object. CommonObjectRequestParams *CommonObjectRequestParams `protobuf:"bytes,8,opt,name=common_object_request_params,json=commonObjectRequestParams,proto3" json:"common_object_request_params,omitempty"` // Mask specifying which fields to read. - // The checksummed_data field and its children will always be present. - // If no mask is specified, will default to all fields except metadata.owner - // and metadata.acl. - // * may be used to mean "all fields". + // The `checksummed_data` field and its children are always present. + // If no mask is specified, it defaults to all fields except `metadata. + // owner` and `metadata.acl`. + // `*` might be used to mean "all fields". // As per https://google.aip.dev/161, this field is deprecated. - // As an alternative, grpc metadata can be used: - // https://cloud.google.com/apis/docs/system-parameters#definitions + // As an alternative, `grpc metadata` can be used: // // Deprecated: Marked as deprecated in google/storage/v2/storage.proto. ReadMask *fieldmaskpb.FieldMask `protobuf:"bytes,12,opt,name=read_mask,json=readMask,proto3,oneof" json:"read_mask,omitempty"` @@ -1829,22 +1856,23 @@ func (x *BidiReadObjectSpec) GetRoutingToken() string { return "" } -// Request message for BidiReadObject. +// Request message for +// [BidiReadObject][google.storage.v2.Storage.BidiReadObject]. type BidiReadObjectRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Optional. The first message of each stream should set this field. If this - // is not the first message, an error will be returned. Describes the object - // to read. + // is not the first message, an error is returned. Describes the object to + // read. ReadObjectSpec *BidiReadObjectSpec `protobuf:"bytes,1,opt,name=read_object_spec,json=readObjectSpec,proto3" json:"read_object_spec,omitempty"` // Optional. Provides a list of 0 or more (up to 100) ranges to read. If a // single range is large enough to require multiple responses, they are - // guaranteed to be delivered in increasing offset order. There are no - // ordering guarantees across ranges. When no ranges are provided, the - // response message will not include ObjectRangeData. For full object - // downloads, the offset and size can be set to 0. + // delivered in increasing offset order. There are no ordering guarantees + // across ranges. When no ranges are provided, the response message + // doesn't include `ObjectRangeData`. For full object downloads, the + // offset and size can be set to `0`. ReadRanges []*ReadRange `protobuf:"bytes,8,rep,name=read_ranges,json=readRanges,proto3" json:"read_ranges,omitempty"` } @@ -1892,25 +1920,26 @@ func (x *BidiReadObjectRequest) GetReadRanges() []*ReadRange { return nil } -// Response message for BidiReadObject. +// Response message for +// [BidiReadObject][google.storage.v2.Storage.BidiReadObject]. type BidiReadObjectResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // A portion of the object's data. The service **may** leave data - // empty for any given ReadResponse. This enables the service to inform the + // A portion of the object's data. The service might leave data + // empty for any given `ReadResponse`. This enables the service to inform the // client that the request is still live while it is running an operation to // generate more data. - // The service **may** pipeline multiple responses belonging to different read - // requests. Each ObjectRangeData entry will have a read_id - // set to the same value as the corresponding source read request. + // The service might pipeline multiple responses belonging to different read + // requests. Each `ObjectRangeData` entry has a `read_id` that is set + // to the same value as the corresponding source read request. ObjectDataRanges []*ObjectRangeData `protobuf:"bytes,6,rep,name=object_data_ranges,json=objectDataRanges,proto3" json:"object_data_ranges,omitempty"` // Metadata of the object whose media is being returned. // Only populated in the first response in the stream and not populated when // the stream is opened with a read handle. Metadata *Object `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` - // This field will be periodically refreshed, however it may not be set in + // This field is periodically refreshed, however it might not be set in // every response. It allows the client to more efficiently open subsequent // bidirectional streams to the same object. ReadHandle *BidiReadHandle `protobuf:"bytes,7,opt,name=read_handle,json=readHandle,proto3" json:"read_handle,omitempty"` @@ -1967,15 +1996,15 @@ func (x *BidiReadObjectResponse) GetReadHandle() *BidiReadHandle { return nil } -// Error proto containing details for a redirected read. This error may be +// Error proto containing details for a redirected read. This error might be // attached as details for an ABORTED response to BidiReadObject. type BidiReadObjectRedirectedError struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // The read handle for the redirected read. If set, the client may use this in - // the BidiReadObjectSpec when retrying the read stream. + // The read handle for the redirected read. If set, the client might use this + // in the BidiReadObjectSpec when retrying the read stream. ReadHandle *BidiReadHandle `protobuf:"bytes,1,opt,name=read_handle,json=readHandle,proto3" json:"read_handle,omitempty"` // The routing token the client must use when retrying the read stream. // This value must be provided in the header `x-goog-request-params`, with key @@ -2027,7 +2056,7 @@ func (x *BidiReadObjectRedirectedError) GetRoutingToken() string { return "" } -// Error proto containing details for a redirected write. This error may be +// Error proto containing details for a redirected write. This error might be // attached as details for an ABORTED response to BidiWriteObject. type BidiWriteObjectRedirectedError struct { state protoimpl.MessageState @@ -2040,11 +2069,11 @@ type BidiWriteObjectRedirectedError struct { RoutingToken *string `protobuf:"bytes,1,opt,name=routing_token,json=routingToken,proto3,oneof" json:"routing_token,omitempty"` // Opaque value describing a previous write. If set, the client must use this // in an AppendObjectSpec first_message when retrying the write stream. If not - // set, clients may retry the original request. + // set, clients might retry the original request. WriteHandle *BidiWriteHandle `protobuf:"bytes,2,opt,name=write_handle,json=writeHandle,proto3,oneof" json:"write_handle,omitempty"` - // The generation of the object that triggered the redirect. This will be set - // iff write_handle is set. If set, the client must use this in an - // AppendObjectSpec first_message when retrying the write stream. + // The generation of the object that triggered the redirect. This is set + // iff `write_handle` is set. If set, the client must use this in an + // `AppendObjectSpec` first_message when retrying the write stream. Generation *int64 `protobuf:"varint,3,opt,name=generation,proto3,oneof" json:"generation,omitempty"` } @@ -2203,7 +2232,7 @@ func (x *ReadRangeError) GetStatus() *status.Status { return nil } -// Describes a range of bytes to read in a BidiReadObjectRanges request. +// Describes a range of bytes to read in a `BidiReadObjectRanges` request. type ReadRange struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2212,26 +2241,26 @@ type ReadRange struct { // Required. The offset for the first byte to return in the read, relative to // the start of the object. // - // A negative read_offset value will be interpreted as the number of bytes + // A negative read_offset value is interpreted as the number of bytes // back from the end of the object to be returned. For example, if an object's - // length is 15 bytes, a ReadObjectRequest with read_offset = -5 and - // read_length = 3 would return bytes 10 through 12 of the object. Requesting - // a negative offset with magnitude larger than the size of the object will - // return the entire object. A read_offset larger than the size of the object - // will result in an OutOfRange error. + // length is 15 bytes, a `ReadObjectRequest` with `read_offset` = -5 and + // `read_length` = 3 would return bytes 10 through 12 of the object. + // Requesting a negative offset with magnitude larger than the size of the + // object returns the entire object. A `read_offset` larger than the size + // of the object results in an `OutOfRange` error. ReadOffset int64 `protobuf:"varint,1,opt,name=read_offset,json=readOffset,proto3" json:"read_offset,omitempty"` // Optional. The maximum number of data bytes the server is allowed to return - // across all response messages with the same read_id. A read_length of zero - // indicates to read until the resource end, and a negative read_length will - // cause an error. If the stream returns fewer bytes than allowed by the - // read_length and no error occurred, the stream includes all data from the - // read_offset to the resource end. + // across all response messages with the same `read_id`. A `read_length` of + // zero indicates to read until the resource end, and a negative `read_length` + // causes an error. If the stream returns fewer bytes than allowed by the + // `read_length` and no error occurred, the stream includes all data from the + // `read_offset` to the resource end. ReadLength int64 `protobuf:"varint,2,opt,name=read_length,json=readLength,proto3" json:"read_length,omitempty"` // Required. Read identifier provided by the client. When the client issues - // more than one outstanding ReadRange on the same stream, responses can be + // more than one outstanding `ReadRange` on the same stream, responses can be // mapped back to their corresponding requests using this value. Clients must // ensure that all outstanding requests have different read_id values. The - // server may close the stream with an error if this condition is not met. + // server might close the stream with an error if this condition is not met. ReadId int64 `protobuf:"varint,3,opt,name=read_id,json=readId,proto3" json:"read_id,omitempty"` } @@ -2294,11 +2323,11 @@ type ObjectRangeData struct { // A portion of the data for the object. ChecksummedData *ChecksummedData `protobuf:"bytes,1,opt,name=checksummed_data,json=checksummedData,proto3" json:"checksummed_data,omitempty"` - // The ReadRange describes the content being returned with read_id set to the - // corresponding ReadObjectRequest in the stream. Multiple ObjectRangeData - // messages may have the same read_id but increasing offsets. - // ReadObjectResponse messages with the same read_id are guaranteed to be - // delivered in increasing offset order. + // The `ReadRange` describes the content being returned with `read_id` set to + // the corresponding `ReadObjectRequest` in the stream. Multiple + // `ObjectRangeData` messages might have the same read_id but increasing + // offsets. `ReadObjectResponse` messages with the same `read_id` are + // guaranteed to be delivered in increasing offset order. ReadRange *ReadRange `protobuf:"bytes,2,opt,name=read_range,json=readRange,proto3" json:"read_range,omitempty"` // If set, indicates there are no more bytes to read for the given ReadRange. RangeEnd bool `protobuf:"varint,3,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"` @@ -2355,8 +2384,8 @@ func (x *ObjectRangeData) GetRangeEnd() bool { return false } -// BidiReadHandle contains a handle from a previous BiDiReadObject -// invocation. The client can use this instead of BidiReadObjectSpec as an +// `BidiReadHandle` contains a handle from a previous `BiDiReadObject` +// invocation. The client can use this instead of `BidiReadObjectSpec` as an // optimized way of opening subsequent bidirectional streams to the same object. type BidiReadHandle struct { state protoimpl.MessageState @@ -2404,9 +2433,9 @@ func (x *BidiReadHandle) GetHandle() []byte { return nil } -// BidiWriteHandle contains a handle from a previous BidiWriteObject -// invocation. The client can use this as an optimized way of opening subsequent -// bidirectional streams to the same object. +// `BidiWriteHandle` contains a handle from a previous `BidiWriteObject` +// invocation. The client can use this instead of `BidiReadObjectSpec` as an +// optimized way of opening subsequent bidirectional streams to the same object. type BidiWriteHandle struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2462,16 +2491,16 @@ type WriteObjectSpec struct { // Required. Destination object, including its name and its metadata. Resource *Object `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` // Optional. Apply a predefined set of access controls to this object. - // Valid values are "authenticatedRead", "bucketOwnerFullControl", - // "bucketOwnerRead", "private", "projectPrivate", or "publicRead". + // Valid values are `authenticatedRead`, `bucketOwnerFullControl`, + // `bucketOwnerRead`, `private`, `projectPrivate`, or `publicRead`. PredefinedAcl string `protobuf:"bytes,7,opt,name=predefined_acl,json=predefinedAcl,proto3" json:"predefined_acl,omitempty"` // Makes the operation conditional on whether the object's current - // generation matches the given value. Setting to 0 makes the operation + // generation matches the given value. Setting to `0` makes the operation // succeed only if there are no live versions of the object. IfGenerationMatch *int64 `protobuf:"varint,3,opt,name=if_generation_match,json=ifGenerationMatch,proto3,oneof" json:"if_generation_match,omitempty"` // Makes the operation conditional on whether the object's live // generation does not match the given value. If no live object exists, the - // precondition fails. Setting to 0 makes the operation succeed only if + // precondition fails. Setting to `0` makes the operation succeed only if // there is a live version of the object. IfGenerationNotMatch *int64 `protobuf:"varint,4,opt,name=if_generation_not_match,json=ifGenerationNotMatch,proto3,oneof" json:"if_generation_not_match,omitempty"` // Makes the operation conditional on whether the object's current @@ -2482,14 +2511,14 @@ type WriteObjectSpec struct { IfMetagenerationNotMatch *int64 `protobuf:"varint,6,opt,name=if_metageneration_not_match,json=ifMetagenerationNotMatch,proto3,oneof" json:"if_metageneration_not_match,omitempty"` // The expected final object size being uploaded. // If this value is set, closing the stream after writing fewer or more than - // `object_size` bytes will result in an OUT_OF_RANGE error. + // `object_size` bytes results in an `OUT_OF_RANGE` error. // // This situation is considered a client error, and if such an error occurs // you must start the upload over from scratch, this time sending the correct // number of bytes. ObjectSize *int64 `protobuf:"varint,8,opt,name=object_size,json=objectSize,proto3,oneof" json:"object_size,omitempty"` - // If true, the object will be created in appendable mode. - // This field may only be set when using BidiWriteObject. + // If `true`, the object is created in appendable mode. + // This field might only be set when using `BidiWriteObject`. Appendable *bool `protobuf:"varint,9,opt,name=appendable,proto3,oneof" json:"appendable,omitempty"` } @@ -2579,7 +2608,7 @@ func (x *WriteObjectSpec) GetAppendable() bool { return false } -// Request message for WriteObject. +// Request message for [WriteObject][google.storage.v2.Storage.WriteObject]. type WriteObjectRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2604,7 +2633,7 @@ type WriteObjectRequest struct { // first `write_offset` and the sizes of all `data` chunks sent previously on // this stream. // - // An incorrect value will cause an error. + // An incorrect value causes an error. WriteOffset int64 `protobuf:"varint,3,opt,name=write_offset,json=writeOffset,proto3" json:"write_offset,omitempty"` // A portion of the data for the object. // @@ -2613,19 +2642,19 @@ type WriteObjectRequest struct { // *WriteObjectRequest_ChecksummedData Data isWriteObjectRequest_Data `protobuf_oneof:"data"` // Optional. Checksums for the complete object. If the checksums computed by - // the service don't match the specified checksums the call will fail. May - // only be provided in the first or last request (either with first_message, - // or finish_write set). + // the service don't match the specified checksums the call fails. This field + // might only be provided in the first or last request (either with + // `first_message`, or `finish_write` set). ObjectChecksums *ObjectChecksums `protobuf:"bytes,6,opt,name=object_checksums,json=objectChecksums,proto3" json:"object_checksums,omitempty"` // Optional. If `true`, this indicates that the write is complete. Sending any // `WriteObjectRequest`s subsequent to one in which `finish_write` is `true` - // will cause an error. - // For a non-resumable write (where the upload_id was not set in the first + // causes an error. + // For a non-resumable write (where the `upload_id` was not set in the first // message), it is an error not to set this field in the final message of the // stream. FinishWrite bool `protobuf:"varint,7,opt,name=finish_write,json=finishWrite,proto3" json:"finish_write,omitempty"` - // Optional. A set of parameters common to Storage API requests concerning an - // object. + // Optional. A set of parameters common to Cloud Storage API requests + // concerning an object. CommonObjectRequestParams *CommonObjectRequestParams `protobuf:"bytes,8,opt,name=common_object_request_params,json=commonObjectRequestParams,proto3" json:"common_object_request_params,omitempty"` } @@ -2748,19 +2777,20 @@ type isWriteObjectRequest_Data interface { type WriteObjectRequest_ChecksummedData struct { // The data to insert. If a crc32c checksum is provided that doesn't match - // the checksum computed by the service, the request will fail. + // the checksum computed by the service, the request fails. ChecksummedData *ChecksummedData `protobuf:"bytes,4,opt,name=checksummed_data,json=checksummedData,proto3,oneof"` } func (*WriteObjectRequest_ChecksummedData) isWriteObjectRequest_Data() {} -// Response message for WriteObject. +// Response message for +// [WriteObject][google.storage.v2.Storage.WriteObject]. type WriteObjectResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // The response will set one of the following. + // The response sets one of the following. // // Types that are assignable to WriteStatus: // @@ -2865,7 +2895,7 @@ type AppendObjectSpec struct { // is empty. IfMetagenerationNotMatch *int64 `protobuf:"varint,5,opt,name=if_metageneration_not_match,json=ifMetagenerationNotMatch,proto3,oneof" json:"if_metageneration_not_match,omitempty"` // An optional routing token that influences request routing for the stream. - // Must be provided if a BidiWriteObjectRedirectedError is returned. + // Must be provided if a `BidiWriteObjectRedirectedError` is returned. RoutingToken *string `protobuf:"bytes,6,opt,name=routing_token,json=routingToken,proto3,oneof" json:"routing_token,omitempty"` // An optional write handle returned from a previous BidiWriteObjectResponse // message or a BidiWriteObjectRedirectedError error. @@ -2954,7 +2984,8 @@ func (x *AppendObjectSpec) GetWriteHandle() *BidiWriteHandle { return nil } -// Request message for BidiWriteObject. +// Request message for +// [BidiWriteObject][google.storage.v2.Storage.BidiWriteObject]. type BidiWriteObjectRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2972,15 +3003,15 @@ type BidiWriteObjectRequest struct { // should be written. // // In the first `WriteObjectRequest` of a `WriteObject()` action, it - // indicates the initial offset for the `Write()` call. The value **must** be + // indicates the initial offset for the `Write()` call. The value must be // equal to the `persisted_size` that a call to `QueryWriteStatus()` would // return (0 if this is the first write to the object). // - // On subsequent calls, this value **must** be no larger than the sum of the + // On subsequent calls, this value must be no larger than the sum of the // first `write_offset` and the sizes of all `data` chunks sent previously on // this stream. // - // An invalid value will cause an error. + // An invalid value causes an error. WriteOffset int64 `protobuf:"varint,3,opt,name=write_offset,json=writeOffset,proto3" json:"write_offset,omitempty"` // A portion of the data for the object. // @@ -2989,30 +3020,30 @@ type BidiWriteObjectRequest struct { // *BidiWriteObjectRequest_ChecksummedData Data isBidiWriteObjectRequest_Data `protobuf_oneof:"data"` // Optional. Checksums for the complete object. If the checksums computed by - // the service don't match the specified checksums the call will fail. May - // only be provided in the first request or the last request (with - // finish_write set). + // the service don't match the specified checksums the call fails. Might only + // be provided in the first request or the last request (with finish_write + // set). ObjectChecksums *ObjectChecksums `protobuf:"bytes,6,opt,name=object_checksums,json=objectChecksums,proto3" json:"object_checksums,omitempty"` - // Optional. For each BidiWriteObjectRequest where state_lookup is `true` or - // the client closes the stream, the service will send a - // BidiWriteObjectResponse containing the current persisted size. The + // Optional. For each `BidiWriteObjectRequest` where `state_lookup` is `true` + // or the client closes the stream, the service sends a + // `BidiWriteObjectResponse` containing the current persisted size. The // persisted size sent in responses covers all the bytes the server has // persisted thus far and can be used to decide what data is safe for the // client to drop. Note that the object's current size reported by the - // BidiWriteObjectResponse may lag behind the number of bytes written by the - // client. This field is ignored if `finish_write` is set to true. + // `BidiWriteObjectResponse` might lag behind the number of bytes written by + // the client. This field is ignored if `finish_write` is set to true. StateLookup bool `protobuf:"varint,7,opt,name=state_lookup,json=stateLookup,proto3" json:"state_lookup,omitempty"` // Optional. Persists data written on the stream, up to and including the // current message, to permanent storage. This option should be used sparingly - // as it may reduce performance. Ongoing writes will periodically be persisted + // as it might reduce performance. Ongoing writes are periodically persisted // on the server even when `flush` is not set. This field is ignored if // `finish_write` is set to true since there's no need to checkpoint or flush // if this message completes the write. Flush bool `protobuf:"varint,8,opt,name=flush,proto3" json:"flush,omitempty"` // Optional. If `true`, this indicates that the write is complete. Sending any // `WriteObjectRequest`s subsequent to one in which `finish_write` is `true` - // will cause an error. - // For a non-resumable write (where the upload_id was not set in the first + // causes an error. + // For a non-resumable write (where the `upload_id` was not set in the first // message), it is an error not to set this field in the final message of the // stream. FinishWrite bool `protobuf:"varint,9,opt,name=finish_write,json=finishWrite,proto3" json:"finish_write,omitempty"` @@ -3168,7 +3199,7 @@ type isBidiWriteObjectRequest_Data interface { type BidiWriteObjectRequest_ChecksummedData struct { // The data to insert. If a crc32c checksum is provided that doesn't match - // the checksum computed by the service, the request will fail. + // the checksum computed by the service, the request fails. ChecksummedData *ChecksummedData `protobuf:"bytes,4,opt,name=checksummed_data,json=checksummedData,proto3,oneof"` } @@ -3180,14 +3211,14 @@ type BidiWriteObjectResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // The response will set one of the following. + // The response sets one of the following. // // Types that are assignable to WriteStatus: // // *BidiWriteObjectResponse_PersistedSize // *BidiWriteObjectResponse_Resource WriteStatus isBidiWriteObjectResponse_WriteStatus `protobuf_oneof:"write_status"` - // An optional write handle that will periodically be present in response + // An optional write handle that is returned periodically in response // messages. Clients should save it for later use in establishing a new stream // if a connection is interrupted. WriteHandle *BidiWriteHandle `protobuf:"bytes,3,opt,name=write_handle,json=writeHandle,proto3,oneof" json:"write_handle,omitempty"` @@ -3271,7 +3302,7 @@ func (*BidiWriteObjectResponse_PersistedSize) isBidiWriteObjectResponse_WriteSta func (*BidiWriteObjectResponse_Resource) isBidiWriteObjectResponse_WriteStatus() {} -// Request message for ListObjects. +// Request message for [ListObjects][google.storage.v2.Storage.ListObjects]. type ListObjectsRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3281,58 +3312,57 @@ type ListObjectsRequest struct { Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` // Optional. Maximum number of `items` plus `prefixes` to return // in a single page of responses. As duplicate `prefixes` are - // omitted, fewer total results may be returned than requested. The service - // will use this parameter or 1,000 items, whichever is smaller. + // omitted, fewer total results might be returned than requested. The service + // uses this parameter or 1,000 items, whichever is smaller. PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` // Optional. A previously-returned page token representing part of the larger // set of results to view. PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - // Optional. If set, returns results in a directory-like mode. `items` will - // contain only objects whose names, aside from the `prefix`, do not contain + // Optional. If set, returns results in a directory-like mode. `items` + // contains only objects whose names, aside from the `prefix`, do not contain // `delimiter`. Objects whose names, aside from the `prefix`, contain - // `delimiter` will have their name, truncated after the `delimiter`, returned - // in `prefixes`. Duplicate `prefixes` are omitted. + // `delimiter` has their name, truncated after the `delimiter`, returned in + // `prefixes`. Duplicate `prefixes` are omitted. Delimiter string `protobuf:"bytes,4,opt,name=delimiter,proto3" json:"delimiter,omitempty"` // Optional. If true, objects that end in exactly one instance of `delimiter` - // will have their metadata included in `items` in addition to + // has their metadata included in `items` in addition to // `prefixes`. IncludeTrailingDelimiter bool `protobuf:"varint,5,opt,name=include_trailing_delimiter,json=includeTrailingDelimiter,proto3" json:"include_trailing_delimiter,omitempty"` // Optional. Filter results to objects whose names begin with this prefix. Prefix string `protobuf:"bytes,6,opt,name=prefix,proto3" json:"prefix,omitempty"` // Optional. If `true`, lists all versions of an object as distinct results. - // For more information, see - // [Object - // Versioning](https://cloud.google.com/storage/docs/object-versioning). Versions bool `protobuf:"varint,7,opt,name=versions,proto3" json:"versions,omitempty"` // Mask specifying which fields to read from each result. - // If no mask is specified, will default to all fields except items.acl and - // items.owner. - // * may be used to mean "all fields". + // If no mask is specified, defaults to all fields except `items.acl` and + // `items.owner`. + // `*` might be used to mean all fields. ReadMask *fieldmaskpb.FieldMask `protobuf:"bytes,8,opt,name=read_mask,json=readMask,proto3,oneof" json:"read_mask,omitempty"` // Optional. Filter results to objects whose names are lexicographically equal - // to or after lexicographic_start. If lexicographic_end is also set, the - // objects listed have names between lexicographic_start (inclusive) and - // lexicographic_end (exclusive). + // to or after `lexicographic_start`. If `lexicographic_end` is also set, the + // objects listed have names between `lexicographic_start` (inclusive) and + // `lexicographic_end` (exclusive). LexicographicStart string `protobuf:"bytes,10,opt,name=lexicographic_start,json=lexicographicStart,proto3" json:"lexicographic_start,omitempty"` // Optional. Filter results to objects whose names are lexicographically - // before lexicographic_end. If lexicographic_start is also set, the objects - // listed have names between lexicographic_start (inclusive) and - // lexicographic_end (exclusive). + // before `lexicographic_end`. If `lexicographic_start` is also set, the + // objects listed have names between `lexicographic_start` (inclusive) and + // `lexicographic_end` (exclusive). LexicographicEnd string `protobuf:"bytes,11,opt,name=lexicographic_end,json=lexicographicEnd,proto3" json:"lexicographic_end,omitempty"` // Optional. If true, only list all soft-deleted versions of the object. // Soft delete policy is required to set this option. SoftDeleted bool `protobuf:"varint,12,opt,name=soft_deleted,json=softDeleted,proto3" json:"soft_deleted,omitempty"` - // Optional. If true, will also include folders and managed folders (besides - // objects) in the returned `prefixes`. Requires `delimiter` to be set to '/'. + // Optional. If true, includes folders and managed folders (besides objects) + // in the returned `prefixes`. Requires `delimiter` to be set to '/'. IncludeFoldersAsPrefixes bool `protobuf:"varint,13,opt,name=include_folders_as_prefixes,json=includeFoldersAsPrefixes,proto3" json:"include_folders_as_prefixes,omitempty"` // Optional. Filter results to objects and prefixes that match this glob - // pattern. See [List Objects Using - // Glob](https://cloud.google.com/storage/docs/json_api/v1/objects/list#list-objects-and-prefixes-using-glob) + // pattern. See [List objects using + // glob](https://cloud.google.com/storage/docs/json_api/v1/objects/list#list-objects-and-prefixes-using-glob) // for the full syntax. MatchGlob string `protobuf:"bytes,14,opt,name=match_glob,json=matchGlob,proto3" json:"match_glob,omitempty"` - // Optional. Filter the returned objects. Currently only supported for the - // `contexts` field. If `delimiter` is set, the returned `prefixes` are exempt - // from this filter. + // Optional. An expression used to filter the returned objects by the + // `context` field. For the full syntax, see [Filter objects by contexts + // syntax](https://cloud.google.com/storage/docs/listing-objects#filter-by-object-contexts-syntax). + // If a `delimiter` is set, the returned `prefixes` are exempt from this + // filter. Filter string `protobuf:"bytes,15,opt,name=filter,proto3" json:"filter,omitempty"` } @@ -3464,7 +3494,8 @@ func (x *ListObjectsRequest) GetFilter() string { return "" } -// Request object for `QueryWriteStatus`. +// Request object for +// [QueryWriteStatus][google.storage.v2.Storage.QueryWriteStatus]. type QueryWriteStatusRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3522,13 +3553,14 @@ func (x *QueryWriteStatusRequest) GetCommonObjectRequestParams() *CommonObjectRe return nil } -// Response object for `QueryWriteStatus`. +// Response object for +// [QueryWriteStatus][google.storage.v2.Storage.QueryWriteStatus]. type QueryWriteStatusResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // The response will set one of the following. + // The response sets one of the following. // // Types that are assignable to WriteStatus: // @@ -3610,14 +3642,15 @@ func (*QueryWriteStatusResponse_PersistedSize) isQueryWriteStatusResponse_WriteS func (*QueryWriteStatusResponse_Resource) isQueryWriteStatusResponse_WriteStatus() {} -// Request message for RewriteObject. +// Request message for [RewriteObject][google.storage.v2.Storage.RewriteObject]. // If the source object is encrypted using a Customer-Supplied Encryption Key -// the key information must be provided in the copy_source_encryption_algorithm, -// copy_source_encryption_key_bytes, and copy_source_encryption_key_sha256_bytes -// fields. If the destination object should be encrypted the keying information -// should be provided in the encryption_algorithm, encryption_key_bytes, and -// encryption_key_sha256_bytes fields of the -// common_object_request_params.customer_encryption field. +// the key information must be provided in the +// `copy_source_encryption_algorithm`, `copy_source_encryption_key_bytes`, and +// `copy_source_encryption_key_sha256_bytes` fields. If the destination object +// should be encrypted the keying information should be provided in the +// `encryption_algorithm`, `encryption_key_bytes`, and +// `encryption_key_sha256_bytes` fields of the +// `common_object_request_params.customer_encryption` field. type RewriteObjectRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3634,7 +3667,7 @@ type RewriteObjectRequest struct { // Required. Immutable. The name of the bucket containing the destination // object. DestinationBucket string `protobuf:"bytes,25,opt,name=destination_bucket,json=destinationBucket,proto3" json:"destination_bucket,omitempty"` - // Optional. The name of the Cloud KMS key that will be used to encrypt the + // Optional. The name of the Cloud KMS key that is used to encrypt the // destination object. The Cloud KMS key must be located in same location as // the object. If the parameter is not specified, the request uses the // destination bucket's default encryption key, if any, or else the @@ -3644,8 +3677,8 @@ type RewriteObjectRequest struct { // The `name`, `bucket` and `kms_key` fields must not be populated (these // values are specified in the `destination_name`, `destination_bucket`, and // `destination_kms_key` fields). - // If `destination` is present it will be used to construct the destination - // object's metadata; otherwise the destination object's metadata will be + // If `destination` is present it is used to construct the destination + // object's metadata; otherwise the destination object's metadata is // copied from the source object. Destination *Object `protobuf:"bytes,1,opt,name=destination,proto3" json:"destination,omitempty"` // Required. Name of the bucket in which to find the source object. @@ -3662,8 +3695,8 @@ type RewriteObjectRequest struct { // first rewrite request. RewriteToken string `protobuf:"bytes,5,opt,name=rewrite_token,json=rewriteToken,proto3" json:"rewrite_token,omitempty"` // Optional. Apply a predefined set of access controls to the destination - // object. Valid values are "authenticatedRead", "bucketOwnerFullControl", - // "bucketOwnerRead", "private", "projectPrivate", or "publicRead". + // object. Valid values are `authenticatedRead`, `bucketOwnerFullControl`, + // `bucketOwnerRead`, `private`, `projectPrivate`, or `publicRead`. DestinationPredefinedAcl string `protobuf:"bytes,28,opt,name=destination_predefined_acl,json=destinationPredefinedAcl,proto3" json:"destination_predefined_acl,omitempty"` // Makes the operation conditional on whether the object's current generation // matches the given value. Setting to 0 makes the operation succeed only if @@ -3692,7 +3725,7 @@ type RewriteObjectRequest struct { // Makes the operation conditional on whether the source object's current // metageneration does not match the given value. IfSourceMetagenerationNotMatch *int64 `protobuf:"varint,14,opt,name=if_source_metageneration_not_match,json=ifSourceMetagenerationNotMatch,proto3,oneof" json:"if_source_metageneration_not_match,omitempty"` - // Optional. The maximum number of bytes that will be rewritten per rewrite + // Optional. The maximum number of bytes that are rewritten per rewrite // request. Most callers shouldn't need to specify this parameter - it is // primarily in place to support testing. If specified the value must be an // integral multiple of 1 MiB (1048576). Also, this only applies to requests @@ -3714,8 +3747,8 @@ type RewriteObjectRequest struct { // Optional. A set of parameters common to Storage API requests concerning an // object. CommonObjectRequestParams *CommonObjectRequestParams `protobuf:"bytes,19,opt,name=common_object_request_params,json=commonObjectRequestParams,proto3" json:"common_object_request_params,omitempty"` - // Optional. The checksums of the complete object. This will be used to - // validate the destination object after rewriting. + // Optional. The checksums of the complete object. This is used to validate + // the destination object after rewriting. ObjectChecksums *ObjectChecksums `protobuf:"bytes,29,opt,name=object_checksums,json=objectChecksums,proto3" json:"object_checksums,omitempty"` } @@ -3998,7 +4031,7 @@ func (x *RewriteResponse) GetResource() *Object { return nil } -// Request message for MoveObject. +// Request message for [MoveObject][google.storage.v2.Storage.MoveObject]. type MoveObjectRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -4167,7 +4200,8 @@ func (x *MoveObjectRequest) GetIfMetagenerationNotMatch() int64 { return 0 } -// Request message StartResumableWrite. +// Request message for +// [StartResumableWrite][google.storage.v2.Storage.StartResumableWrite]. type StartResumableWriteRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -4237,7 +4271,8 @@ func (x *StartResumableWriteRequest) GetObjectChecksums() *ObjectChecksums { return nil } -// Response object for `StartResumableWrite`. +// Response object for +// [StartResumableWrite][google.storage.v2.Storage.StartResumableWrite]. type StartResumableWriteResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -4288,7 +4323,7 @@ func (x *StartResumableWriteResponse) GetUploadId() string { return "" } -// Request message for UpdateObject. +// Request message for [UpdateObject][google.storage.v2.Storage.UpdateObject]. type UpdateObjectRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -4324,7 +4359,7 @@ type UpdateObjectRequest struct { // To specify ALL fields, equivalent to the JSON API's "update" function, // specify a single field with the value `*`. Note: not recommended. If a new // field is introduced at a later time, an older client updating with the `*` - // may accidentally reset the new field's value. + // might accidentally reset the new field's value. // // Not specifying any fields is an error. UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,7,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` @@ -4440,8 +4475,8 @@ type CommonObjectRequestParams struct { // Optional. Encryption key used with the Customer-Supplied Encryption Keys // feature. In raw bytes format (not base64-encoded). EncryptionKeyBytes []byte `protobuf:"bytes,4,opt,name=encryption_key_bytes,json=encryptionKeyBytes,proto3" json:"encryption_key_bytes,omitempty"` - // Optional. SHA256 hash of encryption key used with the Customer-Supplied - // Encryption Keys feature. + // Optional. SHA256 hash of encryption key used with the Customer-supplied + // encryption keys feature. EncryptionKeySha256Bytes []byte `protobuf:"bytes,5,opt,name=encryption_key_sha256_bytes,json=encryptionKeySha256Bytes,proto3" json:"encryption_key_sha256_bytes,omitempty"` } @@ -4544,25 +4579,23 @@ type Bucket struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Output only. The user-chosen part of the bucket name. The `{bucket}` // portion of the `name` field. For globally unique buckets, this is equal to - // the "bucket name" of other Cloud Storage APIs. Example: "pub". + // the `bucket name` of other Cloud Storage APIs. Example: `pub`. BucketId string `protobuf:"bytes,2,opt,name=bucket_id,json=bucketId,proto3" json:"bucket_id,omitempty"` // The etag of the bucket. - // If included in the metadata of an UpdateBucketRequest, the operation will - // only be performed if the etag matches that of the bucket. + // If included in the metadata of an `UpdateBucketRequest`, the operation is + // only performed if the `etag` matches that of the bucket. Etag string `protobuf:"bytes,29,opt,name=etag,proto3" json:"etag,omitempty"` // Immutable. The project which owns this bucket, in the format of - // "projects/{projectIdentifier}". - // {projectIdentifier} can be the project ID or project number. - // Output values will always be in project number format. + // `projects/{projectIdentifier}`. + // `{projectIdentifier}` can be the project ID or project number. + // Output values are always in the project number format. Project string `protobuf:"bytes,3,opt,name=project,proto3" json:"project,omitempty"` // Output only. The metadata generation of this bucket. Metageneration int64 `protobuf:"varint,4,opt,name=metageneration,proto3" json:"metageneration,omitempty"` // Immutable. The location of the bucket. Object data for objects in the // bucket resides in physical storage within this region. Defaults to `US`. - // See the - // [https://developers.google.com/storage/docs/concepts-techniques#specifyinglocations"][developer's - // guide] for the authoritative list. Attempting to update this field after - // the bucket is created will result in an error. + // Attempting to update this field after the bucket is created results in an + // error. Location string `protobuf:"bytes,5,opt,name=location,proto3" json:"location,omitempty"` // Output only. The location type of the bucket (region, dual-region, // multi-region, etc). @@ -4570,44 +4603,44 @@ type Bucket struct { // Optional. The bucket's default storage class, used whenever no storageClass // is specified for a newly-created object. This defines how objects in the // bucket are stored and determines the SLA and the cost of storage. - // If this value is not specified when the bucket is created, it will default - // to `STANDARD`. For more information, see - // https://developers.google.com/storage/docs/storage-classes. + // If this value is not specified when the bucket is created, it defaults + // to `STANDARD`. For more information, see [Storage + // classes](https://developers.google.com/storage/docs/storage-classes). StorageClass string `protobuf:"bytes,7,opt,name=storage_class,json=storageClass,proto3" json:"storage_class,omitempty"` // Optional. The recovery point objective for cross-region replication of the - // bucket. Applicable only for dual- and multi-region buckets. "DEFAULT" uses - // default replication. "ASYNC_TURBO" enables turbo replication, valid for + // bucket. Applicable only for dual- and multi-region buckets. `DEFAULT` uses + // default replication. `ASYNC_TURBO` enables turbo replication, valid for // dual-region buckets only. If rpo is not specified when the bucket is - // created, it defaults to "DEFAULT". For more information, see - // https://cloud.google.com/storage/docs/availability-durability#turbo-replication. + // created, it defaults to `DEFAULT`. For more information, see [Turbo + // replication](https://cloud.google.com/storage/docs/availability-durability#turbo-replication). Rpo string `protobuf:"bytes,27,opt,name=rpo,proto3" json:"rpo,omitempty"` // Optional. Access controls on the bucket. - // If iam_config.uniform_bucket_level_access is enabled on this bucket, + // If `iam_config.uniform_bucket_level_access` is enabled on this bucket, // requests to set, read, or modify acl is an error. Acl []*BucketAccessControl `protobuf:"bytes,8,rep,name=acl,proto3" json:"acl,omitempty"` // Optional. Default access controls to apply to new objects when no ACL is - // provided. If iam_config.uniform_bucket_level_access is enabled on this + // provided. If `iam_config.uniform_bucket_level_access` is enabled on this // bucket, requests to set, read, or modify acl is an error. DefaultObjectAcl []*ObjectAccessControl `protobuf:"bytes,9,rep,name=default_object_acl,json=defaultObjectAcl,proto3" json:"default_object_acl,omitempty"` - // Optional. The bucket's lifecycle config. See - // [https://developers.google.com/storage/docs/lifecycle]Lifecycle Management] - // for more information. + // Optional. The bucket's lifecycle configuration. See [Lifecycle + // Management](https://developers.google.com/storage/docs/lifecycle) for more + // information. Lifecycle *Bucket_Lifecycle `protobuf:"bytes,10,opt,name=lifecycle,proto3" json:"lifecycle,omitempty"` // Output only. The creation time of the bucket. CreateTime *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - // Optional. The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource - // Sharing] (CORS) config. + // Optional. The bucket's [CORS](https://www.w3.org/TR/cors/) + // configuration. Cors []*Bucket_Cors `protobuf:"bytes,12,rep,name=cors,proto3" json:"cors,omitempty"` // Output only. The modification time of the bucket. UpdateTime *timestamppb.Timestamp `protobuf:"bytes,13,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` // Optional. The default value for event-based hold on newly created objects // in this bucket. Event-based hold is a way to retain objects indefinitely // until an event occurs, signified by the hold's release. After being - // released, such objects will be subject to bucket-level retention (if any). - // One sample use case of this flag is for banks to hold loan documents for at + // released, such objects are subject to bucket-level retention (if any). One + // sample use case of this flag is for banks to hold loan documents for at // least 3 years after loan is paid in full. Here, bucket-level retention is 3 // years and the event is loan being paid in full. In this example, these - // objects will be held intact for any number of years until the event has + // objects are held intact for any number of years until the event has // occurred (event-based hold on the object is released) and then 3 more years // after that. That means retention duration of the objects begins from the // moment event-based hold transitioned from true to false. Objects under @@ -4617,11 +4650,11 @@ type Bucket struct { // Optional. User-provided labels, in key/value pairs. Labels map[string]string `protobuf:"bytes,15,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Optional. The bucket's website config, controlling how the service behaves - // when accessing bucket contents as a web site. See the - // [https://cloud.google.com/storage/docs/static-website][Static Website - // Examples] for more information. + // when accessing bucket contents as a web site. See the [Static website + // examples](https://cloud.google.com/storage/docs/static-website) for more + // information. Website *Bucket_Website `protobuf:"bytes,16,opt,name=website,proto3" json:"website,omitempty"` - // Optional. The bucket's versioning config. + // Optional. The bucket's versioning configuration. Versioning *Bucket_Versioning `protobuf:"bytes,17,opt,name=versioning,proto3" json:"versioning,omitempty"` // Optional. The bucket's logging config, which defines the destination bucket // and name prefix (if any) for the current bucket's logs. @@ -4631,40 +4664,39 @@ type Bucket struct { Owner *Owner `protobuf:"bytes,19,opt,name=owner,proto3" json:"owner,omitempty"` // Optional. Encryption config for a bucket. Encryption *Bucket_Encryption `protobuf:"bytes,20,opt,name=encryption,proto3" json:"encryption,omitempty"` - // Optional. The bucket's billing config. + // Optional. The bucket's billing configuration. Billing *Bucket_Billing `protobuf:"bytes,21,opt,name=billing,proto3" json:"billing,omitempty"` // Optional. The bucket's retention policy. The retention policy enforces a // minimum retention time for all objects contained in the bucket, based on // their creation time. Any attempt to overwrite or delete objects younger - // than the retention period will result in a PERMISSION_DENIED error. An + // than the retention period results in a `PERMISSION_DENIED` error. An // unlocked retention policy can be modified or removed from the bucket via a // storage.buckets.update operation. A locked retention policy cannot be // removed or shortened in duration for the lifetime of the bucket. - // Attempting to remove or decrease period of a locked retention policy will - // result in a PERMISSION_DENIED error. + // Attempting to remove or decrease period of a locked retention policy + // results in a `PERMISSION_DENIED` error. RetentionPolicy *Bucket_RetentionPolicy `protobuf:"bytes,22,opt,name=retention_policy,json=retentionPolicy,proto3" json:"retention_policy,omitempty"` - // Optional. The bucket's IAM config. + // Optional. The bucket's IAM configuration. IamConfig *Bucket_IamConfig `protobuf:"bytes,23,opt,name=iam_config,json=iamConfig,proto3" json:"iam_config,omitempty"` // Optional. Reserved for future use. SatisfiesPzs bool `protobuf:"varint,25,opt,name=satisfies_pzs,json=satisfiesPzs,proto3" json:"satisfies_pzs,omitempty"` // Optional. Configuration that, if present, specifies the data placement for - // a - // [https://cloud.google.com/storage/docs/locations#location-dr][configurable - // dual-region]. + // a [configurable + // dual-region](https://cloud.google.com/storage/docs/locations#location-dr). CustomPlacementConfig *Bucket_CustomPlacementConfig `protobuf:"bytes,26,opt,name=custom_placement_config,json=customPlacementConfig,proto3" json:"custom_placement_config,omitempty"` // Optional. The bucket's Autoclass configuration. If there is no - // configuration, the Autoclass feature will be disabled and have no effect on - // the bucket. + // configuration, the Autoclass feature is disabled and has no effect on the + // bucket. Autoclass *Bucket_Autoclass `protobuf:"bytes,28,opt,name=autoclass,proto3" json:"autoclass,omitempty"` // Optional. The bucket's hierarchical namespace configuration. If there is no - // configuration, the hierarchical namespace feature will be disabled and have + // configuration, the hierarchical namespace feature is disabled and has // no effect on the bucket. HierarchicalNamespace *Bucket_HierarchicalNamespace `protobuf:"bytes,32,opt,name=hierarchical_namespace,json=hierarchicalNamespace,proto3" json:"hierarchical_namespace,omitempty"` // Optional. The bucket's soft delete policy. The soft delete policy prevents // soft-deleted objects from being permanently deleted. SoftDeletePolicy *Bucket_SoftDeletePolicy `protobuf:"bytes,31,opt,name=soft_delete_policy,json=softDeletePolicy,proto3" json:"soft_delete_policy,omitempty"` // Optional. The bucket's object retention configuration. Must be enabled - // before objects in the bucket may have retention configured. + // before objects in the bucket might have retention configured. ObjectRetention *Bucket_ObjectRetention `protobuf:"bytes,33,opt,name=object_retention,json=objectRetention,proto3" json:"object_retention,omitempty"` // Optional. The bucket's IP filter configuration. IpFilter *Bucket_IpFilter `protobuf:"bytes,38,opt,name=ip_filter,json=ipFilter,proto3,oneof" json:"ip_filter,omitempty"` @@ -4950,18 +4982,18 @@ type BucketAccessControl struct { // `group-example@googlegroups.com` // * All members of the Google Apps for Business domain `example.com` would be // `domain-example.com` - // For project entities, `project-{team}-{projectnumber}` format will be + // For project entities, `project-{team}-{projectnumber}` format is // returned on response. Entity string `protobuf:"bytes,3,opt,name=entity,proto3" json:"entity,omitempty"` // Output only. The alternative entity format, if exists. For project - // entities, `project-{team}-{projectid}` format will be returned on response. + // entities, `project-{team}-{projectid}` format is returned in the response. EntityAlt string `protobuf:"bytes,9,opt,name=entity_alt,json=entityAlt,proto3" json:"entity_alt,omitempty"` // Optional. The ID for the entity, if any. EntityId string `protobuf:"bytes,4,opt,name=entity_id,json=entityId,proto3" json:"entity_id,omitempty"` - // Optional. The etag of the BucketAccessControl. + // Optional. The `etag` of the `BucketAccessControl`. // If included in the metadata of an update or delete request message, the - // operation operation will only be performed if the etag matches that of the - // bucket's BucketAccessControl. + // operation operation is only performed if the etag matches that of the + // bucket's `BucketAccessControl`. Etag string `protobuf:"bytes,8,opt,name=etag,proto3" json:"etag,omitempty"` // Optional. The email address associated with the entity, if any. Email string `protobuf:"bytes,5,opt,name=email,proto3" json:"email,omitempty"` @@ -5129,16 +5161,15 @@ type ObjectChecksums struct { // CRC32C digest of the object data. Computed by the Cloud Storage service for // all written objects. - // If set in a WriteObjectRequest, service will validate that the stored + // If set in a WriteObjectRequest, service validates that the stored // object matches this checksum. Crc32C *uint32 `protobuf:"fixed32,1,opt,name=crc32c,proto3,oneof" json:"crc32c,omitempty"` - // Optional. 128 bit MD5 hash of the object data. - // For more information about using the MD5 hash, see - // [https://cloud.google.com/storage/docs/hashes-etags#json-api][Hashes and - // ETags: Best Practices]. - // Not all objects will provide an MD5 hash. For example, composite objects - // provide only crc32c hashes. This value is equivalent to running `cat - // object.txt | openssl md5 -binary` + // Optional. 128 bit MD5 hash of the object data. For more information about + // using the MD5 hash, see [Data validation and change + // detection](https://cloud.google.com/storage/docs/data-validation). Not all + // objects provide an MD5 hash. For example, composite objects provide only + // crc32c hashes. This value is equivalent to running `cat object.txt | + // openssl md5 -binary` Md5Hash []byte `protobuf:"bytes,2,opt,name=md5_hash,json=md5Hash,proto3" json:"md5_hash,omitempty"` } @@ -5298,8 +5329,8 @@ func (x *ObjectContexts) GetCustom() map[string]*ObjectCustomContextPayload { return nil } -// Describes the Customer-Supplied Encryption Key mechanism used to store an -// Object's data at rest. +// Describes the customer-supplied encryption key mechanism used to store an +// object's data at rest. type CustomerEncryption struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -5372,9 +5403,9 @@ type Object struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Immutable. The name of the bucket containing this object. Bucket string `protobuf:"bytes,2,opt,name=bucket,proto3" json:"bucket,omitempty"` - // Optional. The etag of the object. + // Optional. The `etag` of an object. // If included in the metadata of an update or delete request message, the - // operation will only be performed if the etag matches that of the live + // operation is only performed if the etag matches that of the live // object. Etag string `protobuf:"bytes,27,opt,name=etag,proto3" json:"etag,omitempty"` // Immutable. The content generation of this object. Used for object @@ -5392,25 +5423,25 @@ type Object struct { // Optional. Storage class of the object. StorageClass string `protobuf:"bytes,5,opt,name=storage_class,json=storageClass,proto3" json:"storage_class,omitempty"` // Output only. Content-Length of the object data in bytes, matching - // [https://tools.ietf.org/html/rfc7230#section-3.3.2][RFC 7230 §3.3.2]. + // [RFC 7230 §3.3.2](https://tools.ietf.org/html/rfc7230#section-3.3.2]). Size int64 `protobuf:"varint,6,opt,name=size,proto3" json:"size,omitempty"` // Optional. Content-Encoding of the object data, matching - // [https://tools.ietf.org/html/rfc7231#section-3.1.2.2][RFC 7231 §3.1.2.2] + // [RFC 7231 §3.1.2.2](https://tools.ietf.org/html/rfc7231#section-3.1.2.2) ContentEncoding string `protobuf:"bytes,7,opt,name=content_encoding,json=contentEncoding,proto3" json:"content_encoding,omitempty"` // Optional. Content-Disposition of the object data, matching - // [https://tools.ietf.org/html/rfc6266][RFC 6266]. + // [RFC 6266](https://tools.ietf.org/html/rfc6266). ContentDisposition string `protobuf:"bytes,8,opt,name=content_disposition,json=contentDisposition,proto3" json:"content_disposition,omitempty"` // Optional. Cache-Control directive for the object data, matching - // [https://tools.ietf.org/html/rfc7234#section-5.2"][RFC 7234 §5.2]. + // [RFC 7234 §5.2](https://tools.ietf.org/html/rfc7234#section-5.2). // If omitted, and the object is accessible to all anonymous users, the - // default will be `public, max-age=3600`. + // default is `public, max-age=3600`. CacheControl string `protobuf:"bytes,9,opt,name=cache_control,json=cacheControl,proto3" json:"cache_control,omitempty"` // Optional. Access controls on the object. - // If iam_config.uniform_bucket_level_access is enabled on the parent + // If `iam_config.uniform_bucket_level_access` is enabled on the parent // bucket, requests to set, read, or modify acl is an error. Acl []*ObjectAccessControl `protobuf:"bytes,10,rep,name=acl,proto3" json:"acl,omitempty"` // Optional. Content-Language of the object data, matching - // [https://tools.ietf.org/html/rfc7231#section-3.1.3.2][RFC 7231 §3.1.3.2]. + // [RFC 7231 §3.1.3.2](https://tools.ietf.org/html/rfc7231#section-3.1.3.2). ContentLanguage string `protobuf:"bytes,11,opt,name=content_language,json=contentLanguage,proto3" json:"content_language,omitempty"` // Output only. If this object is noncurrent, this is the time when the object // became noncurrent. @@ -5418,7 +5449,7 @@ type Object struct { // Output only. The time when the object was finalized. FinalizeTime *timestamppb.Timestamp `protobuf:"bytes,36,opt,name=finalize_time,json=finalizeTime,proto3" json:"finalize_time,omitempty"` // Optional. Content-Type of the object data, matching - // [https://tools.ietf.org/html/rfc7231#section-3.1.1.5][RFC 7231 §3.1.1.5]. + // [RFC 7231 §3.1.1.5](https://tools.ietf.org/html/rfc7231#section-3.1.1.5). // If an object is stored without a Content-Type, it is served as // `application/octet-stream`. ContentType string `protobuf:"bytes,13,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"` @@ -5428,7 +5459,7 @@ type Object struct { // Components are accumulated by compose operations. ComponentCount int32 `protobuf:"varint,15,opt,name=component_count,json=componentCount,proto3" json:"component_count,omitempty"` // Output only. Hashes for the data part of this object. This field is used - // for output only and will be silently ignored if provided in requests. The + // for output only and is silently ignored if provided in requests. The // checksums of the complete object regardless of data range. If the object is // downloaded in full, the client should compute one of these checksums over // the downloaded object and compare it against the value provided here. @@ -5444,7 +5475,7 @@ type Object struct { // encrypted by such a key. KmsKey string `protobuf:"bytes,18,opt,name=kms_key,json=kmsKey,proto3" json:"kms_key,omitempty"` // Output only. The time at which the object's storage class was last changed. - // When the object is initially created, it will be set to time_created. + // When the object is initially created, it is set to `time_created`. UpdateStorageClassTime *timestamppb.Timestamp `protobuf:"bytes,19,opt,name=update_storage_class_time,json=updateStorageClassTime,proto3" json:"update_storage_class_time,omitempty"` // Optional. Whether an object is under temporary hold. While this flag is set // to true, the object is protected against deletion and overwrites. A common @@ -5469,19 +5500,19 @@ type Object struct { // Whether an object is under event-based hold. // An event-based hold is a way to force the retention of an object until // after some event occurs. Once the hold is released by explicitly setting - // this field to false, the object will become subject to any bucket-level - // retention policy, except that the retention duration will be calculated + // this field to `false`, the object becomes subject to any bucket-level + // retention policy, except that the retention duration is calculated // from the time the event based hold was lifted, rather than the time the // object was created. // - // In a WriteObject request, not setting this field implies that the value - // should be taken from the parent bucket's "default_event_based_hold" field. - // In a response, this field will always be set to true or false. + // In a `WriteObject` request, not setting this field implies that the value + // should be taken from the parent bucket's `default_event_based_hold` field. + // In a response, this field is always set to `true` or `false`. EventBasedHold *bool `protobuf:"varint,23,opt,name=event_based_hold,json=eventBasedHold,proto3,oneof" json:"event_based_hold,omitempty"` - // Output only. The owner of the object. This will always be the uploader of - // the object. + // Output only. The owner of the object. This is always the uploader of the + // object. Owner *Owner `protobuf:"bytes,24,opt,name=owner,proto3" json:"owner,omitempty"` - // Optional. Metadata of Customer-Supplied Encryption Key, if the object is + // Optional. Metadata of customer-supplied encryption key, if the object is // encrypted by such a key. CustomerEncryption *CustomerEncryption `protobuf:"bytes,25,opt,name=customer_encryption,json=customerEncryption,proto3" json:"customer_encryption,omitempty"` // Optional. A user-specified timestamp set on an object. @@ -5489,15 +5520,15 @@ type Object struct { // Output only. This is the time when the object became soft-deleted. // // Soft-deleted objects are only accessible if a soft_delete_policy is - // enabled. Also see hard_delete_time. + // enabled. Also see `hard_delete_time`. SoftDeleteTime *timestamppb.Timestamp `protobuf:"bytes,28,opt,name=soft_delete_time,json=softDeleteTime,proto3,oneof" json:"soft_delete_time,omitempty"` - // Output only. The time when the object will be permanently deleted. + // Output only. The time when the object is permanently deleted. // - // Only set when an object becomes soft-deleted with a soft_delete_policy. - // Otherwise, the object will not be accessible. + // Only set when an object becomes soft-deleted with a `soft_delete_policy`. + // Otherwise, the object is not accessible. HardDeleteTime *timestamppb.Timestamp `protobuf:"bytes,29,opt,name=hard_delete_time,json=hardDeleteTime,proto3,oneof" json:"hard_delete_time,omitempty"` // Optional. Retention configuration of this object. - // May only be configured if the bucket has object retention enabled. + // Might only be configured if the bucket has object retention enabled. Retention *Object_Retention `protobuf:"bytes,30,opt,name=retention,proto3" json:"retention,omitempty"` } @@ -5792,17 +5823,17 @@ type ObjectAccessControl struct { // `group-example@googlegroups.com`. // * All members of the Google Apps for Business domain `example.com` would be // `domain-example.com`. - // For project entities, `project-{team}-{projectnumber}` format will be - // returned on response. + // For project entities, `project-{team}-{projectnumber}` format is + // returned in the response. Entity string `protobuf:"bytes,3,opt,name=entity,proto3" json:"entity,omitempty"` // Output only. The alternative entity format, if exists. For project - // entities, `project-{team}-{projectid}` format will be returned on response. + // entities, `project-{team}-{projectid}` format is returned in the response. EntityAlt string `protobuf:"bytes,9,opt,name=entity_alt,json=entityAlt,proto3" json:"entity_alt,omitempty"` // Optional. The ID for the entity, if any. EntityId string `protobuf:"bytes,4,opt,name=entity_id,json=entityId,proto3" json:"entity_id,omitempty"` // Optional. The etag of the ObjectAccessControl. // If included in the metadata of an update or delete request message, the - // operation will only be performed if the etag matches that of the live + // operation is only performed if the etag matches that of the live // object's ObjectAccessControl. Etag string `protobuf:"bytes,8,opt,name=etag,proto3" json:"etag,omitempty"` // Optional. The email address associated with the entity, if any. @@ -6224,7 +6255,7 @@ type ComposeObjectRequest_SourceObject_ObjectPreconditions struct { // Only perform the composition if the generation of the source object // that would be used matches this value. If this value and a generation - // are both specified, they must be the same value or the call will fail. + // are both specified, they must be the same value or the call fails. IfGenerationMatch *int64 `protobuf:"varint,1,opt,name=if_generation_match,json=ifGenerationMatch,proto3,oneof" json:"if_generation_match,omitempty"` } @@ -6321,22 +6352,23 @@ type Bucket_Cors struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Optional. The list of Origins eligible to receive CORS response headers. - // See [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins. - // Note: "*" is permitted in the list of origins, and means "any Origin". + // Optional. The list of origins eligible to receive CORS response headers. + // For more information about origins, see [RFC + // 6454](https://tools.ietf.org/html/rfc6454). Note: `*` is permitted in the + // list of origins, and means `any origin`. Origin []string `protobuf:"bytes,1,rep,name=origin,proto3" json:"origin,omitempty"` // Optional. The list of HTTP methods on which to include CORS response // headers, - // (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of + // (`GET`, `OPTIONS`, `POST`, etc) Note: `*` is permitted in the list of // methods, and means "any method". Method []string `protobuf:"bytes,2,rep,name=method,proto3" json:"method,omitempty"` - // Optional. The list of HTTP headers other than the - // [https://www.w3.org/TR/cors/#simple-response-header][simple response - // headers] to give permission for the user-agent to share across domains. + // Optional. The list of HTTP headers other than the [simple response + // headers](https://www.w3.org/TR/cors/#simple-response-headers) to give + // permission for the user-agent to share across domains. ResponseHeader []string `protobuf:"bytes,3,rep,name=response_header,json=responseHeader,proto3" json:"response_header,omitempty"` - // Optional. The value, in seconds, to return in the - // [https://www.w3.org/TR/cors/#access-control-max-age-response-header][Access-Control-Max-Age - // header] used in preflight responses. + // Optional. The value, in seconds, to return in the [Access-Control-Max-Age + // header](https://www.w3.org/TR/cors/#access-control-max-age-response-header) + // used in preflight responses. MaxAgeSeconds int32 `protobuf:"varint,4,opt,name=max_age_seconds,json=maxAgeSeconds,proto3" json:"max_age_seconds,omitempty"` } @@ -6404,8 +6436,8 @@ type Bucket_Encryption struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Optional. The name of the Cloud KMS key that will be used to encrypt - // objects inserted into this bucket, if no encryption method is specified. + // Optional. The name of the Cloud KMS key that is used to encrypt objects + // inserted into this bucket, if no encryption method is specified. DefaultKmsKey string `protobuf:"bytes,1,opt,name=default_kms_key,json=defaultKmsKey,proto3" json:"default_kms_key,omitempty"` // Optional. If omitted, then new objects with GMEK encryption-type is // allowed. If set, then new objects created in this bucket must comply with @@ -6490,8 +6522,8 @@ type Bucket_IamConfig struct { // Optional. Bucket restriction options currently enforced on the bucket. UniformBucketLevelAccess *Bucket_IamConfig_UniformBucketLevelAccess `protobuf:"bytes,1,opt,name=uniform_bucket_level_access,json=uniformBucketLevelAccess,proto3" json:"uniform_bucket_level_access,omitempty"` - // Optional. Whether IAM will enforce public access prevention. Valid values - // are "enforced" or "inherited". + // Optional. Whether IAM enforces public access prevention. Valid values are + // `enforced` or `inherited`. PublicAccessPrevention string `protobuf:"bytes,3,opt,name=public_access_prevention,json=publicAccessPrevention,proto3" json:"public_access_prevention,omitempty"` } @@ -6540,14 +6572,15 @@ func (x *Bucket_IamConfig) GetPublicAccessPrevention() string { } // Lifecycle properties of a bucket. -// For more information, see https://cloud.google.com/storage/docs/lifecycle. +// For more information, see [Object Lifecycle +// Management](https://cloud.google.com/storage/docs/lifecycle). type Bucket_Lifecycle struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Optional. A lifecycle management rule, which is made of an action to take - // and the condition(s) under which the action will be taken. + // and the condition under which the action is taken. Rule []*Bucket_Lifecycle_Rule `protobuf:"bytes,1,rep,name=rule,proto3" json:"rule,omitempty"` } @@ -6708,7 +6741,7 @@ type Bucket_RetentionPolicy struct { // duration must be greater than zero and less than 100 years. Note that // enforcement of retention periods less than a day is not guaranteed. Such // periods should only be used for testing purposes. Any `nanos` value - // specified will be rounded down to the nearest second. + // specified is rounded down to the nearest second. RetentionDuration *durationpb.Duration `protobuf:"bytes,4,opt,name=retention_duration,json=retentionDuration,proto3" json:"retention_duration,omitempty"` } @@ -6822,8 +6855,8 @@ func (x *Bucket_SoftDeletePolicy) GetEffectiveTime() *timestamppb.Timestamp { } // Properties of a bucket related to versioning. -// For more on Cloud Storage versioning, see -// https://cloud.google.com/storage/docs/object-versioning. +// For more information about Cloud Storage versioning, see [Object +// versioning](https://cloud.google.com/storage/docs/object-versioning). type Bucket_Versioning struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -6871,22 +6904,22 @@ func (x *Bucket_Versioning) GetEnabled() bool { } // Properties of a bucket related to accessing the contents as a static -// website. For more on hosting a static website via Cloud Storage, see -// https://cloud.google.com/storage/docs/hosting-static-website. +// website. For details, see [hosting a static website using Cloud +// Storage](https://cloud.google.com/storage/docs/hosting-static-website). type Bucket_Website struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Optional. If the requested object path is missing, the service will - // ensure the path has a trailing '/', append this suffix, and attempt to - // retrieve the resulting object. This allows the creation of `index.html` - // objects to represent directory pages. + // Optional. If the requested object path is missing, the service ensures + // the path has a trailing '/', append this suffix, and attempt to retrieve + // the resulting object. This allows the creation of `index.html` objects to + // represent directory pages. MainPageSuffix string `protobuf:"bytes,1,opt,name=main_page_suffix,json=mainPageSuffix,proto3" json:"main_page_suffix,omitempty"` // Optional. If the requested object path is missing, and any // `mainPageSuffix` object is missing, if applicable, the service - // will return the named object from this bucket as the content for a - // [https://tools.ietf.org/html/rfc7231#section-6.5.4][404 Not Found] + // returns the named object from this bucket as the content for a + // [404 Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4) // result. NotFoundPage string `protobuf:"bytes,2,opt,name=not_found_page,json=notFoundPage,proto3" json:"not_found_page,omitempty"` } @@ -6935,9 +6968,11 @@ func (x *Bucket_Website) GetNotFoundPage() string { return "" } -// Configuration for Custom Dual Regions. It should specify precisely two -// eligible regions within the same Multiregion. More information on regions -// may be found [here](https://cloud.google.com/storage/docs/locations). +// Configuration for [configurable dual- +// regions](https://cloud.google.com/storage/docs/locations#configurable). It +// should specify precisely two eligible regions within the same multi-region. +// For details, see +// [locations](https://cloud.google.com/storage/docs/locations). type Bucket_CustomPlacementConfig struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -6994,10 +7029,10 @@ type Bucket_Autoclass struct { Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` // Output only. Latest instant at which the `enabled` field was set to true // after being disabled/unconfigured or set to false after being enabled. If - // Autoclass is enabled when the bucket is created, the toggle_time is set - // to the bucket creation time. + // Autoclass is enabled when the bucket is created, the value of the + // `toggle_time` field is set to the bucket `create_time`. ToggleTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=toggle_time,json=toggleTime,proto3" json:"toggle_time,omitempty"` - // An object in an Autoclass bucket will eventually cool down to the + // An object in an Autoclass bucket eventually cools down to the // terminal storage class if there is no access to the object. // The only valid values are NEARLINE and ARCHIVE. TerminalStorageClass *string `protobuf:"bytes,3,opt,name=terminal_storage_class,json=terminalStorageClass,proto3,oneof" json:"terminal_storage_class,omitempty"` @@ -7077,7 +7112,7 @@ type Bucket_IpFilter struct { // `Disabled`. When set to `Enabled`, IP filtering rules are applied to a // bucket and all incoming requests to the bucket are evaluated against // these rules. When set to `Disabled`, IP filtering rules are not applied - // to a bucket.". + // to a bucket. Mode *string `protobuf:"bytes,1,opt,name=mode,proto3,oneof" json:"mode,omitempty"` // Public IPs allowed to operate or access the bucket. PublicNetworkSource *Bucket_IpFilter_PublicNetworkSource `protobuf:"bytes,2,opt,name=public_network_source,json=publicNetworkSource,proto3,oneof" json:"public_network_source,omitempty"` @@ -7087,11 +7122,11 @@ type Bucket_IpFilter struct { // Optional. Whether or not to allow VPCs from orgs different than the // bucket's parent org to access the bucket. When set to true, validations // on the existence of the VPCs won't be performed. If set to false, each - // VPC network source will be checked to belong to the same org as the - // bucket as well as validated for existence. + // VPC network source is checked to belong to the same org as the bucket as + // well as validated for existence. AllowCrossOrgVpcs bool `protobuf:"varint,4,opt,name=allow_cross_org_vpcs,json=allowCrossOrgVpcs,proto3" json:"allow_cross_org_vpcs,omitempty"` // Whether or not to allow all P4SA access to the bucket. When set to true, - // IP filter config validation will not apply. + // IP filter config validation doesn't apply. AllowAllServiceAgentAccess *bool `protobuf:"varint,5,opt,name=allow_all_service_agent_access,json=allowAllServiceAgentAccess,proto3,oneof" json:"allow_all_service_agent_access,omitempty"` } @@ -7214,7 +7249,7 @@ type Bucket_Encryption_GoogleManagedEncryptionEnforcementConfig struct { unknownFields protoimpl.UnknownFields // Restriction mode for google-managed encryption for new objects within - // the bucket. Valid values are: "NotRestricted", "FullyRestricted". + // the bucket. Valid values are: `NotRestricted` and `FullyRestricted`. // If `NotRestricted` or unset, creation of new objects with // google-managed encryption is allowed. // If `FullyRestricted`, new objects can't be created using google-managed @@ -7275,7 +7310,7 @@ type Bucket_Encryption_CustomerManagedEncryptionEnforcementConfig struct { unknownFields protoimpl.UnknownFields // Restriction mode for customer-managed encryption for new objects within - // the bucket. Valid values are: "NotRestricted", "FullyRestricted". + // the bucket. Valid values are: `NotRestricted` and `FullyRestricted`. // If `NotRestricted` or unset, creation of new objects with // customer-managed encryption is allowed. // If `FullyRestricted`, new objects can't be created using @@ -7336,8 +7371,8 @@ type Bucket_Encryption_CustomerSuppliedEncryptionEnforcementConfig struct { unknownFields protoimpl.UnknownFields // Restriction mode for customer-supplied encryption for new objects - // within the bucket. Valid values are: "NotRestricted", - // "FullyRestricted". + // within the bucket. Valid values are: `NotRestricted` and + // `FullyRestricted`. // If `NotRestricted` or unset, creation of new objects with // customer-supplied encryption is allowed. // If `FullyRestricted`, new objects can't be created using @@ -7453,7 +7488,7 @@ func (x *Bucket_IamConfig_UniformBucketLevelAccess) GetLockTime() *timestamppb.T } // A lifecycle Rule, combining an action to take on an object and a -// condition which will trigger that action. +// condition which triggers that action. type Bucket_Lifecycle_Rule struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -7461,7 +7496,7 @@ type Bucket_Lifecycle_Rule struct { // Optional. The action to take. Action *Bucket_Lifecycle_Rule_Action `protobuf:"bytes,1,opt,name=action,proto3" json:"action,omitempty"` - // Optional. The condition(s) under which the action will be taken. + // Optional. The condition under which the action is taken. Condition *Bucket_Lifecycle_Rule_Condition `protobuf:"bytes,2,opt,name=condition,proto3" json:"condition,omitempty"` } @@ -7591,8 +7626,8 @@ type Bucket_Lifecycle_Rule_Condition struct { // the live version) newer than this version of the object. NumNewerVersions *int32 `protobuf:"varint,4,opt,name=num_newer_versions,json=numNewerVersions,proto3,oneof" json:"num_newer_versions,omitempty"` // Optional. Objects having any of the storage classes specified by this - // condition will be matched. Values include `MULTI_REGIONAL`, - // `REGIONAL`, `NEARLINE`, `COLDLINE`, `STANDARD`, and + // condition are matched. Values include `MULTI_REGIONAL`, `REGIONAL`, + // `NEARLINE`, `COLDLINE`, `STANDARD`, and // `DURABLE_REDUCED_AVAILABILITY`. MatchesStorageClass []string `protobuf:"bytes,5,rep,name=matches_storage_class,json=matchesStorageClass,proto3" json:"matches_storage_class,omitempty"` // Number of days that have elapsed since the custom timestamp set on an @@ -7605,7 +7640,7 @@ type Bucket_Lifecycle_Rule_Condition struct { // This condition is relevant only for versioned objects. An object // version satisfies this condition only if these many days have been // passed since it became noncurrent. The value of the field must be a - // nonnegative integer. If it's zero, the object version will become + // nonnegative integer. If it's zero, the object version becomes // eligible for Lifecycle action as soon as it becomes noncurrent. DaysSinceNoncurrentTime *int32 `protobuf:"varint,9,opt,name=days_since_noncurrent_time,json=daysSinceNoncurrentTime,proto3,oneof" json:"days_since_noncurrent_time,omitempty"` // Optional. This condition is relevant only for versioned objects. An @@ -7985,7 +8020,7 @@ var file_google_storage_v2_storage_proto_rawDesc = []byte{ 0x0a, 0x17, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x15, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x4f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x82, 0x02, 0x0a, 0x12, + 0x63, 0x74, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xbd, 0x02, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x1f, 0x12, 0x1d, 0x73, 0x74, 0x6f, 0x72, @@ -8001,140 +8036,612 @@ var file_google_storage_v2_storage_proto_rawDesc = []byte{ 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x48, 0x00, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x88, - 0x01, 0x01, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, - 0x22, 0x72, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x07, 0x62, 0x75, 0x63, 0x6b, 0x65, - 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, - 0x6b, 0x65, 0x74, 0x52, 0x07, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x12, 0x26, 0x0a, 0x0f, - 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x9e, 0x01, 0x0a, 0x20, 0x4c, 0x6f, 0x63, 0x6b, 0x42, 0x75, 0x63, - 0x6b, 0x65, 0x74, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, - 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x06, 0x62, 0x75, 0x63, - 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0xe0, 0x41, 0x02, 0xfa, 0x41, - 0x1f, 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, - 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x3b, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x6d, + 0x01, 0x01, 0x12, 0x39, 0x0a, 0x16, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x5f, 0x70, 0x61, 0x72, + 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x14, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x50, + 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x42, 0x0c, 0x0a, + 0x0a, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x22, 0x94, 0x01, 0x0a, 0x13, + 0x4c, 0x69, 0x73, 0x74, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x07, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, + 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, + 0x07, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, + 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x12, 0x20, 0x0a, 0x0b, 0x75, 0x6e, 0x72, 0x65, 0x61, 0x63, 0x68, 0x61, 0x62, 0x6c, 0x65, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x75, 0x6e, 0x72, 0x65, 0x61, 0x63, 0x68, 0x61, 0x62, + 0x6c, 0x65, 0x22, 0x9e, 0x01, 0x0a, 0x20, 0x4c, 0x6f, 0x63, 0x6b, 0x42, 0x75, 0x63, 0x6b, 0x65, + 0x74, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x1f, 0x0a, + 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, + 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, + 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x3b, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, + 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, + 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x15, 0x69, 0x66, + 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, + 0x74, 0x63, 0x68, 0x22, 0xc0, 0x03, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x75, + 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x06, 0x62, + 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, + 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x62, 0x75, 0x63, + 0x6b, 0x65, 0x74, 0x12, 0x3b, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x15, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, + 0x12, 0x42, 0x0a, 0x1b, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x18, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, + 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, + 0x68, 0x88, 0x01, 0x01, 0x12, 0x2a, 0x0a, 0x0e, 0x70, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, + 0x65, 0x64, 0x5f, 0x61, 0x63, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, + 0x01, 0x52, 0x0d, 0x70, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x41, 0x63, 0x6c, + 0x12, 0x46, 0x0a, 0x1d, 0x70, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x5f, 0x64, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x61, 0x63, + 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x1a, 0x70, 0x72, + 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x41, 0x63, 0x6c, 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0a, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, + 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1e, 0x0a, 0x1c, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, + 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, + 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x22, 0xe5, 0x07, 0x0a, 0x14, 0x43, 0x6f, 0x6d, 0x70, 0x6f, + 0x73, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x40, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, + 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x42, + 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x60, 0x0a, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, + 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x73, 0x12, 0x41, 0x0a, 0x1a, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x5f, 0x61, 0x63, + 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x18, 0x64, 0x65, + 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, + 0x6e, 0x65, 0x64, 0x41, 0x63, 0x6c, 0x12, 0x33, 0x0a, 0x13, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x11, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3b, 0x0a, 0x17, 0x69, + 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x15, + 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x42, 0x0a, 0x07, 0x6b, 0x6d, 0x73, 0x5f, + 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x29, 0xe0, 0x41, 0x01, 0xfa, 0x41, + 0x23, 0x0a, 0x21, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x72, 0x79, 0x70, 0x74, + 0x6f, 0x4b, 0x65, 0x79, 0x52, 0x06, 0x6b, 0x6d, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x72, 0x0a, 0x1c, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x19, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x12, 0x52, 0x0a, 0x10, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, + 0x73, 0x75, 0x6d, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x42, 0x03, + 0xe0, 0x41, 0x01, 0x52, 0x0f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, + 0x73, 0x75, 0x6d, 0x73, 0x1a, 0xb3, 0x02, 0x0a, 0x0c, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x23, + 0x0a, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x80, 0x01, 0x0a, 0x14, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x70, + 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x48, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x4f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, + 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x03, 0xe0, 0x41, + 0x01, 0x52, 0x13, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x64, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x62, 0x0a, 0x13, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x33, 0x0a, + 0x13, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, + 0x61, 0x74, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x11, 0x69, 0x66, + 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, + 0x01, 0x01, 0x42, 0x16, 0x0a, 0x14, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x16, 0x0a, 0x14, 0x5f, 0x69, + 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, + 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x22, 0xec, + 0x04, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x1f, 0x0a, 0x1d, + 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, + 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x62, + 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x1b, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x12, 0x23, 0x0a, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0a, 0x67, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x13, 0x69, 0x66, 0x5f, 0x67, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x11, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3a, 0x0a, 0x17, + 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, + 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, + 0x14, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, + 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3b, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, - 0x74, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x15, + 0x74, 0x63, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x48, 0x02, 0x52, 0x15, 0x69, 0x66, 0x4d, + 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, + 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x42, 0x0a, 0x1b, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, + 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, + 0x61, 0x74, 0x63, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x48, 0x03, 0x52, 0x18, 0x69, 0x66, + 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, + 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x72, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x03, 0xe0, + 0x41, 0x01, 0x52, 0x19, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x16, 0x0a, + 0x14, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, + 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1e, 0x0a, + 0x1c, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x22, 0xd8, 0x05, + 0x0a, 0x14, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x1f, 0x0a, 0x1d, + 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, + 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x62, + 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x1b, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x12, 0x23, 0x0a, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0a, 0x67, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, + 0xe0, 0x41, 0x01, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x12, 0x33, 0x0a, 0x13, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, + 0x52, 0x11, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, + 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3a, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, + 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x14, 0x69, 0x66, 0x47, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, + 0x01, 0x01, 0x12, 0x3b, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x03, 0x48, 0x02, 0x52, 0x15, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, + 0x42, 0x0a, 0x1b, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x03, 0x48, 0x03, 0x52, 0x18, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, + 0x88, 0x01, 0x01, 0x12, 0x2b, 0x0a, 0x0f, 0x63, 0x6f, 0x70, 0x79, 0x5f, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x5f, 0x61, 0x63, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x48, 0x04, 0x52, 0x0d, + 0x63, 0x6f, 0x70, 0x79, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x41, 0x63, 0x6c, 0x88, 0x01, 0x01, + 0x12, 0x72, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x19, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x42, 0x16, 0x0a, 0x14, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, + 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, + 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, + 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, + 0x61, 0x74, 0x63, 0x68, 0x42, 0x1e, 0x0a, 0x1c, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, + 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, + 0x61, 0x74, 0x63, 0x68, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x63, 0x6f, 0x70, 0x79, 0x5f, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x5f, 0x61, 0x63, 0x6c, 0x22, 0x3f, 0x0a, 0x1b, 0x43, 0x61, 0x6e, 0x63, + 0x65, 0x6c, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x09, 0x75, 0x70, 0x6c, 0x6f, 0x61, + 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, + 0x08, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x49, 0x64, 0x22, 0x1e, 0x0a, 0x1c, 0x43, 0x61, 0x6e, + 0x63, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, 0x69, 0x74, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x80, 0x06, 0x0a, 0x11, 0x52, 0x65, + 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x3d, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x25, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x1f, 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x1b, + 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, + 0xe0, 0x41, 0x02, 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x23, 0x0a, 0x0a, 0x67, + 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x24, 0x0a, 0x0b, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, + 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x22, 0x0a, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6c, + 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, + 0x09, 0x72, 0x65, 0x61, 0x64, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x33, 0x0a, 0x13, 0x69, 0x66, + 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, + 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x11, 0x69, 0x66, 0x47, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, + 0x3a, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, + 0x48, 0x01, 0x52, 0x14, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3b, 0x0a, 0x17, 0x69, + 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x48, 0x02, 0x52, 0x15, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x4d, 0x61, 0x74, 0x63, 0x68, 0x22, 0xc0, 0x03, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, - 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, - 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x62, - 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x3b, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, - 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x15, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, - 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, - 0x01, 0x01, 0x12, 0x42, 0x0a, 0x1b, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, + 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x42, 0x0a, 0x1b, 0x69, 0x66, 0x5f, 0x6d, + 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, + 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x48, 0x03, 0x52, + 0x18, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x72, 0x0a, 0x1c, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x19, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x12, 0x3c, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x0c, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x48, + 0x04, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x88, 0x01, 0x01, 0x42, 0x16, + 0x0a, 0x14, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, + 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1e, + 0x0a, 0x1c, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x0c, + 0x0a, 0x0a, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x22, 0x98, 0x06, 0x0a, + 0x10, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x3d, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x25, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x1f, 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, + 0x12, 0x1b, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x23, 0x0a, + 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x26, 0x0a, 0x0c, 0x73, 0x6f, 0x66, 0x74, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x6f, 0x66, 0x74, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x88, 0x01, 0x01, 0x12, 0x33, 0x0a, 0x13, 0x69, 0x66, + 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, + 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x11, 0x69, 0x66, 0x47, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, + 0x3a, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, + 0x48, 0x02, 0x52, 0x14, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3b, 0x0a, 0x17, 0x69, + 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x48, 0x03, 0x52, 0x15, + 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x42, 0x0a, 0x1b, 0x69, 0x66, 0x5f, 0x6d, + 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, + 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x48, 0x04, 0x52, + 0x18, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x72, 0x0a, 0x1c, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x19, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x12, 0x3c, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x48, + 0x05, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x88, 0x01, 0x01, 0x12, 0x28, + 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, + 0x0c, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x74, + 0x6f, 0x72, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x73, 0x6f, 0x66, + 0x74, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x42, 0x16, 0x0a, 0x14, 0x5f, 0x69, 0x66, + 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, + 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, + 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1e, 0x0a, 0x1c, 0x5f, 0x69, 0x66, + 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x72, 0x65, + 0x61, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x22, 0xaf, 0x02, 0x0a, 0x12, 0x52, 0x65, 0x61, 0x64, + 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, + 0x0a, 0x10, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x5f, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x68, 0x65, + 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0f, 0x63, 0x68, + 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x4d, 0x0a, + 0x10, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x52, 0x0f, 0x6f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x12, 0x44, 0x0a, 0x0d, + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, + 0x61, 0x6e, 0x67, 0x65, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x6e, + 0x67, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, + 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, + 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0xd0, 0x06, 0x0a, 0x12, 0x42, 0x69, + 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, + 0x12, 0x3d, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x25, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x1f, 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, + 0x1b, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x23, 0x0a, 0x0a, + 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, + 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x33, 0x0a, 0x13, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, + 0x52, 0x11, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, + 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3a, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, - 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x18, 0x69, 0x66, 0x4d, 0x65, 0x74, - 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, - 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x2a, 0x0a, 0x0e, 0x70, 0x72, 0x65, 0x64, 0x65, 0x66, - 0x69, 0x6e, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, - 0xe0, 0x41, 0x01, 0x52, 0x0d, 0x70, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x41, - 0x63, 0x6c, 0x12, 0x46, 0x0a, 0x1d, 0x70, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, - 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, - 0x61, 0x63, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x1a, - 0x70, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, - 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x41, 0x63, 0x6c, 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x42, 0x03, 0xe0, 0x41, 0x02, - 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x42, 0x1a, 0x0a, 0x18, + 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x14, 0x69, 0x66, 0x47, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, + 0x01, 0x01, 0x12, 0x3b, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x03, 0x48, 0x02, 0x52, 0x15, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, + 0x42, 0x0a, 0x1b, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x03, 0x48, 0x03, 0x52, 0x18, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, + 0x88, 0x01, 0x01, 0x12, 0x72, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x19, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x40, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x5f, + 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, + 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x42, 0x02, 0x18, 0x01, 0x48, 0x04, 0x52, 0x08, 0x72, 0x65, + 0x61, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x88, 0x01, 0x01, 0x12, 0x47, 0x0a, 0x0b, 0x72, 0x65, 0x61, + 0x64, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, + 0x76, 0x32, 0x2e, 0x42, 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, 0x48, 0x61, 0x6e, 0x64, 0x6c, + 0x65, 0x48, 0x05, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x88, + 0x01, 0x01, 0x12, 0x28, 0x0a, 0x0d, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x48, 0x06, 0x52, 0x0c, 0x72, 0x6f, 0x75, + 0x74, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x88, 0x01, 0x01, 0x42, 0x16, 0x0a, 0x14, + 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, + 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, + 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1e, 0x0a, 0x1c, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1e, 0x0a, 0x1c, 0x5f, 0x69, 0x66, 0x5f, + 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x0c, 0x0a, 0x0a, + 0x5f, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x72, + 0x65, 0x61, 0x64, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x72, + 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xb1, 0x01, 0x0a, + 0x15, 0x42, 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x54, 0x0a, 0x10, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0e, 0x72, 0x65, + 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x12, 0x42, 0x0a, 0x0b, + 0x72, 0x65, 0x61, 0x64, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, + 0x22, 0xe5, 0x01, 0x0a, 0x16, 0x42, 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x12, 0x6f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, + 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x10, 0x6f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x44, 0x61, 0x74, 0x61, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x35, 0x0a, + 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x12, 0x42, 0x0a, 0x0b, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x68, 0x61, 0x6e, + 0x64, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x69, + 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x0a, 0x72, 0x65, + 0x61, 0x64, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0x9f, 0x01, 0x0a, 0x1d, 0x42, 0x69, 0x64, + 0x69, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x64, 0x69, 0x72, + 0x65, 0x63, 0x74, 0x65, 0x64, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x42, 0x0a, 0x0b, 0x72, 0x65, + 0x61, 0x64, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, 0x48, 0x61, 0x6e, 0x64, + 0x6c, 0x65, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x28, + 0x0a, 0x0d, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0c, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x88, 0x01, 0x01, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x72, 0x6f, 0x75, + 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xed, 0x01, 0x0a, 0x1e, 0x42, + 0x69, 0x64, 0x69, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, + 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x65, 0x64, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x28, 0x0a, + 0x0d, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0c, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x4a, 0x0a, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, + 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, + 0x32, 0x2e, 0x42, 0x69, 0x64, 0x69, 0x57, 0x72, 0x69, 0x74, 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, + 0x65, 0x48, 0x01, 0x52, 0x0b, 0x77, 0x72, 0x69, 0x74, 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, + 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x48, 0x02, 0x52, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x72, 0x6f, 0x75, + 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x77, + 0x72, 0x69, 0x74, 0x65, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, + 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x64, 0x0a, 0x13, 0x42, 0x69, + 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x45, 0x72, 0x72, 0x6f, + 0x72, 0x12, 0x4d, 0x0a, 0x11, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, + 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, + 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, + 0x0f, 0x72, 0x65, 0x61, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x73, + 0x22, 0x55, 0x0a, 0x0e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x45, 0x72, 0x72, + 0x6f, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x06, 0x72, 0x65, 0x61, 0x64, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x75, 0x0a, 0x09, 0x52, 0x65, 0x61, 0x64, 0x52, + 0x61, 0x6e, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x0b, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6f, 0x66, 0x66, + 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0a, + 0x72, 0x65, 0x61, 0x64, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x24, 0x0a, 0x0b, 0x72, 0x65, + 0x61, 0x64, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, + 0x12, 0x1c, 0x0a, 0x07, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x03, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x72, 0x65, 0x61, 0x64, 0x49, 0x64, 0x22, 0xba, + 0x01, 0x0a, 0x0f, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x61, + 0x74, 0x61, 0x12, 0x4d, 0x0a, 0x10, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, + 0x64, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, + 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, + 0x52, 0x0f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x44, 0x61, 0x74, + 0x61, 0x12, 0x3b, 0x0a, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x61, + 0x6e, 0x67, 0x65, 0x52, 0x09, 0x72, 0x65, 0x61, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x1b, + 0x0a, 0x09, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x65, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x08, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x45, 0x6e, 0x64, 0x22, 0x2d, 0x0a, 0x0e, 0x42, + 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x1b, 0x0a, + 0x06, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x03, 0xe0, + 0x41, 0x02, 0x52, 0x06, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0x2e, 0x0a, 0x0f, 0x42, 0x69, + 0x64, 0x69, 0x57, 0x72, 0x69, 0x74, 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x1b, 0x0a, + 0x06, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x03, 0xe0, + 0x41, 0x02, 0x52, 0x06, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0xc5, 0x04, 0x0a, 0x0f, 0x57, + 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x12, 0x3a, + 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x02, + 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x2a, 0x0a, 0x0e, 0x70, 0x72, + 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x6c, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0d, 0x70, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, + 0x6e, 0x65, 0x64, 0x41, 0x63, 0x6c, 0x12, 0x33, 0x0a, 0x13, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x11, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3a, 0x0a, 0x17, 0x69, + 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, + 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x14, + 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, + 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3b, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x6d, 0x65, + 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, + 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x48, 0x02, 0x52, 0x15, 0x69, 0x66, 0x4d, 0x65, + 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, + 0x68, 0x88, 0x01, 0x01, 0x12, 0x42, 0x0a, 0x1b, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, + 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, + 0x74, 0x63, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x48, 0x03, 0x52, 0x18, 0x69, 0x66, 0x4d, + 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, + 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x24, 0x0a, 0x0b, 0x6f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x48, 0x04, 0x52, + 0x0a, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x88, 0x01, 0x01, 0x12, 0x23, + 0x0a, 0x0a, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x08, 0x48, 0x05, 0x52, 0x0a, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65, + 0x88, 0x01, 0x01, 0x42, 0x16, 0x0a, 0x14, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, + 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, + 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x6d, + 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, + 0x74, 0x63, 0x68, 0x42, 0x1e, 0x0a, 0x1c, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, + 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, + 0x74, 0x63, 0x68, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x73, + 0x69, 0x7a, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x61, 0x62, + 0x6c, 0x65, 0x22, 0x87, 0x04, 0x0a, 0x12, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x09, 0x75, 0x70, 0x6c, + 0x6f, 0x61, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, + 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x49, 0x64, 0x12, 0x50, 0x0a, 0x11, 0x77, 0x72, 0x69, 0x74, + 0x65, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x48, 0x00, 0x52, 0x0f, 0x77, 0x72, 0x69, 0x74, 0x65, + 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x12, 0x26, 0x0a, 0x0c, 0x77, 0x72, + 0x69, 0x74, 0x65, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, + 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0b, 0x77, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x66, 0x66, 0x73, + 0x65, 0x74, 0x12, 0x4f, 0x0a, 0x10, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, + 0x64, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, + 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, + 0x48, 0x01, 0x52, 0x0f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x44, + 0x61, 0x74, 0x61, 0x12, 0x52, 0x0a, 0x10, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x63, 0x68, + 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, + 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, + 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, + 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x12, 0x26, 0x0a, 0x0c, 0x66, 0x69, 0x6e, 0x69, 0x73, + 0x68, 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, + 0x41, 0x01, 0x52, 0x0b, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, + 0x72, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x19, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x42, 0x0f, 0x0a, 0x0d, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x87, 0x01, 0x0a, + 0x13, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x0e, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, + 0x64, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x0d, + 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x64, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x37, 0x0a, + 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x00, 0x52, 0x08, 0x72, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x0e, 0x0a, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xe9, 0x03, 0x0a, 0x10, 0x41, 0x70, 0x70, 0x65, 0x6e, + 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x12, 0x3d, 0x0a, 0x06, 0x62, + 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0xe0, 0x41, 0x02, + 0xfa, 0x41, 0x1f, 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, + 0x65, 0x74, 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x1b, 0x0a, 0x06, 0x6f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, + 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x23, 0x0a, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x02, + 0x52, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3b, 0x0a, 0x17, + 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, + 0x15, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x42, 0x0a, 0x1b, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, - 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x22, 0xe5, 0x07, 0x0a, 0x14, 0x43, 0x6f, 0x6d, - 0x70, 0x6f, 0x73, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x40, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, + 0x52, 0x18, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x28, 0x0a, + 0x0d, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x0c, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x4a, 0x0a, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, + 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, + 0x32, 0x2e, 0x42, 0x69, 0x64, 0x69, 0x57, 0x72, 0x69, 0x74, 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, + 0x65, 0x48, 0x03, 0x52, 0x0b, 0x77, 0x72, 0x69, 0x74, 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, + 0x88, 0x01, 0x01, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, + 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, + 0x1e, 0x0a, 0x1c, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, + 0x10, 0x0a, 0x0e, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x68, 0x61, 0x6e, 0x64, + 0x6c, 0x65, 0x22, 0xa3, 0x05, 0x0a, 0x16, 0x42, 0x69, 0x64, 0x69, 0x57, 0x72, 0x69, 0x74, 0x65, + 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, + 0x09, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x48, 0x00, 0x52, 0x08, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x49, 0x64, 0x12, 0x50, 0x0a, 0x11, + 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x73, 0x70, 0x65, + 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x57, 0x72, 0x69, 0x74, + 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x48, 0x00, 0x52, 0x0f, 0x77, + 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x12, 0x53, + 0x0a, 0x12, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, + 0x73, 0x70, 0x65, 0x63, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x41, + 0x70, 0x70, 0x65, 0x6e, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x48, + 0x00, 0x52, 0x10, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, + 0x70, 0x65, 0x63, 0x12, 0x26, 0x0a, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x6f, 0x66, 0x66, + 0x73, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0b, + 0x77, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x4f, 0x0a, 0x10, 0x63, + 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, + 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x48, 0x01, 0x52, 0x0f, 0x63, 0x68, 0x65, + 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x52, 0x0a, 0x10, + 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x60, 0x0a, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, - 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x41, 0x0a, 0x1a, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x5f, - 0x61, 0x63, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x18, - 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x65, 0x64, 0x65, - 0x66, 0x69, 0x6e, 0x65, 0x64, 0x41, 0x63, 0x6c, 0x12, 0x33, 0x0a, 0x13, 0x69, 0x66, 0x5f, 0x67, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x11, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3b, 0x0a, - 0x17, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, - 0x52, 0x15, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x42, 0x0a, 0x07, 0x6b, 0x6d, - 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x29, 0xe0, 0x41, 0x01, - 0xfa, 0x41, 0x23, 0x0a, 0x21, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x72, 0x79, - 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x52, 0x06, 0x6b, 0x6d, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x72, - 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, - 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x19, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x12, 0x52, 0x0a, 0x10, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x63, 0x68, 0x65, - 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, - 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, - 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, - 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x1a, 0xb3, 0x02, 0x0a, 0x0c, 0x53, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x23, 0x0a, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x80, 0x01, 0x0a, 0x14, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x5f, 0x70, 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x48, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, - 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, - 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x03, - 0xe0, 0x41, 0x01, 0x52, 0x13, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x65, 0x63, 0x6f, - 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x62, 0x0a, 0x13, 0x4f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, - 0x33, 0x0a, 0x13, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x11, - 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, - 0x68, 0x88, 0x01, 0x01, 0x42, 0x16, 0x0a, 0x14, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x16, 0x0a, 0x14, - 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, - 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, - 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, - 0x22, 0xec, 0x04, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, - 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x1f, - 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, - 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x1b, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x6f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x12, 0x23, 0x0a, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0a, 0x67, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x13, 0x69, 0x66, 0x5f, - 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x11, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3a, - 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x48, - 0x01, 0x52, 0x14, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, - 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3b, 0x0a, 0x17, 0x69, 0x66, - 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x48, 0x02, 0x52, 0x15, 0x69, - 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, - 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x42, 0x0a, 0x1b, 0x69, 0x66, 0x5f, 0x6d, 0x65, - 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, - 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x48, 0x03, 0x52, 0x18, - 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x72, 0x0a, 0x1c, 0x63, + 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, + 0x0f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, + 0x12, 0x26, 0x0a, 0x0c, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x6c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0b, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x12, 0x19, 0x0a, 0x05, 0x66, 0x6c, 0x75, 0x73, + 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x05, 0x66, 0x6c, + 0x75, 0x73, 0x68, 0x12, 0x26, 0x0a, 0x0c, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x5f, 0x77, 0x72, + 0x69, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0b, + 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x72, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, @@ -8142,1833 +8649,1367 @@ var file_google_storage_v2_storage_proto_rawDesc = []byte{ 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x19, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, - 0x16, 0x0a, 0x14, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x67, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, - 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, - 0x1e, 0x0a, 0x1c, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x22, - 0xd8, 0x05, 0x0a, 0x14, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, - 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x1f, - 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, - 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x1b, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x6f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x12, 0x23, 0x0a, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0a, 0x67, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x0d, 0x72, 0x65, 0x73, - 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x12, 0x33, 0x0a, 0x13, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, - 0x48, 0x00, 0x52, 0x11, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3a, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x67, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, - 0x74, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x14, 0x69, 0x66, 0x47, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, - 0x68, 0x88, 0x01, 0x01, 0x12, 0x3b, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x03, 0x48, 0x02, 0x52, 0x15, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, - 0x01, 0x12, 0x42, 0x0a, 0x1b, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x48, 0x03, 0x52, 0x18, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, - 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, - 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x2b, 0x0a, 0x0f, 0x63, 0x6f, 0x70, 0x79, 0x5f, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x5f, 0x61, 0x63, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x48, 0x04, - 0x52, 0x0d, 0x63, 0x6f, 0x70, 0x79, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x41, 0x63, 0x6c, 0x88, - 0x01, 0x01, 0x12, 0x72, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, + 0x0f, 0x0a, 0x0d, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x42, 0x06, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xe8, 0x01, 0x0a, 0x17, 0x42, 0x69, 0x64, + 0x69, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x0e, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, + 0x64, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x0d, + 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x64, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x37, 0x0a, + 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x00, 0x52, 0x08, 0x72, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x4a, 0x0a, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, + 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, + 0x2e, 0x42, 0x69, 0x64, 0x69, 0x57, 0x72, 0x69, 0x74, 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, + 0x48, 0x01, 0x52, 0x0b, 0x77, 0x72, 0x69, 0x74, 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x88, + 0x01, 0x01, 0x42, 0x0e, 0x0a, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x68, 0x61, 0x6e, + 0x64, 0x6c, 0x65, 0x22, 0x9e, 0x05, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x06, 0x70, 0x61, + 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0xe0, 0x41, 0x02, 0xfa, + 0x41, 0x1f, 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, + 0x74, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x09, 0x70, 0x61, 0x67, + 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, + 0x01, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x22, 0x0a, 0x0a, 0x70, + 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, + 0x21, 0x0a, 0x09, 0x64, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x09, 0x64, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, + 0x65, 0x72, 0x12, 0x41, 0x0a, 0x1a, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x74, 0x72, + 0x61, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x18, 0x69, 0x6e, 0x63, + 0x6c, 0x75, 0x64, 0x65, 0x54, 0x72, 0x61, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x69, + 0x6d, 0x69, 0x74, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x06, 0x70, 0x72, 0x65, 0x66, + 0x69, 0x78, 0x12, 0x1f, 0x0a, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x3c, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, + 0x73, 0x6b, 0x48, 0x00, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x88, 0x01, + 0x01, 0x12, 0x34, 0x0a, 0x13, 0x6c, 0x65, 0x78, 0x69, 0x63, 0x6f, 0x67, 0x72, 0x61, 0x70, 0x68, + 0x69, 0x63, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, + 0xe0, 0x41, 0x01, 0x52, 0x12, 0x6c, 0x65, 0x78, 0x69, 0x63, 0x6f, 0x67, 0x72, 0x61, 0x70, 0x68, + 0x69, 0x63, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x30, 0x0a, 0x11, 0x6c, 0x65, 0x78, 0x69, 0x63, + 0x6f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x5f, 0x65, 0x6e, 0x64, 0x18, 0x0b, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x10, 0x6c, 0x65, 0x78, 0x69, 0x63, 0x6f, 0x67, + 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x45, 0x6e, 0x64, 0x12, 0x26, 0x0a, 0x0c, 0x73, 0x6f, 0x66, + 0x74, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0b, 0x73, 0x6f, 0x66, 0x74, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x64, 0x12, 0x42, 0x0a, 0x1b, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x66, 0x6f, 0x6c, + 0x64, 0x65, 0x72, 0x73, 0x5f, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x65, 0x73, + 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x18, 0x69, 0x6e, 0x63, + 0x6c, 0x75, 0x64, 0x65, 0x46, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x73, 0x41, 0x73, 0x50, 0x72, 0x65, + 0x66, 0x69, 0x78, 0x65, 0x73, 0x12, 0x22, 0x0a, 0x0a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x67, + 0x6c, 0x6f, 0x62, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x09, + 0x6d, 0x61, 0x74, 0x63, 0x68, 0x47, 0x6c, 0x6f, 0x62, 0x12, 0x1b, 0x0a, 0x06, 0x66, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x06, + 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x5f, + 0x6d, 0x61, 0x73, 0x6b, 0x22, 0xaf, 0x01, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x57, 0x72, + 0x69, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x20, 0x0a, 0x09, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x08, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, + 0x49, 0x64, 0x12, 0x72, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x19, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x16, 0x0a, 0x14, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, - 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, - 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1e, 0x0a, 0x1c, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, - 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, - 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x63, 0x6f, 0x70, 0x79, 0x5f, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x61, 0x63, 0x6c, 0x22, 0x3f, 0x0a, 0x1b, 0x43, 0x61, - 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, 0x69, - 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x09, 0x75, 0x70, 0x6c, - 0x6f, 0x61, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, - 0x02, 0x52, 0x08, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x49, 0x64, 0x22, 0x1e, 0x0a, 0x1c, 0x43, - 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, - 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x80, 0x06, 0x0a, 0x11, - 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x3d, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x25, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x1f, 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, - 0x12, 0x1b, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x23, 0x0a, - 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x24, 0x0a, 0x0b, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, - 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0a, 0x72, 0x65, - 0x61, 0x64, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x22, 0x0a, 0x0a, 0x72, 0x65, 0x61, 0x64, - 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, - 0x01, 0x52, 0x09, 0x72, 0x65, 0x61, 0x64, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x33, 0x0a, 0x13, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x8c, 0x01, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x0e, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x64, + 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x0d, 0x70, + 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x64, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x37, 0x0a, 0x08, + 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, + 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x00, 0x52, 0x08, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x0e, 0x0a, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xea, 0x0e, 0x0a, 0x14, 0x52, 0x65, 0x77, 0x72, 0x69, 0x74, + 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, + 0x0a, 0x10, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x18, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe0, 0x41, 0x02, 0xe0, 0x41, 0x05, + 0x52, 0x0f, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x57, 0x0a, 0x12, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x19, 0x20, 0x01, 0x28, 0x09, 0x42, 0x28, 0xe0, + 0x41, 0x02, 0xe0, 0x41, 0x05, 0xfa, 0x41, 0x1f, 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x11, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x59, 0x0a, 0x13, 0x64, 0x65, + 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x6d, 0x73, 0x5f, 0x6b, 0x65, + 0x79, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x09, 0x42, 0x29, 0xe0, 0x41, 0x01, 0xfa, 0x41, 0x23, 0x0a, + 0x21, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, + 0x65, 0x79, 0x52, 0x11, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4b, + 0x6d, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x40, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x74, + 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4a, 0x0a, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, + 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x1f, 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x42, + 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x75, 0x63, + 0x6b, 0x65, 0x74, 0x12, 0x28, 0x0a, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, + 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x30, 0x0a, + 0x11, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x10, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x28, 0x0a, 0x0d, 0x72, 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0c, 0x72, 0x65, 0x77, + 0x72, 0x69, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x41, 0x0a, 0x1a, 0x64, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, + 0x6e, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x6c, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, + 0x41, 0x01, 0x52, 0x18, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, + 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x41, 0x63, 0x6c, 0x12, 0x33, 0x0a, 0x13, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, - 0x74, 0x63, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x11, 0x69, 0x66, 0x47, + 0x74, 0x63, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x11, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3a, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x07, 0x20, 0x01, + 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x14, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3b, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x48, 0x02, + 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x48, 0x02, 0x52, 0x15, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x42, 0x0a, 0x1b, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x48, + 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x48, 0x03, 0x52, 0x18, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x72, + 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x40, + 0x0a, 0x1a, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x67, 0x65, 0x6e, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x0b, 0x20, 0x01, + 0x28, 0x03, 0x48, 0x04, 0x52, 0x17, 0x69, 0x66, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x47, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, + 0x12, 0x47, 0x0a, 0x1e, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x67, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, + 0x63, 0x68, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x48, 0x05, 0x52, 0x1a, 0x69, 0x66, 0x53, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, + 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x48, 0x0a, 0x1e, 0x69, 0x66, 0x5f, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, + 0x03, 0x48, 0x06, 0x52, 0x1b, 0x69, 0x66, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x65, 0x74, + 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, + 0x88, 0x01, 0x01, 0x12, 0x4f, 0x0a, 0x22, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x48, + 0x07, 0x52, 0x1e, 0x69, 0x66, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x67, + 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, + 0x68, 0x88, 0x01, 0x01, 0x12, 0x43, 0x0a, 0x1c, 0x6d, 0x61, 0x78, 0x5f, 0x62, 0x79, 0x74, 0x65, + 0x73, 0x5f, 0x72, 0x65, 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x5f, 0x70, 0x65, 0x72, 0x5f, + 0x63, 0x61, 0x6c, 0x6c, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, + 0x18, 0x6d, 0x61, 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, 0x65, 0x77, 0x72, 0x69, 0x74, 0x74, + 0x65, 0x6e, 0x50, 0x65, 0x72, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x4c, 0x0a, 0x20, 0x63, 0x6f, 0x70, + 0x79, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x18, 0x10, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x1d, 0x63, 0x6f, 0x70, 0x79, 0x53, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6c, + 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x4b, 0x0a, 0x20, 0x63, 0x6f, 0x70, 0x79, 0x5f, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x15, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x1c, 0x63, 0x6f, 0x70, 0x79, 0x53, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x42, + 0x79, 0x74, 0x65, 0x73, 0x12, 0x58, 0x0a, 0x27, 0x63, 0x6f, 0x70, 0x79, 0x5f, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x5f, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, + 0x65, 0x79, 0x5f, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, + 0x16, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x22, 0x63, 0x6f, 0x70, 0x79, + 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x4b, 0x65, 0x79, 0x53, 0x68, 0x61, 0x32, 0x35, 0x36, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x72, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x0a, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x19, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x12, 0x3c, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, - 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, - 0x6b, 0x48, 0x04, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x88, 0x01, 0x01, - 0x42, 0x16, 0x0a, 0x14, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, + 0x6d, 0x73, 0x12, 0x52, 0x0a, 0x10, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x63, 0x68, 0x65, + 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, + 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, + 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, + 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x42, 0x16, 0x0a, 0x14, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, + 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, + 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1e, 0x0a, 0x1c, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, + 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, + 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1d, 0x0a, 0x1b, 0x5f, 0x69, 0x66, 0x5f, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x21, 0x0a, 0x1f, 0x5f, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, + 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x21, 0x0a, 0x1f, 0x5f, 0x69, 0x66, 0x5f, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x25, 0x0a, 0x23, 0x5f, + 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, + 0x63, 0x68, 0x22, 0xd6, 0x01, 0x0a, 0x0f, 0x52, 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x15, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, + 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x72, 0x65, 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x13, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x42, 0x79, 0x74, 0x65, + 0x73, 0x52, 0x65, 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x6f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x0a, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, + 0x6f, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x64, 0x6f, 0x6e, 0x65, 0x12, + 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x35, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0xec, 0x07, 0x0a, 0x11, + 0x4d, 0x6f, 0x76, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x3d, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x25, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x1f, 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, + 0x12, 0x28, 0x0a, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0c, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x32, 0x0a, 0x12, 0x64, 0x65, + 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x11, 0x64, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x45, + 0x0a, 0x1a, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x67, 0x65, 0x6e, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x00, 0x52, 0x17, 0x69, 0x66, 0x53, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, + 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x4c, 0x0a, 0x1e, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, + 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, + 0x41, 0x01, 0x48, 0x01, 0x52, 0x1a, 0x69, 0x66, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x47, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, + 0x88, 0x01, 0x01, 0x12, 0x4d, 0x0a, 0x1e, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, + 0x48, 0x02, 0x52, 0x1b, 0x69, 0x66, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, + 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, + 0x01, 0x01, 0x12, 0x54, 0x0a, 0x22, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, + 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, + 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, + 0xe0, 0x41, 0x01, 0x48, 0x03, 0x52, 0x1e, 0x69, 0x66, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, + 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, + 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x38, 0x0a, 0x13, 0x69, 0x66, 0x5f, 0x67, + 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x04, 0x52, 0x11, 0x69, 0x66, + 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, + 0x01, 0x01, 0x12, 0x3f, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x05, 0x52, 0x14, 0x69, 0x66, 0x47, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, + 0x88, 0x01, 0x01, 0x12, 0x40, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x0a, + 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x06, 0x52, 0x15, 0x69, 0x66, 0x4d, + 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, + 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x47, 0x0a, 0x1b, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, - 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, - 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, - 0x42, 0x1e, 0x0a, 0x1c, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, + 0x61, 0x74, 0x63, 0x68, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, + 0x07, 0x52, 0x18, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x42, 0x1d, + 0x0a, 0x1b, 0x5f, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x67, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x21, 0x0a, + 0x1f, 0x5f, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, - 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x22, 0x98, - 0x06, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x25, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x1f, 0x0a, 0x1d, 0x73, 0x74, 0x6f, - 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, - 0x65, 0x74, 0x12, 0x1b, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, - 0x23, 0x0a, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x0a, 0x0c, 0x73, 0x6f, 0x66, 0x74, 0x5f, 0x64, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x6f, - 0x66, 0x74, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x88, 0x01, 0x01, 0x12, 0x33, 0x0a, 0x13, - 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, - 0x74, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x11, 0x69, 0x66, 0x47, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, - 0x01, 0x12, 0x3a, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x03, 0x48, 0x02, 0x52, 0x14, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3b, 0x0a, - 0x17, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x48, 0x03, - 0x52, 0x15, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x42, 0x0a, 0x1b, 0x69, 0x66, - 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x48, - 0x04, 0x52, 0x18, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x72, + 0x42, 0x21, 0x0a, 0x1f, 0x5f, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6d, + 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, + 0x74, 0x63, 0x68, 0x42, 0x25, 0x0a, 0x23, 0x5f, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x16, 0x0a, 0x14, 0x5f, 0x69, + 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, + 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, + 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1e, 0x0a, 0x1c, 0x5f, 0x69, + 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x22, 0xb9, 0x02, 0x0a, 0x1a, 0x53, + 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, 0x69, + 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x53, 0x0a, 0x11, 0x77, 0x72, 0x69, + 0x74, 0x65, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, + 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0f, 0x77, + 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x12, 0x72, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x08, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x19, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x12, 0x3c, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, - 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x6d, 0x73, 0x12, 0x52, 0x0a, 0x10, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x63, 0x68, 0x65, + 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, + 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, + 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, + 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x22, 0x3a, 0x0a, 0x1b, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, + 0x65, 0x73, 0x75, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, + 0x49, 0x64, 0x22, 0xd6, 0x05, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x06, 0x6f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x12, 0x33, 0x0a, 0x13, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x48, + 0x00, 0x52, 0x11, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, + 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3a, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x67, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, + 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x14, 0x69, 0x66, 0x47, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, + 0x88, 0x01, 0x01, 0x12, 0x3b, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x03, 0x48, 0x02, 0x52, 0x15, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, + 0x12, 0x42, 0x0a, 0x1b, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x03, 0x48, 0x03, 0x52, 0x18, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, + 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, + 0x68, 0x88, 0x01, 0x01, 0x12, 0x2a, 0x0a, 0x0e, 0x70, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, + 0x65, 0x64, 0x5f, 0x61, 0x63, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, + 0x01, 0x52, 0x0d, 0x70, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x41, 0x63, 0x6c, + 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, - 0x6b, 0x48, 0x05, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x88, 0x01, 0x01, - 0x12, 0x28, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0c, 0x72, 0x65, - 0x73, 0x74, 0x6f, 0x72, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x73, - 0x6f, 0x66, 0x74, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x42, 0x16, 0x0a, 0x14, 0x5f, + 0x6b, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, + 0x73, 0x6b, 0x12, 0x72, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x19, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x43, 0x0a, 0x1b, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, + 0x64, 0x65, 0x5f, 0x75, 0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x74, 0x65, + 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, + 0x52, 0x19, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x55, 0x6e, 0x6c, 0x6f, 0x63, 0x6b, + 0x65, 0x64, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x16, 0x0a, 0x14, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1e, 0x0a, 0x1c, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, - 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x22, 0xaf, 0x02, 0x0a, 0x12, 0x52, 0x65, - 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x4d, 0x0a, 0x10, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x5f, - 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, - 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0f, - 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, - 0x4d, 0x0a, 0x10, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, - 0x75, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x52, 0x0f, 0x6f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x12, 0x44, - 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, - 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, - 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, - 0x61, 0x6e, 0x67, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0xd0, 0x06, 0x0a, 0x12, - 0x42, 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, - 0x65, 0x63, 0x12, 0x3d, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x25, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x1f, 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, - 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, - 0x74, 0x12, 0x1b, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x23, - 0x0a, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x13, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, - 0x48, 0x00, 0x52, 0x11, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3a, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x67, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, - 0x74, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x14, 0x69, 0x66, 0x47, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, - 0x68, 0x88, 0x01, 0x01, 0x12, 0x3b, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x03, 0x48, 0x02, 0x52, 0x15, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, - 0x01, 0x12, 0x42, 0x0a, 0x1b, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x48, 0x03, 0x52, 0x18, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, - 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, - 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x72, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, - 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, + 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x22, 0xce, 0x01, 0x0a, 0x19, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x19, - 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x40, 0x0a, 0x09, 0x72, 0x65, 0x61, - 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, - 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x42, 0x02, 0x18, 0x01, 0x48, 0x04, 0x52, 0x08, - 0x72, 0x65, 0x61, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x88, 0x01, 0x01, 0x12, 0x47, 0x0a, 0x0b, 0x72, - 0x65, 0x61, 0x64, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, 0x48, 0x61, 0x6e, - 0x64, 0x6c, 0x65, 0x48, 0x05, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x48, 0x61, 0x6e, 0x64, 0x6c, - 0x65, 0x88, 0x01, 0x01, 0x12, 0x28, 0x0a, 0x0d, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x5f, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x48, 0x06, 0x52, 0x0c, 0x72, - 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x88, 0x01, 0x01, 0x42, 0x16, - 0x0a, 0x14, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, - 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1e, - 0x0a, 0x1c, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x0c, - 0x0a, 0x0a, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x42, 0x0e, 0x0a, 0x0c, - 0x5f, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x42, 0x10, 0x0a, 0x0e, - 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xb1, - 0x01, 0x0a, 0x15, 0x42, 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x54, 0x0a, 0x10, 0x72, 0x65, 0x61, 0x64, - 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, - 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0e, - 0x72, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x12, 0x42, - 0x0a, 0x0b, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x08, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, - 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x61, 0x6e, 0x67, - 0x65, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x52, 0x61, 0x6e, 0x67, - 0x65, 0x73, 0x22, 0xe5, 0x01, 0x0a, 0x16, 0x42, 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, - 0x12, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x72, 0x61, 0x6e, - 0x67, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x10, 0x6f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x44, 0x61, 0x74, 0x61, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, - 0x35, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x08, 0x6d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x42, 0x0a, 0x0b, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x68, - 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, - 0x42, 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x0a, - 0x72, 0x65, 0x61, 0x64, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0x9f, 0x01, 0x0a, 0x1d, 0x42, - 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x64, - 0x69, 0x72, 0x65, 0x63, 0x74, 0x65, 0x64, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x42, 0x0a, 0x0b, - 0x72, 0x65, 0x61, 0x64, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, 0x48, 0x61, - 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, - 0x12, 0x28, 0x0a, 0x0d, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0c, 0x72, 0x6f, 0x75, 0x74, 0x69, - 0x6e, 0x67, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x88, 0x01, 0x01, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x72, - 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xed, 0x01, 0x0a, - 0x1e, 0x42, 0x69, 0x64, 0x69, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x52, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x65, 0x64, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, - 0x28, 0x0a, 0x0d, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0c, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, - 0x67, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x4a, 0x0a, 0x0c, 0x77, 0x72, 0x69, - 0x74, 0x65, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, - 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x69, 0x64, 0x69, 0x57, 0x72, 0x69, 0x74, 0x65, 0x48, 0x61, 0x6e, - 0x64, 0x6c, 0x65, 0x48, 0x01, 0x52, 0x0b, 0x77, 0x72, 0x69, 0x74, 0x65, 0x48, 0x61, 0x6e, 0x64, - 0x6c, 0x65, 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x48, 0x02, 0x52, 0x0a, 0x67, 0x65, 0x6e, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x72, - 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x0f, 0x0a, 0x0d, - 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x42, 0x0d, 0x0a, - 0x0b, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x64, 0x0a, 0x13, - 0x42, 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x45, 0x72, - 0x72, 0x6f, 0x72, 0x12, 0x4d, 0x0a, 0x11, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x72, 0x61, 0x6e, 0x67, - 0x65, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, - 0x76, 0x32, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x45, 0x72, 0x72, 0x6f, - 0x72, 0x52, 0x0f, 0x72, 0x65, 0x61, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x45, 0x72, 0x72, 0x6f, - 0x72, 0x73, 0x22, 0x55, 0x0a, 0x0e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x45, - 0x72, 0x72, 0x6f, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x72, 0x65, 0x61, 0x64, 0x49, 0x64, 0x12, 0x2a, 0x0a, - 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x75, 0x0a, 0x09, 0x52, 0x65, 0x61, - 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x0b, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6f, - 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x02, - 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x24, 0x0a, 0x0b, - 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x4c, 0x65, 0x6e, 0x67, - 0x74, 0x68, 0x12, 0x1c, 0x0a, 0x07, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x72, 0x65, 0x61, 0x64, 0x49, 0x64, - 0x22, 0xba, 0x01, 0x0a, 0x0f, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, - 0x44, 0x61, 0x74, 0x61, 0x12, 0x4d, 0x0a, 0x10, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, - 0x6d, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, - 0x76, 0x32, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x44, 0x61, - 0x74, 0x61, 0x52, 0x0f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x44, - 0x61, 0x74, 0x61, 0x12, 0x3b, 0x0a, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x72, 0x61, 0x6e, 0x67, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x61, 0x64, - 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x09, 0x72, 0x65, 0x61, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, - 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x65, 0x6e, 0x64, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x45, 0x6e, 0x64, 0x22, 0x2d, 0x0a, - 0x0e, 0x42, 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x12, - 0x1b, 0x0a, 0x06, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0x2e, 0x0a, 0x0f, - 0x42, 0x69, 0x64, 0x69, 0x57, 0x72, 0x69, 0x74, 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x12, - 0x1b, 0x0a, 0x06, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0xc5, 0x04, 0x0a, - 0x0f, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, - 0x12, 0x3a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, - 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x42, 0x03, 0xe0, - 0x41, 0x02, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x2a, 0x0a, 0x0e, - 0x70, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x6c, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0d, 0x70, 0x72, 0x65, 0x64, 0x65, - 0x66, 0x69, 0x6e, 0x65, 0x64, 0x41, 0x63, 0x6c, 0x12, 0x33, 0x0a, 0x13, 0x69, 0x66, 0x5f, 0x67, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x11, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3a, 0x0a, - 0x17, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, - 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, - 0x52, 0x14, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, - 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3b, 0x0a, 0x17, 0x69, 0x66, 0x5f, - 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, - 0x61, 0x74, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x48, 0x02, 0x52, 0x15, 0x69, 0x66, - 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, - 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x42, 0x0a, 0x1b, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, - 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, - 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x48, 0x03, 0x52, 0x18, 0x69, - 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, - 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x24, 0x0a, 0x0b, 0x6f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x48, - 0x04, 0x52, 0x0a, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x88, 0x01, 0x01, - 0x12, 0x23, 0x0a, 0x0a, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x09, - 0x20, 0x01, 0x28, 0x08, 0x48, 0x05, 0x52, 0x0a, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x61, 0x62, - 0x6c, 0x65, 0x88, 0x01, 0x01, 0x42, 0x16, 0x0a, 0x14, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, - 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, - 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1e, 0x0a, 0x1c, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, - 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, - 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, - 0x61, 0x62, 0x6c, 0x65, 0x22, 0x87, 0x04, 0x0a, 0x12, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x09, 0x75, - 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, - 0x52, 0x08, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x49, 0x64, 0x12, 0x50, 0x0a, 0x11, 0x77, 0x72, - 0x69, 0x74, 0x65, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, - 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x48, 0x00, 0x52, 0x0f, 0x77, 0x72, 0x69, - 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x12, 0x26, 0x0a, 0x0c, - 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0b, 0x77, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x66, - 0x66, 0x73, 0x65, 0x74, 0x12, 0x4f, 0x0a, 0x10, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, - 0x6d, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, - 0x76, 0x32, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x44, 0x61, - 0x74, 0x61, 0x48, 0x01, 0x52, 0x0f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, - 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x52, 0x0a, 0x10, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, - 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, - 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, - 0x75, 0x6d, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x12, 0x26, 0x0a, 0x0c, 0x66, 0x69, 0x6e, - 0x69, 0x73, 0x68, 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x42, - 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0b, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x57, 0x72, 0x69, 0x74, - 0x65, 0x12, 0x72, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, - 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x19, 0x63, 0x6f, 0x6d, 0x6d, - 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x0f, 0x0a, 0x0d, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x6d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x87, - 0x01, 0x0a, 0x13, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x0e, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, - 0x74, 0x65, 0x64, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, - 0x52, 0x0d, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x64, 0x53, 0x69, 0x7a, 0x65, 0x12, - 0x37, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x00, 0x52, 0x08, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x0e, 0x0a, 0x0c, 0x77, 0x72, 0x69, 0x74, - 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xe9, 0x03, 0x0a, 0x10, 0x41, 0x70, 0x70, - 0x65, 0x6e, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x12, 0x3d, 0x0a, - 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0xe0, - 0x41, 0x02, 0xfa, 0x41, 0x1f, 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x75, - 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x1b, 0x0a, 0x06, - 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, - 0x02, 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x23, 0x0a, 0x0a, 0x67, 0x65, 0x6e, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, - 0x41, 0x02, 0x52, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3b, - 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x48, - 0x00, 0x52, 0x15, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x42, 0x0a, 0x1b, 0x69, - 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, - 0x48, 0x01, 0x52, 0x18, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, - 0x28, 0x0a, 0x0d, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x0c, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, - 0x67, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x4a, 0x0a, 0x0c, 0x77, 0x72, 0x69, - 0x74, 0x65, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, - 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x69, 0x64, 0x69, 0x57, 0x72, 0x69, 0x74, 0x65, 0x48, 0x61, 0x6e, - 0x64, 0x6c, 0x65, 0x48, 0x03, 0x52, 0x0b, 0x77, 0x72, 0x69, 0x74, 0x65, 0x48, 0x61, 0x6e, 0x64, - 0x6c, 0x65, 0x88, 0x01, 0x01, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, - 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, - 0x68, 0x42, 0x1e, 0x0a, 0x1c, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, - 0x68, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x68, 0x61, - 0x6e, 0x64, 0x6c, 0x65, 0x22, 0xa3, 0x05, 0x0a, 0x16, 0x42, 0x69, 0x64, 0x69, 0x57, 0x72, 0x69, - 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x1d, 0x0a, 0x09, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x49, 0x64, 0x12, 0x50, - 0x0a, 0x11, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x73, - 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x57, 0x72, - 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x48, 0x00, 0x52, - 0x0f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, - 0x12, 0x53, 0x0a, 0x12, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, - 0x2e, 0x41, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, - 0x63, 0x48, 0x00, 0x52, 0x10, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x53, 0x70, 0x65, 0x63, 0x12, 0x26, 0x0a, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x6f, - 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x02, - 0x52, 0x0b, 0x77, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x4f, 0x0a, - 0x10, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x74, - 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x68, 0x65, 0x63, - 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x48, 0x01, 0x52, 0x0f, 0x63, - 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x52, - 0x0a, 0x10, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, - 0x6d, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x42, 0x03, 0xe0, 0x41, - 0x01, 0x52, 0x0f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, - 0x6d, 0x73, 0x12, 0x26, 0x0a, 0x0c, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x6c, 0x6f, 0x6f, 0x6b, - 0x75, 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0b, 0x73, - 0x74, 0x61, 0x74, 0x65, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x12, 0x19, 0x0a, 0x05, 0x66, 0x6c, - 0x75, 0x73, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x05, - 0x66, 0x6c, 0x75, 0x73, 0x68, 0x12, 0x26, 0x0a, 0x0c, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x5f, - 0x77, 0x72, 0x69, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, - 0x52, 0x0b, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x72, 0x0a, - 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x72, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x0a, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, - 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x19, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x42, 0x0f, 0x0a, 0x0d, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xe8, 0x01, 0x0a, 0x17, 0x42, - 0x69, 0x64, 0x69, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x0e, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, - 0x74, 0x65, 0x64, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, - 0x52, 0x0d, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x64, 0x53, 0x69, 0x7a, 0x65, 0x12, - 0x37, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x00, 0x52, 0x08, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x4a, 0x0a, 0x0c, 0x77, 0x72, 0x69, 0x74, - 0x65, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, - 0x76, 0x32, 0x2e, 0x42, 0x69, 0x64, 0x69, 0x57, 0x72, 0x69, 0x74, 0x65, 0x48, 0x61, 0x6e, 0x64, - 0x6c, 0x65, 0x48, 0x01, 0x52, 0x0b, 0x77, 0x72, 0x69, 0x74, 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, - 0x65, 0x88, 0x01, 0x01, 0x42, 0x0e, 0x0a, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x68, - 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0x9e, 0x05, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x06, - 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0xe0, 0x41, - 0x02, 0xfa, 0x41, 0x1f, 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, - 0x6b, 0x65, 0x74, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x09, 0x70, - 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, - 0xe0, 0x41, 0x01, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x22, 0x0a, - 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x12, 0x21, 0x0a, 0x09, 0x64, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x09, 0x64, 0x65, 0x6c, 0x69, 0x6d, - 0x69, 0x74, 0x65, 0x72, 0x12, 0x41, 0x0a, 0x1a, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, - 0x74, 0x72, 0x61, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, - 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x18, 0x69, - 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x54, 0x72, 0x61, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x44, 0x65, - 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, - 0x78, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x06, 0x70, 0x72, - 0x65, 0x66, 0x69, 0x78, 0x12, 0x1f, 0x0a, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x08, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3c, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6d, 0x61, - 0x73, 0x6b, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, - 0x4d, 0x61, 0x73, 0x6b, 0x48, 0x00, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x4d, 0x61, 0x73, 0x6b, - 0x88, 0x01, 0x01, 0x12, 0x34, 0x0a, 0x13, 0x6c, 0x65, 0x78, 0x69, 0x63, 0x6f, 0x67, 0x72, 0x61, - 0x70, 0x68, 0x69, 0x63, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x12, 0x6c, 0x65, 0x78, 0x69, 0x63, 0x6f, 0x67, 0x72, 0x61, - 0x70, 0x68, 0x69, 0x63, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x30, 0x0a, 0x11, 0x6c, 0x65, 0x78, - 0x69, 0x63, 0x6f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x5f, 0x65, 0x6e, 0x64, 0x18, 0x0b, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x10, 0x6c, 0x65, 0x78, 0x69, 0x63, - 0x6f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x45, 0x6e, 0x64, 0x12, 0x26, 0x0a, 0x0c, 0x73, - 0x6f, 0x66, 0x74, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, - 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0b, 0x73, 0x6f, 0x66, 0x74, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x64, 0x12, 0x42, 0x0a, 0x1b, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x66, - 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x73, 0x5f, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, - 0x65, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x18, 0x69, - 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x46, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x73, 0x41, 0x73, 0x50, - 0x72, 0x65, 0x66, 0x69, 0x78, 0x65, 0x73, 0x12, 0x22, 0x0a, 0x0a, 0x6d, 0x61, 0x74, 0x63, 0x68, - 0x5f, 0x67, 0x6c, 0x6f, 0x62, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, - 0x52, 0x09, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x47, 0x6c, 0x6f, 0x62, 0x12, 0x1b, 0x0a, 0x06, 0x66, - 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, - 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x72, 0x65, 0x61, - 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x22, 0xaf, 0x01, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x20, 0x0a, 0x09, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x08, 0x75, 0x70, 0x6c, 0x6f, - 0x61, 0x64, 0x49, 0x64, 0x12, 0x72, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x19, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x8c, 0x01, 0x0a, 0x18, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x0e, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, - 0x65, 0x64, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, - 0x0d, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x64, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x37, - 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x00, 0x52, 0x08, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x0e, 0x0a, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, - 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xea, 0x0e, 0x0a, 0x14, 0x52, 0x65, 0x77, 0x72, - 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x31, 0x0a, 0x10, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x18, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe0, 0x41, 0x02, 0xe0, - 0x41, 0x05, 0x52, 0x0f, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, - 0x61, 0x6d, 0x65, 0x12, 0x57, 0x0a, 0x12, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x19, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x28, 0xe0, 0x41, 0x02, 0xe0, 0x41, 0x05, 0xfa, 0x41, 0x1f, 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, - 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x11, 0x64, 0x65, 0x73, 0x74, 0x69, - 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x59, 0x0a, 0x13, - 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x6d, 0x73, 0x5f, - 0x6b, 0x65, 0x79, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x09, 0x42, 0x29, 0xe0, 0x41, 0x01, 0xfa, 0x41, - 0x23, 0x0a, 0x21, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x72, 0x79, 0x70, 0x74, - 0x6f, 0x4b, 0x65, 0x79, 0x52, 0x11, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x4b, 0x6d, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x40, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, - 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, - 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0b, 0x64, 0x65, - 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4a, 0x0a, 0x0d, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x25, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x1f, 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, - 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x28, 0x0a, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, - 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, - 0x02, 0x52, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, - 0x30, 0x0a, 0x11, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, - 0x10, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x28, 0x0a, 0x0d, 0x72, 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0c, 0x72, - 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x41, 0x0a, 0x1a, 0x64, - 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x65, 0x64, 0x65, - 0x66, 0x69, 0x6e, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x6c, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x03, 0xe0, 0x41, 0x01, 0x52, 0x18, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x50, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x41, 0x63, 0x6c, 0x12, 0x33, - 0x0a, 0x13, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x11, 0x69, - 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, - 0x88, 0x01, 0x01, 0x12, 0x3a, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x08, - 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x14, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, - 0x3b, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, - 0x48, 0x02, 0x52, 0x15, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x42, 0x0a, 0x1b, - 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x0a, 0x20, 0x01, 0x28, - 0x03, 0x48, 0x03, 0x52, 0x18, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, - 0x12, 0x40, 0x0a, 0x1a, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x67, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x0b, - 0x20, 0x01, 0x28, 0x03, 0x48, 0x04, 0x52, 0x17, 0x69, 0x66, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, - 0x01, 0x01, 0x12, 0x47, 0x0a, 0x1e, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, - 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, - 0x61, 0x74, 0x63, 0x68, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x48, 0x05, 0x52, 0x1a, 0x69, 0x66, - 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x48, 0x0a, 0x1e, 0x69, - 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x0d, 0x20, - 0x01, 0x28, 0x03, 0x48, 0x06, 0x52, 0x1b, 0x69, 0x66, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, - 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, - 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x4f, 0x0a, 0x22, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x0e, 0x20, 0x01, 0x28, - 0x03, 0x48, 0x07, 0x52, 0x1e, 0x69, 0x66, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x65, 0x74, - 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, - 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x43, 0x0a, 0x1c, 0x6d, 0x61, 0x78, 0x5f, 0x62, 0x79, - 0x74, 0x65, 0x73, 0x5f, 0x72, 0x65, 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x5f, 0x70, 0x65, - 0x72, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, - 0x01, 0x52, 0x18, 0x6d, 0x61, 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, 0x65, 0x77, 0x72, 0x69, - 0x74, 0x74, 0x65, 0x6e, 0x50, 0x65, 0x72, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x4c, 0x0a, 0x20, 0x63, - 0x6f, 0x70, 0x79, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x65, 0x6e, 0x63, 0x72, 0x79, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x18, - 0x10, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x1d, 0x63, 0x6f, 0x70, 0x79, - 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x4b, 0x0a, 0x20, 0x63, 0x6f, 0x70, - 0x79, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x15, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x1c, 0x63, 0x6f, 0x70, 0x79, 0x53, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, - 0x79, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x58, 0x0a, 0x27, 0x63, 0x6f, 0x70, 0x79, 0x5f, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x5f, 0x62, 0x79, 0x74, 0x65, - 0x73, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x22, 0x63, 0x6f, - 0x70, 0x79, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x53, 0x68, 0x61, 0x32, 0x35, 0x36, 0x42, 0x79, 0x74, 0x65, 0x73, - 0x12, 0x72, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x19, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x12, 0x52, 0x0a, 0x10, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x63, - 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, - 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, - 0x6d, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, - 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x42, 0x16, 0x0a, 0x14, 0x5f, 0x69, 0x66, 0x5f, - 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, - 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, - 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1e, 0x0a, 0x1c, 0x5f, 0x69, 0x66, 0x5f, - 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, - 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1d, 0x0a, 0x1b, 0x5f, 0x69, 0x66, 0x5f, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x21, 0x0a, 0x1f, 0x5f, 0x69, 0x66, 0x5f, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x21, 0x0a, 0x1f, 0x5f, 0x69, - 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x25, 0x0a, - 0x23, 0x5f, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, - 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, - 0x61, 0x74, 0x63, 0x68, 0x22, 0xd6, 0x01, 0x0a, 0x0f, 0x52, 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x15, 0x74, 0x6f, 0x74, 0x61, - 0x6c, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x72, 0x65, 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, - 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x13, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x42, 0x79, - 0x74, 0x65, 0x73, 0x52, 0x65, 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, - 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x0a, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x12, 0x0a, - 0x04, 0x64, 0x6f, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x64, 0x6f, 0x6e, - 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x77, 0x72, 0x69, 0x74, - 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x35, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0xec, 0x07, - 0x0a, 0x11, 0x4d, 0x6f, 0x76, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x25, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x1f, 0x0a, 0x1d, 0x73, 0x74, 0x6f, - 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, - 0x65, 0x74, 0x12, 0x28, 0x0a, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0c, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x32, 0x0a, 0x12, - 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x11, 0x64, - 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x12, 0x45, 0x0a, 0x1a, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x67, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x00, 0x52, 0x17, 0x69, 0x66, 0x53, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, - 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x4c, 0x0a, 0x1e, 0x69, 0x66, 0x5f, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x42, - 0x03, 0xe0, 0x41, 0x01, 0x48, 0x01, 0x52, 0x1a, 0x69, 0x66, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, - 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x4d, 0x0a, 0x1e, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, - 0x41, 0x01, 0x48, 0x02, 0x52, 0x1b, 0x69, 0x66, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x65, - 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, - 0x68, 0x88, 0x01, 0x01, 0x12, 0x54, 0x0a, 0x22, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, - 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x03, 0x52, 0x1e, 0x69, 0x66, 0x53, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, - 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x38, 0x0a, 0x13, 0x69, 0x66, - 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, - 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x04, 0x52, 0x11, - 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, - 0x68, 0x88, 0x01, 0x01, 0x12, 0x3f, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, - 0x09, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x05, 0x52, 0x14, 0x69, 0x66, - 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, - 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x40, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, - 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, - 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x06, 0x52, 0x15, 0x69, - 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, - 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x47, 0x0a, 0x1b, 0x69, 0x66, 0x5f, 0x6d, 0x65, - 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, - 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, - 0x01, 0x48, 0x07, 0x52, 0x18, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, - 0x42, 0x1d, 0x0a, 0x1b, 0x5f, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x67, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, - 0x21, 0x0a, 0x1f, 0x5f, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x67, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, - 0x63, 0x68, 0x42, 0x21, 0x0a, 0x1f, 0x5f, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x25, 0x0a, 0x23, 0x5f, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x16, 0x0a, 0x14, - 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, - 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, - 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1e, 0x0a, 0x1c, - 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x22, 0xb9, 0x02, 0x0a, - 0x1a, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x57, - 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x53, 0x0a, 0x11, 0x77, - 0x72, 0x69, 0x74, 0x65, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x73, 0x70, 0x65, 0x63, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, - 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, - 0x0f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, - 0x12, 0x72, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x19, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x12, 0x52, 0x0a, 0x10, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x63, - 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, - 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, - 0x6d, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, - 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x22, 0x3a, 0x0a, 0x1b, 0x53, 0x74, 0x61, 0x72, - 0x74, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x75, 0x70, 0x6c, 0x6f, 0x61, - 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x70, 0x6c, 0x6f, - 0x61, 0x64, 0x49, 0x64, 0x22, 0xd6, 0x05, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x06, - 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, - 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x6f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x12, 0x33, 0x0a, 0x13, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x03, 0x48, 0x00, 0x52, 0x11, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3a, 0x0a, 0x17, 0x69, 0x66, 0x5f, - 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, - 0x61, 0x74, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x14, 0x69, 0x66, - 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, - 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3b, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, - 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x48, 0x02, 0x52, 0x15, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, - 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, - 0x01, 0x01, 0x12, 0x42, 0x0a, 0x1b, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, - 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x48, 0x03, 0x52, 0x18, 0x69, 0x66, 0x4d, 0x65, 0x74, - 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, - 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x2a, 0x0a, 0x0e, 0x70, 0x72, 0x65, 0x64, 0x65, 0x66, - 0x69, 0x6e, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, - 0xe0, 0x41, 0x01, 0x52, 0x0d, 0x70, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x41, - 0x63, 0x6c, 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, - 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, - 0x61, 0x73, 0x6b, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x4d, 0x61, 0x73, 0x6b, 0x12, 0x72, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x19, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x43, 0x0a, 0x1b, 0x6f, 0x76, 0x65, 0x72, - 0x72, 0x69, 0x64, 0x65, 0x5f, 0x75, 0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x5f, 0x72, 0x65, - 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, - 0x41, 0x01, 0x52, 0x19, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x55, 0x6e, 0x6c, 0x6f, - 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x16, 0x0a, - 0x14, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, - 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1e, 0x0a, - 0x1c, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x22, 0xce, 0x01, - 0x0a, 0x19, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x14, 0x65, - 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, - 0x74, 0x68, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x13, - 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, - 0x74, 0x68, 0x6d, 0x12, 0x35, 0x0a, 0x14, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x12, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x42, 0x0a, 0x1b, 0x65, 0x6e, - 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x73, 0x68, 0x61, - 0x32, 0x35, 0x36, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, - 0x03, 0xe0, 0x41, 0x01, 0x52, 0x18, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x4b, 0x65, 0x79, 0x53, 0x68, 0x61, 0x32, 0x35, 0x36, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0xca, - 0x05, 0x0a, 0x10, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x61, - 0x6e, 0x74, 0x73, 0x22, 0xb5, 0x05, 0x0a, 0x06, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x16, - 0x0a, 0x12, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, - 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1b, 0x0a, 0x14, 0x4d, 0x41, 0x58, 0x5f, 0x52, 0x45, - 0x41, 0x44, 0x5f, 0x43, 0x48, 0x55, 0x4e, 0x4b, 0x5f, 0x42, 0x59, 0x54, 0x45, 0x53, 0x10, 0x80, - 0x80, 0x80, 0x01, 0x12, 0x1c, 0x0a, 0x15, 0x4d, 0x41, 0x58, 0x5f, 0x57, 0x52, 0x49, 0x54, 0x45, + 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x14, 0x65, 0x6e, 0x63, + 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, + 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x13, 0x65, 0x6e, + 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, + 0x6d, 0x12, 0x35, 0x0a, 0x14, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x6b, 0x65, 0x79, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x52, 0x12, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x4b, 0x65, 0x79, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x42, 0x0a, 0x1b, 0x65, 0x6e, 0x63, 0x72, + 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x73, 0x68, 0x61, 0x32, 0x35, + 0x36, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x03, 0xe0, + 0x41, 0x01, 0x52, 0x18, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, + 0x79, 0x53, 0x68, 0x61, 0x32, 0x35, 0x36, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0xca, 0x05, 0x0a, + 0x10, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, + 0x73, 0x22, 0xb5, 0x05, 0x0a, 0x06, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x12, + 0x56, 0x41, 0x4c, 0x55, 0x45, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, + 0x45, 0x44, 0x10, 0x00, 0x12, 0x1b, 0x0a, 0x14, 0x4d, 0x41, 0x58, 0x5f, 0x52, 0x45, 0x41, 0x44, 0x5f, 0x43, 0x48, 0x55, 0x4e, 0x4b, 0x5f, 0x42, 0x59, 0x54, 0x45, 0x53, 0x10, 0x80, 0x80, 0x80, - 0x01, 0x12, 0x19, 0x0a, 0x12, 0x4d, 0x41, 0x58, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, - 0x53, 0x49, 0x5a, 0x45, 0x5f, 0x4d, 0x42, 0x10, 0x80, 0x80, 0xc0, 0x02, 0x12, 0x29, 0x0a, 0x24, - 0x4d, 0x41, 0x58, 0x5f, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x5f, 0x4d, 0x45, 0x54, 0x41, 0x44, - 0x41, 0x54, 0x41, 0x5f, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x5f, 0x42, - 0x59, 0x54, 0x45, 0x53, 0x10, 0x80, 0x08, 0x12, 0x2a, 0x0a, 0x25, 0x4d, 0x41, 0x58, 0x5f, 0x43, - 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x5f, 0x4d, 0x45, 0x54, 0x41, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x46, - 0x49, 0x45, 0x4c, 0x44, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x42, 0x59, 0x54, 0x45, 0x53, - 0x10, 0x80, 0x20, 0x12, 0x29, 0x0a, 0x24, 0x4d, 0x41, 0x58, 0x5f, 0x43, 0x55, 0x53, 0x54, 0x4f, - 0x4d, 0x5f, 0x4d, 0x45, 0x54, 0x41, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x54, 0x4f, 0x54, 0x41, 0x4c, - 0x5f, 0x53, 0x49, 0x5a, 0x45, 0x5f, 0x42, 0x59, 0x54, 0x45, 0x53, 0x10, 0x80, 0x40, 0x12, 0x2a, - 0x0a, 0x24, 0x4d, 0x41, 0x58, 0x5f, 0x42, 0x55, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x4d, 0x45, 0x54, - 0x41, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x54, 0x4f, 0x54, 0x41, 0x4c, 0x5f, 0x53, 0x49, 0x5a, 0x45, - 0x5f, 0x42, 0x59, 0x54, 0x45, 0x53, 0x10, 0x80, 0xa0, 0x01, 0x12, 0x27, 0x0a, 0x23, 0x4d, 0x41, - 0x58, 0x5f, 0x4e, 0x4f, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x43, - 0x4f, 0x4e, 0x46, 0x49, 0x47, 0x53, 0x5f, 0x50, 0x45, 0x52, 0x5f, 0x42, 0x55, 0x43, 0x4b, 0x45, - 0x54, 0x10, 0x64, 0x12, 0x22, 0x0a, 0x1e, 0x4d, 0x41, 0x58, 0x5f, 0x4c, 0x49, 0x46, 0x45, 0x43, - 0x59, 0x43, 0x4c, 0x45, 0x5f, 0x52, 0x55, 0x4c, 0x45, 0x53, 0x5f, 0x50, 0x45, 0x52, 0x5f, 0x42, - 0x55, 0x43, 0x4b, 0x45, 0x54, 0x10, 0x64, 0x12, 0x26, 0x0a, 0x22, 0x4d, 0x41, 0x58, 0x5f, 0x4e, - 0x4f, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x43, 0x55, 0x53, 0x54, - 0x4f, 0x4d, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x45, 0x53, 0x10, 0x05, 0x12, - 0x31, 0x0a, 0x2c, 0x4d, 0x41, 0x58, 0x5f, 0x4e, 0x4f, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, - 0x49, 0x4f, 0x4e, 0x5f, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x49, - 0x42, 0x55, 0x54, 0x45, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x4c, 0x45, 0x4e, 0x47, 0x54, 0x48, 0x10, - 0x80, 0x02, 0x12, 0x33, 0x0a, 0x2e, 0x4d, 0x41, 0x58, 0x5f, 0x4e, 0x4f, 0x54, 0x49, 0x46, 0x49, - 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x5f, 0x41, 0x54, - 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x45, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x4c, 0x45, - 0x4e, 0x47, 0x54, 0x48, 0x10, 0x80, 0x08, 0x12, 0x1c, 0x0a, 0x18, 0x4d, 0x41, 0x58, 0x5f, 0x4c, - 0x41, 0x42, 0x45, 0x4c, 0x53, 0x5f, 0x45, 0x4e, 0x54, 0x52, 0x49, 0x45, 0x53, 0x5f, 0x43, 0x4f, - 0x55, 0x4e, 0x54, 0x10, 0x40, 0x12, 0x1f, 0x0a, 0x1b, 0x4d, 0x41, 0x58, 0x5f, 0x4c, 0x41, 0x42, - 0x45, 0x4c, 0x53, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x4c, 0x45, - 0x4e, 0x47, 0x54, 0x48, 0x10, 0x3f, 0x12, 0x1f, 0x0a, 0x1a, 0x4d, 0x41, 0x58, 0x5f, 0x4c, 0x41, - 0x42, 0x45, 0x4c, 0x53, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x42, - 0x59, 0x54, 0x45, 0x53, 0x10, 0x80, 0x01, 0x12, 0x2e, 0x0a, 0x29, 0x4d, 0x41, 0x58, 0x5f, 0x4f, - 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x49, 0x44, 0x53, 0x5f, 0x50, 0x45, 0x52, 0x5f, 0x44, 0x45, - 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x53, 0x5f, 0x52, 0x45, 0x51, - 0x55, 0x45, 0x53, 0x54, 0x10, 0xe8, 0x07, 0x12, 0x1e, 0x0a, 0x1a, 0x53, 0x50, 0x4c, 0x49, 0x54, - 0x5f, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x5f, 0x4d, 0x41, 0x58, 0x5f, 0x56, 0x41, 0x4c, 0x49, 0x44, - 0x5f, 0x44, 0x41, 0x59, 0x53, 0x10, 0x0e, 0x1a, 0x02, 0x10, 0x01, 0x22, 0xb5, 0x37, 0x0a, 0x06, - 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x08, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x20, 0x0a, 0x09, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x08, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x49, - 0x64, 0x12, 0x12, 0x0a, 0x04, 0x65, 0x74, 0x61, 0x67, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x65, 0x74, 0x61, 0x67, 0x12, 0x4d, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x33, 0xe0, 0x41, 0x05, 0xfa, 0x41, 0x2d, 0x0a, 0x2b, - 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6d, 0x61, 0x6e, - 0x61, 0x67, 0x65, 0x72, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x07, 0x70, 0x72, 0x6f, - 0x6a, 0x65, 0x63, 0x74, 0x12, 0x2b, 0x0a, 0x0e, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, - 0x03, 0x52, 0x0e, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x1f, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x05, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x0d, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, - 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0c, - 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x28, 0x0a, 0x0d, - 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x15, 0x0a, 0x03, 0x72, 0x70, 0x6f, 0x18, 0x1b, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x03, 0x72, 0x70, 0x6f, 0x12, 0x3d, 0x0a, - 0x03, 0x61, 0x63, 0x6c, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, - 0x75, 0x63, 0x6b, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, - 0x6f, 0x6c, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x03, 0x61, 0x63, 0x6c, 0x12, 0x59, 0x0a, 0x12, - 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x61, - 0x63, 0x6c, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, - 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x10, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x41, 0x63, 0x6c, 0x12, 0x46, 0x0a, 0x09, 0x6c, 0x69, 0x66, 0x65, 0x63, - 0x79, 0x63, 0x6c, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, - 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x4c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x42, - 0x03, 0xe0, 0x41, 0x01, 0x52, 0x09, 0x6c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x12, - 0x40, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0b, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, - 0x65, 0x12, 0x37, 0x0a, 0x04, 0x63, 0x6f, 0x72, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, - 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x43, 0x6f, 0x72, 0x73, 0x42, - 0x03, 0xe0, 0x41, 0x01, 0x52, 0x04, 0x63, 0x6f, 0x72, 0x73, 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, - 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3c, 0x0a, 0x18, - 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x61, - 0x73, 0x65, 0x64, 0x5f, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, - 0xe0, 0x41, 0x01, 0x52, 0x15, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x42, 0x61, 0x73, 0x65, 0x64, 0x48, 0x6f, 0x6c, 0x64, 0x12, 0x42, 0x0a, 0x06, 0x6c, 0x61, - 0x62, 0x65, 0x6c, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, + 0x01, 0x12, 0x1c, 0x0a, 0x15, 0x4d, 0x41, 0x58, 0x5f, 0x57, 0x52, 0x49, 0x54, 0x45, 0x5f, 0x43, + 0x48, 0x55, 0x4e, 0x4b, 0x5f, 0x42, 0x59, 0x54, 0x45, 0x53, 0x10, 0x80, 0x80, 0x80, 0x01, 0x12, + 0x19, 0x0a, 0x12, 0x4d, 0x41, 0x58, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x53, 0x49, + 0x5a, 0x45, 0x5f, 0x4d, 0x42, 0x10, 0x80, 0x80, 0xc0, 0x02, 0x12, 0x29, 0x0a, 0x24, 0x4d, 0x41, + 0x58, 0x5f, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x5f, 0x4d, 0x45, 0x54, 0x41, 0x44, 0x41, 0x54, + 0x41, 0x5f, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x5f, 0x42, 0x59, 0x54, + 0x45, 0x53, 0x10, 0x80, 0x08, 0x12, 0x2a, 0x0a, 0x25, 0x4d, 0x41, 0x58, 0x5f, 0x43, 0x55, 0x53, + 0x54, 0x4f, 0x4d, 0x5f, 0x4d, 0x45, 0x54, 0x41, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x46, 0x49, 0x45, + 0x4c, 0x44, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x42, 0x59, 0x54, 0x45, 0x53, 0x10, 0x80, + 0x20, 0x12, 0x29, 0x0a, 0x24, 0x4d, 0x41, 0x58, 0x5f, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x5f, + 0x4d, 0x45, 0x54, 0x41, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x54, 0x4f, 0x54, 0x41, 0x4c, 0x5f, 0x53, + 0x49, 0x5a, 0x45, 0x5f, 0x42, 0x59, 0x54, 0x45, 0x53, 0x10, 0x80, 0x40, 0x12, 0x2a, 0x0a, 0x24, + 0x4d, 0x41, 0x58, 0x5f, 0x42, 0x55, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x4d, 0x45, 0x54, 0x41, 0x44, + 0x41, 0x54, 0x41, 0x5f, 0x54, 0x4f, 0x54, 0x41, 0x4c, 0x5f, 0x53, 0x49, 0x5a, 0x45, 0x5f, 0x42, + 0x59, 0x54, 0x45, 0x53, 0x10, 0x80, 0xa0, 0x01, 0x12, 0x27, 0x0a, 0x23, 0x4d, 0x41, 0x58, 0x5f, + 0x4e, 0x4f, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x43, 0x4f, 0x4e, + 0x46, 0x49, 0x47, 0x53, 0x5f, 0x50, 0x45, 0x52, 0x5f, 0x42, 0x55, 0x43, 0x4b, 0x45, 0x54, 0x10, + 0x64, 0x12, 0x22, 0x0a, 0x1e, 0x4d, 0x41, 0x58, 0x5f, 0x4c, 0x49, 0x46, 0x45, 0x43, 0x59, 0x43, + 0x4c, 0x45, 0x5f, 0x52, 0x55, 0x4c, 0x45, 0x53, 0x5f, 0x50, 0x45, 0x52, 0x5f, 0x42, 0x55, 0x43, + 0x4b, 0x45, 0x54, 0x10, 0x64, 0x12, 0x26, 0x0a, 0x22, 0x4d, 0x41, 0x58, 0x5f, 0x4e, 0x4f, 0x54, + 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, + 0x5f, 0x41, 0x54, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x45, 0x53, 0x10, 0x05, 0x12, 0x31, 0x0a, + 0x2c, 0x4d, 0x41, 0x58, 0x5f, 0x4e, 0x4f, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, + 0x4e, 0x5f, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x49, 0x42, 0x55, + 0x54, 0x45, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x4c, 0x45, 0x4e, 0x47, 0x54, 0x48, 0x10, 0x80, 0x02, + 0x12, 0x33, 0x0a, 0x2e, 0x4d, 0x41, 0x58, 0x5f, 0x4e, 0x4f, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, + 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x5f, 0x41, 0x54, 0x54, 0x52, + 0x49, 0x42, 0x55, 0x54, 0x45, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x4c, 0x45, 0x4e, 0x47, + 0x54, 0x48, 0x10, 0x80, 0x08, 0x12, 0x1c, 0x0a, 0x18, 0x4d, 0x41, 0x58, 0x5f, 0x4c, 0x41, 0x42, + 0x45, 0x4c, 0x53, 0x5f, 0x45, 0x4e, 0x54, 0x52, 0x49, 0x45, 0x53, 0x5f, 0x43, 0x4f, 0x55, 0x4e, + 0x54, 0x10, 0x40, 0x12, 0x1f, 0x0a, 0x1b, 0x4d, 0x41, 0x58, 0x5f, 0x4c, 0x41, 0x42, 0x45, 0x4c, + 0x53, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x4c, 0x45, 0x4e, 0x47, + 0x54, 0x48, 0x10, 0x3f, 0x12, 0x1f, 0x0a, 0x1a, 0x4d, 0x41, 0x58, 0x5f, 0x4c, 0x41, 0x42, 0x45, + 0x4c, 0x53, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x42, 0x59, 0x54, + 0x45, 0x53, 0x10, 0x80, 0x01, 0x12, 0x2e, 0x0a, 0x29, 0x4d, 0x41, 0x58, 0x5f, 0x4f, 0x42, 0x4a, + 0x45, 0x43, 0x54, 0x5f, 0x49, 0x44, 0x53, 0x5f, 0x50, 0x45, 0x52, 0x5f, 0x44, 0x45, 0x4c, 0x45, + 0x54, 0x45, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x53, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x45, + 0x53, 0x54, 0x10, 0xe8, 0x07, 0x12, 0x1e, 0x0a, 0x1a, 0x53, 0x50, 0x4c, 0x49, 0x54, 0x5f, 0x54, + 0x4f, 0x4b, 0x45, 0x4e, 0x5f, 0x4d, 0x41, 0x58, 0x5f, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x44, + 0x41, 0x59, 0x53, 0x10, 0x0e, 0x1a, 0x02, 0x10, 0x01, 0x22, 0xb5, 0x37, 0x0a, 0x06, 0x42, 0x75, + 0x63, 0x6b, 0x65, 0x74, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x08, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, + 0x09, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x08, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x64, 0x12, + 0x12, 0x0a, 0x04, 0x65, 0x74, 0x61, 0x67, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x65, + 0x74, 0x61, 0x67, 0x12, 0x4d, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x33, 0xe0, 0x41, 0x05, 0xfa, 0x41, 0x2d, 0x0a, 0x2b, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, + 0x65, 0x72, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x12, 0x2b, 0x0a, 0x0e, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, + 0x0e, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x1f, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x03, 0xe0, 0x41, 0x05, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x28, 0x0a, 0x0d, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0c, 0x6c, 0x6f, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x28, 0x0a, 0x0d, 0x73, 0x74, + 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, + 0x6c, 0x61, 0x73, 0x73, 0x12, 0x15, 0x0a, 0x03, 0x72, 0x70, 0x6f, 0x18, 0x1b, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x03, 0x72, 0x70, 0x6f, 0x12, 0x3d, 0x0a, 0x03, 0x61, + 0x63, 0x6c, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, + 0x6b, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x03, 0x61, 0x63, 0x6c, 0x12, 0x59, 0x0a, 0x12, 0x64, 0x65, + 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x61, 0x63, 0x6c, + 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x42, 0x03, + 0xe0, 0x41, 0x01, 0x52, 0x10, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x4f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x41, 0x63, 0x6c, 0x12, 0x46, 0x0a, 0x09, 0x6c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, + 0x6c, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, + 0x6b, 0x65, 0x74, 0x2e, 0x4c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x42, 0x03, 0xe0, + 0x41, 0x01, 0x52, 0x09, 0x6c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x12, 0x40, 0x0a, + 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, + 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, + 0x37, 0x0a, 0x04, 0x63, 0x6f, 0x72, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, + 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x43, 0x6f, 0x72, 0x73, 0x42, 0x03, 0xe0, + 0x41, 0x01, 0x52, 0x04, 0x63, 0x6f, 0x72, 0x73, 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3c, 0x0a, 0x18, 0x64, 0x65, + 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x61, 0x73, 0x65, + 0x64, 0x5f, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, + 0x01, 0x52, 0x15, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, + 0x61, 0x73, 0x65, 0x64, 0x48, 0x6f, 0x6c, 0x64, 0x12, 0x42, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, + 0x6c, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, + 0x6b, 0x65, 0x74, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x40, 0x0a, 0x07, + 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, + 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x57, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, + 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x12, 0x49, + 0x0a, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x18, 0x11, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x56, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0a, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x12, 0x40, 0x0a, 0x07, 0x6c, 0x6f, 0x67, + 0x67, 0x69, 0x6e, 0x67, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, - 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x40, - 0x0a, 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, - 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x57, 0x65, 0x62, 0x73, 0x69, - 0x74, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, - 0x12, 0x49, 0x0a, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x18, 0x11, + 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x4c, 0x6f, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x42, 0x03, 0xe0, + 0x41, 0x01, 0x52, 0x07, 0x6c, 0x6f, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x12, 0x33, 0x0a, 0x05, 0x6f, + 0x77, 0x6e, 0x65, 0x72, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, + 0x77, 0x6e, 0x65, 0x72, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, + 0x12, 0x49, 0x0a, 0x0a, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, - 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, - 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x12, 0x40, 0x0a, 0x07, 0x6c, - 0x6f, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, + 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, + 0x0a, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x07, 0x62, + 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, - 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x4c, 0x6f, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x42, - 0x03, 0xe0, 0x41, 0x01, 0x52, 0x07, 0x6c, 0x6f, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x12, 0x33, 0x0a, - 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, + 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x42, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x52, 0x07, 0x62, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x12, 0x59, 0x0a, + 0x10, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, + 0x79, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, + 0x65, 0x74, 0x2e, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0f, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, + 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x47, 0x0a, 0x0a, 0x69, 0x61, 0x6d, 0x5f, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, - 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x05, 0x6f, 0x77, 0x6e, - 0x65, 0x72, 0x12, 0x49, 0x0a, 0x0a, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, - 0x74, 0x2e, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x03, 0xe0, 0x41, - 0x01, 0x52, 0x0a, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, - 0x07, 0x62, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, - 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x42, 0x69, 0x6c, 0x6c, 0x69, 0x6e, - 0x67, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x07, 0x62, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x12, - 0x59, 0x0a, 0x10, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x6f, 0x6c, - 0x69, 0x63, 0x79, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, - 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, - 0x6c, 0x69, 0x63, 0x79, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0f, 0x72, 0x65, 0x74, 0x65, 0x6e, - 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x47, 0x0a, 0x0a, 0x69, 0x61, - 0x6d, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, - 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x49, 0x61, 0x6d, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x09, 0x69, 0x61, 0x6d, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x12, 0x28, 0x0a, 0x0d, 0x73, 0x61, 0x74, 0x69, 0x73, 0x66, 0x69, 0x65, 0x73, - 0x5f, 0x70, 0x7a, 0x73, 0x18, 0x19, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, - 0x0c, 0x73, 0x61, 0x74, 0x69, 0x73, 0x66, 0x69, 0x65, 0x73, 0x50, 0x7a, 0x73, 0x12, 0x6c, 0x0a, - 0x17, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, - 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, - 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, - 0x50, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, - 0x03, 0xe0, 0x41, 0x01, 0x52, 0x15, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x50, 0x6c, 0x61, 0x63, - 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x46, 0x0a, 0x09, 0x61, - 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, - 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x41, 0x75, 0x74, 0x6f, 0x63, 0x6c, - 0x61, 0x73, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x09, 0x61, 0x75, 0x74, 0x6f, 0x63, 0x6c, - 0x61, 0x73, 0x73, 0x12, 0x6b, 0x0a, 0x16, 0x68, 0x69, 0x65, 0x72, 0x61, 0x72, 0x63, 0x68, 0x69, - 0x63, 0x61, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x20, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, - 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x48, - 0x69, 0x65, 0x72, 0x61, 0x72, 0x63, 0x68, 0x69, 0x63, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x15, 0x68, 0x69, 0x65, 0x72, 0x61, - 0x72, 0x63, 0x68, 0x69, 0x63, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x12, 0x5d, 0x0a, 0x12, 0x73, 0x6f, 0x66, 0x74, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, - 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x67, + 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x49, 0x61, 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x09, 0x69, 0x61, 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x12, 0x28, 0x0a, 0x0d, 0x73, 0x61, 0x74, 0x69, 0x73, 0x66, 0x69, 0x65, 0x73, 0x5f, 0x70, + 0x7a, 0x73, 0x18, 0x19, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0c, 0x73, + 0x61, 0x74, 0x69, 0x73, 0x66, 0x69, 0x65, 0x73, 0x50, 0x7a, 0x73, 0x12, 0x6c, 0x0a, 0x17, 0x63, + 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, - 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x53, 0x6f, 0x66, 0x74, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x10, 0x73, - 0x6f, 0x66, 0x74, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, - 0x59, 0x0a, 0x10, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x21, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, - 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x74, 0x65, 0x6e, - 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0f, 0x6f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x49, 0x0a, 0x09, 0x69, 0x70, - 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x26, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, - 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x49, 0x70, 0x46, 0x69, 0x6c, 0x74, 0x65, - 0x72, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x00, 0x52, 0x08, 0x69, 0x70, 0x46, 0x69, 0x6c, 0x74, - 0x65, 0x72, 0x88, 0x01, 0x01, 0x1a, 0x35, 0x0a, 0x07, 0x42, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, - 0x12, 0x2a, 0x0a, 0x0e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x70, 0x61, - 0x79, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0d, 0x72, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x50, 0x61, 0x79, 0x73, 0x1a, 0x9b, 0x01, 0x0a, - 0x04, 0x43, 0x6f, 0x72, 0x73, 0x12, 0x1b, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, - 0x69, 0x6e, 0x12, 0x1b, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, - 0x2c, 0x0a, 0x0f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x68, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0e, 0x72, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x2b, 0x0a, - 0x0f, 0x6d, 0x61, 0x78, 0x5f, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0d, 0x6d, 0x61, 0x78, - 0x41, 0x67, 0x65, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x1a, 0xa0, 0x0b, 0x0a, 0x0a, 0x45, - 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x51, 0x0a, 0x0f, 0x64, 0x65, 0x66, - 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x6b, 0x6d, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x29, 0xe0, 0x41, 0x01, 0xfa, 0x41, 0x23, 0x0a, 0x21, 0x63, 0x6c, 0x6f, 0x75, - 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x52, 0x0d, 0x64, - 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x4b, 0x6d, 0x73, 0x4b, 0x65, 0x79, 0x12, 0xb7, 0x01, 0x0a, - 0x2c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x5f, - 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x66, 0x6f, 0x72, - 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x4d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, - 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x45, - 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x45, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x00, 0x52, 0x28, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x45, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x88, 0x01, 0x01, 0x12, 0xbd, 0x01, 0x0a, 0x2e, 0x63, 0x75, 0x73, 0x74, 0x6f, - 0x6d, 0x65, 0x72, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x5f, 0x65, 0x6e, 0x63, 0x72, - 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x6d, 0x65, - 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x4f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, - 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x45, 0x6e, 0x63, 0x72, 0x79, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x4d, 0x61, + 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x50, 0x6c, + 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x03, 0xe0, + 0x41, 0x01, 0x52, 0x15, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x6d, + 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x46, 0x0a, 0x09, 0x61, 0x75, 0x74, + 0x6f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, + 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x41, 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x61, 0x73, + 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x09, 0x61, 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x61, 0x73, + 0x73, 0x12, 0x6b, 0x0a, 0x16, 0x68, 0x69, 0x65, 0x72, 0x61, 0x72, 0x63, 0x68, 0x69, 0x63, 0x61, + 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x20, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x48, 0x69, 0x65, + 0x72, 0x61, 0x72, 0x63, 0x68, 0x69, 0x63, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x15, 0x68, 0x69, 0x65, 0x72, 0x61, 0x72, 0x63, + 0x68, 0x69, 0x63, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x5d, + 0x0a, 0x12, 0x73, 0x6f, 0x66, 0x74, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x70, 0x6f, + 0x6c, 0x69, 0x63, 0x79, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, + 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x53, 0x6f, 0x66, 0x74, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x10, 0x73, 0x6f, 0x66, + 0x74, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x59, 0x0a, + 0x10, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x21, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, + 0x65, 0x74, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, + 0x6f, 0x6e, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, + 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x49, 0x0a, 0x09, 0x69, 0x70, 0x5f, 0x66, + 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x26, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, + 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x49, 0x70, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x48, 0x00, 0x52, 0x08, 0x69, 0x70, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, + 0x88, 0x01, 0x01, 0x1a, 0x35, 0x0a, 0x07, 0x42, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x12, 0x2a, + 0x0a, 0x0e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x79, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0d, 0x72, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x50, 0x61, 0x79, 0x73, 0x1a, 0x9b, 0x01, 0x0a, 0x04, 0x43, + 0x6f, 0x72, 0x73, 0x12, 0x1b, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, + 0x12, 0x1b, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, + 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x2c, 0x0a, + 0x0f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0e, 0x72, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x0f, 0x6d, + 0x61, 0x78, 0x5f, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0d, 0x6d, 0x61, 0x78, 0x41, 0x67, + 0x65, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x1a, 0xa0, 0x0b, 0x0a, 0x0a, 0x45, 0x6e, 0x63, + 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x51, 0x0a, 0x0f, 0x64, 0x65, 0x66, 0x61, 0x75, + 0x6c, 0x74, 0x5f, 0x6b, 0x6d, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x29, 0xe0, 0x41, 0x01, 0xfa, 0x41, 0x23, 0x0a, 0x21, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, + 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x52, 0x0d, 0x64, 0x65, 0x66, + 0x61, 0x75, 0x6c, 0x74, 0x4b, 0x6d, 0x73, 0x4b, 0x65, 0x79, 0x12, 0xb7, 0x01, 0x0a, 0x2c, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x5f, 0x65, 0x6e, + 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, + 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x4d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x45, 0x6e, 0x63, + 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x01, 0x52, 0x2a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, + 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x00, 0x52, 0x28, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x4d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x45, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x88, 0x01, 0x01, 0x12, 0xbd, 0x01, 0x0a, 0x2e, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, + 0x72, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x5f, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, + 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x4f, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, + 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x4d, 0x61, 0x6e, 0x61, + 0x67, 0x65, 0x64, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x66, + 0x6f, 0x72, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x03, + 0xe0, 0x41, 0x01, 0x48, 0x01, 0x52, 0x2a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x4d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x45, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x88, 0x01, 0x01, 0x12, 0xc0, 0x01, 0x0a, 0x2f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, + 0x72, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x64, 0x5f, 0x65, 0x6e, 0x63, 0x72, 0x79, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x50, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, + 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x53, 0x75, 0x70, + 0x70, 0x6c, 0x69, 0x65, 0x64, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x45, + 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x02, 0x52, 0x2b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, + 0x72, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x64, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x88, 0x01, 0x01, 0x1a, 0xca, 0x01, 0x0a, 0x28, 0x47, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2e, 0x0a, 0x10, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, + 0x52, 0x0f, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x6f, 0x64, + 0x65, 0x88, 0x01, 0x01, 0x12, 0x46, 0x0a, 0x0e, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, + 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x01, 0x52, 0x0d, 0x65, 0x66, 0x66, 0x65, + 0x63, 0x74, 0x69, 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, 0x13, 0x0a, 0x11, + 0x5f, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x6f, 0x64, + 0x65, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x1a, 0xcc, 0x01, 0x0a, 0x2a, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x88, 0x01, 0x01, 0x12, 0xc0, 0x01, 0x0a, 0x2f, 0x63, 0x75, 0x73, 0x74, 0x6f, - 0x6d, 0x65, 0x72, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x64, 0x5f, 0x65, 0x6e, 0x63, - 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x6d, - 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x50, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x45, 0x6e, 0x63, 0x72, - 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x53, - 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x64, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x45, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x02, 0x52, 0x2b, 0x63, 0x75, 0x73, 0x74, 0x6f, - 0x6d, 0x65, 0x72, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x64, 0x45, 0x6e, 0x63, 0x72, 0x79, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x88, 0x01, 0x01, 0x1a, 0xca, 0x01, 0x0a, 0x28, 0x47, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x45, 0x6e, 0x63, 0x72, 0x79, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2e, 0x0a, 0x10, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x48, 0x00, 0x52, 0x0f, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, - 0x6f, 0x64, 0x65, 0x88, 0x01, 0x01, 0x12, 0x46, 0x0a, 0x0e, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, - 0x69, 0x76, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x01, 0x52, 0x0d, 0x65, 0x66, - 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, 0x13, - 0x0a, 0x11, 0x5f, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, - 0x6f, 0x64, 0x65, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, - 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x1a, 0xcc, 0x01, 0x0a, 0x2a, 0x43, 0x75, 0x73, 0x74, 0x6f, - 0x6d, 0x65, 0x72, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2e, 0x0a, 0x10, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, - 0x00, 0x52, 0x0f, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x6f, - 0x64, 0x65, 0x88, 0x01, 0x01, 0x12, 0x46, 0x0a, 0x0e, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, - 0x76, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x01, 0x52, 0x0d, 0x65, 0x66, 0x66, - 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, 0x13, 0x0a, - 0x11, 0x5f, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x6f, - 0x64, 0x65, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, - 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x1a, 0xcd, 0x01, 0x0a, 0x2b, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, - 0x65, 0x72, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x64, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2e, 0x0a, 0x10, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, - 0x00, 0x52, 0x0f, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x6f, - 0x64, 0x65, 0x88, 0x01, 0x01, 0x12, 0x46, 0x0a, 0x0e, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, - 0x76, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x01, 0x52, 0x0d, 0x65, 0x66, 0x66, - 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, 0x13, 0x0a, - 0x11, 0x5f, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x6f, - 0x64, 0x65, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, - 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x2f, 0x0a, 0x2d, 0x5f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x5f, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x31, 0x0a, 0x2f, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, - 0x6d, 0x65, 0x72, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x5f, 0x65, 0x6e, 0x63, 0x72, - 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x6d, 0x65, - 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x32, 0x0a, 0x30, 0x5f, 0x63, 0x75, - 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x64, 0x5f, - 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x66, 0x6f, 0x72, - 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0xc6, 0x02, - 0x0a, 0x09, 0x49, 0x61, 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x80, 0x01, 0x0a, 0x1b, - 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x6c, - 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x3c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x49, 0x61, 0x6d, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x75, - 0x63, 0x6b, 0x65, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x42, - 0x03, 0xe0, 0x41, 0x01, 0x52, 0x18, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x75, 0x63, - 0x6b, 0x65, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x3d, - 0x0a, 0x18, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, - 0x70, 0x72, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x16, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x41, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x50, 0x72, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x77, 0x0a, - 0x18, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x4c, 0x65, - 0x76, 0x65, 0x6c, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x1d, 0x0a, 0x07, 0x65, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, - 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x3c, 0x0a, 0x09, 0x6c, 0x6f, 0x63, 0x6b, + 0x66, 0x69, 0x67, 0x12, 0x2e, 0x0a, 0x10, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, + 0x0f, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x6f, 0x64, 0x65, + 0x88, 0x01, 0x01, 0x12, 0x46, 0x0a, 0x0e, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x08, 0x6c, 0x6f, - 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x1a, 0x92, 0x08, 0x0a, 0x09, 0x4c, 0x69, 0x66, 0x65, 0x63, - 0x79, 0x63, 0x6c, 0x65, 0x12, 0x41, 0x0a, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, - 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x4c, 0x69, - 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x42, 0x03, 0xe0, 0x41, - 0x01, 0x52, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x1a, 0xc1, 0x07, 0x0a, 0x04, 0x52, 0x75, 0x6c, 0x65, - 0x12, 0x4c, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x4c, 0x69, 0x66, 0x65, - 0x63, 0x79, 0x63, 0x6c, 0x65, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x55, - 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x4c, 0x69, 0x66, - 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x2e, 0x43, 0x6f, 0x6e, 0x64, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x64, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x4b, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x17, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, - 0x41, 0x01, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x28, 0x0a, 0x0d, 0x73, 0x74, 0x6f, 0x72, - 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, - 0x73, 0x73, 0x1a, 0xc6, 0x05, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x1e, 0x0a, 0x08, 0x61, 0x67, 0x65, 0x5f, 0x64, 0x61, 0x79, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x05, 0x48, 0x00, 0x52, 0x07, 0x61, 0x67, 0x65, 0x44, 0x61, 0x79, 0x73, 0x88, 0x01, 0x01, - 0x12, 0x3d, 0x0a, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x65, 0x66, 0x6f, - 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x01, - 0x52, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x12, - 0x1c, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x6c, 0x69, 0x76, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, - 0x48, 0x01, 0x52, 0x06, 0x69, 0x73, 0x4c, 0x69, 0x76, 0x65, 0x88, 0x01, 0x01, 0x12, 0x31, 0x0a, - 0x12, 0x6e, 0x75, 0x6d, 0x5f, 0x6e, 0x65, 0x77, 0x65, 0x72, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x48, 0x02, 0x52, 0x10, 0x6e, 0x75, 0x6d, - 0x4e, 0x65, 0x77, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x88, 0x01, 0x01, - 0x12, 0x37, 0x0a, 0x15, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x5f, 0x73, 0x74, 0x6f, 0x72, - 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x42, - 0x03, 0xe0, 0x41, 0x01, 0x52, 0x13, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x53, 0x74, 0x6f, - 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x38, 0x0a, 0x16, 0x64, 0x61, 0x79, - 0x73, 0x5f, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x74, - 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x48, 0x03, 0x52, 0x13, 0x64, 0x61, 0x79, - 0x73, 0x53, 0x69, 0x6e, 0x63, 0x65, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x54, 0x69, 0x6d, 0x65, - 0x88, 0x01, 0x01, 0x12, 0x44, 0x0a, 0x12, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x74, 0x69, - 0x6d, 0x65, 0x5f, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x11, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x44, 0x61, - 0x74, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x10, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x54, - 0x69, 0x6d, 0x65, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x12, 0x40, 0x0a, 0x1a, 0x64, 0x61, 0x79, - 0x73, 0x5f, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x5f, 0x6e, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, - 0x6e, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x48, 0x04, 0x52, - 0x17, 0x64, 0x61, 0x79, 0x73, 0x53, 0x69, 0x6e, 0x63, 0x65, 0x4e, 0x6f, 0x6e, 0x63, 0x75, 0x72, - 0x72, 0x65, 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x4c, 0x0a, 0x16, 0x6e, - 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x62, - 0x65, 0x66, 0x6f, 0x72, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x65, 0x42, 0x03, - 0xe0, 0x41, 0x01, 0x52, 0x14, 0x6e, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x54, - 0x69, 0x6d, 0x65, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x12, 0x2a, 0x0a, 0x0e, 0x6d, 0x61, 0x74, - 0x63, 0x68, 0x65, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x0b, 0x20, 0x03, 0x28, - 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0d, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x50, - 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x2a, 0x0a, 0x0e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, - 0x5f, 0x73, 0x75, 0x66, 0x66, 0x69, 0x78, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x09, 0x42, 0x03, 0xe0, - 0x41, 0x01, 0x52, 0x0d, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x53, 0x75, 0x66, 0x66, 0x69, - 0x78, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x61, 0x67, 0x65, 0x5f, 0x64, 0x61, 0x79, 0x73, 0x42, 0x0a, - 0x0a, 0x08, 0x5f, 0x69, 0x73, 0x5f, 0x6c, 0x69, 0x76, 0x65, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x6e, - 0x75, 0x6d, 0x5f, 0x6e, 0x65, 0x77, 0x65, 0x72, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x73, 0x42, 0x19, 0x0a, 0x17, 0x5f, 0x64, 0x61, 0x79, 0x73, 0x5f, 0x73, 0x69, 0x6e, 0x63, 0x65, - 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x1d, 0x0a, 0x1b, - 0x5f, 0x64, 0x61, 0x79, 0x73, 0x5f, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x5f, 0x6e, 0x6f, 0x6e, 0x63, - 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x1a, 0x5e, 0x0a, 0x07, 0x4c, - 0x6f, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x12, 0x22, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x5f, 0x62, 0x75, - 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, - 0x09, 0x6c, 0x6f, 0x67, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x2f, 0x0a, 0x11, 0x6c, 0x6f, - 0x67, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0f, 0x6c, 0x6f, 0x67, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x1a, 0x33, 0x0a, 0x0f, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, - 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x42, - 0x06, 0xe0, 0x41, 0x01, 0xe0, 0x41, 0x03, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, - 0x1a, 0xca, 0x01, 0x0a, 0x0f, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, - 0x6c, 0x69, 0x63, 0x79, 0x12, 0x46, 0x0a, 0x0e, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, - 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0d, 0x65, - 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x09, - 0x69, 0x73, 0x5f, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x42, - 0x03, 0xe0, 0x41, 0x01, 0x52, 0x08, 0x69, 0x73, 0x4c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x12, 0x4d, - 0x0a, 0x12, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x11, 0x72, 0x65, 0x74, 0x65, - 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0xd3, 0x01, - 0x0a, 0x10, 0x53, 0x6f, 0x66, 0x74, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, - 0x63, 0x79, 0x12, 0x4d, 0x0a, 0x12, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x11, 0x72, 0x65, 0x74, - 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, - 0x01, 0x12, 0x46, 0x0a, 0x0e, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x74, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x01, 0x52, 0x0d, 0x65, 0x66, 0x66, 0x65, 0x63, + 0x74, 0x69, 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, 0x13, 0x0a, 0x11, 0x5f, + 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x6f, 0x64, 0x65, + 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x1a, 0xcd, 0x01, 0x0a, 0x2b, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, + 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x64, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x45, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x12, 0x2e, 0x0a, 0x10, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, + 0x0f, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x6f, 0x64, 0x65, + 0x88, 0x01, 0x01, 0x12, 0x46, 0x0a, 0x0e, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x01, 0x52, 0x0d, 0x65, 0x66, 0x66, 0x65, 0x63, + 0x74, 0x69, 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, 0x13, 0x0a, 0x11, 0x5f, + 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x6f, 0x64, 0x65, + 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x42, 0x2f, 0x0a, 0x2d, 0x5f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5f, 0x6d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x5f, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x42, 0x31, 0x0a, 0x2f, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, + 0x72, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x5f, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, + 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x32, 0x0a, 0x30, 0x5f, 0x63, 0x75, 0x73, 0x74, + 0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x64, 0x5f, 0x65, 0x6e, + 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, + 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0xc6, 0x02, 0x0a, 0x09, + 0x49, 0x61, 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x80, 0x01, 0x0a, 0x1b, 0x75, 0x6e, + 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x6c, 0x65, 0x76, + 0x65, 0x6c, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x3c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x49, 0x61, 0x6d, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x75, 0x63, 0x6b, + 0x65, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x42, 0x03, 0xe0, + 0x41, 0x01, 0x52, 0x18, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x75, 0x63, 0x6b, 0x65, + 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x3d, 0x0a, 0x18, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x70, 0x72, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, + 0xe0, 0x41, 0x01, 0x52, 0x16, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x41, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x50, 0x72, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x77, 0x0a, 0x18, 0x55, + 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x4c, 0x65, 0x76, 0x65, + 0x6c, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x1d, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, + 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x07, 0x65, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x3c, 0x0a, 0x09, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x01, 0x52, 0x0d, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, - 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x72, 0x65, - 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x74, - 0x69, 0x6d, 0x65, 0x1a, 0x2b, 0x0a, 0x0a, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, - 0x67, 0x12, 0x1d, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, - 0x1a, 0x63, 0x0a, 0x07, 0x57, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x12, 0x2d, 0x0a, 0x10, 0x6d, - 0x61, 0x69, 0x6e, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x75, 0x66, 0x66, 0x69, 0x78, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0e, 0x6d, 0x61, 0x69, 0x6e, - 0x50, 0x61, 0x67, 0x65, 0x53, 0x75, 0x66, 0x66, 0x69, 0x78, 0x12, 0x29, 0x0a, 0x0e, 0x6e, 0x6f, - 0x74, 0x5f, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0c, 0x6e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, - 0x64, 0x50, 0x61, 0x67, 0x65, 0x1a, 0x43, 0x0a, 0x15, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x50, - 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2a, - 0x0a, 0x0e, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0d, 0x64, 0x61, 0x74, - 0x61, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0xdb, 0x02, 0x0a, 0x09, 0x41, - 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x1d, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, - 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x07, - 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x40, 0x0a, 0x0b, 0x74, 0x6f, 0x67, 0x67, 0x6c, - 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x74, - 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x16, 0x74, 0x65, 0x72, - 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6c, - 0x61, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x14, 0x74, 0x65, 0x72, - 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, - 0x73, 0x88, 0x01, 0x01, 0x12, 0x70, 0x0a, 0x22, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, - 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x75, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, - 0x03, 0x48, 0x01, 0x52, 0x1e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x53, 0x74, 0x6f, - 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, - 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, 0x19, 0x0a, 0x17, 0x5f, 0x74, 0x65, 0x72, 0x6d, 0x69, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x6b, + 0x54, 0x69, 0x6d, 0x65, 0x1a, 0x92, 0x08, 0x0a, 0x09, 0x4c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, + 0x6c, 0x65, 0x12, 0x41, 0x0a, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x28, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x4c, 0x69, 0x66, 0x65, + 0x63, 0x79, 0x63, 0x6c, 0x65, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, + 0x04, 0x72, 0x75, 0x6c, 0x65, 0x1a, 0xc1, 0x07, 0x0a, 0x04, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x4c, + 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, + 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x4c, 0x69, 0x66, 0x65, 0x63, 0x79, + 0x63, 0x6c, 0x65, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x55, 0x0a, 0x09, + 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x32, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x4c, 0x69, 0x66, 0x65, 0x63, + 0x79, 0x63, 0x6c, 0x65, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x1a, 0x4b, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, + 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x28, 0x0a, 0x0d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, + 0x41, 0x01, 0x52, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, + 0x1a, 0xc6, 0x05, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e, + 0x0a, 0x08, 0x61, 0x67, 0x65, 0x5f, 0x64, 0x61, 0x79, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x48, 0x00, 0x52, 0x07, 0x61, 0x67, 0x65, 0x44, 0x61, 0x79, 0x73, 0x88, 0x01, 0x01, 0x12, 0x3d, + 0x0a, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x74, 0x79, 0x70, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0d, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x12, 0x1c, 0x0a, + 0x07, 0x69, 0x73, 0x5f, 0x6c, 0x69, 0x76, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x48, 0x01, + 0x52, 0x06, 0x69, 0x73, 0x4c, 0x69, 0x76, 0x65, 0x88, 0x01, 0x01, 0x12, 0x31, 0x0a, 0x12, 0x6e, + 0x75, 0x6d, 0x5f, 0x6e, 0x65, 0x77, 0x65, 0x72, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x48, 0x02, 0x52, 0x10, 0x6e, 0x75, 0x6d, 0x4e, 0x65, + 0x77, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x88, 0x01, 0x01, 0x12, 0x37, + 0x0a, 0x15, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x42, 0x03, 0xe0, + 0x41, 0x01, 0x52, 0x13, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x53, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x38, 0x0a, 0x16, 0x64, 0x61, 0x79, 0x73, 0x5f, + 0x73, 0x69, 0x6e, 0x63, 0x65, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x74, 0x69, 0x6d, + 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x48, 0x03, 0x52, 0x13, 0x64, 0x61, 0x79, 0x73, 0x53, + 0x69, 0x6e, 0x63, 0x65, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, + 0x01, 0x12, 0x44, 0x0a, 0x12, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x74, 0x69, 0x6d, 0x65, + 0x5f, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x65, + 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x10, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x54, 0x69, 0x6d, + 0x65, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x12, 0x40, 0x0a, 0x1a, 0x64, 0x61, 0x79, 0x73, 0x5f, + 0x73, 0x69, 0x6e, 0x63, 0x65, 0x5f, 0x6e, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x48, 0x04, 0x52, 0x17, 0x64, + 0x61, 0x79, 0x73, 0x53, 0x69, 0x6e, 0x63, 0x65, 0x4e, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, + 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x4c, 0x0a, 0x16, 0x6e, 0x6f, 0x6e, + 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x62, 0x65, 0x66, + 0x6f, 0x72, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x65, 0x42, 0x03, 0xe0, 0x41, + 0x01, 0x52, 0x14, 0x6e, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x54, 0x69, 0x6d, + 0x65, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x12, 0x2a, 0x0a, 0x0e, 0x6d, 0x61, 0x74, 0x63, 0x68, + 0x65, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x09, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0d, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x50, 0x72, 0x65, + 0x66, 0x69, 0x78, 0x12, 0x2a, 0x0a, 0x0e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x5f, 0x73, + 0x75, 0x66, 0x66, 0x69, 0x78, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, + 0x52, 0x0d, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x53, 0x75, 0x66, 0x66, 0x69, 0x78, 0x42, + 0x0b, 0x0a, 0x09, 0x5f, 0x61, 0x67, 0x65, 0x5f, 0x64, 0x61, 0x79, 0x73, 0x42, 0x0a, 0x0a, 0x08, + 0x5f, 0x69, 0x73, 0x5f, 0x6c, 0x69, 0x76, 0x65, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x6e, 0x75, 0x6d, + 0x5f, 0x6e, 0x65, 0x77, 0x65, 0x72, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x42, + 0x19, 0x0a, 0x17, 0x5f, 0x64, 0x61, 0x79, 0x73, 0x5f, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x5f, 0x63, + 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x1d, 0x0a, 0x1b, 0x5f, 0x64, + 0x61, 0x79, 0x73, 0x5f, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x5f, 0x6e, 0x6f, 0x6e, 0x63, 0x75, 0x72, + 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x1a, 0x5e, 0x0a, 0x07, 0x4c, 0x6f, 0x67, + 0x67, 0x69, 0x6e, 0x67, 0x12, 0x22, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x5f, 0x62, 0x75, 0x63, 0x6b, + 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x09, 0x6c, + 0x6f, 0x67, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x2f, 0x0a, 0x11, 0x6c, 0x6f, 0x67, 0x5f, + 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0f, 0x6c, 0x6f, 0x67, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x1a, 0x33, 0x0a, 0x0f, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x07, + 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x42, 0x06, 0xe0, + 0x41, 0x01, 0xe0, 0x41, 0x03, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x1a, 0xca, + 0x01, 0x0a, 0x0f, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x12, 0x46, 0x0a, 0x0e, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0d, 0x65, 0x66, 0x66, + 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x09, 0x69, 0x73, + 0x5f, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, + 0x41, 0x01, 0x52, 0x08, 0x69, 0x73, 0x4c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x12, 0x4d, 0x0a, 0x12, + 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x11, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, + 0x69, 0x6f, 0x6e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0xd3, 0x01, 0x0a, 0x10, + 0x53, 0x6f, 0x66, 0x74, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, + 0x12, 0x4d, 0x0a, 0x12, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x11, 0x72, 0x65, 0x74, 0x65, 0x6e, + 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x12, + 0x46, 0x0a, 0x0e, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x74, 0x69, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x48, 0x01, 0x52, 0x0d, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, + 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x72, 0x65, 0x74, 0x65, + 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x11, + 0x0a, 0x0f, 0x5f, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x74, 0x69, 0x6d, + 0x65, 0x1a, 0x2b, 0x0a, 0x0a, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x12, + 0x1d, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, + 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x1a, 0x63, + 0x0a, 0x07, 0x57, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x12, 0x2d, 0x0a, 0x10, 0x6d, 0x61, 0x69, + 0x6e, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x75, 0x66, 0x66, 0x69, 0x78, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0e, 0x6d, 0x61, 0x69, 0x6e, 0x50, 0x61, + 0x67, 0x65, 0x53, 0x75, 0x66, 0x66, 0x69, 0x78, 0x12, 0x29, 0x0a, 0x0e, 0x6e, 0x6f, 0x74, 0x5f, + 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0c, 0x6e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x50, + 0x61, 0x67, 0x65, 0x1a, 0x43, 0x0a, 0x15, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x50, 0x6c, 0x61, + 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2a, 0x0a, 0x0e, + 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x4c, + 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0xdb, 0x02, 0x0a, 0x09, 0x41, 0x75, 0x74, + 0x6f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x1d, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x07, 0x65, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x40, 0x0a, 0x0b, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x74, 0x6f, 0x67, + 0x67, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x16, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, - 0x73, 0x42, 0x25, 0x0a, 0x23, 0x5f, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x5f, 0x73, + 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x14, 0x74, 0x65, 0x72, 0x6d, 0x69, + 0x6e, 0x61, 0x6c, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x88, + 0x01, 0x01, 0x12, 0x70, 0x0a, 0x22, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x1a, 0x8d, 0x05, 0x0a, 0x08, 0x49, 0x70, 0x46, - 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x88, 0x01, 0x01, 0x12, 0x6f, - 0x0a, 0x15, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, - 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, - 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x49, 0x70, 0x46, 0x69, 0x6c, 0x74, 0x65, - 0x72, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x53, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x48, 0x01, 0x52, 0x13, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4e, - 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x88, 0x01, 0x01, 0x12, - 0x68, 0x0a, 0x13, 0x76, 0x70, 0x63, 0x5f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, - 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x49, 0x70, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, - 0x2e, 0x56, 0x70, 0x63, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x53, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x11, 0x76, 0x70, 0x63, 0x4e, 0x65, 0x74, 0x77, 0x6f, - 0x72, 0x6b, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x14, 0x61, 0x6c, 0x6c, - 0x6f, 0x77, 0x5f, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x5f, 0x6f, 0x72, 0x67, 0x5f, 0x76, 0x70, 0x63, - 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x11, 0x61, 0x6c, - 0x6c, 0x6f, 0x77, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x4f, 0x72, 0x67, 0x56, 0x70, 0x63, 0x73, 0x12, - 0x47, 0x0a, 0x1e, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x61, 0x6c, 0x6c, 0x5f, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x5f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, - 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x48, 0x02, 0x52, 0x1a, 0x61, 0x6c, 0x6c, 0x6f, 0x77, - 0x41, 0x6c, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x41, - 0x63, 0x63, 0x65, 0x73, 0x73, 0x88, 0x01, 0x01, 0x1a, 0x4f, 0x0a, 0x13, 0x50, 0x75, 0x62, 0x6c, - 0x69, 0x63, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, - 0x38, 0x0a, 0x16, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x69, 0x70, 0x5f, 0x63, 0x69, - 0x64, 0x72, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x42, - 0x03, 0xe0, 0x41, 0x01, 0x52, 0x13, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x49, 0x70, 0x43, - 0x69, 0x64, 0x72, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x1a, 0x77, 0x0a, 0x10, 0x56, 0x70, 0x63, - 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x1d, 0x0a, - 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, - 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x88, 0x01, 0x01, 0x12, 0x38, 0x0a, 0x16, - 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x69, 0x70, 0x5f, 0x63, 0x69, 0x64, 0x72, 0x5f, - 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, - 0x01, 0x52, 0x13, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x49, 0x70, 0x43, 0x69, 0x64, 0x72, - 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x6e, 0x65, 0x74, 0x77, 0x6f, - 0x72, 0x6b, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x42, 0x18, 0x0a, 0x16, 0x5f, + 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x48, + 0x01, 0x52, 0x1e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x53, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, + 0x65, 0x88, 0x01, 0x01, 0x42, 0x19, 0x0a, 0x17, 0x5f, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, + 0x6c, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x42, + 0x25, 0x0a, 0x23, 0x5f, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x1a, 0x8d, 0x05, 0x0a, 0x08, 0x49, 0x70, 0x46, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x48, 0x00, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x88, 0x01, 0x01, 0x12, 0x6f, 0x0a, 0x15, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x21, 0x0a, 0x1f, 0x5f, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, - 0x61, 0x6c, 0x6c, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x61, 0x67, 0x65, 0x6e, - 0x74, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x1a, 0x36, 0x0a, 0x15, 0x48, 0x69, 0x65, 0x72, - 0x61, 0x72, 0x63, 0x68, 0x69, 0x63, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, - 0x65, 0x12, 0x1d, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, - 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x58, 0xea, 0x41, 0x55, - 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, - 0x23, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x7d, 0x2f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x2f, 0x7b, 0x62, 0x75, 0x63, - 0x6b, 0x65, 0x74, 0x7d, 0x2a, 0x07, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x32, 0x06, 0x62, - 0x75, 0x63, 0x6b, 0x65, 0x74, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x69, 0x70, 0x5f, 0x66, 0x69, 0x6c, - 0x74, 0x65, 0x72, 0x22, 0xbf, 0x02, 0x0a, 0x13, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x41, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x17, 0x0a, 0x04, 0x72, - 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x04, - 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x13, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x06, 0x65, 0x6e, 0x74, - 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x06, - 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x22, 0x0a, 0x0a, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, - 0x5f, 0x61, 0x6c, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, - 0x09, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x41, 0x6c, 0x74, 0x12, 0x20, 0x0a, 0x09, 0x65, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, - 0x41, 0x01, 0x52, 0x08, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x04, - 0x65, 0x74, 0x61, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, - 0x04, 0x65, 0x74, 0x61, 0x67, 0x12, 0x19, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, - 0x12, 0x1b, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x46, 0x0a, - 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x74, 0x65, 0x61, 0x6d, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, - 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x54, - 0x65, 0x61, 0x6d, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x54, 0x65, 0x61, 0x6d, 0x22, 0x5a, 0x0a, 0x0f, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, - 0x6d, 0x6d, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1f, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x05, 0xe0, 0x41, 0x01, 0x08, 0x01, - 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x06, 0x63, 0x72, 0x63, - 0x33, 0x32, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x07, 0x48, 0x00, 0x52, 0x06, 0x63, 0x72, 0x63, - 0x33, 0x32, 0x63, 0x88, 0x01, 0x01, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x63, 0x72, 0x63, 0x33, 0x32, - 0x63, 0x22, 0x59, 0x0a, 0x0f, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, - 0x73, 0x75, 0x6d, 0x73, 0x12, 0x1b, 0x0a, 0x06, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x07, 0x48, 0x00, 0x52, 0x06, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x88, 0x01, - 0x01, 0x12, 0x1e, 0x0a, 0x08, 0x6d, 0x64, 0x35, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x07, 0x6d, 0x64, 0x35, 0x48, 0x61, 0x73, - 0x68, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x22, 0xbb, 0x01, 0x0a, - 0x1a, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x6f, 0x6e, - 0x74, 0x65, 0x78, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x19, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, + 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x49, 0x70, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2e, + 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x53, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x48, 0x01, 0x52, 0x13, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x88, 0x01, 0x01, 0x12, 0x68, 0x0a, + 0x13, 0x76, 0x70, 0x63, 0x5f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, + 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x49, 0x70, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x56, + 0x70, 0x63, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x52, 0x11, 0x76, 0x70, 0x63, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x14, 0x61, 0x6c, 0x6c, 0x6f, 0x77, + 0x5f, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x5f, 0x6f, 0x72, 0x67, 0x5f, 0x76, 0x70, 0x63, 0x73, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x11, 0x61, 0x6c, 0x6c, 0x6f, + 0x77, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x4f, 0x72, 0x67, 0x56, 0x70, 0x63, 0x73, 0x12, 0x47, 0x0a, + 0x1e, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x61, 0x6c, 0x6c, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x5f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x08, 0x48, 0x02, 0x52, 0x1a, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x41, 0x6c, + 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x88, 0x01, 0x01, 0x1a, 0x4f, 0x0a, 0x13, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x38, 0x0a, + 0x16, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x69, 0x70, 0x5f, 0x63, 0x69, 0x64, 0x72, + 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x42, 0x03, 0xe0, + 0x41, 0x01, 0x52, 0x13, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x49, 0x70, 0x43, 0x69, 0x64, + 0x72, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x1a, 0x77, 0x0a, 0x10, 0x56, 0x70, 0x63, 0x4e, 0x65, + 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x07, 0x6e, + 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x07, + 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x88, 0x01, 0x01, 0x12, 0x38, 0x0a, 0x16, 0x61, 0x6c, + 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x69, 0x70, 0x5f, 0x63, 0x69, 0x64, 0x72, 0x5f, 0x72, 0x61, + 0x6e, 0x67, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, + 0x13, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x49, 0x70, 0x43, 0x69, 0x64, 0x72, 0x52, 0x61, + 0x6e, 0x67, 0x65, 0x73, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x42, 0x18, 0x0a, 0x16, 0x5f, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x42, 0x21, 0x0a, 0x1f, 0x5f, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x61, 0x6c, + 0x6c, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, + 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x1a, 0x36, 0x0a, 0x15, 0x48, 0x69, 0x65, 0x72, 0x61, 0x72, + 0x63, 0x68, 0x69, 0x63, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, + 0x1d, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, + 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x1a, 0x39, + 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x58, 0xea, 0x41, 0x55, 0x0a, 0x1d, + 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, + 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x23, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x7d, 0x2f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x2f, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, + 0x74, 0x7d, 0x2a, 0x07, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x32, 0x06, 0x62, 0x75, 0x63, + 0x6b, 0x65, 0x74, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x69, 0x70, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x22, 0xbf, 0x02, 0x0a, 0x13, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x17, 0x0a, 0x04, 0x72, 0x6f, 0x6c, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x04, 0x72, 0x6f, + 0x6c, 0x65, 0x12, 0x13, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, + 0xe0, 0x41, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x06, 0x65, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x12, 0x22, 0x0a, 0x0a, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x61, + 0x6c, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x09, 0x65, + 0x6e, 0x74, 0x69, 0x74, 0x79, 0x41, 0x6c, 0x74, 0x12, 0x20, 0x0a, 0x09, 0x65, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, + 0x52, 0x08, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x04, 0x65, 0x74, + 0x61, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x04, 0x65, + 0x74, 0x61, 0x67, 0x12, 0x19, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1b, + 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, + 0xe0, 0x41, 0x01, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x46, 0x0a, 0x0c, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x74, 0x65, 0x61, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x65, 0x61, + 0x6d, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x54, + 0x65, 0x61, 0x6d, 0x22, 0x5a, 0x0a, 0x0f, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, + 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1f, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x05, 0xe0, 0x41, 0x01, 0x08, 0x01, 0x52, 0x07, + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x06, 0x63, 0x72, 0x63, 0x33, 0x32, + 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x07, 0x48, 0x00, 0x52, 0x06, 0x63, 0x72, 0x63, 0x33, 0x32, + 0x63, 0x88, 0x01, 0x01, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x22, + 0x59, 0x0a, 0x0f, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, + 0x6d, 0x73, 0x12, 0x1b, 0x0a, 0x06, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x07, 0x48, 0x00, 0x52, 0x06, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x88, 0x01, 0x01, 0x12, + 0x1e, 0x0a, 0x08, 0x6d, 0x64, 0x35, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x07, 0x6d, 0x64, 0x35, 0x48, 0x61, 0x73, 0x68, 0x42, + 0x09, 0x0a, 0x07, 0x5f, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x22, 0xbb, 0x01, 0x0a, 0x1a, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x6f, 0x6e, 0x74, 0x65, + 0x78, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x19, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xc6, 0x01, 0x0a, 0x0e, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x73, 0x12, 0x4a, 0x0a, 0x06, 0x63, + 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, + 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x73, 0x2e, 0x43, + 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, + 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x1a, 0x68, 0x0a, 0x0b, 0x43, 0x75, 0x73, 0x74, 0x6f, + 0x6d, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x43, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x50, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x22, 0x7b, 0x0a, 0x12, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x45, 0x6e, 0x63, + 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x36, 0x0a, 0x14, 0x65, 0x6e, 0x63, 0x72, 0x79, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x13, 0x65, 0x6e, 0x63, 0x72, + 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, + 0x2d, 0x0a, 0x10, 0x6b, 0x65, 0x79, 0x5f, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x5f, 0x62, 0x79, + 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0e, + 0x6b, 0x65, 0x79, 0x53, 0x68, 0x61, 0x32, 0x35, 0x36, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0xe3, + 0x11, 0x0a, 0x06, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x05, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x3d, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x25, 0xe0, 0x41, 0x05, 0xfa, 0x41, 0x1f, 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, + 0x74, 0x12, 0x17, 0x0a, 0x04, 0x65, 0x74, 0x61, 0x67, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x52, 0x04, 0x65, 0x74, 0x61, 0x67, 0x12, 0x23, 0x0a, 0x0a, 0x67, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, + 0xe0, 0x41, 0x05, 0x52, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x2d, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x18, 0x23, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x48, 0x00, 0x52, 0x0c, 0x72, + 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x2b, + 0x0a, 0x0e, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0e, 0x6d, 0x65, 0x74, + 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x0d, 0x73, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x17, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x2e, + 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, + 0x6e, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0f, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x34, + 0x0a, 0x13, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x64, 0x69, 0x73, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, + 0x52, 0x12, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x44, 0x69, 0x73, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x0d, 0x63, 0x61, 0x63, 0x68, 0x65, 0x5f, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, + 0x52, 0x0c, 0x63, 0x61, 0x63, 0x68, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x3d, + 0x0a, 0x03, 0x61, 0x63, 0x6c, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, + 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, + 0x72, 0x6f, 0x6c, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x03, 0x61, 0x63, 0x6c, 0x12, 0x2e, 0x0a, + 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, + 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0f, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x12, 0x40, 0x0a, + 0x0b, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, + 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, + 0x44, 0x0a, 0x0d, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, + 0x18, 0x24, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0c, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, + 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, + 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x40, 0x0a, + 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0e, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, + 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, + 0x2c, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0e, 0x63, + 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x45, 0x0a, + 0x09, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, + 0x73, 0x75, 0x6d, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x09, 0x63, 0x68, 0x65, 0x63, 0x6b, + 0x73, 0x75, 0x6d, 0x73, 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x42, 0x0a, 0x07, 0x6b, 0x6d, 0x73, 0x5f, 0x6b, 0x65, + 0x79, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x42, 0x29, 0xe0, 0x41, 0x01, 0xfa, 0x41, 0x23, 0x0a, + 0x21, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, + 0x65, 0x79, 0x52, 0x06, 0x6b, 0x6d, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x5a, 0x0a, 0x19, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6c, 0x61, + 0x73, 0x73, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, - 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xc6, 0x01, 0x0a, 0x0e, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x73, 0x12, 0x4a, 0x0a, - 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, - 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x73, - 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x03, 0xe0, 0x41, - 0x01, 0x52, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x1a, 0x68, 0x0a, 0x0b, 0x43, 0x75, 0x73, - 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x43, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x16, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, + 0x73, 0x73, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x0e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, + 0x61, 0x72, 0x79, 0x5f, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x14, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, + 0xe0, 0x41, 0x01, 0x52, 0x0d, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x72, 0x79, 0x48, 0x6f, + 0x6c, 0x64, 0x12, 0x53, 0x0a, 0x15, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x15, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, + 0x41, 0x01, 0x52, 0x13, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x70, + 0x69, 0x72, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x48, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x16, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, - 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, - 0x02, 0x38, 0x01, 0x22, 0x7b, 0x0a, 0x12, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x45, - 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x36, 0x0a, 0x14, 0x65, 0x6e, 0x63, - 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, - 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x13, 0x65, 0x6e, - 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, - 0x6d, 0x12, 0x2d, 0x0a, 0x10, 0x6b, 0x65, 0x79, 0x5f, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x5f, - 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x03, 0xe0, 0x41, 0x01, - 0x52, 0x0e, 0x6b, 0x65, 0x79, 0x53, 0x68, 0x61, 0x32, 0x35, 0x36, 0x42, 0x79, 0x74, 0x65, 0x73, - 0x22, 0xe3, 0x11, 0x0a, 0x06, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x17, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x05, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3d, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0xe0, 0x41, 0x05, 0xfa, 0x41, 0x1f, 0x0a, 0x1d, 0x73, 0x74, - 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x62, 0x75, 0x63, - 0x6b, 0x65, 0x74, 0x12, 0x17, 0x0a, 0x04, 0x65, 0x74, 0x61, 0x67, 0x18, 0x1b, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x04, 0x65, 0x74, 0x61, 0x67, 0x12, 0x23, 0x0a, 0x0a, - 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, - 0x42, 0x03, 0xe0, 0x41, 0x05, 0x52, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x2d, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x18, 0x23, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x48, 0x00, 0x52, - 0x0c, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x88, 0x01, 0x01, - 0x12, 0x2b, 0x0a, 0x0e, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0e, 0x6d, - 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x0a, - 0x0d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x17, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, - 0x12, 0x2e, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x6e, 0x63, 0x6f, - 0x64, 0x69, 0x6e, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, - 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, - 0x12, 0x34, 0x0a, 0x13, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x64, 0x69, 0x73, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, - 0x41, 0x01, 0x52, 0x12, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x44, 0x69, 0x73, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x0d, 0x63, 0x61, 0x63, 0x68, 0x65, 0x5f, - 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, - 0x41, 0x01, 0x52, 0x0c, 0x63, 0x61, 0x63, 0x68, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, - 0x12, 0x3d, 0x0a, 0x03, 0x61, 0x63, 0x6c, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, - 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x03, 0x61, 0x63, 0x6c, 0x12, - 0x2e, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x61, 0x6e, 0x67, 0x75, - 0x61, 0x67, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0f, - 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x12, - 0x40, 0x0a, 0x0b, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0c, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x69, 0x6d, - 0x65, 0x12, 0x44, 0x0a, 0x0d, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x5f, 0x74, 0x69, - 0x6d, 0x65, 0x18, 0x24, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0c, 0x66, 0x69, 0x6e, 0x61, 0x6c, - 0x69, 0x7a, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, - 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, - 0x41, 0x01, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x40, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0e, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, - 0x65, 0x12, 0x2c, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x5f, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, - 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, - 0x45, 0x0a, 0x09, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x18, 0x10, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, - 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, - 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x09, 0x63, 0x68, 0x65, - 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x12, 0x42, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x73, 0x18, 0x26, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6f, + 0x6e, 0x74, 0x65, 0x78, 0x74, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x08, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x78, 0x74, 0x73, 0x12, 0x2d, 0x0a, 0x10, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x62, + 0x61, 0x73, 0x65, 0x64, 0x5f, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x17, 0x20, 0x01, 0x28, 0x08, 0x48, + 0x01, 0x52, 0x0e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x61, 0x73, 0x65, 0x64, 0x48, 0x6f, 0x6c, + 0x64, 0x88, 0x01, 0x01, 0x12, 0x33, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x18, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x42, 0x03, 0xe0, + 0x41, 0x03, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x5b, 0x0a, 0x13, 0x63, 0x75, 0x73, + 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x19, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, + 0x6d, 0x65, 0x72, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x03, 0xe0, + 0x41, 0x01, 0x52, 0x12, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x45, 0x6e, 0x63, 0x72, + 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x42, 0x0a, 0x07, 0x6b, 0x6d, 0x73, 0x5f, - 0x6b, 0x65, 0x79, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x42, 0x29, 0xe0, 0x41, 0x01, 0xfa, 0x41, - 0x23, 0x0a, 0x21, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x72, 0x79, 0x70, 0x74, - 0x6f, 0x4b, 0x65, 0x79, 0x52, 0x06, 0x6b, 0x6d, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x5a, 0x0a, 0x19, - 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x63, - 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, - 0x52, 0x16, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, - 0x6c, 0x61, 0x73, 0x73, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x0e, 0x74, 0x65, 0x6d, 0x70, - 0x6f, 0x72, 0x61, 0x72, 0x79, 0x5f, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x14, 0x20, 0x01, 0x28, 0x08, - 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0d, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x72, 0x79, - 0x48, 0x6f, 0x6c, 0x64, 0x12, 0x53, 0x0a, 0x15, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x15, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, - 0x03, 0xe0, 0x41, 0x01, 0x52, 0x13, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x45, - 0x78, 0x70, 0x69, 0x72, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x48, 0x0a, 0x08, 0x6d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x16, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x67, 0x6f, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0a, 0x63, 0x75, + 0x73, 0x74, 0x6f, 0x6d, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x4e, 0x0a, 0x10, 0x73, 0x6f, 0x66, 0x74, + 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x1c, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, + 0xe0, 0x41, 0x03, 0x48, 0x02, 0x52, 0x0e, 0x73, 0x6f, 0x66, 0x74, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x4e, 0x0a, 0x10, 0x68, 0x61, 0x72, 0x64, + 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x1d, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, + 0xe0, 0x41, 0x03, 0x48, 0x03, 0x52, 0x0e, 0x68, 0x61, 0x72, 0x64, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, 0x74, 0x65, + 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, - 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x12, 0x42, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x73, 0x18, - 0x26, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, - 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x08, 0x63, - 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x73, 0x12, 0x2d, 0x0a, 0x10, 0x65, 0x76, 0x65, 0x6e, 0x74, - 0x5f, 0x62, 0x61, 0x73, 0x65, 0x64, 0x5f, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x17, 0x20, 0x01, 0x28, - 0x08, 0x48, 0x01, 0x52, 0x0e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x61, 0x73, 0x65, 0x64, 0x48, - 0x6f, 0x6c, 0x64, 0x88, 0x01, 0x01, 0x12, 0x33, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, - 0x18, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, - 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x42, - 0x03, 0xe0, 0x41, 0x03, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x5b, 0x0a, 0x13, 0x63, - 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x19, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x75, 0x73, - 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, - 0x03, 0xe0, 0x41, 0x01, 0x52, 0x12, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x45, 0x6e, - 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74, - 0x6f, 0x6d, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0a, - 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x4e, 0x0a, 0x10, 0x73, 0x6f, - 0x66, 0x74, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x1c, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x42, 0x03, 0xe0, 0x41, 0x03, 0x48, 0x02, 0x52, 0x0e, 0x73, 0x6f, 0x66, 0x74, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x4e, 0x0a, 0x10, 0x68, 0x61, - 0x72, 0x64, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x1d, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x42, 0x03, 0xe0, 0x41, 0x03, 0x48, 0x03, 0x52, 0x0e, 0x68, 0x61, 0x72, 0x64, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, - 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, - 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, - 0x6f, 0x6e, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x09, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, - 0x6f, 0x6e, 0x1a, 0xd3, 0x01, 0x0a, 0x09, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x41, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, - 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x04, 0x6d, - 0x6f, 0x64, 0x65, 0x12, 0x4b, 0x0a, 0x11, 0x72, 0x65, 0x74, 0x61, 0x69, 0x6e, 0x5f, 0x75, 0x6e, - 0x74, 0x69, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, - 0x0f, 0x72, 0x65, 0x74, 0x61, 0x69, 0x6e, 0x55, 0x6e, 0x74, 0x69, 0x6c, 0x54, 0x69, 0x6d, 0x65, - 0x22, 0x36, 0x0a, 0x04, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x4d, 0x4f, 0x44, 0x45, - 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, - 0x0a, 0x08, 0x55, 0x4e, 0x4c, 0x4f, 0x43, 0x4b, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, - 0x4c, 0x4f, 0x43, 0x4b, 0x45, 0x44, 0x10, 0x02, 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, - 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x65, 0x76, 0x65, 0x6e, - 0x74, 0x5f, 0x62, 0x61, 0x73, 0x65, 0x64, 0x5f, 0x68, 0x6f, 0x6c, 0x64, 0x42, 0x13, 0x0a, 0x11, - 0x5f, 0x73, 0x6f, 0x66, 0x74, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, - 0x65, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x68, 0x61, 0x72, 0x64, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0xbf, 0x02, 0x0a, 0x13, 0x4f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x17, - 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, - 0x01, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x13, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x06, - 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, - 0x01, 0x52, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x22, 0x0a, 0x0a, 0x65, 0x6e, 0x74, - 0x69, 0x74, 0x79, 0x5f, 0x61, 0x6c, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, - 0x41, 0x03, 0x52, 0x09, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x41, 0x6c, 0x74, 0x12, 0x20, 0x0a, - 0x09, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x08, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x12, - 0x17, 0x0a, 0x04, 0x65, 0x74, 0x61, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, - 0x41, 0x01, 0x52, 0x04, 0x65, 0x74, 0x61, 0x67, 0x12, 0x19, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, - 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x05, 0x65, 0x6d, - 0x61, 0x69, 0x6c, 0x12, 0x1b, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, - 0x12, 0x46, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x74, 0x65, 0x61, 0x6d, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0b, 0x70, 0x72, 0x6f, - 0x6a, 0x65, 0x63, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x22, 0x8e, 0x01, 0x0a, 0x13, 0x4c, 0x69, 0x73, - 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x33, 0x0a, 0x07, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x07, 0x6f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x65, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x65, - 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, - 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x52, 0x0a, 0x0b, 0x50, 0x72, 0x6f, - 0x6a, 0x65, 0x63, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x12, 0x2a, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x75, - 0x6d, 0x62, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x04, 0x74, 0x65, 0x61, 0x6d, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x04, 0x74, 0x65, 0x61, 0x6d, 0x22, 0x46, 0x0a, - 0x05, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x06, 0x65, 0x6e, 0x74, - 0x69, 0x74, 0x79, 0x12, 0x20, 0x0a, 0x09, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x08, 0x65, 0x6e, 0x74, - 0x69, 0x74, 0x79, 0x49, 0x64, 0x22, 0x5f, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, - 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x65, - 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x12, 0x27, 0x0a, - 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, - 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x32, 0x9f, 0x1f, 0x0a, 0x07, 0x53, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x12, 0x72, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x75, 0x63, 0x6b, - 0x65, 0x74, 0x12, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, - 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x75, 0x63, - 0x6b, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x22, 0x22, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x8a, 0xd3, 0xe4, 0x93, 0x02, - 0x15, 0x12, 0x13, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, - 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x6f, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x42, 0x75, 0x63, - 0x6b, 0x65, 0x74, 0x12, 0x23, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, - 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x75, 0x63, 0x6b, 0x65, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, - 0x6b, 0x65, 0x74, 0x22, 0x22, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x8a, 0xd3, 0xe4, 0x93, - 0x02, 0x15, 0x12, 0x13, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, - 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0xab, 0x01, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x22, 0x58, 0xda, 0x41, 0x17, - 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2c, 0x62, 0x75, - 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x38, 0x12, 0x16, 0x0a, - 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x0c, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x1e, 0x0a, 0x0e, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, - 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x0c, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x85, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x75, - 0x63, 0x6b, 0x65, 0x74, 0x73, 0x12, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, - 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x75, - 0x63, 0x6b, 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x67, + 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, + 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x09, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, + 0x1a, 0xd3, 0x01, 0x0a, 0x09, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x41, + 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x27, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x8a, - 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, - 0x0c, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x93, 0x01, - 0x0a, 0x19, 0x4c, 0x6f, 0x63, 0x6b, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x74, 0x65, - 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x33, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, - 0x4c, 0x6f, 0x63, 0x6b, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, - 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x22, 0x26, 0xda, 0x41, 0x06, - 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x12, 0x15, 0x0a, 0x06, - 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, - 0x2a, 0x2a, 0x7d, 0x12, 0xa3, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f, - 0x6c, 0x69, 0x63, 0x79, 0x12, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, - 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, - 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, - 0x58, 0xda, 0x41, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x8a, 0xd3, 0xe4, 0x93, - 0x02, 0x47, 0x12, 0x17, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x0b, - 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x2c, 0x0a, 0x08, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x20, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, - 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x62, 0x75, 0x63, 0x6b, - 0x65, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x2a, 0x2a, 0x12, 0xaa, 0x01, 0x0a, 0x0c, 0x53, 0x65, - 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x22, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x49, 0x61, - 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x50, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x5f, 0xda, 0x41, 0x0f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x2c, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x47, 0x12, - 0x17, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x0b, 0x7b, 0x62, 0x75, - 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x2c, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x12, 0x20, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x70, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, - 0x2f, 0x2a, 0x7d, 0x2f, 0x2a, 0x2a, 0x12, 0x96, 0x02, 0x0a, 0x12, 0x54, 0x65, 0x73, 0x74, 0x49, - 0x61, 0x6d, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x28, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, - 0x73, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x49, 0x61, 0x6d, 0x50, - 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0xaa, 0x01, 0xda, 0x41, 0x14, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x2c, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x8a, 0xd3, 0xe4, 0x93, - 0x02, 0x8c, 0x01, 0x12, 0x17, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, - 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x34, 0x0a, 0x08, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x28, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, - 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x62, 0x75, 0x63, - 0x6b, 0x65, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, - 0x2a, 0x2a, 0x12, 0x3b, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x2f, - 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, - 0x2f, 0x2a, 0x2f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x6d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x64, 0x46, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x2a, 0x12, - 0x8a, 0x01, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, + 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x04, 0x6d, 0x6f, 0x64, + 0x65, 0x12, 0x4b, 0x0a, 0x11, 0x72, 0x65, 0x74, 0x61, 0x69, 0x6e, 0x5f, 0x75, 0x6e, 0x74, 0x69, + 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0f, 0x72, + 0x65, 0x74, 0x61, 0x69, 0x6e, 0x55, 0x6e, 0x74, 0x69, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x36, + 0x0a, 0x04, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x55, + 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, + 0x55, 0x4e, 0x4c, 0x4f, 0x43, 0x4b, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x4f, + 0x43, 0x4b, 0x45, 0x44, 0x10, 0x02, 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, + 0x62, 0x61, 0x73, 0x65, 0x64, 0x5f, 0x68, 0x6f, 0x6c, 0x64, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x73, + 0x6f, 0x66, 0x74, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x42, + 0x13, 0x0a, 0x11, 0x5f, 0x68, 0x61, 0x72, 0x64, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x22, 0xbf, 0x02, 0x0a, 0x13, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x41, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x17, 0x0a, 0x04, + 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, + 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x13, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x06, 0x65, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, + 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x22, 0x0a, 0x0a, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x5f, 0x61, 0x6c, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, + 0x52, 0x09, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x41, 0x6c, 0x74, 0x12, 0x20, 0x0a, 0x09, 0x65, + 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, + 0xe0, 0x41, 0x01, 0x52, 0x08, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x12, 0x17, 0x0a, + 0x04, 0x65, 0x74, 0x61, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, + 0x52, 0x04, 0x65, 0x74, 0x61, 0x67, 0x12, 0x19, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, + 0x6c, 0x12, 0x1b, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x46, + 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x74, 0x65, 0x61, 0x6d, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, + 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x54, 0x65, 0x61, 0x6d, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x22, 0x8e, 0x01, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, + 0x0a, 0x07, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x07, 0x6f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x65, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x65, 0x73, 0x12, + 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, + 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x52, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x12, 0x2a, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, + 0xe0, 0x41, 0x01, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x12, 0x17, 0x0a, 0x04, 0x74, 0x65, 0x61, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x04, 0x74, 0x65, 0x61, 0x6d, 0x22, 0x46, 0x0a, 0x05, 0x4f, + 0x77, 0x6e, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x12, 0x20, 0x0a, 0x09, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x08, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x49, 0x64, 0x22, 0x5f, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, + 0x6e, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x63, + 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x4c, 0x65, + 0x6e, 0x67, 0x74, 0x68, 0x32, 0x9f, 0x1f, 0x0a, 0x07, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x12, 0x72, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, - 0x6b, 0x65, 0x74, 0x22, 0x37, 0xda, 0x41, 0x12, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2c, 0x75, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x1c, - 0x12, 0x1a, 0x0a, 0x0b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x7e, 0x0a, 0x0d, - 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x27, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, - 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, + 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x22, 0x22, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x12, + 0x13, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, + 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x6f, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x42, 0x75, 0x63, 0x6b, 0x65, + 0x74, 0x12, 0x23, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x22, 0x29, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x12, 0x21, 0x0a, 0x12, 0x64, 0x65, 0x73, - 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, - 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x98, 0x01, 0x0a, - 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x26, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, - 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x48, 0xda, - 0x41, 0x0d, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2c, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0xda, - 0x41, 0x18, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2c, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2c, - 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x17, - 0x12, 0x15, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, - 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x8d, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x74, - 0x6f, 0x72, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x27, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, - 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, - 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x38, 0xda, - 0x41, 0x18, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2c, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2c, - 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x17, - 0x12, 0x15, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, - 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0xba, 0x01, 0x0a, 0x14, 0x43, 0x61, 0x6e, 0x63, - 0x65, 0x6c, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, - 0x12, 0x2e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x75, 0x6d, - 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x75, 0x6d, - 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x41, 0xda, 0x41, 0x09, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x69, 0x64, 0x8a, - 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x12, 0x2d, 0x0a, 0x09, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, - 0x69, 0x64, 0x12, 0x20, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, + 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, + 0x74, 0x22, 0x22, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x15, + 0x12, 0x13, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, + 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0xab, 0x01, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, + 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x22, 0x58, 0xda, 0x41, 0x17, 0x70, 0x61, + 0x72, 0x65, 0x6e, 0x74, 0x2c, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2c, 0x62, 0x75, 0x63, 0x6b, + 0x65, 0x74, 0x5f, 0x69, 0x64, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x38, 0x12, 0x16, 0x0a, 0x06, 0x70, + 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x0c, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x3d, + 0x2a, 0x2a, 0x7d, 0x12, 0x1e, 0x0a, 0x0e, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x0c, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x3d, + 0x2a, 0x2a, 0x7d, 0x12, 0x85, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x75, 0x63, 0x6b, + 0x65, 0x74, 0x73, 0x12, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x75, 0x63, 0x6b, + 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x27, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x8a, 0xd3, 0xe4, + 0x93, 0x02, 0x18, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x0c, 0x7b, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x93, 0x01, 0x0a, 0x19, + 0x4c, 0x6f, 0x63, 0x6b, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, + 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x6f, + 0x63, 0x6b, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, + 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, + 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x22, 0x26, 0xda, 0x41, 0x06, 0x62, 0x75, + 0x63, 0x6b, 0x65, 0x74, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x75, + 0x63, 0x6b, 0x65, 0x74, 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, + 0x7d, 0x12, 0xa3, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x12, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, + 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x58, 0xda, + 0x41, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x47, + 0x12, 0x17, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x0b, 0x7b, 0x62, + 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x2c, 0x0a, 0x08, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x20, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, + 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x2a, 0x2a, 0x12, 0xaa, 0x01, 0x0a, 0x0c, 0x53, 0x65, 0x74, 0x49, + 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50, + 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, + 0x69, 0x63, 0x79, 0x22, 0x5f, 0xda, 0x41, 0x0f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x2c, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x47, 0x12, 0x17, 0x0a, + 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, + 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x2c, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x12, 0x20, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x2f, 0x2a, - 0x7d, 0x2f, 0x2a, 0x2a, 0x12, 0x95, 0x01, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x12, 0x23, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, - 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x7d, 0x2f, 0x2a, 0x2a, 0x12, 0x96, 0x02, 0x0a, 0x12, 0x54, 0x65, 0x73, 0x74, 0x49, 0x61, 0x6d, + 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x28, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x73, 0x74, + 0x49, 0x61, 0x6d, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, + 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x65, 0x72, + 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0xaa, 0x01, 0xda, 0x41, 0x14, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2c, 0x70, + 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x8c, + 0x01, 0x12, 0x17, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x0b, 0x7b, + 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x34, 0x0a, 0x08, 0x72, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x28, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x62, 0x75, 0x63, 0x6b, 0x65, + 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2a, + 0x12, 0x3b, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x2f, 0x7b, 0x62, + 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, + 0x2f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x6d, 0x61, 0x6e, 0x61, + 0x67, 0x65, 0x64, 0x46, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x2a, 0x12, 0x8a, 0x01, + 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x26, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, + 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, + 0x74, 0x22, 0x37, 0xda, 0x41, 0x12, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2c, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, + 0x0a, 0x0b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0b, 0x7b, + 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x7e, 0x0a, 0x0d, 0x43, 0x6f, + 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x27, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, + 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, + 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, + 0x29, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x12, 0x21, 0x0a, 0x12, 0x64, 0x65, 0x73, 0x74, 0x69, + 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x0b, 0x7b, + 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x98, 0x01, 0x0a, 0x0c, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x26, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x48, 0xda, 0x41, 0x0d, + 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2c, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0xda, 0x41, 0x18, + 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2c, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x67, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x12, 0x15, + 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, + 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x8d, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x27, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x74, + 0x6f, 0x72, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x38, 0xda, 0x41, 0x18, + 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2c, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x67, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x12, 0x15, + 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, + 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0xba, 0x01, 0x0a, 0x14, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, + 0x52, 0x65, 0x73, 0x75, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x2e, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, + 0x76, 0x32, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x61, 0x62, + 0x6c, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, + 0x76, 0x32, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x61, 0x62, + 0x6c, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x41, 0xda, 0x41, 0x09, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x69, 0x64, 0x8a, 0xd3, 0xe4, + 0x93, 0x02, 0x2f, 0x12, 0x2d, 0x0a, 0x09, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x69, 0x64, + 0x12, 0x20, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, + 0x2a, 0x2a, 0x12, 0x95, 0x01, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x12, 0x23, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x22, 0x48, 0xda, 0x41, 0x0d, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2c, 0x6f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0xda, 0x41, 0x18, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2c, 0x6f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x2c, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x8a, 0xd3, 0xe4, + 0x93, 0x02, 0x17, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x0b, 0x7b, + 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0xa5, 0x01, 0x0a, 0x0a, 0x52, + 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, + 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x48, 0xda, 0x41, 0x0d, 0x62, 0x75, 0x63, 0x6b, 0x65, + 0x74, 0x2c, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0xda, 0x41, 0x18, 0x62, 0x75, 0x63, 0x6b, 0x65, + 0x74, 0x2c, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x75, 0x63, + 0x6b, 0x65, 0x74, 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, + 0x30, 0x01, 0x12, 0x99, 0x01, 0x0a, 0x0e, 0x42, 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x28, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x69, 0x64, 0x69, 0x52, 0x65, + 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x8a, 0xd3, 0xe4, 0x93, + 0x02, 0x28, 0x12, 0x26, 0x0a, 0x17, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x0b, 0x7b, + 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x28, 0x01, 0x30, 0x01, 0x12, 0x8c, + 0x01, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, + 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x22, 0x48, 0xda, 0x41, 0x0d, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2c, 0x6f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0xda, 0x41, 0x18, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2c, 0x6f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x8a, - 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, - 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0xa5, 0x01, 0x0a, - 0x0a, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x24, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, - 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x48, 0xda, 0x41, 0x0d, 0x62, 0x75, 0x63, - 0x6b, 0x65, 0x74, 0x2c, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0xda, 0x41, 0x18, 0x62, 0x75, 0x63, - 0x6b, 0x65, 0x74, 0x2c, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x67, 0x65, 0x6e, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x12, 0x15, 0x0a, 0x06, 0x62, + 0x63, 0x74, 0x22, 0x39, 0xda, 0x41, 0x12, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x12, + 0x1c, 0x0a, 0x0d, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, + 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x60, 0x0a, + 0x0b, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x25, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, + 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x12, + 0x6e, 0x0a, 0x0f, 0x42, 0x69, 0x64, 0x69, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x12, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x69, 0x64, 0x69, 0x57, 0x72, 0x69, 0x74, 0x65, + 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, + 0x32, 0x2e, 0x42, 0x69, 0x64, 0x69, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, + 0x84, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, + 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, + 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x12, + 0x15, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, + 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x98, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x77, 0x72, 0x69, + 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x27, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x77, + 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x34, 0x12, 0x0f, 0x0a, + 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x21, + 0x0a, 0x12, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x75, + 0x63, 0x6b, 0x65, 0x74, 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, + 0x7d, 0x12, 0xae, 0x01, 0x0a, 0x13, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6d, + 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x74, + 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, 0x69, 0x74, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x74, 0x61, + 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x32, + 0x12, 0x30, 0x0a, 0x21, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x5f, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, - 0x2a, 0x7d, 0x30, 0x01, 0x12, 0x99, 0x01, 0x0a, 0x0e, 0x42, 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, - 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x28, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x69, 0x64, 0x69, - 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x8a, 0xd3, - 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x0a, 0x17, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, - 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x28, 0x01, 0x30, 0x01, - 0x12, 0x8c, 0x01, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x12, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x22, 0x39, 0xda, 0x41, 0x12, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2c, - 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x8a, 0xd3, 0xe4, 0x93, 0x02, - 0x1e, 0x12, 0x1c, 0x0a, 0x0d, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x62, 0x75, 0x63, 0x6b, - 0x65, 0x74, 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, - 0x60, 0x0a, 0x0b, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x25, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, - 0x76, 0x32, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, - 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, - 0x01, 0x12, 0x6e, 0x0a, 0x0f, 0x42, 0x69, 0x64, 0x69, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x12, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, - 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x69, 0x64, 0x69, 0x57, 0x72, 0x69, - 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, - 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x69, 0x64, 0x69, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, - 0x01, 0x12, 0x84, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x73, 0x12, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x26, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x8a, 0xd3, 0xe4, 0x93, 0x02, - 0x17, 0x12, 0x15, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x0b, 0x7b, 0x62, 0x75, - 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x98, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x77, - 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x27, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x52, - 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, - 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x34, 0x12, - 0x0f, 0x0a, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, - 0x12, 0x21, 0x0a, 0x12, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, - 0x2a, 0x2a, 0x7d, 0x12, 0xae, 0x01, 0x0a, 0x13, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, - 0x75, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x2d, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, - 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, - 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x53, - 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, 0x69, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0x8a, 0xd3, 0xe4, 0x93, - 0x02, 0x32, 0x12, 0x30, 0x0a, 0x21, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x6f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x2e, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, - 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0xae, 0x01, 0x0a, 0x10, 0x51, 0x75, 0x65, 0x72, 0x79, 0x57, 0x72, - 0x69, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, - 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x57, - 0x72, 0x69, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x41, 0xda, 0x41, 0x09, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x69, 0x64, - 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x12, 0x2d, 0x0a, 0x09, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, - 0x5f, 0x69, 0x64, 0x12, 0x20, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x70, 0x72, 0x6f, - 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x2f, - 0x2a, 0x7d, 0x2f, 0x2a, 0x2a, 0x12, 0x96, 0x01, 0x0a, 0x0a, 0x4d, 0x6f, 0x76, 0x65, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x12, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, - 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x6f, 0x76, 0x65, 0x4f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x47, 0xda, 0x41, 0x27, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, - 0x2c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x64, - 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, - 0x74, 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x1a, 0xa7, - 0x02, 0xca, 0x41, 0x16, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0xd2, 0x41, 0x8a, 0x02, 0x68, 0x74, - 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x63, 0x6c, - 0x6f, 0x75, 0x64, 0x2d, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2c, 0x68, 0x74, 0x74, - 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, - 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x63, 0x6c, 0x6f, - 0x75, 0x64, 0x2d, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x72, 0x65, 0x61, 0x64, - 0x2d, 0x6f, 0x6e, 0x6c, 0x79, 0x2c, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, - 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x64, 0x65, 0x76, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, - 0x2e, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2c, 0x68, 0x74, - 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x64, 0x65, - 0x76, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6f, 0x6e, - 0x6c, 0x79, 0x2c, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x75, - 0x74, 0x68, 0x2f, 0x64, 0x65, 0x76, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x72, 0x65, - 0x61, 0x64, 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x42, 0xe2, 0x01, 0xea, 0x41, 0x78, 0x0a, 0x21, - 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, - 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, - 0x79, 0x12, 0x53, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, - 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, - 0x7b, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, - 0x6e, 0x67, 0x73, 0x2f, 0x7b, 0x6b, 0x65, 0x79, 0x5f, 0x72, 0x69, 0x6e, 0x67, 0x7d, 0x2f, 0x63, - 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x2f, 0x7b, 0x63, 0x72, 0x79, 0x70, 0x74, - 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x7d, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x42, 0x0c, 0x53, - 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3e, 0x63, - 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x67, 0x6f, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x6e, 0x61, 0x6c, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x70, 0x62, 0x3b, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x70, 0x62, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2a, 0x7d, 0x12, 0xae, 0x01, 0x0a, 0x10, 0x51, 0x75, 0x65, 0x72, 0x79, 0x57, 0x72, 0x69, 0x74, + 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x57, 0x72, 0x69, + 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x41, 0xda, 0x41, 0x09, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x69, 0x64, 0x8a, 0xd3, + 0xe4, 0x93, 0x02, 0x2f, 0x12, 0x2d, 0x0a, 0x09, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x69, + 0x64, 0x12, 0x20, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x2f, 0x2a, 0x7d, + 0x2f, 0x2a, 0x2a, 0x12, 0x96, 0x01, 0x0a, 0x0a, 0x4d, 0x6f, 0x76, 0x65, 0x4f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x12, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x6f, 0x76, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x22, 0x47, 0xda, 0x41, 0x27, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2c, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x64, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x8a, + 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, + 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x1a, 0xa7, 0x02, 0xca, + 0x41, 0x16, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0xd2, 0x41, 0x8a, 0x02, 0x68, 0x74, 0x74, 0x70, + 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, + 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x63, 0x6c, 0x6f, 0x75, + 0x64, 0x2d, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2c, 0x68, 0x74, 0x74, 0x70, 0x73, + 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, + 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, + 0x2d, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x2d, 0x6f, + 0x6e, 0x6c, 0x79, 0x2c, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, + 0x75, 0x74, 0x68, 0x2f, 0x64, 0x65, 0x76, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x66, + 0x75, 0x6c, 0x6c, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2c, 0x68, 0x74, 0x74, 0x70, + 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, + 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x64, 0x65, 0x76, 0x73, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, + 0x2c, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x75, 0x74, 0x68, + 0x2f, 0x64, 0x65, 0x76, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x72, 0x65, 0x61, 0x64, + 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x42, 0xe2, 0x01, 0xea, 0x41, 0x78, 0x0a, 0x21, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, + 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x12, + 0x53, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x7d, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x6c, + 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, 0x6e, 0x67, + 0x73, 0x2f, 0x7b, 0x6b, 0x65, 0x79, 0x5f, 0x72, 0x69, 0x6e, 0x67, 0x7d, 0x2f, 0x63, 0x72, 0x79, + 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x2f, 0x7b, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, + 0x6b, 0x65, 0x79, 0x7d, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x42, 0x0c, 0x53, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3e, 0x63, 0x6c, 0x6f, + 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, + 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, + 0x6c, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x70, + 0x62, 0x3b, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -10352,1459 +10393,3 @@ func file_google_storage_v2_storage_proto_init() { file_google_storage_v2_storage_proto_goTypes = nil file_google_storage_v2_storage_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// StorageClient is the client API for Storage service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type StorageClient interface { - // Permanently deletes an empty bucket. - DeleteBucket(ctx context.Context, in *DeleteBucketRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // Returns metadata for the specified bucket. - GetBucket(ctx context.Context, in *GetBucketRequest, opts ...grpc.CallOption) (*Bucket, error) - // Creates a new bucket. - CreateBucket(ctx context.Context, in *CreateBucketRequest, opts ...grpc.CallOption) (*Bucket, error) - // Retrieves a list of buckets for a given project. - ListBuckets(ctx context.Context, in *ListBucketsRequest, opts ...grpc.CallOption) (*ListBucketsResponse, error) - // Locks retention policy on a bucket. - LockBucketRetentionPolicy(ctx context.Context, in *LockBucketRetentionPolicyRequest, opts ...grpc.CallOption) (*Bucket, error) - // Gets the IAM policy for a specified bucket. - // The `resource` field in the request should be - // `projects/_/buckets/{bucket}` for a bucket, or - // `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` - // for a managed folder. - GetIamPolicy(ctx context.Context, in *iampb.GetIamPolicyRequest, opts ...grpc.CallOption) (*iampb.Policy, error) - // Updates an IAM policy for the specified bucket. - // The `resource` field in the request should be - // `projects/_/buckets/{bucket}` for a bucket, or - // `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` - // for a managed folder. - SetIamPolicy(ctx context.Context, in *iampb.SetIamPolicyRequest, opts ...grpc.CallOption) (*iampb.Policy, error) - // Tests a set of permissions on the given bucket, object, or managed folder - // to see which, if any, are held by the caller. - // The `resource` field in the request should be - // `projects/_/buckets/{bucket}` for a bucket, - // `projects/_/buckets/{bucket}/objects/{object}` for an object, or - // `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` - // for a managed folder. - TestIamPermissions(ctx context.Context, in *iampb.TestIamPermissionsRequest, opts ...grpc.CallOption) (*iampb.TestIamPermissionsResponse, error) - // Updates a bucket. Equivalent to JSON API's storage.buckets.patch method. - UpdateBucket(ctx context.Context, in *UpdateBucketRequest, opts ...grpc.CallOption) (*Bucket, error) - // Concatenates a list of existing objects into a new object in the same - // bucket. - ComposeObject(ctx context.Context, in *ComposeObjectRequest, opts ...grpc.CallOption) (*Object, error) - // Deletes an object and its metadata. Deletions are permanent if versioning - // is not enabled for the bucket, or if the generation parameter is used, or - // if [soft delete](https://cloud.google.com/storage/docs/soft-delete) is not - // enabled for the bucket. - // When this API is used to delete an object from a bucket that has soft - // delete policy enabled, the object becomes soft deleted, and the - // `softDeleteTime` and `hardDeleteTime` properties are set on the object. - // This API cannot be used to permanently delete soft-deleted objects. - // Soft-deleted objects are permanently deleted according to their - // `hardDeleteTime`. - // - // You can use the [`RestoreObject`][google.storage.v2.Storage.RestoreObject] - // API to restore soft-deleted objects until the soft delete retention period - // has passed. - // - // **IAM Permissions**: - // - // Requires `storage.objects.delete` - // [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on - // the bucket. - DeleteObject(ctx context.Context, in *DeleteObjectRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // Restores a soft-deleted object. - RestoreObject(ctx context.Context, in *RestoreObjectRequest, opts ...grpc.CallOption) (*Object, error) - // Cancels an in-progress resumable upload. - // - // Any attempts to write to the resumable upload after cancelling the upload - // will fail. - // - // The behavior for currently in progress write operations is not guaranteed - - // they could either complete before the cancellation or fail if the - // cancellation completes first. - CancelResumableWrite(ctx context.Context, in *CancelResumableWriteRequest, opts ...grpc.CallOption) (*CancelResumableWriteResponse, error) - // Retrieves object metadata. - // - // **IAM Permissions**: - // - // Requires `storage.objects.get` - // [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on - // the bucket. To return object ACLs, the authenticated user must also have - // the `storage.objects.getIamPolicy` permission. - GetObject(ctx context.Context, in *GetObjectRequest, opts ...grpc.CallOption) (*Object, error) - // Retrieves object data. - // - // **IAM Permissions**: - // - // Requires `storage.objects.get` - // [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on - // the bucket. - ReadObject(ctx context.Context, in *ReadObjectRequest, opts ...grpc.CallOption) (Storage_ReadObjectClient, error) - // Reads an object's data. - // - // This is a bi-directional API with the added support for reading multiple - // ranges within one stream both within and across multiple messages. - // If the server encountered an error for any of the inputs, the stream will - // be closed with the relevant error code. - // Because the API allows for multiple outstanding requests, when the stream - // is closed the error response will contain a BidiReadObjectRangesError proto - // in the error extension describing the error for each outstanding read_id. - // - // **IAM Permissions**: - // - // Requires `storage.objects.get` - // - // [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on - // the bucket. - // - // This API is currently in preview and is not yet available for general - // use. - BidiReadObject(ctx context.Context, opts ...grpc.CallOption) (Storage_BidiReadObjectClient, error) - // Updates an object's metadata. - // Equivalent to JSON API's storage.objects.patch. - UpdateObject(ctx context.Context, in *UpdateObjectRequest, opts ...grpc.CallOption) (*Object, error) - // Stores a new object and metadata. - // - // An object can be written either in a single message stream or in a - // resumable sequence of message streams. To write using a single stream, - // the client should include in the first message of the stream an - // `WriteObjectSpec` describing the destination bucket, object, and any - // preconditions. Additionally, the final message must set 'finish_write' to - // true, or else it is an error. - // - // For a resumable write, the client should instead call - // `StartResumableWrite()`, populating a `WriteObjectSpec` into that request. - // They should then attach the returned `upload_id` to the first message of - // each following call to `WriteObject`. If the stream is closed before - // finishing the upload (either explicitly by the client or due to a network - // error or an error response from the server), the client should do as - // follows: - // - Check the result Status of the stream, to determine if writing can be - // resumed on this stream or must be restarted from scratch (by calling - // `StartResumableWrite()`). The resumable errors are DEADLINE_EXCEEDED, - // INTERNAL, and UNAVAILABLE. For each case, the client should use binary - // exponential backoff before retrying. Additionally, writes can be - // resumed after RESOURCE_EXHAUSTED errors, but only after taking - // appropriate measures, which may include reducing aggregate send rate - // across clients and/or requesting a quota increase for your project. - // - If the call to `WriteObject` returns `ABORTED`, that indicates - // concurrent attempts to update the resumable write, caused either by - // multiple racing clients or by a single client where the previous - // request was timed out on the client side but nonetheless reached the - // server. In this case the client should take steps to prevent further - // concurrent writes (e.g., increase the timeouts, stop using more than - // one process to perform the upload, etc.), and then should follow the - // steps below for resuming the upload. - // - For resumable errors, the client should call `QueryWriteStatus()` and - // then continue writing from the returned `persisted_size`. This may be - // less than the amount of data the client previously sent. Note also that - // it is acceptable to send data starting at an offset earlier than the - // returned `persisted_size`; in this case, the service will skip data at - // offsets that were already persisted (without checking that it matches - // the previously written data), and write only the data starting from the - // persisted offset. Even though the data isn't written, it may still - // incur a performance cost over resuming at the correct write offset. - // This behavior can make client-side handling simpler in some cases. - // - Clients must only send data that is a multiple of 256 KiB per message, - // unless the object is being finished with `finish_write` set to `true`. - // - // The service will not view the object as complete until the client has - // sent a `WriteObjectRequest` with `finish_write` set to `true`. Sending any - // requests on a stream after sending a request with `finish_write` set to - // `true` will cause an error. The client **should** check the response it - // receives to determine how much data the service was able to commit and - // whether the service views the object as complete. - // - // Attempting to resume an already finalized object will result in an OK - // status, with a `WriteObjectResponse` containing the finalized object's - // metadata. - // - // Alternatively, the BidiWriteObject operation may be used to write an - // object with controls over flushing and the ability to fetch the ability to - // determine the current persisted size. - // - // **IAM Permissions**: - // - // Requires `storage.objects.create` - // [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on - // the bucket. - WriteObject(ctx context.Context, opts ...grpc.CallOption) (Storage_WriteObjectClient, error) - // Stores a new object and metadata. - // - // This is similar to the WriteObject call with the added support for - // manual flushing of persisted state, and the ability to determine current - // persisted size without closing the stream. - // - // The client may specify one or both of the `state_lookup` and `flush` fields - // in each BidiWriteObjectRequest. If `flush` is specified, the data written - // so far will be persisted to storage. If `state_lookup` is specified, the - // service will respond with a BidiWriteObjectResponse that contains the - // persisted size. If both `flush` and `state_lookup` are specified, the flush - // will always occur before a `state_lookup`, so that both may be set in the - // same request and the returned state will be the state of the object - // post-flush. When the stream is closed, a BidiWriteObjectResponse will - // always be sent to the client, regardless of the value of `state_lookup`. - BidiWriteObject(ctx context.Context, opts ...grpc.CallOption) (Storage_BidiWriteObjectClient, error) - // Retrieves a list of objects matching the criteria. - // - // **IAM Permissions**: - // - // The authenticated user requires `storage.objects.list` - // [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) - // to use this method. To return object ACLs, the authenticated user must also - // have the `storage.objects.getIamPolicy` permission. - ListObjects(ctx context.Context, in *ListObjectsRequest, opts ...grpc.CallOption) (*ListObjectsResponse, error) - // Rewrites a source object to a destination object. Optionally overrides - // metadata. - RewriteObject(ctx context.Context, in *RewriteObjectRequest, opts ...grpc.CallOption) (*RewriteResponse, error) - // Starts a resumable write operation. This - // method is part of the [Resumable - // upload](https://cloud.google.com/storage/docs/resumable-uploads) feature. - // This allows you to upload large objects in multiple chunks, which is more - // resilient to network interruptions than a single upload. The validity - // duration of the write operation, and the consequences of it becoming - // invalid, are service-dependent. - // - // **IAM Permissions**: - // - // Requires `storage.objects.create` - // [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on - // the bucket. - StartResumableWrite(ctx context.Context, in *StartResumableWriteRequest, opts ...grpc.CallOption) (*StartResumableWriteResponse, error) - // Determines the `persisted_size` of an object that is being written. This - // method is part of the [resumable - // upload](https://cloud.google.com/storage/docs/resumable-uploads) feature. - // The returned value is the size of the object that has been persisted so - // far. The value can be used as the `write_offset` for the next `Write()` - // call. - // - // If the object does not exist, meaning if it was deleted, or the - // first `Write()` has not yet reached the service, this method returns the - // error `NOT_FOUND`. - // - // This method is useful for clients that buffer data and need to know which - // data can be safely evicted. The client can call `QueryWriteStatus()` at any - // time to determine how much data has been logged for this object. - // For any sequence of `QueryWriteStatus()` calls for a given - // object name, the sequence of returned `persisted_size` values are - // non-decreasing. - QueryWriteStatus(ctx context.Context, in *QueryWriteStatusRequest, opts ...grpc.CallOption) (*QueryWriteStatusResponse, error) - // Moves the source object to the destination object in the same bucket. - MoveObject(ctx context.Context, in *MoveObjectRequest, opts ...grpc.CallOption) (*Object, error) -} - -type storageClient struct { - cc grpc.ClientConnInterface -} - -func NewStorageClient(cc grpc.ClientConnInterface) StorageClient { - return &storageClient{cc} -} - -func (c *storageClient) DeleteBucket(ctx context.Context, in *DeleteBucketRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/google.storage.v2.Storage/DeleteBucket", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *storageClient) GetBucket(ctx context.Context, in *GetBucketRequest, opts ...grpc.CallOption) (*Bucket, error) { - out := new(Bucket) - err := c.cc.Invoke(ctx, "/google.storage.v2.Storage/GetBucket", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *storageClient) CreateBucket(ctx context.Context, in *CreateBucketRequest, opts ...grpc.CallOption) (*Bucket, error) { - out := new(Bucket) - err := c.cc.Invoke(ctx, "/google.storage.v2.Storage/CreateBucket", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *storageClient) ListBuckets(ctx context.Context, in *ListBucketsRequest, opts ...grpc.CallOption) (*ListBucketsResponse, error) { - out := new(ListBucketsResponse) - err := c.cc.Invoke(ctx, "/google.storage.v2.Storage/ListBuckets", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *storageClient) LockBucketRetentionPolicy(ctx context.Context, in *LockBucketRetentionPolicyRequest, opts ...grpc.CallOption) (*Bucket, error) { - out := new(Bucket) - err := c.cc.Invoke(ctx, "/google.storage.v2.Storage/LockBucketRetentionPolicy", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *storageClient) GetIamPolicy(ctx context.Context, in *iampb.GetIamPolicyRequest, opts ...grpc.CallOption) (*iampb.Policy, error) { - out := new(iampb.Policy) - err := c.cc.Invoke(ctx, "/google.storage.v2.Storage/GetIamPolicy", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *storageClient) SetIamPolicy(ctx context.Context, in *iampb.SetIamPolicyRequest, opts ...grpc.CallOption) (*iampb.Policy, error) { - out := new(iampb.Policy) - err := c.cc.Invoke(ctx, "/google.storage.v2.Storage/SetIamPolicy", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *storageClient) TestIamPermissions(ctx context.Context, in *iampb.TestIamPermissionsRequest, opts ...grpc.CallOption) (*iampb.TestIamPermissionsResponse, error) { - out := new(iampb.TestIamPermissionsResponse) - err := c.cc.Invoke(ctx, "/google.storage.v2.Storage/TestIamPermissions", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *storageClient) UpdateBucket(ctx context.Context, in *UpdateBucketRequest, opts ...grpc.CallOption) (*Bucket, error) { - out := new(Bucket) - err := c.cc.Invoke(ctx, "/google.storage.v2.Storage/UpdateBucket", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *storageClient) ComposeObject(ctx context.Context, in *ComposeObjectRequest, opts ...grpc.CallOption) (*Object, error) { - out := new(Object) - err := c.cc.Invoke(ctx, "/google.storage.v2.Storage/ComposeObject", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *storageClient) DeleteObject(ctx context.Context, in *DeleteObjectRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/google.storage.v2.Storage/DeleteObject", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *storageClient) RestoreObject(ctx context.Context, in *RestoreObjectRequest, opts ...grpc.CallOption) (*Object, error) { - out := new(Object) - err := c.cc.Invoke(ctx, "/google.storage.v2.Storage/RestoreObject", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *storageClient) CancelResumableWrite(ctx context.Context, in *CancelResumableWriteRequest, opts ...grpc.CallOption) (*CancelResumableWriteResponse, error) { - out := new(CancelResumableWriteResponse) - err := c.cc.Invoke(ctx, "/google.storage.v2.Storage/CancelResumableWrite", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *storageClient) GetObject(ctx context.Context, in *GetObjectRequest, opts ...grpc.CallOption) (*Object, error) { - out := new(Object) - err := c.cc.Invoke(ctx, "/google.storage.v2.Storage/GetObject", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *storageClient) ReadObject(ctx context.Context, in *ReadObjectRequest, opts ...grpc.CallOption) (Storage_ReadObjectClient, error) { - stream, err := c.cc.NewStream(ctx, &_Storage_serviceDesc.Streams[0], "/google.storage.v2.Storage/ReadObject", opts...) - if err != nil { - return nil, err - } - x := &storageReadObjectClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Storage_ReadObjectClient interface { - Recv() (*ReadObjectResponse, error) - grpc.ClientStream -} - -type storageReadObjectClient struct { - grpc.ClientStream -} - -func (x *storageReadObjectClient) Recv() (*ReadObjectResponse, error) { - m := new(ReadObjectResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *storageClient) BidiReadObject(ctx context.Context, opts ...grpc.CallOption) (Storage_BidiReadObjectClient, error) { - stream, err := c.cc.NewStream(ctx, &_Storage_serviceDesc.Streams[1], "/google.storage.v2.Storage/BidiReadObject", opts...) - if err != nil { - return nil, err - } - x := &storageBidiReadObjectClient{stream} - return x, nil -} - -type Storage_BidiReadObjectClient interface { - Send(*BidiReadObjectRequest) error - Recv() (*BidiReadObjectResponse, error) - grpc.ClientStream -} - -type storageBidiReadObjectClient struct { - grpc.ClientStream -} - -func (x *storageBidiReadObjectClient) Send(m *BidiReadObjectRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *storageBidiReadObjectClient) Recv() (*BidiReadObjectResponse, error) { - m := new(BidiReadObjectResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *storageClient) UpdateObject(ctx context.Context, in *UpdateObjectRequest, opts ...grpc.CallOption) (*Object, error) { - out := new(Object) - err := c.cc.Invoke(ctx, "/google.storage.v2.Storage/UpdateObject", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *storageClient) WriteObject(ctx context.Context, opts ...grpc.CallOption) (Storage_WriteObjectClient, error) { - stream, err := c.cc.NewStream(ctx, &_Storage_serviceDesc.Streams[2], "/google.storage.v2.Storage/WriteObject", opts...) - if err != nil { - return nil, err - } - x := &storageWriteObjectClient{stream} - return x, nil -} - -type Storage_WriteObjectClient interface { - Send(*WriteObjectRequest) error - CloseAndRecv() (*WriteObjectResponse, error) - grpc.ClientStream -} - -type storageWriteObjectClient struct { - grpc.ClientStream -} - -func (x *storageWriteObjectClient) Send(m *WriteObjectRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *storageWriteObjectClient) CloseAndRecv() (*WriteObjectResponse, error) { - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - m := new(WriteObjectResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *storageClient) BidiWriteObject(ctx context.Context, opts ...grpc.CallOption) (Storage_BidiWriteObjectClient, error) { - stream, err := c.cc.NewStream(ctx, &_Storage_serviceDesc.Streams[3], "/google.storage.v2.Storage/BidiWriteObject", opts...) - if err != nil { - return nil, err - } - x := &storageBidiWriteObjectClient{stream} - return x, nil -} - -type Storage_BidiWriteObjectClient interface { - Send(*BidiWriteObjectRequest) error - Recv() (*BidiWriteObjectResponse, error) - grpc.ClientStream -} - -type storageBidiWriteObjectClient struct { - grpc.ClientStream -} - -func (x *storageBidiWriteObjectClient) Send(m *BidiWriteObjectRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *storageBidiWriteObjectClient) Recv() (*BidiWriteObjectResponse, error) { - m := new(BidiWriteObjectResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *storageClient) ListObjects(ctx context.Context, in *ListObjectsRequest, opts ...grpc.CallOption) (*ListObjectsResponse, error) { - out := new(ListObjectsResponse) - err := c.cc.Invoke(ctx, "/google.storage.v2.Storage/ListObjects", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *storageClient) RewriteObject(ctx context.Context, in *RewriteObjectRequest, opts ...grpc.CallOption) (*RewriteResponse, error) { - out := new(RewriteResponse) - err := c.cc.Invoke(ctx, "/google.storage.v2.Storage/RewriteObject", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *storageClient) StartResumableWrite(ctx context.Context, in *StartResumableWriteRequest, opts ...grpc.CallOption) (*StartResumableWriteResponse, error) { - out := new(StartResumableWriteResponse) - err := c.cc.Invoke(ctx, "/google.storage.v2.Storage/StartResumableWrite", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *storageClient) QueryWriteStatus(ctx context.Context, in *QueryWriteStatusRequest, opts ...grpc.CallOption) (*QueryWriteStatusResponse, error) { - out := new(QueryWriteStatusResponse) - err := c.cc.Invoke(ctx, "/google.storage.v2.Storage/QueryWriteStatus", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *storageClient) MoveObject(ctx context.Context, in *MoveObjectRequest, opts ...grpc.CallOption) (*Object, error) { - out := new(Object) - err := c.cc.Invoke(ctx, "/google.storage.v2.Storage/MoveObject", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// StorageServer is the server API for Storage service. -type StorageServer interface { - // Permanently deletes an empty bucket. - DeleteBucket(context.Context, *DeleteBucketRequest) (*emptypb.Empty, error) - // Returns metadata for the specified bucket. - GetBucket(context.Context, *GetBucketRequest) (*Bucket, error) - // Creates a new bucket. - CreateBucket(context.Context, *CreateBucketRequest) (*Bucket, error) - // Retrieves a list of buckets for a given project. - ListBuckets(context.Context, *ListBucketsRequest) (*ListBucketsResponse, error) - // Locks retention policy on a bucket. - LockBucketRetentionPolicy(context.Context, *LockBucketRetentionPolicyRequest) (*Bucket, error) - // Gets the IAM policy for a specified bucket. - // The `resource` field in the request should be - // `projects/_/buckets/{bucket}` for a bucket, or - // `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` - // for a managed folder. - GetIamPolicy(context.Context, *iampb.GetIamPolicyRequest) (*iampb.Policy, error) - // Updates an IAM policy for the specified bucket. - // The `resource` field in the request should be - // `projects/_/buckets/{bucket}` for a bucket, or - // `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` - // for a managed folder. - SetIamPolicy(context.Context, *iampb.SetIamPolicyRequest) (*iampb.Policy, error) - // Tests a set of permissions on the given bucket, object, or managed folder - // to see which, if any, are held by the caller. - // The `resource` field in the request should be - // `projects/_/buckets/{bucket}` for a bucket, - // `projects/_/buckets/{bucket}/objects/{object}` for an object, or - // `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` - // for a managed folder. - TestIamPermissions(context.Context, *iampb.TestIamPermissionsRequest) (*iampb.TestIamPermissionsResponse, error) - // Updates a bucket. Equivalent to JSON API's storage.buckets.patch method. - UpdateBucket(context.Context, *UpdateBucketRequest) (*Bucket, error) - // Concatenates a list of existing objects into a new object in the same - // bucket. - ComposeObject(context.Context, *ComposeObjectRequest) (*Object, error) - // Deletes an object and its metadata. Deletions are permanent if versioning - // is not enabled for the bucket, or if the generation parameter is used, or - // if [soft delete](https://cloud.google.com/storage/docs/soft-delete) is not - // enabled for the bucket. - // When this API is used to delete an object from a bucket that has soft - // delete policy enabled, the object becomes soft deleted, and the - // `softDeleteTime` and `hardDeleteTime` properties are set on the object. - // This API cannot be used to permanently delete soft-deleted objects. - // Soft-deleted objects are permanently deleted according to their - // `hardDeleteTime`. - // - // You can use the [`RestoreObject`][google.storage.v2.Storage.RestoreObject] - // API to restore soft-deleted objects until the soft delete retention period - // has passed. - // - // **IAM Permissions**: - // - // Requires `storage.objects.delete` - // [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on - // the bucket. - DeleteObject(context.Context, *DeleteObjectRequest) (*emptypb.Empty, error) - // Restores a soft-deleted object. - RestoreObject(context.Context, *RestoreObjectRequest) (*Object, error) - // Cancels an in-progress resumable upload. - // - // Any attempts to write to the resumable upload after cancelling the upload - // will fail. - // - // The behavior for currently in progress write operations is not guaranteed - - // they could either complete before the cancellation or fail if the - // cancellation completes first. - CancelResumableWrite(context.Context, *CancelResumableWriteRequest) (*CancelResumableWriteResponse, error) - // Retrieves object metadata. - // - // **IAM Permissions**: - // - // Requires `storage.objects.get` - // [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on - // the bucket. To return object ACLs, the authenticated user must also have - // the `storage.objects.getIamPolicy` permission. - GetObject(context.Context, *GetObjectRequest) (*Object, error) - // Retrieves object data. - // - // **IAM Permissions**: - // - // Requires `storage.objects.get` - // [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on - // the bucket. - ReadObject(*ReadObjectRequest, Storage_ReadObjectServer) error - // Reads an object's data. - // - // This is a bi-directional API with the added support for reading multiple - // ranges within one stream both within and across multiple messages. - // If the server encountered an error for any of the inputs, the stream will - // be closed with the relevant error code. - // Because the API allows for multiple outstanding requests, when the stream - // is closed the error response will contain a BidiReadObjectRangesError proto - // in the error extension describing the error for each outstanding read_id. - // - // **IAM Permissions**: - // - // Requires `storage.objects.get` - // - // [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on - // the bucket. - // - // This API is currently in preview and is not yet available for general - // use. - BidiReadObject(Storage_BidiReadObjectServer) error - // Updates an object's metadata. - // Equivalent to JSON API's storage.objects.patch. - UpdateObject(context.Context, *UpdateObjectRequest) (*Object, error) - // Stores a new object and metadata. - // - // An object can be written either in a single message stream or in a - // resumable sequence of message streams. To write using a single stream, - // the client should include in the first message of the stream an - // `WriteObjectSpec` describing the destination bucket, object, and any - // preconditions. Additionally, the final message must set 'finish_write' to - // true, or else it is an error. - // - // For a resumable write, the client should instead call - // `StartResumableWrite()`, populating a `WriteObjectSpec` into that request. - // They should then attach the returned `upload_id` to the first message of - // each following call to `WriteObject`. If the stream is closed before - // finishing the upload (either explicitly by the client or due to a network - // error or an error response from the server), the client should do as - // follows: - // - Check the result Status of the stream, to determine if writing can be - // resumed on this stream or must be restarted from scratch (by calling - // `StartResumableWrite()`). The resumable errors are DEADLINE_EXCEEDED, - // INTERNAL, and UNAVAILABLE. For each case, the client should use binary - // exponential backoff before retrying. Additionally, writes can be - // resumed after RESOURCE_EXHAUSTED errors, but only after taking - // appropriate measures, which may include reducing aggregate send rate - // across clients and/or requesting a quota increase for your project. - // - If the call to `WriteObject` returns `ABORTED`, that indicates - // concurrent attempts to update the resumable write, caused either by - // multiple racing clients or by a single client where the previous - // request was timed out on the client side but nonetheless reached the - // server. In this case the client should take steps to prevent further - // concurrent writes (e.g., increase the timeouts, stop using more than - // one process to perform the upload, etc.), and then should follow the - // steps below for resuming the upload. - // - For resumable errors, the client should call `QueryWriteStatus()` and - // then continue writing from the returned `persisted_size`. This may be - // less than the amount of data the client previously sent. Note also that - // it is acceptable to send data starting at an offset earlier than the - // returned `persisted_size`; in this case, the service will skip data at - // offsets that were already persisted (without checking that it matches - // the previously written data), and write only the data starting from the - // persisted offset. Even though the data isn't written, it may still - // incur a performance cost over resuming at the correct write offset. - // This behavior can make client-side handling simpler in some cases. - // - Clients must only send data that is a multiple of 256 KiB per message, - // unless the object is being finished with `finish_write` set to `true`. - // - // The service will not view the object as complete until the client has - // sent a `WriteObjectRequest` with `finish_write` set to `true`. Sending any - // requests on a stream after sending a request with `finish_write` set to - // `true` will cause an error. The client **should** check the response it - // receives to determine how much data the service was able to commit and - // whether the service views the object as complete. - // - // Attempting to resume an already finalized object will result in an OK - // status, with a `WriteObjectResponse` containing the finalized object's - // metadata. - // - // Alternatively, the BidiWriteObject operation may be used to write an - // object with controls over flushing and the ability to fetch the ability to - // determine the current persisted size. - // - // **IAM Permissions**: - // - // Requires `storage.objects.create` - // [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on - // the bucket. - WriteObject(Storage_WriteObjectServer) error - // Stores a new object and metadata. - // - // This is similar to the WriteObject call with the added support for - // manual flushing of persisted state, and the ability to determine current - // persisted size without closing the stream. - // - // The client may specify one or both of the `state_lookup` and `flush` fields - // in each BidiWriteObjectRequest. If `flush` is specified, the data written - // so far will be persisted to storage. If `state_lookup` is specified, the - // service will respond with a BidiWriteObjectResponse that contains the - // persisted size. If both `flush` and `state_lookup` are specified, the flush - // will always occur before a `state_lookup`, so that both may be set in the - // same request and the returned state will be the state of the object - // post-flush. When the stream is closed, a BidiWriteObjectResponse will - // always be sent to the client, regardless of the value of `state_lookup`. - BidiWriteObject(Storage_BidiWriteObjectServer) error - // Retrieves a list of objects matching the criteria. - // - // **IAM Permissions**: - // - // The authenticated user requires `storage.objects.list` - // [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) - // to use this method. To return object ACLs, the authenticated user must also - // have the `storage.objects.getIamPolicy` permission. - ListObjects(context.Context, *ListObjectsRequest) (*ListObjectsResponse, error) - // Rewrites a source object to a destination object. Optionally overrides - // metadata. - RewriteObject(context.Context, *RewriteObjectRequest) (*RewriteResponse, error) - // Starts a resumable write operation. This - // method is part of the [Resumable - // upload](https://cloud.google.com/storage/docs/resumable-uploads) feature. - // This allows you to upload large objects in multiple chunks, which is more - // resilient to network interruptions than a single upload. The validity - // duration of the write operation, and the consequences of it becoming - // invalid, are service-dependent. - // - // **IAM Permissions**: - // - // Requires `storage.objects.create` - // [IAM permission](https://cloud.google.com/iam/docs/overview#permissions) on - // the bucket. - StartResumableWrite(context.Context, *StartResumableWriteRequest) (*StartResumableWriteResponse, error) - // Determines the `persisted_size` of an object that is being written. This - // method is part of the [resumable - // upload](https://cloud.google.com/storage/docs/resumable-uploads) feature. - // The returned value is the size of the object that has been persisted so - // far. The value can be used as the `write_offset` for the next `Write()` - // call. - // - // If the object does not exist, meaning if it was deleted, or the - // first `Write()` has not yet reached the service, this method returns the - // error `NOT_FOUND`. - // - // This method is useful for clients that buffer data and need to know which - // data can be safely evicted. The client can call `QueryWriteStatus()` at any - // time to determine how much data has been logged for this object. - // For any sequence of `QueryWriteStatus()` calls for a given - // object name, the sequence of returned `persisted_size` values are - // non-decreasing. - QueryWriteStatus(context.Context, *QueryWriteStatusRequest) (*QueryWriteStatusResponse, error) - // Moves the source object to the destination object in the same bucket. - MoveObject(context.Context, *MoveObjectRequest) (*Object, error) -} - -// UnimplementedStorageServer can be embedded to have forward compatible implementations. -type UnimplementedStorageServer struct { -} - -func (*UnimplementedStorageServer) DeleteBucket(context.Context, *DeleteBucketRequest) (*emptypb.Empty, error) { - return nil, status1.Errorf(codes.Unimplemented, "method DeleteBucket not implemented") -} -func (*UnimplementedStorageServer) GetBucket(context.Context, *GetBucketRequest) (*Bucket, error) { - return nil, status1.Errorf(codes.Unimplemented, "method GetBucket not implemented") -} -func (*UnimplementedStorageServer) CreateBucket(context.Context, *CreateBucketRequest) (*Bucket, error) { - return nil, status1.Errorf(codes.Unimplemented, "method CreateBucket not implemented") -} -func (*UnimplementedStorageServer) ListBuckets(context.Context, *ListBucketsRequest) (*ListBucketsResponse, error) { - return nil, status1.Errorf(codes.Unimplemented, "method ListBuckets not implemented") -} -func (*UnimplementedStorageServer) LockBucketRetentionPolicy(context.Context, *LockBucketRetentionPolicyRequest) (*Bucket, error) { - return nil, status1.Errorf(codes.Unimplemented, "method LockBucketRetentionPolicy not implemented") -} -func (*UnimplementedStorageServer) GetIamPolicy(context.Context, *iampb.GetIamPolicyRequest) (*iampb.Policy, error) { - return nil, status1.Errorf(codes.Unimplemented, "method GetIamPolicy not implemented") -} -func (*UnimplementedStorageServer) SetIamPolicy(context.Context, *iampb.SetIamPolicyRequest) (*iampb.Policy, error) { - return nil, status1.Errorf(codes.Unimplemented, "method SetIamPolicy not implemented") -} -func (*UnimplementedStorageServer) TestIamPermissions(context.Context, *iampb.TestIamPermissionsRequest) (*iampb.TestIamPermissionsResponse, error) { - return nil, status1.Errorf(codes.Unimplemented, "method TestIamPermissions not implemented") -} -func (*UnimplementedStorageServer) UpdateBucket(context.Context, *UpdateBucketRequest) (*Bucket, error) { - return nil, status1.Errorf(codes.Unimplemented, "method UpdateBucket not implemented") -} -func (*UnimplementedStorageServer) ComposeObject(context.Context, *ComposeObjectRequest) (*Object, error) { - return nil, status1.Errorf(codes.Unimplemented, "method ComposeObject not implemented") -} -func (*UnimplementedStorageServer) DeleteObject(context.Context, *DeleteObjectRequest) (*emptypb.Empty, error) { - return nil, status1.Errorf(codes.Unimplemented, "method DeleteObject not implemented") -} -func (*UnimplementedStorageServer) RestoreObject(context.Context, *RestoreObjectRequest) (*Object, error) { - return nil, status1.Errorf(codes.Unimplemented, "method RestoreObject not implemented") -} -func (*UnimplementedStorageServer) CancelResumableWrite(context.Context, *CancelResumableWriteRequest) (*CancelResumableWriteResponse, error) { - return nil, status1.Errorf(codes.Unimplemented, "method CancelResumableWrite not implemented") -} -func (*UnimplementedStorageServer) GetObject(context.Context, *GetObjectRequest) (*Object, error) { - return nil, status1.Errorf(codes.Unimplemented, "method GetObject not implemented") -} -func (*UnimplementedStorageServer) ReadObject(*ReadObjectRequest, Storage_ReadObjectServer) error { - return status1.Errorf(codes.Unimplemented, "method ReadObject not implemented") -} -func (*UnimplementedStorageServer) BidiReadObject(Storage_BidiReadObjectServer) error { - return status1.Errorf(codes.Unimplemented, "method BidiReadObject not implemented") -} -func (*UnimplementedStorageServer) UpdateObject(context.Context, *UpdateObjectRequest) (*Object, error) { - return nil, status1.Errorf(codes.Unimplemented, "method UpdateObject not implemented") -} -func (*UnimplementedStorageServer) WriteObject(Storage_WriteObjectServer) error { - return status1.Errorf(codes.Unimplemented, "method WriteObject not implemented") -} -func (*UnimplementedStorageServer) BidiWriteObject(Storage_BidiWriteObjectServer) error { - return status1.Errorf(codes.Unimplemented, "method BidiWriteObject not implemented") -} -func (*UnimplementedStorageServer) ListObjects(context.Context, *ListObjectsRequest) (*ListObjectsResponse, error) { - return nil, status1.Errorf(codes.Unimplemented, "method ListObjects not implemented") -} -func (*UnimplementedStorageServer) RewriteObject(context.Context, *RewriteObjectRequest) (*RewriteResponse, error) { - return nil, status1.Errorf(codes.Unimplemented, "method RewriteObject not implemented") -} -func (*UnimplementedStorageServer) StartResumableWrite(context.Context, *StartResumableWriteRequest) (*StartResumableWriteResponse, error) { - return nil, status1.Errorf(codes.Unimplemented, "method StartResumableWrite not implemented") -} -func (*UnimplementedStorageServer) QueryWriteStatus(context.Context, *QueryWriteStatusRequest) (*QueryWriteStatusResponse, error) { - return nil, status1.Errorf(codes.Unimplemented, "method QueryWriteStatus not implemented") -} -func (*UnimplementedStorageServer) MoveObject(context.Context, *MoveObjectRequest) (*Object, error) { - return nil, status1.Errorf(codes.Unimplemented, "method MoveObject not implemented") -} - -func RegisterStorageServer(s *grpc.Server, srv StorageServer) { - s.RegisterService(&_Storage_serviceDesc, srv) -} - -func _Storage_DeleteBucket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteBucketRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StorageServer).DeleteBucket(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.storage.v2.Storage/DeleteBucket", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StorageServer).DeleteBucket(ctx, req.(*DeleteBucketRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Storage_GetBucket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetBucketRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StorageServer).GetBucket(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.storage.v2.Storage/GetBucket", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StorageServer).GetBucket(ctx, req.(*GetBucketRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Storage_CreateBucket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateBucketRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StorageServer).CreateBucket(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.storage.v2.Storage/CreateBucket", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StorageServer).CreateBucket(ctx, req.(*CreateBucketRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Storage_ListBuckets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListBucketsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StorageServer).ListBuckets(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.storage.v2.Storage/ListBuckets", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StorageServer).ListBuckets(ctx, req.(*ListBucketsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Storage_LockBucketRetentionPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(LockBucketRetentionPolicyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StorageServer).LockBucketRetentionPolicy(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.storage.v2.Storage/LockBucketRetentionPolicy", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StorageServer).LockBucketRetentionPolicy(ctx, req.(*LockBucketRetentionPolicyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Storage_GetIamPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(iampb.GetIamPolicyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StorageServer).GetIamPolicy(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.storage.v2.Storage/GetIamPolicy", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StorageServer).GetIamPolicy(ctx, req.(*iampb.GetIamPolicyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Storage_SetIamPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(iampb.SetIamPolicyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StorageServer).SetIamPolicy(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.storage.v2.Storage/SetIamPolicy", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StorageServer).SetIamPolicy(ctx, req.(*iampb.SetIamPolicyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Storage_TestIamPermissions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(iampb.TestIamPermissionsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StorageServer).TestIamPermissions(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.storage.v2.Storage/TestIamPermissions", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StorageServer).TestIamPermissions(ctx, req.(*iampb.TestIamPermissionsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Storage_UpdateBucket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateBucketRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StorageServer).UpdateBucket(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.storage.v2.Storage/UpdateBucket", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StorageServer).UpdateBucket(ctx, req.(*UpdateBucketRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Storage_ComposeObject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ComposeObjectRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StorageServer).ComposeObject(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.storage.v2.Storage/ComposeObject", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StorageServer).ComposeObject(ctx, req.(*ComposeObjectRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Storage_DeleteObject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteObjectRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StorageServer).DeleteObject(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.storage.v2.Storage/DeleteObject", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StorageServer).DeleteObject(ctx, req.(*DeleteObjectRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Storage_RestoreObject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RestoreObjectRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StorageServer).RestoreObject(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.storage.v2.Storage/RestoreObject", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StorageServer).RestoreObject(ctx, req.(*RestoreObjectRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Storage_CancelResumableWrite_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CancelResumableWriteRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StorageServer).CancelResumableWrite(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.storage.v2.Storage/CancelResumableWrite", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StorageServer).CancelResumableWrite(ctx, req.(*CancelResumableWriteRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Storage_GetObject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetObjectRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StorageServer).GetObject(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.storage.v2.Storage/GetObject", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StorageServer).GetObject(ctx, req.(*GetObjectRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Storage_ReadObject_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(ReadObjectRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(StorageServer).ReadObject(m, &storageReadObjectServer{stream}) -} - -type Storage_ReadObjectServer interface { - Send(*ReadObjectResponse) error - grpc.ServerStream -} - -type storageReadObjectServer struct { - grpc.ServerStream -} - -func (x *storageReadObjectServer) Send(m *ReadObjectResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _Storage_BidiReadObject_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(StorageServer).BidiReadObject(&storageBidiReadObjectServer{stream}) -} - -type Storage_BidiReadObjectServer interface { - Send(*BidiReadObjectResponse) error - Recv() (*BidiReadObjectRequest, error) - grpc.ServerStream -} - -type storageBidiReadObjectServer struct { - grpc.ServerStream -} - -func (x *storageBidiReadObjectServer) Send(m *BidiReadObjectResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *storageBidiReadObjectServer) Recv() (*BidiReadObjectRequest, error) { - m := new(BidiReadObjectRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _Storage_UpdateObject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateObjectRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StorageServer).UpdateObject(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.storage.v2.Storage/UpdateObject", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StorageServer).UpdateObject(ctx, req.(*UpdateObjectRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Storage_WriteObject_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(StorageServer).WriteObject(&storageWriteObjectServer{stream}) -} - -type Storage_WriteObjectServer interface { - SendAndClose(*WriteObjectResponse) error - Recv() (*WriteObjectRequest, error) - grpc.ServerStream -} - -type storageWriteObjectServer struct { - grpc.ServerStream -} - -func (x *storageWriteObjectServer) SendAndClose(m *WriteObjectResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *storageWriteObjectServer) Recv() (*WriteObjectRequest, error) { - m := new(WriteObjectRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _Storage_BidiWriteObject_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(StorageServer).BidiWriteObject(&storageBidiWriteObjectServer{stream}) -} - -type Storage_BidiWriteObjectServer interface { - Send(*BidiWriteObjectResponse) error - Recv() (*BidiWriteObjectRequest, error) - grpc.ServerStream -} - -type storageBidiWriteObjectServer struct { - grpc.ServerStream -} - -func (x *storageBidiWriteObjectServer) Send(m *BidiWriteObjectResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *storageBidiWriteObjectServer) Recv() (*BidiWriteObjectRequest, error) { - m := new(BidiWriteObjectRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _Storage_ListObjects_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListObjectsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StorageServer).ListObjects(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.storage.v2.Storage/ListObjects", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StorageServer).ListObjects(ctx, req.(*ListObjectsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Storage_RewriteObject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RewriteObjectRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StorageServer).RewriteObject(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.storage.v2.Storage/RewriteObject", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StorageServer).RewriteObject(ctx, req.(*RewriteObjectRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Storage_StartResumableWrite_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StartResumableWriteRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StorageServer).StartResumableWrite(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.storage.v2.Storage/StartResumableWrite", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StorageServer).StartResumableWrite(ctx, req.(*StartResumableWriteRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Storage_QueryWriteStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryWriteStatusRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StorageServer).QueryWriteStatus(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.storage.v2.Storage/QueryWriteStatus", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StorageServer).QueryWriteStatus(ctx, req.(*QueryWriteStatusRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Storage_MoveObject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MoveObjectRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StorageServer).MoveObject(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.storage.v2.Storage/MoveObject", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StorageServer).MoveObject(ctx, req.(*MoveObjectRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Storage_serviceDesc = grpc.ServiceDesc{ - ServiceName: "google.storage.v2.Storage", - HandlerType: (*StorageServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "DeleteBucket", - Handler: _Storage_DeleteBucket_Handler, - }, - { - MethodName: "GetBucket", - Handler: _Storage_GetBucket_Handler, - }, - { - MethodName: "CreateBucket", - Handler: _Storage_CreateBucket_Handler, - }, - { - MethodName: "ListBuckets", - Handler: _Storage_ListBuckets_Handler, - }, - { - MethodName: "LockBucketRetentionPolicy", - Handler: _Storage_LockBucketRetentionPolicy_Handler, - }, - { - MethodName: "GetIamPolicy", - Handler: _Storage_GetIamPolicy_Handler, - }, - { - MethodName: "SetIamPolicy", - Handler: _Storage_SetIamPolicy_Handler, - }, - { - MethodName: "TestIamPermissions", - Handler: _Storage_TestIamPermissions_Handler, - }, - { - MethodName: "UpdateBucket", - Handler: _Storage_UpdateBucket_Handler, - }, - { - MethodName: "ComposeObject", - Handler: _Storage_ComposeObject_Handler, - }, - { - MethodName: "DeleteObject", - Handler: _Storage_DeleteObject_Handler, - }, - { - MethodName: "RestoreObject", - Handler: _Storage_RestoreObject_Handler, - }, - { - MethodName: "CancelResumableWrite", - Handler: _Storage_CancelResumableWrite_Handler, - }, - { - MethodName: "GetObject", - Handler: _Storage_GetObject_Handler, - }, - { - MethodName: "UpdateObject", - Handler: _Storage_UpdateObject_Handler, - }, - { - MethodName: "ListObjects", - Handler: _Storage_ListObjects_Handler, - }, - { - MethodName: "RewriteObject", - Handler: _Storage_RewriteObject_Handler, - }, - { - MethodName: "StartResumableWrite", - Handler: _Storage_StartResumableWrite_Handler, - }, - { - MethodName: "QueryWriteStatus", - Handler: _Storage_QueryWriteStatus_Handler, - }, - { - MethodName: "MoveObject", - Handler: _Storage_MoveObject_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "ReadObject", - Handler: _Storage_ReadObject_Handler, - ServerStreams: true, - }, - { - StreamName: "BidiReadObject", - Handler: _Storage_BidiReadObject_Handler, - ServerStreams: true, - ClientStreams: true, - }, - { - StreamName: "WriteObject", - Handler: _Storage_WriteObject_Handler, - ClientStreams: true, - }, - { - StreamName: "BidiWriteObject", - Handler: _Storage_BidiWriteObject_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "google/storage/v2/storage.proto", -} diff --git a/vendor/cloud.google.com/go/storage/internal/apiv2/storagepb/storage_grpc.pb.go b/vendor/cloud.google.com/go/storage/internal/apiv2/storagepb/storage_grpc.pb.go new file mode 100644 index 00000000000..e1c9161c272 --- /dev/null +++ b/vendor/cloud.google.com/go/storage/internal/apiv2/storagepb/storage_grpc.pb.go @@ -0,0 +1,1799 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.7 +// source: google/storage/v2/storage.proto + +package storagepb + +import ( + context "context" + + iampb "cloud.google.com/go/iam/apiv1/iampb" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Storage_DeleteBucket_FullMethodName = "/google.storage.v2.Storage/DeleteBucket" + Storage_GetBucket_FullMethodName = "/google.storage.v2.Storage/GetBucket" + Storage_CreateBucket_FullMethodName = "/google.storage.v2.Storage/CreateBucket" + Storage_ListBuckets_FullMethodName = "/google.storage.v2.Storage/ListBuckets" + Storage_LockBucketRetentionPolicy_FullMethodName = "/google.storage.v2.Storage/LockBucketRetentionPolicy" + Storage_GetIamPolicy_FullMethodName = "/google.storage.v2.Storage/GetIamPolicy" + Storage_SetIamPolicy_FullMethodName = "/google.storage.v2.Storage/SetIamPolicy" + Storage_TestIamPermissions_FullMethodName = "/google.storage.v2.Storage/TestIamPermissions" + Storage_UpdateBucket_FullMethodName = "/google.storage.v2.Storage/UpdateBucket" + Storage_ComposeObject_FullMethodName = "/google.storage.v2.Storage/ComposeObject" + Storage_DeleteObject_FullMethodName = "/google.storage.v2.Storage/DeleteObject" + Storage_RestoreObject_FullMethodName = "/google.storage.v2.Storage/RestoreObject" + Storage_CancelResumableWrite_FullMethodName = "/google.storage.v2.Storage/CancelResumableWrite" + Storage_GetObject_FullMethodName = "/google.storage.v2.Storage/GetObject" + Storage_ReadObject_FullMethodName = "/google.storage.v2.Storage/ReadObject" + Storage_BidiReadObject_FullMethodName = "/google.storage.v2.Storage/BidiReadObject" + Storage_UpdateObject_FullMethodName = "/google.storage.v2.Storage/UpdateObject" + Storage_WriteObject_FullMethodName = "/google.storage.v2.Storage/WriteObject" + Storage_BidiWriteObject_FullMethodName = "/google.storage.v2.Storage/BidiWriteObject" + Storage_ListObjects_FullMethodName = "/google.storage.v2.Storage/ListObjects" + Storage_RewriteObject_FullMethodName = "/google.storage.v2.Storage/RewriteObject" + Storage_StartResumableWrite_FullMethodName = "/google.storage.v2.Storage/StartResumableWrite" + Storage_QueryWriteStatus_FullMethodName = "/google.storage.v2.Storage/QueryWriteStatus" + Storage_MoveObject_FullMethodName = "/google.storage.v2.Storage/MoveObject" +) + +// StorageClient is the client API for Storage service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type StorageClient interface { + // Permanently deletes an empty bucket. + // The request fails if there are any live or + // noncurrent objects in the bucket, but the request succeeds if the + // bucket only contains soft-deleted objects or incomplete uploads, such + // as ongoing XML API multipart uploads. Does not permanently delete + // soft-deleted objects. + // + // When this API is used to delete a bucket containing an object that has a + // soft delete policy + // enabled, the object becomes soft deleted, and the + // `softDeleteTime` and `hardDeleteTime` properties are set on the + // object. + // + // Objects and multipart uploads that were in the bucket at the time of + // deletion are also retained for the specified retention duration. When + // a soft-deleted bucket reaches the end of its retention duration, it + // is permanently deleted. The `hardDeleteTime` of the bucket always + // equals + // or exceeds the expiration time of the last soft-deleted object in the + // bucket. + // + // **IAM Permissions**: + // + // Requires `storage.buckets.delete` IAM permission on the bucket. + DeleteBucket(ctx context.Context, in *DeleteBucketRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Returns metadata for the specified bucket. + // + // **IAM Permissions**: + // + // Requires `storage.buckets.get` + // IAM permission on + // the bucket. Additionally, to return specific bucket metadata, the + // authenticated user must have the following permissions: + // + // - To return the IAM policies: `storage.buckets.getIamPolicy` + // - To return the bucket IP filtering rules: `storage.buckets.getIpFilter` + GetBucket(ctx context.Context, in *GetBucketRequest, opts ...grpc.CallOption) (*Bucket, error) + // Creates a new bucket. + // + // **IAM Permissions**: + // + // Requires `storage.buckets.create` IAM permission on the bucket. + // Additionally, to enable specific bucket features, the authenticated user + // must have the following permissions: + // + // - To enable object retention using the `enableObjectRetention` query + // parameter: `storage.buckets.enableObjectRetention` + // - To set the bucket IP filtering rules: `storage.buckets.setIpFilter` + CreateBucket(ctx context.Context, in *CreateBucketRequest, opts ...grpc.CallOption) (*Bucket, error) + // Retrieves a list of buckets for a given project, ordered + // lexicographically by name. + // + // **IAM Permissions**: + // + // Requires `storage.buckets.list` IAM permission on the bucket. + // Additionally, to enable specific bucket features, the authenticated + // user must have the following permissions: + // + // - To list the IAM policies: `storage.buckets.getIamPolicy` + // - To list the bucket IP filtering rules: `storage.buckets.getIpFilter` + ListBuckets(ctx context.Context, in *ListBucketsRequest, opts ...grpc.CallOption) (*ListBucketsResponse, error) + // Permanently locks the retention + // policy that is + // currently applied to the specified bucket. + // + // Caution: Locking a bucket is an + // irreversible action. Once you lock a bucket: + // + // - You cannot remove the retention policy from the bucket. + // - You cannot decrease the retention period for the policy. + // + // Once locked, you must delete the entire bucket in order to remove the + // bucket's retention policy. However, before you can delete the bucket, you + // must delete all the objects in the bucket, which is only + // possible if all the objects have reached the retention period set by the + // retention policy. + // + // **IAM Permissions**: + // + // Requires `storage.buckets.update` IAM permission on the bucket. + LockBucketRetentionPolicy(ctx context.Context, in *LockBucketRetentionPolicyRequest, opts ...grpc.CallOption) (*Bucket, error) + // Gets the IAM policy for a specified bucket or managed folder. + // The `resource` field in the request should be + // `projects/_/buckets/{bucket}` for a bucket, or + // `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` + // for a managed folder. + // + // **IAM Permissions**: + // + // Requires `storage.buckets.getIamPolicy` on the bucket or + // `storage.managedFolders.getIamPolicy` IAM permission on the + // managed folder. + GetIamPolicy(ctx context.Context, in *iampb.GetIamPolicyRequest, opts ...grpc.CallOption) (*iampb.Policy, error) + // Updates an IAM policy for the specified bucket or managed folder. + // The `resource` field in the request should be + // `projects/_/buckets/{bucket}` for a bucket, or + // `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` + // for a managed folder. + SetIamPolicy(ctx context.Context, in *iampb.SetIamPolicyRequest, opts ...grpc.CallOption) (*iampb.Policy, error) + // Tests a set of permissions on the given bucket, object, or managed folder + // to see which, if any, are held by the caller. The `resource` field in the + // request should be `projects/_/buckets/{bucket}` for a bucket, + // `projects/_/buckets/{bucket}/objects/{object}` for an object, or + // `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` + // for a managed folder. + TestIamPermissions(ctx context.Context, in *iampb.TestIamPermissionsRequest, opts ...grpc.CallOption) (*iampb.TestIamPermissionsResponse, error) + // Updates a bucket. Changes to the bucket are readable immediately after + // writing, but configuration changes might take time to propagate. This + // method supports `patch` semantics. + // + // **IAM Permissions**: + // + // Requires `storage.buckets.update` IAM permission on the bucket. + // Additionally, to enable specific bucket features, the authenticated user + // must have the following permissions: + // + // - To set bucket IP filtering rules: `storage.buckets.setIpFilter` + // - To update public access prevention policies or access control lists + // (ACLs): `storage.buckets.setIamPolicy` + UpdateBucket(ctx context.Context, in *UpdateBucketRequest, opts ...grpc.CallOption) (*Bucket, error) + // Concatenates a list of existing objects into a new object in the same + // bucket. The existing source objects are unaffected by this operation. + // + // **IAM Permissions**: + // + // Requires the `storage.objects.create` and `storage.objects.get` IAM + // permissions to use this method. If the new composite object + // overwrites an existing object, the authenticated user must also have + // the `storage.objects.delete` permission. If the request body includes + // the retention property, the authenticated user must also have the + // `storage.objects.setRetention` IAM permission. + ComposeObject(ctx context.Context, in *ComposeObjectRequest, opts ...grpc.CallOption) (*Object, error) + // Deletes an object and its metadata. Deletions are permanent if versioning + // is not enabled for the bucket, or if the generation parameter is used, or + // if soft delete is not + // enabled for the bucket. + // When this API is used to delete an object from a bucket that has soft + // delete policy enabled, the object becomes soft deleted, and the + // `softDeleteTime` and `hardDeleteTime` properties are set on the object. + // This API cannot be used to permanently delete soft-deleted objects. + // Soft-deleted objects are permanently deleted according to their + // `hardDeleteTime`. + // + // You can use the [`RestoreObject`][google.storage.v2.Storage.RestoreObject] + // API to restore soft-deleted objects until the soft delete retention period + // has passed. + // + // **IAM Permissions**: + // + // Requires `storage.objects.delete` IAM permission on the bucket. + DeleteObject(ctx context.Context, in *DeleteObjectRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Restores a + // soft-deleted object. + // When a soft-deleted object is restored, a new copy of that object is + // created in the same bucket and inherits the same metadata as the + // soft-deleted object. The inherited metadata is the metadata that existed + // when the original object became soft deleted, with the following + // exceptions: + // + // - The `createTime` of the new object is set to the time at which the + // soft-deleted object was restored. + // - The `softDeleteTime` and `hardDeleteTime` values are cleared. + // - A new generation is assigned and the metageneration is reset to 1. + // - If the soft-deleted object was in a bucket that had Autoclass enabled, + // the new object is + // restored to Standard storage. + // - The restored object inherits the bucket's default object ACL, unless + // `copySourceAcl` is `true`. + // + // If a live object using the same name already exists in the bucket and + // becomes overwritten, the live object becomes a noncurrent object if Object + // Versioning is enabled on the bucket. If Object Versioning is not enabled, + // the live object becomes soft deleted. + // + // **IAM Permissions**: + // + // Requires the following IAM permissions to use this method: + // + // - `storage.objects.restore` + // - `storage.objects.create` + // - `storage.objects.delete` (only required if overwriting an existing + // object) + // - `storage.objects.getIamPolicy` (only required if `projection` is `full` + // and the relevant bucket + // has uniform bucket-level access disabled) + // - `storage.objects.setIamPolicy` (only required if `copySourceAcl` is + // `true` and the relevant + // bucket has uniform bucket-level access disabled) + RestoreObject(ctx context.Context, in *RestoreObjectRequest, opts ...grpc.CallOption) (*Object, error) + // Cancels an in-progress resumable upload. + // + // Any attempts to write to the resumable upload after cancelling the upload + // fail. + // + // The behavior for any in-progress write operations is not guaranteed; + // they could either complete before the cancellation or fail if the + // cancellation completes first. + CancelResumableWrite(ctx context.Context, in *CancelResumableWriteRequest, opts ...grpc.CallOption) (*CancelResumableWriteResponse, error) + // Retrieves object metadata. + // + // **IAM Permissions**: + // + // Requires `storage.objects.get` IAM permission on the bucket. + // To return object ACLs, the authenticated user must also have + // the `storage.objects.getIamPolicy` permission. + GetObject(ctx context.Context, in *GetObjectRequest, opts ...grpc.CallOption) (*Object, error) + // Retrieves object data. + // + // **IAM Permissions**: + // + // Requires `storage.objects.get` IAM permission on the bucket. + ReadObject(ctx context.Context, in *ReadObjectRequest, opts ...grpc.CallOption) (Storage_ReadObjectClient, error) + // Reads an object's data. + // + // This bi-directional API reads data from an object, allowing you to + // request multiple data ranges within a single stream, even across + // several messages. If an error occurs with any request, the stream + // closes with a relevant error code. Since you can have multiple + // outstanding requests, the error response includes a + // `BidiReadObjectRangesError` field detailing the specific error for + // each pending `read_id`. + // + // **IAM Permissions**: + // + // Requires `storage.objects.get` IAM permission on the bucket. + BidiReadObject(ctx context.Context, opts ...grpc.CallOption) (Storage_BidiReadObjectClient, error) + // Updates an object's metadata. + // Equivalent to JSON API's `storage.objects.patch` method. + // + // **IAM Permissions**: + // + // Requires `storage.objects.update` IAM permission on the bucket. + UpdateObject(ctx context.Context, in *UpdateObjectRequest, opts ...grpc.CallOption) (*Object, error) + // Stores a new object and metadata. + // + // An object can be written either in a single message stream or in a + // resumable sequence of message streams. To write using a single stream, + // the client should include in the first message of the stream an + // `WriteObjectSpec` describing the destination bucket, object, and any + // preconditions. Additionally, the final message must set 'finish_write' to + // true, or else it is an error. + // + // For a resumable write, the client should instead call + // `StartResumableWrite()`, populating a `WriteObjectSpec` into that request. + // They should then attach the returned `upload_id` to the first message of + // each following call to `WriteObject`. If the stream is closed before + // finishing the upload (either explicitly by the client or due to a network + // error or an error response from the server), the client should do as + // follows: + // + // - Check the result Status of the stream, to determine if writing can be + // resumed on this stream or must be restarted from scratch (by calling + // `StartResumableWrite()`). The resumable errors are `DEADLINE_EXCEEDED`, + // `INTERNAL`, and `UNAVAILABLE`. For each case, the client should use + // binary exponential backoff before retrying. Additionally, writes can + // be resumed after `RESOURCE_EXHAUSTED` errors, but only after taking + // appropriate measures, which might include reducing aggregate send rate + // across clients and/or requesting a quota increase for your project. + // - If the call to `WriteObject` returns `ABORTED`, that indicates + // concurrent attempts to update the resumable write, caused either by + // multiple racing clients or by a single client where the previous + // request was timed out on the client side but nonetheless reached the + // server. In this case the client should take steps to prevent further + // concurrent writes. For example, increase the timeouts and stop using + // more than one process to perform the upload. Follow the steps below for + // resuming the upload. + // - For resumable errors, the client should call `QueryWriteStatus()` and + // then continue writing from the returned `persisted_size`. This might be + // less than the amount of data the client previously sent. Note also that + // it is acceptable to send data starting at an offset earlier than the + // returned `persisted_size`; in this case, the service skips data at + // offsets that were already persisted (without checking that it matches + // the previously written data), and write only the data starting from the + // persisted offset. Even though the data isn't written, it might still + // incur a performance cost over resuming at the correct write offset. + // This behavior can make client-side handling simpler in some cases. + // - Clients must only send data that is a multiple of 256 KiB per message, + // unless the object is being finished with `finish_write` set to `true`. + // + // The service does not view the object as complete until the client has + // sent a `WriteObjectRequest` with `finish_write` set to `true`. Sending any + // requests on a stream after sending a request with `finish_write` set to + // `true` causes an error. The client must check the response it + // receives to determine how much data the service is able to commit and + // whether the service views the object as complete. + // + // Attempting to resume an already finalized object results in an `OK` + // status, with a `WriteObjectResponse` containing the finalized object's + // metadata. + // + // Alternatively, you can use the `BidiWriteObject` operation to write an + // object with controls over flushing and the ability to fetch the ability to + // determine the current persisted size. + // + // **IAM Permissions**: + // + // Requires `storage.objects.create` + // IAM permission on + // the bucket. + WriteObject(ctx context.Context, opts ...grpc.CallOption) (Storage_WriteObjectClient, error) + // Stores a new object and metadata. + // + // This is similar to the `WriteObject` call with the added support for + // manual flushing of persisted state, and the ability to determine current + // persisted size without closing the stream. + // + // The client might specify one or both of the `state_lookup` and `flush` + // fields in each `BidiWriteObjectRequest`. If `flush` is specified, the data + // written so far is persisted to storage. If `state_lookup` is specified, the + // service responds with a `BidiWriteObjectResponse` that contains the + // persisted size. If both `flush` and `state_lookup` are specified, the flush + // always occurs before a `state_lookup`, so that both might be set in the + // same request and the returned state is the state of the object + // post-flush. When the stream is closed, a `BidiWriteObjectResponse` + // is always sent to the client, regardless of the value of `state_lookup`. + BidiWriteObject(ctx context.Context, opts ...grpc.CallOption) (Storage_BidiWriteObjectClient, error) + // Retrieves a list of objects matching the criteria. + // + // **IAM Permissions**: + // + // The authenticated user requires `storage.objects.list` + // IAM permission to use this method. To return object ACLs, the + // authenticated user must also + // have the `storage.objects.getIamPolicy` permission. + ListObjects(ctx context.Context, in *ListObjectsRequest, opts ...grpc.CallOption) (*ListObjectsResponse, error) + // Rewrites a source object to a destination object. Optionally overrides + // metadata. + RewriteObject(ctx context.Context, in *RewriteObjectRequest, opts ...grpc.CallOption) (*RewriteResponse, error) + // Starts a resumable write operation. This + // method is part of the Resumable + // upload feature. + // This allows you to upload large objects in multiple chunks, which is more + // resilient to network interruptions than a single upload. The validity + // duration of the write operation, and the consequences of it becoming + // invalid, are service-dependent. + // + // **IAM Permissions**: + // + // Requires `storage.objects.create` IAM permission on the bucket. + StartResumableWrite(ctx context.Context, in *StartResumableWriteRequest, opts ...grpc.CallOption) (*StartResumableWriteResponse, error) + // Determines the `persisted_size` of an object that is being written. This + // method is part of the resumable + // upload feature. + // The returned value is the size of the object that has been persisted so + // far. The value can be used as the `write_offset` for the next `Write()` + // call. + // + // If the object does not exist, meaning if it was deleted, or the + // first `Write()` has not yet reached the service, this method returns the + // error `NOT_FOUND`. + // + // This method is useful for clients that buffer data and need to know which + // data can be safely evicted. The client can call `QueryWriteStatus()` at any + // time to determine how much data has been logged for this object. + // For any sequence of `QueryWriteStatus()` calls for a given + // object name, the sequence of returned `persisted_size` values are + // non-decreasing. + QueryWriteStatus(ctx context.Context, in *QueryWriteStatusRequest, opts ...grpc.CallOption) (*QueryWriteStatusResponse, error) + // Moves the source object to the destination object in the same bucket. + // This operation moves a source object to a destination object in the + // same bucket by renaming the object. The move itself is an atomic + // transaction, ensuring all steps either complete successfully or no + // changes are made. + // + // **IAM Permissions**: + // + // Requires the following IAM permissions to use this method: + // + // - `storage.objects.move` + // - `storage.objects.create` + // - `storage.objects.delete` (only required if overwriting an existing + // object) + MoveObject(ctx context.Context, in *MoveObjectRequest, opts ...grpc.CallOption) (*Object, error) +} + +type storageClient struct { + cc grpc.ClientConnInterface +} + +func NewStorageClient(cc grpc.ClientConnInterface) StorageClient { + return &storageClient{cc} +} + +func (c *storageClient) DeleteBucket(ctx context.Context, in *DeleteBucketRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, Storage_DeleteBucket_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storageClient) GetBucket(ctx context.Context, in *GetBucketRequest, opts ...grpc.CallOption) (*Bucket, error) { + out := new(Bucket) + err := c.cc.Invoke(ctx, Storage_GetBucket_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storageClient) CreateBucket(ctx context.Context, in *CreateBucketRequest, opts ...grpc.CallOption) (*Bucket, error) { + out := new(Bucket) + err := c.cc.Invoke(ctx, Storage_CreateBucket_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storageClient) ListBuckets(ctx context.Context, in *ListBucketsRequest, opts ...grpc.CallOption) (*ListBucketsResponse, error) { + out := new(ListBucketsResponse) + err := c.cc.Invoke(ctx, Storage_ListBuckets_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storageClient) LockBucketRetentionPolicy(ctx context.Context, in *LockBucketRetentionPolicyRequest, opts ...grpc.CallOption) (*Bucket, error) { + out := new(Bucket) + err := c.cc.Invoke(ctx, Storage_LockBucketRetentionPolicy_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storageClient) GetIamPolicy(ctx context.Context, in *iampb.GetIamPolicyRequest, opts ...grpc.CallOption) (*iampb.Policy, error) { + out := new(iampb.Policy) + err := c.cc.Invoke(ctx, Storage_GetIamPolicy_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storageClient) SetIamPolicy(ctx context.Context, in *iampb.SetIamPolicyRequest, opts ...grpc.CallOption) (*iampb.Policy, error) { + out := new(iampb.Policy) + err := c.cc.Invoke(ctx, Storage_SetIamPolicy_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storageClient) TestIamPermissions(ctx context.Context, in *iampb.TestIamPermissionsRequest, opts ...grpc.CallOption) (*iampb.TestIamPermissionsResponse, error) { + out := new(iampb.TestIamPermissionsResponse) + err := c.cc.Invoke(ctx, Storage_TestIamPermissions_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storageClient) UpdateBucket(ctx context.Context, in *UpdateBucketRequest, opts ...grpc.CallOption) (*Bucket, error) { + out := new(Bucket) + err := c.cc.Invoke(ctx, Storage_UpdateBucket_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storageClient) ComposeObject(ctx context.Context, in *ComposeObjectRequest, opts ...grpc.CallOption) (*Object, error) { + out := new(Object) + err := c.cc.Invoke(ctx, Storage_ComposeObject_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storageClient) DeleteObject(ctx context.Context, in *DeleteObjectRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, Storage_DeleteObject_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storageClient) RestoreObject(ctx context.Context, in *RestoreObjectRequest, opts ...grpc.CallOption) (*Object, error) { + out := new(Object) + err := c.cc.Invoke(ctx, Storage_RestoreObject_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storageClient) CancelResumableWrite(ctx context.Context, in *CancelResumableWriteRequest, opts ...grpc.CallOption) (*CancelResumableWriteResponse, error) { + out := new(CancelResumableWriteResponse) + err := c.cc.Invoke(ctx, Storage_CancelResumableWrite_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storageClient) GetObject(ctx context.Context, in *GetObjectRequest, opts ...grpc.CallOption) (*Object, error) { + out := new(Object) + err := c.cc.Invoke(ctx, Storage_GetObject_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storageClient) ReadObject(ctx context.Context, in *ReadObjectRequest, opts ...grpc.CallOption) (Storage_ReadObjectClient, error) { + stream, err := c.cc.NewStream(ctx, &Storage_ServiceDesc.Streams[0], Storage_ReadObject_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &storageReadObjectClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Storage_ReadObjectClient interface { + Recv() (*ReadObjectResponse, error) + grpc.ClientStream +} + +type storageReadObjectClient struct { + grpc.ClientStream +} + +func (x *storageReadObjectClient) Recv() (*ReadObjectResponse, error) { + m := new(ReadObjectResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *storageClient) BidiReadObject(ctx context.Context, opts ...grpc.CallOption) (Storage_BidiReadObjectClient, error) { + stream, err := c.cc.NewStream(ctx, &Storage_ServiceDesc.Streams[1], Storage_BidiReadObject_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &storageBidiReadObjectClient{stream} + return x, nil +} + +type Storage_BidiReadObjectClient interface { + Send(*BidiReadObjectRequest) error + Recv() (*BidiReadObjectResponse, error) + grpc.ClientStream +} + +type storageBidiReadObjectClient struct { + grpc.ClientStream +} + +func (x *storageBidiReadObjectClient) Send(m *BidiReadObjectRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *storageBidiReadObjectClient) Recv() (*BidiReadObjectResponse, error) { + m := new(BidiReadObjectResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *storageClient) UpdateObject(ctx context.Context, in *UpdateObjectRequest, opts ...grpc.CallOption) (*Object, error) { + out := new(Object) + err := c.cc.Invoke(ctx, Storage_UpdateObject_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storageClient) WriteObject(ctx context.Context, opts ...grpc.CallOption) (Storage_WriteObjectClient, error) { + stream, err := c.cc.NewStream(ctx, &Storage_ServiceDesc.Streams[2], Storage_WriteObject_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &storageWriteObjectClient{stream} + return x, nil +} + +type Storage_WriteObjectClient interface { + Send(*WriteObjectRequest) error + CloseAndRecv() (*WriteObjectResponse, error) + grpc.ClientStream +} + +type storageWriteObjectClient struct { + grpc.ClientStream +} + +func (x *storageWriteObjectClient) Send(m *WriteObjectRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *storageWriteObjectClient) CloseAndRecv() (*WriteObjectResponse, error) { + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + m := new(WriteObjectResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *storageClient) BidiWriteObject(ctx context.Context, opts ...grpc.CallOption) (Storage_BidiWriteObjectClient, error) { + stream, err := c.cc.NewStream(ctx, &Storage_ServiceDesc.Streams[3], Storage_BidiWriteObject_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &storageBidiWriteObjectClient{stream} + return x, nil +} + +type Storage_BidiWriteObjectClient interface { + Send(*BidiWriteObjectRequest) error + Recv() (*BidiWriteObjectResponse, error) + grpc.ClientStream +} + +type storageBidiWriteObjectClient struct { + grpc.ClientStream +} + +func (x *storageBidiWriteObjectClient) Send(m *BidiWriteObjectRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *storageBidiWriteObjectClient) Recv() (*BidiWriteObjectResponse, error) { + m := new(BidiWriteObjectResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *storageClient) ListObjects(ctx context.Context, in *ListObjectsRequest, opts ...grpc.CallOption) (*ListObjectsResponse, error) { + out := new(ListObjectsResponse) + err := c.cc.Invoke(ctx, Storage_ListObjects_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storageClient) RewriteObject(ctx context.Context, in *RewriteObjectRequest, opts ...grpc.CallOption) (*RewriteResponse, error) { + out := new(RewriteResponse) + err := c.cc.Invoke(ctx, Storage_RewriteObject_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storageClient) StartResumableWrite(ctx context.Context, in *StartResumableWriteRequest, opts ...grpc.CallOption) (*StartResumableWriteResponse, error) { + out := new(StartResumableWriteResponse) + err := c.cc.Invoke(ctx, Storage_StartResumableWrite_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storageClient) QueryWriteStatus(ctx context.Context, in *QueryWriteStatusRequest, opts ...grpc.CallOption) (*QueryWriteStatusResponse, error) { + out := new(QueryWriteStatusResponse) + err := c.cc.Invoke(ctx, Storage_QueryWriteStatus_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storageClient) MoveObject(ctx context.Context, in *MoveObjectRequest, opts ...grpc.CallOption) (*Object, error) { + out := new(Object) + err := c.cc.Invoke(ctx, Storage_MoveObject_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// StorageServer is the server API for Storage service. +// All implementations should embed UnimplementedStorageServer +// for forward compatibility +type StorageServer interface { + // Permanently deletes an empty bucket. + // The request fails if there are any live or + // noncurrent objects in the bucket, but the request succeeds if the + // bucket only contains soft-deleted objects or incomplete uploads, such + // as ongoing XML API multipart uploads. Does not permanently delete + // soft-deleted objects. + // + // When this API is used to delete a bucket containing an object that has a + // soft delete policy + // enabled, the object becomes soft deleted, and the + // `softDeleteTime` and `hardDeleteTime` properties are set on the + // object. + // + // Objects and multipart uploads that were in the bucket at the time of + // deletion are also retained for the specified retention duration. When + // a soft-deleted bucket reaches the end of its retention duration, it + // is permanently deleted. The `hardDeleteTime` of the bucket always + // equals + // or exceeds the expiration time of the last soft-deleted object in the + // bucket. + // + // **IAM Permissions**: + // + // Requires `storage.buckets.delete` IAM permission on the bucket. + DeleteBucket(context.Context, *DeleteBucketRequest) (*emptypb.Empty, error) + // Returns metadata for the specified bucket. + // + // **IAM Permissions**: + // + // Requires `storage.buckets.get` + // IAM permission on + // the bucket. Additionally, to return specific bucket metadata, the + // authenticated user must have the following permissions: + // + // - To return the IAM policies: `storage.buckets.getIamPolicy` + // - To return the bucket IP filtering rules: `storage.buckets.getIpFilter` + GetBucket(context.Context, *GetBucketRequest) (*Bucket, error) + // Creates a new bucket. + // + // **IAM Permissions**: + // + // Requires `storage.buckets.create` IAM permission on the bucket. + // Additionally, to enable specific bucket features, the authenticated user + // must have the following permissions: + // + // - To enable object retention using the `enableObjectRetention` query + // parameter: `storage.buckets.enableObjectRetention` + // - To set the bucket IP filtering rules: `storage.buckets.setIpFilter` + CreateBucket(context.Context, *CreateBucketRequest) (*Bucket, error) + // Retrieves a list of buckets for a given project, ordered + // lexicographically by name. + // + // **IAM Permissions**: + // + // Requires `storage.buckets.list` IAM permission on the bucket. + // Additionally, to enable specific bucket features, the authenticated + // user must have the following permissions: + // + // - To list the IAM policies: `storage.buckets.getIamPolicy` + // - To list the bucket IP filtering rules: `storage.buckets.getIpFilter` + ListBuckets(context.Context, *ListBucketsRequest) (*ListBucketsResponse, error) + // Permanently locks the retention + // policy that is + // currently applied to the specified bucket. + // + // Caution: Locking a bucket is an + // irreversible action. Once you lock a bucket: + // + // - You cannot remove the retention policy from the bucket. + // - You cannot decrease the retention period for the policy. + // + // Once locked, you must delete the entire bucket in order to remove the + // bucket's retention policy. However, before you can delete the bucket, you + // must delete all the objects in the bucket, which is only + // possible if all the objects have reached the retention period set by the + // retention policy. + // + // **IAM Permissions**: + // + // Requires `storage.buckets.update` IAM permission on the bucket. + LockBucketRetentionPolicy(context.Context, *LockBucketRetentionPolicyRequest) (*Bucket, error) + // Gets the IAM policy for a specified bucket or managed folder. + // The `resource` field in the request should be + // `projects/_/buckets/{bucket}` for a bucket, or + // `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` + // for a managed folder. + // + // **IAM Permissions**: + // + // Requires `storage.buckets.getIamPolicy` on the bucket or + // `storage.managedFolders.getIamPolicy` IAM permission on the + // managed folder. + GetIamPolicy(context.Context, *iampb.GetIamPolicyRequest) (*iampb.Policy, error) + // Updates an IAM policy for the specified bucket or managed folder. + // The `resource` field in the request should be + // `projects/_/buckets/{bucket}` for a bucket, or + // `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` + // for a managed folder. + SetIamPolicy(context.Context, *iampb.SetIamPolicyRequest) (*iampb.Policy, error) + // Tests a set of permissions on the given bucket, object, or managed folder + // to see which, if any, are held by the caller. The `resource` field in the + // request should be `projects/_/buckets/{bucket}` for a bucket, + // `projects/_/buckets/{bucket}/objects/{object}` for an object, or + // `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` + // for a managed folder. + TestIamPermissions(context.Context, *iampb.TestIamPermissionsRequest) (*iampb.TestIamPermissionsResponse, error) + // Updates a bucket. Changes to the bucket are readable immediately after + // writing, but configuration changes might take time to propagate. This + // method supports `patch` semantics. + // + // **IAM Permissions**: + // + // Requires `storage.buckets.update` IAM permission on the bucket. + // Additionally, to enable specific bucket features, the authenticated user + // must have the following permissions: + // + // - To set bucket IP filtering rules: `storage.buckets.setIpFilter` + // - To update public access prevention policies or access control lists + // (ACLs): `storage.buckets.setIamPolicy` + UpdateBucket(context.Context, *UpdateBucketRequest) (*Bucket, error) + // Concatenates a list of existing objects into a new object in the same + // bucket. The existing source objects are unaffected by this operation. + // + // **IAM Permissions**: + // + // Requires the `storage.objects.create` and `storage.objects.get` IAM + // permissions to use this method. If the new composite object + // overwrites an existing object, the authenticated user must also have + // the `storage.objects.delete` permission. If the request body includes + // the retention property, the authenticated user must also have the + // `storage.objects.setRetention` IAM permission. + ComposeObject(context.Context, *ComposeObjectRequest) (*Object, error) + // Deletes an object and its metadata. Deletions are permanent if versioning + // is not enabled for the bucket, or if the generation parameter is used, or + // if soft delete is not + // enabled for the bucket. + // When this API is used to delete an object from a bucket that has soft + // delete policy enabled, the object becomes soft deleted, and the + // `softDeleteTime` and `hardDeleteTime` properties are set on the object. + // This API cannot be used to permanently delete soft-deleted objects. + // Soft-deleted objects are permanently deleted according to their + // `hardDeleteTime`. + // + // You can use the [`RestoreObject`][google.storage.v2.Storage.RestoreObject] + // API to restore soft-deleted objects until the soft delete retention period + // has passed. + // + // **IAM Permissions**: + // + // Requires `storage.objects.delete` IAM permission on the bucket. + DeleteObject(context.Context, *DeleteObjectRequest) (*emptypb.Empty, error) + // Restores a + // soft-deleted object. + // When a soft-deleted object is restored, a new copy of that object is + // created in the same bucket and inherits the same metadata as the + // soft-deleted object. The inherited metadata is the metadata that existed + // when the original object became soft deleted, with the following + // exceptions: + // + // - The `createTime` of the new object is set to the time at which the + // soft-deleted object was restored. + // - The `softDeleteTime` and `hardDeleteTime` values are cleared. + // - A new generation is assigned and the metageneration is reset to 1. + // - If the soft-deleted object was in a bucket that had Autoclass enabled, + // the new object is + // restored to Standard storage. + // - The restored object inherits the bucket's default object ACL, unless + // `copySourceAcl` is `true`. + // + // If a live object using the same name already exists in the bucket and + // becomes overwritten, the live object becomes a noncurrent object if Object + // Versioning is enabled on the bucket. If Object Versioning is not enabled, + // the live object becomes soft deleted. + // + // **IAM Permissions**: + // + // Requires the following IAM permissions to use this method: + // + // - `storage.objects.restore` + // - `storage.objects.create` + // - `storage.objects.delete` (only required if overwriting an existing + // object) + // - `storage.objects.getIamPolicy` (only required if `projection` is `full` + // and the relevant bucket + // has uniform bucket-level access disabled) + // - `storage.objects.setIamPolicy` (only required if `copySourceAcl` is + // `true` and the relevant + // bucket has uniform bucket-level access disabled) + RestoreObject(context.Context, *RestoreObjectRequest) (*Object, error) + // Cancels an in-progress resumable upload. + // + // Any attempts to write to the resumable upload after cancelling the upload + // fail. + // + // The behavior for any in-progress write operations is not guaranteed; + // they could either complete before the cancellation or fail if the + // cancellation completes first. + CancelResumableWrite(context.Context, *CancelResumableWriteRequest) (*CancelResumableWriteResponse, error) + // Retrieves object metadata. + // + // **IAM Permissions**: + // + // Requires `storage.objects.get` IAM permission on the bucket. + // To return object ACLs, the authenticated user must also have + // the `storage.objects.getIamPolicy` permission. + GetObject(context.Context, *GetObjectRequest) (*Object, error) + // Retrieves object data. + // + // **IAM Permissions**: + // + // Requires `storage.objects.get` IAM permission on the bucket. + ReadObject(*ReadObjectRequest, Storage_ReadObjectServer) error + // Reads an object's data. + // + // This bi-directional API reads data from an object, allowing you to + // request multiple data ranges within a single stream, even across + // several messages. If an error occurs with any request, the stream + // closes with a relevant error code. Since you can have multiple + // outstanding requests, the error response includes a + // `BidiReadObjectRangesError` field detailing the specific error for + // each pending `read_id`. + // + // **IAM Permissions**: + // + // Requires `storage.objects.get` IAM permission on the bucket. + BidiReadObject(Storage_BidiReadObjectServer) error + // Updates an object's metadata. + // Equivalent to JSON API's `storage.objects.patch` method. + // + // **IAM Permissions**: + // + // Requires `storage.objects.update` IAM permission on the bucket. + UpdateObject(context.Context, *UpdateObjectRequest) (*Object, error) + // Stores a new object and metadata. + // + // An object can be written either in a single message stream or in a + // resumable sequence of message streams. To write using a single stream, + // the client should include in the first message of the stream an + // `WriteObjectSpec` describing the destination bucket, object, and any + // preconditions. Additionally, the final message must set 'finish_write' to + // true, or else it is an error. + // + // For a resumable write, the client should instead call + // `StartResumableWrite()`, populating a `WriteObjectSpec` into that request. + // They should then attach the returned `upload_id` to the first message of + // each following call to `WriteObject`. If the stream is closed before + // finishing the upload (either explicitly by the client or due to a network + // error or an error response from the server), the client should do as + // follows: + // + // - Check the result Status of the stream, to determine if writing can be + // resumed on this stream or must be restarted from scratch (by calling + // `StartResumableWrite()`). The resumable errors are `DEADLINE_EXCEEDED`, + // `INTERNAL`, and `UNAVAILABLE`. For each case, the client should use + // binary exponential backoff before retrying. Additionally, writes can + // be resumed after `RESOURCE_EXHAUSTED` errors, but only after taking + // appropriate measures, which might include reducing aggregate send rate + // across clients and/or requesting a quota increase for your project. + // - If the call to `WriteObject` returns `ABORTED`, that indicates + // concurrent attempts to update the resumable write, caused either by + // multiple racing clients or by a single client where the previous + // request was timed out on the client side but nonetheless reached the + // server. In this case the client should take steps to prevent further + // concurrent writes. For example, increase the timeouts and stop using + // more than one process to perform the upload. Follow the steps below for + // resuming the upload. + // - For resumable errors, the client should call `QueryWriteStatus()` and + // then continue writing from the returned `persisted_size`. This might be + // less than the amount of data the client previously sent. Note also that + // it is acceptable to send data starting at an offset earlier than the + // returned `persisted_size`; in this case, the service skips data at + // offsets that were already persisted (without checking that it matches + // the previously written data), and write only the data starting from the + // persisted offset. Even though the data isn't written, it might still + // incur a performance cost over resuming at the correct write offset. + // This behavior can make client-side handling simpler in some cases. + // - Clients must only send data that is a multiple of 256 KiB per message, + // unless the object is being finished with `finish_write` set to `true`. + // + // The service does not view the object as complete until the client has + // sent a `WriteObjectRequest` with `finish_write` set to `true`. Sending any + // requests on a stream after sending a request with `finish_write` set to + // `true` causes an error. The client must check the response it + // receives to determine how much data the service is able to commit and + // whether the service views the object as complete. + // + // Attempting to resume an already finalized object results in an `OK` + // status, with a `WriteObjectResponse` containing the finalized object's + // metadata. + // + // Alternatively, you can use the `BidiWriteObject` operation to write an + // object with controls over flushing and the ability to fetch the ability to + // determine the current persisted size. + // + // **IAM Permissions**: + // + // Requires `storage.objects.create` + // IAM permission on + // the bucket. + WriteObject(Storage_WriteObjectServer) error + // Stores a new object and metadata. + // + // This is similar to the `WriteObject` call with the added support for + // manual flushing of persisted state, and the ability to determine current + // persisted size without closing the stream. + // + // The client might specify one or both of the `state_lookup` and `flush` + // fields in each `BidiWriteObjectRequest`. If `flush` is specified, the data + // written so far is persisted to storage. If `state_lookup` is specified, the + // service responds with a `BidiWriteObjectResponse` that contains the + // persisted size. If both `flush` and `state_lookup` are specified, the flush + // always occurs before a `state_lookup`, so that both might be set in the + // same request and the returned state is the state of the object + // post-flush. When the stream is closed, a `BidiWriteObjectResponse` + // is always sent to the client, regardless of the value of `state_lookup`. + BidiWriteObject(Storage_BidiWriteObjectServer) error + // Retrieves a list of objects matching the criteria. + // + // **IAM Permissions**: + // + // The authenticated user requires `storage.objects.list` + // IAM permission to use this method. To return object ACLs, the + // authenticated user must also + // have the `storage.objects.getIamPolicy` permission. + ListObjects(context.Context, *ListObjectsRequest) (*ListObjectsResponse, error) + // Rewrites a source object to a destination object. Optionally overrides + // metadata. + RewriteObject(context.Context, *RewriteObjectRequest) (*RewriteResponse, error) + // Starts a resumable write operation. This + // method is part of the Resumable + // upload feature. + // This allows you to upload large objects in multiple chunks, which is more + // resilient to network interruptions than a single upload. The validity + // duration of the write operation, and the consequences of it becoming + // invalid, are service-dependent. + // + // **IAM Permissions**: + // + // Requires `storage.objects.create` IAM permission on the bucket. + StartResumableWrite(context.Context, *StartResumableWriteRequest) (*StartResumableWriteResponse, error) + // Determines the `persisted_size` of an object that is being written. This + // method is part of the resumable + // upload feature. + // The returned value is the size of the object that has been persisted so + // far. The value can be used as the `write_offset` for the next `Write()` + // call. + // + // If the object does not exist, meaning if it was deleted, or the + // first `Write()` has not yet reached the service, this method returns the + // error `NOT_FOUND`. + // + // This method is useful for clients that buffer data and need to know which + // data can be safely evicted. The client can call `QueryWriteStatus()` at any + // time to determine how much data has been logged for this object. + // For any sequence of `QueryWriteStatus()` calls for a given + // object name, the sequence of returned `persisted_size` values are + // non-decreasing. + QueryWriteStatus(context.Context, *QueryWriteStatusRequest) (*QueryWriteStatusResponse, error) + // Moves the source object to the destination object in the same bucket. + // This operation moves a source object to a destination object in the + // same bucket by renaming the object. The move itself is an atomic + // transaction, ensuring all steps either complete successfully or no + // changes are made. + // + // **IAM Permissions**: + // + // Requires the following IAM permissions to use this method: + // + // - `storage.objects.move` + // - `storage.objects.create` + // - `storage.objects.delete` (only required if overwriting an existing + // object) + MoveObject(context.Context, *MoveObjectRequest) (*Object, error) +} + +// UnimplementedStorageServer should be embedded to have forward compatible implementations. +type UnimplementedStorageServer struct { +} + +func (UnimplementedStorageServer) DeleteBucket(context.Context, *DeleteBucketRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteBucket not implemented") +} +func (UnimplementedStorageServer) GetBucket(context.Context, *GetBucketRequest) (*Bucket, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetBucket not implemented") +} +func (UnimplementedStorageServer) CreateBucket(context.Context, *CreateBucketRequest) (*Bucket, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateBucket not implemented") +} +func (UnimplementedStorageServer) ListBuckets(context.Context, *ListBucketsRequest) (*ListBucketsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListBuckets not implemented") +} +func (UnimplementedStorageServer) LockBucketRetentionPolicy(context.Context, *LockBucketRetentionPolicyRequest) (*Bucket, error) { + return nil, status.Errorf(codes.Unimplemented, "method LockBucketRetentionPolicy not implemented") +} +func (UnimplementedStorageServer) GetIamPolicy(context.Context, *iampb.GetIamPolicyRequest) (*iampb.Policy, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetIamPolicy not implemented") +} +func (UnimplementedStorageServer) SetIamPolicy(context.Context, *iampb.SetIamPolicyRequest) (*iampb.Policy, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetIamPolicy not implemented") +} +func (UnimplementedStorageServer) TestIamPermissions(context.Context, *iampb.TestIamPermissionsRequest) (*iampb.TestIamPermissionsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TestIamPermissions not implemented") +} +func (UnimplementedStorageServer) UpdateBucket(context.Context, *UpdateBucketRequest) (*Bucket, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateBucket not implemented") +} +func (UnimplementedStorageServer) ComposeObject(context.Context, *ComposeObjectRequest) (*Object, error) { + return nil, status.Errorf(codes.Unimplemented, "method ComposeObject not implemented") +} +func (UnimplementedStorageServer) DeleteObject(context.Context, *DeleteObjectRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteObject not implemented") +} +func (UnimplementedStorageServer) RestoreObject(context.Context, *RestoreObjectRequest) (*Object, error) { + return nil, status.Errorf(codes.Unimplemented, "method RestoreObject not implemented") +} +func (UnimplementedStorageServer) CancelResumableWrite(context.Context, *CancelResumableWriteRequest) (*CancelResumableWriteResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CancelResumableWrite not implemented") +} +func (UnimplementedStorageServer) GetObject(context.Context, *GetObjectRequest) (*Object, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetObject not implemented") +} +func (UnimplementedStorageServer) ReadObject(*ReadObjectRequest, Storage_ReadObjectServer) error { + return status.Errorf(codes.Unimplemented, "method ReadObject not implemented") +} +func (UnimplementedStorageServer) BidiReadObject(Storage_BidiReadObjectServer) error { + return status.Errorf(codes.Unimplemented, "method BidiReadObject not implemented") +} +func (UnimplementedStorageServer) UpdateObject(context.Context, *UpdateObjectRequest) (*Object, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateObject not implemented") +} +func (UnimplementedStorageServer) WriteObject(Storage_WriteObjectServer) error { + return status.Errorf(codes.Unimplemented, "method WriteObject not implemented") +} +func (UnimplementedStorageServer) BidiWriteObject(Storage_BidiWriteObjectServer) error { + return status.Errorf(codes.Unimplemented, "method BidiWriteObject not implemented") +} +func (UnimplementedStorageServer) ListObjects(context.Context, *ListObjectsRequest) (*ListObjectsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListObjects not implemented") +} +func (UnimplementedStorageServer) RewriteObject(context.Context, *RewriteObjectRequest) (*RewriteResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RewriteObject not implemented") +} +func (UnimplementedStorageServer) StartResumableWrite(context.Context, *StartResumableWriteRequest) (*StartResumableWriteResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method StartResumableWrite not implemented") +} +func (UnimplementedStorageServer) QueryWriteStatus(context.Context, *QueryWriteStatusRequest) (*QueryWriteStatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryWriteStatus not implemented") +} +func (UnimplementedStorageServer) MoveObject(context.Context, *MoveObjectRequest) (*Object, error) { + return nil, status.Errorf(codes.Unimplemented, "method MoveObject not implemented") +} + +// UnsafeStorageServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to StorageServer will +// result in compilation errors. +type UnsafeStorageServer interface { + mustEmbedUnimplementedStorageServer() +} + +func RegisterStorageServer(s grpc.ServiceRegistrar, srv StorageServer) { + s.RegisterService(&Storage_ServiceDesc, srv) +} + +func _Storage_DeleteBucket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteBucketRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StorageServer).DeleteBucket(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Storage_DeleteBucket_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StorageServer).DeleteBucket(ctx, req.(*DeleteBucketRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Storage_GetBucket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetBucketRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StorageServer).GetBucket(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Storage_GetBucket_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StorageServer).GetBucket(ctx, req.(*GetBucketRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Storage_CreateBucket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateBucketRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StorageServer).CreateBucket(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Storage_CreateBucket_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StorageServer).CreateBucket(ctx, req.(*CreateBucketRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Storage_ListBuckets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListBucketsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StorageServer).ListBuckets(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Storage_ListBuckets_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StorageServer).ListBuckets(ctx, req.(*ListBucketsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Storage_LockBucketRetentionPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LockBucketRetentionPolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StorageServer).LockBucketRetentionPolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Storage_LockBucketRetentionPolicy_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StorageServer).LockBucketRetentionPolicy(ctx, req.(*LockBucketRetentionPolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Storage_GetIamPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(iampb.GetIamPolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StorageServer).GetIamPolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Storage_GetIamPolicy_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StorageServer).GetIamPolicy(ctx, req.(*iampb.GetIamPolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Storage_SetIamPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(iampb.SetIamPolicyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StorageServer).SetIamPolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Storage_SetIamPolicy_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StorageServer).SetIamPolicy(ctx, req.(*iampb.SetIamPolicyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Storage_TestIamPermissions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(iampb.TestIamPermissionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StorageServer).TestIamPermissions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Storage_TestIamPermissions_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StorageServer).TestIamPermissions(ctx, req.(*iampb.TestIamPermissionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Storage_UpdateBucket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateBucketRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StorageServer).UpdateBucket(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Storage_UpdateBucket_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StorageServer).UpdateBucket(ctx, req.(*UpdateBucketRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Storage_ComposeObject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ComposeObjectRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StorageServer).ComposeObject(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Storage_ComposeObject_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StorageServer).ComposeObject(ctx, req.(*ComposeObjectRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Storage_DeleteObject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteObjectRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StorageServer).DeleteObject(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Storage_DeleteObject_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StorageServer).DeleteObject(ctx, req.(*DeleteObjectRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Storage_RestoreObject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RestoreObjectRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StorageServer).RestoreObject(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Storage_RestoreObject_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StorageServer).RestoreObject(ctx, req.(*RestoreObjectRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Storage_CancelResumableWrite_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CancelResumableWriteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StorageServer).CancelResumableWrite(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Storage_CancelResumableWrite_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StorageServer).CancelResumableWrite(ctx, req.(*CancelResumableWriteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Storage_GetObject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetObjectRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StorageServer).GetObject(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Storage_GetObject_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StorageServer).GetObject(ctx, req.(*GetObjectRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Storage_ReadObject_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(ReadObjectRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(StorageServer).ReadObject(m, &storageReadObjectServer{stream}) +} + +type Storage_ReadObjectServer interface { + Send(*ReadObjectResponse) error + grpc.ServerStream +} + +type storageReadObjectServer struct { + grpc.ServerStream +} + +func (x *storageReadObjectServer) Send(m *ReadObjectResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _Storage_BidiReadObject_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(StorageServer).BidiReadObject(&storageBidiReadObjectServer{stream}) +} + +type Storage_BidiReadObjectServer interface { + Send(*BidiReadObjectResponse) error + Recv() (*BidiReadObjectRequest, error) + grpc.ServerStream +} + +type storageBidiReadObjectServer struct { + grpc.ServerStream +} + +func (x *storageBidiReadObjectServer) Send(m *BidiReadObjectResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *storageBidiReadObjectServer) Recv() (*BidiReadObjectRequest, error) { + m := new(BidiReadObjectRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _Storage_UpdateObject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateObjectRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StorageServer).UpdateObject(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Storage_UpdateObject_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StorageServer).UpdateObject(ctx, req.(*UpdateObjectRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Storage_WriteObject_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(StorageServer).WriteObject(&storageWriteObjectServer{stream}) +} + +type Storage_WriteObjectServer interface { + SendAndClose(*WriteObjectResponse) error + Recv() (*WriteObjectRequest, error) + grpc.ServerStream +} + +type storageWriteObjectServer struct { + grpc.ServerStream +} + +func (x *storageWriteObjectServer) SendAndClose(m *WriteObjectResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *storageWriteObjectServer) Recv() (*WriteObjectRequest, error) { + m := new(WriteObjectRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _Storage_BidiWriteObject_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(StorageServer).BidiWriteObject(&storageBidiWriteObjectServer{stream}) +} + +type Storage_BidiWriteObjectServer interface { + Send(*BidiWriteObjectResponse) error + Recv() (*BidiWriteObjectRequest, error) + grpc.ServerStream +} + +type storageBidiWriteObjectServer struct { + grpc.ServerStream +} + +func (x *storageBidiWriteObjectServer) Send(m *BidiWriteObjectResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *storageBidiWriteObjectServer) Recv() (*BidiWriteObjectRequest, error) { + m := new(BidiWriteObjectRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _Storage_ListObjects_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListObjectsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StorageServer).ListObjects(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Storage_ListObjects_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StorageServer).ListObjects(ctx, req.(*ListObjectsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Storage_RewriteObject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RewriteObjectRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StorageServer).RewriteObject(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Storage_RewriteObject_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StorageServer).RewriteObject(ctx, req.(*RewriteObjectRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Storage_StartResumableWrite_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StartResumableWriteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StorageServer).StartResumableWrite(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Storage_StartResumableWrite_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StorageServer).StartResumableWrite(ctx, req.(*StartResumableWriteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Storage_QueryWriteStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryWriteStatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StorageServer).QueryWriteStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Storage_QueryWriteStatus_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StorageServer).QueryWriteStatus(ctx, req.(*QueryWriteStatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Storage_MoveObject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MoveObjectRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StorageServer).MoveObject(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Storage_MoveObject_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StorageServer).MoveObject(ctx, req.(*MoveObjectRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Storage_ServiceDesc is the grpc.ServiceDesc for Storage service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Storage_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "google.storage.v2.Storage", + HandlerType: (*StorageServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "DeleteBucket", + Handler: _Storage_DeleteBucket_Handler, + }, + { + MethodName: "GetBucket", + Handler: _Storage_GetBucket_Handler, + }, + { + MethodName: "CreateBucket", + Handler: _Storage_CreateBucket_Handler, + }, + { + MethodName: "ListBuckets", + Handler: _Storage_ListBuckets_Handler, + }, + { + MethodName: "LockBucketRetentionPolicy", + Handler: _Storage_LockBucketRetentionPolicy_Handler, + }, + { + MethodName: "GetIamPolicy", + Handler: _Storage_GetIamPolicy_Handler, + }, + { + MethodName: "SetIamPolicy", + Handler: _Storage_SetIamPolicy_Handler, + }, + { + MethodName: "TestIamPermissions", + Handler: _Storage_TestIamPermissions_Handler, + }, + { + MethodName: "UpdateBucket", + Handler: _Storage_UpdateBucket_Handler, + }, + { + MethodName: "ComposeObject", + Handler: _Storage_ComposeObject_Handler, + }, + { + MethodName: "DeleteObject", + Handler: _Storage_DeleteObject_Handler, + }, + { + MethodName: "RestoreObject", + Handler: _Storage_RestoreObject_Handler, + }, + { + MethodName: "CancelResumableWrite", + Handler: _Storage_CancelResumableWrite_Handler, + }, + { + MethodName: "GetObject", + Handler: _Storage_GetObject_Handler, + }, + { + MethodName: "UpdateObject", + Handler: _Storage_UpdateObject_Handler, + }, + { + MethodName: "ListObjects", + Handler: _Storage_ListObjects_Handler, + }, + { + MethodName: "RewriteObject", + Handler: _Storage_RewriteObject_Handler, + }, + { + MethodName: "StartResumableWrite", + Handler: _Storage_StartResumableWrite_Handler, + }, + { + MethodName: "QueryWriteStatus", + Handler: _Storage_QueryWriteStatus_Handler, + }, + { + MethodName: "MoveObject", + Handler: _Storage_MoveObject_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "ReadObject", + Handler: _Storage_ReadObject_Handler, + ServerStreams: true, + }, + { + StreamName: "BidiReadObject", + Handler: _Storage_BidiReadObject_Handler, + ServerStreams: true, + ClientStreams: true, + }, + { + StreamName: "WriteObject", + Handler: _Storage_WriteObject_Handler, + ClientStreams: true, + }, + { + StreamName: "BidiWriteObject", + Handler: _Storage_BidiWriteObject_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "google/storage/v2/storage.proto", +} diff --git a/vendor/cloud.google.com/go/storage/internal/version.go b/vendor/cloud.google.com/go/storage/internal/version.go index 07cfc2811f7..7d1d0dfd40c 100644 --- a/vendor/cloud.google.com/go/storage/internal/version.go +++ b/vendor/cloud.google.com/go/storage/internal/version.go @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,7 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +// Code generated by gapicgen. DO NOT EDIT. + package internal // Version is the current tagged release of the library. -const Version = "1.57.0" +const Version = "1.58.0" diff --git a/vendor/cloud.google.com/go/storage/reader.go b/vendor/cloud.google.com/go/storage/reader.go index 793c1b2e0e8..0c5f5be0ab9 100644 --- a/vendor/cloud.google.com/go/storage/reader.go +++ b/vendor/cloud.google.com/go/storage/reader.go @@ -23,8 +23,6 @@ import ( "strings" "sync" "time" - - "cloud.google.com/go/internal/trace" ) var crc32cTable = crc32.MakeTable(crc32.Castagnoli) @@ -116,7 +114,8 @@ func (o *ObjectHandle) NewReader(ctx context.Context) (*Reader, error) { func (o *ObjectHandle) NewRangeReader(ctx context.Context, offset, length int64) (r *Reader, err error) { // This span covers the life of the reader. It is closed via the context // in Reader.Close. - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.Object.Reader") + ctx, _ = startSpan(ctx, "Object.Reader") + defer func() { endSpan(ctx, err) }() if err := o.validate(); err != nil { return nil, err @@ -150,8 +149,6 @@ func (o *ObjectHandle) NewRangeReader(ctx context.Context, offset, length int64) // span now if there is an error. if err == nil { r.ctx = ctx - } else { - trace.EndSpan(ctx, err) } return r, err @@ -167,7 +164,8 @@ func (o *ObjectHandle) NewRangeReader(ctx context.Context, offset, length int64) func (o *ObjectHandle) NewMultiRangeDownloader(ctx context.Context) (mrd *MultiRangeDownloader, err error) { // This span covers the life of the reader. It is closed via the context // in Reader.Close. - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.Object.MultiRangeDownloader") + ctx, _ = startSpan(ctx, "Object.MultiRangeDownloader") + defer func() { endSpan(ctx, err) }() if err := o.validate(); err != nil { return nil, err @@ -195,8 +193,6 @@ func (o *ObjectHandle) NewMultiRangeDownloader(ctx context.Context) (mrd *MultiR // span now if there is an error. if err == nil { r.ctx = ctx - } else { - trace.EndSpan(ctx, err) } return r, err @@ -285,7 +281,7 @@ type Reader struct { // Close closes the Reader. It must be called when done reading. func (r *Reader) Close() error { err := r.reader.Close() - trace.EndSpan(r.ctx, err) + endSpan(r.ctx, err) return err } @@ -436,7 +432,7 @@ func (mrd *MultiRangeDownloader) Add(output io.Writer, offset, length int64, cal // Call [MultiRangeDownloader.Wait] to avoid this error. func (mrd *MultiRangeDownloader) Close() error { err := mrd.reader.close() - trace.EndSpan(mrd.ctx, err) + endSpan(mrd.ctx, err) return err } diff --git a/vendor/cloud.google.com/go/storage/storage.go b/vendor/cloud.google.com/go/storage/storage.go index 2f4e093d828..55a81fab79c 100644 --- a/vendor/cloud.google.com/go/storage/storage.go +++ b/vendor/cloud.google.com/go/storage/storage.go @@ -40,7 +40,6 @@ import ( "cloud.google.com/go/auth" "cloud.google.com/go/internal/optional" - "cloud.google.com/go/internal/trace" "cloud.google.com/go/storage/internal" "cloud.google.com/go/storage/internal/apiv2/storagepb" "github.com/googleapis/gax-go/v2" @@ -1120,6 +1119,13 @@ type ObjectAttrsToUpdate struct { // extending the RetainUntil time on the object retention must be done // on an ObjectHandle with OverrideUnlockedRetention set to true. Retention *ObjectRetention + + // Contexts allows adding, modifying, or deleting individual object contexts. + // To add or modify a context, set the value field in ObjectCustomContextPayload. + // To delete a context, set the Delete field in ObjectCustomContextPayload to true. + // To remove all contexts, pass Custom as an empty map in Contexts. Passing nil Custom + // map will be no-op. + Contexts *ObjectContexts } // Delete deletes the single specified object. @@ -1248,7 +1254,7 @@ type MoveObjectDestination struct { // It is the caller's responsibility to call Close when writing is done. To // stop writing without saving the data, cancel the context. func (o *ObjectHandle) NewWriter(ctx context.Context) *Writer { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.Object.Writer") + ctx, _ = startSpan(ctx, "Object.Writer") return &Writer{ ctx: ctx, o: o, @@ -1284,7 +1290,7 @@ func (o *ObjectHandle) NewWriter(ctx context.Context) *Writer { // objects which were created append semantics and not finalized. // This feature is in preview and is not yet available for general use. func (o *ObjectHandle) NewWriterFromAppendableObject(ctx context.Context, opts *AppendableWriterOpts) (*Writer, int64, error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.Object.Writer") + ctx, _ = startSpan(ctx, "Object.WriterFromAppendableObject") if o.gen < 0 { return nil, 0, errors.New("storage: ObjectHandle.Generation must be set to use NewWriterFromAppendableObject") } @@ -1412,6 +1418,7 @@ func (o *ObjectAttrs) toRawObject(bucket string) *raw.Object { Metadata: o.Metadata, CustomTime: ct, Retention: o.Retention.toRawObjectRetention(), + Contexts: toRawObjectContexts(o.Contexts), } } @@ -1446,6 +1453,7 @@ func (o *ObjectAttrs) toProtoObject(b string) *storagepb.Object { KmsKey: o.KMSKeyName, Generation: o.Generation, Size: o.Size, + Contexts: toProtoObjectContexts(o.Contexts), } } @@ -1489,6 +1497,10 @@ func (uattrs *ObjectAttrsToUpdate) toProtoObject(bucket, object string) *storage o.Metadata = uattrs.Metadata + if uattrs.Contexts != nil { + o.Contexts = toProtoObjectContexts(uattrs.Contexts) + } + return o } @@ -1671,6 +1683,18 @@ type ObjectAttrs struct { // ObjectHandle.Attrs will return ErrObjectNotExist if the object is soft-deleted. // This field is read-only. HardDeleteTime time.Time + + // Contexts store custom key-value metadata that the user could + // annotate object with. These key-value pairs can be used to filter objects + // during list calls. See https://cloud.google.com/storage/docs/object-contexts + // for more details. + Contexts *ObjectContexts +} + +// isZero reports whether the ObjectAttrs struct is empty (i.e. all the +// fields are their zero value). +func (o *ObjectAttrs) isZero() bool { + return reflect.DeepEqual(o, &ObjectAttrs{}) } // ObjectRetention contains the retention configuration for this object. @@ -1778,6 +1802,7 @@ func newObject(o *raw.Object) *ObjectAttrs { Retention: toObjectRetention(o.Retention), SoftDeleteTime: convertTime(o.SoftDeleteTime), HardDeleteTime: convertTime(o.HardDeleteTime), + Contexts: toObjectContexts(o.Contexts), } } @@ -1816,6 +1841,7 @@ func newObjectFromProto(o *storagepb.Object) *ObjectAttrs { ComponentCount: int64(o.ComponentCount), SoftDeleteTime: convertProtoTime(o.GetSoftDeleteTime()), HardDeleteTime: convertProtoTime(o.GetHardDeleteTime()), + Contexts: toObjectContextsFromProto(o.GetContexts()), } } @@ -1928,6 +1954,11 @@ type Query struct { // If true, only objects that have been soft-deleted will be listed. // By default, soft-deleted objects are not listed. SoftDeleted bool + + // Filters objects based on object attributes like custom contexts. + // See https://docs.cloud.google.com/storage/docs/listing-objects#filter-by-object-contexts + // for more details. + Filter string } // attrToFieldMap maps the field names of ObjectAttrs to the underlying field @@ -1966,6 +1997,7 @@ var attrToFieldMap = map[string]string{ "Retention": "retention", "HardDeleteTime": "hardDeleteTime", "SoftDeleteTime": "softDeleteTime", + "Contexts": "contexts", } // attrToProtoFieldMap maps the field names of ObjectAttrs to the underlying field @@ -2001,6 +2033,7 @@ var attrToProtoFieldMap = map[string]string{ "ComponentCount": "component_count", "HardDeleteTime": "hard_delete_time", "SoftDeleteTime": "soft_delete_time", + "Contexts": "contexts", // MediaLink was explicitly excluded from the proto as it is an HTTP-ism. // "MediaLink": "mediaLink", // TODO: add object retention - b/308194853 diff --git a/vendor/cloud.google.com/go/storage/writer.go b/vendor/cloud.google.com/go/storage/writer.go index e7c8ed51b45..cba6184cb11 100644 --- a/vendor/cloud.google.com/go/storage/writer.go +++ b/vendor/cloud.google.com/go/storage/writer.go @@ -22,8 +22,6 @@ import ( "sync" "time" "unicode/utf8" - - "cloud.google.com/go/internal/trace" ) // Interface internalWriter wraps low-level implementations which may vary @@ -43,17 +41,35 @@ type Writer struct { // attributes are ignored. ObjectAttrs - // SendCRC32C specifies whether to transmit a CRC32C field. It should be set - // to true in addition to setting the Writer's CRC32C field, because zero - // is a valid CRC and normally a zero would not be transmitted. - // If a CRC32C is sent, and the data written does not match the checksum, - // the write will be rejected. + // SendCRC32C specifies whether to transmit a CRC32C checksum. When this is + // true and the Writer's CRC32C field is set, that checksum is sent to GCS. + // If the data written does not match the checksum, the write is rejected. + // It is necessary to set this field to true in addition to setting the + // Writer's CRC32C field because zero is a valid CRC. + // + // When using gRPC, the client automatically calculates and sends checksums + // per-chunk and for the full object. However, A user-provided checksum takes + // precedence over the auto-calculated checksum for full object. + // To disable auto checksum behavior, see DisableAutoChecksum. // - // Note: SendCRC32C must be set to true BEFORE the first call to - // Writer.Write() in order to send the checksum. If it is set after that - // point, the checksum will be ignored. + // Note: SendCRC32C must be set before the first call to Writer.Write(). SendCRC32C bool + // DisableAutoChecksum disables automatic CRC32C checksum calculation and + // validation in gRPC Writer. By default when using gRPC, the Writer + // automatically performs checksum validation for both individual chunks and + // the entire object. Setting this to true disables this behavior. This flag + // is ignored when not using gRPC. + // + // Disabling automatic checksumming does not prevent a user-provided checksum + // from being sent. If SendCRC32C is true and the Writer's CRC32C field is + // populated, that checksum will still be sent to GCS for validation. + // + // Note: DisableAutoChecksum must be set before the first call to + // Writer.Write(). Automatic checksumming is not enabled for writes + // using the HTTP client or for unfinalized writes to appendable objects in gRPC. + DisableAutoChecksum bool + // ChunkSize controls the maximum number of bytes of the object that the // Writer will attempt to send to the server in a single request. Objects // smaller than the size will be sent in a single request, while larger @@ -261,7 +277,7 @@ func (w *Writer) Close() error { w.closed = true w.mu.Lock() defer w.mu.Unlock() - trace.EndSpan(w.ctx, w.err) + endSpan(w.ctx, w.err) return w.err } @@ -274,6 +290,8 @@ func (w *Writer) openWriter() (err error) { } isIdempotent := w.o.conds != nil && (w.o.conds.GenerationMatch >= 0 || w.o.conds.DoesNotExist) + // Append operations that takeover a specific generation are idempotent. + isIdempotent = isIdempotent || w.Append && w.o.gen > 0 opts := makeStorageOpts(isIdempotent, w.o.retry, w.o.userProject) params := &openWriterParams{ ctx: w.ctx, @@ -286,6 +304,7 @@ func (w *Writer) openWriter() (err error) { appendGen: w.o.gen, encryptionKey: w.o.encryptionKey, sendCRC32C: w.SendCRC32C, + disableAutoChecksum: w.DisableAutoChecksum, append: w.Append, finalizeOnClose: w.FinalizeOnClose, donec: w.donec, diff --git a/vendor/github.com/chavacava/garif/.gitignore b/vendor/codeberg.org/chavacava/garif/.gitignore similarity index 100% rename from vendor/github.com/chavacava/garif/.gitignore rename to vendor/codeberg.org/chavacava/garif/.gitignore diff --git a/vendor/github.com/chavacava/garif/LICENSE b/vendor/codeberg.org/chavacava/garif/LICENSE similarity index 100% rename from vendor/github.com/chavacava/garif/LICENSE rename to vendor/codeberg.org/chavacava/garif/LICENSE diff --git a/vendor/codeberg.org/chavacava/garif/README.md b/vendor/codeberg.org/chavacava/garif/README.md new file mode 100644 index 00000000000..c1cc80d3bfb --- /dev/null +++ b/vendor/codeberg.org/chavacava/garif/README.md @@ -0,0 +1,52 @@ +# garif + +A Go package to create and manipulate SARIF logs. + +SARIF, from _Static Analysis Results Interchange Format_, is a standard JSON-based format for the output of static analysis tools defined and promoted by [OASIS](https://www.oasis-open.org/). + +Current supported version of the standard is [SARIF-v2.1.0](https://docs.oasis-open.org/sarif/sarif/v2.1.0/csprd01/sarif-v2.1.0-csprd01.html +). + +## Usage + +The package provides access to every element of the SARIF model, therefore you are free to manipulate it at every detail. + +The package also provides constructors functions (`New...`) and decorators methods (`With...`) that simplify the creation of SARIF files for common use cases. + +Using these constructors and decorators we can easily create the example SARIF file of the [Microsoft SARIF pages](https://github.com/microsoft/sarif-tutorials/blob/master/docs/1-Introduction.md) + + +```go +import to `github.com/chavacava/garif` + +// ... + +rule := garif.NewRule("no-unused-vars"). + WithHelpUri("https://eslint.org/docs/rules/no-unused-vars"). + WithShortDescription("disallow unused variables"). + WithProperties("category", "Variables") + +driver := garif.NewDriver("ESLint"). + WithInformationUri("https://eslint.org"). + WithRules(rule) + +run := garif.NewRun(NewTool(driver)). + WithArtifactsURIs("file:///C:/dev/sarif/sarif-tutorials/samples/Introduction/simple-example.js") + +run.WithResult(rule.Id, "'x' is assigned a value but never used.", "file:///C:/dev/sarif/sarif-tutorials/samples/Introduction/simple-example.js", 1, 5) + +logFile := garif.NewLogFile([]*Run{run}, Version210) + +logFile.Write(os.Stdout) +``` + +## Why this package? +This package was initiated during my works on adding to [`revive`](https://github.com/mgechev/revive) a SARIF output formatter. +I've tried to use [go-sarif](https://github.com/owenrumney/go-sarif) by [Owen Rumney](https://github.com/owenrumney) but it is too focused in the use case of the static analyzer [tfsec](https://tfsec.dev) so I've decided to create a package flexible enough to generate SARIF files in broader cases. + +## More information about SARIF +For more information about SARIF, you can visit the [Oasis Open](https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=sarif) site. + + +## Contributing +Of course, contributions are welcome! \ No newline at end of file diff --git a/vendor/github.com/chavacava/garif/constructors.go b/vendor/codeberg.org/chavacava/garif/constructors.go similarity index 100% rename from vendor/github.com/chavacava/garif/constructors.go rename to vendor/codeberg.org/chavacava/garif/constructors.go diff --git a/vendor/github.com/chavacava/garif/decorators.go b/vendor/codeberg.org/chavacava/garif/decorators.go similarity index 100% rename from vendor/github.com/chavacava/garif/decorators.go rename to vendor/codeberg.org/chavacava/garif/decorators.go diff --git a/vendor/codeberg.org/chavacava/garif/doc.go b/vendor/codeberg.org/chavacava/garif/doc.go new file mode 100644 index 00000000000..5ac5a156aba --- /dev/null +++ b/vendor/codeberg.org/chavacava/garif/doc.go @@ -0,0 +1,11 @@ +// Package garif defines all the Go structures required to model a SARIF log file. +// These structures were created using the JSON-schema sarif-schema-2.1.0.json of SARIF logfiles +// available at https://github.com/oasis-tcs/sarif-spec/tree/master/Schemata. +// +// The package provides constructors for all structures (see constructors.go) These constructors +// ensure that the returned structure instantiation is valid with respect to the JSON schema and +// should be used in place of plain structure instantiation. +// The root structure is LogFile. +// +// The package provides utility decorators for the most commonly used structures (see decorators.go) +package garif diff --git a/vendor/github.com/chavacava/garif/enums.go b/vendor/codeberg.org/chavacava/garif/enums.go similarity index 100% rename from vendor/github.com/chavacava/garif/enums.go rename to vendor/codeberg.org/chavacava/garif/enums.go diff --git a/vendor/github.com/chavacava/garif/io.go b/vendor/codeberg.org/chavacava/garif/io.go similarity index 100% rename from vendor/github.com/chavacava/garif/io.go rename to vendor/codeberg.org/chavacava/garif/io.go diff --git a/vendor/codeberg.org/chavacava/garif/models.go b/vendor/codeberg.org/chavacava/garif/models.go new file mode 100644 index 00000000000..ed18b04a595 --- /dev/null +++ b/vendor/codeberg.org/chavacava/garif/models.go @@ -0,0 +1,1486 @@ +package garif + +// Address A physical or virtual address, or a range of addresses, in an 'addressable region' (memory or a binary file). +type Address struct { + + // The address expressed as a byte offset from the start of the addressable region. + AbsoluteAddress int `json:"absoluteAddress,omitempty"` + + // A human-readable fully qualified name that is associated with the address. + FullyQualifiedName string `json:"fullyQualifiedName,omitempty"` + + // The index within run.addresses of the cached object for this address. + Index int `json:"index,omitempty"` + + // An open-ended string that identifies the address kind. + // 'data', 'function', 'header','instruction', 'module', 'page', 'section', + // 'segment', 'stack', 'stackFrame', 'table' are well-known values. + Kind string `json:"kind,omitempty"` + + // The number of bytes in this range of addresses. + Length int `json:"length,omitempty"` + + // A name that is associated with the address, e.g., '.text'. + Name string `json:"name,omitempty"` + + // The byte offset of this address from the absolute or relative address of the parent object. + OffsetFromParent int `json:"offsetFromParent,omitempty"` + + // The index within run.addresses of the parent object. + ParentIndex int `json:"parentIndex,omitempty"` + + // Key/value pairs that provide additional information about the address. + Properties *PropertyBag `json:"properties,omitempty"` + + // The address expressed as a byte offset from the absolute address of the top-most parent object. + RelativeAddress int `json:"relativeAddress,omitempty"` +} + +// Artifact A single artifact. In some cases, this artifact might be nested within another artifact. +type Artifact struct { + + // The contents of the artifact. + Contents *ArtifactContent `json:"contents,omitempty"` + + // A short description of the artifact. + Description *Message `json:"description,omitempty"` + + // Specifies the encoding for an artifact object that refers to a text file. + Encoding string `json:"encoding,omitempty"` + + // A dictionary, each of whose keys is the name of a hash function and each of whose values is + // the hashed value of the artifact produced by the specified hash function. + Hashes map[string]string `json:"hashes,omitempty"` + + // The Coordinated Universal Time (UTC) date and time at which the artifact was most recently modified. + // See "Date/time properties" in the SARIF spec for the required format. + LastModifiedTimeUtc string `json:"lastModifiedTimeUtc,omitempty"` + + // The length of the artifact in bytes. + Length int `json:"length,omitempty"` + + // The location of the artifact. + Location *ArtifactLocation `json:"location,omitempty"` + + // The MIME type (RFC 2045) of the artifact. + MimeType string `json:"mimeType,omitempty"` + + // The offset in bytes of the artifact within its containing artifact. + Offset int `json:"offset,omitempty"` + + // Identifies the index of the immediate parent of the artifact, if this artifact is nested. + ParentIndex int `json:"parentIndex,omitempty"` + + // Key/value pairs that provide additional information about the artifact. + Properties *PropertyBag `json:"properties,omitempty"` + + // The role or roles played by the artifact in the analysis. + Roles []interface{} `json:"roles,omitempty"` + + // Specifies the source language for any artifact object that refers to a text file that contains source code. + SourceLanguage string `json:"sourceLanguage,omitempty"` +} + +// ArtifactChange A change to a single artifact. +type ArtifactChange struct { + + // The location of the artifact to change. + ArtifactLocation *ArtifactLocation `json:"artifactLocation"` + + // Key/value pairs that provide additional information about the change. + Properties *PropertyBag `json:"properties,omitempty"` + + // An array of replacement objects, each of which represents the replacement of a single region in a + // single artifact specified by 'artifactLocation'. + Replacements []*Replacement `json:"replacements"` +} + +// ArtifactContent Represents the contents of an artifact. +type ArtifactContent struct { + + // MIME Base64-encoded content from a binary artifact, or from a text artifact in its original encoding. + Binary string `json:"binary,omitempty"` + + // Key/value pairs that provide additional information about the artifact content. + Properties *PropertyBag `json:"properties,omitempty"` + + // An alternate rendered representation of the artifact (e.g., a decompiled representation of a binary region). + Rendered *MultiformatMessageString `json:"rendered,omitempty"` + + // UTF-8-encoded content from a text artifact. + Text string `json:"text,omitempty"` +} + +// ArtifactLocation Specifies the location of an artifact. +type ArtifactLocation struct { + + // A short description of the artifact location. + Description *Message `json:"description,omitempty"` + + // The index within the run artifacts array of the artifact object associated with the artifact location. + Index int `json:"index,omitempty"` + + // Key/value pairs that provide additional information about the artifact location. + Properties *PropertyBag `json:"properties,omitempty"` + + // A string containing a valid relative or absolute URI. + Uri string `json:"uri,omitempty"` + + // A string which indirectly specifies the absolute URI with respect to which a relative URI in the "uri" property is interpreted. + UriBaseId string `json:"uriBaseId,omitempty"` +} + +// Attachment An artifact relevant to a result. +type Attachment struct { + + // The location of the attachment. + ArtifactLocation *ArtifactLocation `json:"artifactLocation"` + + // A message describing the role played by the attachment. + Description *Message `json:"description,omitempty"` + + // Key/value pairs that provide additional information about the attachment. + Properties *PropertyBag `json:"properties,omitempty"` + + // An array of rectangles specifying areas of interest within the image. + Rectangles []*Rectangle `json:"rectangles,omitempty"` + + // An array of regions of interest within the attachment. + Regions []*Region `json:"regions,omitempty"` +} + +// CodeFlow A set of threadFlows which together describe a pattern of code execution relevant to detecting a result. +type CodeFlow struct { + + // A message relevant to the code flow. + Message *Message `json:"message,omitempty"` + + // Key/value pairs that provide additional information about the code flow. + Properties *PropertyBag `json:"properties,omitempty"` + + // An array of one or more unique threadFlow objects, each of which describes the progress of a program + // through a thread of execution. + ThreadFlows []*ThreadFlow `json:"threadFlows"` +} + +// ConfigurationOverride Information about how a specific rule or notification was reconfigured at runtime. +type ConfigurationOverride struct { + + // Specifies how the rule or notification was configured during the scan. + Configuration *ReportingConfiguration `json:"configuration"` + + // A reference used to locate the descriptor whose configuration was overridden. + Descriptor *ReportingDescriptorReference `json:"descriptor"` + + // Key/value pairs that provide additional information about the configuration override. + Properties *PropertyBag `json:"properties,omitempty"` +} + +// Conversion Describes how a converter transformed the output of a static analysis tool from the analysis tool's native output format into the SARIF format. +type Conversion struct { + + // The locations of the analysis tool's per-run log files. + AnalysisToolLogFiles []*ArtifactLocation `json:"analysisToolLogFiles,omitempty"` + + // An invocation object that describes the invocation of the converter. + Invocation *Invocation `json:"invocation,omitempty"` + + // Key/value pairs that provide additional information about the conversion. + Properties *PropertyBag `json:"properties,omitempty"` + + // A tool object that describes the converter. + Tool *Tool `json:"tool"` +} + +// Edge Represents a directed edge in a graph. +type Edge struct { + + // A string that uniquely identifies the edge within its graph. + Id string `json:"id"` + + // A short description of the edge. + Label *Message `json:"label,omitempty"` + + // Key/value pairs that provide additional information about the edge. + Properties *PropertyBag `json:"properties,omitempty"` + + // Identifies the source node (the node at which the edge starts). + SourceNodeId string `json:"sourceNodeId"` + + // Identifies the target node (the node at which the edge ends). + TargetNodeId string `json:"targetNodeId"` +} + +// EdgeTraversal Represents the traversal of a single edge during a graph traversal. +type EdgeTraversal struct { + + // Identifies the edge being traversed. + EdgeId string `json:"edgeId"` + + // The values of relevant expressions after the edge has been traversed. + FinalState map[string]*MultiformatMessageString `json:"finalState,omitempty"` + + // A message to display to the user as the edge is traversed. + Message *Message `json:"message,omitempty"` + + // Key/value pairs that provide additional information about the edge traversal. + Properties *PropertyBag `json:"properties,omitempty"` + + // The number of edge traversals necessary to return from a nested graph. + StepOverEdgeCount int `json:"stepOverEdgeCount,omitempty"` +} + +// Exception Describes a runtime exception encountered during the execution of an analysis tool. +type Exception struct { + + // An array of exception objects each of which is considered a cause of this exception. + InnerExceptions []*Exception `json:"innerExceptions,omitempty"` + + // A string that identifies the kind of exception, for example, the fully qualified type name of an object that was thrown, or the symbolic name of a signal. + Kind string `json:"kind,omitempty"` + + // A message that describes the exception. + Message string `json:"message,omitempty"` + + // Key/value pairs that provide additional information about the exception. + Properties *PropertyBag `json:"properties,omitempty"` + + // The sequence of function calls leading to the exception. + Stack *Stack `json:"stack,omitempty"` +} + +// ExternalProperties The top-level element of an external property file. +type ExternalProperties struct { + + // Addresses that will be merged with a separate run. + Addresses []*Address `json:"addresses,omitempty"` + + // An array of artifact objects that will be merged with a separate run. + Artifacts []*Artifact `json:"artifacts,omitempty"` + + // A conversion object that will be merged with a separate run. + Conversion *Conversion `json:"conversion,omitempty"` + + // The analysis tool object that will be merged with a separate run. + Driver *ToolComponent `json:"driver,omitempty"` + + // Tool extensions that will be merged with a separate run. + Extensions []*ToolComponent `json:"extensions,omitempty"` + + // Key/value pairs that provide additional information that will be merged with a separate run. + ExternalizedProperties *PropertyBag `json:"externalizedProperties,omitempty"` + + // An array of graph objects that will be merged with a separate run. + Graphs []*Graph `json:"graphs,omitempty"` + + // A stable, unique identifier for this external properties object, in the form of a GUID. + Guid string `json:"guid,omitempty"` + + // Describes the invocation of the analysis tool that will be merged with a separate run. + Invocations []*Invocation `json:"invocations,omitempty"` + + // An array of logical locations such as namespaces, types or functions that will be merged with a separate run. + LogicalLocations []*LogicalLocation `json:"logicalLocations,omitempty"` + + // Tool policies that will be merged with a separate run. + Policies []*ToolComponent `json:"policies,omitempty"` + + // Key/value pairs that provide additional information about the external properties. + Properties *PropertyBag `json:"properties,omitempty"` + + // An array of result objects that will be merged with a separate run. + Results []*Result `json:"results,omitempty"` + + // A stable, unique identifier for the run associated with this external properties object, in the form of a GUID. + RunGuid string `json:"runGuid,omitempty"` + + // The URI of the JSON schema corresponding to the version of the external property file format. + Schema string `json:"schema,omitempty"` + + // Tool taxonomies that will be merged with a separate run. + Taxonomies []*ToolComponent `json:"taxonomies,omitempty"` + + // An array of threadFlowLocation objects that will be merged with a separate run. + ThreadFlowLocations []*ThreadFlowLocation `json:"threadFlowLocations,omitempty"` + + // Tool translations that will be merged with a separate run. + Translations []*ToolComponent `json:"translations,omitempty"` + + // The SARIF format version of this external properties object. + Version interface{} `json:"version,omitempty"` + + // Requests that will be merged with a separate run. + WebRequests []*WebRequest `json:"webRequests,omitempty"` + + // Responses that will be merged with a separate run. + WebResponses []*WebResponse `json:"webResponses,omitempty"` +} + +// ExternalPropertyFileReference Contains information that enables a SARIF consumer to locate the external property file that contains the value of an externalized property associated with the run. +type ExternalPropertyFileReference struct { + + // A stable, unique identifier for the external property file in the form of a GUID. + Guid string `json:"guid,omitempty"` + + // A non-negative integer specifying the number of items contained in the external property file. + ItemCount int `json:"itemCount,omitempty"` + + // The location of the external property file. + Location *ArtifactLocation `json:"location,omitempty"` + + // Key/value pairs that provide additional information about the external property file. + Properties *PropertyBag `json:"properties,omitempty"` +} + +// ExternalPropertyFileReferences References to external property files that should be inlined with the content of a root log file. +type ExternalPropertyFileReferences struct { + + // An array of external property files containing run.addresses arrays to be merged with the root log file. + Addresses []*ExternalPropertyFileReference `json:"addresses,omitempty"` + + // An array of external property files containing run.artifacts arrays to be merged with the root log file. + Artifacts []*ExternalPropertyFileReference `json:"artifacts,omitempty"` + + // An external property file containing a run.conversion object to be merged with the root log file. + Conversion *ExternalPropertyFileReference `json:"conversion,omitempty"` + + // An external property file containing a run.driver object to be merged with the root log file. + Driver *ExternalPropertyFileReference `json:"driver,omitempty"` + + // An array of external property files containing run.extensions arrays to be merged with the root log file. + Extensions []*ExternalPropertyFileReference `json:"extensions,omitempty"` + + // An external property file containing a run.properties object to be merged with the root log file. + ExternalizedProperties *ExternalPropertyFileReference `json:"externalizedProperties,omitempty"` + + // An array of external property files containing a run.graphs object to be merged with the root log file. + Graphs []*ExternalPropertyFileReference `json:"graphs,omitempty"` + + // An array of external property files containing run.invocations arrays to be merged with the root log file. + Invocations []*ExternalPropertyFileReference `json:"invocations,omitempty"` + + // An array of external property files containing run.logicalLocations arrays to be merged with the root log file. + LogicalLocations []*ExternalPropertyFileReference `json:"logicalLocations,omitempty"` + + // An array of external property files containing run.policies arrays to be merged with the root log file. + Policies []*ExternalPropertyFileReference `json:"policies,omitempty"` + + // Key/value pairs that provide additional information about the external property files. + Properties *PropertyBag `json:"properties,omitempty"` + + // An array of external property files containing run.results arrays to be merged with the root log file. + Results []*ExternalPropertyFileReference `json:"results,omitempty"` + + // An array of external property files containing run.taxonomies arrays to be merged with the root log file. + Taxonomies []*ExternalPropertyFileReference `json:"taxonomies,omitempty"` + + // An array of external property files containing run.threadFlowLocations arrays to be merged with the root log file. + ThreadFlowLocations []*ExternalPropertyFileReference `json:"threadFlowLocations,omitempty"` + + // An array of external property files containing run.translations arrays to be merged with the root log file. + Translations []*ExternalPropertyFileReference `json:"translations,omitempty"` + + // An array of external property files containing run.requests arrays to be merged with the root log file. + WebRequests []*ExternalPropertyFileReference `json:"webRequests,omitempty"` + + // An array of external property files containing run.responses arrays to be merged with the root log file. + WebResponses []*ExternalPropertyFileReference `json:"webResponses,omitempty"` +} + +// Fix A proposed fix for the problem represented by a result object. +// A fix specifies a set of artifacts to modify. For each artifact, +// it specifies a set of bytes to remove, and provides a set of new bytes to replace them. +type Fix struct { + + // One or more artifact changes that comprise a fix for a result. + ArtifactChanges []*ArtifactChange `json:"artifactChanges"` + + // A message that describes the proposed fix, enabling viewers to present the proposed change to an end user. + Description *Message `json:"description,omitempty"` + + // Key/value pairs that provide additional information about the fix. + Properties *PropertyBag `json:"properties,omitempty"` +} + +// Graph A network of nodes and directed edges that describes some aspect of the +// structure of the code (for example, a call graph). +type Graph struct { + + // A description of the graph. + Description *Message `json:"description,omitempty"` + + // An array of edge objects representing the edges of the graph. + Edges []*Edge `json:"edges,omitempty"` + + // An array of node objects representing the nodes of the graph. + Nodes []*Node `json:"nodes,omitempty"` + + // Key/value pairs that provide additional information about the graph. + Properties *PropertyBag `json:"properties,omitempty"` +} + +// GraphTraversal Represents a path through a graph. +type GraphTraversal struct { + + // A description of this graph traversal. + Description *Message `json:"description,omitempty"` + + // The sequences of edges traversed by this graph traversal. + EdgeTraversals []*EdgeTraversal `json:"edgeTraversals,omitempty"` + + // Values of relevant expressions at the start of the graph traversal that remain constant for the graph traversal. + ImmutableState map[string]*MultiformatMessageString `json:"immutableState,omitempty"` + + // Values of relevant expressions at the start of the graph traversal that may change during graph traversal. + InitialState map[string]*MultiformatMessageString `json:"initialState,omitempty"` + + // Key/value pairs that provide additional information about the graph traversal. + Properties *PropertyBag `json:"properties,omitempty"` + + // The index within the result.graphs to be associated with the result. + ResultGraphIndex int `json:"resultGraphIndex,omitempty"` + + // The index within the run.graphs to be associated with the result. + RunGraphIndex int `json:"runGraphIndex,omitempty"` +} + +// Invocation The runtime environment of the analysis tool run. +type Invocation struct { + + // The account under which the invocation occurred. + Account string `json:"account,omitempty"` + + // An array of strings, containing in order the command line arguments passed to the tool from the operating system. + Arguments []string `json:"arguments,omitempty"` + + // The command line used to invoke the tool. + CommandLine string `json:"commandLine,omitempty"` + + // The Coordinated Universal Time (UTC) date and time at which the invocation ended. See "Date/time properties" in the SARIF spec for the required format. + EndTimeUtc string `json:"endTimeUtc,omitempty"` + + // The environment variables associated with the analysis tool process, expressed as key/value pairs. + EnvironmentVariables map[string]string `json:"environmentVariables,omitempty"` + + // An absolute URI specifying the location of the executable that was invoked. + ExecutableLocation *ArtifactLocation `json:"executableLocation,omitempty"` + + // Specifies whether the tool's execution completed successfully. + ExecutionSuccessful bool `json:"executionSuccessful"` + + // The process exit code. + ExitCode int `json:"exitCode,omitempty"` + + // The reason for the process exit. + ExitCodeDescription string `json:"exitCodeDescription,omitempty"` + + // The name of the signal that caused the process to exit. + ExitSignalName string `json:"exitSignalName,omitempty"` + + // The numeric value of the signal that caused the process to exit. + ExitSignalNumber int `json:"exitSignalNumber,omitempty"` + + // The machine on which the invocation occurred. + Machine string `json:"machine,omitempty"` + + // An array of configurationOverride objects that describe notifications related runtime overrides. + NotificationConfigurationOverrides []*ConfigurationOverride `json:"notificationConfigurationOverrides,omitempty"` + + // The id of the process in which the invocation occurred. + ProcessId int `json:"processId,omitempty"` + + // The reason given by the operating system that the process failed to start. + ProcessStartFailureMessage string `json:"processStartFailureMessage,omitempty"` + + // Key/value pairs that provide additional information about the invocation. + Properties *PropertyBag `json:"properties,omitempty"` + + // The locations of any response files specified on the tool's command line. + ResponseFiles []*ArtifactLocation `json:"responseFiles,omitempty"` + + // An array of configurationOverride objects that describe rules related runtime overrides. + RuleConfigurationOverrides []*ConfigurationOverride `json:"ruleConfigurationOverrides,omitempty"` + + // The Coordinated Universal Time (UTC) date and time at which the invocation started. See "Date/time properties" in the SARIF spec for the required format. + StartTimeUtc string `json:"startTimeUtc,omitempty"` + + // A file containing the standard error stream from the process that was invoked. + Stderr *ArtifactLocation `json:"stderr,omitempty"` + + // A file containing the standard input stream to the process that was invoked. + Stdin *ArtifactLocation `json:"stdin,omitempty"` + + // A file containing the standard output stream from the process that was invoked. + Stdout *ArtifactLocation `json:"stdout,omitempty"` + + // A file containing the interleaved standard output and standard error stream from the process that was invoked. + StdoutStderr *ArtifactLocation `json:"stdoutStderr,omitempty"` + + // A list of conditions detected by the tool that are relevant to the tool's configuration. + ToolConfigurationNotifications []*Notification `json:"toolConfigurationNotifications,omitempty"` + + // A list of runtime conditions detected by the tool during the analysis. + ToolExecutionNotifications []*Notification `json:"toolExecutionNotifications,omitempty"` + + // The working directory for the invocation. + WorkingDirectory *ArtifactLocation `json:"workingDirectory,omitempty"` +} + +// Location A location within a programming artifact. +type Location struct { + + // A set of regions relevant to the location. + Annotations []*Region `json:"annotations,omitempty"` + + // Value that distinguishes this location from all other locations within a single result object. + Id int `json:"id,omitempty"` + + // The logical locations associated with the result. + LogicalLocations []*LogicalLocation `json:"logicalLocations,omitempty"` + + // A message relevant to the location. + Message *Message `json:"message,omitempty"` + + // Identifies the artifact and region. + PhysicalLocation *PhysicalLocation `json:"physicalLocation,omitempty"` + + // Key/value pairs that provide additional information about the location. + Properties *PropertyBag `json:"properties,omitempty"` + + // An array of objects that describe relationships between this location and others. + Relationships []*LocationRelationship `json:"relationships,omitempty"` +} + +// LocationRelationship Information about the relation of one location to another. +type LocationRelationship struct { + + // A description of the location relationship. + Description *Message `json:"description,omitempty"` + + // A set of distinct strings that categorize the relationship. Well-known kinds include 'includes', 'isIncludedBy' and 'relevant'. + Kinds []string `json:"kinds,omitempty"` + + // Key/value pairs that provide additional information about the location relationship. + Properties *PropertyBag `json:"properties,omitempty"` + + // A reference to the related location. + Target int `json:"target"` +} + +// LogFile Static Analysis Results Format (SARIF) Version 2.1.0 JSON Schema. +type LogFile struct { + + // References to external property files that share data between runs. + InlineExternalProperties []*ExternalProperties `json:"inlineExternalProperties,omitempty"` + + // Key/value pairs that provide additional information about the log file. + Properties *PropertyBag `json:"properties,omitempty"` + + // The set of runs contained in this log file. + Runs []*Run `json:"runs"` + + // The URI of the JSON schema corresponding to the version. + Schema string `json:"$schema,omitempty"` + + // The SARIF format version of this log file. + Version interface{} `json:"version"` +} + +// LogicalLocation A logical location of a construct that produced a result. +type LogicalLocation struct { + + // The machine-readable name for the logical location, such as a mangled function name provided by a C++ compiler that encodes calling convention, return type and other details along with the function name. + DecoratedName string `json:"decoratedName,omitempty"` + + // The human-readable fully qualified name of the logical location. + FullyQualifiedName string `json:"fullyQualifiedName,omitempty"` + + // The index within the logical locations array. + Index int `json:"index,omitempty"` + + // The type of construct this logical location component refers to. Should be one of 'function', 'member', 'module', 'namespace', 'parameter', 'resource', 'returnType', 'type', 'variable', 'object', 'array', 'property', 'value', 'element', 'text', 'attribute', 'comment', 'declaration', 'dtd' or 'processingInstruction', if any of those accurately describe the construct. + Kind string `json:"kind,omitempty"` + + // Identifies the construct in which the result occurred. For example, this property might contain the name of a class or a method. + Name string `json:"name,omitempty"` + + // Identifies the index of the immediate parent of the construct in which the result was detected. For example, this property might point to a logical location that represents the namespace that holds a type. + ParentIndex int `json:"parentIndex,omitempty"` + + // Key/value pairs that provide additional information about the logical location. + Properties *PropertyBag `json:"properties,omitempty"` +} + +// Message Encapsulates a message intended to be read by the end user. +type Message struct { + + // An array of strings to substitute into the message string. + Arguments []string `json:"arguments,omitempty"` + + // The identifier for this message. + Id string `json:"id,omitempty"` + + // A Markdown message string. + Markdown string `json:"markdown,omitempty"` + + // Key/value pairs that provide additional information about the message. + Properties *PropertyBag `json:"properties,omitempty"` + + // A plain text message string. + Text string `json:"text,omitempty"` +} + +// MultiformatMessageString A message string or message format string rendered in multiple formats. +type MultiformatMessageString struct { + + // A Markdown message string or format string. + Markdown string `json:"markdown,omitempty"` + + // Key/value pairs that provide additional information about the message. + Properties *PropertyBag `json:"properties,omitempty"` + + // A plain text message string or format string. + Text string `json:"text"` +} + +// Node Represents a node in a graph. +type Node struct { + + // Array of child nodes. + Children []*Node `json:"children,omitempty"` + + // A string that uniquely identifies the node within its graph. + Id string `json:"id"` + + // A short description of the node. + Label *Message `json:"label,omitempty"` + + // A code location associated with the node. + Location *Location `json:"location,omitempty"` + + // Key/value pairs that provide additional information about the node. + Properties *PropertyBag `json:"properties,omitempty"` +} + +// Notification Describes a condition relevant to the tool itself, as opposed to being relevant to a target being analyzed by the tool. +type Notification struct { + + // A reference used to locate the rule descriptor associated with this notification. + AssociatedRule *ReportingDescriptorReference `json:"associatedRule,omitempty"` + + // A reference used to locate the descriptor relevant to this notification. + Descriptor *ReportingDescriptorReference `json:"descriptor,omitempty"` + + // The runtime exception, if any, relevant to this notification. + Exception *Exception `json:"exception,omitempty"` + + // A value specifying the severity level of the notification. + Level interface{} `json:"level,omitempty"` + + // The locations relevant to this notification. + Locations []*Location `json:"locations,omitempty"` + + // A message that describes the condition that was encountered. + Message *Message `json:"message"` + + // Key/value pairs that provide additional information about the notification. + Properties *PropertyBag `json:"properties,omitempty"` + + // The thread identifier of the code that generated the notification. + ThreadId int `json:"threadId,omitempty"` + + // The Coordinated Universal Time (UTC) date and time at which the analysis tool generated the notification. + TimeUtc string `json:"timeUtc,omitempty"` +} + +// PhysicalLocation A physical location relevant to a result. Specifies a reference to a programming artifact together with a range of bytes or characters within that artifact. +type PhysicalLocation struct { + + // The address of the location. + Address *Address `json:"address,omitempty"` + + // The location of the artifact. + ArtifactLocation *ArtifactLocation `json:"artifactLocation,omitempty"` + + // Specifies a portion of the artifact that encloses the region. Allows a viewer to display additional context around the region. + ContextRegion *Region `json:"contextRegion,omitempty"` + + // Key/value pairs that provide additional information about the physical location. + Properties *PropertyBag `json:"properties,omitempty"` + + // Specifies a portion of the artifact. + Region *Region `json:"region,omitempty"` +} + +type PropertyBag map[string]interface{} + +/* +// PropertyBag Key/value pairs that provide additional information about the object. +type PropertyBag struct { + AdditionalProperties map[string]interface{} `json:"-,omitempty"` + + // A set of distinct strings that provide additional information. + Tags []string `json:"tags,omitempty"` +} +*/ +// Rectangle An area within an image. +type Rectangle struct { + + // The Y coordinate of the bottom edge of the rectangle, measured in the image's natural units. + Bottom float64 `json:"bottom,omitempty"` + + // The X coordinate of the left edge of the rectangle, measured in the image's natural units. + Left float64 `json:"left,omitempty"` + + // A message relevant to the rectangle. + Message *Message `json:"message,omitempty"` + + // Key/value pairs that provide additional information about the rectangle. + Properties *PropertyBag `json:"properties,omitempty"` + + // The X coordinate of the right edge of the rectangle, measured in the image's natural units. + Right float64 `json:"right,omitempty"` + + // The Y coordinate of the top edge of the rectangle, measured in the image's natural units. + Top float64 `json:"top,omitempty"` +} + +// Region A region within an artifact where a result was detected. +type Region struct { + + // The length of the region in bytes. + ByteLength int `json:"byteLength,omitempty"` + + // The zero-based offset from the beginning of the artifact of the first byte in the region. + ByteOffset int `json:"byteOffset,omitempty"` + + // The length of the region in characters. + CharLength int `json:"charLength,omitempty"` + + // The zero-based offset from the beginning of the artifact of the first character in the region. + CharOffset int `json:"charOffset,omitempty"` + + // The column number of the character following the end of the region. + EndColumn int `json:"endColumn,omitempty"` + + // The line number of the last character in the region. + EndLine int `json:"endLine,omitempty"` + + // A message relevant to the region. + Message *Message `json:"message,omitempty"` + + // Key/value pairs that provide additional information about the region. + Properties *PropertyBag `json:"properties,omitempty"` + + // The portion of the artifact contents within the specified region. + Snippet *ArtifactContent `json:"snippet,omitempty"` + + // Specifies the source language, if any, of the portion of the artifact specified by the region object. + SourceLanguage string `json:"sourceLanguage,omitempty"` + + // The column number of the first character in the region. + StartColumn int `json:"startColumn,omitempty"` + + // The line number of the first character in the region. + StartLine int `json:"startLine,omitempty"` +} + +// Replacement The replacement of a single region of an artifact. +type Replacement struct { + + // The region of the artifact to delete. + DeletedRegion *Region `json:"deletedRegion"` + + // The content to insert at the location specified by the 'deletedRegion' property. + InsertedContent *ArtifactContent `json:"insertedContent,omitempty"` + + // Key/value pairs that provide additional information about the replacement. + Properties *PropertyBag `json:"properties,omitempty"` +} + +// ReportingConfiguration Information about a rule or notification that can be configured at runtime. +type ReportingConfiguration struct { + + // Specifies whether the report may be produced during the scan. + Enabled bool `json:"enabled,omitempty"` + + // Specifies the failure level for the report. + Level interface{} `json:"level,omitempty"` + + // Contains configuration information specific to a report. + Parameters *PropertyBag `json:"parameters,omitempty"` + + // Key/value pairs that provide additional information about the reporting configuration. + Properties *PropertyBag `json:"properties,omitempty"` + + // Specifies the relative priority of the report. Used for analysis output only. + Rank float64 `json:"rank,omitempty"` +} + +// ReportingDescriptor Metadata that describes a specific report produced by the tool, as part of the analysis it provides or its runtime reporting. +type ReportingDescriptor struct { + + // Default reporting configuration information. + DefaultConfiguration *ReportingConfiguration `json:"defaultConfiguration,omitempty"` + + // An array of unique identifies in the form of a GUID by which this report was known in some previous version of the analysis tool. + DeprecatedGuids []string `json:"deprecatedGuids,omitempty"` + + // An array of stable, opaque identifiers by which this report was known in some previous version of the analysis tool. + DeprecatedIds []string `json:"deprecatedIds,omitempty"` + + // An array of readable identifiers by which this report was known in some previous version of the analysis tool. + DeprecatedNames []string `json:"deprecatedNames,omitempty"` + + // A description of the report. Should, as far as possible, provide details sufficient to enable resolution of any problem indicated by the result. + FullDescription *MultiformatMessageString `json:"fullDescription,omitempty"` + + // A unique identifier for the reporting descriptor in the form of a GUID. + Guid string `json:"guid,omitempty"` + + // Provides the primary documentation for the report, useful when there is no online documentation. + Help *MultiformatMessageString `json:"help,omitempty"` + + // A URI where the primary documentation for the report can be found. + HelpUri string `json:"helpUri,omitempty"` + + // A stable, opaque identifier for the report. + Id string `json:"id"` + + // A set of name/value pairs with arbitrary names. Each value is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in combination with an arbitrary number of additional string arguments. + MessageStrings map[string]*MultiformatMessageString `json:"messageStrings,omitempty"` + + // A report identifier that is understandable to an end user. + Name string `json:"name,omitempty"` + + // Key/value pairs that provide additional information about the report. + Properties *PropertyBag `json:"properties,omitempty"` + + // An array of objects that describe relationships between this reporting descriptor and others. + Relationships []*ReportingDescriptorRelationship `json:"relationships,omitempty"` + + // A concise description of the report. Should be a single sentence that is understandable when visible space is limited to a single line of text. + ShortDescription *MultiformatMessageString `json:"shortDescription,omitempty"` +} + +// ReportingDescriptorReference Information about how to locate a relevant reporting descriptor. +type ReportingDescriptorReference struct { + + // A guid that uniquely identifies the descriptor. + Guid string `json:"guid,omitempty"` + + // The id of the descriptor. + Id string `json:"id,omitempty"` + + // The index into an array of descriptors in toolComponent.ruleDescriptors, toolComponent.notificationDescriptors, or toolComponent.taxonomyDescriptors, depending on context. + Index int `json:"index,omitempty"` + + // Key/value pairs that provide additional information about the reporting descriptor reference. + Properties *PropertyBag `json:"properties,omitempty"` + + // A reference used to locate the toolComponent associated with the descriptor. + ToolComponent *ToolComponentReference `json:"toolComponent,omitempty"` +} + +// ReportingDescriptorRelationship Information about the relation of one reporting descriptor to another. +type ReportingDescriptorRelationship struct { + + // A description of the reporting descriptor relationship. + Description *Message `json:"description,omitempty"` + + // A set of distinct strings that categorize the relationship. Well-known kinds include 'canPrecede', 'canFollow', 'willPrecede', 'willFollow', 'superset', 'subset', 'equal', 'disjoint', 'relevant', and 'incomparable'. + Kinds []string `json:"kinds,omitempty"` + + // Key/value pairs that provide additional information about the reporting descriptor reference. + Properties *PropertyBag `json:"properties,omitempty"` + + // A reference to the related reporting descriptor. + Target *ReportingDescriptorReference `json:"target"` +} + +// Result A result produced by an analysis tool. +type Result struct { + + // Identifies the artifact that the analysis tool was instructed to scan. This need not be the same as the artifact where the result actually occurred. + AnalysisTarget *ArtifactLocation `json:"analysisTarget,omitempty"` + + // A set of artifacts relevant to the result. + Attachments []*Attachment `json:"attachments,omitempty"` + + // The state of a result relative to a baseline of a previous run. + BaselineState interface{} `json:"baselineState,omitempty"` + + // An array of 'codeFlow' objects relevant to the result. + CodeFlows []*CodeFlow `json:"codeFlows,omitempty"` + + // A stable, unique identifier for the equivalence class of logically identical results to which this result belongs, in the form of a GUID. + CorrelationGuid string `json:"correlationGuid,omitempty"` + + // A set of strings each of which individually defines a stable, unique identity for the result. + Fingerprints map[string]string `json:"fingerprints,omitempty"` + + // An array of 'fix' objects, each of which represents a proposed fix to the problem indicated by the result. + Fixes []*Fix `json:"fixes,omitempty"` + + // An array of one or more unique 'graphTraversal' objects. + GraphTraversals []*GraphTraversal `json:"graphTraversals,omitempty"` + + // An array of zero or more unique graph objects associated with the result. + Graphs []*Graph `json:"graphs,omitempty"` + + // A stable, unique identifier for the result in the form of a GUID. + Guid string `json:"guid,omitempty"` + + // An absolute URI at which the result can be viewed. + HostedViewerUri string `json:"hostedViewerUri,omitempty"` + + // A value that categorizes results by evaluation state. + Kind ResultKind `json:"kind,omitempty"` + + // A value specifying the severity level of the result. + Level ResultLevel `json:"level,omitempty"` + + // The set of locations where the result was detected. Specify only one location unless the problem indicated by the result can only be corrected by making a change at every specified location. + Locations []*Location `json:"locations,omitempty"` + + // A message that describes the result. The first sentence of the message only will be displayed when visible space is limited. + Message *Message `json:"message"` + + // A positive integer specifying the number of times this logically unique result was observed in this run. + OccurrenceCount int `json:"occurrenceCount,omitempty"` + + // A set of strings that contribute to the stable, unique identity of the result. + PartialFingerprints map[string]string `json:"partialFingerprints,omitempty"` + + // Key/value pairs that provide additional information about the result. + Properties *PropertyBag `json:"properties,omitempty"` + + // Information about how and when the result was detected. + Provenance *ResultProvenance `json:"provenance,omitempty"` + + // A number representing the priority or importance of the result. + Rank float64 `json:"rank,omitempty"` + + // A set of locations relevant to this result. + RelatedLocations []*Location `json:"relatedLocations,omitempty"` + + // A reference used to locate the rule descriptor relevant to this result. + Rule *ReportingDescriptorReference `json:"rule,omitempty"` + + // The stable, unique identifier of the rule, if any, to which this result is relevant. + RuleId string `json:"ruleId,omitempty"` + + // The index within the tool component rules array of the rule object associated with this result. + RuleIndex int `json:"ruleIndex,omitempty"` + + // An array of 'stack' objects relevant to the result. + Stacks []*Stack `json:"stacks,omitempty"` + + // A set of suppressions relevant to this result. + Suppressions []*Suppression `json:"suppressions,omitempty"` + + // An array of references to taxonomy reporting descriptors that are applicable to the result. + Taxa []*ReportingDescriptorReference `json:"taxa,omitempty"` + + // A web request associated with this result. + WebRequest *WebRequest `json:"webRequest,omitempty"` + + // A web response associated with this result. + WebResponse *WebResponse `json:"webResponse,omitempty"` + + // The URIs of the work items associated with this result. + WorkItemUris []string `json:"workItemUris,omitempty"` +} + +// ResultProvenance Contains information about how and when a result was detected. +type ResultProvenance struct { + + // An array of physicalLocation objects which specify the portions of an analysis tool's output that a converter transformed into the result. + ConversionSources []*PhysicalLocation `json:"conversionSources,omitempty"` + + // A GUID-valued string equal to the automationDetails.guid property of the run in which the result was first detected. + FirstDetectionRunGuid string `json:"firstDetectionRunGuid,omitempty"` + + // The Coordinated Universal Time (UTC) date and time at which the result was first detected. See "Date/time properties" in the SARIF spec for the required format. + FirstDetectionTimeUtc string `json:"firstDetectionTimeUtc,omitempty"` + + // The index within the run.invocations array of the invocation object which describes the tool invocation that detected the result. + InvocationIndex int `json:"invocationIndex,omitempty"` + + // A GUID-valued string equal to the automationDetails.guid property of the run in which the result was most recently detected. + LastDetectionRunGuid string `json:"lastDetectionRunGuid,omitempty"` + + // The Coordinated Universal Time (UTC) date and time at which the result was most recently detected. See "Date/time properties" in the SARIF spec for the required format. + LastDetectionTimeUtc string `json:"lastDetectionTimeUtc,omitempty"` + + // Key/value pairs that provide additional information about the result. + Properties *PropertyBag `json:"properties,omitempty"` +} + +// Run Describes a single run of an analysis tool, and contains the reported output of that run. +type Run struct { + + // Addresses associated with this run instance, if any. + Addresses []*Address `json:"addresses,omitempty"` + + // An array of artifact objects relevant to the run. + Artifacts []*Artifact `json:"artifacts,omitempty"` + + // Automation details that describe this run. + AutomationDetails *RunAutomationDetails `json:"automationDetails,omitempty"` + + // The 'guid' property of a previous SARIF 'run' that comprises the baseline that was used to compute result 'baselineState' properties for the run. + BaselineGuid string `json:"baselineGuid,omitempty"` + + // Specifies the unit in which the tool measures columns. + ColumnKind interface{} `json:"columnKind,omitempty"` + + // A conversion object that describes how a converter transformed an analysis tool's native reporting format into the SARIF format. + Conversion *Conversion `json:"conversion,omitempty"` + + // Specifies the default encoding for any artifact object that refers to a text file. + DefaultEncoding string `json:"defaultEncoding,omitempty"` + + // Specifies the default source language for any artifact object that refers to a text file that contains source code. + DefaultSourceLanguage string `json:"defaultSourceLanguage,omitempty"` + + // References to external property files that should be inlined with the content of a root log file. + ExternalPropertyFileReferences *ExternalPropertyFileReferences `json:"externalPropertyFileReferences,omitempty"` + + // An array of zero or more unique graph objects associated with the run. + Graphs []*Graph `json:"graphs,omitempty"` + + // Describes the invocation of the analysis tool. + Invocations []*Invocation `json:"invocations,omitempty"` + + // The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase culture code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to RFC5646). + Language string `json:"language,omitempty"` + + // An array of logical locations such as namespaces, types or functions. + LogicalLocations []*LogicalLocation `json:"logicalLocations,omitempty"` + + // An ordered list of character sequences that were treated as line breaks when computing region information for the run. + NewlineSequences []string `json:"newlineSequences,omitempty"` + + // The artifact location specified by each uriBaseId symbol on the machine where the tool originally ran. + OriginalUriBaseIds map[string]*ArtifactLocation `json:"originalUriBaseIds,omitempty"` + + // Contains configurations that may potentially override both reportingDescriptor.defaultConfiguration (the tool's default severities) and invocation.configurationOverrides (severities established at run-time from the command line). + Policies []*ToolComponent `json:"policies,omitempty"` + + // Key/value pairs that provide additional information about the run. + Properties *PropertyBag `json:"properties,omitempty"` + + // An array of strings used to replace sensitive information in a redaction-aware property. + RedactionTokens []string `json:"redactionTokens,omitempty"` + + // The set of results contained in an SARIF log. The results array can be omitted when a run is solely exporting rules metadata. It must be present (but may be empty) if a log file represents an actual scan. + Results []*Result `json:"results,omitempty"` + + // Automation details that describe the aggregate of runs to which this run belongs. + RunAggregates []*RunAutomationDetails `json:"runAggregates,omitempty"` + + // A specialLocations object that defines locations of special significance to SARIF consumers. + SpecialLocations *SpecialLocations `json:"specialLocations,omitempty"` + + // An array of toolComponent objects relevant to a taxonomy in which results are categorized. + Taxonomies []*ToolComponent `json:"taxonomies,omitempty"` + + // An array of threadFlowLocation objects cached at run level. + ThreadFlowLocations []*ThreadFlowLocation `json:"threadFlowLocations,omitempty"` + + // Information about the tool or tool pipeline that generated the results in this run. A run can only contain results produced by a single tool or tool pipeline. A run can aggregate results from multiple log files, as long as context around the tool run (tool command-line arguments and the like) is identical for all aggregated files. + Tool *Tool `json:"tool"` + + // The set of available translations of the localized data provided by the tool. + Translations []*ToolComponent `json:"translations,omitempty"` + + // Specifies the revision in version control of the artifacts that were scanned. + VersionControlProvenance []*VersionControlDetails `json:"versionControlProvenance,omitempty"` + + // An array of request objects cached at run level. + WebRequests []*WebRequest `json:"webRequests,omitempty"` + + // An array of response objects cached at run level. + WebResponses []*WebResponse `json:"webResponses,omitempty"` +} + +// RunAutomationDetails Information that describes a run's identity and role within an engineering system process. +type RunAutomationDetails struct { + + // A stable, unique identifier for the equivalence class of runs to which this object's containing run object belongs in the form of a GUID. + CorrelationGuid string `json:"correlationGuid,omitempty"` + + // A description of the identity and role played within the engineering system by this object's containing run object. + Description *Message `json:"description,omitempty"` + + // A stable, unique identifier for this object's containing run object in the form of a GUID. + Guid string `json:"guid,omitempty"` + + // A hierarchical string that uniquely identifies this object's containing run object. + Id string `json:"id,omitempty"` + + // Key/value pairs that provide additional information about the run automation details. + Properties *PropertyBag `json:"properties,omitempty"` +} + +// SpecialLocations Defines locations of special significance to SARIF consumers. +type SpecialLocations struct { + + // Provides a suggestion to SARIF consumers to display file paths relative to the specified location. + DisplayBase *ArtifactLocation `json:"displayBase,omitempty"` + + // Key/value pairs that provide additional information about the special locations. + Properties *PropertyBag `json:"properties,omitempty"` +} + +// Stack A call stack that is relevant to a result. +type Stack struct { + + // An array of stack frames that represents a sequence of calls, rendered in reverse chronological order, that comprise the call stack. + Frames []*StackFrame `json:"frames"` + + // A message relevant to this call stack. + Message *Message `json:"message,omitempty"` + + // Key/value pairs that provide additional information about the stack. + Properties *PropertyBag `json:"properties,omitempty"` +} + +// StackFrame A function call within a stack trace. +type StackFrame struct { + + // The location to which this stack frame refers. + Location *Location `json:"location,omitempty"` + + // The name of the module that contains the code of this stack frame. + Module string `json:"module,omitempty"` + + // The parameters of the call that is executing. + Parameters []string `json:"parameters,omitempty"` + + // Key/value pairs that provide additional information about the stack frame. + Properties *PropertyBag `json:"properties,omitempty"` + + // The thread identifier of the stack frame. + ThreadId int `json:"threadId,omitempty"` +} + +// Suppression A suppression that is relevant to a result. +type Suppression struct { + + // A stable, unique identifier for the suppression in the form of a GUID. + Guid string `json:"guid,omitempty"` + + // A string representing the justification for the suppression. + Justification string `json:"justification,omitempty"` + + // A string that indicates where the suppression is persisted. + Kind string `json:"kind"` + + // Identifies the location associated with the suppression. + Location *Location `json:"location,omitempty"` + + // Key/value pairs that provide additional information about the suppression. + Properties *PropertyBag `json:"properties,omitempty"` + + // A string that indicates the review status of the suppression. + Status interface{} `json:"status,omitempty"` +} + +// ThreadFlow Describes a sequence of code locations that specify a path through a single thread of execution such as an operating system or fiber. +type ThreadFlow struct { + + // An string that uniquely identifies the threadFlow within the codeFlow in which it occurs. + Id string `json:"id,omitempty"` + + // Values of relevant expressions at the start of the thread flow that remain constant. + ImmutableState map[string]*MultiformatMessageString `json:"immutableState,omitempty"` + + // Values of relevant expressions at the start of the thread flow that may change during thread flow execution. + InitialState map[string]*MultiformatMessageString `json:"initialState,omitempty"` + + // A temporally ordered array of 'threadFlowLocation' objects, each of which describes a location visited by the tool while producing the result. + Locations []*ThreadFlowLocation `json:"locations"` + + // A message relevant to the thread flow. + Message *Message `json:"message,omitempty"` + + // Key/value pairs that provide additional information about the thread flow. + Properties *PropertyBag `json:"properties,omitempty"` +} + +// ThreadFlowLocation A location visited by an analysis tool while simulating or monitoring the execution of a program. +type ThreadFlowLocation struct { + + // An integer representing the temporal order in which execution reached this location. + ExecutionOrder int `json:"executionOrder,omitempty"` + + // The Coordinated Universal Time (UTC) date and time at which this location was executed. + ExecutionTimeUtc string `json:"executionTimeUtc,omitempty"` + + // Specifies the importance of this location in understanding the code flow in which it occurs. The order from most to least important is "essential", "important", "unimportant". Default: "important". + Importance interface{} `json:"importance,omitempty"` + + // The index within the run threadFlowLocations array. + Index int `json:"index,omitempty"` + + // A set of distinct strings that categorize the thread flow location. Well-known kinds include 'acquire', 'release', 'enter', 'exit', 'call', 'return', 'branch', 'implicit', 'false', 'true', 'caution', 'danger', 'unknown', 'unreachable', 'taint', 'function', 'handler', 'lock', 'memory', 'resource', 'scope' and 'value'. + Kinds []string `json:"kinds,omitempty"` + + // The code location. + Location *Location `json:"location,omitempty"` + + // The name of the module that contains the code that is executing. + Module string `json:"module,omitempty"` + + // An integer representing a containment hierarchy within the thread flow. + NestingLevel int `json:"nestingLevel,omitempty"` + + // Key/value pairs that provide additional information about the threadflow location. + Properties *PropertyBag `json:"properties,omitempty"` + + // The call stack leading to this location. + Stack *Stack `json:"stack,omitempty"` + + // A dictionary, each of whose keys specifies a variable or expression, the associated value of which represents the variable or expression value. For an annotation of kind 'continuation', for example, this dictionary might hold the current assumed values of a set of global variables. + State map[string]*MultiformatMessageString `json:"state,omitempty"` + + // An array of references to rule or taxonomy reporting descriptors that are applicable to the thread flow location. + Taxa []*ReportingDescriptorReference `json:"taxa,omitempty"` + + // A web request associated with this thread flow location. + WebRequest *WebRequest `json:"webRequest,omitempty"` + + // A web response associated with this thread flow location. + WebResponse *WebResponse `json:"webResponse,omitempty"` +} + +// Tool The analysis tool that was run. +type Tool struct { + + // The analysis tool that was run. + Driver *ToolComponent `json:"driver"` + + // Tool extensions that contributed to or reconfigured the analysis tool that was run. + Extensions []*ToolComponent `json:"extensions,omitempty"` + + // Key/value pairs that provide additional information about the tool. + Properties *PropertyBag `json:"properties,omitempty"` +} + +// ToolComponent A component, such as a plug-in or the driver, of the analysis tool that was run. +type ToolComponent struct { + + // The component which is strongly associated with this component. For a translation, this refers to the component which has been translated. For an extension, this is the driver that provides the extension's plugin model. + AssociatedComponent *ToolComponentReference `json:"associatedComponent,omitempty"` + + // The kinds of data contained in this object. + Contents []interface{} `json:"contents,omitempty"` + + // The binary version of the tool component's primary executable file expressed as four non-negative integers separated by a period (for operating systems that express file versions in this way). + DottedQuadFileVersion string `json:"dottedQuadFileVersion,omitempty"` + + // The absolute URI from which the tool component can be downloaded. + DownloadUri string `json:"downloadUri,omitempty"` + + // A comprehensive description of the tool component. + FullDescription *MultiformatMessageString `json:"fullDescription,omitempty"` + + // The name of the tool component along with its version and any other useful identifying information, such as its locale. + FullName string `json:"fullName,omitempty"` + + // A dictionary, each of whose keys is a resource identifier and each of whose values is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in combination with an arbitrary number of additional string arguments. + GlobalMessageStrings map[string]*MultiformatMessageString `json:"globalMessageStrings,omitempty"` + + // A unique identifier for the tool component in the form of a GUID. + Guid string `json:"guid,omitempty"` + + // The absolute URI at which information about this version of the tool component can be found. + InformationUri string `json:"informationUri,omitempty"` + + // Specifies whether this object contains a complete definition of the localizable and/or non-localizable data for this component, as opposed to including only data that is relevant to the results persisted to this log file. + IsComprehensive bool `json:"isComprehensive,omitempty"` + + // The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase language code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to RFC5646). + Language string `json:"language,omitempty"` + + // The semantic version of the localized strings defined in this component; maintained by components that provide translations. + LocalizedDataSemanticVersion string `json:"localizedDataSemanticVersion,omitempty"` + + // An array of the artifactLocation objects associated with the tool component. + Locations []*ArtifactLocation `json:"locations,omitempty"` + + // The minimum value of localizedDataSemanticVersion required in translations consumed by this component; used by components that consume translations. + MinimumRequiredLocalizedDataSemanticVersion string `json:"minimumRequiredLocalizedDataSemanticVersion,omitempty"` + + // The name of the tool component. + Name string `json:"name"` + + // An array of reportingDescriptor objects relevant to the notifications related to the configuration and runtime execution of the tool component. + Notifications []*ReportingDescriptor `json:"notifications,omitempty"` + + // The organization or company that produced the tool component. + Organization string `json:"organization,omitempty"` + + // A product suite to which the tool component belongs. + Product string `json:"product,omitempty"` + + // A localizable string containing the name of the suite of products to which the tool component belongs. + ProductSuite string `json:"productSuite,omitempty"` + + // Key/value pairs that provide additional information about the tool component. + Properties *PropertyBag `json:"properties,omitempty"` + + // A string specifying the UTC date (and optionally, the time) of the component's release. + ReleaseDateUtc string `json:"releaseDateUtc,omitempty"` + + // An array of reportingDescriptor objects relevant to the analysis performed by the tool component. + Rules []*ReportingDescriptor `json:"rules,omitempty"` + + // The tool component version in the format specified by Semantic Versioning 2.0. + SemanticVersion string `json:"semanticVersion,omitempty"` + + // A brief description of the tool component. + ShortDescription *MultiformatMessageString `json:"shortDescription,omitempty"` + + // An array of toolComponentReference objects to declare the taxonomies supported by the tool component. + SupportedTaxonomies []*ToolComponentReference `json:"supportedTaxonomies,omitempty"` + + // An array of reportingDescriptor objects relevant to the definitions of both standalone and tool-defined taxonomies. + Taxa []*ReportingDescriptor `json:"taxa,omitempty"` + + // Translation metadata, required for a translation, not populated by other component types. + TranslationMetadata *TranslationMetadata `json:"translationMetadata,omitempty"` + + // The tool component version, in whatever format the component natively provides. + Version string `json:"version,omitempty"` +} + +// ToolComponentReference Identifies a particular toolComponent object, either the driver or an extension. +type ToolComponentReference struct { + + // The 'guid' property of the referenced toolComponent. + Guid string `json:"guid,omitempty"` + + // An index into the referenced toolComponent in tool.extensions. + Index int `json:"index,omitempty"` + + // The 'name' property of the referenced toolComponent. + Name string `json:"name,omitempty"` + + // Key/value pairs that provide additional information about the toolComponentReference. + Properties *PropertyBag `json:"properties,omitempty"` +} + +// TranslationMetadata Provides additional metadata related to translation. +type TranslationMetadata struct { + + // The absolute URI from which the translation metadata can be downloaded. + DownloadUri string `json:"downloadUri,omitempty"` + + // A comprehensive description of the translation metadata. + FullDescription *MultiformatMessageString `json:"fullDescription,omitempty"` + + // The full name associated with the translation metadata. + FullName string `json:"fullName,omitempty"` + + // The absolute URI from which information related to the translation metadata can be downloaded. + InformationUri string `json:"informationUri,omitempty"` + + // The name associated with the translation metadata. + Name string `json:"name"` + + // Key/value pairs that provide additional information about the translation metadata. + Properties *PropertyBag `json:"properties,omitempty"` + + // A brief description of the translation metadata. + ShortDescription *MultiformatMessageString `json:"shortDescription,omitempty"` +} + +// VersionControlDetails Specifies the information necessary to retrieve a desired revision from a version control system. +type VersionControlDetails struct { + + // A Coordinated Universal Time (UTC) date and time that can be used to synchronize an enlistment to the state of the repository at that time. + AsOfTimeUtc string `json:"asOfTimeUtc,omitempty"` + + // The name of a branch containing the revision. + Branch string `json:"branch,omitempty"` + + // The location in the local file system to which the root of the repository was mapped at the time of the analysis. + MappedTo *ArtifactLocation `json:"mappedTo,omitempty"` + + // Key/value pairs that provide additional information about the version control details. + Properties *PropertyBag `json:"properties,omitempty"` + + // The absolute URI of the repository. + RepositoryUri string `json:"repositoryUri"` + + // A string that uniquely and permanently identifies the revision within the repository. + RevisionId string `json:"revisionId,omitempty"` + + // A tag that has been applied to the revision. + RevisionTag string `json:"revisionTag,omitempty"` +} + +// WebRequest Describes an HTTP request. +type WebRequest struct { + + // The body of the request. + Body *ArtifactContent `json:"body,omitempty"` + + // The request headers. + Headers map[string]string `json:"headers,omitempty"` + + // The index within the run.webRequests array of the request object associated with this result. + Index int `json:"index,omitempty"` + + // The HTTP method. Well-known values are 'GET', 'PUT', 'POST', 'DELETE', 'PATCH', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT'. + Method string `json:"method,omitempty"` + + // The request parameters. + Parameters map[string]string `json:"parameters,omitempty"` + + // Key/value pairs that provide additional information about the request. + Properties *PropertyBag `json:"properties,omitempty"` + + // The request protocol. Example: 'http'. + Protocol string `json:"protocol,omitempty"` + + // The target of the request. + Target string `json:"target,omitempty"` + + // The request version. Example: '1.1'. + Version string `json:"version,omitempty"` +} + +// WebResponse Describes the response to an HTTP request. +type WebResponse struct { + + // The body of the response. + Body *ArtifactContent `json:"body,omitempty"` + + // The response headers. + Headers map[string]string `json:"headers,omitempty"` + + // The index within the run.webResponses array of the response object associated with this result. + Index int `json:"index,omitempty"` + + // Specifies whether a response was received from the server. + NoResponseReceived bool `json:"noResponseReceived,omitempty"` + + // Key/value pairs that provide additional information about the response. + Properties *PropertyBag `json:"properties,omitempty"` + + // The response protocol. Example: 'http'. + Protocol string `json:"protocol,omitempty"` + + // The response reason. Example: 'Not found'. + ReasonPhrase string `json:"reasonPhrase,omitempty"` + + // The response status code. Example: 451. + StatusCode int `json:"statusCode,omitempty"` + + // The response version. Example: '1.1'. + Version string `json:"version,omitempty"` +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md index 1799c6ef223..d730a3bc357 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md @@ -1,5 +1,40 @@ # Release History +## 1.21.1 (2026-04-16) + +### Bugs Fixed + +* Fixed an issue in `ResponseError.Error()` where the request URL path was being logged unescaped. +* Redact query parameters when logging errors. +* For `runtime.JoinPaths`, don't add a slash between root and paths when `paths` starts with `?` (query string). + +### Other Changes + +* Upgraded to Go 1.25.0. +* Upgraded dependencies. + +## 1.21.0 (2026-01-12) + +### Features Added + +* Added `runtime/datetime` package which provides specialized time type wrappers for serializing and deserializing +time values in various formats used by Azure services. + +### Other Changes + +* Aligned `cloud.AzureGovernment` and `cloud.AzureChina` audience values with Azure CLI + +## 1.20.0 (2025-11-06) + +### Features Added + +* Added `runtime.FetcherForNextLinkOptions.HTTPVerb` to specify the HTTP verb when fetching the next page via next link. Defaults to `http.MethodGet`. + +### Bugs Fixed + +* Fixed potential panic when decoding base64 strings. +* Fixed an issue in resource identifier parsing which prevented it from returning an error for malformed resource IDs. + ## 1.19.1 (2025-09-11) ### Bugs Fixed diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/client.go index c373cc43fd5..d103de88a85 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/doc.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/doc.go index 1bdd16a3d03..370754179b7 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/doc.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/doc.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright 2017 Microsoft Corporation. All rights reserved. // Use of this source code is governed by an MIT // license that can be found in the LICENSE file. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource/resource_identifier.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource/resource_identifier.go index b8348b7d82e..c602e77d1b2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource/resource_identifier.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource/resource_identifier.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. @@ -217,6 +214,7 @@ func appendNext(parent *ResourceID, parts []string, id string) (*ResourceID, err func splitStringAndOmitEmpty(v, sep string) []string { r := make([]string, 0) for _, s := range strings.Split(v, sep) { + s = strings.TrimSpace(s) if len(s) == 0 { continue } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource/resource_type.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource/resource_type.go index ca03ac9713d..34d09b6d7f4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource/resource_type.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource/resource_type.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy/policy.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy/policy.go index f18caf84893..787c8e50315 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy/policy.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy/policy.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/resource_identifier.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/resource_identifier.go index d1c3191f2ee..7f7b0f14199 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/resource_identifier.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/resource_identifier.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/resource_type.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/resource_type.go index fc7fbffd260..270d495e4fc 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/resource_type.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/resource_type.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/pipeline.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/pipeline.go index 6a7c916b43e..fa0f2920605 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/pipeline.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/pipeline.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_register_rp.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_register_rp.go index 810ac9d9fab..3bfb7d02d9e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_register_rp.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_register_rp.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_trace_namespace.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_trace_namespace.go index 6cea184240f..cc84d542d23 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_trace_namespace.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_trace_namespace.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/runtime.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/runtime.go index 1400d43799f..0b58f542e6c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/runtime.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/runtime.go @@ -1,6 +1,3 @@ -//go:build go1.16 -// +build go1.16 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. @@ -10,11 +7,11 @@ import "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" func init() { cloud.AzureChina.Services[cloud.ResourceManager] = cloud.ServiceConfiguration{ - Audience: "https://management.core.chinacloudapi.cn", + Audience: "https://management.core.chinacloudapi.cn/", Endpoint: "https://management.chinacloudapi.cn", } cloud.AzureGovernment.Services[cloud.ResourceManager] = cloud.ServiceConfiguration{ - Audience: "https://management.core.usgovcloudapi.net", + Audience: "https://management.core.usgovcloudapi.net/", Endpoint: "https://management.usgovcloudapi.net", } cloud.AzurePublic.Services[cloud.ResourceManager] = cloud.ServiceConfiguration{ diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud/cloud.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud/cloud.go index 9d077a3e126..4ef739a6c46 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud/cloud.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud/cloud.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud/doc.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud/doc.go index 985b1bde2f2..39d0d489e51 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud/doc.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud/doc.go @@ -1,6 +1,3 @@ -//go:build go1.16 -// +build go1.16 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/core.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/core.go index 9d1c2f0c053..c3572985b66 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/core.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/core.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/doc.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/doc.go index 654a5f40431..4862a9f6883 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/doc.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/doc.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright 2017 Microsoft Corporation. All rights reserved. // Use of this source code is governed by an MIT // license that can be found in the LICENSE file. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/errors.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/errors.go index 03cb227d0d4..66111a403fd 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/errors.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/errors.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/etag.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/etag.go index 2b19d01f76e..4a5d7462d6d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/etag.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/etag.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/exported.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/exported.go index 460170034aa..96be304eb7d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/exported.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/exported.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. @@ -92,7 +89,7 @@ func DecodeByteArray(s string, v *[]byte, format Base64Encoding) error { return nil } payload := string(s) - if payload[0] == '"' { + if len(payload) >= 2 && payload[0] == '"' && payload[len(payload)-1] == '"' { // remove surrounding quotes payload = payload[1 : len(payload)-1] } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/pipeline.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/pipeline.go index e45f831ed2a..5d9892a0555 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/pipeline.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/pipeline.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/request.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/request.go index 9b3f5badb5e..4bf722630a7 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/request.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/request.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. @@ -115,7 +112,7 @@ func NewRequest(ctx context.Context, httpMethod string, endpoint string) (*Reque if req.URL.Host == "" { return nil, errors.New("no Host in request URL") } - if !(req.URL.Scheme == "http" || req.URL.Scheme == "https") { + if req.URL.Scheme != "http" && req.URL.Scheme != "https" { return nil, fmt.Errorf("unsupported protocol scheme %s", req.URL.Scheme) } // populate values so that the same instance is propagated across policies diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/response_error.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/response_error.go index 8aec256bd0d..8246b6a5b82 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/response_error.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/response_error.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. @@ -134,7 +131,7 @@ func (e *ResponseError) Error() string { msg := &bytes.Buffer{} if e.RawResponse != nil { if e.RawResponse.Request != nil { - fmt.Fprintf(msg, "%s %s://%s%s\n", e.RawResponse.Request.Method, e.RawResponse.Request.URL.Scheme, e.RawResponse.Request.URL.Host, e.RawResponse.Request.URL.Path) + fmt.Fprintf(msg, "%s %s://%s%s\n", e.RawResponse.Request.Method, e.RawResponse.Request.URL.Scheme, e.RawResponse.Request.URL.Host, e.RawResponse.Request.URL.EscapedPath()) } else { fmt.Fprintln(msg, "Request information not available") } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/log/log.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/log/log.go index 6fc6d1400e7..d3e7191f730 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/log/log.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/log/log.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/async/async.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/async/async.go index a5346276056..fcaf6e168f1 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/async/async.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/async/async.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. @@ -128,10 +125,11 @@ func (p *Poller[T]) Result(ctx context.Context, out *T) error { } var req *exported.Request var err error - if p.Method == http.MethodPatch || p.Method == http.MethodPut { + switch p.Method { + case http.MethodPatch, http.MethodPut: // for PATCH and PUT, the final GET is on the original resource URL req, err = exported.NewRequest(ctx, http.MethodGet, p.OrigURL) - } else if p.Method == http.MethodPost { + case http.MethodPost: if p.FinalState == pollers.FinalStateViaAzureAsyncOp { // no final GET required } else if p.FinalState == pollers.FinalStateViaOriginalURI { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/body/body.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/body/body.go index 8751b05147f..8eebebf78f2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/body/body.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/body/body.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/fake/fake.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/fake/fake.go index 7f8d11b8ba3..3284ea70974 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/fake/fake.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/fake/fake.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/loc/loc.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/loc/loc.go index 048285275df..cbd8e5880b8 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/loc/loc.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/loc/loc.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/op/op.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/op/op.go index f4963318932..a89aed378be 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/op/op.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/op/op.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/poller.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/poller.go index 37ed647f4e0..2f15bc1de5a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/poller.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/poller.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/util.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/util.go index 6a7a32e0342..de545431909 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/util.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/util.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. @@ -165,7 +162,10 @@ func ResultHelper[T any](resp *http.Response, failed bool, jsonPath string, out return nil } - defer resp.Body.Close() + defer func() { + _ = resp.Body.Close() + }() + if !poller.StatusCodeValid(resp) || failed { // the LRO failed. unmarshall the error and update state return azexported.NewResponseError(resp) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go index 8aebe5ce53b..8ad391dd26f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. @@ -40,5 +37,5 @@ const ( Module = "azcore" // Version is the semantic version (see http://semver.org) of this module. - Version = "v1.19.1" + Version = "v1.21.1" ) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/shared.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/shared.go index d3da2c5fdfa..e82d4f00c94 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/shared.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/shared.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/log/doc.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/log/doc.go index 2f3901bff3c..174bbf99b7b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/log/doc.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/log/doc.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright 2017 Microsoft Corporation. All rights reserved. // Use of this source code is governed by an MIT // license that can be found in the LICENSE file. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/log/log.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/log/log.go index f260dac3637..6880cd9cd36 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/log/log.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/log/log.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/policy/doc.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/policy/doc.go index fad2579ed6c..01d788ad26c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/policy/doc.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/policy/doc.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright 2017 Microsoft Corporation. All rights reserved. // Use of this source code is governed by an MIT // license that can be found in the LICENSE file. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/policy/policy.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/policy/policy.go index 368a2199e08..074d1a600e3 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/policy/policy.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/policy/policy.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/doc.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/doc.go index c9cfa438cb3..2c169da79c4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/doc.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/doc.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright 2017 Microsoft Corporation. All rights reserved. // Use of this source code is governed by an MIT // license that can be found in the LICENSE file. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/errors.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/errors.go index c0d56158e22..931d6f862ff 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/errors.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/errors.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/pager.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/pager.go index c66fc0a90a5..743513be4b5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/pager.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/pager.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. @@ -99,6 +96,11 @@ type FetcherForNextLinkOptions struct { // StatusCodes contains additional HTTP status codes indicating success. // The default value is http.StatusOK. StatusCodes []int + + // HTTPVerb specifies the HTTP verb to use when fetching the next page. + // The default value is http.MethodGet. + // This field is only used when NextReq is not specified. + HTTPVerb string } // FetcherForNextLink is a helper containing boilerplate code to simplify creating a PagingHandler[T].Fetcher from a next link URL. @@ -119,7 +121,11 @@ func FetcherForNextLink(ctx context.Context, pl Pipeline, nextLink string, first if options.NextReq != nil { req, err = options.NextReq(ctx, nextLink) } else { - req, err = NewRequest(ctx, http.MethodGet, nextLink) + verb := http.MethodGet + if options.HTTPVerb != "" { + verb = options.HTTPVerb + } + req, err = NewRequest(ctx, verb, nextLink) } } if err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/pipeline.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/pipeline.go index 6b1f5c083eb..3d95fe30dde 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/pipeline.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/pipeline.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_api_version.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_api_version.go index c3646feb55b..21c1430be74 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_api_version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_api_version.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_body_download.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_body_download.go index 99dc029f0c1..08ce2e4b084 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_body_download.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_body_download.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_http_header.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_http_header.go index c230af0afa8..fa6d643f1e6 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_http_header.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_http_header.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. @@ -34,6 +31,7 @@ func httpHeaderPolicy(req *policy.Request) (*http.Response, error) { // WithHTTPHeader adds the specified http.Header to the parent context. // Use this to specify custom HTTP headers at the API-call level. // Any overlapping headers will have their values replaced with the values specified here. +// // Deprecated: use [policy.WithHTTPHeader] instead. func WithHTTPHeader(parent context.Context, header http.Header) context.Context { return policy.WithHTTPHeader(parent, header) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_http_trace.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_http_trace.go index f375195c4b5..7017d5e1067 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_http_trace.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_http_trace.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. @@ -8,10 +5,8 @@ package runtime import ( "context" - "errors" "fmt" "net/http" - "net/url" "strings" "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported" @@ -76,14 +71,7 @@ func (h *httpTracePolicy) Do(req *policy.Request) (resp *http.Response, err erro span.SetAttributes(tracing.Attribute{Key: attrAZServiceReqID, Value: reqID}) } } else if err != nil { - var urlErr *url.Error - if errors.As(err, &urlErr) { - // calling *url.Error.Error() will include the unsanitized URL - // which we don't want. in addition, we already have the HTTP verb - // and sanitized URL in the trace so we aren't losing any info - err = urlErr.Err - } - span.SetStatus(tracing.SpanStatusError, err.Error()) + span.SetStatus(tracing.SpanStatusError, getSanitizedURLString(err.Error(), req.Raw().URL, h.allowedQP)) } span.End() }() diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_include_response.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_include_response.go index bb00f6c2fdb..eaa6c7375c2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_include_response.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_include_response.go @@ -1,6 +1,3 @@ -//go:build go1.16 -// +build go1.16 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. @@ -29,6 +26,7 @@ func includeResponsePolicy(req *policy.Request) (*http.Response, error) { // WithCaptureResponse applies the HTTP response retrieval annotation to the parent context. // The resp parameter will contain the HTTP response after the request has completed. +// // Deprecated: use [policy.WithCaptureResponse] instead. func WithCaptureResponse(parent context.Context, resp **http.Response) context.Context { return policy.WithCaptureResponse(parent, resp) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_logging.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_logging.go index f048d7fb53f..d9e6481de80 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_logging.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_logging.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. @@ -161,6 +158,27 @@ func getSanitizedURL(u url.URL, allowedQueryParams map[string]struct{}) string { return u.String() } +// getSanitizedURLString returns s with the query params of u redacted. +// if s doesn't contain u, then s is returned unchanged. +func getSanitizedURLString(s string, u *url.URL, allowedQueryParams map[string]struct{}) string { + if u.RawQuery == "" { + // the URL doesn't have any query params, so nothing to redact + return s + } + + urlIndex := strings.Index(strings.ToLower(s), strings.ToLower(u.String())) + if urlIndex < 0 { + // the URL isn't in the string, so nothing to redact + return s + } + + // replace the unsanitized URL in the error message with the sanitized version + sanitizedURL := getSanitizedURL(*u, allowedQueryParams) + s = s[:urlIndex] + sanitizedURL + s[urlIndex+len(u.String()):] + + return s +} + // writeRequestWithResponse appends a formatted HTTP request into a Buffer. If request and/or err are // not nil, then these are also written into the Buffer. func (p *logPolicy) writeRequestWithResponse(b *bytes.Buffer, req *policy.Request, resp *http.Response, err error) { @@ -174,7 +192,7 @@ func (p *logPolicy) writeRequestWithResponse(b *bytes.Buffer, req *policy.Reques } if err != nil { fmt.Fprintln(b, " --------------------------------------------------------------------------------") - fmt.Fprint(b, " ERROR:\n"+err.Error()+"\n") + fmt.Fprint(b, " ERROR:\n"+getSanitizedURLString(err.Error(), req.Raw().URL, p.allowedQP)+"\n") } } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_request_id.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_request_id.go index 360a7f2118a..a8f1cbac3f5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_request_id.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_request_id.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_retry.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_retry.go index 4c3a31fea78..696e1d9f496 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_retry.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_retry.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. @@ -117,7 +114,10 @@ func (p *retryPolicy) Do(req *policy.Request) (resp *http.Response, err error) { // wrap the body so we control when it's actually closed. // do this outside the for loop so defers don't accumulate. rwbody = &retryableRequestBody{body: req.Body()} - defer rwbody.realClose() + defer func() { + // TODO: https://github.com/Azure/azure-sdk-for-go/issues/25649 + _ = rwbody.realClose() + }() } try := int32(1) for { @@ -222,6 +222,7 @@ func (p *retryPolicy) Do(req *policy.Request) (resp *http.Response, err error) { // WithRetryOptions adds the specified RetryOptions to the parent context. // Use this to specify custom RetryOptions at the API-call level. +// // Deprecated: use [policy.WithRetryOptions] instead. func WithRetryOptions(parent context.Context, options policy.RetryOptions) context.Context { return policy.WithRetryOptions(parent, options) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_telemetry.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_telemetry.go index 80a90354619..2c60e9d23ad 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_telemetry.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_telemetry.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/poller.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/poller.go index a89ae9b7b9d..2e172cdd1d7 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/poller.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/poller.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. @@ -87,7 +84,10 @@ func NewPoller[T any](resp *http.Response, pl exported.Pipeline, options *NewPol }, nil } - defer resp.Body.Close() + defer func() { + _ = resp.Body.Close() + }() + // this is a back-stop in case the swagger is incorrect (i.e. missing one or more status codes for success). // ideally the codegen should return an error if the initial response failed and not even create a poller. if !poller.StatusCodeValid(resp) { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/request.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/request.go index 7d34b7803af..20d86496d27 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/request.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/request.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. @@ -93,12 +90,16 @@ func JoinPaths(root string, paths ...string) string { } if qps != "" { - p = p + "?" + qps + if strings.Contains(p, "?") { + p = p + "&" + qps + } else { + p = p + "?" + qps + } } if strings.HasSuffix(root, "/") && strings.HasPrefix(p, "/") { root = root[:len(root)-1] - } else if !strings.HasSuffix(root, "/") && !strings.HasPrefix(p, "/") { + } else if !strings.HasSuffix(root, "/") && !strings.HasPrefix(p, "/") && !strings.HasPrefix(p, "?") { p = "/" + p } return root + p diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/response.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/response.go index 048566e02c0..e95f8c8ecf9 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/response.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/response.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. @@ -84,8 +81,9 @@ func UnmarshalAsXML(resp *http.Response, v any) error { // Drain reads the response body to completion then closes it. The bytes read are discarded. func Drain(resp *http.Response) { if resp != nil && resp.Body != nil { + // TODO: this might not be necessary when the bodyDownloadPolicy is in play _, _ = io.Copy(io.Discard, resp.Body) - resp.Body.Close() + _ = resp.Body.Close() } } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/transport_default_http_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/transport_default_http_client.go index 2124c1d48b9..928e9bf9255 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/transport_default_http_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/transport_default_http_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming/doc.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming/doc.go index cadaef3d584..10d04148611 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming/doc.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming/doc.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright 2017 Microsoft Corporation. All rights reserved. // Use of this source code is governed by an MIT // license that can be found in the LICENSE file. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming/progress.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming/progress.go index 2468540bd75..c93824a6610 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming/progress.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming/progress.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/to/doc.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/to/doc.go index faa98c9dc51..13263fbc942 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/to/doc.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/to/doc.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright 2017 Microsoft Corporation. All rights reserved. // Use of this source code is governed by an MIT // license that can be found in the LICENSE file. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/to/to.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/to/to.go index e0e4817b90d..e434f77956e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/to/to.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/to/to.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/tracing/constants.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/tracing/constants.go index 80282d4ab0a..c00c21a3b33 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/tracing/constants.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/tracing/constants.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/tracing/tracing.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/tracing/tracing.go index 1ade7c560ff..8f32485608c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/tracing/tracing.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/tracing/tracing.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/CHANGELOG.md index 217d279fd4f..4a6349e1678 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/CHANGELOG.md +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +## 1.13.1 (2025-11-10) + +### Bugs Fixed + +- `AzureCLICredential` quoted arguments incorrectly on Windows + ## 1.13.0 (2025-10-07) ### Features Added diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/developer_credential_util.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/developer_credential_util.go index e2ca8bced2c..cb7dbe2e4b8 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/developer_credential_util.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/developer_credential_util.go @@ -12,7 +12,6 @@ import ( "errors" "os" "os/exec" - "runtime" "strings" "time" ) @@ -30,17 +29,9 @@ var shellExec = func(ctx context.Context, credName, command string) ([]byte, err ctx, cancel = context.WithTimeout(ctx, cliTimeout) defer cancel() } - var cmd *exec.Cmd - if runtime.GOOS == "windows" { - dir := os.Getenv("SYSTEMROOT") - if dir == "" { - return nil, newCredentialUnavailableError(credName, `environment variable "SYSTEMROOT" has no value`) - } - cmd = exec.CommandContext(ctx, "cmd.exe", "/c", command) - cmd.Dir = dir - } else { - cmd = exec.CommandContext(ctx, "/bin/sh", "-c", command) - cmd.Dir = "/bin" + cmd, err := buildCmd(ctx, credName, command) + if err != nil { + return nil, err } cmd.Env = os.Environ() stderr := bytes.Buffer{} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/developer_credential_util_nonwindows.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/developer_credential_util_nonwindows.go new file mode 100644 index 00000000000..681fcd0cf9f --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/developer_credential_util_nonwindows.go @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +//go:build !windows + +package azidentity + +import ( + "context" + "os/exec" +) + +func buildCmd(ctx context.Context, _, command string) (*exec.Cmd, error) { + cmd := exec.CommandContext(ctx, "/bin/sh", "-c", command) + cmd.Dir = "/bin" + return cmd, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/developer_credential_util_windows.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/developer_credential_util_windows.go new file mode 100644 index 00000000000..09c7a1a977c --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/developer_credential_util_windows.go @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package azidentity + +import ( + "context" + "os" + "os/exec" + "syscall" +) + +func buildCmd(ctx context.Context, credName, command string) (*exec.Cmd, error) { + dir := os.Getenv("SYSTEMROOT") + if dir == "" { + return nil, newCredentialUnavailableError(credName, `environment variable "SYSTEMROOT" has no value`) + } + cmd := exec.CommandContext(ctx, "cmd.exe") + cmd.Dir = dir + cmd.SysProcAttr = &syscall.SysProcAttr{CmdLine: "/c " + command} + return cmd, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/version.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/version.go index bb8bddb16ea..041f11658df 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/version.go @@ -14,5 +14,5 @@ const ( module = "github.com/Azure/azure-sdk-for-go/sdk/" + component // Version is the semantic version (see http://semver.org) of this module. - version = "v1.13.0" + version = "v1.13.1" ) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/diag/diag.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/diag/diag.go index 245af7d2bec..c6ce89e1d4c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/diag/diag.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/diag/diag.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. @@ -42,7 +39,7 @@ func StackTrace(skipFrames, totalFrames int) string { sb.WriteString("()\n\t") sb.WriteString(frame.File) sb.WriteRune(':') - sb.WriteString(fmt.Sprintf("%d\n", frame.Line)) + fmt.Fprintf(&sb, "%d\n", frame.Line) if !more { break } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/diag/doc.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/diag/doc.go index 66bf13e5f04..198a7ba75eb 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/diag/doc.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/diag/doc.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/errorinfo/doc.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/errorinfo/doc.go index 8c6eacb618a..545f36625ae 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/errorinfo/doc.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/errorinfo/doc.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/errorinfo/errorinfo.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/errorinfo/errorinfo.go index 779657b23b8..d6e570f91d4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/errorinfo/errorinfo.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/errorinfo/errorinfo.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/exported/exported.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/exported/exported.go index 9948f604b30..16bb4927679 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/exported/exported.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/exported/exported.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. @@ -10,6 +7,7 @@ import ( "errors" "io" "net/http" + "slices" ) // HasStatusCode returns true if the Response's status code is one of the specified values. @@ -18,12 +16,7 @@ func HasStatusCode(resp *http.Response, statusCodes ...int) bool { if resp == nil { return false } - for _, sc := range statusCodes { - if resp.StatusCode == sc { - return true - } - } - return false + return slices.Contains(statusCodes, resp.StatusCode) } // PayloadOptions contains the optional values for the Payload func. @@ -57,7 +50,7 @@ func Payload(resp *http.Response, opts *PayloadOptions) ([]byte, error) { } bytesBody, err := io.ReadAll(resp.Body) - resp.Body.Close() + _ = resp.Body.Close() if err != nil { return nil, err } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/log/doc.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/log/doc.go index d7876d297ae..452fbf06ead 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/log/doc.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/log/doc.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/log/log.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/log/log.go index 76dadf7d351..4bba1cfda6b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/log/log.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/log/log.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/poller/util.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/poller/util.go index db8269627d3..718b2351213 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/poller/util.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/poller/util.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/temporal/resource.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/temporal/resource.go index 02aa1fb3bc8..153f4cc6235 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/temporal/resource.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/temporal/resource.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. @@ -93,7 +90,7 @@ func (er *Resource[TResource, TState]) Get(state TState) (TResource, error) { } // Getting here means that this thread/goroutine will wait for the updated resource } else if er.shouldRefresh(resource, state) { - if !(er.acquiring || backoff(now, er.lastAttempt)) { + if !er.acquiring && !backoff(now, er.lastAttempt) { // If another thread/goroutine is not acquiring/renewing the resource, and none has attempted // to do so within the last 30 seconds, this thread/goroutine will do it er.acquiring, acquire = true, true diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/uuid/doc.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/uuid/doc.go index a3824bee8b5..296a1096b70 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/uuid/doc.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/uuid/doc.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/uuid/uuid.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/uuid/uuid.go index 278ac9cd1c2..072fa21ca4f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/uuid/uuid.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/uuid/uuid.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/CHANGELOG.md deleted file mode 100644 index b363a53ef61..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/CHANGELOG.md +++ /dev/null @@ -1,421 +0,0 @@ -# Release History - -## 5.7.0 (2024-04-26) -### Features Added - -- New value `DiffDiskPlacementNvmeDisk` added to enum type `DiffDiskPlacement` -- New value `DiskCreateOptionTypesCopy`, `DiskCreateOptionTypesRestore` added to enum type `DiskCreateOptionTypes` -- New enum type `ResourceIDOptionsForGetCapacityReservationGroups` with values `ResourceIDOptionsForGetCapacityReservationGroupsAll`, `ResourceIDOptionsForGetCapacityReservationGroupsCreatedInSubscription`, `ResourceIDOptionsForGetCapacityReservationGroupsSharedWithSubscription` -- New struct `EventGridAndResourceGraph` -- New struct `ScheduledEventsAdditionalPublishingTargets` -- New struct `ScheduledEventsPolicy` -- New struct `UserInitiatedReboot` -- New struct `UserInitiatedRedeploy` -- New field `ResourceIDsOnly` in struct `CapacityReservationGroupsClientListBySubscriptionOptions` -- New field `SourceResource` in struct `DataDisk` -- New field `Caching`, `DeleteOption`, `DiskEncryptionSet`, `WriteAcceleratorEnabled` in struct `DataDisksToAttach` -- New field `ScheduledEventsPolicy` in struct `VirtualMachineProperties` -- New field `ScheduledEventsPolicy` in struct `VirtualMachineScaleSetProperties` -- New field `ForceUpdateOSDiskForEphemeral` in struct `VirtualMachineScaleSetReimageParameters` -- New field `DiffDiskSettings` in struct `VirtualMachineScaleSetUpdateOSDisk` -- New field `ForceUpdateOSDiskForEphemeral` in struct `VirtualMachineScaleSetVMReimageParameters` - - -## 5.6.0 (2024-03-22) -### Features Added - -- New field `VirtualMachineID` in struct `GalleryArtifactVersionFullSource` - - -## 5.5.0 (2024-01-26) -### Features Added - -- New value `DiskSecurityTypesConfidentialVMNonPersistedTPM` added to enum type `DiskSecurityTypes` -- New enum type `ProvisionedBandwidthCopyOption` with values `ProvisionedBandwidthCopyOptionEnhanced`, `ProvisionedBandwidthCopyOptionNone` -- New field `ProvisionedBandwidthCopySpeed` in struct `CreationData` - - -## 5.4.0 (2023-12-22) -### Features Added - -- New value `ConfidentialVMEncryptionTypeNonPersistedTPM` added to enum type `ConfidentialVMEncryptionType` -- New value `ReplicationStatusTypesUefiSettings` added to enum type `ReplicationStatusTypes` -- New value `SecurityEncryptionTypesNonPersistedTPM` added to enum type `SecurityEncryptionTypes` -- New enum type `Mode` with values `ModeAudit`, `ModeEnforce` -- New enum type `SSHEncryptionTypes` with values `SSHEncryptionTypesEd25519`, `SSHEncryptionTypesRSA` -- New enum type `UefiKeyType` with values `UefiKeyTypeSHA256`, `UefiKeyTypeX509` -- New enum type `UefiSignatureTemplateName` with values `UefiSignatureTemplateNameMicrosoftUefiCertificateAuthorityTemplate`, `UefiSignatureTemplateNameMicrosoftWindowsTemplate`, `UefiSignatureTemplateNameNoSignatureTemplate` -- New function `*DedicatedHostsClient.BeginRedeploy(context.Context, string, string, string, *DedicatedHostsClientBeginRedeployOptions) (*runtime.Poller[DedicatedHostsClientRedeployResponse], error)` -- New function `*VirtualMachineScaleSetVMsClient.BeginApproveRollingUpgrade(context.Context, string, string, string, *VirtualMachineScaleSetVMsClientBeginApproveRollingUpgradeOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientApproveRollingUpgradeResponse], error)` -- New function `*VirtualMachineScaleSetVMsClient.BeginAttachDetachDataDisks(context.Context, string, string, string, AttachDetachDataDisksRequest, *VirtualMachineScaleSetVMsClientBeginAttachDetachDataDisksOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientAttachDetachDataDisksResponse], error)` -- New function `*VirtualMachineScaleSetsClient.BeginApproveRollingUpgrade(context.Context, string, string, *VirtualMachineScaleSetsClientBeginApproveRollingUpgradeOptions) (*runtime.Poller[VirtualMachineScaleSetsClientApproveRollingUpgradeResponse], error)` -- New function `*VirtualMachinesClient.BeginAttachDetachDataDisks(context.Context, string, string, AttachDetachDataDisksRequest, *VirtualMachinesClientBeginAttachDetachDataDisksOptions) (*runtime.Poller[VirtualMachinesClientAttachDetachDataDisksResponse], error)` -- New struct `AttachDetachDataDisksRequest` -- New struct `CommunityGalleryMetadata` -- New struct `CommunityGalleryProperties` -- New struct `DataDisksToAttach` -- New struct `DataDisksToDetach` -- New struct `EncryptionIdentity` -- New struct `GalleryImageVersionUefiSettings` -- New struct `ImageVersionSecurityProfile` -- New struct `ProxyAgentSettings` -- New struct `ResiliencyPolicy` -- New struct `ResilientVMCreationPolicy` -- New struct `ResilientVMDeletionPolicy` -- New struct `ResourceSharingProfile` -- New struct `SSHGenerateKeyPairInputParameters` -- New struct `SharedGalleryProperties` -- New struct `UefiKey` -- New struct `UefiKeySignatures` -- New field `OSRollingUpgradeDeferral` in struct `AutomaticOSUpgradePolicy` -- New field `SharedSubscriptionIDs` in struct `CapacityReservationGroupInstanceView` -- New field `SharingProfile` in struct `CapacityReservationGroupProperties` -- New field `Properties` in struct `CommunityGallery` -- New field `ArtifactTags`, `Disclaimer` in struct `CommunityGalleryImageProperties` -- New field `ArtifactTags`, `Disclaimer` in struct `CommunityGalleryImageVersionProperties` -- New field `SecurityProfile` in struct `GalleryImageVersionProperties` -- New field `DiskControllerType` in struct `RestorePointSourceVMStorageProfile` -- New field `Parameters` in struct `SSHPublicKeysClientGenerateKeyPairOptions` -- New field `EncryptionIdentity`, `ProxyAgentSettings` in struct `SecurityProfile` -- New field `Properties` in struct `SharedGallery` -- New field `ArtifactTags` in struct `SharedGalleryImageProperties` -- New field `ArtifactTags` in struct `SharedGalleryImageVersionProperties` -- New field `Etag`, `ManagedBy` in struct `VirtualMachine` -- New field `IsVMInStandbyPool` in struct `VirtualMachineInstanceView` -- New field `Etag` in struct `VirtualMachineScaleSet` -- New field `ResiliencyPolicy` in struct `VirtualMachineScaleSetProperties` -- New field `ResiliencyPolicy` in struct `VirtualMachineScaleSetUpdateProperties` -- New field `Etag` in struct `VirtualMachineScaleSetVM` -- New field `TimeCreated` in struct `VirtualMachineScaleSetVMProfile` -- New field `IfMatch`, `IfNoneMatch` in struct `VirtualMachineScaleSetVMsClientBeginUpdateOptions` -- New field `IfMatch`, `IfNoneMatch` in struct `VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions` -- New field `IfMatch`, `IfNoneMatch` in struct `VirtualMachineScaleSetsClientBeginUpdateOptions` -- New field `IfMatch`, `IfNoneMatch` in struct `VirtualMachinesClientBeginCreateOrUpdateOptions` -- New field `IfMatch`, `IfNoneMatch` in struct `VirtualMachinesClientBeginUpdateOptions` - - -## 5.3.0 (2023-11-24) -### Features Added - -- Support for test fakes and OpenTelemetry trace spans. - - -## 5.3.0-beta.2 (2023-10-30) - -### Other Changes - -- Updated with latest code generator to fix a few issues in fakes. - -## 5.3.0-beta.1 (2023-10-09) -### Features Added - -- Support for test fakes and OpenTelemetry trace spans. - -## 5.2.0 (2023-09-22) -### Features Added - -- New value `DiskCreateOptionCopyFromSanSnapshot` added to enum type `DiskCreateOption` -- New enum type `DomainNameLabelScopeTypes` with values `DomainNameLabelScopeTypesNoReuse`, `DomainNameLabelScopeTypesResourceGroupReuse`, `DomainNameLabelScopeTypesSubscriptionReuse`, `DomainNameLabelScopeTypesTenantReuse` -- New enum type `NetworkInterfaceAuxiliaryMode` with values `NetworkInterfaceAuxiliaryModeAcceleratedConnections`, `NetworkInterfaceAuxiliaryModeFloating`, `NetworkInterfaceAuxiliaryModeNone` -- New enum type `NetworkInterfaceAuxiliarySKU` with values `NetworkInterfaceAuxiliarySKUA1`, `NetworkInterfaceAuxiliarySKUA2`, `NetworkInterfaceAuxiliarySKUA4`, `NetworkInterfaceAuxiliarySKUA8`, `NetworkInterfaceAuxiliarySKUNone` -- New field `ElasticSanResourceID` in struct `CreationData` -- New field `LastOwnershipUpdateTime` in struct `DiskProperties` -- New field `AuxiliaryMode`, `AuxiliarySKU` in struct `VirtualMachineNetworkInterfaceConfigurationProperties` -- New field `DomainNameLabelScope` in struct `VirtualMachinePublicIPAddressDNSSettingsConfiguration` -- New field `AuxiliaryMode`, `AuxiliarySKU` in struct `VirtualMachineScaleSetNetworkConfigurationProperties` -- New field `DomainNameLabelScope` in struct `VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings` -- New field `AuxiliaryMode`, `AuxiliarySKU` in struct `VirtualMachineScaleSetUpdateNetworkConfigurationProperties` -- New field `TimeCreated` in struct `VirtualMachineScaleSetVMProperties` - - -## 5.1.0 (2023-07-28) -### Features Added - -- New enum type `FileFormat` with values `FileFormatVHD`, `FileFormatVHDX` -- New field `FileFormat` in struct `GrantAccessData` - - -## 5.0.0 (2023-05-26) -### Breaking Changes - -- Type of `CommunityGalleryImageProperties.Identifier` has been changed from `*GalleryImageIdentifier` to `*CommunityGalleryImageIdentifier` -- Type of `GalleryTargetExtendedLocation.StorageAccountType` has been changed from `*StorageAccountType` to `*EdgeZoneStorageAccountType` -- Type of `RestorePointSourceVMDataDisk.DiskRestorePoint` has been changed from `*APIEntityReference` to `*DiskRestorePointAttributes` -- Type of `RestorePointSourceVMOSDisk.DiskRestorePoint` has been changed from `*APIEntityReference` to `*DiskRestorePointAttributes` -- `StorageAccountTypeStandardSSDLRS` from enum `StorageAccountType` has been removed -- Field `ID` of struct `VirtualMachineScaleSetIPConfiguration` has been removed -- Field `ID` of struct `VirtualMachineScaleSetNetworkConfiguration` has been removed -- Field `ID` of struct `VirtualMachineScaleSetUpdateIPConfiguration` has been removed -- Field `ID` of struct `VirtualMachineScaleSetUpdateNetworkConfiguration` has been removed - -### Features Added - -- New enum type `EdgeZoneStorageAccountType` with values `EdgeZoneStorageAccountTypePremiumLRS`, `EdgeZoneStorageAccountTypeStandardLRS`, `EdgeZoneStorageAccountTypeStandardSSDLRS`, `EdgeZoneStorageAccountTypeStandardZRS` -- New enum type `ExpandTypeForListVMs` with values `ExpandTypeForListVMsInstanceView` -- New enum type `ExpandTypesForListVMs` with values `ExpandTypesForListVMsInstanceView` -- New enum type `RestorePointEncryptionType` with values `RestorePointEncryptionTypeEncryptionAtRestWithCustomerKey`, `RestorePointEncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys`, `RestorePointEncryptionTypeEncryptionAtRestWithPlatformKey` -- New function `*DedicatedHostsClient.NewListAvailableSizesPager(string, string, string, *DedicatedHostsClientListAvailableSizesOptions) *runtime.Pager[DedicatedHostsClientListAvailableSizesResponse]` -- New function `*VirtualMachineScaleSetsClient.BeginReapply(context.Context, string, string, *VirtualMachineScaleSetsClientBeginReapplyOptions) (*runtime.Poller[VirtualMachineScaleSetsClientReapplyResponse], error)` -- New struct `CommunityGalleryImageIdentifier` -- New struct `DedicatedHostSizeListResult` -- New struct `DiskRestorePointAttributes` -- New struct `RestorePointEncryption` -- New struct `RunCommandManagedIdentity` -- New struct `SecurityPostureReference` -- New field `SKU` in struct `DedicatedHostUpdate` -- New field `BypassPlatformSafetyChecksOnUserSchedule` in struct `LinuxVMGuestPatchAutomaticByPlatformSettings` -- New field `HyperVGeneration` in struct `RestorePointSourceMetadata` -- New field `WriteAcceleratorEnabled` in struct `RestorePointSourceVMDataDisk` -- New field `WriteAcceleratorEnabled` in struct `RestorePointSourceVMOSDisk` -- New field `ProvisionAfterExtensions` in struct `VirtualMachineExtensionProperties` -- New field `ErrorBlobManagedIdentity`, `OutputBlobManagedIdentity`, `TreatFailureAsDeploymentFailure` in struct `VirtualMachineRunCommandProperties` -- New field `ScriptURIManagedIdentity` in struct `VirtualMachineRunCommandScriptSource` -- New field `PriorityMixPolicy`, `SpotRestorePolicy` in struct `VirtualMachineScaleSetUpdateProperties` -- New field `Location` in struct `VirtualMachineScaleSetVMExtension` -- New field `SecurityPostureReference` in struct `VirtualMachineScaleSetVMProfile` -- New field `Hibernate` in struct `VirtualMachineScaleSetsClientBeginDeallocateOptions` -- New field `Expand` in struct `VirtualMachinesClientListAllOptions` -- New field `Expand` in struct `VirtualMachinesClientListOptions` -- New field `BypassPlatformSafetyChecksOnUserSchedule` in struct `WindowsVMGuestPatchAutomaticByPlatformSettings` - - -## 4.2.1 (2023-04-14) -### Bug Fixes - -- Fix serialization bug of empty value of `any` type. - - -## 4.2.0 (2023-03-27) -### Features Added - -- New struct `ClientFactory` which is a client factory used to create any client in this module -- New value `StorageAccountTypeStandardSSDLRS` added to enum type `StorageAccountType` -- New field `ComputerName` in struct `VirtualMachineScaleSetVMInstanceView` -- New field `HyperVGeneration` in struct `VirtualMachineScaleSetVMInstanceView` -- New field `OSName` in struct `VirtualMachineScaleSetVMInstanceView` -- New field `OSVersion` in struct `VirtualMachineScaleSetVMInstanceView` - - -## 4.1.0 (2023-01-27) -### Features Added - -- New type alias `AlternativeType` with values `AlternativeTypeNone`, `AlternativeTypeOffer`, `AlternativeTypePlan` -- New type alias `ImageState` with values `ImageStateActive`, `ImageStateDeprecated`, `ImageStateScheduledForDeprecation` -- New struct `AlternativeOption` -- New struct `ImageDeprecationStatus` -- New struct `OSImageNotificationProfile` -- New struct `OSProfileProvisioningData` -- New struct `ServiceArtifactReference` -- New field `Zones` in struct `CloudService` -- New field `UserData` in struct `RestorePointSourceMetadata` -- New field `MaxSurge` in struct `RollingUpgradePolicy` -- New field `RollbackFailedInstancesOnPolicyBreach` in struct `RollingUpgradePolicy` -- New field `OSImageNotificationProfile` in struct `ScheduledEventsProfile` -- New field `ImageDeprecationStatus` in struct `VirtualMachineImageProperties` -- New field `ExactVersion` in struct `VirtualMachineReimageParameters` -- New field `OSProfile` in struct `VirtualMachineReimageParameters` -- New field `RequireGuestProvisionSignal` in struct `VirtualMachineScaleSetOSProfile` -- New field `ConstrainedMaximumCapacity` in struct `VirtualMachineScaleSetProperties` -- New field `ExactVersion` in struct `VirtualMachineScaleSetReimageParameters` -- New field `OSProfile` in struct `VirtualMachineScaleSetReimageParameters` -- New field `ServiceArtifactReference` in struct `VirtualMachineScaleSetVMProfile` -- New field `ExactVersion` in struct `VirtualMachineScaleSetVMReimageParameters` -- New field `OSProfile` in struct `VirtualMachineScaleSetVMReimageParameters` - - -## 4.0.0 (2022-10-04) -### Breaking Changes - -- Type of `GalleryImageVersionStorageProfile.Source` has been changed from `*GalleryArtifactVersionSource` to `*GalleryArtifactVersionFullSource` -- Type of `SharingProfile.CommunityGalleryInfo` has been changed from `interface{}` to `*CommunityGalleryInfo` -- Type of `VirtualMachineExtensionUpdateProperties.ProtectedSettingsFromKeyVault` has been changed from `interface{}` to `*KeyVaultSecretReference` -- Type of `GalleryOSDiskImage.Source` has been changed from `*GalleryArtifactVersionSource` to `*GalleryDiskImageSource` -- Type of `GalleryDiskImage.Source` has been changed from `*GalleryArtifactVersionSource` to `*GalleryDiskImageSource` -- Type of `GalleryDataDiskImage.Source` has been changed from `*GalleryArtifactVersionSource` to `*GalleryDiskImageSource` -- Type of `VirtualMachineScaleSetExtensionProperties.ProtectedSettingsFromKeyVault` has been changed from `interface{}` to `*KeyVaultSecretReference` -- Type of `VirtualMachineExtensionProperties.ProtectedSettingsFromKeyVault` has been changed from `interface{}` to `*KeyVaultSecretReference` -- Field `URI` of struct `GalleryArtifactVersionSource` has been removed - -### Features Added - -- New const `DiskControllerTypesSCSI` -- New const `PolicyViolationCategoryImageFlaggedUnsafe` -- New const `GalleryApplicationCustomActionParameterTypeConfigurationDataBlob` -- New const `PolicyViolationCategoryIPTheft` -- New const `PolicyViolationCategoryCopyrightValidation` -- New const `PolicyViolationCategoryOther` -- New const `GalleryApplicationCustomActionParameterTypeString` -- New const `DiskControllerTypesNVMe` -- New const `GalleryApplicationCustomActionParameterTypeLogOutputBlob` -- New type alias `DiskControllerTypes` -- New type alias `PolicyViolationCategory` -- New type alias `GalleryApplicationCustomActionParameterType` -- New function `PossiblePolicyViolationCategoryValues() []PolicyViolationCategory` -- New function `PossibleGalleryApplicationCustomActionParameterTypeValues() []GalleryApplicationCustomActionParameterType` -- New function `PossibleDiskControllerTypesValues() []DiskControllerTypes` -- New struct `GalleryApplicationCustomAction` -- New struct `GalleryApplicationCustomActionParameter` -- New struct `GalleryApplicationVersionSafetyProfile` -- New struct `GalleryArtifactSafetyProfileBase` -- New struct `GalleryArtifactVersionFullSource` -- New struct `GalleryDiskImageSource` -- New struct `GalleryImageVersionSafetyProfile` -- New struct `LatestGalleryImageVersion` -- New struct `PolicyViolation` -- New struct `PriorityMixPolicy` -- New field `DiskControllerType` in struct `VirtualMachineScaleSetUpdateStorageProfile` -- New field `HardwareProfile` in struct `VirtualMachineScaleSetUpdateVMProfile` -- New field `CustomActions` in struct `GalleryApplicationProperties` -- New field `DisableTCPStateTracking` in struct `VirtualMachineScaleSetNetworkConfigurationProperties` -- New field `DiskControllerType` in struct `StorageProfile` -- New field `OptimizedForFrequentAttach` in struct `DiskProperties` -- New field `BurstingEnabledTime` in struct `DiskProperties` -- New field `DiskControllerTypes` in struct `SupportedCapabilities` -- New field `DisableTCPStateTracking` in struct `VirtualMachineNetworkInterfaceConfigurationProperties` -- New field `EnableVMAgentPlatformUpdates` in struct `WindowsConfiguration` -- New field `PerformancePlus` in struct `CreationData` -- New field `IncrementalSnapshotFamilyID` in struct `SnapshotProperties` -- New field `OptimizedForFrequentAttach` in struct `DiskUpdateProperties` -- New field `DisableTCPStateTracking` in struct `VirtualMachineScaleSetUpdateNetworkConfigurationProperties` -- New field `ExcludeFromLatest` in struct `TargetRegion` -- New field `PrivacyStatementURI` in struct `SharedGalleryImageProperties` -- New field `Eula` in struct `SharedGalleryImageProperties` -- New field `SafetyProfile` in struct `GalleryApplicationVersionProperties` -- New field `SafetyProfile` in struct `GalleryImageVersionProperties` -- New field `EnableVMAgentPlatformUpdates` in struct `LinuxConfiguration` -- New field `CurrentCapacity` in struct `CapacityReservationUtilization` -- New field `PriorityMixPolicy` in struct `VirtualMachineScaleSetProperties` -- New field `CustomActions` in struct `GalleryApplicationVersionPublishingProfile` -- New field `PlatformFaultDomainCount` in struct `CapacityReservationProperties` -- New field `DiskControllerType` in struct `VirtualMachineScaleSetStorageProfile` - - -## 3.0.1 (2022-07-29) -### Other Changes -- Fix wrong module import for live test - -## 3.0.0 (2022-06-24) -### Breaking Changes - -- Function `*CloudServicesClient.BeginCreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, *CloudServicesClientBeginCreateOrUpdateOptions)` to `(context.Context, string, string, CloudService, *CloudServicesClientBeginCreateOrUpdateOptions)` -- Function `*CloudServicesClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, *CloudServicesClientBeginUpdateOptions)` to `(context.Context, string, string, CloudServiceUpdate, *CloudServicesClientBeginUpdateOptions)` -- Function `*CloudServicesUpdateDomainClient.BeginWalkUpdateDomain` parameter(s) have been changed from `(context.Context, string, string, int32, *CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions)` to `(context.Context, string, string, int32, UpdateDomain, *CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions)` -- Type of `CloudServiceExtensionProperties.Settings` has been changed from `*string` to `interface{}` -- Type of `CloudServiceExtensionProperties.ProtectedSettings` has been changed from `*string` to `interface{}` -- Field `Parameters` of struct `CloudServicesClientBeginUpdateOptions` has been removed -- Field `Parameters` of struct `CloudServicesClientBeginCreateOrUpdateOptions` has been removed -- Field `Parameters` of struct `CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions` has been removed - -### Features Added - -- New const `CloudServiceSlotTypeProduction` -- New const `CloudServiceSlotTypeStaging` -- New function `*VirtualMachineImagesClient.ListByEdgeZone(context.Context, string, string, *VirtualMachineImagesClientListByEdgeZoneOptions) (VirtualMachineImagesClientListByEdgeZoneResponse, error)` -- New function `PossibleCloudServiceSlotTypeValues() []CloudServiceSlotType` -- New struct `SystemData` -- New struct `VMImagesInEdgeZoneListResult` -- New struct `VirtualMachineImagesClientListByEdgeZoneOptions` -- New struct `VirtualMachineImagesClientListByEdgeZoneResponse` -- New field `SystemData` in struct `CloudService` -- New field `SlotType` in struct `CloudServiceNetworkProfile` - - -## 2.0.0 (2022-06-02) -### Breaking Changes - -- Type of `GalleryProperties.ProvisioningState` has been changed from `*GalleryPropertiesProvisioningState` to `*GalleryProvisioningState` -- Type of `GalleryImageVersionProperties.ProvisioningState` has been changed from `*GalleryImageVersionPropertiesProvisioningState` to `*GalleryProvisioningState` -- Type of `GalleryImageProperties.ProvisioningState` has been changed from `*GalleryImagePropertiesProvisioningState` to `*GalleryProvisioningState` -- Type of `GalleryApplicationVersionProperties.ProvisioningState` has been changed from `*GalleryApplicationVersionPropertiesProvisioningState` to `*GalleryProvisioningState` -- Type of `VirtualMachineScaleSetIdentity.UserAssignedIdentities` has been changed from `map[string]*VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue` to `map[string]*UserAssignedIdentitiesValue` -- Const `GalleryImagePropertiesProvisioningStateFailed` has been removed -- Const `GalleryImagePropertiesProvisioningStateMigrating` has been removed -- Const `GalleryImageVersionPropertiesProvisioningStateCreating` has been removed -- Const `GalleryImageVersionPropertiesProvisioningStateMigrating` has been removed -- Const `GalleryApplicationVersionPropertiesProvisioningStateFailed` has been removed -- Const `GalleryPropertiesProvisioningStateMigrating` has been removed -- Const `GalleryApplicationVersionPropertiesProvisioningStateDeleting` has been removed -- Const `GalleryPropertiesProvisioningStateDeleting` has been removed -- Const `GalleryApplicationVersionPropertiesProvisioningStateCreating` has been removed -- Const `GalleryImageVersionPropertiesProvisioningStateSucceeded` has been removed -- Const `GalleryImagePropertiesProvisioningStateCreating` has been removed -- Const `GalleryImagePropertiesProvisioningStateUpdating` has been removed -- Const `GalleryImageVersionPropertiesProvisioningStateDeleting` has been removed -- Const `GalleryPropertiesProvisioningStateFailed` has been removed -- Const `SharingProfileGroupTypesCommunity` has been removed -- Const `GalleryApplicationVersionPropertiesProvisioningStateSucceeded` has been removed -- Const `GalleryApplicationVersionPropertiesProvisioningStateMigrating` has been removed -- Const `GalleryPropertiesProvisioningStateUpdating` has been removed -- Const `GalleryImageVersionPropertiesProvisioningStateFailed` has been removed -- Const `GalleryImagePropertiesProvisioningStateDeleting` has been removed -- Const `GalleryImageVersionPropertiesProvisioningStateUpdating` has been removed -- Const `GalleryPropertiesProvisioningStateCreating` has been removed -- Const `GalleryApplicationVersionPropertiesProvisioningStateUpdating` has been removed -- Const `GalleryImagePropertiesProvisioningStateSucceeded` has been removed -- Const `GalleryPropertiesProvisioningStateSucceeded` has been removed -- Function `PossibleGalleryPropertiesProvisioningStateValues` has been removed -- Function `PossibleGalleryImageVersionPropertiesProvisioningStateValues` has been removed -- Function `PossibleGalleryImagePropertiesProvisioningStateValues` has been removed -- Function `PossibleGalleryApplicationVersionPropertiesProvisioningStateValues` has been removed -- Struct `VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue` has been removed - -### Features Added - -- New const `GallerySharingPermissionTypesCommunity` -- New const `GalleryProvisioningStateUpdating` -- New const `SharedGalleryHostCachingReadOnly` -- New const `SharedGalleryHostCachingNone` -- New const `GalleryProvisioningStateSucceeded` -- New const `GalleryProvisioningStateFailed` -- New const `SharedGalleryHostCachingReadWrite` -- New const `GalleryProvisioningStateCreating` -- New const `DiskEncryptionSetIdentityTypeUserAssigned` -- New const `GalleryProvisioningStateMigrating` -- New const `DiskEncryptionSetIdentityTypeSystemAssignedUserAssigned` -- New const `CopyCompletionErrorReasonCopySourceNotFound` -- New const `GalleryProvisioningStateDeleting` -- New const `DiskStorageAccountTypesPremiumV2LRS` -- New function `PossibleCopyCompletionErrorReasonValues() []CopyCompletionErrorReason` -- New function `PossibleSharedGalleryHostCachingValues() []SharedGalleryHostCaching` -- New function `PossibleGalleryProvisioningStateValues() []GalleryProvisioningState` -- New function `EncryptionSetIdentity.MarshalJSON() ([]byte, error)` -- New function `*CommunityGalleryImagesClient.NewListPager(string, string, *CommunityGalleryImagesClientListOptions) *runtime.Pager[CommunityGalleryImagesClientListResponse]` -- New function `*CommunityGalleryImageVersionsClient.NewListPager(string, string, string, *CommunityGalleryImageVersionsClientListOptions) *runtime.Pager[CommunityGalleryImageVersionsClientListResponse]` -- New struct `CommunityGalleryImageList` -- New struct `CommunityGalleryImageVersionList` -- New struct `CommunityGalleryImageVersionsClientListOptions` -- New struct `CommunityGalleryImageVersionsClientListResponse` -- New struct `CommunityGalleryImagesClientListOptions` -- New struct `CommunityGalleryImagesClientListResponse` -- New struct `CopyCompletionError` -- New struct `SharedGalleryDataDiskImage` -- New struct `SharedGalleryDiskImage` -- New struct `SharedGalleryImageVersionStorageProfile` -- New struct `SharedGalleryOSDiskImage` -- New struct `UserArtifactSettings` -- New field `SharedGalleryImageID` in struct `ImageDiskReference` -- New field `CommunityGalleryImageID` in struct `ImageDiskReference` -- New field `AdvancedSettings` in struct `GalleryApplicationVersionPublishingProfile` -- New field `Settings` in struct `GalleryApplicationVersionPublishingProfile` -- New field `CopyCompletionError` in struct `SnapshotProperties` -- New field `ExcludeFromLatest` in struct `SharedGalleryImageVersionProperties` -- New field `StorageProfile` in struct `SharedGalleryImageVersionProperties` -- New field `ExcludeFromLatest` in struct `CommunityGalleryImageVersionProperties` -- New field `StorageProfile` in struct `CommunityGalleryImageVersionProperties` -- New field `Architecture` in struct `SharedGalleryImageProperties` -- New field `UserAssignedIdentities` in struct `EncryptionSetIdentity` -- New field `Eula` in struct `CommunityGalleryImageProperties` -- New field `PrivacyStatementURI` in struct `CommunityGalleryImageProperties` -- New field `Architecture` in struct `CommunityGalleryImageProperties` -- New field `FederatedClientID` in struct `DiskEncryptionSetUpdateProperties` -- New field `FederatedClientID` in struct `EncryptionSetProperties` -- New field `SecurityProfile` in struct `DiskRestorePointProperties` - - -## 1.0.0 (2022-05-16) - -The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html) since version 1.0.0, which contains breaking changes. - -To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/azsdk/go/mgmt/migration). - -To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/go/mgmt). diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/LICENSE.txt b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/LICENSE.txt deleted file mode 100644 index dc0c2ffb3dc..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/LICENSE.txt +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) Microsoft Corporation. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/README.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/README.md deleted file mode 100644 index c4bf8ab344e..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/README.md +++ /dev/null @@ -1,113 +0,0 @@ -# Azure Compute Module for Go - -[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5) - -The `armcompute` module provides operations for working with Azure Compute. - -[Source code](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/resourcemanager/compute/armcompute) - -# Getting started - -## Prerequisites - -- an [Azure subscription](https://azure.microsoft.com/free/) -- Go 1.18 or above (You could download and install the latest version of Go from [here](https://go.dev/doc/install). It will replace the existing Go on your machine. If you want to install multiple Go versions on the same machine, you could refer this [doc](https://go.dev/doc/manage-install).) - -## Install the package - -This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for versioning and dependency management. - -Install the Azure Compute module: - -```sh -go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 -``` - -## Authorization - -When creating a client, you will need to provide a credential for authenticating with Azure Compute. The `azidentity` module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more. - -```go -cred, err := azidentity.NewDefaultAzureCredential(nil) -``` - -For more information on authentication, please see the documentation for `azidentity` at [pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity). - -## Client Factory - -Azure Compute module consists of one or more clients. We provide a client factory which could be used to create any client in this module. - -```go -clientFactory, err := armcompute.NewClientFactory(, cred, nil) -``` - -You can use `ClientOptions` in package `github.com/Azure/azure-sdk-for-go/sdk/azcore/arm` to set endpoint to connect with public and sovereign clouds as well as Azure Stack. For more information, please see the documentation for `azcore` at [pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore). - -```go -options := arm.ClientOptions { - ClientOptions: azcore.ClientOptions { - Cloud: cloud.AzureChina, - }, -} -clientFactory, err := armcompute.NewClientFactory(, cred, &options) -``` - -## Clients - -A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory. - -```go -client := clientFactory.NewAvailabilitySetsClient() -``` - -## Fakes - -The fake package contains types used for constructing in-memory fake servers used in unit tests. -This allows writing tests to cover various success/error conditions without the need for connecting to a live service. - -Please see https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/samples/fakes for details and examples on how to use fakes. - -## More sample code - -- [Availability Set](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/compute/availabilityset) -- [Creating a Fake](https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/resourcemanager/compute/armcompute/fake_example_test.go) -- [Virtual Machine](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/compute/create_vm) -- [Dedicated Host](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/compute/dedicated_host) -- [Disk](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/compute/disk) -- [Gallery](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/compute/gallery) -- [Proximity Placement Group](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/compute/proximity) -- [Snapshot](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/compute/snapshot) -- [Virtual Machine Scale Set](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/compute/vmscaleset) - -## Major Version Upgrade - -Go uses [semantic import versioning](https://github.com/golang/go/wiki/Modules#semantic-import-versioning) to ensure a good backward compatibility for modules. For Azure Go management SDK, we usually upgrade module version according to cooresponding service's API version. Regarding it could be a complicated experience for major version upgrade, we will try our best to keep the SDK API stable and release new version in backward compatible way. However, if any unavoidable breaking changes and a new major version releases for SDK modules, you could use these commands under your module folder to upgrade: - -```sh -go install github.com/icholy/gomajor@latest -gomajor get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute@latest -``` - -## Provide Feedback - -If you encounter bugs or have suggestions, please -[open an issue](https://github.com/Azure/azure-sdk-for-go/issues) and assign the `Compute` label. - -# Contributing - -This project welcomes contributions and suggestions. Most contributions require -you to agree to a Contributor License Agreement (CLA) declaring that you have -the right to, and actually do, grant us the rights to use your contribution. -For details, visit [https://cla.microsoft.com](https://cla.microsoft.com). - -When you submit a pull request, a CLA-bot will automatically determine whether -you need to provide a CLA and decorate the PR appropriately (e.g., label, -comment). Simply follow the instructions provided by the bot. You will only -need to do this once across all repos using our CLA. - -This project has adopted the -[Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). -For more information, see the -[Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) -or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any -additional questions or comments. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/assets.json b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/assets.json deleted file mode 100644 index db9b10d43d8..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/assets.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "AssetsRepo": "Azure/azure-sdk-assets", - "AssetsRepoPrefixPath": "go", - "TagPrefix": "go/resourcemanager/compute/armcompute", - "Tag": "go/resourcemanager/compute/armcompute_6e7bd6d107" -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/autorest.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/autorest.md deleted file mode 100644 index 5f836a65859..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/autorest.md +++ /dev/null @@ -1,13 +0,0 @@ -### AutoRest Configuration - -> see https://aka.ms/autorest - -``` yaml -azure-arm: true -require: -- https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/readme.go.md -license-header: MICROSOFT_MIT_NO_VERSION -module-version: 5.7.0 -tag: package-2024-03-01 -``` diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/availabilitysets_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/availabilitysets_client.go deleted file mode 100644 index b9b8536f863..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/availabilitysets_client.go +++ /dev/null @@ -1,485 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// AvailabilitySetsClient contains the methods for the AvailabilitySets group. -// Don't use this type directly, use NewAvailabilitySetsClient() instead. -type AvailabilitySetsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewAvailabilitySetsClient creates a new instance of AvailabilitySetsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewAvailabilitySetsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AvailabilitySetsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &AvailabilitySetsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// CreateOrUpdate - Create or update an availability set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - availabilitySetName - The name of the availability set. -// - parameters - Parameters supplied to the Create Availability Set operation. -// - options - AvailabilitySetsClientCreateOrUpdateOptions contains the optional parameters for the AvailabilitySetsClient.CreateOrUpdate -// method. -func (client *AvailabilitySetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySet, options *AvailabilitySetsClientCreateOrUpdateOptions) (AvailabilitySetsClientCreateOrUpdateResponse, error) { - var err error - const operationName = "AvailabilitySetsClient.CreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, availabilitySetName, parameters, options) - if err != nil { - return AvailabilitySetsClientCreateOrUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return AvailabilitySetsClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return AvailabilitySetsClientCreateOrUpdateResponse{}, err - } - resp, err := client.createOrUpdateHandleResponse(httpResp) - return resp, err -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *AvailabilitySetsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySet, options *AvailabilitySetsClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if availabilitySetName == "" { - return nil, errors.New("parameter availabilitySetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{availabilitySetName}", url.PathEscape(availabilitySetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *AvailabilitySetsClient) createOrUpdateHandleResponse(resp *http.Response) (AvailabilitySetsClientCreateOrUpdateResponse, error) { - result := AvailabilitySetsClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AvailabilitySet); err != nil { - return AvailabilitySetsClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// Delete - Delete an availability set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - availabilitySetName - The name of the availability set. -// - options - AvailabilitySetsClientDeleteOptions contains the optional parameters for the AvailabilitySetsClient.Delete method. -func (client *AvailabilitySetsClient) Delete(ctx context.Context, resourceGroupName string, availabilitySetName string, options *AvailabilitySetsClientDeleteOptions) (AvailabilitySetsClientDeleteResponse, error) { - var err error - const operationName = "AvailabilitySetsClient.Delete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, availabilitySetName, options) - if err != nil { - return AvailabilitySetsClientDeleteResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return AvailabilitySetsClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return AvailabilitySetsClientDeleteResponse{}, err - } - return AvailabilitySetsClientDeleteResponse{}, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *AvailabilitySetsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, availabilitySetName string, options *AvailabilitySetsClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if availabilitySetName == "" { - return nil, errors.New("parameter availabilitySetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{availabilitySetName}", url.PathEscape(availabilitySetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves information about an availability set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - availabilitySetName - The name of the availability set. -// - options - AvailabilitySetsClientGetOptions contains the optional parameters for the AvailabilitySetsClient.Get method. -func (client *AvailabilitySetsClient) Get(ctx context.Context, resourceGroupName string, availabilitySetName string, options *AvailabilitySetsClientGetOptions) (AvailabilitySetsClientGetResponse, error) { - var err error - const operationName = "AvailabilitySetsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, availabilitySetName, options) - if err != nil { - return AvailabilitySetsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return AvailabilitySetsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return AvailabilitySetsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *AvailabilitySetsClient) getCreateRequest(ctx context.Context, resourceGroupName string, availabilitySetName string, options *AvailabilitySetsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if availabilitySetName == "" { - return nil, errors.New("parameter availabilitySetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{availabilitySetName}", url.PathEscape(availabilitySetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *AvailabilitySetsClient) getHandleResponse(resp *http.Response) (AvailabilitySetsClientGetResponse, error) { - result := AvailabilitySetsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AvailabilitySet); err != nil { - return AvailabilitySetsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Lists all availability sets in a resource group. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - options - AvailabilitySetsClientListOptions contains the optional parameters for the AvailabilitySetsClient.NewListPager -// method. -func (client *AvailabilitySetsClient) NewListPager(resourceGroupName string, options *AvailabilitySetsClientListOptions) *runtime.Pager[AvailabilitySetsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[AvailabilitySetsClientListResponse]{ - More: func(page AvailabilitySetsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *AvailabilitySetsClientListResponse) (AvailabilitySetsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AvailabilitySetsClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, options) - }, nil) - if err != nil { - return AvailabilitySetsClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *AvailabilitySetsClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *AvailabilitySetsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *AvailabilitySetsClient) listHandleResponse(resp *http.Response) (AvailabilitySetsClientListResponse, error) { - result := AvailabilitySetsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AvailabilitySetListResult); err != nil { - return AvailabilitySetsClientListResponse{}, err - } - return result, nil -} - -// NewListAvailableSizesPager - Lists all available virtual machine sizes that can be used to create a new virtual machine -// in an existing availability set. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - availabilitySetName - The name of the availability set. -// - options - AvailabilitySetsClientListAvailableSizesOptions contains the optional parameters for the AvailabilitySetsClient.NewListAvailableSizesPager -// method. -func (client *AvailabilitySetsClient) NewListAvailableSizesPager(resourceGroupName string, availabilitySetName string, options *AvailabilitySetsClientListAvailableSizesOptions) *runtime.Pager[AvailabilitySetsClientListAvailableSizesResponse] { - return runtime.NewPager(runtime.PagingHandler[AvailabilitySetsClientListAvailableSizesResponse]{ - More: func(page AvailabilitySetsClientListAvailableSizesResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *AvailabilitySetsClientListAvailableSizesResponse) (AvailabilitySetsClientListAvailableSizesResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AvailabilitySetsClient.NewListAvailableSizesPager") - req, err := client.listAvailableSizesCreateRequest(ctx, resourceGroupName, availabilitySetName, options) - if err != nil { - return AvailabilitySetsClientListAvailableSizesResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return AvailabilitySetsClientListAvailableSizesResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AvailabilitySetsClientListAvailableSizesResponse{}, runtime.NewResponseError(resp) - } - return client.listAvailableSizesHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listAvailableSizesCreateRequest creates the ListAvailableSizes request. -func (client *AvailabilitySetsClient) listAvailableSizesCreateRequest(ctx context.Context, resourceGroupName string, availabilitySetName string, options *AvailabilitySetsClientListAvailableSizesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/vmSizes" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if availabilitySetName == "" { - return nil, errors.New("parameter availabilitySetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{availabilitySetName}", url.PathEscape(availabilitySetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAvailableSizesHandleResponse handles the ListAvailableSizes response. -func (client *AvailabilitySetsClient) listAvailableSizesHandleResponse(resp *http.Response) (AvailabilitySetsClientListAvailableSizesResponse, error) { - result := AvailabilitySetsClientListAvailableSizesResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineSizeListResult); err != nil { - return AvailabilitySetsClientListAvailableSizesResponse{}, err - } - return result, nil -} - -// NewListBySubscriptionPager - Lists all availability sets in a subscription. -// -// Generated from API version 2024-03-01 -// - options - AvailabilitySetsClientListBySubscriptionOptions contains the optional parameters for the AvailabilitySetsClient.NewListBySubscriptionPager -// method. -func (client *AvailabilitySetsClient) NewListBySubscriptionPager(options *AvailabilitySetsClientListBySubscriptionOptions) *runtime.Pager[AvailabilitySetsClientListBySubscriptionResponse] { - return runtime.NewPager(runtime.PagingHandler[AvailabilitySetsClientListBySubscriptionResponse]{ - More: func(page AvailabilitySetsClientListBySubscriptionResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *AvailabilitySetsClientListBySubscriptionResponse) (AvailabilitySetsClientListBySubscriptionResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AvailabilitySetsClient.NewListBySubscriptionPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listBySubscriptionCreateRequest(ctx, options) - }, nil) - if err != nil { - return AvailabilitySetsClientListBySubscriptionResponse{}, err - } - return client.listBySubscriptionHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *AvailabilitySetsClient) listBySubscriptionCreateRequest(ctx context.Context, options *AvailabilitySetsClientListBySubscriptionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/availabilitySets" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listBySubscriptionHandleResponse handles the ListBySubscription response. -func (client *AvailabilitySetsClient) listBySubscriptionHandleResponse(resp *http.Response) (AvailabilitySetsClientListBySubscriptionResponse, error) { - result := AvailabilitySetsClientListBySubscriptionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AvailabilitySetListResult); err != nil { - return AvailabilitySetsClientListBySubscriptionResponse{}, err - } - return result, nil -} - -// Update - Update an availability set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - availabilitySetName - The name of the availability set. -// - parameters - Parameters supplied to the Update Availability Set operation. -// - options - AvailabilitySetsClientUpdateOptions contains the optional parameters for the AvailabilitySetsClient.Update method. -func (client *AvailabilitySetsClient) Update(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySetUpdate, options *AvailabilitySetsClientUpdateOptions) (AvailabilitySetsClientUpdateResponse, error) { - var err error - const operationName = "AvailabilitySetsClient.Update" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, availabilitySetName, parameters, options) - if err != nil { - return AvailabilitySetsClientUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return AvailabilitySetsClientUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return AvailabilitySetsClientUpdateResponse{}, err - } - resp, err := client.updateHandleResponse(httpResp) - return resp, err -} - -// updateCreateRequest creates the Update request. -func (client *AvailabilitySetsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySetUpdate, options *AvailabilitySetsClientUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if availabilitySetName == "" { - return nil, errors.New("parameter availabilitySetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{availabilitySetName}", url.PathEscape(availabilitySetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// updateHandleResponse handles the Update response. -func (client *AvailabilitySetsClient) updateHandleResponse(resp *http.Response) (AvailabilitySetsClientUpdateResponse, error) { - result := AvailabilitySetsClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AvailabilitySet); err != nil { - return AvailabilitySetsClientUpdateResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/build.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/build.go deleted file mode 100644 index f88d006f4fb..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/build.go +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. - -// This file enables 'go generate' to regenerate this specific SDK -//go:generate pwsh ../../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate -alwaysSetBodyParamRequired resourcemanager/compute/armcompute - -package armcompute diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/capacityreservationgroups_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/capacityreservationgroups_client.go deleted file mode 100644 index 51a41065840..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/capacityreservationgroups_client.go +++ /dev/null @@ -1,437 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// CapacityReservationGroupsClient contains the methods for the CapacityReservationGroups group. -// Don't use this type directly, use NewCapacityReservationGroupsClient() instead. -type CapacityReservationGroupsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewCapacityReservationGroupsClient creates a new instance of CapacityReservationGroupsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewCapacityReservationGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CapacityReservationGroupsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &CapacityReservationGroupsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// CreateOrUpdate - The operation to create or update a capacity reservation group. When updating a capacity reservation group, -// only tags and sharing profile may be modified. Please refer to -// https://aka.ms/CapacityReservation for more details. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - capacityReservationGroupName - The name of the capacity reservation group. -// - parameters - Parameters supplied to the Create capacity reservation Group. -// - options - CapacityReservationGroupsClientCreateOrUpdateOptions contains the optional parameters for the CapacityReservationGroupsClient.CreateOrUpdate -// method. -func (client *CapacityReservationGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, parameters CapacityReservationGroup, options *CapacityReservationGroupsClientCreateOrUpdateOptions) (CapacityReservationGroupsClientCreateOrUpdateResponse, error) { - var err error - const operationName = "CapacityReservationGroupsClient.CreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, capacityReservationGroupName, parameters, options) - if err != nil { - return CapacityReservationGroupsClientCreateOrUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CapacityReservationGroupsClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return CapacityReservationGroupsClientCreateOrUpdateResponse{}, err - } - resp, err := client.createOrUpdateHandleResponse(httpResp) - return resp, err -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *CapacityReservationGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, parameters CapacityReservationGroup, options *CapacityReservationGroupsClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if capacityReservationGroupName == "" { - return nil, errors.New("parameter capacityReservationGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{capacityReservationGroupName}", url.PathEscape(capacityReservationGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *CapacityReservationGroupsClient) createOrUpdateHandleResponse(resp *http.Response) (CapacityReservationGroupsClientCreateOrUpdateResponse, error) { - result := CapacityReservationGroupsClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CapacityReservationGroup); err != nil { - return CapacityReservationGroupsClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// Delete - The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources -// are disassociated from the reservation group and all capacity reservations under -// the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - capacityReservationGroupName - The name of the capacity reservation group. -// - options - CapacityReservationGroupsClientDeleteOptions contains the optional parameters for the CapacityReservationGroupsClient.Delete -// method. -func (client *CapacityReservationGroupsClient) Delete(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, options *CapacityReservationGroupsClientDeleteOptions) (CapacityReservationGroupsClientDeleteResponse, error) { - var err error - const operationName = "CapacityReservationGroupsClient.Delete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, capacityReservationGroupName, options) - if err != nil { - return CapacityReservationGroupsClientDeleteResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CapacityReservationGroupsClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return CapacityReservationGroupsClientDeleteResponse{}, err - } - return CapacityReservationGroupsClientDeleteResponse{}, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *CapacityReservationGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, options *CapacityReservationGroupsClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if capacityReservationGroupName == "" { - return nil, errors.New("parameter capacityReservationGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{capacityReservationGroupName}", url.PathEscape(capacityReservationGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - The operation that retrieves information about a capacity reservation group. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - capacityReservationGroupName - The name of the capacity reservation group. -// - options - CapacityReservationGroupsClientGetOptions contains the optional parameters for the CapacityReservationGroupsClient.Get -// method. -func (client *CapacityReservationGroupsClient) Get(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, options *CapacityReservationGroupsClientGetOptions) (CapacityReservationGroupsClientGetResponse, error) { - var err error - const operationName = "CapacityReservationGroupsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, capacityReservationGroupName, options) - if err != nil { - return CapacityReservationGroupsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CapacityReservationGroupsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return CapacityReservationGroupsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *CapacityReservationGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, options *CapacityReservationGroupsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if capacityReservationGroupName == "" { - return nil, errors.New("parameter capacityReservationGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{capacityReservationGroupName}", url.PathEscape(capacityReservationGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *CapacityReservationGroupsClient) getHandleResponse(resp *http.Response) (CapacityReservationGroupsClientGetResponse, error) { - result := CapacityReservationGroupsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CapacityReservationGroup); err != nil { - return CapacityReservationGroupsClientGetResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Lists all of the capacity reservation groups in the specified resource group. Use the nextLink -// property in the response to get the next page of capacity reservation groups. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - options - CapacityReservationGroupsClientListByResourceGroupOptions contains the optional parameters for the CapacityReservationGroupsClient.NewListByResourceGroupPager -// method. -func (client *CapacityReservationGroupsClient) NewListByResourceGroupPager(resourceGroupName string, options *CapacityReservationGroupsClientListByResourceGroupOptions) *runtime.Pager[CapacityReservationGroupsClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[CapacityReservationGroupsClientListByResourceGroupResponse]{ - More: func(page CapacityReservationGroupsClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *CapacityReservationGroupsClientListByResourceGroupResponse) (CapacityReservationGroupsClientListByResourceGroupResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CapacityReservationGroupsClient.NewListByResourceGroupPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - }, nil) - if err != nil { - return CapacityReservationGroupsClientListByResourceGroupResponse{}, err - } - return client.listByResourceGroupHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *CapacityReservationGroupsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *CapacityReservationGroupsClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *CapacityReservationGroupsClient) listByResourceGroupHandleResponse(resp *http.Response) (CapacityReservationGroupsClientListByResourceGroupResponse, error) { - result := CapacityReservationGroupsClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CapacityReservationGroupListResult); err != nil { - return CapacityReservationGroupsClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// NewListBySubscriptionPager - Lists all of the capacity reservation groups in the subscription. Use the nextLink property -// in the response to get the next page of capacity reservation groups. -// -// Generated from API version 2024-03-01 -// - options - CapacityReservationGroupsClientListBySubscriptionOptions contains the optional parameters for the CapacityReservationGroupsClient.NewListBySubscriptionPager -// method. -func (client *CapacityReservationGroupsClient) NewListBySubscriptionPager(options *CapacityReservationGroupsClientListBySubscriptionOptions) *runtime.Pager[CapacityReservationGroupsClientListBySubscriptionResponse] { - return runtime.NewPager(runtime.PagingHandler[CapacityReservationGroupsClientListBySubscriptionResponse]{ - More: func(page CapacityReservationGroupsClientListBySubscriptionResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *CapacityReservationGroupsClientListBySubscriptionResponse) (CapacityReservationGroupsClientListBySubscriptionResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CapacityReservationGroupsClient.NewListBySubscriptionPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listBySubscriptionCreateRequest(ctx, options) - }, nil) - if err != nil { - return CapacityReservationGroupsClientListBySubscriptionResponse{}, err - } - return client.listBySubscriptionHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *CapacityReservationGroupsClient) listBySubscriptionCreateRequest(ctx context.Context, options *CapacityReservationGroupsClientListBySubscriptionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/capacityReservationGroups" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2024-03-01") - if options != nil && options.ResourceIDsOnly != nil { - reqQP.Set("resourceIdsOnly", string(*options.ResourceIDsOnly)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listBySubscriptionHandleResponse handles the ListBySubscription response. -func (client *CapacityReservationGroupsClient) listBySubscriptionHandleResponse(resp *http.Response) (CapacityReservationGroupsClientListBySubscriptionResponse, error) { - result := CapacityReservationGroupsClientListBySubscriptionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CapacityReservationGroupListResult); err != nil { - return CapacityReservationGroupsClientListBySubscriptionResponse{}, err - } - return result, nil -} - -// Update - The operation to update a capacity reservation group. When updating a capacity reservation group, only tags and -// sharing profile may be modified. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - capacityReservationGroupName - The name of the capacity reservation group. -// - parameters - Parameters supplied to the Update capacity reservation Group operation. -// - options - CapacityReservationGroupsClientUpdateOptions contains the optional parameters for the CapacityReservationGroupsClient.Update -// method. -func (client *CapacityReservationGroupsClient) Update(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, parameters CapacityReservationGroupUpdate, options *CapacityReservationGroupsClientUpdateOptions) (CapacityReservationGroupsClientUpdateResponse, error) { - var err error - const operationName = "CapacityReservationGroupsClient.Update" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, capacityReservationGroupName, parameters, options) - if err != nil { - return CapacityReservationGroupsClientUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CapacityReservationGroupsClientUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return CapacityReservationGroupsClientUpdateResponse{}, err - } - resp, err := client.updateHandleResponse(httpResp) - return resp, err -} - -// updateCreateRequest creates the Update request. -func (client *CapacityReservationGroupsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, parameters CapacityReservationGroupUpdate, options *CapacityReservationGroupsClientUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if capacityReservationGroupName == "" { - return nil, errors.New("parameter capacityReservationGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{capacityReservationGroupName}", url.PathEscape(capacityReservationGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// updateHandleResponse handles the Update response. -func (client *CapacityReservationGroupsClient) updateHandleResponse(resp *http.Response) (CapacityReservationGroupsClientUpdateResponse, error) { - result := CapacityReservationGroupsClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CapacityReservationGroup); err != nil { - return CapacityReservationGroupsClientUpdateResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/capacityreservations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/capacityreservations_client.go deleted file mode 100644 index aaf86c3a26a..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/capacityreservations_client.go +++ /dev/null @@ -1,443 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// CapacityReservationsClient contains the methods for the CapacityReservations group. -// Don't use this type directly, use NewCapacityReservationsClient() instead. -type CapacityReservationsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewCapacityReservationsClient creates a new instance of CapacityReservationsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewCapacityReservationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CapacityReservationsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &CapacityReservationsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - The operation to create or update a capacity reservation. Please note some properties can be set -// only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more -// details. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - capacityReservationGroupName - The name of the capacity reservation group. -// - capacityReservationName - The name of the capacity reservation. -// - parameters - Parameters supplied to the Create capacity reservation. -// - options - CapacityReservationsClientBeginCreateOrUpdateOptions contains the optional parameters for the CapacityReservationsClient.BeginCreateOrUpdate -// method. -func (client *CapacityReservationsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservation, options *CapacityReservationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[CapacityReservationsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CapacityReservationsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CapacityReservationsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - The operation to create or update a capacity reservation. Please note some properties can be set only -// during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more -// details. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *CapacityReservationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservation, options *CapacityReservationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "CapacityReservationsClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *CapacityReservationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservation, options *CapacityReservationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if capacityReservationGroupName == "" { - return nil, errors.New("parameter capacityReservationGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{capacityReservationGroupName}", url.PathEscape(capacityReservationGroupName)) - if capacityReservationName == "" { - return nil, errors.New("parameter capacityReservationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{capacityReservationName}", url.PathEscape(capacityReservationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - The operation to delete a capacity reservation. This operation is allowed only when all the associated resources -// are disassociated from the capacity reservation. Please refer to -// https://aka.ms/CapacityReservation for more details. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - capacityReservationGroupName - The name of the capacity reservation group. -// - capacityReservationName - The name of the capacity reservation. -// - options - CapacityReservationsClientBeginDeleteOptions contains the optional parameters for the CapacityReservationsClient.BeginDelete -// method. -func (client *CapacityReservationsClient) BeginDelete(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, options *CapacityReservationsClientBeginDeleteOptions) (*runtime.Poller[CapacityReservationsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CapacityReservationsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CapacityReservationsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - The operation to delete a capacity reservation. This operation is allowed only when all the associated resources -// are disassociated from the capacity reservation. Please refer to -// https://aka.ms/CapacityReservation for more details. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *CapacityReservationsClient) deleteOperation(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, options *CapacityReservationsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "CapacityReservationsClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *CapacityReservationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, options *CapacityReservationsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if capacityReservationGroupName == "" { - return nil, errors.New("parameter capacityReservationGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{capacityReservationGroupName}", url.PathEscape(capacityReservationGroupName)) - if capacityReservationName == "" { - return nil, errors.New("parameter capacityReservationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{capacityReservationName}", url.PathEscape(capacityReservationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - The operation that retrieves information about the capacity reservation. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - capacityReservationGroupName - The name of the capacity reservation group. -// - capacityReservationName - The name of the capacity reservation. -// - options - CapacityReservationsClientGetOptions contains the optional parameters for the CapacityReservationsClient.Get -// method. -func (client *CapacityReservationsClient) Get(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, options *CapacityReservationsClientGetOptions) (CapacityReservationsClientGetResponse, error) { - var err error - const operationName = "CapacityReservationsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName, options) - if err != nil { - return CapacityReservationsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CapacityReservationsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return CapacityReservationsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *CapacityReservationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, options *CapacityReservationsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if capacityReservationGroupName == "" { - return nil, errors.New("parameter capacityReservationGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{capacityReservationGroupName}", url.PathEscape(capacityReservationGroupName)) - if capacityReservationName == "" { - return nil, errors.New("parameter capacityReservationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{capacityReservationName}", url.PathEscape(capacityReservationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *CapacityReservationsClient) getHandleResponse(resp *http.Response) (CapacityReservationsClientGetResponse, error) { - result := CapacityReservationsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CapacityReservation); err != nil { - return CapacityReservationsClientGetResponse{}, err - } - return result, nil -} - -// NewListByCapacityReservationGroupPager - Lists all of the capacity reservations in the specified capacity reservation group. -// Use the nextLink property in the response to get the next page of capacity reservations. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - capacityReservationGroupName - The name of the capacity reservation group. -// - options - CapacityReservationsClientListByCapacityReservationGroupOptions contains the optional parameters for the CapacityReservationsClient.NewListByCapacityReservationGroupPager -// method. -func (client *CapacityReservationsClient) NewListByCapacityReservationGroupPager(resourceGroupName string, capacityReservationGroupName string, options *CapacityReservationsClientListByCapacityReservationGroupOptions) *runtime.Pager[CapacityReservationsClientListByCapacityReservationGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[CapacityReservationsClientListByCapacityReservationGroupResponse]{ - More: func(page CapacityReservationsClientListByCapacityReservationGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *CapacityReservationsClientListByCapacityReservationGroupResponse) (CapacityReservationsClientListByCapacityReservationGroupResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CapacityReservationsClient.NewListByCapacityReservationGroupPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByCapacityReservationGroupCreateRequest(ctx, resourceGroupName, capacityReservationGroupName, options) - }, nil) - if err != nil { - return CapacityReservationsClientListByCapacityReservationGroupResponse{}, err - } - return client.listByCapacityReservationGroupHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByCapacityReservationGroupCreateRequest creates the ListByCapacityReservationGroup request. -func (client *CapacityReservationsClient) listByCapacityReservationGroupCreateRequest(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, options *CapacityReservationsClientListByCapacityReservationGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if capacityReservationGroupName == "" { - return nil, errors.New("parameter capacityReservationGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{capacityReservationGroupName}", url.PathEscape(capacityReservationGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByCapacityReservationGroupHandleResponse handles the ListByCapacityReservationGroup response. -func (client *CapacityReservationsClient) listByCapacityReservationGroupHandleResponse(resp *http.Response) (CapacityReservationsClientListByCapacityReservationGroupResponse, error) { - result := CapacityReservationsClientListByCapacityReservationGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CapacityReservationListResult); err != nil { - return CapacityReservationsClientListByCapacityReservationGroupResponse{}, err - } - return result, nil -} - -// BeginUpdate - The operation to update a capacity reservation. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - capacityReservationGroupName - The name of the capacity reservation group. -// - capacityReservationName - The name of the capacity reservation. -// - parameters - Parameters supplied to the Update capacity reservation operation. -// - options - CapacityReservationsClientBeginUpdateOptions contains the optional parameters for the CapacityReservationsClient.BeginUpdate -// method. -func (client *CapacityReservationsClient) BeginUpdate(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservationUpdate, options *CapacityReservationsClientBeginUpdateOptions) (*runtime.Poller[CapacityReservationsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CapacityReservationsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CapacityReservationsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - The operation to update a capacity reservation. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *CapacityReservationsClient) update(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservationUpdate, options *CapacityReservationsClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "CapacityReservationsClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *CapacityReservationsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservationUpdate, options *CapacityReservationsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if capacityReservationGroupName == "" { - return nil, errors.New("parameter capacityReservationGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{capacityReservationGroupName}", url.PathEscape(capacityReservationGroupName)) - if capacityReservationName == "" { - return nil, errors.New("parameter capacityReservationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{capacityReservationName}", url.PathEscape(capacityReservationName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/ci.yml b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/ci.yml deleted file mode 100644 index c93d36fd4cc..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/ci.yml +++ /dev/null @@ -1,28 +0,0 @@ -# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. -trigger: - branches: - include: - - main - - feature/* - - hotfix/* - - release/* - paths: - include: - - sdk/resourcemanager/compute/armcompute/ - -pr: - branches: - include: - - main - - feature/* - - hotfix/* - - release/* - paths: - include: - - sdk/resourcemanager/compute/armcompute/ - -extends: - template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml - parameters: - IncludeRelease: true - ServiceDirectory: 'resourcemanager/compute/armcompute' diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/client_factory.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/client_factory.go deleted file mode 100644 index dab27c87cb6..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/client_factory.go +++ /dev/null @@ -1,429 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" -) - -// ClientFactory is a client factory used to create any client in this module. -// Don't use this type directly, use NewClientFactory instead. -type ClientFactory struct { - subscriptionID string - internal *arm.Client -} - -// NewClientFactory creates a new instance of ClientFactory with the specified values. -// The parameter values will be propagated to any client created from this factory. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { - internal, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - return &ClientFactory{ - subscriptionID: subscriptionID, - internal: internal, - }, nil -} - -// NewAvailabilitySetsClient creates a new instance of AvailabilitySetsClient. -func (c *ClientFactory) NewAvailabilitySetsClient() *AvailabilitySetsClient { - return &AvailabilitySetsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewCapacityReservationGroupsClient creates a new instance of CapacityReservationGroupsClient. -func (c *ClientFactory) NewCapacityReservationGroupsClient() *CapacityReservationGroupsClient { - return &CapacityReservationGroupsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewCapacityReservationsClient creates a new instance of CapacityReservationsClient. -func (c *ClientFactory) NewCapacityReservationsClient() *CapacityReservationsClient { - return &CapacityReservationsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewCloudServiceOperatingSystemsClient creates a new instance of CloudServiceOperatingSystemsClient. -func (c *ClientFactory) NewCloudServiceOperatingSystemsClient() *CloudServiceOperatingSystemsClient { - return &CloudServiceOperatingSystemsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewCloudServiceRoleInstancesClient creates a new instance of CloudServiceRoleInstancesClient. -func (c *ClientFactory) NewCloudServiceRoleInstancesClient() *CloudServiceRoleInstancesClient { - return &CloudServiceRoleInstancesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewCloudServiceRolesClient creates a new instance of CloudServiceRolesClient. -func (c *ClientFactory) NewCloudServiceRolesClient() *CloudServiceRolesClient { - return &CloudServiceRolesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewCloudServicesClient creates a new instance of CloudServicesClient. -func (c *ClientFactory) NewCloudServicesClient() *CloudServicesClient { - return &CloudServicesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewCloudServicesUpdateDomainClient creates a new instance of CloudServicesUpdateDomainClient. -func (c *ClientFactory) NewCloudServicesUpdateDomainClient() *CloudServicesUpdateDomainClient { - return &CloudServicesUpdateDomainClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewCommunityGalleriesClient creates a new instance of CommunityGalleriesClient. -func (c *ClientFactory) NewCommunityGalleriesClient() *CommunityGalleriesClient { - return &CommunityGalleriesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewCommunityGalleryImageVersionsClient creates a new instance of CommunityGalleryImageVersionsClient. -func (c *ClientFactory) NewCommunityGalleryImageVersionsClient() *CommunityGalleryImageVersionsClient { - return &CommunityGalleryImageVersionsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewCommunityGalleryImagesClient creates a new instance of CommunityGalleryImagesClient. -func (c *ClientFactory) NewCommunityGalleryImagesClient() *CommunityGalleryImagesClient { - return &CommunityGalleryImagesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewDedicatedHostGroupsClient creates a new instance of DedicatedHostGroupsClient. -func (c *ClientFactory) NewDedicatedHostGroupsClient() *DedicatedHostGroupsClient { - return &DedicatedHostGroupsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewDedicatedHostsClient creates a new instance of DedicatedHostsClient. -func (c *ClientFactory) NewDedicatedHostsClient() *DedicatedHostsClient { - return &DedicatedHostsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewDiskAccessesClient creates a new instance of DiskAccessesClient. -func (c *ClientFactory) NewDiskAccessesClient() *DiskAccessesClient { - return &DiskAccessesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewDiskEncryptionSetsClient creates a new instance of DiskEncryptionSetsClient. -func (c *ClientFactory) NewDiskEncryptionSetsClient() *DiskEncryptionSetsClient { - return &DiskEncryptionSetsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewDiskRestorePointClient creates a new instance of DiskRestorePointClient. -func (c *ClientFactory) NewDiskRestorePointClient() *DiskRestorePointClient { - return &DiskRestorePointClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewDisksClient creates a new instance of DisksClient. -func (c *ClientFactory) NewDisksClient() *DisksClient { - return &DisksClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewGalleriesClient creates a new instance of GalleriesClient. -func (c *ClientFactory) NewGalleriesClient() *GalleriesClient { - return &GalleriesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewGalleryApplicationVersionsClient creates a new instance of GalleryApplicationVersionsClient. -func (c *ClientFactory) NewGalleryApplicationVersionsClient() *GalleryApplicationVersionsClient { - return &GalleryApplicationVersionsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewGalleryApplicationsClient creates a new instance of GalleryApplicationsClient. -func (c *ClientFactory) NewGalleryApplicationsClient() *GalleryApplicationsClient { - return &GalleryApplicationsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewGalleryImageVersionsClient creates a new instance of GalleryImageVersionsClient. -func (c *ClientFactory) NewGalleryImageVersionsClient() *GalleryImageVersionsClient { - return &GalleryImageVersionsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewGalleryImagesClient creates a new instance of GalleryImagesClient. -func (c *ClientFactory) NewGalleryImagesClient() *GalleryImagesClient { - return &GalleryImagesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewGallerySharingProfileClient creates a new instance of GallerySharingProfileClient. -func (c *ClientFactory) NewGallerySharingProfileClient() *GallerySharingProfileClient { - return &GallerySharingProfileClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewImagesClient creates a new instance of ImagesClient. -func (c *ClientFactory) NewImagesClient() *ImagesClient { - return &ImagesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewLogAnalyticsClient creates a new instance of LogAnalyticsClient. -func (c *ClientFactory) NewLogAnalyticsClient() *LogAnalyticsClient { - return &LogAnalyticsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewOperationsClient creates a new instance of OperationsClient. -func (c *ClientFactory) NewOperationsClient() *OperationsClient { - return &OperationsClient{ - internal: c.internal, - } -} - -// NewProximityPlacementGroupsClient creates a new instance of ProximityPlacementGroupsClient. -func (c *ClientFactory) NewProximityPlacementGroupsClient() *ProximityPlacementGroupsClient { - return &ProximityPlacementGroupsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewResourceSKUsClient creates a new instance of ResourceSKUsClient. -func (c *ClientFactory) NewResourceSKUsClient() *ResourceSKUsClient { - return &ResourceSKUsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewRestorePointCollectionsClient creates a new instance of RestorePointCollectionsClient. -func (c *ClientFactory) NewRestorePointCollectionsClient() *RestorePointCollectionsClient { - return &RestorePointCollectionsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewRestorePointsClient creates a new instance of RestorePointsClient. -func (c *ClientFactory) NewRestorePointsClient() *RestorePointsClient { - return &RestorePointsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewSSHPublicKeysClient creates a new instance of SSHPublicKeysClient. -func (c *ClientFactory) NewSSHPublicKeysClient() *SSHPublicKeysClient { - return &SSHPublicKeysClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewSharedGalleriesClient creates a new instance of SharedGalleriesClient. -func (c *ClientFactory) NewSharedGalleriesClient() *SharedGalleriesClient { - return &SharedGalleriesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewSharedGalleryImageVersionsClient creates a new instance of SharedGalleryImageVersionsClient. -func (c *ClientFactory) NewSharedGalleryImageVersionsClient() *SharedGalleryImageVersionsClient { - return &SharedGalleryImageVersionsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewSharedGalleryImagesClient creates a new instance of SharedGalleryImagesClient. -func (c *ClientFactory) NewSharedGalleryImagesClient() *SharedGalleryImagesClient { - return &SharedGalleryImagesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewSnapshotsClient creates a new instance of SnapshotsClient. -func (c *ClientFactory) NewSnapshotsClient() *SnapshotsClient { - return &SnapshotsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewUsageClient creates a new instance of UsageClient. -func (c *ClientFactory) NewUsageClient() *UsageClient { - return &UsageClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewVirtualMachineExtensionImagesClient creates a new instance of VirtualMachineExtensionImagesClient. -func (c *ClientFactory) NewVirtualMachineExtensionImagesClient() *VirtualMachineExtensionImagesClient { - return &VirtualMachineExtensionImagesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewVirtualMachineExtensionsClient creates a new instance of VirtualMachineExtensionsClient. -func (c *ClientFactory) NewVirtualMachineExtensionsClient() *VirtualMachineExtensionsClient { - return &VirtualMachineExtensionsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewVirtualMachineImagesClient creates a new instance of VirtualMachineImagesClient. -func (c *ClientFactory) NewVirtualMachineImagesClient() *VirtualMachineImagesClient { - return &VirtualMachineImagesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewVirtualMachineImagesEdgeZoneClient creates a new instance of VirtualMachineImagesEdgeZoneClient. -func (c *ClientFactory) NewVirtualMachineImagesEdgeZoneClient() *VirtualMachineImagesEdgeZoneClient { - return &VirtualMachineImagesEdgeZoneClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewVirtualMachineRunCommandsClient creates a new instance of VirtualMachineRunCommandsClient. -func (c *ClientFactory) NewVirtualMachineRunCommandsClient() *VirtualMachineRunCommandsClient { - return &VirtualMachineRunCommandsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewVirtualMachineScaleSetExtensionsClient creates a new instance of VirtualMachineScaleSetExtensionsClient. -func (c *ClientFactory) NewVirtualMachineScaleSetExtensionsClient() *VirtualMachineScaleSetExtensionsClient { - return &VirtualMachineScaleSetExtensionsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewVirtualMachineScaleSetRollingUpgradesClient creates a new instance of VirtualMachineScaleSetRollingUpgradesClient. -func (c *ClientFactory) NewVirtualMachineScaleSetRollingUpgradesClient() *VirtualMachineScaleSetRollingUpgradesClient { - return &VirtualMachineScaleSetRollingUpgradesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewVirtualMachineScaleSetVMExtensionsClient creates a new instance of VirtualMachineScaleSetVMExtensionsClient. -func (c *ClientFactory) NewVirtualMachineScaleSetVMExtensionsClient() *VirtualMachineScaleSetVMExtensionsClient { - return &VirtualMachineScaleSetVMExtensionsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewVirtualMachineScaleSetVMRunCommandsClient creates a new instance of VirtualMachineScaleSetVMRunCommandsClient. -func (c *ClientFactory) NewVirtualMachineScaleSetVMRunCommandsClient() *VirtualMachineScaleSetVMRunCommandsClient { - return &VirtualMachineScaleSetVMRunCommandsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewVirtualMachineScaleSetVMsClient creates a new instance of VirtualMachineScaleSetVMsClient. -func (c *ClientFactory) NewVirtualMachineScaleSetVMsClient() *VirtualMachineScaleSetVMsClient { - return &VirtualMachineScaleSetVMsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewVirtualMachineScaleSetsClient creates a new instance of VirtualMachineScaleSetsClient. -func (c *ClientFactory) NewVirtualMachineScaleSetsClient() *VirtualMachineScaleSetsClient { - return &VirtualMachineScaleSetsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewVirtualMachineSizesClient creates a new instance of VirtualMachineSizesClient. -func (c *ClientFactory) NewVirtualMachineSizesClient() *VirtualMachineSizesClient { - return &VirtualMachineSizesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewVirtualMachinesClient creates a new instance of VirtualMachinesClient. -func (c *ClientFactory) NewVirtualMachinesClient() *VirtualMachinesClient { - return &VirtualMachinesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudserviceoperatingsystems_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudserviceoperatingsystems_client.go deleted file mode 100644 index bd0cda902fb..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudserviceoperatingsystems_client.go +++ /dev/null @@ -1,301 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// CloudServiceOperatingSystemsClient contains the methods for the CloudServiceOperatingSystems group. -// Don't use this type directly, use NewCloudServiceOperatingSystemsClient() instead. -type CloudServiceOperatingSystemsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewCloudServiceOperatingSystemsClient creates a new instance of CloudServiceOperatingSystemsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewCloudServiceOperatingSystemsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CloudServiceOperatingSystemsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &CloudServiceOperatingSystemsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// GetOSFamily - Gets properties of a guest operating system family that can be specified in the XML service configuration -// (.cscfg) for a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - location - Name of the location that the OS family pertains to. -// - osFamilyName - Name of the OS family. -// - options - CloudServiceOperatingSystemsClientGetOSFamilyOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.GetOSFamily -// method. -func (client *CloudServiceOperatingSystemsClient) GetOSFamily(ctx context.Context, location string, osFamilyName string, options *CloudServiceOperatingSystemsClientGetOSFamilyOptions) (CloudServiceOperatingSystemsClientGetOSFamilyResponse, error) { - var err error - const operationName = "CloudServiceOperatingSystemsClient.GetOSFamily" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getOSFamilyCreateRequest(ctx, location, osFamilyName, options) - if err != nil { - return CloudServiceOperatingSystemsClientGetOSFamilyResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CloudServiceOperatingSystemsClientGetOSFamilyResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return CloudServiceOperatingSystemsClientGetOSFamilyResponse{}, err - } - resp, err := client.getOSFamilyHandleResponse(httpResp) - return resp, err -} - -// getOSFamilyCreateRequest creates the GetOSFamily request. -func (client *CloudServiceOperatingSystemsClient) getOSFamilyCreateRequest(ctx context.Context, location string, osFamilyName string, options *CloudServiceOperatingSystemsClientGetOSFamilyOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsFamilies/{osFamilyName}" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if osFamilyName == "" { - return nil, errors.New("parameter osFamilyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{osFamilyName}", url.PathEscape(osFamilyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getOSFamilyHandleResponse handles the GetOSFamily response. -func (client *CloudServiceOperatingSystemsClient) getOSFamilyHandleResponse(resp *http.Response) (CloudServiceOperatingSystemsClientGetOSFamilyResponse, error) { - result := CloudServiceOperatingSystemsClientGetOSFamilyResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.OSFamily); err != nil { - return CloudServiceOperatingSystemsClientGetOSFamilyResponse{}, err - } - return result, nil -} - -// GetOSVersion - Gets properties of a guest operating system version that can be specified in the XML service configuration -// (.cscfg) for a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - location - Name of the location that the OS version pertains to. -// - osVersionName - Name of the OS version. -// - options - CloudServiceOperatingSystemsClientGetOSVersionOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.GetOSVersion -// method. -func (client *CloudServiceOperatingSystemsClient) GetOSVersion(ctx context.Context, location string, osVersionName string, options *CloudServiceOperatingSystemsClientGetOSVersionOptions) (CloudServiceOperatingSystemsClientGetOSVersionResponse, error) { - var err error - const operationName = "CloudServiceOperatingSystemsClient.GetOSVersion" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getOSVersionCreateRequest(ctx, location, osVersionName, options) - if err != nil { - return CloudServiceOperatingSystemsClientGetOSVersionResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CloudServiceOperatingSystemsClientGetOSVersionResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return CloudServiceOperatingSystemsClientGetOSVersionResponse{}, err - } - resp, err := client.getOSVersionHandleResponse(httpResp) - return resp, err -} - -// getOSVersionCreateRequest creates the GetOSVersion request. -func (client *CloudServiceOperatingSystemsClient) getOSVersionCreateRequest(ctx context.Context, location string, osVersionName string, options *CloudServiceOperatingSystemsClientGetOSVersionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsVersions/{osVersionName}" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if osVersionName == "" { - return nil, errors.New("parameter osVersionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{osVersionName}", url.PathEscape(osVersionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getOSVersionHandleResponse handles the GetOSVersion response. -func (client *CloudServiceOperatingSystemsClient) getOSVersionHandleResponse(resp *http.Response) (CloudServiceOperatingSystemsClientGetOSVersionResponse, error) { - result := CloudServiceOperatingSystemsClientGetOSVersionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.OSVersion); err != nil { - return CloudServiceOperatingSystemsClientGetOSVersionResponse{}, err - } - return result, nil -} - -// NewListOSFamiliesPager - Gets a list of all guest operating system families available to be specified in the XML service -// configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page -// of OS Families. Do this till nextLink is null to fetch all the OS Families. -// -// Generated from API version 2022-09-04 -// - location - Name of the location that the OS families pertain to. -// - options - CloudServiceOperatingSystemsClientListOSFamiliesOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.NewListOSFamiliesPager -// method. -func (client *CloudServiceOperatingSystemsClient) NewListOSFamiliesPager(location string, options *CloudServiceOperatingSystemsClientListOSFamiliesOptions) *runtime.Pager[CloudServiceOperatingSystemsClientListOSFamiliesResponse] { - return runtime.NewPager(runtime.PagingHandler[CloudServiceOperatingSystemsClientListOSFamiliesResponse]{ - More: func(page CloudServiceOperatingSystemsClientListOSFamiliesResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *CloudServiceOperatingSystemsClientListOSFamiliesResponse) (CloudServiceOperatingSystemsClientListOSFamiliesResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CloudServiceOperatingSystemsClient.NewListOSFamiliesPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listOSFamiliesCreateRequest(ctx, location, options) - }, nil) - if err != nil { - return CloudServiceOperatingSystemsClientListOSFamiliesResponse{}, err - } - return client.listOSFamiliesHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listOSFamiliesCreateRequest creates the ListOSFamilies request. -func (client *CloudServiceOperatingSystemsClient) listOSFamiliesCreateRequest(ctx context.Context, location string, options *CloudServiceOperatingSystemsClientListOSFamiliesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsFamilies" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listOSFamiliesHandleResponse handles the ListOSFamilies response. -func (client *CloudServiceOperatingSystemsClient) listOSFamiliesHandleResponse(resp *http.Response) (CloudServiceOperatingSystemsClientListOSFamiliesResponse, error) { - result := CloudServiceOperatingSystemsClientListOSFamiliesResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.OSFamilyListResult); err != nil { - return CloudServiceOperatingSystemsClientListOSFamiliesResponse{}, err - } - return result, nil -} - -// NewListOSVersionsPager - Gets a list of all guest operating system versions available to be specified in the XML service -// configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page -// of OS versions. Do this till nextLink is null to fetch all the OS versions. -// -// Generated from API version 2022-09-04 -// - location - Name of the location that the OS versions pertain to. -// - options - CloudServiceOperatingSystemsClientListOSVersionsOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.NewListOSVersionsPager -// method. -func (client *CloudServiceOperatingSystemsClient) NewListOSVersionsPager(location string, options *CloudServiceOperatingSystemsClientListOSVersionsOptions) *runtime.Pager[CloudServiceOperatingSystemsClientListOSVersionsResponse] { - return runtime.NewPager(runtime.PagingHandler[CloudServiceOperatingSystemsClientListOSVersionsResponse]{ - More: func(page CloudServiceOperatingSystemsClientListOSVersionsResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *CloudServiceOperatingSystemsClientListOSVersionsResponse) (CloudServiceOperatingSystemsClientListOSVersionsResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CloudServiceOperatingSystemsClient.NewListOSVersionsPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listOSVersionsCreateRequest(ctx, location, options) - }, nil) - if err != nil { - return CloudServiceOperatingSystemsClientListOSVersionsResponse{}, err - } - return client.listOSVersionsHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listOSVersionsCreateRequest creates the ListOSVersions request. -func (client *CloudServiceOperatingSystemsClient) listOSVersionsCreateRequest(ctx context.Context, location string, options *CloudServiceOperatingSystemsClientListOSVersionsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsVersions" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listOSVersionsHandleResponse handles the ListOSVersions response. -func (client *CloudServiceOperatingSystemsClient) listOSVersionsHandleResponse(resp *http.Response) (CloudServiceOperatingSystemsClientListOSVersionsResponse, error) { - result := CloudServiceOperatingSystemsClientListOSVersionsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.OSVersionListResult); err != nil { - return CloudServiceOperatingSystemsClientListOSVersionsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudserviceroleinstances_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudserviceroleinstances_client.go deleted file mode 100644 index 1f7cdb7c382..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudserviceroleinstances_client.go +++ /dev/null @@ -1,648 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// CloudServiceRoleInstancesClient contains the methods for the CloudServiceRoleInstances group. -// Don't use this type directly, use NewCloudServiceRoleInstancesClient() instead. -type CloudServiceRoleInstancesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewCloudServiceRoleInstancesClient creates a new instance of CloudServiceRoleInstancesClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewCloudServiceRoleInstancesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CloudServiceRoleInstancesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &CloudServiceRoleInstancesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginDelete - Deletes a role instance from a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - roleInstanceName - Name of the role instance. -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServiceRoleInstancesClientBeginDeleteOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginDelete -// method. -func (client *CloudServiceRoleInstancesClient) BeginDelete(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginDeleteOptions) (*runtime.Poller[CloudServiceRoleInstancesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServiceRoleInstancesClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServiceRoleInstancesClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Deletes a role instance from a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -func (client *CloudServiceRoleInstancesClient) deleteOperation(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "CloudServiceRoleInstancesClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *CloudServiceRoleInstancesClient) deleteCreateRequest(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}" - if roleInstanceName == "" { - return nil, errors.New("parameter roleInstanceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets a role instance from a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - roleInstanceName - Name of the role instance. -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServiceRoleInstancesClientGetOptions contains the optional parameters for the CloudServiceRoleInstancesClient.Get -// method. -func (client *CloudServiceRoleInstancesClient) Get(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientGetOptions) (CloudServiceRoleInstancesClientGetResponse, error) { - var err error - const operationName = "CloudServiceRoleInstancesClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options) - if err != nil { - return CloudServiceRoleInstancesClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CloudServiceRoleInstancesClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return CloudServiceRoleInstancesClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *CloudServiceRoleInstancesClient) getCreateRequest(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}" - if roleInstanceName == "" { - return nil, errors.New("parameter roleInstanceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *CloudServiceRoleInstancesClient) getHandleResponse(resp *http.Response) (CloudServiceRoleInstancesClientGetResponse, error) { - result := CloudServiceRoleInstancesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RoleInstance); err != nil { - return CloudServiceRoleInstancesClientGetResponse{}, err - } - return result, nil -} - -// GetInstanceView - Retrieves information about the run-time state of a role instance in a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - roleInstanceName - Name of the role instance. -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServiceRoleInstancesClientGetInstanceViewOptions contains the optional parameters for the CloudServiceRoleInstancesClient.GetInstanceView -// method. -func (client *CloudServiceRoleInstancesClient) GetInstanceView(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientGetInstanceViewOptions) (CloudServiceRoleInstancesClientGetInstanceViewResponse, error) { - var err error - const operationName = "CloudServiceRoleInstancesClient.GetInstanceView" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getInstanceViewCreateRequest(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options) - if err != nil { - return CloudServiceRoleInstancesClientGetInstanceViewResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CloudServiceRoleInstancesClientGetInstanceViewResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return CloudServiceRoleInstancesClientGetInstanceViewResponse{}, err - } - resp, err := client.getInstanceViewHandleResponse(httpResp) - return resp, err -} - -// getInstanceViewCreateRequest creates the GetInstanceView request. -func (client *CloudServiceRoleInstancesClient) getInstanceViewCreateRequest(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientGetInstanceViewOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/instanceView" - if roleInstanceName == "" { - return nil, errors.New("parameter roleInstanceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getInstanceViewHandleResponse handles the GetInstanceView response. -func (client *CloudServiceRoleInstancesClient) getInstanceViewHandleResponse(resp *http.Response) (CloudServiceRoleInstancesClientGetInstanceViewResponse, error) { - result := CloudServiceRoleInstancesClientGetInstanceViewResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RoleInstanceView); err != nil { - return CloudServiceRoleInstancesClientGetInstanceViewResponse{}, err - } - return result, nil -} - -// GetRemoteDesktopFile - Gets a remote desktop file for a role instance in a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - roleInstanceName - Name of the role instance. -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServiceRoleInstancesClientGetRemoteDesktopFileOptions contains the optional parameters for the CloudServiceRoleInstancesClient.GetRemoteDesktopFile -// method. -func (client *CloudServiceRoleInstancesClient) GetRemoteDesktopFile(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientGetRemoteDesktopFileOptions) (CloudServiceRoleInstancesClientGetRemoteDesktopFileResponse, error) { - var err error - const operationName = "CloudServiceRoleInstancesClient.GetRemoteDesktopFile" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getRemoteDesktopFileCreateRequest(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options) - if err != nil { - return CloudServiceRoleInstancesClientGetRemoteDesktopFileResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CloudServiceRoleInstancesClientGetRemoteDesktopFileResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return CloudServiceRoleInstancesClientGetRemoteDesktopFileResponse{}, err - } - return CloudServiceRoleInstancesClientGetRemoteDesktopFileResponse{Body: httpResp.Body}, nil -} - -// getRemoteDesktopFileCreateRequest creates the GetRemoteDesktopFile request. -func (client *CloudServiceRoleInstancesClient) getRemoteDesktopFileCreateRequest(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientGetRemoteDesktopFileOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/remoteDesktopFile" - if roleInstanceName == "" { - return nil, errors.New("parameter roleInstanceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - runtime.SkipBodyDownload(req) - req.Raw().Header["Accept"] = []string{"application/x-rdp"} - return req, nil -} - -// NewListPager - Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the -// next page of role instances. Do this till nextLink is null to fetch all the role instances. -// -// Generated from API version 2022-09-04 -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServiceRoleInstancesClientListOptions contains the optional parameters for the CloudServiceRoleInstancesClient.NewListPager -// method. -func (client *CloudServiceRoleInstancesClient) NewListPager(resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientListOptions) *runtime.Pager[CloudServiceRoleInstancesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[CloudServiceRoleInstancesClientListResponse]{ - More: func(page CloudServiceRoleInstancesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *CloudServiceRoleInstancesClientListResponse) (CloudServiceRoleInstancesClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CloudServiceRoleInstancesClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - }, nil) - if err != nil { - return CloudServiceRoleInstancesClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *CloudServiceRoleInstancesClient) listCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *CloudServiceRoleInstancesClient) listHandleResponse(resp *http.Response) (CloudServiceRoleInstancesClientListResponse, error) { - result := CloudServiceRoleInstancesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RoleInstanceListResult); err != nil { - return CloudServiceRoleInstancesClientListResponse{}, err - } - return result, nil -} - -// BeginRebuild - The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles -// or worker roles and initializes the storage resources that are used by them. If you do not -// want to initialize storage resources, you can use Reimage Role Instance. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - roleInstanceName - Name of the role instance. -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServiceRoleInstancesClientBeginRebuildOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginRebuild -// method. -func (client *CloudServiceRoleInstancesClient) BeginRebuild(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginRebuildOptions) (*runtime.Poller[CloudServiceRoleInstancesClientRebuildResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.rebuild(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServiceRoleInstancesClientRebuildResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServiceRoleInstancesClientRebuildResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Rebuild - The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or -// worker roles and initializes the storage resources that are used by them. If you do not -// want to initialize storage resources, you can use Reimage Role Instance. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -func (client *CloudServiceRoleInstancesClient) rebuild(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginRebuildOptions) (*http.Response, error) { - var err error - const operationName = "CloudServiceRoleInstancesClient.BeginRebuild" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.rebuildCreateRequest(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// rebuildCreateRequest creates the Rebuild request. -func (client *CloudServiceRoleInstancesClient) rebuildCreateRequest(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginRebuildOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/rebuild" - if roleInstanceName == "" { - return nil, errors.New("parameter roleInstanceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginReimage - The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles -// or worker roles. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - roleInstanceName - Name of the role instance. -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServiceRoleInstancesClientBeginReimageOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginReimage -// method. -func (client *CloudServiceRoleInstancesClient) BeginReimage(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginReimageOptions) (*runtime.Poller[CloudServiceRoleInstancesClientReimageResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.reimage(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServiceRoleInstancesClientReimageResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServiceRoleInstancesClientReimageResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Reimage - The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or -// worker roles. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -func (client *CloudServiceRoleInstancesClient) reimage(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginReimageOptions) (*http.Response, error) { - var err error - const operationName = "CloudServiceRoleInstancesClient.BeginReimage" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.reimageCreateRequest(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// reimageCreateRequest creates the Reimage request. -func (client *CloudServiceRoleInstancesClient) reimageCreateRequest(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginReimageOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/reimage" - if roleInstanceName == "" { - return nil, errors.New("parameter roleInstanceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginRestart - The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - roleInstanceName - Name of the role instance. -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServiceRoleInstancesClientBeginRestartOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginRestart -// method. -func (client *CloudServiceRoleInstancesClient) BeginRestart(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginRestartOptions) (*runtime.Poller[CloudServiceRoleInstancesClientRestartResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.restart(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServiceRoleInstancesClientRestartResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServiceRoleInstancesClientRestartResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Restart - The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -func (client *CloudServiceRoleInstancesClient) restart(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginRestartOptions) (*http.Response, error) { - var err error - const operationName = "CloudServiceRoleInstancesClient.BeginRestart" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.restartCreateRequest(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// restartCreateRequest creates the Restart request. -func (client *CloudServiceRoleInstancesClient) restartCreateRequest(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginRestartOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/restart" - if roleInstanceName == "" { - return nil, errors.New("parameter roleInstanceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudserviceroles_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudserviceroles_client.go deleted file mode 100644 index a4572cf143d..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudserviceroles_client.go +++ /dev/null @@ -1,180 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// CloudServiceRolesClient contains the methods for the CloudServiceRoles group. -// Don't use this type directly, use NewCloudServiceRolesClient() instead. -type CloudServiceRolesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewCloudServiceRolesClient creates a new instance of CloudServiceRolesClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewCloudServiceRolesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CloudServiceRolesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &CloudServiceRolesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Get - Gets a role from a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - roleName - Name of the role. -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServiceRolesClientGetOptions contains the optional parameters for the CloudServiceRolesClient.Get method. -func (client *CloudServiceRolesClient) Get(ctx context.Context, roleName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRolesClientGetOptions) (CloudServiceRolesClientGetResponse, error) { - var err error - const operationName = "CloudServiceRolesClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, roleName, resourceGroupName, cloudServiceName, options) - if err != nil { - return CloudServiceRolesClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CloudServiceRolesClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return CloudServiceRolesClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *CloudServiceRolesClient) getCreateRequest(ctx context.Context, roleName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRolesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roles/{roleName}" - if roleName == "" { - return nil, errors.New("parameter roleName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{roleName}", url.PathEscape(roleName)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *CloudServiceRolesClient) getHandleResponse(resp *http.Response) (CloudServiceRolesClientGetResponse, error) { - result := CloudServiceRolesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CloudServiceRole); err != nil { - return CloudServiceRolesClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page -// of roles. Do this till nextLink is null to fetch all the roles. -// -// Generated from API version 2022-09-04 -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServiceRolesClientListOptions contains the optional parameters for the CloudServiceRolesClient.NewListPager -// method. -func (client *CloudServiceRolesClient) NewListPager(resourceGroupName string, cloudServiceName string, options *CloudServiceRolesClientListOptions) *runtime.Pager[CloudServiceRolesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[CloudServiceRolesClientListResponse]{ - More: func(page CloudServiceRolesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *CloudServiceRolesClientListResponse) (CloudServiceRolesClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CloudServiceRolesClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - }, nil) - if err != nil { - return CloudServiceRolesClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *CloudServiceRolesClient) listCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServiceRolesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roles" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *CloudServiceRolesClient) listHandleResponse(resp *http.Response) (CloudServiceRolesClientListResponse, error) { - result := CloudServiceRolesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CloudServiceRoleListResult); err != nil { - return CloudServiceRolesClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudservices_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudservices_client.go deleted file mode 100644 index 283d3a6feb7..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudservices_client.go +++ /dev/null @@ -1,1013 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// CloudServicesClient contains the methods for the CloudServices group. -// Don't use this type directly, use NewCloudServicesClient() instead. -type CloudServicesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewCloudServicesClient creates a new instance of CloudServicesClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewCloudServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CloudServicesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &CloudServicesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create or update a cloud service. Please note some properties can be set only during cloud service -// creation. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - parameters - The cloud service object. -// - options - CloudServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the CloudServicesClient.BeginCreateOrUpdate -// method. -func (client *CloudServicesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters CloudService, options *CloudServicesClientBeginCreateOrUpdateOptions) (*runtime.Poller[CloudServicesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, cloudServiceName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServicesClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServicesClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Create or update a cloud service. Please note some properties can be set only during cloud service creation. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -func (client *CloudServicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters CloudService, options *CloudServicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "CloudServicesClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, cloudServiceName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *CloudServicesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters CloudService, options *CloudServicesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - Deletes a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServicesClientBeginDeleteOptions contains the optional parameters for the CloudServicesClient.BeginDelete -// method. -func (client *CloudServicesClient) BeginDelete(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginDeleteOptions) (*runtime.Poller[CloudServicesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServicesClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServicesClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Deletes a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -func (client *CloudServicesClient) deleteOperation(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "CloudServicesClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *CloudServicesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginDeleteInstances - Deletes role instances in a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServicesClientBeginDeleteInstancesOptions contains the optional parameters for the CloudServicesClient.BeginDeleteInstances -// method. -func (client *CloudServicesClient) BeginDeleteInstances(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginDeleteInstancesOptions) (*runtime.Poller[CloudServicesClientDeleteInstancesResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteInstances(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServicesClientDeleteInstancesResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServicesClientDeleteInstancesResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// DeleteInstances - Deletes role instances in a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -func (client *CloudServicesClient) deleteInstances(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginDeleteInstancesOptions) (*http.Response, error) { - var err error - const operationName = "CloudServicesClient.BeginDeleteInstances" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteInstancesCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteInstancesCreateRequest creates the DeleteInstances request. -func (client *CloudServicesClient) deleteInstancesCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginDeleteInstancesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/delete" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.Parameters != nil { - if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil { - return nil, err - } - return req, nil - } - return req, nil -} - -// Get - Display information about a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServicesClientGetOptions contains the optional parameters for the CloudServicesClient.Get method. -func (client *CloudServicesClient) Get(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientGetOptions) (CloudServicesClientGetResponse, error) { - var err error - const operationName = "CloudServicesClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return CloudServicesClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CloudServicesClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return CloudServicesClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *CloudServicesClient) getCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *CloudServicesClient) getHandleResponse(resp *http.Response) (CloudServicesClientGetResponse, error) { - result := CloudServicesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CloudService); err != nil { - return CloudServicesClientGetResponse{}, err - } - return result, nil -} - -// GetInstanceView - Gets the status of a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServicesClientGetInstanceViewOptions contains the optional parameters for the CloudServicesClient.GetInstanceView -// method. -func (client *CloudServicesClient) GetInstanceView(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientGetInstanceViewOptions) (CloudServicesClientGetInstanceViewResponse, error) { - var err error - const operationName = "CloudServicesClient.GetInstanceView" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getInstanceViewCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return CloudServicesClientGetInstanceViewResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CloudServicesClientGetInstanceViewResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return CloudServicesClientGetInstanceViewResponse{}, err - } - resp, err := client.getInstanceViewHandleResponse(httpResp) - return resp, err -} - -// getInstanceViewCreateRequest creates the GetInstanceView request. -func (client *CloudServicesClient) getInstanceViewCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientGetInstanceViewOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/instanceView" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getInstanceViewHandleResponse handles the GetInstanceView response. -func (client *CloudServicesClient) getInstanceViewHandleResponse(resp *http.Response) (CloudServicesClientGetInstanceViewResponse, error) { - result := CloudServicesClientGetInstanceViewResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CloudServiceInstanceView); err != nil { - return CloudServicesClientGetInstanceViewResponse{}, err - } - return result, nil -} - -// NewListPager - Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the -// next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. -// -// Generated from API version 2022-09-04 -// - resourceGroupName - Name of the resource group. -// - options - CloudServicesClientListOptions contains the optional parameters for the CloudServicesClient.NewListPager method. -func (client *CloudServicesClient) NewListPager(resourceGroupName string, options *CloudServicesClientListOptions) *runtime.Pager[CloudServicesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[CloudServicesClientListResponse]{ - More: func(page CloudServicesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *CloudServicesClientListResponse) (CloudServicesClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CloudServicesClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, options) - }, nil) - if err != nil { - return CloudServicesClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *CloudServicesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *CloudServicesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *CloudServicesClient) listHandleResponse(resp *http.Response) (CloudServicesClientListResponse, error) { - result := CloudServicesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CloudServiceListResult); err != nil { - return CloudServicesClientListResponse{}, err - } - return result, nil -} - -// NewListAllPager - Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use -// nextLink property in the response to get the next page of Cloud Services. Do this till nextLink -// is null to fetch all the Cloud Services. -// -// Generated from API version 2022-09-04 -// - options - CloudServicesClientListAllOptions contains the optional parameters for the CloudServicesClient.NewListAllPager -// method. -func (client *CloudServicesClient) NewListAllPager(options *CloudServicesClientListAllOptions) *runtime.Pager[CloudServicesClientListAllResponse] { - return runtime.NewPager(runtime.PagingHandler[CloudServicesClientListAllResponse]{ - More: func(page CloudServicesClientListAllResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *CloudServicesClientListAllResponse) (CloudServicesClientListAllResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CloudServicesClient.NewListAllPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listAllCreateRequest(ctx, options) - }, nil) - if err != nil { - return CloudServicesClientListAllResponse{}, err - } - return client.listAllHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listAllCreateRequest creates the ListAll request. -func (client *CloudServicesClient) listAllCreateRequest(ctx context.Context, options *CloudServicesClientListAllOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/cloudServices" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAllHandleResponse handles the ListAll response. -func (client *CloudServicesClient) listAllHandleResponse(resp *http.Response) (CloudServicesClientListAllResponse, error) { - result := CloudServicesClientListAllResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CloudServiceListResult); err != nil { - return CloudServicesClientListAllResponse{}, err - } - return result, nil -} - -// BeginPowerOff - Power off the cloud service. Note that resources are still attached and you are getting charged for the -// resources. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServicesClientBeginPowerOffOptions contains the optional parameters for the CloudServicesClient.BeginPowerOff -// method. -func (client *CloudServicesClient) BeginPowerOff(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginPowerOffOptions) (*runtime.Poller[CloudServicesClientPowerOffResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.powerOff(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServicesClientPowerOffResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServicesClientPowerOffResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// PowerOff - Power off the cloud service. Note that resources are still attached and you are getting charged for the resources. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -func (client *CloudServicesClient) powerOff(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginPowerOffOptions) (*http.Response, error) { - var err error - const operationName = "CloudServicesClient.BeginPowerOff" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.powerOffCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// powerOffCreateRequest creates the PowerOff request. -func (client *CloudServicesClient) powerOffCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginPowerOffOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/poweroff" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginRebuild - Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes -// the storage resources that are used by them. If you do not want to initialize storage -// resources, you can use Reimage Role Instances. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServicesClientBeginRebuildOptions contains the optional parameters for the CloudServicesClient.BeginRebuild -// method. -func (client *CloudServicesClient) BeginRebuild(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginRebuildOptions) (*runtime.Poller[CloudServicesClientRebuildResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.rebuild(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServicesClientRebuildResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServicesClientRebuildResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Rebuild - Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes -// the storage resources that are used by them. If you do not want to initialize storage -// resources, you can use Reimage Role Instances. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -func (client *CloudServicesClient) rebuild(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginRebuildOptions) (*http.Response, error) { - var err error - const operationName = "CloudServicesClient.BeginRebuild" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.rebuildCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// rebuildCreateRequest creates the Rebuild request. -func (client *CloudServicesClient) rebuildCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginRebuildOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/rebuild" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.Parameters != nil { - if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil { - return nil, err - } - return req, nil - } - return req, nil -} - -// BeginReimage - Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServicesClientBeginReimageOptions contains the optional parameters for the CloudServicesClient.BeginReimage -// method. -func (client *CloudServicesClient) BeginReimage(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginReimageOptions) (*runtime.Poller[CloudServicesClientReimageResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.reimage(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServicesClientReimageResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServicesClientReimageResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Reimage - Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -func (client *CloudServicesClient) reimage(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginReimageOptions) (*http.Response, error) { - var err error - const operationName = "CloudServicesClient.BeginReimage" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.reimageCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// reimageCreateRequest creates the Reimage request. -func (client *CloudServicesClient) reimageCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginReimageOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/reimage" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.Parameters != nil { - if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil { - return nil, err - } - return req, nil - } - return req, nil -} - -// BeginRestart - Restarts one or more role instances in a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServicesClientBeginRestartOptions contains the optional parameters for the CloudServicesClient.BeginRestart -// method. -func (client *CloudServicesClient) BeginRestart(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginRestartOptions) (*runtime.Poller[CloudServicesClientRestartResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.restart(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServicesClientRestartResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServicesClientRestartResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Restart - Restarts one or more role instances in a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -func (client *CloudServicesClient) restart(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginRestartOptions) (*http.Response, error) { - var err error - const operationName = "CloudServicesClient.BeginRestart" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.restartCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// restartCreateRequest creates the Restart request. -func (client *CloudServicesClient) restartCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginRestartOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/restart" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.Parameters != nil { - if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil { - return nil, err - } - return req, nil - } - return req, nil -} - -// BeginStart - Starts the cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServicesClientBeginStartOptions contains the optional parameters for the CloudServicesClient.BeginStart -// method. -func (client *CloudServicesClient) BeginStart(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginStartOptions) (*runtime.Poller[CloudServicesClientStartResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.start(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServicesClientStartResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServicesClientStartResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Start - Starts the cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -func (client *CloudServicesClient) start(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginStartOptions) (*http.Response, error) { - var err error - const operationName = "CloudServicesClient.BeginStart" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.startCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// startCreateRequest creates the Start request. -func (client *CloudServicesClient) startCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginStartOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/start" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginUpdate - Update a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - parameters - The cloud service object. -// - options - CloudServicesClientBeginUpdateOptions contains the optional parameters for the CloudServicesClient.BeginUpdate -// method. -func (client *CloudServicesClient) BeginUpdate(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters CloudServiceUpdate, options *CloudServicesClientBeginUpdateOptions) (*runtime.Poller[CloudServicesClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, cloudServiceName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServicesClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServicesClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Update a cloud service. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -func (client *CloudServicesClient) update(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters CloudServiceUpdate, options *CloudServicesClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "CloudServicesClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, cloudServiceName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *CloudServicesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters CloudServiceUpdate, options *CloudServicesClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudservicesupdatedomain_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudservicesupdatedomain_client.go deleted file mode 100644 index a4bd1e7b126..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudservicesupdatedomain_client.go +++ /dev/null @@ -1,263 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// CloudServicesUpdateDomainClient contains the methods for the CloudServicesUpdateDomain group. -// Don't use this type directly, use NewCloudServicesUpdateDomainClient() instead. -type CloudServicesUpdateDomainClient struct { - internal *arm.Client - subscriptionID string -} - -// NewCloudServicesUpdateDomainClient creates a new instance of CloudServicesUpdateDomainClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewCloudServicesUpdateDomainClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CloudServicesUpdateDomainClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &CloudServicesUpdateDomainClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// GetUpdateDomain - Gets the specified update domain of a cloud service. Use nextLink property in the response to get the -// next page of update domains. Do this till nextLink is null to fetch all the update domains. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - updateDomain - Specifies an integer value that identifies the update domain. Update domains are identified with a zero-based -// index: the first update domain has an ID of 0, the second has an ID of 1, and so on. -// - options - CloudServicesUpdateDomainClientGetUpdateDomainOptions contains the optional parameters for the CloudServicesUpdateDomainClient.GetUpdateDomain -// method. -func (client *CloudServicesUpdateDomainClient) GetUpdateDomain(ctx context.Context, resourceGroupName string, cloudServiceName string, updateDomain int32, options *CloudServicesUpdateDomainClientGetUpdateDomainOptions) (CloudServicesUpdateDomainClientGetUpdateDomainResponse, error) { - var err error - const operationName = "CloudServicesUpdateDomainClient.GetUpdateDomain" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getUpdateDomainCreateRequest(ctx, resourceGroupName, cloudServiceName, updateDomain, options) - if err != nil { - return CloudServicesUpdateDomainClientGetUpdateDomainResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CloudServicesUpdateDomainClientGetUpdateDomainResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return CloudServicesUpdateDomainClientGetUpdateDomainResponse{}, err - } - resp, err := client.getUpdateDomainHandleResponse(httpResp) - return resp, err -} - -// getUpdateDomainCreateRequest creates the GetUpdateDomain request. -func (client *CloudServicesUpdateDomainClient) getUpdateDomainCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, updateDomain int32, options *CloudServicesUpdateDomainClientGetUpdateDomainOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/updateDomains/{updateDomain}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - urlPath = strings.ReplaceAll(urlPath, "{updateDomain}", url.PathEscape(strconv.FormatInt(int64(updateDomain), 10))) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getUpdateDomainHandleResponse handles the GetUpdateDomain response. -func (client *CloudServicesUpdateDomainClient) getUpdateDomainHandleResponse(resp *http.Response) (CloudServicesUpdateDomainClientGetUpdateDomainResponse, error) { - result := CloudServicesUpdateDomainClientGetUpdateDomainResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.UpdateDomain); err != nil { - return CloudServicesUpdateDomainClientGetUpdateDomainResponse{}, err - } - return result, nil -} - -// NewListUpdateDomainsPager - Gets a list of all update domains in a cloud service. -// -// Generated from API version 2022-09-04 -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - options - CloudServicesUpdateDomainClientListUpdateDomainsOptions contains the optional parameters for the CloudServicesUpdateDomainClient.NewListUpdateDomainsPager -// method. -func (client *CloudServicesUpdateDomainClient) NewListUpdateDomainsPager(resourceGroupName string, cloudServiceName string, options *CloudServicesUpdateDomainClientListUpdateDomainsOptions) *runtime.Pager[CloudServicesUpdateDomainClientListUpdateDomainsResponse] { - return runtime.NewPager(runtime.PagingHandler[CloudServicesUpdateDomainClientListUpdateDomainsResponse]{ - More: func(page CloudServicesUpdateDomainClientListUpdateDomainsResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *CloudServicesUpdateDomainClientListUpdateDomainsResponse) (CloudServicesUpdateDomainClientListUpdateDomainsResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CloudServicesUpdateDomainClient.NewListUpdateDomainsPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listUpdateDomainsCreateRequest(ctx, resourceGroupName, cloudServiceName, options) - }, nil) - if err != nil { - return CloudServicesUpdateDomainClientListUpdateDomainsResponse{}, err - } - return client.listUpdateDomainsHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listUpdateDomainsCreateRequest creates the ListUpdateDomains request. -func (client *CloudServicesUpdateDomainClient) listUpdateDomainsCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesUpdateDomainClientListUpdateDomainsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/updateDomains" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listUpdateDomainsHandleResponse handles the ListUpdateDomains response. -func (client *CloudServicesUpdateDomainClient) listUpdateDomainsHandleResponse(resp *http.Response) (CloudServicesUpdateDomainClientListUpdateDomainsResponse, error) { - result := CloudServicesUpdateDomainClientListUpdateDomainsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.UpdateDomainListResult); err != nil { - return CloudServicesUpdateDomainClientListUpdateDomainsResponse{}, err - } - return result, nil -} - -// BeginWalkUpdateDomain - Updates the role instances in the specified update domain. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -// - resourceGroupName - Name of the resource group. -// - cloudServiceName - Name of the cloud service. -// - updateDomain - Specifies an integer value that identifies the update domain. Update domains are identified with a zero-based -// index: the first update domain has an ID of 0, the second has an ID of 1, and so on. -// - parameters - The update domain object. -// - options - CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions contains the optional parameters for the CloudServicesUpdateDomainClient.BeginWalkUpdateDomain -// method. -func (client *CloudServicesUpdateDomainClient) BeginWalkUpdateDomain(ctx context.Context, resourceGroupName string, cloudServiceName string, updateDomain int32, parameters UpdateDomain, options *CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions) (*runtime.Poller[CloudServicesUpdateDomainClientWalkUpdateDomainResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.walkUpdateDomain(ctx, resourceGroupName, cloudServiceName, updateDomain, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServicesUpdateDomainClientWalkUpdateDomainResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServicesUpdateDomainClientWalkUpdateDomainResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// WalkUpdateDomain - Updates the role instances in the specified update domain. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-04 -func (client *CloudServicesUpdateDomainClient) walkUpdateDomain(ctx context.Context, resourceGroupName string, cloudServiceName string, updateDomain int32, parameters UpdateDomain, options *CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions) (*http.Response, error) { - var err error - const operationName = "CloudServicesUpdateDomainClient.BeginWalkUpdateDomain" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.walkUpdateDomainCreateRequest(ctx, resourceGroupName, cloudServiceName, updateDomain, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// walkUpdateDomainCreateRequest creates the WalkUpdateDomain request. -func (client *CloudServicesUpdateDomainClient) walkUpdateDomainCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, updateDomain int32, parameters UpdateDomain, options *CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/updateDomains/{updateDomain}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if cloudServiceName == "" { - return nil, errors.New("parameter cloudServiceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName)) - urlPath = strings.ReplaceAll(urlPath, "{updateDomain}", url.PathEscape(strconv.FormatInt(int64(updateDomain), 10))) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-04") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/communitygalleries_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/communitygalleries_client.go deleted file mode 100644 index 431a26cdef2..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/communitygalleries_client.go +++ /dev/null @@ -1,109 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// CommunityGalleriesClient contains the methods for the CommunityGalleries group. -// Don't use this type directly, use NewCommunityGalleriesClient() instead. -type CommunityGalleriesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewCommunityGalleriesClient creates a new instance of CommunityGalleriesClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewCommunityGalleriesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CommunityGalleriesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &CommunityGalleriesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Get - Get a community gallery by gallery public name. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - location - Resource location. -// - publicGalleryName - The public name of the community gallery. -// - options - CommunityGalleriesClientGetOptions contains the optional parameters for the CommunityGalleriesClient.Get method. -func (client *CommunityGalleriesClient) Get(ctx context.Context, location string, publicGalleryName string, options *CommunityGalleriesClientGetOptions) (CommunityGalleriesClientGetResponse, error) { - var err error - const operationName = "CommunityGalleriesClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, location, publicGalleryName, options) - if err != nil { - return CommunityGalleriesClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CommunityGalleriesClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return CommunityGalleriesClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *CommunityGalleriesClient) getCreateRequest(ctx context.Context, location string, publicGalleryName string, options *CommunityGalleriesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if publicGalleryName == "" { - return nil, errors.New("parameter publicGalleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publicGalleryName}", url.PathEscape(publicGalleryName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *CommunityGalleriesClient) getHandleResponse(resp *http.Response) (CommunityGalleriesClientGetResponse, error) { - result := CommunityGalleriesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CommunityGallery); err != nil { - return CommunityGalleriesClientGetResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/communitygalleryimages_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/communitygalleryimages_client.go deleted file mode 100644 index 4ecc005caaf..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/communitygalleryimages_client.go +++ /dev/null @@ -1,180 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// CommunityGalleryImagesClient contains the methods for the CommunityGalleryImages group. -// Don't use this type directly, use NewCommunityGalleryImagesClient() instead. -type CommunityGalleryImagesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewCommunityGalleryImagesClient creates a new instance of CommunityGalleryImagesClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewCommunityGalleryImagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CommunityGalleryImagesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &CommunityGalleryImagesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Get - Get a community gallery image. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - location - Resource location. -// - publicGalleryName - The public name of the community gallery. -// - galleryImageName - The name of the community gallery image definition. -// - options - CommunityGalleryImagesClientGetOptions contains the optional parameters for the CommunityGalleryImagesClient.Get -// method. -func (client *CommunityGalleryImagesClient) Get(ctx context.Context, location string, publicGalleryName string, galleryImageName string, options *CommunityGalleryImagesClientGetOptions) (CommunityGalleryImagesClientGetResponse, error) { - var err error - const operationName = "CommunityGalleryImagesClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, location, publicGalleryName, galleryImageName, options) - if err != nil { - return CommunityGalleryImagesClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CommunityGalleryImagesClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return CommunityGalleryImagesClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *CommunityGalleryImagesClient) getCreateRequest(ctx context.Context, location string, publicGalleryName string, galleryImageName string, options *CommunityGalleryImagesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if publicGalleryName == "" { - return nil, errors.New("parameter publicGalleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publicGalleryName}", url.PathEscape(publicGalleryName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *CommunityGalleryImagesClient) getHandleResponse(resp *http.Response) (CommunityGalleryImagesClientGetResponse, error) { - result := CommunityGalleryImagesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CommunityGalleryImage); err != nil { - return CommunityGalleryImagesClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - List community gallery images inside a gallery. -// -// Generated from API version 2023-07-03 -// - location - Resource location. -// - publicGalleryName - The public name of the community gallery. -// - options - CommunityGalleryImagesClientListOptions contains the optional parameters for the CommunityGalleryImagesClient.NewListPager -// method. -func (client *CommunityGalleryImagesClient) NewListPager(location string, publicGalleryName string, options *CommunityGalleryImagesClientListOptions) *runtime.Pager[CommunityGalleryImagesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[CommunityGalleryImagesClientListResponse]{ - More: func(page CommunityGalleryImagesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *CommunityGalleryImagesClientListResponse) (CommunityGalleryImagesClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CommunityGalleryImagesClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, location, publicGalleryName, options) - }, nil) - if err != nil { - return CommunityGalleryImagesClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *CommunityGalleryImagesClient) listCreateRequest(ctx context.Context, location string, publicGalleryName string, options *CommunityGalleryImagesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if publicGalleryName == "" { - return nil, errors.New("parameter publicGalleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publicGalleryName}", url.PathEscape(publicGalleryName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *CommunityGalleryImagesClient) listHandleResponse(resp *http.Response) (CommunityGalleryImagesClientListResponse, error) { - result := CommunityGalleryImagesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CommunityGalleryImageList); err != nil { - return CommunityGalleryImagesClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/communitygalleryimageversions_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/communitygalleryimageversions_client.go deleted file mode 100644 index e98cfa506c7..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/communitygalleryimageversions_client.go +++ /dev/null @@ -1,192 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// CommunityGalleryImageVersionsClient contains the methods for the CommunityGalleryImageVersions group. -// Don't use this type directly, use NewCommunityGalleryImageVersionsClient() instead. -type CommunityGalleryImageVersionsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewCommunityGalleryImageVersionsClient creates a new instance of CommunityGalleryImageVersionsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewCommunityGalleryImageVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CommunityGalleryImageVersionsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &CommunityGalleryImageVersionsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Get - Get a community gallery image version. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - location - Resource location. -// - publicGalleryName - The public name of the community gallery. -// - galleryImageName - The name of the community gallery image definition. -// - galleryImageVersionName - The name of the community gallery image version. Needs to follow semantic version name pattern: -// The allowed characters are digit and period. Digits must be within the range of a 32-bit integer. -// Format: .. -// - options - CommunityGalleryImageVersionsClientGetOptions contains the optional parameters for the CommunityGalleryImageVersionsClient.Get -// method. -func (client *CommunityGalleryImageVersionsClient) Get(ctx context.Context, location string, publicGalleryName string, galleryImageName string, galleryImageVersionName string, options *CommunityGalleryImageVersionsClientGetOptions) (CommunityGalleryImageVersionsClientGetResponse, error) { - var err error - const operationName = "CommunityGalleryImageVersionsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, location, publicGalleryName, galleryImageName, galleryImageVersionName, options) - if err != nil { - return CommunityGalleryImageVersionsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return CommunityGalleryImageVersionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return CommunityGalleryImageVersionsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *CommunityGalleryImageVersionsClient) getCreateRequest(ctx context.Context, location string, publicGalleryName string, galleryImageName string, galleryImageVersionName string, options *CommunityGalleryImageVersionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if publicGalleryName == "" { - return nil, errors.New("parameter publicGalleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publicGalleryName}", url.PathEscape(publicGalleryName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - if galleryImageVersionName == "" { - return nil, errors.New("parameter galleryImageVersionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageVersionName}", url.PathEscape(galleryImageVersionName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *CommunityGalleryImageVersionsClient) getHandleResponse(resp *http.Response) (CommunityGalleryImageVersionsClientGetResponse, error) { - result := CommunityGalleryImageVersionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CommunityGalleryImageVersion); err != nil { - return CommunityGalleryImageVersionsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - List community gallery image versions inside an image. -// -// Generated from API version 2023-07-03 -// - location - Resource location. -// - publicGalleryName - The public name of the community gallery. -// - galleryImageName - The name of the community gallery image definition. -// - options - CommunityGalleryImageVersionsClientListOptions contains the optional parameters for the CommunityGalleryImageVersionsClient.NewListPager -// method. -func (client *CommunityGalleryImageVersionsClient) NewListPager(location string, publicGalleryName string, galleryImageName string, options *CommunityGalleryImageVersionsClientListOptions) *runtime.Pager[CommunityGalleryImageVersionsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[CommunityGalleryImageVersionsClientListResponse]{ - More: func(page CommunityGalleryImageVersionsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *CommunityGalleryImageVersionsClientListResponse) (CommunityGalleryImageVersionsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CommunityGalleryImageVersionsClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, location, publicGalleryName, galleryImageName, options) - }, nil) - if err != nil { - return CommunityGalleryImageVersionsClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *CommunityGalleryImageVersionsClient) listCreateRequest(ctx context.Context, location string, publicGalleryName string, galleryImageName string, options *CommunityGalleryImageVersionsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}/versions" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if publicGalleryName == "" { - return nil, errors.New("parameter publicGalleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publicGalleryName}", url.PathEscape(publicGalleryName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *CommunityGalleryImageVersionsClient) listHandleResponse(resp *http.Response) (CommunityGalleryImageVersionsClientListResponse, error) { - result := CommunityGalleryImageVersionsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CommunityGalleryImageVersionList); err != nil { - return CommunityGalleryImageVersionsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/constants.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/constants.go deleted file mode 100644 index ab719dfdf02..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/constants.go +++ /dev/null @@ -1,2830 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -const ( - moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute" - moduleVersion = "v5.7.0" -) - -type AccessLevel string - -const ( - AccessLevelNone AccessLevel = "None" - AccessLevelRead AccessLevel = "Read" - AccessLevelWrite AccessLevel = "Write" -) - -// PossibleAccessLevelValues returns the possible values for the AccessLevel const type. -func PossibleAccessLevelValues() []AccessLevel { - return []AccessLevel{ - AccessLevelNone, - AccessLevelRead, - AccessLevelWrite, - } -} - -// AggregatedReplicationState - This is the aggregated replication status based on all the regional replication status flags. -type AggregatedReplicationState string - -const ( - AggregatedReplicationStateCompleted AggregatedReplicationState = "Completed" - AggregatedReplicationStateFailed AggregatedReplicationState = "Failed" - AggregatedReplicationStateInProgress AggregatedReplicationState = "InProgress" - AggregatedReplicationStateUnknown AggregatedReplicationState = "Unknown" -) - -// PossibleAggregatedReplicationStateValues returns the possible values for the AggregatedReplicationState const type. -func PossibleAggregatedReplicationStateValues() []AggregatedReplicationState { - return []AggregatedReplicationState{ - AggregatedReplicationStateCompleted, - AggregatedReplicationStateFailed, - AggregatedReplicationStateInProgress, - AggregatedReplicationStateUnknown, - } -} - -// AlternativeType - Describes the type of the alternative option. -type AlternativeType string - -const ( - AlternativeTypeNone AlternativeType = "None" - AlternativeTypeOffer AlternativeType = "Offer" - AlternativeTypePlan AlternativeType = "Plan" -) - -// PossibleAlternativeTypeValues returns the possible values for the AlternativeType const type. -func PossibleAlternativeTypeValues() []AlternativeType { - return []AlternativeType{ - AlternativeTypeNone, - AlternativeTypeOffer, - AlternativeTypePlan, - } -} - -// Architecture - The architecture of the image. Applicable to OS disks only. -type Architecture string - -const ( - ArchitectureArm64 Architecture = "Arm64" - ArchitectureX64 Architecture = "x64" -) - -// PossibleArchitectureValues returns the possible values for the Architecture const type. -func PossibleArchitectureValues() []Architecture { - return []Architecture{ - ArchitectureArm64, - ArchitectureX64, - } -} - -// ArchitectureTypes - Specifies the Architecture Type -type ArchitectureTypes string - -const ( - ArchitectureTypesArm64 ArchitectureTypes = "Arm64" - ArchitectureTypesX64 ArchitectureTypes = "x64" -) - -// PossibleArchitectureTypesValues returns the possible values for the ArchitectureTypes const type. -func PossibleArchitectureTypesValues() []ArchitectureTypes { - return []ArchitectureTypes{ - ArchitectureTypesArm64, - ArchitectureTypesX64, - } -} - -// AvailabilitySetSKUTypes - Specifies the sku of an Availability Set. Use 'Aligned' for virtual machines with managed disks -// and 'Classic' for virtual machines with unmanaged disks. Default value is 'Classic'. -type AvailabilitySetSKUTypes string - -const ( - AvailabilitySetSKUTypesAligned AvailabilitySetSKUTypes = "Aligned" - AvailabilitySetSKUTypesClassic AvailabilitySetSKUTypes = "Classic" -) - -// PossibleAvailabilitySetSKUTypesValues returns the possible values for the AvailabilitySetSKUTypes const type. -func PossibleAvailabilitySetSKUTypesValues() []AvailabilitySetSKUTypes { - return []AvailabilitySetSKUTypes{ - AvailabilitySetSKUTypesAligned, - AvailabilitySetSKUTypesClassic, - } -} - -// CachingTypes - Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The default values are: -// None for Standard storage. ReadOnly for Premium storage -type CachingTypes string - -const ( - CachingTypesNone CachingTypes = "None" - CachingTypesReadOnly CachingTypes = "ReadOnly" - CachingTypesReadWrite CachingTypes = "ReadWrite" -) - -// PossibleCachingTypesValues returns the possible values for the CachingTypes const type. -func PossibleCachingTypesValues() []CachingTypes { - return []CachingTypes{ - CachingTypesNone, - CachingTypesReadOnly, - CachingTypesReadWrite, - } -} - -type CapacityReservationGroupInstanceViewTypes string - -const ( - CapacityReservationGroupInstanceViewTypesInstanceView CapacityReservationGroupInstanceViewTypes = "instanceView" -) - -// PossibleCapacityReservationGroupInstanceViewTypesValues returns the possible values for the CapacityReservationGroupInstanceViewTypes const type. -func PossibleCapacityReservationGroupInstanceViewTypesValues() []CapacityReservationGroupInstanceViewTypes { - return []CapacityReservationGroupInstanceViewTypes{ - CapacityReservationGroupInstanceViewTypesInstanceView, - } -} - -type CapacityReservationInstanceViewTypes string - -const ( - CapacityReservationInstanceViewTypesInstanceView CapacityReservationInstanceViewTypes = "instanceView" -) - -// PossibleCapacityReservationInstanceViewTypesValues returns the possible values for the CapacityReservationInstanceViewTypes const type. -func PossibleCapacityReservationInstanceViewTypesValues() []CapacityReservationInstanceViewTypes { - return []CapacityReservationInstanceViewTypes{ - CapacityReservationInstanceViewTypesInstanceView, - } -} - -// CloudServiceSlotType - Slot type for the cloud service. Possible values are -// Production -// Staging -// If not specified, the default value is Production. -type CloudServiceSlotType string - -const ( - CloudServiceSlotTypeProduction CloudServiceSlotType = "Production" - CloudServiceSlotTypeStaging CloudServiceSlotType = "Staging" -) - -// PossibleCloudServiceSlotTypeValues returns the possible values for the CloudServiceSlotType const type. -func PossibleCloudServiceSlotTypeValues() []CloudServiceSlotType { - return []CloudServiceSlotType{ - CloudServiceSlotTypeProduction, - CloudServiceSlotTypeStaging, - } -} - -// CloudServiceUpgradeMode - Update mode for the cloud service. Role instances are allocated to update domains when the service -// is deployed. Updates can be initiated manually in each update domain or initiated automatically in -// all update domains. Possible Values are -// Auto -// Manual -// Simultaneous -// If not specified, the default value is Auto. If set to Manual, PUT UpdateDomain must be called to apply the update. If -// set to Auto, the update is automatically applied to each update domain in -// sequence. -type CloudServiceUpgradeMode string - -const ( - CloudServiceUpgradeModeAuto CloudServiceUpgradeMode = "Auto" - CloudServiceUpgradeModeManual CloudServiceUpgradeMode = "Manual" - CloudServiceUpgradeModeSimultaneous CloudServiceUpgradeMode = "Simultaneous" -) - -// PossibleCloudServiceUpgradeModeValues returns the possible values for the CloudServiceUpgradeMode const type. -func PossibleCloudServiceUpgradeModeValues() []CloudServiceUpgradeMode { - return []CloudServiceUpgradeMode{ - CloudServiceUpgradeModeAuto, - CloudServiceUpgradeModeManual, - CloudServiceUpgradeModeSimultaneous, - } -} - -// ConfidentialVMEncryptionType - confidential VM encryption types -type ConfidentialVMEncryptionType string - -const ( - ConfidentialVMEncryptionTypeEncryptedVMGuestStateOnlyWithPmk ConfidentialVMEncryptionType = "EncryptedVMGuestStateOnlyWithPmk" - ConfidentialVMEncryptionTypeEncryptedWithCmk ConfidentialVMEncryptionType = "EncryptedWithCmk" - ConfidentialVMEncryptionTypeEncryptedWithPmk ConfidentialVMEncryptionType = "EncryptedWithPmk" - ConfidentialVMEncryptionTypeNonPersistedTPM ConfidentialVMEncryptionType = "NonPersistedTPM" -) - -// PossibleConfidentialVMEncryptionTypeValues returns the possible values for the ConfidentialVMEncryptionType const type. -func PossibleConfidentialVMEncryptionTypeValues() []ConfidentialVMEncryptionType { - return []ConfidentialVMEncryptionType{ - ConfidentialVMEncryptionTypeEncryptedVMGuestStateOnlyWithPmk, - ConfidentialVMEncryptionTypeEncryptedWithCmk, - ConfidentialVMEncryptionTypeEncryptedWithPmk, - ConfidentialVMEncryptionTypeNonPersistedTPM, - } -} - -// ConsistencyModeTypes - ConsistencyMode of the RestorePoint. Can be specified in the input while creating a restore point. -// For now, only CrashConsistent is accepted as a valid input. Please refer to -// https://aka.ms/RestorePoints for more details. -type ConsistencyModeTypes string - -const ( - ConsistencyModeTypesApplicationConsistent ConsistencyModeTypes = "ApplicationConsistent" - ConsistencyModeTypesCrashConsistent ConsistencyModeTypes = "CrashConsistent" - ConsistencyModeTypesFileSystemConsistent ConsistencyModeTypes = "FileSystemConsistent" -) - -// PossibleConsistencyModeTypesValues returns the possible values for the ConsistencyModeTypes const type. -func PossibleConsistencyModeTypesValues() []ConsistencyModeTypes { - return []ConsistencyModeTypes{ - ConsistencyModeTypesApplicationConsistent, - ConsistencyModeTypesCrashConsistent, - ConsistencyModeTypesFileSystemConsistent, - } -} - -// CopyCompletionErrorReason - Indicates the error code if the background copy of a resource created via the CopyStart operation -// fails. -type CopyCompletionErrorReason string - -const ( - // CopyCompletionErrorReasonCopySourceNotFound - Indicates that the source snapshot was deleted while the background copy - // of the resource created via CopyStart operation was in progress. - CopyCompletionErrorReasonCopySourceNotFound CopyCompletionErrorReason = "CopySourceNotFound" -) - -// PossibleCopyCompletionErrorReasonValues returns the possible values for the CopyCompletionErrorReason const type. -func PossibleCopyCompletionErrorReasonValues() []CopyCompletionErrorReason { - return []CopyCompletionErrorReason{ - CopyCompletionErrorReasonCopySourceNotFound, - } -} - -// DataAccessAuthMode - Additional authentication requirements when exporting or uploading to a disk or snapshot. -type DataAccessAuthMode string - -const ( - // DataAccessAuthModeAzureActiveDirectory - When export/upload URL is used, the system checks if the user has an identity - // in Azure Active Directory and has necessary permissions to export/upload the data. Please refer to aka.ms/DisksAzureADAuth. - DataAccessAuthModeAzureActiveDirectory DataAccessAuthMode = "AzureActiveDirectory" - // DataAccessAuthModeNone - No additional authentication would be performed when accessing export/upload URL. - DataAccessAuthModeNone DataAccessAuthMode = "None" -) - -// PossibleDataAccessAuthModeValues returns the possible values for the DataAccessAuthMode const type. -func PossibleDataAccessAuthModeValues() []DataAccessAuthMode { - return []DataAccessAuthMode{ - DataAccessAuthModeAzureActiveDirectory, - DataAccessAuthModeNone, - } -} - -// DedicatedHostLicenseTypes - Specifies the software license type that will be applied to the VMs deployed on the dedicated -// host. Possible values are: None, WindowsServerHybrid, WindowsServerPerpetual. The default value is: None. -type DedicatedHostLicenseTypes string - -const ( - DedicatedHostLicenseTypesNone DedicatedHostLicenseTypes = "None" - DedicatedHostLicenseTypesWindowsServerHybrid DedicatedHostLicenseTypes = "Windows_Server_Hybrid" - DedicatedHostLicenseTypesWindowsServerPerpetual DedicatedHostLicenseTypes = "Windows_Server_Perpetual" -) - -// PossibleDedicatedHostLicenseTypesValues returns the possible values for the DedicatedHostLicenseTypes const type. -func PossibleDedicatedHostLicenseTypesValues() []DedicatedHostLicenseTypes { - return []DedicatedHostLicenseTypes{ - DedicatedHostLicenseTypesNone, - DedicatedHostLicenseTypesWindowsServerHybrid, - DedicatedHostLicenseTypesWindowsServerPerpetual, - } -} - -// DeleteOptions - Specify what happens to the network interface when the VM is deleted -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -// PossibleDeleteOptionsValues returns the possible values for the DeleteOptions const type. -func PossibleDeleteOptionsValues() []DeleteOptions { - return []DeleteOptions{ - DeleteOptionsDelete, - DeleteOptionsDetach, - } -} - -// DiffDiskOptions - Specifies the ephemeral disk option for operating system disk. -type DiffDiskOptions string - -const ( - DiffDiskOptionsLocal DiffDiskOptions = "Local" -) - -// PossibleDiffDiskOptionsValues returns the possible values for the DiffDiskOptions const type. -func PossibleDiffDiskOptionsValues() []DiffDiskOptions { - return []DiffDiskOptions{ - DiffDiskOptionsLocal, - } -} - -// DiffDiskPlacement - Specifies the ephemeral disk placement for operating system disk. This property can be used by user -// in the request to choose the location i.e, cache disk, resource disk or nvme disk space for -// Ephemeral OS disk provisioning. For more information on Ephemeral OS disk size requirements, please refer Ephemeral OS -// disk size requirements for Windows VM at -// https://docs.microsoft.com/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VM at -// https://docs.microsoft.com/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. Minimum api-version for NvmeDisk: -// 2024-03-01. -type DiffDiskPlacement string - -const ( - DiffDiskPlacementCacheDisk DiffDiskPlacement = "CacheDisk" - DiffDiskPlacementNvmeDisk DiffDiskPlacement = "NvmeDisk" - DiffDiskPlacementResourceDisk DiffDiskPlacement = "ResourceDisk" -) - -// PossibleDiffDiskPlacementValues returns the possible values for the DiffDiskPlacement const type. -func PossibleDiffDiskPlacementValues() []DiffDiskPlacement { - return []DiffDiskPlacement{ - DiffDiskPlacementCacheDisk, - DiffDiskPlacementNvmeDisk, - DiffDiskPlacementResourceDisk, - } -} - -// DiskControllerTypes - Specifies the disk controller type configured for the VM and VirtualMachineScaleSet. This property -// is only supported for virtual machines whose operating system disk and VM sku supports Generation 2 -// (https://docs.microsoft.com/en-us/azure/virtual-machines/generation-2), please check the HyperVGenerations capability returned -// as part of VM sku capabilities in the response of Microsoft.Compute SKUs -// api for the region contains V2 (https://docs.microsoft.com/rest/api/compute/resourceskus/list). For more information about -// Disk Controller Types supported please refer to -// https://aka.ms/azure-diskcontrollertypes. -type DiskControllerTypes string - -const ( - DiskControllerTypesNVMe DiskControllerTypes = "NVMe" - DiskControllerTypesSCSI DiskControllerTypes = "SCSI" -) - -// PossibleDiskControllerTypesValues returns the possible values for the DiskControllerTypes const type. -func PossibleDiskControllerTypesValues() []DiskControllerTypes { - return []DiskControllerTypes{ - DiskControllerTypesNVMe, - DiskControllerTypesSCSI, - } -} - -// DiskCreateOption - This enumerates the possible sources of a disk's creation. -type DiskCreateOption string - -const ( - // DiskCreateOptionAttach - Disk will be attached to a VM. - DiskCreateOptionAttach DiskCreateOption = "Attach" - // DiskCreateOptionCopy - Create a new disk or snapshot by copying from a disk or snapshot specified by the given sourceResourceId. - DiskCreateOptionCopy DiskCreateOption = "Copy" - // DiskCreateOptionCopyFromSanSnapshot - Create a new disk by exporting from elastic san volume snapshot - DiskCreateOptionCopyFromSanSnapshot DiskCreateOption = "CopyFromSanSnapshot" - // DiskCreateOptionCopyStart - Create a new disk by using a deep copy process, where the resource creation is considered complete - // only after all data has been copied from the source. - DiskCreateOptionCopyStart DiskCreateOption = "CopyStart" - // DiskCreateOptionEmpty - Create an empty data disk of a size given by diskSizeGB. - DiskCreateOptionEmpty DiskCreateOption = "Empty" - // DiskCreateOptionFromImage - Create a new disk from a platform image specified by the given imageReference or galleryImageReference. - DiskCreateOptionFromImage DiskCreateOption = "FromImage" - // DiskCreateOptionImport - Create a disk by importing from a blob specified by a sourceUri in a storage account specified - // by storageAccountId. - DiskCreateOptionImport DiskCreateOption = "Import" - // DiskCreateOptionImportSecure - Similar to Import create option. Create a new Trusted Launch VM or Confidential VM supported - // disk by importing additional blob for VM guest state specified by securityDataUri in storage account specified by storageAccountId - DiskCreateOptionImportSecure DiskCreateOption = "ImportSecure" - // DiskCreateOptionRestore - Create a new disk by copying from a backup recovery point. - DiskCreateOptionRestore DiskCreateOption = "Restore" - // DiskCreateOptionUpload - Create a new disk by obtaining a write token and using it to directly upload the contents of the - // disk. - DiskCreateOptionUpload DiskCreateOption = "Upload" - // DiskCreateOptionUploadPreparedSecure - Similar to Upload create option. Create a new Trusted Launch VM or Confidential - // VM supported disk and upload using write token in both disk and VM guest state - DiskCreateOptionUploadPreparedSecure DiskCreateOption = "UploadPreparedSecure" -) - -// PossibleDiskCreateOptionValues returns the possible values for the DiskCreateOption const type. -func PossibleDiskCreateOptionValues() []DiskCreateOption { - return []DiskCreateOption{ - DiskCreateOptionAttach, - DiskCreateOptionCopy, - DiskCreateOptionCopyFromSanSnapshot, - DiskCreateOptionCopyStart, - DiskCreateOptionEmpty, - DiskCreateOptionFromImage, - DiskCreateOptionImport, - DiskCreateOptionImportSecure, - DiskCreateOptionRestore, - DiskCreateOptionUpload, - DiskCreateOptionUploadPreparedSecure, - } -} - -// DiskCreateOptionTypes - Specifies how the virtual machine disk should be created. Possible values are Attach: This value -// is used when you are using a specialized disk to create the virtual machine. FromImage: This value is -// used when you are using an image to create the virtual machine. If you are using a platform image, you should also use -// the imageReference element described above. If you are using a marketplace image, -// you should also use the plan element previously described. Empty: This value is used when creating an empty data disk. -// Copy: This value is used to create a data disk from a snapshot or another disk. -// Restore: This value is used to create a data disk from a disk restore point. -type DiskCreateOptionTypes string - -const ( - DiskCreateOptionTypesAttach DiskCreateOptionTypes = "Attach" - DiskCreateOptionTypesCopy DiskCreateOptionTypes = "Copy" - DiskCreateOptionTypesEmpty DiskCreateOptionTypes = "Empty" - DiskCreateOptionTypesFromImage DiskCreateOptionTypes = "FromImage" - DiskCreateOptionTypesRestore DiskCreateOptionTypes = "Restore" -) - -// PossibleDiskCreateOptionTypesValues returns the possible values for the DiskCreateOptionTypes const type. -func PossibleDiskCreateOptionTypesValues() []DiskCreateOptionTypes { - return []DiskCreateOptionTypes{ - DiskCreateOptionTypesAttach, - DiskCreateOptionTypesCopy, - DiskCreateOptionTypesEmpty, - DiskCreateOptionTypesFromImage, - DiskCreateOptionTypesRestore, - } -} - -// DiskDeleteOptionTypes - Specifies the behavior of the managed disk when the VM gets deleted, for example whether the managed -// disk is deleted or detached. Supported values are: Delete. If this value is used, the managed disk -// is deleted when VM gets deleted. Detach. If this value is used, the managed disk is retained after VM gets deleted. Minimum -// api-version: 2021-03-01. -type DiskDeleteOptionTypes string - -const ( - DiskDeleteOptionTypesDelete DiskDeleteOptionTypes = "Delete" - DiskDeleteOptionTypesDetach DiskDeleteOptionTypes = "Detach" -) - -// PossibleDiskDeleteOptionTypesValues returns the possible values for the DiskDeleteOptionTypes const type. -func PossibleDiskDeleteOptionTypesValues() []DiskDeleteOptionTypes { - return []DiskDeleteOptionTypes{ - DiskDeleteOptionTypesDelete, - DiskDeleteOptionTypesDetach, - } -} - -// DiskDetachOptionTypes - Specifies the detach behavior to be used while detaching a disk or which is already in the process -// of detachment from the virtual machine. Supported values are: ForceDetach. detachOption: ForceDetach -// is applicable only for managed data disks. If a previous detachment attempt of the data disk did not complete due to an -// unexpected failure from the virtual machine and the disk is still not released -// then use force-detach as a last resort option to detach the disk forcibly from the VM. All writes might not have been flushed -// when using this detach behavior. This feature is still in preview mode and -// is not supported for VirtualMachineScaleSet. To force-detach a data disk update toBeDetached to 'true' along with setting -// detachOption: 'ForceDetach'. -type DiskDetachOptionTypes string - -const ( - DiskDetachOptionTypesForceDetach DiskDetachOptionTypes = "ForceDetach" -) - -// PossibleDiskDetachOptionTypesValues returns the possible values for the DiskDetachOptionTypes const type. -func PossibleDiskDetachOptionTypesValues() []DiskDetachOptionTypes { - return []DiskDetachOptionTypes{ - DiskDetachOptionTypesForceDetach, - } -} - -// DiskEncryptionSetIdentityType - The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is supported -// for new creations. Disk Encryption Sets can be updated with Identity type None during migration of -// subscription to a new Azure Active Directory tenant; it will cause the encrypted resources to lose access to the keys. -type DiskEncryptionSetIdentityType string - -const ( - DiskEncryptionSetIdentityTypeNone DiskEncryptionSetIdentityType = "None" - DiskEncryptionSetIdentityTypeSystemAssigned DiskEncryptionSetIdentityType = "SystemAssigned" - DiskEncryptionSetIdentityTypeSystemAssignedUserAssigned DiskEncryptionSetIdentityType = "SystemAssigned, UserAssigned" - DiskEncryptionSetIdentityTypeUserAssigned DiskEncryptionSetIdentityType = "UserAssigned" -) - -// PossibleDiskEncryptionSetIdentityTypeValues returns the possible values for the DiskEncryptionSetIdentityType const type. -func PossibleDiskEncryptionSetIdentityTypeValues() []DiskEncryptionSetIdentityType { - return []DiskEncryptionSetIdentityType{ - DiskEncryptionSetIdentityTypeNone, - DiskEncryptionSetIdentityTypeSystemAssigned, - DiskEncryptionSetIdentityTypeSystemAssignedUserAssigned, - DiskEncryptionSetIdentityTypeUserAssigned, - } -} - -// DiskEncryptionSetType - The type of key used to encrypt the data of the disk. -type DiskEncryptionSetType string - -const ( - // DiskEncryptionSetTypeConfidentialVMEncryptedWithCustomerKey - Confidential VM supported disk and VM guest state would be - // encrypted with customer managed key. - DiskEncryptionSetTypeConfidentialVMEncryptedWithCustomerKey DiskEncryptionSetType = "ConfidentialVmEncryptedWithCustomerKey" - // DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey - Resource using diskEncryptionSet would be encrypted at rest with - // Customer managed key that can be changed and revoked by a customer. - DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey DiskEncryptionSetType = "EncryptionAtRestWithCustomerKey" - // DiskEncryptionSetTypeEncryptionAtRestWithPlatformAndCustomerKeys - Resource using diskEncryptionSet would be encrypted - // at rest with two layers of encryption. One of the keys is Customer managed and the other key is Platform managed. - DiskEncryptionSetTypeEncryptionAtRestWithPlatformAndCustomerKeys DiskEncryptionSetType = "EncryptionAtRestWithPlatformAndCustomerKeys" -) - -// PossibleDiskEncryptionSetTypeValues returns the possible values for the DiskEncryptionSetType const type. -func PossibleDiskEncryptionSetTypeValues() []DiskEncryptionSetType { - return []DiskEncryptionSetType{ - DiskEncryptionSetTypeConfidentialVMEncryptedWithCustomerKey, - DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey, - DiskEncryptionSetTypeEncryptionAtRestWithPlatformAndCustomerKeys, - } -} - -// DiskSecurityTypes - Specifies the SecurityType of the VM. Applicable for OS disks only. -type DiskSecurityTypes string - -const ( - // DiskSecurityTypesConfidentialVMDiskEncryptedWithCustomerKey - Indicates Confidential VM disk with both OS disk and VM guest - // state encrypted with a customer managed key - DiskSecurityTypesConfidentialVMDiskEncryptedWithCustomerKey DiskSecurityTypes = "ConfidentialVM_DiskEncryptedWithCustomerKey" - // DiskSecurityTypesConfidentialVMDiskEncryptedWithPlatformKey - Indicates Confidential VM disk with both OS disk and VM guest - // state encrypted with a platform managed key - DiskSecurityTypesConfidentialVMDiskEncryptedWithPlatformKey DiskSecurityTypes = "ConfidentialVM_DiskEncryptedWithPlatformKey" - // DiskSecurityTypesConfidentialVMNonPersistedTPM - Indicates Confidential VM disk with a ephemeral vTPM. vTPM state is not - // persisted across VM reboots. - DiskSecurityTypesConfidentialVMNonPersistedTPM DiskSecurityTypes = "ConfidentialVM_NonPersistedTPM" - // DiskSecurityTypesConfidentialVMVmguestStateOnlyEncryptedWithPlatformKey - Indicates Confidential VM disk with only VM guest - // state encrypted - DiskSecurityTypesConfidentialVMVmguestStateOnlyEncryptedWithPlatformKey DiskSecurityTypes = "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey" - // DiskSecurityTypesTrustedLaunch - Trusted Launch provides security features such as secure boot and virtual Trusted Platform - // Module (vTPM) - DiskSecurityTypesTrustedLaunch DiskSecurityTypes = "TrustedLaunch" -) - -// PossibleDiskSecurityTypesValues returns the possible values for the DiskSecurityTypes const type. -func PossibleDiskSecurityTypesValues() []DiskSecurityTypes { - return []DiskSecurityTypes{ - DiskSecurityTypesConfidentialVMDiskEncryptedWithCustomerKey, - DiskSecurityTypesConfidentialVMDiskEncryptedWithPlatformKey, - DiskSecurityTypesConfidentialVMNonPersistedTPM, - DiskSecurityTypesConfidentialVMVmguestStateOnlyEncryptedWithPlatformKey, - DiskSecurityTypesTrustedLaunch, - } -} - -// DiskState - This enumerates the possible state of the disk. -type DiskState string - -const ( - // DiskStateActiveSAS - The disk currently has an Active SAS Uri associated with it. - DiskStateActiveSAS DiskState = "ActiveSAS" - // DiskStateActiveSASFrozen - The disk is attached to a VM in hibernated state and has an active SAS URI associated with it. - DiskStateActiveSASFrozen DiskState = "ActiveSASFrozen" - // DiskStateActiveUpload - A disk is created for upload and a write token has been issued for uploading to it. - DiskStateActiveUpload DiskState = "ActiveUpload" - // DiskStateAttached - The disk is currently attached to a running VM. - DiskStateAttached DiskState = "Attached" - // DiskStateFrozen - The disk is attached to a VM which is in hibernated state. - DiskStateFrozen DiskState = "Frozen" - // DiskStateReadyToUpload - A disk is ready to be created by upload by requesting a write token. - DiskStateReadyToUpload DiskState = "ReadyToUpload" - // DiskStateReserved - The disk is attached to a stopped-deallocated VM. - DiskStateReserved DiskState = "Reserved" - // DiskStateUnattached - The disk is not being used and can be attached to a VM. - DiskStateUnattached DiskState = "Unattached" -) - -// PossibleDiskStateValues returns the possible values for the DiskState const type. -func PossibleDiskStateValues() []DiskState { - return []DiskState{ - DiskStateActiveSAS, - DiskStateActiveSASFrozen, - DiskStateActiveUpload, - DiskStateAttached, - DiskStateFrozen, - DiskStateReadyToUpload, - DiskStateReserved, - DiskStateUnattached, - } -} - -// DiskStorageAccountTypes - The sku name. -type DiskStorageAccountTypes string - -const ( - // DiskStorageAccountTypesPremiumLRS - Premium SSD locally redundant storage. Best for production and performance sensitive - // workloads. - DiskStorageAccountTypesPremiumLRS DiskStorageAccountTypes = "Premium_LRS" - // DiskStorageAccountTypesPremiumV2LRS - Premium SSD v2 locally redundant storage. Best for production and performance-sensitive - // workloads that consistently require low latency and high IOPS and throughput. - DiskStorageAccountTypesPremiumV2LRS DiskStorageAccountTypes = "PremiumV2_LRS" - // DiskStorageAccountTypesPremiumZRS - Premium SSD zone redundant storage. Best for the production workloads that need storage - // resiliency against zone failures. - DiskStorageAccountTypesPremiumZRS DiskStorageAccountTypes = "Premium_ZRS" - // DiskStorageAccountTypesStandardLRS - Standard HDD locally redundant storage. Best for backup, non-critical, and infrequent - // access. - DiskStorageAccountTypesStandardLRS DiskStorageAccountTypes = "Standard_LRS" - // DiskStorageAccountTypesStandardSSDLRS - Standard SSD locally redundant storage. Best for web servers, lightly used enterprise - // applications and dev/test. - DiskStorageAccountTypesStandardSSDLRS DiskStorageAccountTypes = "StandardSSD_LRS" - // DiskStorageAccountTypesStandardSSDZRS - Standard SSD zone redundant storage. Best for web servers, lightly used enterprise - // applications and dev/test that need storage resiliency against zone failures. - DiskStorageAccountTypesStandardSSDZRS DiskStorageAccountTypes = "StandardSSD_ZRS" - // DiskStorageAccountTypesUltraSSDLRS - Ultra SSD locally redundant storage. Best for IO-intensive workloads such as SAP HANA, - // top tier databases (for example, SQL, Oracle), and other transaction-heavy workloads. - DiskStorageAccountTypesUltraSSDLRS DiskStorageAccountTypes = "UltraSSD_LRS" -) - -// PossibleDiskStorageAccountTypesValues returns the possible values for the DiskStorageAccountTypes const type. -func PossibleDiskStorageAccountTypesValues() []DiskStorageAccountTypes { - return []DiskStorageAccountTypes{ - DiskStorageAccountTypesPremiumLRS, - DiskStorageAccountTypesPremiumV2LRS, - DiskStorageAccountTypesPremiumZRS, - DiskStorageAccountTypesStandardLRS, - DiskStorageAccountTypesStandardSSDLRS, - DiskStorageAccountTypesStandardSSDZRS, - DiskStorageAccountTypesUltraSSDLRS, - } -} - -// DomainNameLabelScopeTypes - The Domain name label scope.The concatenation of the hashed domain name label that generated -// according to the policy from domain name label scope and vm index will be the domain name labels of the -// PublicIPAddress resources that will be created -type DomainNameLabelScopeTypes string - -const ( - DomainNameLabelScopeTypesNoReuse DomainNameLabelScopeTypes = "NoReuse" - DomainNameLabelScopeTypesResourceGroupReuse DomainNameLabelScopeTypes = "ResourceGroupReuse" - DomainNameLabelScopeTypesSubscriptionReuse DomainNameLabelScopeTypes = "SubscriptionReuse" - DomainNameLabelScopeTypesTenantReuse DomainNameLabelScopeTypes = "TenantReuse" -) - -// PossibleDomainNameLabelScopeTypesValues returns the possible values for the DomainNameLabelScopeTypes const type. -func PossibleDomainNameLabelScopeTypesValues() []DomainNameLabelScopeTypes { - return []DomainNameLabelScopeTypes{ - DomainNameLabelScopeTypesNoReuse, - DomainNameLabelScopeTypesResourceGroupReuse, - DomainNameLabelScopeTypesSubscriptionReuse, - DomainNameLabelScopeTypesTenantReuse, - } -} - -// EdgeZoneStorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. -type EdgeZoneStorageAccountType string - -const ( - EdgeZoneStorageAccountTypePremiumLRS EdgeZoneStorageAccountType = "Premium_LRS" - EdgeZoneStorageAccountTypeStandardLRS EdgeZoneStorageAccountType = "Standard_LRS" - EdgeZoneStorageAccountTypeStandardSSDLRS EdgeZoneStorageAccountType = "StandardSSD_LRS" - EdgeZoneStorageAccountTypeStandardZRS EdgeZoneStorageAccountType = "Standard_ZRS" -) - -// PossibleEdgeZoneStorageAccountTypeValues returns the possible values for the EdgeZoneStorageAccountType const type. -func PossibleEdgeZoneStorageAccountTypeValues() []EdgeZoneStorageAccountType { - return []EdgeZoneStorageAccountType{ - EdgeZoneStorageAccountTypePremiumLRS, - EdgeZoneStorageAccountTypeStandardLRS, - EdgeZoneStorageAccountTypeStandardSSDLRS, - EdgeZoneStorageAccountTypeStandardZRS, - } -} - -// EncryptionType - The type of key used to encrypt the data of the disk. -type EncryptionType string - -const ( - // EncryptionTypeEncryptionAtRestWithCustomerKey - Disk is encrypted at rest with Customer managed key that can be changed - // and revoked by a customer. - EncryptionTypeEncryptionAtRestWithCustomerKey EncryptionType = "EncryptionAtRestWithCustomerKey" - // EncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys - Disk is encrypted at rest with 2 layers of encryption. One - // of the keys is Customer managed and the other key is Platform managed. - EncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys EncryptionType = "EncryptionAtRestWithPlatformAndCustomerKeys" - // EncryptionTypeEncryptionAtRestWithPlatformKey - Disk is encrypted at rest with Platform managed key. It is the default - // encryption type. This is not a valid encryption type for disk encryption sets. - EncryptionTypeEncryptionAtRestWithPlatformKey EncryptionType = "EncryptionAtRestWithPlatformKey" -) - -// PossibleEncryptionTypeValues returns the possible values for the EncryptionType const type. -func PossibleEncryptionTypeValues() []EncryptionType { - return []EncryptionType{ - EncryptionTypeEncryptionAtRestWithCustomerKey, - EncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys, - EncryptionTypeEncryptionAtRestWithPlatformKey, - } -} - -// ExecutionState - Script execution status. -type ExecutionState string - -const ( - ExecutionStateCanceled ExecutionState = "Canceled" - ExecutionStateFailed ExecutionState = "Failed" - ExecutionStatePending ExecutionState = "Pending" - ExecutionStateRunning ExecutionState = "Running" - ExecutionStateSucceeded ExecutionState = "Succeeded" - ExecutionStateTimedOut ExecutionState = "TimedOut" - ExecutionStateUnknown ExecutionState = "Unknown" -) - -// PossibleExecutionStateValues returns the possible values for the ExecutionState const type. -func PossibleExecutionStateValues() []ExecutionState { - return []ExecutionState{ - ExecutionStateCanceled, - ExecutionStateFailed, - ExecutionStatePending, - ExecutionStateRunning, - ExecutionStateSucceeded, - ExecutionStateTimedOut, - ExecutionStateUnknown, - } -} - -type ExpandTypeForListVMs string - -const ( - ExpandTypeForListVMsInstanceView ExpandTypeForListVMs = "instanceView" -) - -// PossibleExpandTypeForListVMsValues returns the possible values for the ExpandTypeForListVMs const type. -func PossibleExpandTypeForListVMsValues() []ExpandTypeForListVMs { - return []ExpandTypeForListVMs{ - ExpandTypeForListVMsInstanceView, - } -} - -type ExpandTypesForGetCapacityReservationGroups string - -const ( - ExpandTypesForGetCapacityReservationGroupsVirtualMachineScaleSetVMsRef ExpandTypesForGetCapacityReservationGroups = "virtualMachineScaleSetVMs/$ref" - ExpandTypesForGetCapacityReservationGroupsVirtualMachinesRef ExpandTypesForGetCapacityReservationGroups = "virtualMachines/$ref" -) - -// PossibleExpandTypesForGetCapacityReservationGroupsValues returns the possible values for the ExpandTypesForGetCapacityReservationGroups const type. -func PossibleExpandTypesForGetCapacityReservationGroupsValues() []ExpandTypesForGetCapacityReservationGroups { - return []ExpandTypesForGetCapacityReservationGroups{ - ExpandTypesForGetCapacityReservationGroupsVirtualMachineScaleSetVMsRef, - ExpandTypesForGetCapacityReservationGroupsVirtualMachinesRef, - } -} - -type ExpandTypesForGetVMScaleSets string - -const ( - ExpandTypesForGetVMScaleSetsUserData ExpandTypesForGetVMScaleSets = "userData" -) - -// PossibleExpandTypesForGetVMScaleSetsValues returns the possible values for the ExpandTypesForGetVMScaleSets const type. -func PossibleExpandTypesForGetVMScaleSetsValues() []ExpandTypesForGetVMScaleSets { - return []ExpandTypesForGetVMScaleSets{ - ExpandTypesForGetVMScaleSetsUserData, - } -} - -type ExpandTypesForListVMs string - -const ( - ExpandTypesForListVMsInstanceView ExpandTypesForListVMs = "instanceView" -) - -// PossibleExpandTypesForListVMsValues returns the possible values for the ExpandTypesForListVMs const type. -func PossibleExpandTypesForListVMsValues() []ExpandTypesForListVMs { - return []ExpandTypesForListVMs{ - ExpandTypesForListVMsInstanceView, - } -} - -// ExtendedLocationType - The type of the extended location. -type ExtendedLocationType string - -const ( - ExtendedLocationTypeEdgeZone ExtendedLocationType = "EdgeZone" -) - -// PossibleExtendedLocationTypeValues returns the possible values for the ExtendedLocationType const type. -func PossibleExtendedLocationTypeValues() []ExtendedLocationType { - return []ExtendedLocationType{ - ExtendedLocationTypeEdgeZone, - } -} - -// ExtendedLocationTypes - The type of extendedLocation. -type ExtendedLocationTypes string - -const ( - ExtendedLocationTypesEdgeZone ExtendedLocationTypes = "EdgeZone" -) - -// PossibleExtendedLocationTypesValues returns the possible values for the ExtendedLocationTypes const type. -func PossibleExtendedLocationTypesValues() []ExtendedLocationTypes { - return []ExtendedLocationTypes{ - ExtendedLocationTypesEdgeZone, - } -} - -// FileFormat - Used to specify the file format when making request for SAS on a VHDX file format snapshot -type FileFormat string - -const ( - // FileFormatVHD - A VHD file is a disk image file in the Virtual Hard Disk file format. - FileFormatVHD FileFormat = "VHD" - // FileFormatVHDX - A VHDX file is a disk image file in the Virtual Hard Disk v2 file format. - FileFormatVHDX FileFormat = "VHDX" -) - -// PossibleFileFormatValues returns the possible values for the FileFormat const type. -func PossibleFileFormatValues() []FileFormat { - return []FileFormat{ - FileFormatVHD, - FileFormatVHDX, - } -} - -// GalleryApplicationCustomActionParameterType - Specifies the type of the custom action parameter. Possible values are: String, -// ConfigurationDataBlob or LogOutputBlob -type GalleryApplicationCustomActionParameterType string - -const ( - GalleryApplicationCustomActionParameterTypeConfigurationDataBlob GalleryApplicationCustomActionParameterType = "ConfigurationDataBlob" - GalleryApplicationCustomActionParameterTypeLogOutputBlob GalleryApplicationCustomActionParameterType = "LogOutputBlob" - GalleryApplicationCustomActionParameterTypeString GalleryApplicationCustomActionParameterType = "String" -) - -// PossibleGalleryApplicationCustomActionParameterTypeValues returns the possible values for the GalleryApplicationCustomActionParameterType const type. -func PossibleGalleryApplicationCustomActionParameterTypeValues() []GalleryApplicationCustomActionParameterType { - return []GalleryApplicationCustomActionParameterType{ - GalleryApplicationCustomActionParameterTypeConfigurationDataBlob, - GalleryApplicationCustomActionParameterTypeLogOutputBlob, - GalleryApplicationCustomActionParameterTypeString, - } -} - -type GalleryExpandParams string - -const ( - GalleryExpandParamsSharingProfileGroups GalleryExpandParams = "SharingProfile/Groups" -) - -// PossibleGalleryExpandParamsValues returns the possible values for the GalleryExpandParams const type. -func PossibleGalleryExpandParamsValues() []GalleryExpandParams { - return []GalleryExpandParams{ - GalleryExpandParamsSharingProfileGroups, - } -} - -// GalleryExtendedLocationType - It is type of the extended location. -type GalleryExtendedLocationType string - -const ( - GalleryExtendedLocationTypeEdgeZone GalleryExtendedLocationType = "EdgeZone" - GalleryExtendedLocationTypeUnknown GalleryExtendedLocationType = "Unknown" -) - -// PossibleGalleryExtendedLocationTypeValues returns the possible values for the GalleryExtendedLocationType const type. -func PossibleGalleryExtendedLocationTypeValues() []GalleryExtendedLocationType { - return []GalleryExtendedLocationType{ - GalleryExtendedLocationTypeEdgeZone, - GalleryExtendedLocationTypeUnknown, - } -} - -// GalleryProvisioningState - The provisioning state, which only appears in the response. -type GalleryProvisioningState string - -const ( - GalleryProvisioningStateCreating GalleryProvisioningState = "Creating" - GalleryProvisioningStateDeleting GalleryProvisioningState = "Deleting" - GalleryProvisioningStateFailed GalleryProvisioningState = "Failed" - GalleryProvisioningStateMigrating GalleryProvisioningState = "Migrating" - GalleryProvisioningStateSucceeded GalleryProvisioningState = "Succeeded" - GalleryProvisioningStateUpdating GalleryProvisioningState = "Updating" -) - -// PossibleGalleryProvisioningStateValues returns the possible values for the GalleryProvisioningState const type. -func PossibleGalleryProvisioningStateValues() []GalleryProvisioningState { - return []GalleryProvisioningState{ - GalleryProvisioningStateCreating, - GalleryProvisioningStateDeleting, - GalleryProvisioningStateFailed, - GalleryProvisioningStateMigrating, - GalleryProvisioningStateSucceeded, - GalleryProvisioningStateUpdating, - } -} - -// GallerySharingPermissionTypes - This property allows you to specify the permission of sharing gallery. Possible values -// are: Private, Groups, Community. -type GallerySharingPermissionTypes string - -const ( - GallerySharingPermissionTypesCommunity GallerySharingPermissionTypes = "Community" - GallerySharingPermissionTypesGroups GallerySharingPermissionTypes = "Groups" - GallerySharingPermissionTypesPrivate GallerySharingPermissionTypes = "Private" -) - -// PossibleGallerySharingPermissionTypesValues returns the possible values for the GallerySharingPermissionTypes const type. -func PossibleGallerySharingPermissionTypesValues() []GallerySharingPermissionTypes { - return []GallerySharingPermissionTypes{ - GallerySharingPermissionTypesCommunity, - GallerySharingPermissionTypesGroups, - GallerySharingPermissionTypesPrivate, - } -} - -// HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' -type HostCaching string - -const ( - HostCachingNone HostCaching = "None" - HostCachingReadOnly HostCaching = "ReadOnly" - HostCachingReadWrite HostCaching = "ReadWrite" -) - -// PossibleHostCachingValues returns the possible values for the HostCaching const type. -func PossibleHostCachingValues() []HostCaching { - return []HostCaching{ - HostCachingNone, - HostCachingReadOnly, - HostCachingReadWrite, - } -} - -// HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. -type HyperVGeneration string - -const ( - HyperVGenerationV1 HyperVGeneration = "V1" - HyperVGenerationV2 HyperVGeneration = "V2" -) - -// PossibleHyperVGenerationValues returns the possible values for the HyperVGeneration const type. -func PossibleHyperVGenerationValues() []HyperVGeneration { - return []HyperVGeneration{ - HyperVGenerationV1, - HyperVGenerationV2, - } -} - -// HyperVGenerationType - Specifies the HyperVGeneration Type associated with a resource -type HyperVGenerationType string - -const ( - HyperVGenerationTypeV1 HyperVGenerationType = "V1" - HyperVGenerationTypeV2 HyperVGenerationType = "V2" -) - -// PossibleHyperVGenerationTypeValues returns the possible values for the HyperVGenerationType const type. -func PossibleHyperVGenerationTypeValues() []HyperVGenerationType { - return []HyperVGenerationType{ - HyperVGenerationTypeV1, - HyperVGenerationTypeV2, - } -} - -// HyperVGenerationTypes - Specifies the HyperVGeneration Type -type HyperVGenerationTypes string - -const ( - HyperVGenerationTypesV1 HyperVGenerationTypes = "V1" - HyperVGenerationTypesV2 HyperVGenerationTypes = "V2" -) - -// PossibleHyperVGenerationTypesValues returns the possible values for the HyperVGenerationTypes const type. -func PossibleHyperVGenerationTypesValues() []HyperVGenerationTypes { - return []HyperVGenerationTypes{ - HyperVGenerationTypesV1, - HyperVGenerationTypesV2, - } -} - -// IPVersion - Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or -// IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. -type IPVersion string - -const ( - IPVersionIPv4 IPVersion = "IPv4" - IPVersionIPv6 IPVersion = "IPv6" -) - -// PossibleIPVersionValues returns the possible values for the IPVersion const type. -func PossibleIPVersionValues() []IPVersion { - return []IPVersion{ - IPVersionIPv4, - IPVersionIPv6, - } -} - -// IPVersions - Available from Api-Version 2019-07-01 onwards, it represents whether the specific ipconfiguration is IPv4 -// or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. -type IPVersions string - -const ( - IPVersionsIPv4 IPVersions = "IPv4" - IPVersionsIPv6 IPVersions = "IPv6" -) - -// PossibleIPVersionsValues returns the possible values for the IPVersions const type. -func PossibleIPVersionsValues() []IPVersions { - return []IPVersions{ - IPVersionsIPv4, - IPVersionsIPv6, - } -} - -// ImageState - Describes the state of the image. -type ImageState string - -const ( - ImageStateActive ImageState = "Active" - ImageStateDeprecated ImageState = "Deprecated" - ImageStateScheduledForDeprecation ImageState = "ScheduledForDeprecation" -) - -// PossibleImageStateValues returns the possible values for the ImageState const type. -func PossibleImageStateValues() []ImageState { - return []ImageState{ - ImageStateActive, - ImageStateDeprecated, - ImageStateScheduledForDeprecation, - } -} - -type InstanceViewTypes string - -const ( - InstanceViewTypesInstanceView InstanceViewTypes = "instanceView" - InstanceViewTypesUserData InstanceViewTypes = "userData" -) - -// PossibleInstanceViewTypesValues returns the possible values for the InstanceViewTypes const type. -func PossibleInstanceViewTypesValues() []InstanceViewTypes { - return []InstanceViewTypes{ - InstanceViewTypesInstanceView, - InstanceViewTypesUserData, - } -} - -// IntervalInMins - Interval value in minutes used to create LogAnalytics call rate logs. -type IntervalInMins string - -const ( - IntervalInMinsFiveMins IntervalInMins = "FiveMins" - IntervalInMinsSixtyMins IntervalInMins = "SixtyMins" - IntervalInMinsThirtyMins IntervalInMins = "ThirtyMins" - IntervalInMinsThreeMins IntervalInMins = "ThreeMins" -) - -// PossibleIntervalInMinsValues returns the possible values for the IntervalInMins const type. -func PossibleIntervalInMinsValues() []IntervalInMins { - return []IntervalInMins{ - IntervalInMinsFiveMins, - IntervalInMinsSixtyMins, - IntervalInMinsThirtyMins, - IntervalInMinsThreeMins, - } -} - -// LinuxPatchAssessmentMode - Specifies the mode of VM Guest Patch Assessment for the IaaS virtual machine. -// Possible values are: -// ImageDefault - You control the timing of patch assessments on a virtual machine. -// AutomaticByPlatform - The platform will trigger periodic patch assessments. The property provisionVMAgent must be true. -type LinuxPatchAssessmentMode string - -const ( - LinuxPatchAssessmentModeAutomaticByPlatform LinuxPatchAssessmentMode = "AutomaticByPlatform" - LinuxPatchAssessmentModeImageDefault LinuxPatchAssessmentMode = "ImageDefault" -) - -// PossibleLinuxPatchAssessmentModeValues returns the possible values for the LinuxPatchAssessmentMode const type. -func PossibleLinuxPatchAssessmentModeValues() []LinuxPatchAssessmentMode { - return []LinuxPatchAssessmentMode{ - LinuxPatchAssessmentModeAutomaticByPlatform, - LinuxPatchAssessmentModeImageDefault, - } -} - -// LinuxVMGuestPatchAutomaticByPlatformRebootSetting - Specifies the reboot setting for all AutomaticByPlatform patch installation -// operations. -type LinuxVMGuestPatchAutomaticByPlatformRebootSetting string - -const ( - LinuxVMGuestPatchAutomaticByPlatformRebootSettingAlways LinuxVMGuestPatchAutomaticByPlatformRebootSetting = "Always" - LinuxVMGuestPatchAutomaticByPlatformRebootSettingIfRequired LinuxVMGuestPatchAutomaticByPlatformRebootSetting = "IfRequired" - LinuxVMGuestPatchAutomaticByPlatformRebootSettingNever LinuxVMGuestPatchAutomaticByPlatformRebootSetting = "Never" - LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown LinuxVMGuestPatchAutomaticByPlatformRebootSetting = "Unknown" -) - -// PossibleLinuxVMGuestPatchAutomaticByPlatformRebootSettingValues returns the possible values for the LinuxVMGuestPatchAutomaticByPlatformRebootSetting const type. -func PossibleLinuxVMGuestPatchAutomaticByPlatformRebootSettingValues() []LinuxVMGuestPatchAutomaticByPlatformRebootSetting { - return []LinuxVMGuestPatchAutomaticByPlatformRebootSetting{ - LinuxVMGuestPatchAutomaticByPlatformRebootSettingAlways, - LinuxVMGuestPatchAutomaticByPlatformRebootSettingIfRequired, - LinuxVMGuestPatchAutomaticByPlatformRebootSettingNever, - LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown, - } -} - -// LinuxVMGuestPatchMode - Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated -// to virtual machine scale set with OrchestrationMode as Flexible. -// Possible values are: -// ImageDefault - The virtual machine's default patching configuration is used. -// AutomaticByPlatform - The virtual machine will be automatically updated by the platform. The property provisionVMAgent -// must be true -type LinuxVMGuestPatchMode string - -const ( - LinuxVMGuestPatchModeAutomaticByPlatform LinuxVMGuestPatchMode = "AutomaticByPlatform" - LinuxVMGuestPatchModeImageDefault LinuxVMGuestPatchMode = "ImageDefault" -) - -// PossibleLinuxVMGuestPatchModeValues returns the possible values for the LinuxVMGuestPatchMode const type. -func PossibleLinuxVMGuestPatchModeValues() []LinuxVMGuestPatchMode { - return []LinuxVMGuestPatchMode{ - LinuxVMGuestPatchModeAutomaticByPlatform, - LinuxVMGuestPatchModeImageDefault, - } -} - -// MaintenanceOperationResultCodeTypes - The Last Maintenance Operation Result Code. -type MaintenanceOperationResultCodeTypes string - -const ( - MaintenanceOperationResultCodeTypesMaintenanceAborted MaintenanceOperationResultCodeTypes = "MaintenanceAborted" - MaintenanceOperationResultCodeTypesMaintenanceCompleted MaintenanceOperationResultCodeTypes = "MaintenanceCompleted" - MaintenanceOperationResultCodeTypesNone MaintenanceOperationResultCodeTypes = "None" - MaintenanceOperationResultCodeTypesRetryLater MaintenanceOperationResultCodeTypes = "RetryLater" -) - -// PossibleMaintenanceOperationResultCodeTypesValues returns the possible values for the MaintenanceOperationResultCodeTypes const type. -func PossibleMaintenanceOperationResultCodeTypesValues() []MaintenanceOperationResultCodeTypes { - return []MaintenanceOperationResultCodeTypes{ - MaintenanceOperationResultCodeTypesMaintenanceAborted, - MaintenanceOperationResultCodeTypesMaintenanceCompleted, - MaintenanceOperationResultCodeTypesNone, - MaintenanceOperationResultCodeTypesRetryLater, - } -} - -// Mode - Specifies the mode that ProxyAgent will execute on if the feature is enabled. ProxyAgent will start to audit or -// monitor but not enforce access control over requests to host endpoints in Audit mode, -// while in Enforce mode it will enforce access control. The default value is Enforce mode. -type Mode string - -const ( - ModeAudit Mode = "Audit" - ModeEnforce Mode = "Enforce" -) - -// PossibleModeValues returns the possible values for the Mode const type. -func PossibleModeValues() []Mode { - return []Mode{ - ModeAudit, - ModeEnforce, - } -} - -// NetworkAPIVersion - specifies the Microsoft.Network API version used when creating networking resources in the Network -// Interface Configurations -type NetworkAPIVersion string - -const ( - NetworkAPIVersionTwoThousandTwenty1101 NetworkAPIVersion = "2020-11-01" -) - -// PossibleNetworkAPIVersionValues returns the possible values for the NetworkAPIVersion const type. -func PossibleNetworkAPIVersionValues() []NetworkAPIVersion { - return []NetworkAPIVersion{ - NetworkAPIVersionTwoThousandTwenty1101, - } -} - -// NetworkAccessPolicy - Policy for accessing the disk via network. -type NetworkAccessPolicy string - -const ( - // NetworkAccessPolicyAllowAll - The disk can be exported or uploaded to from any network. - NetworkAccessPolicyAllowAll NetworkAccessPolicy = "AllowAll" - // NetworkAccessPolicyAllowPrivate - The disk can be exported or uploaded to using a DiskAccess resource's private endpoints. - NetworkAccessPolicyAllowPrivate NetworkAccessPolicy = "AllowPrivate" - // NetworkAccessPolicyDenyAll - The disk cannot be exported. - NetworkAccessPolicyDenyAll NetworkAccessPolicy = "DenyAll" -) - -// PossibleNetworkAccessPolicyValues returns the possible values for the NetworkAccessPolicy const type. -func PossibleNetworkAccessPolicyValues() []NetworkAccessPolicy { - return []NetworkAccessPolicy{ - NetworkAccessPolicyAllowAll, - NetworkAccessPolicyAllowPrivate, - NetworkAccessPolicyDenyAll, - } -} - -// NetworkInterfaceAuxiliaryMode - Specifies whether the Auxiliary mode is enabled for the Network Interface resource. -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -// PossibleNetworkInterfaceAuxiliaryModeValues returns the possible values for the NetworkInterfaceAuxiliaryMode const type. -func PossibleNetworkInterfaceAuxiliaryModeValues() []NetworkInterfaceAuxiliaryMode { - return []NetworkInterfaceAuxiliaryMode{ - NetworkInterfaceAuxiliaryModeAcceleratedConnections, - NetworkInterfaceAuxiliaryModeFloating, - NetworkInterfaceAuxiliaryModeNone, - } -} - -// NetworkInterfaceAuxiliarySKU - Specifies whether the Auxiliary sku is enabled for the Network Interface resource. -type NetworkInterfaceAuxiliarySKU string - -const ( - NetworkInterfaceAuxiliarySKUA1 NetworkInterfaceAuxiliarySKU = "A1" - NetworkInterfaceAuxiliarySKUA2 NetworkInterfaceAuxiliarySKU = "A2" - NetworkInterfaceAuxiliarySKUA4 NetworkInterfaceAuxiliarySKU = "A4" - NetworkInterfaceAuxiliarySKUA8 NetworkInterfaceAuxiliarySKU = "A8" - NetworkInterfaceAuxiliarySKUNone NetworkInterfaceAuxiliarySKU = "None" -) - -// PossibleNetworkInterfaceAuxiliarySKUValues returns the possible values for the NetworkInterfaceAuxiliarySKU const type. -func PossibleNetworkInterfaceAuxiliarySKUValues() []NetworkInterfaceAuxiliarySKU { - return []NetworkInterfaceAuxiliarySKU{ - NetworkInterfaceAuxiliarySKUA1, - NetworkInterfaceAuxiliarySKUA2, - NetworkInterfaceAuxiliarySKUA4, - NetworkInterfaceAuxiliarySKUA8, - NetworkInterfaceAuxiliarySKUNone, - } -} - -// OperatingSystemStateTypes - This property allows the user to specify whether the virtual machines created under this image -// are 'Generalized' or 'Specialized'. -type OperatingSystemStateTypes string - -const ( - OperatingSystemStateTypesGeneralized OperatingSystemStateTypes = "Generalized" - OperatingSystemStateTypesSpecialized OperatingSystemStateTypes = "Specialized" -) - -// PossibleOperatingSystemStateTypesValues returns the possible values for the OperatingSystemStateTypes const type. -func PossibleOperatingSystemStateTypesValues() []OperatingSystemStateTypes { - return []OperatingSystemStateTypes{ - OperatingSystemStateTypesGeneralized, - OperatingSystemStateTypesSpecialized, - } -} - -// OperatingSystemType - Gets the Operating System type. -type OperatingSystemType string - -const ( - OperatingSystemTypeLinux OperatingSystemType = "Linux" - OperatingSystemTypeWindows OperatingSystemType = "Windows" -) - -// PossibleOperatingSystemTypeValues returns the possible values for the OperatingSystemType const type. -func PossibleOperatingSystemTypeValues() []OperatingSystemType { - return []OperatingSystemType{ - OperatingSystemTypeLinux, - OperatingSystemTypeWindows, - } -} - -// OperatingSystemTypes - This property allows you to specify the supported type of the OS that application is built for. -// Possible values are: Windows, Linux. -type OperatingSystemTypes string - -const ( - OperatingSystemTypesLinux OperatingSystemTypes = "Linux" - OperatingSystemTypesWindows OperatingSystemTypes = "Windows" -) - -// PossibleOperatingSystemTypesValues returns the possible values for the OperatingSystemTypes const type. -func PossibleOperatingSystemTypesValues() []OperatingSystemTypes { - return []OperatingSystemTypes{ - OperatingSystemTypesLinux, - OperatingSystemTypesWindows, - } -} - -// OrchestrationMode - Specifies the orchestration mode for the virtual machine scale set. -type OrchestrationMode string - -const ( - OrchestrationModeFlexible OrchestrationMode = "Flexible" - OrchestrationModeUniform OrchestrationMode = "Uniform" -) - -// PossibleOrchestrationModeValues returns the possible values for the OrchestrationMode const type. -func PossibleOrchestrationModeValues() []OrchestrationMode { - return []OrchestrationMode{ - OrchestrationModeFlexible, - OrchestrationModeUniform, - } -} - -// OrchestrationServiceNames - The name of the service. -type OrchestrationServiceNames string - -const ( - OrchestrationServiceNamesAutomaticRepairs OrchestrationServiceNames = "AutomaticRepairs" -) - -// PossibleOrchestrationServiceNamesValues returns the possible values for the OrchestrationServiceNames const type. -func PossibleOrchestrationServiceNamesValues() []OrchestrationServiceNames { - return []OrchestrationServiceNames{ - OrchestrationServiceNamesAutomaticRepairs, - } -} - -// OrchestrationServiceState - The current state of the service. -type OrchestrationServiceState string - -const ( - OrchestrationServiceStateNotRunning OrchestrationServiceState = "NotRunning" - OrchestrationServiceStateRunning OrchestrationServiceState = "Running" - OrchestrationServiceStateSuspended OrchestrationServiceState = "Suspended" -) - -// PossibleOrchestrationServiceStateValues returns the possible values for the OrchestrationServiceState const type. -func PossibleOrchestrationServiceStateValues() []OrchestrationServiceState { - return []OrchestrationServiceState{ - OrchestrationServiceStateNotRunning, - OrchestrationServiceStateRunning, - OrchestrationServiceStateSuspended, - } -} - -// OrchestrationServiceStateAction - The action to be performed. -type OrchestrationServiceStateAction string - -const ( - OrchestrationServiceStateActionResume OrchestrationServiceStateAction = "Resume" - OrchestrationServiceStateActionSuspend OrchestrationServiceStateAction = "Suspend" -) - -// PossibleOrchestrationServiceStateActionValues returns the possible values for the OrchestrationServiceStateAction const type. -func PossibleOrchestrationServiceStateActionValues() []OrchestrationServiceStateAction { - return []OrchestrationServiceStateAction{ - OrchestrationServiceStateActionResume, - OrchestrationServiceStateActionSuspend, - } -} - -// PatchAssessmentState - Describes the availability of a given patch. -type PatchAssessmentState string - -const ( - PatchAssessmentStateAvailable PatchAssessmentState = "Available" - PatchAssessmentStateUnknown PatchAssessmentState = "Unknown" -) - -// PossiblePatchAssessmentStateValues returns the possible values for the PatchAssessmentState const type. -func PossiblePatchAssessmentStateValues() []PatchAssessmentState { - return []PatchAssessmentState{ - PatchAssessmentStateAvailable, - PatchAssessmentStateUnknown, - } -} - -// PatchInstallationState - The state of the patch after the installation operation completed. -type PatchInstallationState string - -const ( - PatchInstallationStateExcluded PatchInstallationState = "Excluded" - PatchInstallationStateFailed PatchInstallationState = "Failed" - PatchInstallationStateInstalled PatchInstallationState = "Installed" - PatchInstallationStateNotSelected PatchInstallationState = "NotSelected" - PatchInstallationStatePending PatchInstallationState = "Pending" - PatchInstallationStateUnknown PatchInstallationState = "Unknown" -) - -// PossiblePatchInstallationStateValues returns the possible values for the PatchInstallationState const type. -func PossiblePatchInstallationStateValues() []PatchInstallationState { - return []PatchInstallationState{ - PatchInstallationStateExcluded, - PatchInstallationStateFailed, - PatchInstallationStateInstalled, - PatchInstallationStateNotSelected, - PatchInstallationStatePending, - PatchInstallationStateUnknown, - } -} - -// PatchOperationStatus - The overall success or failure status of the operation. It remains "InProgress" until the operation -// completes. At that point it will become "Unknown", "Failed", "Succeeded", or -// "CompletedWithWarnings." -type PatchOperationStatus string - -const ( - PatchOperationStatusCompletedWithWarnings PatchOperationStatus = "CompletedWithWarnings" - PatchOperationStatusFailed PatchOperationStatus = "Failed" - PatchOperationStatusInProgress PatchOperationStatus = "InProgress" - PatchOperationStatusSucceeded PatchOperationStatus = "Succeeded" - PatchOperationStatusUnknown PatchOperationStatus = "Unknown" -) - -// PossiblePatchOperationStatusValues returns the possible values for the PatchOperationStatus const type. -func PossiblePatchOperationStatusValues() []PatchOperationStatus { - return []PatchOperationStatus{ - PatchOperationStatusCompletedWithWarnings, - PatchOperationStatusFailed, - PatchOperationStatusInProgress, - PatchOperationStatusSucceeded, - PatchOperationStatusUnknown, - } -} - -// PolicyViolationCategory - Describes the nature of the policy violation. -type PolicyViolationCategory string - -const ( - PolicyViolationCategoryCopyrightValidation PolicyViolationCategory = "CopyrightValidation" - PolicyViolationCategoryIPTheft PolicyViolationCategory = "IpTheft" - PolicyViolationCategoryImageFlaggedUnsafe PolicyViolationCategory = "ImageFlaggedUnsafe" - PolicyViolationCategoryOther PolicyViolationCategory = "Other" -) - -// PossiblePolicyViolationCategoryValues returns the possible values for the PolicyViolationCategory const type. -func PossiblePolicyViolationCategoryValues() []PolicyViolationCategory { - return []PolicyViolationCategory{ - PolicyViolationCategoryCopyrightValidation, - PolicyViolationCategoryIPTheft, - PolicyViolationCategoryImageFlaggedUnsafe, - PolicyViolationCategoryOther, - } -} - -// PrivateEndpointConnectionProvisioningState - The current provisioning state. -type PrivateEndpointConnectionProvisioningState string - -const ( - PrivateEndpointConnectionProvisioningStateCreating PrivateEndpointConnectionProvisioningState = "Creating" - PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting" - PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed" - PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded" -) - -// PossiblePrivateEndpointConnectionProvisioningStateValues returns the possible values for the PrivateEndpointConnectionProvisioningState const type. -func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState { - return []PrivateEndpointConnectionProvisioningState{ - PrivateEndpointConnectionProvisioningStateCreating, - PrivateEndpointConnectionProvisioningStateDeleting, - PrivateEndpointConnectionProvisioningStateFailed, - PrivateEndpointConnectionProvisioningStateSucceeded, - } -} - -// PrivateEndpointServiceConnectionStatus - The private endpoint connection status. -type PrivateEndpointServiceConnectionStatus string - -const ( - PrivateEndpointServiceConnectionStatusApproved PrivateEndpointServiceConnectionStatus = "Approved" - PrivateEndpointServiceConnectionStatusPending PrivateEndpointServiceConnectionStatus = "Pending" - PrivateEndpointServiceConnectionStatusRejected PrivateEndpointServiceConnectionStatus = "Rejected" -) - -// PossiblePrivateEndpointServiceConnectionStatusValues returns the possible values for the PrivateEndpointServiceConnectionStatus const type. -func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus { - return []PrivateEndpointServiceConnectionStatus{ - PrivateEndpointServiceConnectionStatusApproved, - PrivateEndpointServiceConnectionStatusPending, - PrivateEndpointServiceConnectionStatusRejected, - } -} - -// ProtocolTypes - Specifies the protocol of WinRM listener. Possible values are: http, https. -type ProtocolTypes string - -const ( - ProtocolTypesHTTP ProtocolTypes = "Http" - ProtocolTypesHTTPS ProtocolTypes = "Https" -) - -// PossibleProtocolTypesValues returns the possible values for the ProtocolTypes const type. -func PossibleProtocolTypesValues() []ProtocolTypes { - return []ProtocolTypes{ - ProtocolTypesHTTP, - ProtocolTypesHTTPS, - } -} - -// ProvisionedBandwidthCopyOption - If this field is set on a snapshot and createOption is CopyStart, the snapshot will be -// copied at a quicker speed. -type ProvisionedBandwidthCopyOption string - -const ( - ProvisionedBandwidthCopyOptionEnhanced ProvisionedBandwidthCopyOption = "Enhanced" - ProvisionedBandwidthCopyOptionNone ProvisionedBandwidthCopyOption = "None" -) - -// PossibleProvisionedBandwidthCopyOptionValues returns the possible values for the ProvisionedBandwidthCopyOption const type. -func PossibleProvisionedBandwidthCopyOptionValues() []ProvisionedBandwidthCopyOption { - return []ProvisionedBandwidthCopyOption{ - ProvisionedBandwidthCopyOptionEnhanced, - ProvisionedBandwidthCopyOptionNone, - } -} - -// ProximityPlacementGroupType - Specifies the type of the proximity placement group. Possible values are: Standard : Co-locate -// resources within an Azure region or Availability Zone. Ultra : For future use. -type ProximityPlacementGroupType string - -const ( - ProximityPlacementGroupTypeStandard ProximityPlacementGroupType = "Standard" - ProximityPlacementGroupTypeUltra ProximityPlacementGroupType = "Ultra" -) - -// PossibleProximityPlacementGroupTypeValues returns the possible values for the ProximityPlacementGroupType const type. -func PossibleProximityPlacementGroupTypeValues() []ProximityPlacementGroupType { - return []ProximityPlacementGroupType{ - ProximityPlacementGroupTypeStandard, - ProximityPlacementGroupTypeUltra, - } -} - -// PublicIPAddressSKUName - Specify public IP sku name -type PublicIPAddressSKUName string - -const ( - PublicIPAddressSKUNameBasic PublicIPAddressSKUName = "Basic" - PublicIPAddressSKUNameStandard PublicIPAddressSKUName = "Standard" -) - -// PossiblePublicIPAddressSKUNameValues returns the possible values for the PublicIPAddressSKUName const type. -func PossiblePublicIPAddressSKUNameValues() []PublicIPAddressSKUName { - return []PublicIPAddressSKUName{ - PublicIPAddressSKUNameBasic, - PublicIPAddressSKUNameStandard, - } -} - -// PublicIPAddressSKUTier - Specify public IP sku tier -type PublicIPAddressSKUTier string - -const ( - PublicIPAddressSKUTierGlobal PublicIPAddressSKUTier = "Global" - PublicIPAddressSKUTierRegional PublicIPAddressSKUTier = "Regional" -) - -// PossiblePublicIPAddressSKUTierValues returns the possible values for the PublicIPAddressSKUTier const type. -func PossiblePublicIPAddressSKUTierValues() []PublicIPAddressSKUTier { - return []PublicIPAddressSKUTier{ - PublicIPAddressSKUTierGlobal, - PublicIPAddressSKUTierRegional, - } -} - -// PublicIPAllocationMethod - Specify the public IP allocation type -type PublicIPAllocationMethod string - -const ( - PublicIPAllocationMethodDynamic PublicIPAllocationMethod = "Dynamic" - PublicIPAllocationMethodStatic PublicIPAllocationMethod = "Static" -) - -// PossiblePublicIPAllocationMethodValues returns the possible values for the PublicIPAllocationMethod const type. -func PossiblePublicIPAllocationMethodValues() []PublicIPAllocationMethod { - return []PublicIPAllocationMethod{ - PublicIPAllocationMethodDynamic, - PublicIPAllocationMethodStatic, - } -} - -// PublicNetworkAccess - Policy for controlling export on the disk. -type PublicNetworkAccess string - -const ( - // PublicNetworkAccessDisabled - You cannot access the underlying data of the disk publicly on the internet even when NetworkAccessPolicy - // is set to AllowAll. You can access the data via the SAS URI only from your trusted Azure VNET when NetworkAccessPolicy - // is set to AllowPrivate. - PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" - // PublicNetworkAccessEnabled - You can generate a SAS URI to access the underlying data of the disk publicly on the internet - // when NetworkAccessPolicy is set to AllowAll. You can access the data via the SAS URI only from your trusted Azure VNET - // when NetworkAccessPolicy is set to AllowPrivate. - PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" -) - -// PossiblePublicNetworkAccessValues returns the possible values for the PublicNetworkAccess const type. -func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { - return []PublicNetworkAccess{ - PublicNetworkAccessDisabled, - PublicNetworkAccessEnabled, - } -} - -// RepairAction - Type of repair action (replace, restart, reimage) that will be used for repairing unhealthy virtual machines -// in the scale set. Default value is replace. -type RepairAction string - -const ( - RepairActionReimage RepairAction = "Reimage" - RepairActionReplace RepairAction = "Replace" - RepairActionRestart RepairAction = "Restart" -) - -// PossibleRepairActionValues returns the possible values for the RepairAction const type. -func PossibleRepairActionValues() []RepairAction { - return []RepairAction{ - RepairActionReimage, - RepairActionReplace, - RepairActionRestart, - } -} - -// ReplicationMode - Optional parameter which specifies the mode to be used for replication. This property is not updatable. -type ReplicationMode string - -const ( - ReplicationModeFull ReplicationMode = "Full" - ReplicationModeShallow ReplicationMode = "Shallow" -) - -// PossibleReplicationModeValues returns the possible values for the ReplicationMode const type. -func PossibleReplicationModeValues() []ReplicationMode { - return []ReplicationMode{ - ReplicationModeFull, - ReplicationModeShallow, - } -} - -// ReplicationState - This is the regional replication state. -type ReplicationState string - -const ( - ReplicationStateCompleted ReplicationState = "Completed" - ReplicationStateFailed ReplicationState = "Failed" - ReplicationStateReplicating ReplicationState = "Replicating" - ReplicationStateUnknown ReplicationState = "Unknown" -) - -// PossibleReplicationStateValues returns the possible values for the ReplicationState const type. -func PossibleReplicationStateValues() []ReplicationState { - return []ReplicationState{ - ReplicationStateCompleted, - ReplicationStateFailed, - ReplicationStateReplicating, - ReplicationStateUnknown, - } -} - -type ReplicationStatusTypes string - -const ( - ReplicationStatusTypesReplicationStatus ReplicationStatusTypes = "ReplicationStatus" - ReplicationStatusTypesUefiSettings ReplicationStatusTypes = "UefiSettings" -) - -// PossibleReplicationStatusTypesValues returns the possible values for the ReplicationStatusTypes const type. -func PossibleReplicationStatusTypesValues() []ReplicationStatusTypes { - return []ReplicationStatusTypes{ - ReplicationStatusTypesReplicationStatus, - ReplicationStatusTypesUefiSettings, - } -} - -type ResourceIDOptionsForGetCapacityReservationGroups string - -const ( - ResourceIDOptionsForGetCapacityReservationGroupsAll ResourceIDOptionsForGetCapacityReservationGroups = "All" - ResourceIDOptionsForGetCapacityReservationGroupsCreatedInSubscription ResourceIDOptionsForGetCapacityReservationGroups = "CreatedInSubscription" - ResourceIDOptionsForGetCapacityReservationGroupsSharedWithSubscription ResourceIDOptionsForGetCapacityReservationGroups = "SharedWithSubscription" -) - -// PossibleResourceIDOptionsForGetCapacityReservationGroupsValues returns the possible values for the ResourceIDOptionsForGetCapacityReservationGroups const type. -func PossibleResourceIDOptionsForGetCapacityReservationGroupsValues() []ResourceIDOptionsForGetCapacityReservationGroups { - return []ResourceIDOptionsForGetCapacityReservationGroups{ - ResourceIDOptionsForGetCapacityReservationGroupsAll, - ResourceIDOptionsForGetCapacityReservationGroupsCreatedInSubscription, - ResourceIDOptionsForGetCapacityReservationGroupsSharedWithSubscription, - } -} - -// ResourceIdentityType - The type of identity used for the virtual machine scale set. The type 'SystemAssigned, UserAssigned' -// includes both an implicitly created identity and a set of user assigned identities. The type 'None' -// will remove any identities from the virtual machine scale set. -type ResourceIdentityType string - -const ( - ResourceIdentityTypeNone ResourceIdentityType = "None" - ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" - ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" - ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" -) - -// PossibleResourceIdentityTypeValues returns the possible values for the ResourceIdentityType const type. -func PossibleResourceIdentityTypeValues() []ResourceIdentityType { - return []ResourceIdentityType{ - ResourceIdentityTypeNone, - ResourceIdentityTypeSystemAssigned, - ResourceIdentityTypeSystemAssignedUserAssigned, - ResourceIdentityTypeUserAssigned, - } -} - -// ResourceSKUCapacityScaleType - The scale type applicable to the sku. -type ResourceSKUCapacityScaleType string - -const ( - ResourceSKUCapacityScaleTypeAutomatic ResourceSKUCapacityScaleType = "Automatic" - ResourceSKUCapacityScaleTypeManual ResourceSKUCapacityScaleType = "Manual" - ResourceSKUCapacityScaleTypeNone ResourceSKUCapacityScaleType = "None" -) - -// PossibleResourceSKUCapacityScaleTypeValues returns the possible values for the ResourceSKUCapacityScaleType const type. -func PossibleResourceSKUCapacityScaleTypeValues() []ResourceSKUCapacityScaleType { - return []ResourceSKUCapacityScaleType{ - ResourceSKUCapacityScaleTypeAutomatic, - ResourceSKUCapacityScaleTypeManual, - ResourceSKUCapacityScaleTypeNone, - } -} - -// ResourceSKURestrictionsReasonCode - The reason for restriction. -type ResourceSKURestrictionsReasonCode string - -const ( - ResourceSKURestrictionsReasonCodeNotAvailableForSubscription ResourceSKURestrictionsReasonCode = "NotAvailableForSubscription" - ResourceSKURestrictionsReasonCodeQuotaID ResourceSKURestrictionsReasonCode = "QuotaId" -) - -// PossibleResourceSKURestrictionsReasonCodeValues returns the possible values for the ResourceSKURestrictionsReasonCode const type. -func PossibleResourceSKURestrictionsReasonCodeValues() []ResourceSKURestrictionsReasonCode { - return []ResourceSKURestrictionsReasonCode{ - ResourceSKURestrictionsReasonCodeNotAvailableForSubscription, - ResourceSKURestrictionsReasonCodeQuotaID, - } -} - -// ResourceSKURestrictionsType - The type of restrictions. -type ResourceSKURestrictionsType string - -const ( - ResourceSKURestrictionsTypeLocation ResourceSKURestrictionsType = "Location" - ResourceSKURestrictionsTypeZone ResourceSKURestrictionsType = "Zone" -) - -// PossibleResourceSKURestrictionsTypeValues returns the possible values for the ResourceSKURestrictionsType const type. -func PossibleResourceSKURestrictionsTypeValues() []ResourceSKURestrictionsType { - return []ResourceSKURestrictionsType{ - ResourceSKURestrictionsTypeLocation, - ResourceSKURestrictionsTypeZone, - } -} - -type RestorePointCollectionExpandOptions string - -const ( - RestorePointCollectionExpandOptionsRestorePoints RestorePointCollectionExpandOptions = "restorePoints" -) - -// PossibleRestorePointCollectionExpandOptionsValues returns the possible values for the RestorePointCollectionExpandOptions const type. -func PossibleRestorePointCollectionExpandOptionsValues() []RestorePointCollectionExpandOptions { - return []RestorePointCollectionExpandOptions{ - RestorePointCollectionExpandOptionsRestorePoints, - } -} - -// RestorePointEncryptionType - The type of key used to encrypt the data of the disk restore point. -type RestorePointEncryptionType string - -const ( - // RestorePointEncryptionTypeEncryptionAtRestWithCustomerKey - Disk Restore Point is encrypted at rest with Customer managed - // key that can be changed and revoked by a customer. - RestorePointEncryptionTypeEncryptionAtRestWithCustomerKey RestorePointEncryptionType = "EncryptionAtRestWithCustomerKey" - // RestorePointEncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys - Disk Restore Point is encrypted at rest with 2 - // layers of encryption. One of the keys is Customer managed and the other key is Platform managed. - RestorePointEncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys RestorePointEncryptionType = "EncryptionAtRestWithPlatformAndCustomerKeys" - // RestorePointEncryptionTypeEncryptionAtRestWithPlatformKey - Disk Restore Point is encrypted at rest with Platform managed - // key. - RestorePointEncryptionTypeEncryptionAtRestWithPlatformKey RestorePointEncryptionType = "EncryptionAtRestWithPlatformKey" -) - -// PossibleRestorePointEncryptionTypeValues returns the possible values for the RestorePointEncryptionType const type. -func PossibleRestorePointEncryptionTypeValues() []RestorePointEncryptionType { - return []RestorePointEncryptionType{ - RestorePointEncryptionTypeEncryptionAtRestWithCustomerKey, - RestorePointEncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys, - RestorePointEncryptionTypeEncryptionAtRestWithPlatformKey, - } -} - -type RestorePointExpandOptions string - -const ( - RestorePointExpandOptionsInstanceView RestorePointExpandOptions = "instanceView" -) - -// PossibleRestorePointExpandOptionsValues returns the possible values for the RestorePointExpandOptions const type. -func PossibleRestorePointExpandOptionsValues() []RestorePointExpandOptions { - return []RestorePointExpandOptions{ - RestorePointExpandOptionsInstanceView, - } -} - -// RollingUpgradeActionType - The last action performed on the rolling upgrade. -type RollingUpgradeActionType string - -const ( - RollingUpgradeActionTypeCancel RollingUpgradeActionType = "Cancel" - RollingUpgradeActionTypeStart RollingUpgradeActionType = "Start" -) - -// PossibleRollingUpgradeActionTypeValues returns the possible values for the RollingUpgradeActionType const type. -func PossibleRollingUpgradeActionTypeValues() []RollingUpgradeActionType { - return []RollingUpgradeActionType{ - RollingUpgradeActionTypeCancel, - RollingUpgradeActionTypeStart, - } -} - -// RollingUpgradeStatusCode - Code indicating the current status of the upgrade. -type RollingUpgradeStatusCode string - -const ( - RollingUpgradeStatusCodeCancelled RollingUpgradeStatusCode = "Cancelled" - RollingUpgradeStatusCodeCompleted RollingUpgradeStatusCode = "Completed" - RollingUpgradeStatusCodeFaulted RollingUpgradeStatusCode = "Faulted" - RollingUpgradeStatusCodeRollingForward RollingUpgradeStatusCode = "RollingForward" -) - -// PossibleRollingUpgradeStatusCodeValues returns the possible values for the RollingUpgradeStatusCode const type. -func PossibleRollingUpgradeStatusCodeValues() []RollingUpgradeStatusCode { - return []RollingUpgradeStatusCode{ - RollingUpgradeStatusCodeCancelled, - RollingUpgradeStatusCodeCompleted, - RollingUpgradeStatusCodeFaulted, - RollingUpgradeStatusCodeRollingForward, - } -} - -// SSHEncryptionTypes - The encryption type of the SSH keys to be generated. See SshEncryptionTypes for possible set of values. -// If not provided, will default to RSA -type SSHEncryptionTypes string - -const ( - SSHEncryptionTypesEd25519 SSHEncryptionTypes = "Ed25519" - SSHEncryptionTypesRSA SSHEncryptionTypes = "RSA" -) - -// PossibleSSHEncryptionTypesValues returns the possible values for the SSHEncryptionTypes const type. -func PossibleSSHEncryptionTypesValues() []SSHEncryptionTypes { - return []SSHEncryptionTypes{ - SSHEncryptionTypesEd25519, - SSHEncryptionTypesRSA, - } -} - -// SecurityEncryptionTypes - Specifies the EncryptionType of the managed disk. It is set to DiskWithVMGuestState for encryption -// of the managed disk along with VMGuestState blob, VMGuestStateOnly for encryption of just the -// VMGuestState blob, and NonPersistedTPM for not persisting firmware state in the VMGuestState blob.. Note: It can be set -// for only Confidential VMs. -type SecurityEncryptionTypes string - -const ( - SecurityEncryptionTypesDiskWithVMGuestState SecurityEncryptionTypes = "DiskWithVMGuestState" - SecurityEncryptionTypesNonPersistedTPM SecurityEncryptionTypes = "NonPersistedTPM" - SecurityEncryptionTypesVMGuestStateOnly SecurityEncryptionTypes = "VMGuestStateOnly" -) - -// PossibleSecurityEncryptionTypesValues returns the possible values for the SecurityEncryptionTypes const type. -func PossibleSecurityEncryptionTypesValues() []SecurityEncryptionTypes { - return []SecurityEncryptionTypes{ - SecurityEncryptionTypesDiskWithVMGuestState, - SecurityEncryptionTypesNonPersistedTPM, - SecurityEncryptionTypesVMGuestStateOnly, - } -} - -// SecurityTypes - Specifies the SecurityType of the virtual machine. It has to be set to any specified value to enable UefiSettings. -// The default behavior is: UefiSettings will not be enabled unless this property is -// set. -type SecurityTypes string - -const ( - SecurityTypesConfidentialVM SecurityTypes = "ConfidentialVM" - SecurityTypesTrustedLaunch SecurityTypes = "TrustedLaunch" -) - -// PossibleSecurityTypesValues returns the possible values for the SecurityTypes const type. -func PossibleSecurityTypesValues() []SecurityTypes { - return []SecurityTypes{ - SecurityTypesConfidentialVM, - SecurityTypesTrustedLaunch, - } -} - -type SelectPermissions string - -const ( - SelectPermissionsPermissions SelectPermissions = "Permissions" -) - -// PossibleSelectPermissionsValues returns the possible values for the SelectPermissions const type. -func PossibleSelectPermissionsValues() []SelectPermissions { - return []SelectPermissions{ - SelectPermissionsPermissions, - } -} - -// SettingNames - Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands -// and AutoLogon. -type SettingNames string - -const ( - SettingNamesAutoLogon SettingNames = "AutoLogon" - SettingNamesFirstLogonCommands SettingNames = "FirstLogonCommands" -) - -// PossibleSettingNamesValues returns the possible values for the SettingNames const type. -func PossibleSettingNamesValues() []SettingNames { - return []SettingNames{ - SettingNamesAutoLogon, - SettingNamesFirstLogonCommands, - } -} - -// SharedGalleryHostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' -type SharedGalleryHostCaching string - -const ( - SharedGalleryHostCachingNone SharedGalleryHostCaching = "None" - SharedGalleryHostCachingReadOnly SharedGalleryHostCaching = "ReadOnly" - SharedGalleryHostCachingReadWrite SharedGalleryHostCaching = "ReadWrite" -) - -// PossibleSharedGalleryHostCachingValues returns the possible values for the SharedGalleryHostCaching const type. -func PossibleSharedGalleryHostCachingValues() []SharedGalleryHostCaching { - return []SharedGalleryHostCaching{ - SharedGalleryHostCachingNone, - SharedGalleryHostCachingReadOnly, - SharedGalleryHostCachingReadWrite, - } -} - -type SharedToValues string - -const ( - SharedToValuesTenant SharedToValues = "tenant" -) - -// PossibleSharedToValuesValues returns the possible values for the SharedToValues const type. -func PossibleSharedToValuesValues() []SharedToValues { - return []SharedToValues{ - SharedToValuesTenant, - } -} - -// SharingProfileGroupTypes - This property allows you to specify the type of sharing group. Possible values are: Subscriptions, -// AADTenants. -type SharingProfileGroupTypes string - -const ( - SharingProfileGroupTypesAADTenants SharingProfileGroupTypes = "AADTenants" - SharingProfileGroupTypesSubscriptions SharingProfileGroupTypes = "Subscriptions" -) - -// PossibleSharingProfileGroupTypesValues returns the possible values for the SharingProfileGroupTypes const type. -func PossibleSharingProfileGroupTypesValues() []SharingProfileGroupTypes { - return []SharingProfileGroupTypes{ - SharingProfileGroupTypesAADTenants, - SharingProfileGroupTypesSubscriptions, - } -} - -// SharingState - The sharing state of the gallery, which only appears in the response. -type SharingState string - -const ( - SharingStateFailed SharingState = "Failed" - SharingStateInProgress SharingState = "InProgress" - SharingStateSucceeded SharingState = "Succeeded" - SharingStateUnknown SharingState = "Unknown" -) - -// PossibleSharingStateValues returns the possible values for the SharingState const type. -func PossibleSharingStateValues() []SharingState { - return []SharingState{ - SharingStateFailed, - SharingStateInProgress, - SharingStateSucceeded, - SharingStateUnknown, - } -} - -// SharingUpdateOperationTypes - This property allows you to specify the operation type of gallery sharing update. Possible -// values are: Add, Remove, Reset. -type SharingUpdateOperationTypes string - -const ( - SharingUpdateOperationTypesAdd SharingUpdateOperationTypes = "Add" - SharingUpdateOperationTypesEnableCommunity SharingUpdateOperationTypes = "EnableCommunity" - SharingUpdateOperationTypesRemove SharingUpdateOperationTypes = "Remove" - SharingUpdateOperationTypesReset SharingUpdateOperationTypes = "Reset" -) - -// PossibleSharingUpdateOperationTypesValues returns the possible values for the SharingUpdateOperationTypes const type. -func PossibleSharingUpdateOperationTypesValues() []SharingUpdateOperationTypes { - return []SharingUpdateOperationTypes{ - SharingUpdateOperationTypesAdd, - SharingUpdateOperationTypesEnableCommunity, - SharingUpdateOperationTypesRemove, - SharingUpdateOperationTypesReset, - } -} - -// SnapshotStorageAccountTypes - The sku name. -type SnapshotStorageAccountTypes string - -const ( - // SnapshotStorageAccountTypesPremiumLRS - Premium SSD locally redundant storage - SnapshotStorageAccountTypesPremiumLRS SnapshotStorageAccountTypes = "Premium_LRS" - // SnapshotStorageAccountTypesStandardLRS - Standard HDD locally redundant storage - SnapshotStorageAccountTypesStandardLRS SnapshotStorageAccountTypes = "Standard_LRS" - // SnapshotStorageAccountTypesStandardZRS - Standard zone redundant storage - SnapshotStorageAccountTypesStandardZRS SnapshotStorageAccountTypes = "Standard_ZRS" -) - -// PossibleSnapshotStorageAccountTypesValues returns the possible values for the SnapshotStorageAccountTypes const type. -func PossibleSnapshotStorageAccountTypesValues() []SnapshotStorageAccountTypes { - return []SnapshotStorageAccountTypes{ - SnapshotStorageAccountTypesPremiumLRS, - SnapshotStorageAccountTypesStandardLRS, - SnapshotStorageAccountTypesStandardZRS, - } -} - -// StatusLevelTypes - The level code. -type StatusLevelTypes string - -const ( - StatusLevelTypesError StatusLevelTypes = "Error" - StatusLevelTypesInfo StatusLevelTypes = "Info" - StatusLevelTypesWarning StatusLevelTypes = "Warning" -) - -// PossibleStatusLevelTypesValues returns the possible values for the StatusLevelTypes const type. -func PossibleStatusLevelTypesValues() []StatusLevelTypes { - return []StatusLevelTypes{ - StatusLevelTypesError, - StatusLevelTypesInfo, - StatusLevelTypesWarning, - } -} - -// StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. -type StorageAccountType string - -const ( - StorageAccountTypePremiumLRS StorageAccountType = "Premium_LRS" - StorageAccountTypeStandardLRS StorageAccountType = "Standard_LRS" - StorageAccountTypeStandardZRS StorageAccountType = "Standard_ZRS" -) - -// PossibleStorageAccountTypeValues returns the possible values for the StorageAccountType const type. -func PossibleStorageAccountTypeValues() []StorageAccountType { - return []StorageAccountType{ - StorageAccountTypePremiumLRS, - StorageAccountTypeStandardLRS, - StorageAccountTypeStandardZRS, - } -} - -// StorageAccountTypes - Specifies the storage account type for the managed disk. Managed OS disk storage account type can -// only be set when you create the scale set. NOTE: UltraSSDLRS can only be used with data disks. It -// cannot be used with OS Disk. StandardLRS uses Standard HDD. StandardSSDLRS uses Standard SSD. PremiumLRS uses Premium SSD. -// UltraSSDLRS uses Ultra disk. PremiumZRS uses Premium SSD zone redundant -// storage. StandardSSD_ZRS uses Standard SSD zone redundant storage. For more information regarding disks supported for Windows -// Virtual Machines, refer to -// https://docs.microsoft.com/azure/virtual-machines/windows/disks-types and, for Linux Virtual Machines, refer to https://docs.microsoft.com/azure/virtual-machines/linux/disks-types -type StorageAccountTypes string - -const ( - StorageAccountTypesPremiumLRS StorageAccountTypes = "Premium_LRS" - StorageAccountTypesPremiumV2LRS StorageAccountTypes = "PremiumV2_LRS" - StorageAccountTypesPremiumZRS StorageAccountTypes = "Premium_ZRS" - StorageAccountTypesStandardLRS StorageAccountTypes = "Standard_LRS" - StorageAccountTypesStandardSSDLRS StorageAccountTypes = "StandardSSD_LRS" - StorageAccountTypesStandardSSDZRS StorageAccountTypes = "StandardSSD_ZRS" - StorageAccountTypesUltraSSDLRS StorageAccountTypes = "UltraSSD_LRS" -) - -// PossibleStorageAccountTypesValues returns the possible values for the StorageAccountTypes const type. -func PossibleStorageAccountTypesValues() []StorageAccountTypes { - return []StorageAccountTypes{ - StorageAccountTypesPremiumLRS, - StorageAccountTypesPremiumV2LRS, - StorageAccountTypesPremiumZRS, - StorageAccountTypesStandardLRS, - StorageAccountTypesStandardSSDLRS, - StorageAccountTypesStandardSSDZRS, - StorageAccountTypesUltraSSDLRS, - } -} - -// UefiKeyType - The type of key signature. -type UefiKeyType string - -const ( - UefiKeyTypeSHA256 UefiKeyType = "sha256" - UefiKeyTypeX509 UefiKeyType = "x509" -) - -// PossibleUefiKeyTypeValues returns the possible values for the UefiKeyType const type. -func PossibleUefiKeyTypeValues() []UefiKeyType { - return []UefiKeyType{ - UefiKeyTypeSHA256, - UefiKeyTypeX509, - } -} - -// UefiSignatureTemplateName - The name of the signature template that contains default UEFI keys. -type UefiSignatureTemplateName string - -const ( - UefiSignatureTemplateNameMicrosoftUefiCertificateAuthorityTemplate UefiSignatureTemplateName = "MicrosoftUefiCertificateAuthorityTemplate" - UefiSignatureTemplateNameMicrosoftWindowsTemplate UefiSignatureTemplateName = "MicrosoftWindowsTemplate" - UefiSignatureTemplateNameNoSignatureTemplate UefiSignatureTemplateName = "NoSignatureTemplate" -) - -// PossibleUefiSignatureTemplateNameValues returns the possible values for the UefiSignatureTemplateName const type. -func PossibleUefiSignatureTemplateNameValues() []UefiSignatureTemplateName { - return []UefiSignatureTemplateName{ - UefiSignatureTemplateNameMicrosoftUefiCertificateAuthorityTemplate, - UefiSignatureTemplateNameMicrosoftWindowsTemplate, - UefiSignatureTemplateNameNoSignatureTemplate, - } -} - -// UpgradeMode - Specifies the mode of an upgrade to virtual machines in the scale set. -// Possible values are: -// Manual - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade -// action. -// Automatic - All virtual machines in the scale set are automatically updated at the same time. -type UpgradeMode string - -const ( - UpgradeModeAutomatic UpgradeMode = "Automatic" - UpgradeModeManual UpgradeMode = "Manual" - UpgradeModeRolling UpgradeMode = "Rolling" -) - -// PossibleUpgradeModeValues returns the possible values for the UpgradeMode const type. -func PossibleUpgradeModeValues() []UpgradeMode { - return []UpgradeMode{ - UpgradeModeAutomatic, - UpgradeModeManual, - UpgradeModeRolling, - } -} - -// UpgradeOperationInvoker - Invoker of the Upgrade Operation -type UpgradeOperationInvoker string - -const ( - UpgradeOperationInvokerPlatform UpgradeOperationInvoker = "Platform" - UpgradeOperationInvokerUnknown UpgradeOperationInvoker = "Unknown" - UpgradeOperationInvokerUser UpgradeOperationInvoker = "User" -) - -// PossibleUpgradeOperationInvokerValues returns the possible values for the UpgradeOperationInvoker const type. -func PossibleUpgradeOperationInvokerValues() []UpgradeOperationInvoker { - return []UpgradeOperationInvoker{ - UpgradeOperationInvokerPlatform, - UpgradeOperationInvokerUnknown, - UpgradeOperationInvokerUser, - } -} - -// UpgradeState - Code indicating the current status of the upgrade. -type UpgradeState string - -const ( - UpgradeStateCancelled UpgradeState = "Cancelled" - UpgradeStateCompleted UpgradeState = "Completed" - UpgradeStateFaulted UpgradeState = "Faulted" - UpgradeStateRollingForward UpgradeState = "RollingForward" -) - -// PossibleUpgradeStateValues returns the possible values for the UpgradeState const type. -func PossibleUpgradeStateValues() []UpgradeState { - return []UpgradeState{ - UpgradeStateCancelled, - UpgradeStateCompleted, - UpgradeStateFaulted, - UpgradeStateRollingForward, - } -} - -// VMDiskTypes - VM disk types which are disallowed. -type VMDiskTypes string - -const ( - VMDiskTypesNone VMDiskTypes = "None" - VMDiskTypesUnmanaged VMDiskTypes = "Unmanaged" -) - -// PossibleVMDiskTypesValues returns the possible values for the VMDiskTypes const type. -func PossibleVMDiskTypesValues() []VMDiskTypes { - return []VMDiskTypes{ - VMDiskTypesNone, - VMDiskTypesUnmanaged, - } -} - -type VMGuestPatchClassificationLinux string - -const ( - VMGuestPatchClassificationLinuxCritical VMGuestPatchClassificationLinux = "Critical" - VMGuestPatchClassificationLinuxOther VMGuestPatchClassificationLinux = "Other" - VMGuestPatchClassificationLinuxSecurity VMGuestPatchClassificationLinux = "Security" -) - -// PossibleVMGuestPatchClassificationLinuxValues returns the possible values for the VMGuestPatchClassificationLinux const type. -func PossibleVMGuestPatchClassificationLinuxValues() []VMGuestPatchClassificationLinux { - return []VMGuestPatchClassificationLinux{ - VMGuestPatchClassificationLinuxCritical, - VMGuestPatchClassificationLinuxOther, - VMGuestPatchClassificationLinuxSecurity, - } -} - -type VMGuestPatchClassificationWindows string - -const ( - VMGuestPatchClassificationWindowsCritical VMGuestPatchClassificationWindows = "Critical" - VMGuestPatchClassificationWindowsDefinition VMGuestPatchClassificationWindows = "Definition" - VMGuestPatchClassificationWindowsFeaturePack VMGuestPatchClassificationWindows = "FeaturePack" - VMGuestPatchClassificationWindowsSecurity VMGuestPatchClassificationWindows = "Security" - VMGuestPatchClassificationWindowsServicePack VMGuestPatchClassificationWindows = "ServicePack" - VMGuestPatchClassificationWindowsTools VMGuestPatchClassificationWindows = "Tools" - VMGuestPatchClassificationWindowsUpdateRollUp VMGuestPatchClassificationWindows = "UpdateRollUp" - VMGuestPatchClassificationWindowsUpdates VMGuestPatchClassificationWindows = "Updates" -) - -// PossibleVMGuestPatchClassificationWindowsValues returns the possible values for the VMGuestPatchClassificationWindows const type. -func PossibleVMGuestPatchClassificationWindowsValues() []VMGuestPatchClassificationWindows { - return []VMGuestPatchClassificationWindows{ - VMGuestPatchClassificationWindowsCritical, - VMGuestPatchClassificationWindowsDefinition, - VMGuestPatchClassificationWindowsFeaturePack, - VMGuestPatchClassificationWindowsSecurity, - VMGuestPatchClassificationWindowsServicePack, - VMGuestPatchClassificationWindowsTools, - VMGuestPatchClassificationWindowsUpdateRollUp, - VMGuestPatchClassificationWindowsUpdates, - } -} - -// VMGuestPatchRebootBehavior - Describes the reboot requirements of the patch. -type VMGuestPatchRebootBehavior string - -const ( - VMGuestPatchRebootBehaviorAlwaysRequiresReboot VMGuestPatchRebootBehavior = "AlwaysRequiresReboot" - VMGuestPatchRebootBehaviorCanRequestReboot VMGuestPatchRebootBehavior = "CanRequestReboot" - VMGuestPatchRebootBehaviorNeverReboots VMGuestPatchRebootBehavior = "NeverReboots" - VMGuestPatchRebootBehaviorUnknown VMGuestPatchRebootBehavior = "Unknown" -) - -// PossibleVMGuestPatchRebootBehaviorValues returns the possible values for the VMGuestPatchRebootBehavior const type. -func PossibleVMGuestPatchRebootBehaviorValues() []VMGuestPatchRebootBehavior { - return []VMGuestPatchRebootBehavior{ - VMGuestPatchRebootBehaviorAlwaysRequiresReboot, - VMGuestPatchRebootBehaviorCanRequestReboot, - VMGuestPatchRebootBehaviorNeverReboots, - VMGuestPatchRebootBehaviorUnknown, - } -} - -// VMGuestPatchRebootSetting - Defines when it is acceptable to reboot a VM during a software update operation. -type VMGuestPatchRebootSetting string - -const ( - VMGuestPatchRebootSettingAlways VMGuestPatchRebootSetting = "Always" - VMGuestPatchRebootSettingIfRequired VMGuestPatchRebootSetting = "IfRequired" - VMGuestPatchRebootSettingNever VMGuestPatchRebootSetting = "Never" -) - -// PossibleVMGuestPatchRebootSettingValues returns the possible values for the VMGuestPatchRebootSetting const type. -func PossibleVMGuestPatchRebootSettingValues() []VMGuestPatchRebootSetting { - return []VMGuestPatchRebootSetting{ - VMGuestPatchRebootSettingAlways, - VMGuestPatchRebootSettingIfRequired, - VMGuestPatchRebootSettingNever, - } -} - -// VMGuestPatchRebootStatus - The reboot state of the VM following completion of the operation. -type VMGuestPatchRebootStatus string - -const ( - VMGuestPatchRebootStatusCompleted VMGuestPatchRebootStatus = "Completed" - VMGuestPatchRebootStatusFailed VMGuestPatchRebootStatus = "Failed" - VMGuestPatchRebootStatusNotNeeded VMGuestPatchRebootStatus = "NotNeeded" - VMGuestPatchRebootStatusRequired VMGuestPatchRebootStatus = "Required" - VMGuestPatchRebootStatusStarted VMGuestPatchRebootStatus = "Started" - VMGuestPatchRebootStatusUnknown VMGuestPatchRebootStatus = "Unknown" -) - -// PossibleVMGuestPatchRebootStatusValues returns the possible values for the VMGuestPatchRebootStatus const type. -func PossibleVMGuestPatchRebootStatusValues() []VMGuestPatchRebootStatus { - return []VMGuestPatchRebootStatus{ - VMGuestPatchRebootStatusCompleted, - VMGuestPatchRebootStatusFailed, - VMGuestPatchRebootStatusNotNeeded, - VMGuestPatchRebootStatusRequired, - VMGuestPatchRebootStatusStarted, - VMGuestPatchRebootStatusUnknown, - } -} - -// VirtualMachineEvictionPolicyTypes - Specifies the eviction policy for the Azure Spot VM/VMSS -type VirtualMachineEvictionPolicyTypes string - -const ( - VirtualMachineEvictionPolicyTypesDeallocate VirtualMachineEvictionPolicyTypes = "Deallocate" - VirtualMachineEvictionPolicyTypesDelete VirtualMachineEvictionPolicyTypes = "Delete" -) - -// PossibleVirtualMachineEvictionPolicyTypesValues returns the possible values for the VirtualMachineEvictionPolicyTypes const type. -func PossibleVirtualMachineEvictionPolicyTypesValues() []VirtualMachineEvictionPolicyTypes { - return []VirtualMachineEvictionPolicyTypes{ - VirtualMachineEvictionPolicyTypesDeallocate, - VirtualMachineEvictionPolicyTypesDelete, - } -} - -// VirtualMachinePriorityTypes - Specifies the priority for a standalone virtual machine or the virtual machines in the scale -// set. 'Low' enum will be deprecated in the future, please use 'Spot' as the enum to deploy Azure Spot -// VM/VMSS. -type VirtualMachinePriorityTypes string - -const ( - VirtualMachinePriorityTypesLow VirtualMachinePriorityTypes = "Low" - VirtualMachinePriorityTypesRegular VirtualMachinePriorityTypes = "Regular" - VirtualMachinePriorityTypesSpot VirtualMachinePriorityTypes = "Spot" -) - -// PossibleVirtualMachinePriorityTypesValues returns the possible values for the VirtualMachinePriorityTypes const type. -func PossibleVirtualMachinePriorityTypesValues() []VirtualMachinePriorityTypes { - return []VirtualMachinePriorityTypes{ - VirtualMachinePriorityTypesLow, - VirtualMachinePriorityTypesRegular, - VirtualMachinePriorityTypesSpot, - } -} - -// VirtualMachineScaleSetSKUScaleType - The scale type applicable to the sku. -type VirtualMachineScaleSetSKUScaleType string - -const ( - VirtualMachineScaleSetSKUScaleTypeAutomatic VirtualMachineScaleSetSKUScaleType = "Automatic" - VirtualMachineScaleSetSKUScaleTypeNone VirtualMachineScaleSetSKUScaleType = "None" -) - -// PossibleVirtualMachineScaleSetSKUScaleTypeValues returns the possible values for the VirtualMachineScaleSetSKUScaleType const type. -func PossibleVirtualMachineScaleSetSKUScaleTypeValues() []VirtualMachineScaleSetSKUScaleType { - return []VirtualMachineScaleSetSKUScaleType{ - VirtualMachineScaleSetSKUScaleTypeAutomatic, - VirtualMachineScaleSetSKUScaleTypeNone, - } -} - -type VirtualMachineScaleSetScaleInRules string - -const ( - VirtualMachineScaleSetScaleInRulesDefault VirtualMachineScaleSetScaleInRules = "Default" - VirtualMachineScaleSetScaleInRulesNewestVM VirtualMachineScaleSetScaleInRules = "NewestVM" - VirtualMachineScaleSetScaleInRulesOldestVM VirtualMachineScaleSetScaleInRules = "OldestVM" -) - -// PossibleVirtualMachineScaleSetScaleInRulesValues returns the possible values for the VirtualMachineScaleSetScaleInRules const type. -func PossibleVirtualMachineScaleSetScaleInRulesValues() []VirtualMachineScaleSetScaleInRules { - return []VirtualMachineScaleSetScaleInRules{ - VirtualMachineScaleSetScaleInRulesDefault, - VirtualMachineScaleSetScaleInRulesNewestVM, - VirtualMachineScaleSetScaleInRulesOldestVM, - } -} - -// VirtualMachineSizeTypes - Specifies the size of the virtual machine. The enum data type is currently deprecated and will -// be removed by December 23rd 2023. The recommended way to get the list of available sizes is using these -// APIs: List all available virtual machine sizes in an availability set [https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes], -// List all available virtual machine sizes in a -// region [https://docs.microsoft.com/rest/api/compute/resourceskus/list], List all available virtual machine sizes for resizing -// [https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes]. For more information about virtual machine -// sizes, see Sizes for virtual machines -// [https://docs.microsoft.com/azure/virtual-machines/sizes]. The available VM sizes depend on region and availability set. -type VirtualMachineSizeTypes string - -const ( - VirtualMachineSizeTypesBasicA0 VirtualMachineSizeTypes = "Basic_A0" - VirtualMachineSizeTypesBasicA1 VirtualMachineSizeTypes = "Basic_A1" - VirtualMachineSizeTypesBasicA2 VirtualMachineSizeTypes = "Basic_A2" - VirtualMachineSizeTypesBasicA3 VirtualMachineSizeTypes = "Basic_A3" - VirtualMachineSizeTypesBasicA4 VirtualMachineSizeTypes = "Basic_A4" - VirtualMachineSizeTypesStandardA0 VirtualMachineSizeTypes = "Standard_A0" - VirtualMachineSizeTypesStandardA1 VirtualMachineSizeTypes = "Standard_A1" - VirtualMachineSizeTypesStandardA10 VirtualMachineSizeTypes = "Standard_A10" - VirtualMachineSizeTypesStandardA11 VirtualMachineSizeTypes = "Standard_A11" - VirtualMachineSizeTypesStandardA1V2 VirtualMachineSizeTypes = "Standard_A1_v2" - VirtualMachineSizeTypesStandardA2 VirtualMachineSizeTypes = "Standard_A2" - VirtualMachineSizeTypesStandardA2MV2 VirtualMachineSizeTypes = "Standard_A2m_v2" - VirtualMachineSizeTypesStandardA2V2 VirtualMachineSizeTypes = "Standard_A2_v2" - VirtualMachineSizeTypesStandardA3 VirtualMachineSizeTypes = "Standard_A3" - VirtualMachineSizeTypesStandardA4 VirtualMachineSizeTypes = "Standard_A4" - VirtualMachineSizeTypesStandardA4MV2 VirtualMachineSizeTypes = "Standard_A4m_v2" - VirtualMachineSizeTypesStandardA4V2 VirtualMachineSizeTypes = "Standard_A4_v2" - VirtualMachineSizeTypesStandardA5 VirtualMachineSizeTypes = "Standard_A5" - VirtualMachineSizeTypesStandardA6 VirtualMachineSizeTypes = "Standard_A6" - VirtualMachineSizeTypesStandardA7 VirtualMachineSizeTypes = "Standard_A7" - VirtualMachineSizeTypesStandardA8 VirtualMachineSizeTypes = "Standard_A8" - VirtualMachineSizeTypesStandardA8MV2 VirtualMachineSizeTypes = "Standard_A8m_v2" - VirtualMachineSizeTypesStandardA8V2 VirtualMachineSizeTypes = "Standard_A8_v2" - VirtualMachineSizeTypesStandardA9 VirtualMachineSizeTypes = "Standard_A9" - VirtualMachineSizeTypesStandardB1Ms VirtualMachineSizeTypes = "Standard_B1ms" - VirtualMachineSizeTypesStandardB1S VirtualMachineSizeTypes = "Standard_B1s" - VirtualMachineSizeTypesStandardB2Ms VirtualMachineSizeTypes = "Standard_B2ms" - VirtualMachineSizeTypesStandardB2S VirtualMachineSizeTypes = "Standard_B2s" - VirtualMachineSizeTypesStandardB4Ms VirtualMachineSizeTypes = "Standard_B4ms" - VirtualMachineSizeTypesStandardB8Ms VirtualMachineSizeTypes = "Standard_B8ms" - VirtualMachineSizeTypesStandardD1 VirtualMachineSizeTypes = "Standard_D1" - VirtualMachineSizeTypesStandardD11 VirtualMachineSizeTypes = "Standard_D11" - VirtualMachineSizeTypesStandardD11V2 VirtualMachineSizeTypes = "Standard_D11_v2" - VirtualMachineSizeTypesStandardD12 VirtualMachineSizeTypes = "Standard_D12" - VirtualMachineSizeTypesStandardD12V2 VirtualMachineSizeTypes = "Standard_D12_v2" - VirtualMachineSizeTypesStandardD13 VirtualMachineSizeTypes = "Standard_D13" - VirtualMachineSizeTypesStandardD13V2 VirtualMachineSizeTypes = "Standard_D13_v2" - VirtualMachineSizeTypesStandardD14 VirtualMachineSizeTypes = "Standard_D14" - VirtualMachineSizeTypesStandardD14V2 VirtualMachineSizeTypes = "Standard_D14_v2" - VirtualMachineSizeTypesStandardD15V2 VirtualMachineSizeTypes = "Standard_D15_v2" - VirtualMachineSizeTypesStandardD16SV3 VirtualMachineSizeTypes = "Standard_D16s_v3" - VirtualMachineSizeTypesStandardD16V3 VirtualMachineSizeTypes = "Standard_D16_v3" - VirtualMachineSizeTypesStandardD1V2 VirtualMachineSizeTypes = "Standard_D1_v2" - VirtualMachineSizeTypesStandardD2 VirtualMachineSizeTypes = "Standard_D2" - VirtualMachineSizeTypesStandardD2SV3 VirtualMachineSizeTypes = "Standard_D2s_v3" - VirtualMachineSizeTypesStandardD2V2 VirtualMachineSizeTypes = "Standard_D2_v2" - VirtualMachineSizeTypesStandardD2V3 VirtualMachineSizeTypes = "Standard_D2_v3" - VirtualMachineSizeTypesStandardD3 VirtualMachineSizeTypes = "Standard_D3" - VirtualMachineSizeTypesStandardD32SV3 VirtualMachineSizeTypes = "Standard_D32s_v3" - VirtualMachineSizeTypesStandardD32V3 VirtualMachineSizeTypes = "Standard_D32_v3" - VirtualMachineSizeTypesStandardD3V2 VirtualMachineSizeTypes = "Standard_D3_v2" - VirtualMachineSizeTypesStandardD4 VirtualMachineSizeTypes = "Standard_D4" - VirtualMachineSizeTypesStandardD4SV3 VirtualMachineSizeTypes = "Standard_D4s_v3" - VirtualMachineSizeTypesStandardD4V2 VirtualMachineSizeTypes = "Standard_D4_v2" - VirtualMachineSizeTypesStandardD4V3 VirtualMachineSizeTypes = "Standard_D4_v3" - VirtualMachineSizeTypesStandardD5V2 VirtualMachineSizeTypes = "Standard_D5_v2" - VirtualMachineSizeTypesStandardD64SV3 VirtualMachineSizeTypes = "Standard_D64s_v3" - VirtualMachineSizeTypesStandardD64V3 VirtualMachineSizeTypes = "Standard_D64_v3" - VirtualMachineSizeTypesStandardD8SV3 VirtualMachineSizeTypes = "Standard_D8s_v3" - VirtualMachineSizeTypesStandardD8V3 VirtualMachineSizeTypes = "Standard_D8_v3" - VirtualMachineSizeTypesStandardDS1 VirtualMachineSizeTypes = "Standard_DS1" - VirtualMachineSizeTypesStandardDS11 VirtualMachineSizeTypes = "Standard_DS11" - VirtualMachineSizeTypesStandardDS11V2 VirtualMachineSizeTypes = "Standard_DS11_v2" - VirtualMachineSizeTypesStandardDS12 VirtualMachineSizeTypes = "Standard_DS12" - VirtualMachineSizeTypesStandardDS12V2 VirtualMachineSizeTypes = "Standard_DS12_v2" - VirtualMachineSizeTypesStandardDS13 VirtualMachineSizeTypes = "Standard_DS13" - VirtualMachineSizeTypesStandardDS132V2 VirtualMachineSizeTypes = "Standard_DS13-2_v2" - VirtualMachineSizeTypesStandardDS134V2 VirtualMachineSizeTypes = "Standard_DS13-4_v2" - VirtualMachineSizeTypesStandardDS13V2 VirtualMachineSizeTypes = "Standard_DS13_v2" - VirtualMachineSizeTypesStandardDS14 VirtualMachineSizeTypes = "Standard_DS14" - VirtualMachineSizeTypesStandardDS144V2 VirtualMachineSizeTypes = "Standard_DS14-4_v2" - VirtualMachineSizeTypesStandardDS148V2 VirtualMachineSizeTypes = "Standard_DS14-8_v2" - VirtualMachineSizeTypesStandardDS14V2 VirtualMachineSizeTypes = "Standard_DS14_v2" - VirtualMachineSizeTypesStandardDS15V2 VirtualMachineSizeTypes = "Standard_DS15_v2" - VirtualMachineSizeTypesStandardDS1V2 VirtualMachineSizeTypes = "Standard_DS1_v2" - VirtualMachineSizeTypesStandardDS2 VirtualMachineSizeTypes = "Standard_DS2" - VirtualMachineSizeTypesStandardDS2V2 VirtualMachineSizeTypes = "Standard_DS2_v2" - VirtualMachineSizeTypesStandardDS3 VirtualMachineSizeTypes = "Standard_DS3" - VirtualMachineSizeTypesStandardDS3V2 VirtualMachineSizeTypes = "Standard_DS3_v2" - VirtualMachineSizeTypesStandardDS4 VirtualMachineSizeTypes = "Standard_DS4" - VirtualMachineSizeTypesStandardDS4V2 VirtualMachineSizeTypes = "Standard_DS4_v2" - VirtualMachineSizeTypesStandardDS5V2 VirtualMachineSizeTypes = "Standard_DS5_v2" - VirtualMachineSizeTypesStandardE16SV3 VirtualMachineSizeTypes = "Standard_E16s_v3" - VirtualMachineSizeTypesStandardE16V3 VirtualMachineSizeTypes = "Standard_E16_v3" - VirtualMachineSizeTypesStandardE2SV3 VirtualMachineSizeTypes = "Standard_E2s_v3" - VirtualMachineSizeTypesStandardE2V3 VirtualMachineSizeTypes = "Standard_E2_v3" - VirtualMachineSizeTypesStandardE3216V3 VirtualMachineSizeTypes = "Standard_E32-16_v3" - VirtualMachineSizeTypesStandardE328SV3 VirtualMachineSizeTypes = "Standard_E32-8s_v3" - VirtualMachineSizeTypesStandardE32SV3 VirtualMachineSizeTypes = "Standard_E32s_v3" - VirtualMachineSizeTypesStandardE32V3 VirtualMachineSizeTypes = "Standard_E32_v3" - VirtualMachineSizeTypesStandardE4SV3 VirtualMachineSizeTypes = "Standard_E4s_v3" - VirtualMachineSizeTypesStandardE4V3 VirtualMachineSizeTypes = "Standard_E4_v3" - VirtualMachineSizeTypesStandardE6416SV3 VirtualMachineSizeTypes = "Standard_E64-16s_v3" - VirtualMachineSizeTypesStandardE6432SV3 VirtualMachineSizeTypes = "Standard_E64-32s_v3" - VirtualMachineSizeTypesStandardE64SV3 VirtualMachineSizeTypes = "Standard_E64s_v3" - VirtualMachineSizeTypesStandardE64V3 VirtualMachineSizeTypes = "Standard_E64_v3" - VirtualMachineSizeTypesStandardE8SV3 VirtualMachineSizeTypes = "Standard_E8s_v3" - VirtualMachineSizeTypesStandardE8V3 VirtualMachineSizeTypes = "Standard_E8_v3" - VirtualMachineSizeTypesStandardF1 VirtualMachineSizeTypes = "Standard_F1" - VirtualMachineSizeTypesStandardF16 VirtualMachineSizeTypes = "Standard_F16" - VirtualMachineSizeTypesStandardF16S VirtualMachineSizeTypes = "Standard_F16s" - VirtualMachineSizeTypesStandardF16SV2 VirtualMachineSizeTypes = "Standard_F16s_v2" - VirtualMachineSizeTypesStandardF1S VirtualMachineSizeTypes = "Standard_F1s" - VirtualMachineSizeTypesStandardF2 VirtualMachineSizeTypes = "Standard_F2" - VirtualMachineSizeTypesStandardF2S VirtualMachineSizeTypes = "Standard_F2s" - VirtualMachineSizeTypesStandardF2SV2 VirtualMachineSizeTypes = "Standard_F2s_v2" - VirtualMachineSizeTypesStandardF32SV2 VirtualMachineSizeTypes = "Standard_F32s_v2" - VirtualMachineSizeTypesStandardF4 VirtualMachineSizeTypes = "Standard_F4" - VirtualMachineSizeTypesStandardF4S VirtualMachineSizeTypes = "Standard_F4s" - VirtualMachineSizeTypesStandardF4SV2 VirtualMachineSizeTypes = "Standard_F4s_v2" - VirtualMachineSizeTypesStandardF64SV2 VirtualMachineSizeTypes = "Standard_F64s_v2" - VirtualMachineSizeTypesStandardF72SV2 VirtualMachineSizeTypes = "Standard_F72s_v2" - VirtualMachineSizeTypesStandardF8 VirtualMachineSizeTypes = "Standard_F8" - VirtualMachineSizeTypesStandardF8S VirtualMachineSizeTypes = "Standard_F8s" - VirtualMachineSizeTypesStandardF8SV2 VirtualMachineSizeTypes = "Standard_F8s_v2" - VirtualMachineSizeTypesStandardG1 VirtualMachineSizeTypes = "Standard_G1" - VirtualMachineSizeTypesStandardG2 VirtualMachineSizeTypes = "Standard_G2" - VirtualMachineSizeTypesStandardG3 VirtualMachineSizeTypes = "Standard_G3" - VirtualMachineSizeTypesStandardG4 VirtualMachineSizeTypes = "Standard_G4" - VirtualMachineSizeTypesStandardG5 VirtualMachineSizeTypes = "Standard_G5" - VirtualMachineSizeTypesStandardGS1 VirtualMachineSizeTypes = "Standard_GS1" - VirtualMachineSizeTypesStandardGS2 VirtualMachineSizeTypes = "Standard_GS2" - VirtualMachineSizeTypesStandardGS3 VirtualMachineSizeTypes = "Standard_GS3" - VirtualMachineSizeTypesStandardGS4 VirtualMachineSizeTypes = "Standard_GS4" - VirtualMachineSizeTypesStandardGS44 VirtualMachineSizeTypes = "Standard_GS4-4" - VirtualMachineSizeTypesStandardGS48 VirtualMachineSizeTypes = "Standard_GS4-8" - VirtualMachineSizeTypesStandardGS5 VirtualMachineSizeTypes = "Standard_GS5" - VirtualMachineSizeTypesStandardGS516 VirtualMachineSizeTypes = "Standard_GS5-16" - VirtualMachineSizeTypesStandardGS58 VirtualMachineSizeTypes = "Standard_GS5-8" - VirtualMachineSizeTypesStandardH16 VirtualMachineSizeTypes = "Standard_H16" - VirtualMachineSizeTypesStandardH16M VirtualMachineSizeTypes = "Standard_H16m" - VirtualMachineSizeTypesStandardH16Mr VirtualMachineSizeTypes = "Standard_H16mr" - VirtualMachineSizeTypesStandardH16R VirtualMachineSizeTypes = "Standard_H16r" - VirtualMachineSizeTypesStandardH8 VirtualMachineSizeTypes = "Standard_H8" - VirtualMachineSizeTypesStandardH8M VirtualMachineSizeTypes = "Standard_H8m" - VirtualMachineSizeTypesStandardL16S VirtualMachineSizeTypes = "Standard_L16s" - VirtualMachineSizeTypesStandardL32S VirtualMachineSizeTypes = "Standard_L32s" - VirtualMachineSizeTypesStandardL4S VirtualMachineSizeTypes = "Standard_L4s" - VirtualMachineSizeTypesStandardL8S VirtualMachineSizeTypes = "Standard_L8s" - VirtualMachineSizeTypesStandardM12832Ms VirtualMachineSizeTypes = "Standard_M128-32ms" - VirtualMachineSizeTypesStandardM12864Ms VirtualMachineSizeTypes = "Standard_M128-64ms" - VirtualMachineSizeTypesStandardM128Ms VirtualMachineSizeTypes = "Standard_M128ms" - VirtualMachineSizeTypesStandardM128S VirtualMachineSizeTypes = "Standard_M128s" - VirtualMachineSizeTypesStandardM6416Ms VirtualMachineSizeTypes = "Standard_M64-16ms" - VirtualMachineSizeTypesStandardM6432Ms VirtualMachineSizeTypes = "Standard_M64-32ms" - VirtualMachineSizeTypesStandardM64Ms VirtualMachineSizeTypes = "Standard_M64ms" - VirtualMachineSizeTypesStandardM64S VirtualMachineSizeTypes = "Standard_M64s" - VirtualMachineSizeTypesStandardNC12 VirtualMachineSizeTypes = "Standard_NC12" - VirtualMachineSizeTypesStandardNC12SV2 VirtualMachineSizeTypes = "Standard_NC12s_v2" - VirtualMachineSizeTypesStandardNC12SV3 VirtualMachineSizeTypes = "Standard_NC12s_v3" - VirtualMachineSizeTypesStandardNC24 VirtualMachineSizeTypes = "Standard_NC24" - VirtualMachineSizeTypesStandardNC24R VirtualMachineSizeTypes = "Standard_NC24r" - VirtualMachineSizeTypesStandardNC24RsV2 VirtualMachineSizeTypes = "Standard_NC24rs_v2" - VirtualMachineSizeTypesStandardNC24RsV3 VirtualMachineSizeTypes = "Standard_NC24rs_v3" - VirtualMachineSizeTypesStandardNC24SV2 VirtualMachineSizeTypes = "Standard_NC24s_v2" - VirtualMachineSizeTypesStandardNC24SV3 VirtualMachineSizeTypes = "Standard_NC24s_v3" - VirtualMachineSizeTypesStandardNC6 VirtualMachineSizeTypes = "Standard_NC6" - VirtualMachineSizeTypesStandardNC6SV2 VirtualMachineSizeTypes = "Standard_NC6s_v2" - VirtualMachineSizeTypesStandardNC6SV3 VirtualMachineSizeTypes = "Standard_NC6s_v3" - VirtualMachineSizeTypesStandardND12S VirtualMachineSizeTypes = "Standard_ND12s" - VirtualMachineSizeTypesStandardND24Rs VirtualMachineSizeTypes = "Standard_ND24rs" - VirtualMachineSizeTypesStandardND24S VirtualMachineSizeTypes = "Standard_ND24s" - VirtualMachineSizeTypesStandardND6S VirtualMachineSizeTypes = "Standard_ND6s" - VirtualMachineSizeTypesStandardNV12 VirtualMachineSizeTypes = "Standard_NV12" - VirtualMachineSizeTypesStandardNV24 VirtualMachineSizeTypes = "Standard_NV24" - VirtualMachineSizeTypesStandardNV6 VirtualMachineSizeTypes = "Standard_NV6" -) - -// PossibleVirtualMachineSizeTypesValues returns the possible values for the VirtualMachineSizeTypes const type. -func PossibleVirtualMachineSizeTypesValues() []VirtualMachineSizeTypes { - return []VirtualMachineSizeTypes{ - VirtualMachineSizeTypesBasicA0, - VirtualMachineSizeTypesBasicA1, - VirtualMachineSizeTypesBasicA2, - VirtualMachineSizeTypesBasicA3, - VirtualMachineSizeTypesBasicA4, - VirtualMachineSizeTypesStandardA0, - VirtualMachineSizeTypesStandardA1, - VirtualMachineSizeTypesStandardA10, - VirtualMachineSizeTypesStandardA11, - VirtualMachineSizeTypesStandardA1V2, - VirtualMachineSizeTypesStandardA2, - VirtualMachineSizeTypesStandardA2MV2, - VirtualMachineSizeTypesStandardA2V2, - VirtualMachineSizeTypesStandardA3, - VirtualMachineSizeTypesStandardA4, - VirtualMachineSizeTypesStandardA4MV2, - VirtualMachineSizeTypesStandardA4V2, - VirtualMachineSizeTypesStandardA5, - VirtualMachineSizeTypesStandardA6, - VirtualMachineSizeTypesStandardA7, - VirtualMachineSizeTypesStandardA8, - VirtualMachineSizeTypesStandardA8MV2, - VirtualMachineSizeTypesStandardA8V2, - VirtualMachineSizeTypesStandardA9, - VirtualMachineSizeTypesStandardB1Ms, - VirtualMachineSizeTypesStandardB1S, - VirtualMachineSizeTypesStandardB2Ms, - VirtualMachineSizeTypesStandardB2S, - VirtualMachineSizeTypesStandardB4Ms, - VirtualMachineSizeTypesStandardB8Ms, - VirtualMachineSizeTypesStandardD1, - VirtualMachineSizeTypesStandardD11, - VirtualMachineSizeTypesStandardD11V2, - VirtualMachineSizeTypesStandardD12, - VirtualMachineSizeTypesStandardD12V2, - VirtualMachineSizeTypesStandardD13, - VirtualMachineSizeTypesStandardD13V2, - VirtualMachineSizeTypesStandardD14, - VirtualMachineSizeTypesStandardD14V2, - VirtualMachineSizeTypesStandardD15V2, - VirtualMachineSizeTypesStandardD16SV3, - VirtualMachineSizeTypesStandardD16V3, - VirtualMachineSizeTypesStandardD1V2, - VirtualMachineSizeTypesStandardD2, - VirtualMachineSizeTypesStandardD2SV3, - VirtualMachineSizeTypesStandardD2V2, - VirtualMachineSizeTypesStandardD2V3, - VirtualMachineSizeTypesStandardD3, - VirtualMachineSizeTypesStandardD32SV3, - VirtualMachineSizeTypesStandardD32V3, - VirtualMachineSizeTypesStandardD3V2, - VirtualMachineSizeTypesStandardD4, - VirtualMachineSizeTypesStandardD4SV3, - VirtualMachineSizeTypesStandardD4V2, - VirtualMachineSizeTypesStandardD4V3, - VirtualMachineSizeTypesStandardD5V2, - VirtualMachineSizeTypesStandardD64SV3, - VirtualMachineSizeTypesStandardD64V3, - VirtualMachineSizeTypesStandardD8SV3, - VirtualMachineSizeTypesStandardD8V3, - VirtualMachineSizeTypesStandardDS1, - VirtualMachineSizeTypesStandardDS11, - VirtualMachineSizeTypesStandardDS11V2, - VirtualMachineSizeTypesStandardDS12, - VirtualMachineSizeTypesStandardDS12V2, - VirtualMachineSizeTypesStandardDS13, - VirtualMachineSizeTypesStandardDS132V2, - VirtualMachineSizeTypesStandardDS134V2, - VirtualMachineSizeTypesStandardDS13V2, - VirtualMachineSizeTypesStandardDS14, - VirtualMachineSizeTypesStandardDS144V2, - VirtualMachineSizeTypesStandardDS148V2, - VirtualMachineSizeTypesStandardDS14V2, - VirtualMachineSizeTypesStandardDS15V2, - VirtualMachineSizeTypesStandardDS1V2, - VirtualMachineSizeTypesStandardDS2, - VirtualMachineSizeTypesStandardDS2V2, - VirtualMachineSizeTypesStandardDS3, - VirtualMachineSizeTypesStandardDS3V2, - VirtualMachineSizeTypesStandardDS4, - VirtualMachineSizeTypesStandardDS4V2, - VirtualMachineSizeTypesStandardDS5V2, - VirtualMachineSizeTypesStandardE16SV3, - VirtualMachineSizeTypesStandardE16V3, - VirtualMachineSizeTypesStandardE2SV3, - VirtualMachineSizeTypesStandardE2V3, - VirtualMachineSizeTypesStandardE3216V3, - VirtualMachineSizeTypesStandardE328SV3, - VirtualMachineSizeTypesStandardE32SV3, - VirtualMachineSizeTypesStandardE32V3, - VirtualMachineSizeTypesStandardE4SV3, - VirtualMachineSizeTypesStandardE4V3, - VirtualMachineSizeTypesStandardE6416SV3, - VirtualMachineSizeTypesStandardE6432SV3, - VirtualMachineSizeTypesStandardE64SV3, - VirtualMachineSizeTypesStandardE64V3, - VirtualMachineSizeTypesStandardE8SV3, - VirtualMachineSizeTypesStandardE8V3, - VirtualMachineSizeTypesStandardF1, - VirtualMachineSizeTypesStandardF16, - VirtualMachineSizeTypesStandardF16S, - VirtualMachineSizeTypesStandardF16SV2, - VirtualMachineSizeTypesStandardF1S, - VirtualMachineSizeTypesStandardF2, - VirtualMachineSizeTypesStandardF2S, - VirtualMachineSizeTypesStandardF2SV2, - VirtualMachineSizeTypesStandardF32SV2, - VirtualMachineSizeTypesStandardF4, - VirtualMachineSizeTypesStandardF4S, - VirtualMachineSizeTypesStandardF4SV2, - VirtualMachineSizeTypesStandardF64SV2, - VirtualMachineSizeTypesStandardF72SV2, - VirtualMachineSizeTypesStandardF8, - VirtualMachineSizeTypesStandardF8S, - VirtualMachineSizeTypesStandardF8SV2, - VirtualMachineSizeTypesStandardG1, - VirtualMachineSizeTypesStandardG2, - VirtualMachineSizeTypesStandardG3, - VirtualMachineSizeTypesStandardG4, - VirtualMachineSizeTypesStandardG5, - VirtualMachineSizeTypesStandardGS1, - VirtualMachineSizeTypesStandardGS2, - VirtualMachineSizeTypesStandardGS3, - VirtualMachineSizeTypesStandardGS4, - VirtualMachineSizeTypesStandardGS44, - VirtualMachineSizeTypesStandardGS48, - VirtualMachineSizeTypesStandardGS5, - VirtualMachineSizeTypesStandardGS516, - VirtualMachineSizeTypesStandardGS58, - VirtualMachineSizeTypesStandardH16, - VirtualMachineSizeTypesStandardH16M, - VirtualMachineSizeTypesStandardH16Mr, - VirtualMachineSizeTypesStandardH16R, - VirtualMachineSizeTypesStandardH8, - VirtualMachineSizeTypesStandardH8M, - VirtualMachineSizeTypesStandardL16S, - VirtualMachineSizeTypesStandardL32S, - VirtualMachineSizeTypesStandardL4S, - VirtualMachineSizeTypesStandardL8S, - VirtualMachineSizeTypesStandardM12832Ms, - VirtualMachineSizeTypesStandardM12864Ms, - VirtualMachineSizeTypesStandardM128Ms, - VirtualMachineSizeTypesStandardM128S, - VirtualMachineSizeTypesStandardM6416Ms, - VirtualMachineSizeTypesStandardM6432Ms, - VirtualMachineSizeTypesStandardM64Ms, - VirtualMachineSizeTypesStandardM64S, - VirtualMachineSizeTypesStandardNC12, - VirtualMachineSizeTypesStandardNC12SV2, - VirtualMachineSizeTypesStandardNC12SV3, - VirtualMachineSizeTypesStandardNC24, - VirtualMachineSizeTypesStandardNC24R, - VirtualMachineSizeTypesStandardNC24RsV2, - VirtualMachineSizeTypesStandardNC24RsV3, - VirtualMachineSizeTypesStandardNC24SV2, - VirtualMachineSizeTypesStandardNC24SV3, - VirtualMachineSizeTypesStandardNC6, - VirtualMachineSizeTypesStandardNC6SV2, - VirtualMachineSizeTypesStandardNC6SV3, - VirtualMachineSizeTypesStandardND12S, - VirtualMachineSizeTypesStandardND24Rs, - VirtualMachineSizeTypesStandardND24S, - VirtualMachineSizeTypesStandardND6S, - VirtualMachineSizeTypesStandardNV12, - VirtualMachineSizeTypesStandardNV24, - VirtualMachineSizeTypesStandardNV6, - } -} - -// WindowsPatchAssessmentMode - Specifies the mode of VM Guest patch assessment for the IaaS virtual machine. -// Possible values are: -// ImageDefault - You control the timing of patch assessments on a virtual machine. -// AutomaticByPlatform - The platform will trigger periodic patch assessments. The property provisionVMAgent must be true. -type WindowsPatchAssessmentMode string - -const ( - WindowsPatchAssessmentModeAutomaticByPlatform WindowsPatchAssessmentMode = "AutomaticByPlatform" - WindowsPatchAssessmentModeImageDefault WindowsPatchAssessmentMode = "ImageDefault" -) - -// PossibleWindowsPatchAssessmentModeValues returns the possible values for the WindowsPatchAssessmentMode const type. -func PossibleWindowsPatchAssessmentModeValues() []WindowsPatchAssessmentMode { - return []WindowsPatchAssessmentMode{ - WindowsPatchAssessmentModeAutomaticByPlatform, - WindowsPatchAssessmentModeImageDefault, - } -} - -// WindowsVMGuestPatchAutomaticByPlatformRebootSetting - Specifies the reboot setting for all AutomaticByPlatform patch installation -// operations. -type WindowsVMGuestPatchAutomaticByPlatformRebootSetting string - -const ( - WindowsVMGuestPatchAutomaticByPlatformRebootSettingAlways WindowsVMGuestPatchAutomaticByPlatformRebootSetting = "Always" - WindowsVMGuestPatchAutomaticByPlatformRebootSettingIfRequired WindowsVMGuestPatchAutomaticByPlatformRebootSetting = "IfRequired" - WindowsVMGuestPatchAutomaticByPlatformRebootSettingNever WindowsVMGuestPatchAutomaticByPlatformRebootSetting = "Never" - WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown WindowsVMGuestPatchAutomaticByPlatformRebootSetting = "Unknown" -) - -// PossibleWindowsVMGuestPatchAutomaticByPlatformRebootSettingValues returns the possible values for the WindowsVMGuestPatchAutomaticByPlatformRebootSetting const type. -func PossibleWindowsVMGuestPatchAutomaticByPlatformRebootSettingValues() []WindowsVMGuestPatchAutomaticByPlatformRebootSetting { - return []WindowsVMGuestPatchAutomaticByPlatformRebootSetting{ - WindowsVMGuestPatchAutomaticByPlatformRebootSettingAlways, - WindowsVMGuestPatchAutomaticByPlatformRebootSettingIfRequired, - WindowsVMGuestPatchAutomaticByPlatformRebootSettingNever, - WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown, - } -} - -// WindowsVMGuestPatchMode - Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated -// to virtual machine scale set with OrchestrationMode as Flexible. -// Possible values are: -// Manual - You control the application of patches to a virtual machine. You do this by applying patches manually inside the -// VM. In this mode, automatic updates are disabled; the property -// WindowsConfiguration.enableAutomaticUpdates must be false -// AutomaticByOS - The virtual machine will automatically be updated by the OS. The property WindowsConfiguration.enableAutomaticUpdates -// must be true. -// AutomaticByPlatform - the virtual machine will automatically updated by the platform. The properties provisionVMAgent and -// WindowsConfiguration.enableAutomaticUpdates must be true -type WindowsVMGuestPatchMode string - -const ( - WindowsVMGuestPatchModeAutomaticByOS WindowsVMGuestPatchMode = "AutomaticByOS" - WindowsVMGuestPatchModeAutomaticByPlatform WindowsVMGuestPatchMode = "AutomaticByPlatform" - WindowsVMGuestPatchModeManual WindowsVMGuestPatchMode = "Manual" -) - -// PossibleWindowsVMGuestPatchModeValues returns the possible values for the WindowsVMGuestPatchMode const type. -func PossibleWindowsVMGuestPatchModeValues() []WindowsVMGuestPatchMode { - return []WindowsVMGuestPatchMode{ - WindowsVMGuestPatchModeAutomaticByOS, - WindowsVMGuestPatchModeAutomaticByPlatform, - WindowsVMGuestPatchModeManual, - } -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/dedicatedhostgroups_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/dedicatedhostgroups_client.go deleted file mode 100644 index ae2c4f36671..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/dedicatedhostgroups_client.go +++ /dev/null @@ -1,423 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// DedicatedHostGroupsClient contains the methods for the DedicatedHostGroups group. -// Don't use this type directly, use NewDedicatedHostGroupsClient() instead. -type DedicatedHostGroupsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewDedicatedHostGroupsClient creates a new instance of DedicatedHostGroupsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewDedicatedHostGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DedicatedHostGroupsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &DedicatedHostGroupsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// CreateOrUpdate - Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please -// see Dedicated Host Documentation [https://go.microsoft.com/fwlink/?linkid=2082596] -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - hostGroupName - The name of the dedicated host group. -// - parameters - Parameters supplied to the Create Dedicated Host Group. -// - options - DedicatedHostGroupsClientCreateOrUpdateOptions contains the optional parameters for the DedicatedHostGroupsClient.CreateOrUpdate -// method. -func (client *DedicatedHostGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, hostGroupName string, parameters DedicatedHostGroup, options *DedicatedHostGroupsClientCreateOrUpdateOptions) (DedicatedHostGroupsClientCreateOrUpdateResponse, error) { - var err error - const operationName = "DedicatedHostGroupsClient.CreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, hostGroupName, parameters, options) - if err != nil { - return DedicatedHostGroupsClientCreateOrUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DedicatedHostGroupsClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return DedicatedHostGroupsClientCreateOrUpdateResponse{}, err - } - resp, err := client.createOrUpdateHandleResponse(httpResp) - return resp, err -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DedicatedHostGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, parameters DedicatedHostGroup, options *DedicatedHostGroupsClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if hostGroupName == "" { - return nil, errors.New("parameter hostGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *DedicatedHostGroupsClient) createOrUpdateHandleResponse(resp *http.Response) (DedicatedHostGroupsClientCreateOrUpdateResponse, error) { - result := DedicatedHostGroupsClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DedicatedHostGroup); err != nil { - return DedicatedHostGroupsClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// Delete - Delete a dedicated host group. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - hostGroupName - The name of the dedicated host group. -// - options - DedicatedHostGroupsClientDeleteOptions contains the optional parameters for the DedicatedHostGroupsClient.Delete -// method. -func (client *DedicatedHostGroupsClient) Delete(ctx context.Context, resourceGroupName string, hostGroupName string, options *DedicatedHostGroupsClientDeleteOptions) (DedicatedHostGroupsClientDeleteResponse, error) { - var err error - const operationName = "DedicatedHostGroupsClient.Delete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, hostGroupName, options) - if err != nil { - return DedicatedHostGroupsClientDeleteResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DedicatedHostGroupsClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return DedicatedHostGroupsClientDeleteResponse{}, err - } - return DedicatedHostGroupsClientDeleteResponse{}, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *DedicatedHostGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, options *DedicatedHostGroupsClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if hostGroupName == "" { - return nil, errors.New("parameter hostGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves information about a dedicated host group. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - hostGroupName - The name of the dedicated host group. -// - options - DedicatedHostGroupsClientGetOptions contains the optional parameters for the DedicatedHostGroupsClient.Get method. -func (client *DedicatedHostGroupsClient) Get(ctx context.Context, resourceGroupName string, hostGroupName string, options *DedicatedHostGroupsClientGetOptions) (DedicatedHostGroupsClientGetResponse, error) { - var err error - const operationName = "DedicatedHostGroupsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, hostGroupName, options) - if err != nil { - return DedicatedHostGroupsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DedicatedHostGroupsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return DedicatedHostGroupsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *DedicatedHostGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, options *DedicatedHostGroupsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if hostGroupName == "" { - return nil, errors.New("parameter hostGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *DedicatedHostGroupsClient) getHandleResponse(resp *http.Response) (DedicatedHostGroupsClientGetResponse, error) { - result := DedicatedHostGroupsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DedicatedHostGroup); err != nil { - return DedicatedHostGroupsClientGetResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Lists all of the dedicated host groups in the specified resource group. Use the nextLink -// property in the response to get the next page of dedicated host groups. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - options - DedicatedHostGroupsClientListByResourceGroupOptions contains the optional parameters for the DedicatedHostGroupsClient.NewListByResourceGroupPager -// method. -func (client *DedicatedHostGroupsClient) NewListByResourceGroupPager(resourceGroupName string, options *DedicatedHostGroupsClientListByResourceGroupOptions) *runtime.Pager[DedicatedHostGroupsClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[DedicatedHostGroupsClientListByResourceGroupResponse]{ - More: func(page DedicatedHostGroupsClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DedicatedHostGroupsClientListByResourceGroupResponse) (DedicatedHostGroupsClientListByResourceGroupResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DedicatedHostGroupsClient.NewListByResourceGroupPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - }, nil) - if err != nil { - return DedicatedHostGroupsClientListByResourceGroupResponse{}, err - } - return client.listByResourceGroupHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *DedicatedHostGroupsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *DedicatedHostGroupsClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *DedicatedHostGroupsClient) listByResourceGroupHandleResponse(resp *http.Response) (DedicatedHostGroupsClientListByResourceGroupResponse, error) { - result := DedicatedHostGroupsClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DedicatedHostGroupListResult); err != nil { - return DedicatedHostGroupsClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// NewListBySubscriptionPager - Lists all of the dedicated host groups in the subscription. Use the nextLink property in the -// response to get the next page of dedicated host groups. -// -// Generated from API version 2024-03-01 -// - options - DedicatedHostGroupsClientListBySubscriptionOptions contains the optional parameters for the DedicatedHostGroupsClient.NewListBySubscriptionPager -// method. -func (client *DedicatedHostGroupsClient) NewListBySubscriptionPager(options *DedicatedHostGroupsClientListBySubscriptionOptions) *runtime.Pager[DedicatedHostGroupsClientListBySubscriptionResponse] { - return runtime.NewPager(runtime.PagingHandler[DedicatedHostGroupsClientListBySubscriptionResponse]{ - More: func(page DedicatedHostGroupsClientListBySubscriptionResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DedicatedHostGroupsClientListBySubscriptionResponse) (DedicatedHostGroupsClientListBySubscriptionResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DedicatedHostGroupsClient.NewListBySubscriptionPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listBySubscriptionCreateRequest(ctx, options) - }, nil) - if err != nil { - return DedicatedHostGroupsClientListBySubscriptionResponse{}, err - } - return client.listBySubscriptionHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *DedicatedHostGroupsClient) listBySubscriptionCreateRequest(ctx context.Context, options *DedicatedHostGroupsClientListBySubscriptionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/hostGroups" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listBySubscriptionHandleResponse handles the ListBySubscription response. -func (client *DedicatedHostGroupsClient) listBySubscriptionHandleResponse(resp *http.Response) (DedicatedHostGroupsClientListBySubscriptionResponse, error) { - result := DedicatedHostGroupsClientListBySubscriptionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DedicatedHostGroupListResult); err != nil { - return DedicatedHostGroupsClientListBySubscriptionResponse{}, err - } - return result, nil -} - -// Update - Update an dedicated host group. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - hostGroupName - The name of the dedicated host group. -// - parameters - Parameters supplied to the Update Dedicated Host Group operation. -// - options - DedicatedHostGroupsClientUpdateOptions contains the optional parameters for the DedicatedHostGroupsClient.Update -// method. -func (client *DedicatedHostGroupsClient) Update(ctx context.Context, resourceGroupName string, hostGroupName string, parameters DedicatedHostGroupUpdate, options *DedicatedHostGroupsClientUpdateOptions) (DedicatedHostGroupsClientUpdateResponse, error) { - var err error - const operationName = "DedicatedHostGroupsClient.Update" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, hostGroupName, parameters, options) - if err != nil { - return DedicatedHostGroupsClientUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DedicatedHostGroupsClientUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return DedicatedHostGroupsClientUpdateResponse{}, err - } - resp, err := client.updateHandleResponse(httpResp) - return resp, err -} - -// updateCreateRequest creates the Update request. -func (client *DedicatedHostGroupsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, parameters DedicatedHostGroupUpdate, options *DedicatedHostGroupsClientUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if hostGroupName == "" { - return nil, errors.New("parameter hostGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// updateHandleResponse handles the Update response. -func (client *DedicatedHostGroupsClient) updateHandleResponse(resp *http.Response) (DedicatedHostGroupsClientUpdateResponse, error) { - result := DedicatedHostGroupsClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DedicatedHostGroup); err != nil { - return DedicatedHostGroupsClientUpdateResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/dedicatedhosts_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/dedicatedhosts_client.go deleted file mode 100644 index 66ae1f99bf0..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/dedicatedhosts_client.go +++ /dev/null @@ -1,680 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// DedicatedHostsClient contains the methods for the DedicatedHosts group. -// Don't use this type directly, use NewDedicatedHostsClient() instead. -type DedicatedHostsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewDedicatedHostsClient creates a new instance of DedicatedHostsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewDedicatedHostsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DedicatedHostsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &DedicatedHostsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create or update a dedicated host . -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - hostGroupName - The name of the dedicated host group. -// - hostName - The name of the dedicated host . -// - parameters - Parameters supplied to the Create Dedicated Host. -// - options - DedicatedHostsClientBeginCreateOrUpdateOptions contains the optional parameters for the DedicatedHostsClient.BeginCreateOrUpdate -// method. -func (client *DedicatedHostsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHost, options *DedicatedHostsClientBeginCreateOrUpdateOptions) (*runtime.Poller[DedicatedHostsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, hostGroupName, hostName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DedicatedHostsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DedicatedHostsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Create or update a dedicated host . -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *DedicatedHostsClient) createOrUpdate(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHost, options *DedicatedHostsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "DedicatedHostsClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, hostGroupName, hostName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DedicatedHostsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHost, options *DedicatedHostsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if hostGroupName == "" { - return nil, errors.New("parameter hostGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName)) - if hostName == "" { - return nil, errors.New("parameter hostName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostName}", url.PathEscape(hostName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - Delete a dedicated host. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - hostGroupName - The name of the dedicated host group. -// - hostName - The name of the dedicated host. -// - options - DedicatedHostsClientBeginDeleteOptions contains the optional parameters for the DedicatedHostsClient.BeginDelete -// method. -func (client *DedicatedHostsClient) BeginDelete(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientBeginDeleteOptions) (*runtime.Poller[DedicatedHostsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, hostGroupName, hostName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DedicatedHostsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DedicatedHostsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Delete a dedicated host. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *DedicatedHostsClient) deleteOperation(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "DedicatedHostsClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, hostGroupName, hostName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *DedicatedHostsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if hostGroupName == "" { - return nil, errors.New("parameter hostGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName)) - if hostName == "" { - return nil, errors.New("parameter hostName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostName}", url.PathEscape(hostName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves information about a dedicated host. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - hostGroupName - The name of the dedicated host group. -// - hostName - The name of the dedicated host. -// - options - DedicatedHostsClientGetOptions contains the optional parameters for the DedicatedHostsClient.Get method. -func (client *DedicatedHostsClient) Get(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientGetOptions) (DedicatedHostsClientGetResponse, error) { - var err error - const operationName = "DedicatedHostsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, hostGroupName, hostName, options) - if err != nil { - return DedicatedHostsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DedicatedHostsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return DedicatedHostsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *DedicatedHostsClient) getCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if hostGroupName == "" { - return nil, errors.New("parameter hostGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName)) - if hostName == "" { - return nil, errors.New("parameter hostName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostName}", url.PathEscape(hostName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *DedicatedHostsClient) getHandleResponse(resp *http.Response) (DedicatedHostsClientGetResponse, error) { - result := DedicatedHostsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DedicatedHost); err != nil { - return DedicatedHostsClientGetResponse{}, err - } - return result, nil -} - -// NewListAvailableSizesPager - Lists all available dedicated host sizes to which the specified dedicated host can be resized. -// NOTE: The dedicated host sizes provided can be used to only scale up the existing dedicated host. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - hostGroupName - The name of the dedicated host group. -// - hostName - The name of the dedicated host. -// - options - DedicatedHostsClientListAvailableSizesOptions contains the optional parameters for the DedicatedHostsClient.NewListAvailableSizesPager -// method. -func (client *DedicatedHostsClient) NewListAvailableSizesPager(resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientListAvailableSizesOptions) *runtime.Pager[DedicatedHostsClientListAvailableSizesResponse] { - return runtime.NewPager(runtime.PagingHandler[DedicatedHostsClientListAvailableSizesResponse]{ - More: func(page DedicatedHostsClientListAvailableSizesResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *DedicatedHostsClientListAvailableSizesResponse) (DedicatedHostsClientListAvailableSizesResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DedicatedHostsClient.NewListAvailableSizesPager") - req, err := client.listAvailableSizesCreateRequest(ctx, resourceGroupName, hostGroupName, hostName, options) - if err != nil { - return DedicatedHostsClientListAvailableSizesResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DedicatedHostsClientListAvailableSizesResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DedicatedHostsClientListAvailableSizesResponse{}, runtime.NewResponseError(resp) - } - return client.listAvailableSizesHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listAvailableSizesCreateRequest creates the ListAvailableSizes request. -func (client *DedicatedHostsClient) listAvailableSizesCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientListAvailableSizesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}/hostSizes" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if hostGroupName == "" { - return nil, errors.New("parameter hostGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName)) - if hostName == "" { - return nil, errors.New("parameter hostName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostName}", url.PathEscape(hostName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAvailableSizesHandleResponse handles the ListAvailableSizes response. -func (client *DedicatedHostsClient) listAvailableSizesHandleResponse(resp *http.Response) (DedicatedHostsClientListAvailableSizesResponse, error) { - result := DedicatedHostsClientListAvailableSizesResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DedicatedHostSizeListResult); err != nil { - return DedicatedHostsClientListAvailableSizesResponse{}, err - } - return result, nil -} - -// NewListByHostGroupPager - Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property -// in the response to get the next page of dedicated hosts. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - hostGroupName - The name of the dedicated host group. -// - options - DedicatedHostsClientListByHostGroupOptions contains the optional parameters for the DedicatedHostsClient.NewListByHostGroupPager -// method. -func (client *DedicatedHostsClient) NewListByHostGroupPager(resourceGroupName string, hostGroupName string, options *DedicatedHostsClientListByHostGroupOptions) *runtime.Pager[DedicatedHostsClientListByHostGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[DedicatedHostsClientListByHostGroupResponse]{ - More: func(page DedicatedHostsClientListByHostGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DedicatedHostsClientListByHostGroupResponse) (DedicatedHostsClientListByHostGroupResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DedicatedHostsClient.NewListByHostGroupPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByHostGroupCreateRequest(ctx, resourceGroupName, hostGroupName, options) - }, nil) - if err != nil { - return DedicatedHostsClientListByHostGroupResponse{}, err - } - return client.listByHostGroupHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByHostGroupCreateRequest creates the ListByHostGroup request. -func (client *DedicatedHostsClient) listByHostGroupCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, options *DedicatedHostsClientListByHostGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if hostGroupName == "" { - return nil, errors.New("parameter hostGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByHostGroupHandleResponse handles the ListByHostGroup response. -func (client *DedicatedHostsClient) listByHostGroupHandleResponse(resp *http.Response) (DedicatedHostsClientListByHostGroupResponse, error) { - result := DedicatedHostsClientListByHostGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DedicatedHostListResult); err != nil { - return DedicatedHostsClientListByHostGroupResponse{}, err - } - return result, nil -} - -// BeginRedeploy - Redeploy the dedicated host. The operation will complete successfully once the dedicated host has migrated -// to a new node and is running. To determine the health of VMs deployed on the dedicated host -// after the redeploy check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview -// for more details. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - hostGroupName - The name of the dedicated host group. -// - hostName - The name of the dedicated host. -// - options - DedicatedHostsClientBeginRedeployOptions contains the optional parameters for the DedicatedHostsClient.BeginRedeploy -// method. -func (client *DedicatedHostsClient) BeginRedeploy(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientBeginRedeployOptions) (*runtime.Poller[DedicatedHostsClientRedeployResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.redeploy(ctx, resourceGroupName, hostGroupName, hostName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DedicatedHostsClientRedeployResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DedicatedHostsClientRedeployResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Redeploy - Redeploy the dedicated host. The operation will complete successfully once the dedicated host has migrated to -// a new node and is running. To determine the health of VMs deployed on the dedicated host -// after the redeploy check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview -// for more details. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *DedicatedHostsClient) redeploy(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientBeginRedeployOptions) (*http.Response, error) { - var err error - const operationName = "DedicatedHostsClient.BeginRedeploy" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.redeployCreateRequest(ctx, resourceGroupName, hostGroupName, hostName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// redeployCreateRequest creates the Redeploy request. -func (client *DedicatedHostsClient) redeployCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientBeginRedeployOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}/redeploy" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if hostGroupName == "" { - return nil, errors.New("parameter hostGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName)) - if hostName == "" { - return nil, errors.New("parameter hostName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostName}", url.PathEscape(hostName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginRestart - Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted -// and is running. To determine the health of VMs deployed on the dedicated host after the -// restart check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview -// for more details. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - hostGroupName - The name of the dedicated host group. -// - hostName - The name of the dedicated host. -// - options - DedicatedHostsClientBeginRestartOptions contains the optional parameters for the DedicatedHostsClient.BeginRestart -// method. -func (client *DedicatedHostsClient) BeginRestart(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientBeginRestartOptions) (*runtime.Poller[DedicatedHostsClientRestartResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.restart(ctx, resourceGroupName, hostGroupName, hostName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DedicatedHostsClientRestartResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DedicatedHostsClientRestartResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Restart - Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and -// is running. To determine the health of VMs deployed on the dedicated host after the -// restart check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview -// for more details. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *DedicatedHostsClient) restart(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientBeginRestartOptions) (*http.Response, error) { - var err error - const operationName = "DedicatedHostsClient.BeginRestart" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.restartCreateRequest(ctx, resourceGroupName, hostGroupName, hostName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// restartCreateRequest creates the Restart request. -func (client *DedicatedHostsClient) restartCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientBeginRestartOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}/restart" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if hostGroupName == "" { - return nil, errors.New("parameter hostGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName)) - if hostName == "" { - return nil, errors.New("parameter hostName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostName}", url.PathEscape(hostName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginUpdate - Update a dedicated host . -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - hostGroupName - The name of the dedicated host group. -// - hostName - The name of the dedicated host . -// - parameters - Parameters supplied to the Update Dedicated Host operation. -// - options - DedicatedHostsClientBeginUpdateOptions contains the optional parameters for the DedicatedHostsClient.BeginUpdate -// method. -func (client *DedicatedHostsClient) BeginUpdate(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHostUpdate, options *DedicatedHostsClientBeginUpdateOptions) (*runtime.Poller[DedicatedHostsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, hostGroupName, hostName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DedicatedHostsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DedicatedHostsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Update a dedicated host . -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *DedicatedHostsClient) update(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHostUpdate, options *DedicatedHostsClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "DedicatedHostsClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, hostGroupName, hostName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *DedicatedHostsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHostUpdate, options *DedicatedHostsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if hostGroupName == "" { - return nil, errors.New("parameter hostGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName)) - if hostName == "" { - return nil, errors.New("parameter hostName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{hostName}", url.PathEscape(hostName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/diskaccesses_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/diskaccesses_client.go deleted file mode 100644 index 0bea05f3e37..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/diskaccesses_client.go +++ /dev/null @@ -1,846 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// DiskAccessesClient contains the methods for the DiskAccesses group. -// Don't use this type directly, use NewDiskAccessesClient() instead. -type DiskAccessesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewDiskAccessesClient creates a new instance of DiskAccessesClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewDiskAccessesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DiskAccessesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &DiskAccessesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a disk access resource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - diskAccessName - The name of the disk access resource that is being created. The name can't be changed after the disk encryption -// set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The -// maximum name length is 80 characters. -// - diskAccess - disk access object supplied in the body of the Put disk access operation. -// - options - DiskAccessesClientBeginCreateOrUpdateOptions contains the optional parameters for the DiskAccessesClient.BeginCreateOrUpdate -// method. -func (client *DiskAccessesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess DiskAccess, options *DiskAccessesClientBeginCreateOrUpdateOptions) (*runtime.Poller[DiskAccessesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, diskAccessName, diskAccess, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DiskAccessesClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DiskAccessesClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Creates or updates a disk access resource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *DiskAccessesClient) createOrUpdate(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess DiskAccess, options *DiskAccessesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "DiskAccessesClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, diskAccessName, diskAccess, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DiskAccessesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess DiskAccess, options *DiskAccessesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskAccessName == "" { - return nil, errors.New("parameter diskAccessName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskAccessName}", url.PathEscape(diskAccessName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, diskAccess); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - Deletes a disk access resource. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - diskAccessName - The name of the disk access resource that is being created. The name can't be changed after the disk encryption -// set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The -// maximum name length is 80 characters. -// - options - DiskAccessesClientBeginDeleteOptions contains the optional parameters for the DiskAccessesClient.BeginDelete -// method. -func (client *DiskAccessesClient) BeginDelete(ctx context.Context, resourceGroupName string, diskAccessName string, options *DiskAccessesClientBeginDeleteOptions) (*runtime.Poller[DiskAccessesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, diskAccessName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DiskAccessesClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DiskAccessesClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Deletes a disk access resource. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *DiskAccessesClient) deleteOperation(ctx context.Context, resourceGroupName string, diskAccessName string, options *DiskAccessesClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "DiskAccessesClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, diskAccessName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *DiskAccessesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, diskAccessName string, options *DiskAccessesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskAccessName == "" { - return nil, errors.New("parameter diskAccessName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskAccessName}", url.PathEscape(diskAccessName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginDeleteAPrivateEndpointConnection - Deletes a private endpoint connection under a disk access resource. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - diskAccessName - The name of the disk access resource that is being created. The name can't be changed after the disk encryption -// set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The -// maximum name length is 80 characters. -// - privateEndpointConnectionName - The name of the private endpoint connection. -// - options - DiskAccessesClientBeginDeleteAPrivateEndpointConnectionOptions contains the optional parameters for the DiskAccessesClient.BeginDeleteAPrivateEndpointConnection -// method. -func (client *DiskAccessesClient) BeginDeleteAPrivateEndpointConnection(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, options *DiskAccessesClientBeginDeleteAPrivateEndpointConnectionOptions) (*runtime.Poller[DiskAccessesClientDeleteAPrivateEndpointConnectionResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteAPrivateEndpointConnection(ctx, resourceGroupName, diskAccessName, privateEndpointConnectionName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DiskAccessesClientDeleteAPrivateEndpointConnectionResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DiskAccessesClientDeleteAPrivateEndpointConnectionResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// DeleteAPrivateEndpointConnection - Deletes a private endpoint connection under a disk access resource. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *DiskAccessesClient) deleteAPrivateEndpointConnection(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, options *DiskAccessesClientBeginDeleteAPrivateEndpointConnectionOptions) (*http.Response, error) { - var err error - const operationName = "DiskAccessesClient.BeginDeleteAPrivateEndpointConnection" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteAPrivateEndpointConnectionCreateRequest(ctx, resourceGroupName, diskAccessName, privateEndpointConnectionName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteAPrivateEndpointConnectionCreateRequest creates the DeleteAPrivateEndpointConnection request. -func (client *DiskAccessesClient) deleteAPrivateEndpointConnectionCreateRequest(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, options *DiskAccessesClientBeginDeleteAPrivateEndpointConnectionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskAccessName == "" { - return nil, errors.New("parameter diskAccessName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskAccessName}", url.PathEscape(diskAccessName)) - if privateEndpointConnectionName == "" { - return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets information about a disk access resource. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - diskAccessName - The name of the disk access resource that is being created. The name can't be changed after the disk encryption -// set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The -// maximum name length is 80 characters. -// - options - DiskAccessesClientGetOptions contains the optional parameters for the DiskAccessesClient.Get method. -func (client *DiskAccessesClient) Get(ctx context.Context, resourceGroupName string, diskAccessName string, options *DiskAccessesClientGetOptions) (DiskAccessesClientGetResponse, error) { - var err error - const operationName = "DiskAccessesClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, diskAccessName, options) - if err != nil { - return DiskAccessesClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DiskAccessesClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return DiskAccessesClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *DiskAccessesClient) getCreateRequest(ctx context.Context, resourceGroupName string, diskAccessName string, options *DiskAccessesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskAccessName == "" { - return nil, errors.New("parameter diskAccessName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskAccessName}", url.PathEscape(diskAccessName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *DiskAccessesClient) getHandleResponse(resp *http.Response) (DiskAccessesClientGetResponse, error) { - result := DiskAccessesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DiskAccess); err != nil { - return DiskAccessesClientGetResponse{}, err - } - return result, nil -} - -// GetAPrivateEndpointConnection - Gets information about a private endpoint connection under a disk access resource. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - diskAccessName - The name of the disk access resource that is being created. The name can't be changed after the disk encryption -// set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The -// maximum name length is 80 characters. -// - privateEndpointConnectionName - The name of the private endpoint connection. -// - options - DiskAccessesClientGetAPrivateEndpointConnectionOptions contains the optional parameters for the DiskAccessesClient.GetAPrivateEndpointConnection -// method. -func (client *DiskAccessesClient) GetAPrivateEndpointConnection(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, options *DiskAccessesClientGetAPrivateEndpointConnectionOptions) (DiskAccessesClientGetAPrivateEndpointConnectionResponse, error) { - var err error - const operationName = "DiskAccessesClient.GetAPrivateEndpointConnection" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getAPrivateEndpointConnectionCreateRequest(ctx, resourceGroupName, diskAccessName, privateEndpointConnectionName, options) - if err != nil { - return DiskAccessesClientGetAPrivateEndpointConnectionResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DiskAccessesClientGetAPrivateEndpointConnectionResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return DiskAccessesClientGetAPrivateEndpointConnectionResponse{}, err - } - resp, err := client.getAPrivateEndpointConnectionHandleResponse(httpResp) - return resp, err -} - -// getAPrivateEndpointConnectionCreateRequest creates the GetAPrivateEndpointConnection request. -func (client *DiskAccessesClient) getAPrivateEndpointConnectionCreateRequest(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, options *DiskAccessesClientGetAPrivateEndpointConnectionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskAccessName == "" { - return nil, errors.New("parameter diskAccessName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskAccessName}", url.PathEscape(diskAccessName)) - if privateEndpointConnectionName == "" { - return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getAPrivateEndpointConnectionHandleResponse handles the GetAPrivateEndpointConnection response. -func (client *DiskAccessesClient) getAPrivateEndpointConnectionHandleResponse(resp *http.Response) (DiskAccessesClientGetAPrivateEndpointConnectionResponse, error) { - result := DiskAccessesClientGetAPrivateEndpointConnectionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnection); err != nil { - return DiskAccessesClientGetAPrivateEndpointConnectionResponse{}, err - } - return result, nil -} - -// GetPrivateLinkResources - Gets the private link resources possible under disk access resource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - diskAccessName - The name of the disk access resource that is being created. The name can't be changed after the disk encryption -// set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The -// maximum name length is 80 characters. -// - options - DiskAccessesClientGetPrivateLinkResourcesOptions contains the optional parameters for the DiskAccessesClient.GetPrivateLinkResources -// method. -func (client *DiskAccessesClient) GetPrivateLinkResources(ctx context.Context, resourceGroupName string, diskAccessName string, options *DiskAccessesClientGetPrivateLinkResourcesOptions) (DiskAccessesClientGetPrivateLinkResourcesResponse, error) { - var err error - const operationName = "DiskAccessesClient.GetPrivateLinkResources" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getPrivateLinkResourcesCreateRequest(ctx, resourceGroupName, diskAccessName, options) - if err != nil { - return DiskAccessesClientGetPrivateLinkResourcesResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DiskAccessesClientGetPrivateLinkResourcesResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return DiskAccessesClientGetPrivateLinkResourcesResponse{}, err - } - resp, err := client.getPrivateLinkResourcesHandleResponse(httpResp) - return resp, err -} - -// getPrivateLinkResourcesCreateRequest creates the GetPrivateLinkResources request. -func (client *DiskAccessesClient) getPrivateLinkResourcesCreateRequest(ctx context.Context, resourceGroupName string, diskAccessName string, options *DiskAccessesClientGetPrivateLinkResourcesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateLinkResources" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskAccessName == "" { - return nil, errors.New("parameter diskAccessName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskAccessName}", url.PathEscape(diskAccessName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getPrivateLinkResourcesHandleResponse handles the GetPrivateLinkResources response. -func (client *DiskAccessesClient) getPrivateLinkResourcesHandleResponse(resp *http.Response) (DiskAccessesClientGetPrivateLinkResourcesResponse, error) { - result := DiskAccessesClientGetPrivateLinkResourcesResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PrivateLinkResourceListResult); err != nil { - return DiskAccessesClientGetPrivateLinkResourcesResponse{}, err - } - return result, nil -} - -// NewListPager - Lists all the disk access resources under a subscription. -// -// Generated from API version 2023-10-02 -// - options - DiskAccessesClientListOptions contains the optional parameters for the DiskAccessesClient.NewListPager method. -func (client *DiskAccessesClient) NewListPager(options *DiskAccessesClientListOptions) *runtime.Pager[DiskAccessesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[DiskAccessesClientListResponse]{ - More: func(page DiskAccessesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DiskAccessesClientListResponse) (DiskAccessesClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DiskAccessesClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, options) - }, nil) - if err != nil { - return DiskAccessesClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *DiskAccessesClient) listCreateRequest(ctx context.Context, options *DiskAccessesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/diskAccesses" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *DiskAccessesClient) listHandleResponse(resp *http.Response) (DiskAccessesClientListResponse, error) { - result := DiskAccessesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DiskAccessList); err != nil { - return DiskAccessesClientListResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Lists all the disk access resources under a resource group. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - options - DiskAccessesClientListByResourceGroupOptions contains the optional parameters for the DiskAccessesClient.NewListByResourceGroupPager -// method. -func (client *DiskAccessesClient) NewListByResourceGroupPager(resourceGroupName string, options *DiskAccessesClientListByResourceGroupOptions) *runtime.Pager[DiskAccessesClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[DiskAccessesClientListByResourceGroupResponse]{ - More: func(page DiskAccessesClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DiskAccessesClientListByResourceGroupResponse) (DiskAccessesClientListByResourceGroupResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DiskAccessesClient.NewListByResourceGroupPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - }, nil) - if err != nil { - return DiskAccessesClientListByResourceGroupResponse{}, err - } - return client.listByResourceGroupHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *DiskAccessesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *DiskAccessesClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *DiskAccessesClient) listByResourceGroupHandleResponse(resp *http.Response) (DiskAccessesClientListByResourceGroupResponse, error) { - result := DiskAccessesClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DiskAccessList); err != nil { - return DiskAccessesClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// NewListPrivateEndpointConnectionsPager - List information about private endpoint connections under a disk access resource -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - diskAccessName - The name of the disk access resource that is being created. The name can't be changed after the disk encryption -// set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The -// maximum name length is 80 characters. -// - options - DiskAccessesClientListPrivateEndpointConnectionsOptions contains the optional parameters for the DiskAccessesClient.NewListPrivateEndpointConnectionsPager -// method. -func (client *DiskAccessesClient) NewListPrivateEndpointConnectionsPager(resourceGroupName string, diskAccessName string, options *DiskAccessesClientListPrivateEndpointConnectionsOptions) *runtime.Pager[DiskAccessesClientListPrivateEndpointConnectionsResponse] { - return runtime.NewPager(runtime.PagingHandler[DiskAccessesClientListPrivateEndpointConnectionsResponse]{ - More: func(page DiskAccessesClientListPrivateEndpointConnectionsResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DiskAccessesClientListPrivateEndpointConnectionsResponse) (DiskAccessesClientListPrivateEndpointConnectionsResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DiskAccessesClient.NewListPrivateEndpointConnectionsPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listPrivateEndpointConnectionsCreateRequest(ctx, resourceGroupName, diskAccessName, options) - }, nil) - if err != nil { - return DiskAccessesClientListPrivateEndpointConnectionsResponse{}, err - } - return client.listPrivateEndpointConnectionsHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listPrivateEndpointConnectionsCreateRequest creates the ListPrivateEndpointConnections request. -func (client *DiskAccessesClient) listPrivateEndpointConnectionsCreateRequest(ctx context.Context, resourceGroupName string, diskAccessName string, options *DiskAccessesClientListPrivateEndpointConnectionsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskAccessName == "" { - return nil, errors.New("parameter diskAccessName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskAccessName}", url.PathEscape(diskAccessName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listPrivateEndpointConnectionsHandleResponse handles the ListPrivateEndpointConnections response. -func (client *DiskAccessesClient) listPrivateEndpointConnectionsHandleResponse(resp *http.Response) (DiskAccessesClientListPrivateEndpointConnectionsResponse, error) { - result := DiskAccessesClientListPrivateEndpointConnectionsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionListResult); err != nil { - return DiskAccessesClientListPrivateEndpointConnectionsResponse{}, err - } - return result, nil -} - -// BeginUpdate - Updates (patches) a disk access resource. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - diskAccessName - The name of the disk access resource that is being created. The name can't be changed after the disk encryption -// set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The -// maximum name length is 80 characters. -// - diskAccess - disk access object supplied in the body of the Patch disk access operation. -// - options - DiskAccessesClientBeginUpdateOptions contains the optional parameters for the DiskAccessesClient.BeginUpdate -// method. -func (client *DiskAccessesClient) BeginUpdate(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess DiskAccessUpdate, options *DiskAccessesClientBeginUpdateOptions) (*runtime.Poller[DiskAccessesClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, diskAccessName, diskAccess, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DiskAccessesClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DiskAccessesClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Updates (patches) a disk access resource. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *DiskAccessesClient) update(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess DiskAccessUpdate, options *DiskAccessesClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "DiskAccessesClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, diskAccessName, diskAccess, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *DiskAccessesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess DiskAccessUpdate, options *DiskAccessesClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskAccessName == "" { - return nil, errors.New("parameter diskAccessName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskAccessName}", url.PathEscape(diskAccessName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, diskAccess); err != nil { - return nil, err - } - return req, nil -} - -// BeginUpdateAPrivateEndpointConnection - Approve or reject a private endpoint connection under disk access resource, this -// can't be used to create a new private endpoint connection. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - diskAccessName - The name of the disk access resource that is being created. The name can't be changed after the disk encryption -// set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The -// maximum name length is 80 characters. -// - privateEndpointConnectionName - The name of the private endpoint connection. -// - privateEndpointConnection - private endpoint connection object supplied in the body of the Put private endpoint connection -// operation. -// - options - DiskAccessesClientBeginUpdateAPrivateEndpointConnectionOptions contains the optional parameters for the DiskAccessesClient.BeginUpdateAPrivateEndpointConnection -// method. -func (client *DiskAccessesClient) BeginUpdateAPrivateEndpointConnection(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection, options *DiskAccessesClientBeginUpdateAPrivateEndpointConnectionOptions) (*runtime.Poller[DiskAccessesClientUpdateAPrivateEndpointConnectionResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.updateAPrivateEndpointConnection(ctx, resourceGroupName, diskAccessName, privateEndpointConnectionName, privateEndpointConnection, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DiskAccessesClientUpdateAPrivateEndpointConnectionResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DiskAccessesClientUpdateAPrivateEndpointConnectionResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// UpdateAPrivateEndpointConnection - Approve or reject a private endpoint connection under disk access resource, this can't -// be used to create a new private endpoint connection. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *DiskAccessesClient) updateAPrivateEndpointConnection(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection, options *DiskAccessesClientBeginUpdateAPrivateEndpointConnectionOptions) (*http.Response, error) { - var err error - const operationName = "DiskAccessesClient.BeginUpdateAPrivateEndpointConnection" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateAPrivateEndpointConnectionCreateRequest(ctx, resourceGroupName, diskAccessName, privateEndpointConnectionName, privateEndpointConnection, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateAPrivateEndpointConnectionCreateRequest creates the UpdateAPrivateEndpointConnection request. -func (client *DiskAccessesClient) updateAPrivateEndpointConnectionCreateRequest(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection, options *DiskAccessesClientBeginUpdateAPrivateEndpointConnectionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskAccessName == "" { - return nil, errors.New("parameter diskAccessName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskAccessName}", url.PathEscape(diskAccessName)) - if privateEndpointConnectionName == "" { - return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, privateEndpointConnection); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/diskencryptionsets_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/diskencryptionsets_client.go deleted file mode 100644 index 59d34d1e2d9..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/diskencryptionsets_client.go +++ /dev/null @@ -1,535 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// DiskEncryptionSetsClient contains the methods for the DiskEncryptionSets group. -// Don't use this type directly, use NewDiskEncryptionSetsClient() instead. -type DiskEncryptionSetsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewDiskEncryptionSetsClient creates a new instance of DiskEncryptionSetsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewDiskEncryptionSetsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DiskEncryptionSetsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &DiskEncryptionSetsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a disk encryption set -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - diskEncryptionSetName - The name of the disk encryption set that is being created. The name can't be changed after the -// disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum -// name length is 80 characters. -// - diskEncryptionSet - disk encryption set object supplied in the body of the Put disk encryption set operation. -// - options - DiskEncryptionSetsClientBeginCreateOrUpdateOptions contains the optional parameters for the DiskEncryptionSetsClient.BeginCreateOrUpdate -// method. -func (client *DiskEncryptionSetsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSet, options *DiskEncryptionSetsClientBeginCreateOrUpdateOptions) (*runtime.Poller[DiskEncryptionSetsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, diskEncryptionSetName, diskEncryptionSet, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DiskEncryptionSetsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DiskEncryptionSetsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Creates or updates a disk encryption set -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *DiskEncryptionSetsClient) createOrUpdate(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSet, options *DiskEncryptionSetsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "DiskEncryptionSetsClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, diskEncryptionSetName, diskEncryptionSet, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DiskEncryptionSetsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSet, options *DiskEncryptionSetsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskEncryptionSetName == "" { - return nil, errors.New("parameter diskEncryptionSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskEncryptionSetName}", url.PathEscape(diskEncryptionSetName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, diskEncryptionSet); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - Deletes a disk encryption set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - diskEncryptionSetName - The name of the disk encryption set that is being created. The name can't be changed after the -// disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum -// name length is 80 characters. -// - options - DiskEncryptionSetsClientBeginDeleteOptions contains the optional parameters for the DiskEncryptionSetsClient.BeginDelete -// method. -func (client *DiskEncryptionSetsClient) BeginDelete(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, options *DiskEncryptionSetsClientBeginDeleteOptions) (*runtime.Poller[DiskEncryptionSetsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, diskEncryptionSetName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DiskEncryptionSetsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DiskEncryptionSetsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Deletes a disk encryption set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *DiskEncryptionSetsClient) deleteOperation(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, options *DiskEncryptionSetsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "DiskEncryptionSetsClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, diskEncryptionSetName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *DiskEncryptionSetsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, options *DiskEncryptionSetsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskEncryptionSetName == "" { - return nil, errors.New("parameter diskEncryptionSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskEncryptionSetName}", url.PathEscape(diskEncryptionSetName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets information about a disk encryption set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - diskEncryptionSetName - The name of the disk encryption set that is being created. The name can't be changed after the -// disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum -// name length is 80 characters. -// - options - DiskEncryptionSetsClientGetOptions contains the optional parameters for the DiskEncryptionSetsClient.Get method. -func (client *DiskEncryptionSetsClient) Get(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, options *DiskEncryptionSetsClientGetOptions) (DiskEncryptionSetsClientGetResponse, error) { - var err error - const operationName = "DiskEncryptionSetsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, diskEncryptionSetName, options) - if err != nil { - return DiskEncryptionSetsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DiskEncryptionSetsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return DiskEncryptionSetsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *DiskEncryptionSetsClient) getCreateRequest(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, options *DiskEncryptionSetsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskEncryptionSetName == "" { - return nil, errors.New("parameter diskEncryptionSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskEncryptionSetName}", url.PathEscape(diskEncryptionSetName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *DiskEncryptionSetsClient) getHandleResponse(resp *http.Response) (DiskEncryptionSetsClientGetResponse, error) { - result := DiskEncryptionSetsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DiskEncryptionSet); err != nil { - return DiskEncryptionSetsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Lists all the disk encryption sets under a subscription. -// -// Generated from API version 2023-10-02 -// - options - DiskEncryptionSetsClientListOptions contains the optional parameters for the DiskEncryptionSetsClient.NewListPager -// method. -func (client *DiskEncryptionSetsClient) NewListPager(options *DiskEncryptionSetsClientListOptions) *runtime.Pager[DiskEncryptionSetsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[DiskEncryptionSetsClientListResponse]{ - More: func(page DiskEncryptionSetsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DiskEncryptionSetsClientListResponse) (DiskEncryptionSetsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DiskEncryptionSetsClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, options) - }, nil) - if err != nil { - return DiskEncryptionSetsClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *DiskEncryptionSetsClient) listCreateRequest(ctx context.Context, options *DiskEncryptionSetsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/diskEncryptionSets" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *DiskEncryptionSetsClient) listHandleResponse(resp *http.Response) (DiskEncryptionSetsClientListResponse, error) { - result := DiskEncryptionSetsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DiskEncryptionSetList); err != nil { - return DiskEncryptionSetsClientListResponse{}, err - } - return result, nil -} - -// NewListAssociatedResourcesPager - Lists all resources that are encrypted with this disk encryption set. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - diskEncryptionSetName - The name of the disk encryption set that is being created. The name can't be changed after the -// disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum -// name length is 80 characters. -// - options - DiskEncryptionSetsClientListAssociatedResourcesOptions contains the optional parameters for the DiskEncryptionSetsClient.NewListAssociatedResourcesPager -// method. -func (client *DiskEncryptionSetsClient) NewListAssociatedResourcesPager(resourceGroupName string, diskEncryptionSetName string, options *DiskEncryptionSetsClientListAssociatedResourcesOptions) *runtime.Pager[DiskEncryptionSetsClientListAssociatedResourcesResponse] { - return runtime.NewPager(runtime.PagingHandler[DiskEncryptionSetsClientListAssociatedResourcesResponse]{ - More: func(page DiskEncryptionSetsClientListAssociatedResourcesResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DiskEncryptionSetsClientListAssociatedResourcesResponse) (DiskEncryptionSetsClientListAssociatedResourcesResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DiskEncryptionSetsClient.NewListAssociatedResourcesPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listAssociatedResourcesCreateRequest(ctx, resourceGroupName, diskEncryptionSetName, options) - }, nil) - if err != nil { - return DiskEncryptionSetsClientListAssociatedResourcesResponse{}, err - } - return client.listAssociatedResourcesHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listAssociatedResourcesCreateRequest creates the ListAssociatedResources request. -func (client *DiskEncryptionSetsClient) listAssociatedResourcesCreateRequest(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, options *DiskEncryptionSetsClientListAssociatedResourcesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}/associatedResources" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskEncryptionSetName == "" { - return nil, errors.New("parameter diskEncryptionSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskEncryptionSetName}", url.PathEscape(diskEncryptionSetName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAssociatedResourcesHandleResponse handles the ListAssociatedResources response. -func (client *DiskEncryptionSetsClient) listAssociatedResourcesHandleResponse(resp *http.Response) (DiskEncryptionSetsClientListAssociatedResourcesResponse, error) { - result := DiskEncryptionSetsClientListAssociatedResourcesResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ResourceURIList); err != nil { - return DiskEncryptionSetsClientListAssociatedResourcesResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Lists all the disk encryption sets under a resource group. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - options - DiskEncryptionSetsClientListByResourceGroupOptions contains the optional parameters for the DiskEncryptionSetsClient.NewListByResourceGroupPager -// method. -func (client *DiskEncryptionSetsClient) NewListByResourceGroupPager(resourceGroupName string, options *DiskEncryptionSetsClientListByResourceGroupOptions) *runtime.Pager[DiskEncryptionSetsClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[DiskEncryptionSetsClientListByResourceGroupResponse]{ - More: func(page DiskEncryptionSetsClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DiskEncryptionSetsClientListByResourceGroupResponse) (DiskEncryptionSetsClientListByResourceGroupResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DiskEncryptionSetsClient.NewListByResourceGroupPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - }, nil) - if err != nil { - return DiskEncryptionSetsClientListByResourceGroupResponse{}, err - } - return client.listByResourceGroupHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *DiskEncryptionSetsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *DiskEncryptionSetsClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *DiskEncryptionSetsClient) listByResourceGroupHandleResponse(resp *http.Response) (DiskEncryptionSetsClientListByResourceGroupResponse, error) { - result := DiskEncryptionSetsClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DiskEncryptionSetList); err != nil { - return DiskEncryptionSetsClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// BeginUpdate - Updates (patches) a disk encryption set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - diskEncryptionSetName - The name of the disk encryption set that is being created. The name can't be changed after the -// disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum -// name length is 80 characters. -// - diskEncryptionSet - disk encryption set object supplied in the body of the Patch disk encryption set operation. -// - options - DiskEncryptionSetsClientBeginUpdateOptions contains the optional parameters for the DiskEncryptionSetsClient.BeginUpdate -// method. -func (client *DiskEncryptionSetsClient) BeginUpdate(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSetUpdate, options *DiskEncryptionSetsClientBeginUpdateOptions) (*runtime.Poller[DiskEncryptionSetsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, diskEncryptionSetName, diskEncryptionSet, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DiskEncryptionSetsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DiskEncryptionSetsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Updates (patches) a disk encryption set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *DiskEncryptionSetsClient) update(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSetUpdate, options *DiskEncryptionSetsClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "DiskEncryptionSetsClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, diskEncryptionSetName, diskEncryptionSet, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *DiskEncryptionSetsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSetUpdate, options *DiskEncryptionSetsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskEncryptionSetName == "" { - return nil, errors.New("parameter diskEncryptionSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskEncryptionSetName}", url.PathEscape(diskEncryptionSetName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, diskEncryptionSet); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/diskrestorepoint_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/diskrestorepoint_client.go deleted file mode 100644 index 43307ca0493..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/diskrestorepoint_client.go +++ /dev/null @@ -1,367 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// DiskRestorePointClient contains the methods for the DiskRestorePoint group. -// Don't use this type directly, use NewDiskRestorePointClient() instead. -type DiskRestorePointClient struct { - internal *arm.Client - subscriptionID string -} - -// NewDiskRestorePointClient creates a new instance of DiskRestorePointClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewDiskRestorePointClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DiskRestorePointClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &DiskRestorePointClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Get - Get disk restorePoint resource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - restorePointCollectionName - The name of the restore point collection that the disk restore point belongs. -// - vmRestorePointName - The name of the vm restore point that the disk disk restore point belongs. -// - diskRestorePointName - The name of the disk restore point created. -// - options - DiskRestorePointClientGetOptions contains the optional parameters for the DiskRestorePointClient.Get method. -func (client *DiskRestorePointClient) Get(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, diskRestorePointName string, options *DiskRestorePointClientGetOptions) (DiskRestorePointClientGetResponse, error) { - var err error - const operationName = "DiskRestorePointClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, options) - if err != nil { - return DiskRestorePointClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DiskRestorePointClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return DiskRestorePointClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *DiskRestorePointClient) getCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, diskRestorePointName string, options *DiskRestorePointClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if restorePointCollectionName == "" { - return nil, errors.New("parameter restorePointCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName)) - if vmRestorePointName == "" { - return nil, errors.New("parameter vmRestorePointName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmRestorePointName}", url.PathEscape(vmRestorePointName)) - if diskRestorePointName == "" { - return nil, errors.New("parameter diskRestorePointName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskRestorePointName}", url.PathEscape(diskRestorePointName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *DiskRestorePointClient) getHandleResponse(resp *http.Response) (DiskRestorePointClientGetResponse, error) { - result := DiskRestorePointClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DiskRestorePoint); err != nil { - return DiskRestorePointClientGetResponse{}, err - } - return result, nil -} - -// BeginGrantAccess - Grants access to a diskRestorePoint. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - restorePointCollectionName - The name of the restore point collection that the disk restore point belongs. -// - vmRestorePointName - The name of the vm restore point that the disk disk restore point belongs. -// - diskRestorePointName - The name of the disk restore point created. -// - grantAccessData - Access data object supplied in the body of the get disk access operation. -// - options - DiskRestorePointClientBeginGrantAccessOptions contains the optional parameters for the DiskRestorePointClient.BeginGrantAccess -// method. -func (client *DiskRestorePointClient) BeginGrantAccess(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, diskRestorePointName string, grantAccessData GrantAccessData, options *DiskRestorePointClientBeginGrantAccessOptions) (*runtime.Poller[DiskRestorePointClientGrantAccessResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.grantAccess(ctx, resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, grantAccessData, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DiskRestorePointClientGrantAccessResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DiskRestorePointClientGrantAccessResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// GrantAccess - Grants access to a diskRestorePoint. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *DiskRestorePointClient) grantAccess(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, diskRestorePointName string, grantAccessData GrantAccessData, options *DiskRestorePointClientBeginGrantAccessOptions) (*http.Response, error) { - var err error - const operationName = "DiskRestorePointClient.BeginGrantAccess" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.grantAccessCreateRequest(ctx, resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, grantAccessData, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// grantAccessCreateRequest creates the GrantAccess request. -func (client *DiskRestorePointClient) grantAccessCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, diskRestorePointName string, grantAccessData GrantAccessData, options *DiskRestorePointClientBeginGrantAccessOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}/beginGetAccess" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if restorePointCollectionName == "" { - return nil, errors.New("parameter restorePointCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName)) - if vmRestorePointName == "" { - return nil, errors.New("parameter vmRestorePointName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmRestorePointName}", url.PathEscape(vmRestorePointName)) - if diskRestorePointName == "" { - return nil, errors.New("parameter diskRestorePointName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskRestorePointName}", url.PathEscape(diskRestorePointName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, grantAccessData); err != nil { - return nil, err - } - return req, nil -} - -// NewListByRestorePointPager - Lists diskRestorePoints under a vmRestorePoint. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - restorePointCollectionName - The name of the restore point collection that the disk restore point belongs. -// - vmRestorePointName - The name of the vm restore point that the disk disk restore point belongs. -// - options - DiskRestorePointClientListByRestorePointOptions contains the optional parameters for the DiskRestorePointClient.NewListByRestorePointPager -// method. -func (client *DiskRestorePointClient) NewListByRestorePointPager(resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, options *DiskRestorePointClientListByRestorePointOptions) *runtime.Pager[DiskRestorePointClientListByRestorePointResponse] { - return runtime.NewPager(runtime.PagingHandler[DiskRestorePointClientListByRestorePointResponse]{ - More: func(page DiskRestorePointClientListByRestorePointResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DiskRestorePointClientListByRestorePointResponse) (DiskRestorePointClientListByRestorePointResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DiskRestorePointClient.NewListByRestorePointPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByRestorePointCreateRequest(ctx, resourceGroupName, restorePointCollectionName, vmRestorePointName, options) - }, nil) - if err != nil { - return DiskRestorePointClientListByRestorePointResponse{}, err - } - return client.listByRestorePointHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByRestorePointCreateRequest creates the ListByRestorePoint request. -func (client *DiskRestorePointClient) listByRestorePointCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, options *DiskRestorePointClientListByRestorePointOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if restorePointCollectionName == "" { - return nil, errors.New("parameter restorePointCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName)) - if vmRestorePointName == "" { - return nil, errors.New("parameter vmRestorePointName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmRestorePointName}", url.PathEscape(vmRestorePointName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByRestorePointHandleResponse handles the ListByRestorePoint response. -func (client *DiskRestorePointClient) listByRestorePointHandleResponse(resp *http.Response) (DiskRestorePointClientListByRestorePointResponse, error) { - result := DiskRestorePointClientListByRestorePointResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DiskRestorePointList); err != nil { - return DiskRestorePointClientListByRestorePointResponse{}, err - } - return result, nil -} - -// BeginRevokeAccess - Revokes access to a diskRestorePoint. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - restorePointCollectionName - The name of the restore point collection that the disk restore point belongs. -// - vmRestorePointName - The name of the vm restore point that the disk disk restore point belongs. -// - diskRestorePointName - The name of the disk restore point created. -// - options - DiskRestorePointClientBeginRevokeAccessOptions contains the optional parameters for the DiskRestorePointClient.BeginRevokeAccess -// method. -func (client *DiskRestorePointClient) BeginRevokeAccess(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, diskRestorePointName string, options *DiskRestorePointClientBeginRevokeAccessOptions) (*runtime.Poller[DiskRestorePointClientRevokeAccessResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.revokeAccess(ctx, resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DiskRestorePointClientRevokeAccessResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DiskRestorePointClientRevokeAccessResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// RevokeAccess - Revokes access to a diskRestorePoint. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *DiskRestorePointClient) revokeAccess(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, diskRestorePointName string, options *DiskRestorePointClientBeginRevokeAccessOptions) (*http.Response, error) { - var err error - const operationName = "DiskRestorePointClient.BeginRevokeAccess" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.revokeAccessCreateRequest(ctx, resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// revokeAccessCreateRequest creates the RevokeAccess request. -func (client *DiskRestorePointClient) revokeAccessCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, diskRestorePointName string, options *DiskRestorePointClientBeginRevokeAccessOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}/endGetAccess" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if restorePointCollectionName == "" { - return nil, errors.New("parameter restorePointCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName)) - if vmRestorePointName == "" { - return nil, errors.New("parameter vmRestorePointName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmRestorePointName}", url.PathEscape(vmRestorePointName)) - if diskRestorePointName == "" { - return nil, errors.New("parameter diskRestorePointName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskRestorePointName}", url.PathEscape(diskRestorePointName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/disks_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/disks_client.go deleted file mode 100644 index a0ffa752bc9..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/disks_client.go +++ /dev/null @@ -1,623 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// DisksClient contains the methods for the Disks group. -// Don't use this type directly, use NewDisksClient() instead. -type DisksClient struct { - internal *arm.Client - subscriptionID string -} - -// NewDisksClient creates a new instance of DisksClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewDisksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DisksClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &DisksClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a disk. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - diskName - The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported -// characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 -// characters. -// - disk - Disk object supplied in the body of the Put disk operation. -// - options - DisksClientBeginCreateOrUpdateOptions contains the optional parameters for the DisksClient.BeginCreateOrUpdate -// method. -func (client *DisksClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, diskName string, disk Disk, options *DisksClientBeginCreateOrUpdateOptions) (*runtime.Poller[DisksClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, diskName, disk, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DisksClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DisksClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Creates or updates a disk. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *DisksClient) createOrUpdate(ctx context.Context, resourceGroupName string, diskName string, disk Disk, options *DisksClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "DisksClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, diskName, disk, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DisksClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, diskName string, disk Disk, options *DisksClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskName == "" { - return nil, errors.New("parameter diskName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskName}", url.PathEscape(diskName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, disk); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - Deletes a disk. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - diskName - The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported -// characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 -// characters. -// - options - DisksClientBeginDeleteOptions contains the optional parameters for the DisksClient.BeginDelete method. -func (client *DisksClient) BeginDelete(ctx context.Context, resourceGroupName string, diskName string, options *DisksClientBeginDeleteOptions) (*runtime.Poller[DisksClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, diskName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DisksClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DisksClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Deletes a disk. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *DisksClient) deleteOperation(ctx context.Context, resourceGroupName string, diskName string, options *DisksClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "DisksClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, diskName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *DisksClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, diskName string, options *DisksClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskName == "" { - return nil, errors.New("parameter diskName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskName}", url.PathEscape(diskName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - return req, nil -} - -// Get - Gets information about a disk. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - diskName - The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported -// characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 -// characters. -// - options - DisksClientGetOptions contains the optional parameters for the DisksClient.Get method. -func (client *DisksClient) Get(ctx context.Context, resourceGroupName string, diskName string, options *DisksClientGetOptions) (DisksClientGetResponse, error) { - var err error - const operationName = "DisksClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, diskName, options) - if err != nil { - return DisksClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DisksClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return DisksClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *DisksClient) getCreateRequest(ctx context.Context, resourceGroupName string, diskName string, options *DisksClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskName == "" { - return nil, errors.New("parameter diskName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskName}", url.PathEscape(diskName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *DisksClient) getHandleResponse(resp *http.Response) (DisksClientGetResponse, error) { - result := DisksClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Disk); err != nil { - return DisksClientGetResponse{}, err - } - return result, nil -} - -// BeginGrantAccess - Grants access to a disk. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - diskName - The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported -// characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 -// characters. -// - grantAccessData - Access data object supplied in the body of the get disk access operation. -// - options - DisksClientBeginGrantAccessOptions contains the optional parameters for the DisksClient.BeginGrantAccess method. -func (client *DisksClient) BeginGrantAccess(ctx context.Context, resourceGroupName string, diskName string, grantAccessData GrantAccessData, options *DisksClientBeginGrantAccessOptions) (*runtime.Poller[DisksClientGrantAccessResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.grantAccess(ctx, resourceGroupName, diskName, grantAccessData, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DisksClientGrantAccessResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DisksClientGrantAccessResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// GrantAccess - Grants access to a disk. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *DisksClient) grantAccess(ctx context.Context, resourceGroupName string, diskName string, grantAccessData GrantAccessData, options *DisksClientBeginGrantAccessOptions) (*http.Response, error) { - var err error - const operationName = "DisksClient.BeginGrantAccess" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.grantAccessCreateRequest(ctx, resourceGroupName, diskName, grantAccessData, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// grantAccessCreateRequest creates the GrantAccess request. -func (client *DisksClient) grantAccessCreateRequest(ctx context.Context, resourceGroupName string, diskName string, grantAccessData GrantAccessData, options *DisksClientBeginGrantAccessOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskName == "" { - return nil, errors.New("parameter diskName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskName}", url.PathEscape(diskName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, grantAccessData); err != nil { - return nil, err - } - return req, nil -} - -// NewListPager - Lists all the disks under a subscription. -// -// Generated from API version 2023-10-02 -// - options - DisksClientListOptions contains the optional parameters for the DisksClient.NewListPager method. -func (client *DisksClient) NewListPager(options *DisksClientListOptions) *runtime.Pager[DisksClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[DisksClientListResponse]{ - More: func(page DisksClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DisksClientListResponse) (DisksClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DisksClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, options) - }, nil) - if err != nil { - return DisksClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *DisksClient) listCreateRequest(ctx context.Context, options *DisksClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/disks" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *DisksClient) listHandleResponse(resp *http.Response) (DisksClientListResponse, error) { - result := DisksClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DiskList); err != nil { - return DisksClientListResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Lists all the disks under a resource group. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - options - DisksClientListByResourceGroupOptions contains the optional parameters for the DisksClient.NewListByResourceGroupPager -// method. -func (client *DisksClient) NewListByResourceGroupPager(resourceGroupName string, options *DisksClientListByResourceGroupOptions) *runtime.Pager[DisksClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[DisksClientListByResourceGroupResponse]{ - More: func(page DisksClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DisksClientListByResourceGroupResponse) (DisksClientListByResourceGroupResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DisksClient.NewListByResourceGroupPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - }, nil) - if err != nil { - return DisksClientListByResourceGroupResponse{}, err - } - return client.listByResourceGroupHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *DisksClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *DisksClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *DisksClient) listByResourceGroupHandleResponse(resp *http.Response) (DisksClientListByResourceGroupResponse, error) { - result := DisksClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DiskList); err != nil { - return DisksClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// BeginRevokeAccess - Revokes access to a disk. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - diskName - The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported -// characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 -// characters. -// - options - DisksClientBeginRevokeAccessOptions contains the optional parameters for the DisksClient.BeginRevokeAccess method. -func (client *DisksClient) BeginRevokeAccess(ctx context.Context, resourceGroupName string, diskName string, options *DisksClientBeginRevokeAccessOptions) (*runtime.Poller[DisksClientRevokeAccessResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.revokeAccess(ctx, resourceGroupName, diskName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DisksClientRevokeAccessResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DisksClientRevokeAccessResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// RevokeAccess - Revokes access to a disk. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *DisksClient) revokeAccess(ctx context.Context, resourceGroupName string, diskName string, options *DisksClientBeginRevokeAccessOptions) (*http.Response, error) { - var err error - const operationName = "DisksClient.BeginRevokeAccess" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.revokeAccessCreateRequest(ctx, resourceGroupName, diskName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// revokeAccessCreateRequest creates the RevokeAccess request. -func (client *DisksClient) revokeAccessCreateRequest(ctx context.Context, resourceGroupName string, diskName string, options *DisksClientBeginRevokeAccessOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/endGetAccess" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskName == "" { - return nil, errors.New("parameter diskName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskName}", url.PathEscape(diskName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - return req, nil -} - -// BeginUpdate - Updates (patches) a disk. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - diskName - The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported -// characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 -// characters. -// - disk - Disk object supplied in the body of the Patch disk operation. -// - options - DisksClientBeginUpdateOptions contains the optional parameters for the DisksClient.BeginUpdate method. -func (client *DisksClient) BeginUpdate(ctx context.Context, resourceGroupName string, diskName string, disk DiskUpdate, options *DisksClientBeginUpdateOptions) (*runtime.Poller[DisksClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, diskName, disk, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DisksClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DisksClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Updates (patches) a disk. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *DisksClient) update(ctx context.Context, resourceGroupName string, diskName string, disk DiskUpdate, options *DisksClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "DisksClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, diskName, disk, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *DisksClient) updateCreateRequest(ctx context.Context, resourceGroupName string, diskName string, disk DiskUpdate, options *DisksClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if diskName == "" { - return nil, errors.New("parameter diskName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{diskName}", url.PathEscape(diskName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, disk); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleries_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleries_client.go deleted file mode 100644 index f24e730a63f..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleries_client.go +++ /dev/null @@ -1,465 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// GalleriesClient contains the methods for the Galleries group. -// Don't use this type directly, use NewGalleriesClient() instead. -type GalleriesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewGalleriesClient creates a new instance of GalleriesClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewGalleriesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GalleriesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &GalleriesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create or update a Shared Image Gallery. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with dots and periods -// allowed in the middle. The maximum length is 80 characters. -// - gallery - Parameters supplied to the create or update Shared Image Gallery operation. -// - options - GalleriesClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleriesClient.BeginCreateOrUpdate -// method. -func (client *GalleriesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, gallery Gallery, options *GalleriesClientBeginCreateOrUpdateOptions) (*runtime.Poller[GalleriesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, galleryName, gallery, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleriesClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleriesClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Create or update a Shared Image Gallery. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -func (client *GalleriesClient) createOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, gallery Gallery, options *GalleriesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "GalleriesClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, galleryName, gallery, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *GalleriesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, gallery Gallery, options *GalleriesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, gallery); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - Delete a Shared Image Gallery. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Shared Image Gallery to be deleted. -// - options - GalleriesClientBeginDeleteOptions contains the optional parameters for the GalleriesClient.BeginDelete method. -func (client *GalleriesClient) BeginDelete(ctx context.Context, resourceGroupName string, galleryName string, options *GalleriesClientBeginDeleteOptions) (*runtime.Poller[GalleriesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, galleryName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleriesClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleriesClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Delete a Shared Image Gallery. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -func (client *GalleriesClient) deleteOperation(ctx context.Context, resourceGroupName string, galleryName string, options *GalleriesClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "GalleriesClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, galleryName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *GalleriesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, options *GalleriesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves information about a Shared Image Gallery. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Shared Image Gallery. -// - options - GalleriesClientGetOptions contains the optional parameters for the GalleriesClient.Get method. -func (client *GalleriesClient) Get(ctx context.Context, resourceGroupName string, galleryName string, options *GalleriesClientGetOptions) (GalleriesClientGetResponse, error) { - var err error - const operationName = "GalleriesClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, galleryName, options) - if err != nil { - return GalleriesClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return GalleriesClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return GalleriesClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *GalleriesClient) getCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, options *GalleriesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - if options != nil && options.Select != nil { - reqQP.Set("$select", string(*options.Select)) - } - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *GalleriesClient) getHandleResponse(resp *http.Response) (GalleriesClientGetResponse, error) { - result := GalleriesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Gallery); err != nil { - return GalleriesClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - List galleries under a subscription. -// -// Generated from API version 2023-07-03 -// - options - GalleriesClientListOptions contains the optional parameters for the GalleriesClient.NewListPager method. -func (client *GalleriesClient) NewListPager(options *GalleriesClientListOptions) *runtime.Pager[GalleriesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[GalleriesClientListResponse]{ - More: func(page GalleriesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *GalleriesClientListResponse) (GalleriesClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "GalleriesClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, options) - }, nil) - if err != nil { - return GalleriesClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *GalleriesClient) listCreateRequest(ctx context.Context, options *GalleriesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/galleries" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *GalleriesClient) listHandleResponse(resp *http.Response) (GalleriesClientListResponse, error) { - result := GalleriesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GalleryList); err != nil { - return GalleriesClientListResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - List galleries under a resource group. -// -// Generated from API version 2023-07-03 -// - resourceGroupName - The name of the resource group. -// - options - GalleriesClientListByResourceGroupOptions contains the optional parameters for the GalleriesClient.NewListByResourceGroupPager -// method. -func (client *GalleriesClient) NewListByResourceGroupPager(resourceGroupName string, options *GalleriesClientListByResourceGroupOptions) *runtime.Pager[GalleriesClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[GalleriesClientListByResourceGroupResponse]{ - More: func(page GalleriesClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *GalleriesClientListByResourceGroupResponse) (GalleriesClientListByResourceGroupResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "GalleriesClient.NewListByResourceGroupPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - }, nil) - if err != nil { - return GalleriesClientListByResourceGroupResponse{}, err - } - return client.listByResourceGroupHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *GalleriesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *GalleriesClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *GalleriesClient) listByResourceGroupHandleResponse(resp *http.Response) (GalleriesClientListByResourceGroupResponse, error) { - result := GalleriesClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GalleryList); err != nil { - return GalleriesClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// BeginUpdate - Update a Shared Image Gallery. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with dots and periods -// allowed in the middle. The maximum length is 80 characters. -// - gallery - Parameters supplied to the update Shared Image Gallery operation. -// - options - GalleriesClientBeginUpdateOptions contains the optional parameters for the GalleriesClient.BeginUpdate method. -func (client *GalleriesClient) BeginUpdate(ctx context.Context, resourceGroupName string, galleryName string, gallery GalleryUpdate, options *GalleriesClientBeginUpdateOptions) (*runtime.Poller[GalleriesClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, galleryName, gallery, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleriesClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleriesClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Update a Shared Image Gallery. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -func (client *GalleriesClient) update(ctx context.Context, resourceGroupName string, galleryName string, gallery GalleryUpdate, options *GalleriesClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "GalleriesClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, galleryName, gallery, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *GalleriesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, gallery GalleryUpdate, options *GalleriesClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, gallery); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryapplications_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryapplications_client.go deleted file mode 100644 index cd5d6f3ecfe..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryapplications_client.go +++ /dev/null @@ -1,434 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// GalleryApplicationsClient contains the methods for the GalleryApplications group. -// Don't use this type directly, use NewGalleryApplicationsClient() instead. -type GalleryApplicationsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewGalleryApplicationsClient creates a new instance of GalleryApplicationsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewGalleryApplicationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GalleryApplicationsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &GalleryApplicationsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create or update a gallery Application Definition. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Shared Application Gallery in which the Application Definition is to be created. -// - galleryApplicationName - The name of the gallery Application Definition to be created or updated. The allowed characters -// are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 -// characters. -// - galleryApplication - Parameters supplied to the create or update gallery Application operation. -// - options - GalleryApplicationsClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryApplicationsClient.BeginCreateOrUpdate -// method. -func (client *GalleryApplicationsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplication, options *GalleryApplicationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[GalleryApplicationsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplication, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryApplicationsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryApplicationsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Create or update a gallery Application Definition. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -func (client *GalleryApplicationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplication, options *GalleryApplicationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "GalleryApplicationsClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplication, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *GalleryApplicationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplication, options *GalleryApplicationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryApplicationName == "" { - return nil, errors.New("parameter galleryApplicationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationName}", url.PathEscape(galleryApplicationName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, galleryApplication); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - Delete a gallery Application. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Shared Application Gallery in which the Application Definition is to be deleted. -// - galleryApplicationName - The name of the gallery Application Definition to be deleted. -// - options - GalleryApplicationsClientBeginDeleteOptions contains the optional parameters for the GalleryApplicationsClient.BeginDelete -// method. -func (client *GalleryApplicationsClient) BeginDelete(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, options *GalleryApplicationsClientBeginDeleteOptions) (*runtime.Poller[GalleryApplicationsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, galleryName, galleryApplicationName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryApplicationsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryApplicationsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Delete a gallery Application. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -func (client *GalleryApplicationsClient) deleteOperation(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, options *GalleryApplicationsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "GalleryApplicationsClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *GalleryApplicationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, options *GalleryApplicationsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryApplicationName == "" { - return nil, errors.New("parameter galleryApplicationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationName}", url.PathEscape(galleryApplicationName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves information about a gallery Application Definition. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Shared Application Gallery from which the Application Definitions are to be retrieved. -// - galleryApplicationName - The name of the gallery Application Definition to be retrieved. -// - options - GalleryApplicationsClientGetOptions contains the optional parameters for the GalleryApplicationsClient.Get method. -func (client *GalleryApplicationsClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, options *GalleryApplicationsClientGetOptions) (GalleryApplicationsClientGetResponse, error) { - var err error - const operationName = "GalleryApplicationsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, options) - if err != nil { - return GalleryApplicationsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return GalleryApplicationsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return GalleryApplicationsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *GalleryApplicationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, options *GalleryApplicationsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryApplicationName == "" { - return nil, errors.New("parameter galleryApplicationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationName}", url.PathEscape(galleryApplicationName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *GalleryApplicationsClient) getHandleResponse(resp *http.Response) (GalleryApplicationsClientGetResponse, error) { - result := GalleryApplicationsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GalleryApplication); err != nil { - return GalleryApplicationsClientGetResponse{}, err - } - return result, nil -} - -// NewListByGalleryPager - List gallery Application Definitions in a gallery. -// -// Generated from API version 2023-07-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Shared Application Gallery from which Application Definitions are to be listed. -// - options - GalleryApplicationsClientListByGalleryOptions contains the optional parameters for the GalleryApplicationsClient.NewListByGalleryPager -// method. -func (client *GalleryApplicationsClient) NewListByGalleryPager(resourceGroupName string, galleryName string, options *GalleryApplicationsClientListByGalleryOptions) *runtime.Pager[GalleryApplicationsClientListByGalleryResponse] { - return runtime.NewPager(runtime.PagingHandler[GalleryApplicationsClientListByGalleryResponse]{ - More: func(page GalleryApplicationsClientListByGalleryResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *GalleryApplicationsClientListByGalleryResponse) (GalleryApplicationsClientListByGalleryResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "GalleryApplicationsClient.NewListByGalleryPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByGalleryCreateRequest(ctx, resourceGroupName, galleryName, options) - }, nil) - if err != nil { - return GalleryApplicationsClientListByGalleryResponse{}, err - } - return client.listByGalleryHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByGalleryCreateRequest creates the ListByGallery request. -func (client *GalleryApplicationsClient) listByGalleryCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, options *GalleryApplicationsClientListByGalleryOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByGalleryHandleResponse handles the ListByGallery response. -func (client *GalleryApplicationsClient) listByGalleryHandleResponse(resp *http.Response) (GalleryApplicationsClientListByGalleryResponse, error) { - result := GalleryApplicationsClientListByGalleryResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GalleryApplicationList); err != nil { - return GalleryApplicationsClientListByGalleryResponse{}, err - } - return result, nil -} - -// BeginUpdate - Update a gallery Application Definition. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Shared Application Gallery in which the Application Definition is to be updated. -// - galleryApplicationName - The name of the gallery Application Definition to be updated. The allowed characters are alphabets -// and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 -// characters. -// - galleryApplication - Parameters supplied to the update gallery Application operation. -// - options - GalleryApplicationsClientBeginUpdateOptions contains the optional parameters for the GalleryApplicationsClient.BeginUpdate -// method. -func (client *GalleryApplicationsClient) BeginUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplicationUpdate, options *GalleryApplicationsClientBeginUpdateOptions) (*runtime.Poller[GalleryApplicationsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplication, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryApplicationsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryApplicationsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Update a gallery Application Definition. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -func (client *GalleryApplicationsClient) update(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplicationUpdate, options *GalleryApplicationsClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "GalleryApplicationsClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplication, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *GalleryApplicationsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplicationUpdate, options *GalleryApplicationsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryApplicationName == "" { - return nil, errors.New("parameter galleryApplicationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationName}", url.PathEscape(galleryApplicationName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, galleryApplication); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryapplicationversions_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryapplicationversions_client.go deleted file mode 100644 index 06571af3d46..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryapplicationversions_client.go +++ /dev/null @@ -1,464 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// GalleryApplicationVersionsClient contains the methods for the GalleryApplicationVersions group. -// Don't use this type directly, use NewGalleryApplicationVersionsClient() instead. -type GalleryApplicationVersionsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewGalleryApplicationVersionsClient creates a new instance of GalleryApplicationVersionsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewGalleryApplicationVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GalleryApplicationVersionsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &GalleryApplicationVersionsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create or update a gallery Application Version. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Shared Application Gallery in which the Application Definition resides. -// - galleryApplicationName - The name of the gallery Application Definition in which the Application Version is to be created. -// - galleryApplicationVersionName - The name of the gallery Application Version to be created. Needs to follow semantic version -// name pattern: The allowed characters are digit and period. Digits must be within the range of a 32-bit -// integer. Format: .. -// - galleryApplicationVersion - Parameters supplied to the create or update gallery Application Version operation. -// - options - GalleryApplicationVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryApplicationVersionsClient.BeginCreateOrUpdate -// method. -func (client *GalleryApplicationVersionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersion, options *GalleryApplicationVersionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[GalleryApplicationVersionsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryApplicationVersionsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryApplicationVersionsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Create or update a gallery Application Version. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -func (client *GalleryApplicationVersionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersion, options *GalleryApplicationVersionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "GalleryApplicationVersionsClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *GalleryApplicationVersionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersion, options *GalleryApplicationVersionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryApplicationName == "" { - return nil, errors.New("parameter galleryApplicationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationName}", url.PathEscape(galleryApplicationName)) - if galleryApplicationVersionName == "" { - return nil, errors.New("parameter galleryApplicationVersionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationVersionName}", url.PathEscape(galleryApplicationVersionName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, galleryApplicationVersion); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - Delete a gallery Application Version. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Shared Application Gallery in which the Application Definition resides. -// - galleryApplicationName - The name of the gallery Application Definition in which the Application Version resides. -// - galleryApplicationVersionName - The name of the gallery Application Version to be deleted. -// - options - GalleryApplicationVersionsClientBeginDeleteOptions contains the optional parameters for the GalleryApplicationVersionsClient.BeginDelete -// method. -func (client *GalleryApplicationVersionsClient) BeginDelete(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, options *GalleryApplicationVersionsClientBeginDeleteOptions) (*runtime.Poller[GalleryApplicationVersionsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryApplicationVersionsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryApplicationVersionsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Delete a gallery Application Version. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -func (client *GalleryApplicationVersionsClient) deleteOperation(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, options *GalleryApplicationVersionsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "GalleryApplicationVersionsClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *GalleryApplicationVersionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, options *GalleryApplicationVersionsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryApplicationName == "" { - return nil, errors.New("parameter galleryApplicationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationName}", url.PathEscape(galleryApplicationName)) - if galleryApplicationVersionName == "" { - return nil, errors.New("parameter galleryApplicationVersionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationVersionName}", url.PathEscape(galleryApplicationVersionName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves information about a gallery Application Version. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Shared Application Gallery in which the Application Definition resides. -// - galleryApplicationName - The name of the gallery Application Definition in which the Application Version resides. -// - galleryApplicationVersionName - The name of the gallery Application Version to be retrieved. -// - options - GalleryApplicationVersionsClientGetOptions contains the optional parameters for the GalleryApplicationVersionsClient.Get -// method. -func (client *GalleryApplicationVersionsClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, options *GalleryApplicationVersionsClientGetOptions) (GalleryApplicationVersionsClientGetResponse, error) { - var err error - const operationName = "GalleryApplicationVersionsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, options) - if err != nil { - return GalleryApplicationVersionsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return GalleryApplicationVersionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return GalleryApplicationVersionsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *GalleryApplicationVersionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, options *GalleryApplicationVersionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryApplicationName == "" { - return nil, errors.New("parameter galleryApplicationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationName}", url.PathEscape(galleryApplicationName)) - if galleryApplicationVersionName == "" { - return nil, errors.New("parameter galleryApplicationVersionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationVersionName}", url.PathEscape(galleryApplicationVersionName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *GalleryApplicationVersionsClient) getHandleResponse(resp *http.Response) (GalleryApplicationVersionsClientGetResponse, error) { - result := GalleryApplicationVersionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GalleryApplicationVersion); err != nil { - return GalleryApplicationVersionsClientGetResponse{}, err - } - return result, nil -} - -// NewListByGalleryApplicationPager - List gallery Application Versions in a gallery Application Definition. -// -// Generated from API version 2023-07-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Shared Application Gallery in which the Application Definition resides. -// - galleryApplicationName - The name of the Shared Application Gallery Application Definition from which the Application Versions -// are to be listed. -// - options - GalleryApplicationVersionsClientListByGalleryApplicationOptions contains the optional parameters for the GalleryApplicationVersionsClient.NewListByGalleryApplicationPager -// method. -func (client *GalleryApplicationVersionsClient) NewListByGalleryApplicationPager(resourceGroupName string, galleryName string, galleryApplicationName string, options *GalleryApplicationVersionsClientListByGalleryApplicationOptions) *runtime.Pager[GalleryApplicationVersionsClientListByGalleryApplicationResponse] { - return runtime.NewPager(runtime.PagingHandler[GalleryApplicationVersionsClientListByGalleryApplicationResponse]{ - More: func(page GalleryApplicationVersionsClientListByGalleryApplicationResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *GalleryApplicationVersionsClientListByGalleryApplicationResponse) (GalleryApplicationVersionsClientListByGalleryApplicationResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "GalleryApplicationVersionsClient.NewListByGalleryApplicationPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByGalleryApplicationCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, options) - }, nil) - if err != nil { - return GalleryApplicationVersionsClientListByGalleryApplicationResponse{}, err - } - return client.listByGalleryApplicationHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByGalleryApplicationCreateRequest creates the ListByGalleryApplication request. -func (client *GalleryApplicationVersionsClient) listByGalleryApplicationCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, options *GalleryApplicationVersionsClientListByGalleryApplicationOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryApplicationName == "" { - return nil, errors.New("parameter galleryApplicationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationName}", url.PathEscape(galleryApplicationName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByGalleryApplicationHandleResponse handles the ListByGalleryApplication response. -func (client *GalleryApplicationVersionsClient) listByGalleryApplicationHandleResponse(resp *http.Response) (GalleryApplicationVersionsClientListByGalleryApplicationResponse, error) { - result := GalleryApplicationVersionsClientListByGalleryApplicationResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GalleryApplicationVersionList); err != nil { - return GalleryApplicationVersionsClientListByGalleryApplicationResponse{}, err - } - return result, nil -} - -// BeginUpdate - Update a gallery Application Version. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Shared Application Gallery in which the Application Definition resides. -// - galleryApplicationName - The name of the gallery Application Definition in which the Application Version is to be updated. -// - galleryApplicationVersionName - The name of the gallery Application Version to be updated. Needs to follow semantic version -// name pattern: The allowed characters are digit and period. Digits must be within the range of a 32-bit -// integer. Format: .. -// - galleryApplicationVersion - Parameters supplied to the update gallery Application Version operation. -// - options - GalleryApplicationVersionsClientBeginUpdateOptions contains the optional parameters for the GalleryApplicationVersionsClient.BeginUpdate -// method. -func (client *GalleryApplicationVersionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersionUpdate, options *GalleryApplicationVersionsClientBeginUpdateOptions) (*runtime.Poller[GalleryApplicationVersionsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryApplicationVersionsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryApplicationVersionsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Update a gallery Application Version. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -func (client *GalleryApplicationVersionsClient) update(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersionUpdate, options *GalleryApplicationVersionsClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "GalleryApplicationVersionsClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *GalleryApplicationVersionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersionUpdate, options *GalleryApplicationVersionsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryApplicationName == "" { - return nil, errors.New("parameter galleryApplicationName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationName}", url.PathEscape(galleryApplicationName)) - if galleryApplicationVersionName == "" { - return nil, errors.New("parameter galleryApplicationVersionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationVersionName}", url.PathEscape(galleryApplicationVersionName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, galleryApplicationVersion); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryimages_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryimages_client.go deleted file mode 100644 index 8be1a5784a0..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryimages_client.go +++ /dev/null @@ -1,433 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// GalleryImagesClient contains the methods for the GalleryImages group. -// Don't use this type directly, use NewGalleryImagesClient() instead. -type GalleryImagesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewGalleryImagesClient creates a new instance of GalleryImagesClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewGalleryImagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GalleryImagesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &GalleryImagesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create or update a gallery image definition. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Shared Image Gallery in which the Image Definition is to be created. -// - galleryImageName - The name of the gallery image definition to be created or updated. The allowed characters are alphabets -// and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 -// characters. -// - galleryImage - Parameters supplied to the create or update gallery image operation. -// - options - GalleryImagesClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryImagesClient.BeginCreateOrUpdate -// method. -func (client *GalleryImagesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImage, options *GalleryImagesClientBeginCreateOrUpdateOptions) (*runtime.Poller[GalleryImagesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, galleryName, galleryImageName, galleryImage, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryImagesClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryImagesClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Create or update a gallery image definition. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -func (client *GalleryImagesClient) createOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImage, options *GalleryImagesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "GalleryImagesClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, galleryImage, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *GalleryImagesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImage, options *GalleryImagesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, galleryImage); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - Delete a gallery image. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Shared Image Gallery in which the Image Definition is to be deleted. -// - galleryImageName - The name of the gallery image definition to be deleted. -// - options - GalleryImagesClientBeginDeleteOptions contains the optional parameters for the GalleryImagesClient.BeginDelete -// method. -func (client *GalleryImagesClient) BeginDelete(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, options *GalleryImagesClientBeginDeleteOptions) (*runtime.Poller[GalleryImagesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, galleryName, galleryImageName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryImagesClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryImagesClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Delete a gallery image. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -func (client *GalleryImagesClient) deleteOperation(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, options *GalleryImagesClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "GalleryImagesClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *GalleryImagesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, options *GalleryImagesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves information about a gallery image definition. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Shared Image Gallery from which the Image Definitions are to be retrieved. -// - galleryImageName - The name of the gallery image definition to be retrieved. -// - options - GalleryImagesClientGetOptions contains the optional parameters for the GalleryImagesClient.Get method. -func (client *GalleryImagesClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, options *GalleryImagesClientGetOptions) (GalleryImagesClientGetResponse, error) { - var err error - const operationName = "GalleryImagesClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, options) - if err != nil { - return GalleryImagesClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return GalleryImagesClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return GalleryImagesClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *GalleryImagesClient) getCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, options *GalleryImagesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *GalleryImagesClient) getHandleResponse(resp *http.Response) (GalleryImagesClientGetResponse, error) { - result := GalleryImagesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GalleryImage); err != nil { - return GalleryImagesClientGetResponse{}, err - } - return result, nil -} - -// NewListByGalleryPager - List gallery image definitions in a gallery. -// -// Generated from API version 2023-07-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Shared Image Gallery from which Image Definitions are to be listed. -// - options - GalleryImagesClientListByGalleryOptions contains the optional parameters for the GalleryImagesClient.NewListByGalleryPager -// method. -func (client *GalleryImagesClient) NewListByGalleryPager(resourceGroupName string, galleryName string, options *GalleryImagesClientListByGalleryOptions) *runtime.Pager[GalleryImagesClientListByGalleryResponse] { - return runtime.NewPager(runtime.PagingHandler[GalleryImagesClientListByGalleryResponse]{ - More: func(page GalleryImagesClientListByGalleryResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *GalleryImagesClientListByGalleryResponse) (GalleryImagesClientListByGalleryResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "GalleryImagesClient.NewListByGalleryPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByGalleryCreateRequest(ctx, resourceGroupName, galleryName, options) - }, nil) - if err != nil { - return GalleryImagesClientListByGalleryResponse{}, err - } - return client.listByGalleryHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByGalleryCreateRequest creates the ListByGallery request. -func (client *GalleryImagesClient) listByGalleryCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, options *GalleryImagesClientListByGalleryOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByGalleryHandleResponse handles the ListByGallery response. -func (client *GalleryImagesClient) listByGalleryHandleResponse(resp *http.Response) (GalleryImagesClientListByGalleryResponse, error) { - result := GalleryImagesClientListByGalleryResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GalleryImageList); err != nil { - return GalleryImagesClientListByGalleryResponse{}, err - } - return result, nil -} - -// BeginUpdate - Update a gallery image definition. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Shared Image Gallery in which the Image Definition is to be updated. -// - galleryImageName - The name of the gallery image definition to be updated. The allowed characters are alphabets and numbers -// with dots, dashes, and periods allowed in the middle. The maximum length is 80 characters. -// - galleryImage - Parameters supplied to the update gallery image operation. -// - options - GalleryImagesClientBeginUpdateOptions contains the optional parameters for the GalleryImagesClient.BeginUpdate -// method. -func (client *GalleryImagesClient) BeginUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImageUpdate, options *GalleryImagesClientBeginUpdateOptions) (*runtime.Poller[GalleryImagesClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, galleryName, galleryImageName, galleryImage, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryImagesClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryImagesClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Update a gallery image definition. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -func (client *GalleryImagesClient) update(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImageUpdate, options *GalleryImagesClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "GalleryImagesClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, galleryImage, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *GalleryImagesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImageUpdate, options *GalleryImagesClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, galleryImage); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryimageversions_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryimageversions_client.go deleted file mode 100644 index b16e42ed74a..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryimageversions_client.go +++ /dev/null @@ -1,463 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// GalleryImageVersionsClient contains the methods for the GalleryImageVersions group. -// Don't use this type directly, use NewGalleryImageVersionsClient() instead. -type GalleryImageVersionsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewGalleryImageVersionsClient creates a new instance of GalleryImageVersionsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewGalleryImageVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GalleryImageVersionsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &GalleryImageVersionsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create or update a gallery image version. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Shared Image Gallery in which the Image Definition resides. -// - galleryImageName - The name of the gallery image definition in which the Image Version is to be created. -// - galleryImageVersionName - The name of the gallery image version to be created. Needs to follow semantic version name pattern: -// The allowed characters are digit and period. Digits must be within the range of a 32-bit integer. -// Format: .. -// - galleryImageVersion - Parameters supplied to the create or update gallery image version operation. -// - options - GalleryImageVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryImageVersionsClient.BeginCreateOrUpdate -// method. -func (client *GalleryImageVersionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersion, options *GalleryImageVersionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[GalleryImageVersionsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryImageVersionsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryImageVersionsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Create or update a gallery image version. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -func (client *GalleryImageVersionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersion, options *GalleryImageVersionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "GalleryImageVersionsClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *GalleryImageVersionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersion, options *GalleryImageVersionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - if galleryImageVersionName == "" { - return nil, errors.New("parameter galleryImageVersionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageVersionName}", url.PathEscape(galleryImageVersionName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, galleryImageVersion); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - Delete a gallery image version. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Shared Image Gallery in which the Image Definition resides. -// - galleryImageName - The name of the gallery image definition in which the Image Version resides. -// - galleryImageVersionName - The name of the gallery image version to be deleted. -// - options - GalleryImageVersionsClientBeginDeleteOptions contains the optional parameters for the GalleryImageVersionsClient.BeginDelete -// method. -func (client *GalleryImageVersionsClient) BeginDelete(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, options *GalleryImageVersionsClientBeginDeleteOptions) (*runtime.Poller[GalleryImageVersionsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryImageVersionsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryImageVersionsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Delete a gallery image version. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -func (client *GalleryImageVersionsClient) deleteOperation(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, options *GalleryImageVersionsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "GalleryImageVersionsClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *GalleryImageVersionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, options *GalleryImageVersionsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - if galleryImageVersionName == "" { - return nil, errors.New("parameter galleryImageVersionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageVersionName}", url.PathEscape(galleryImageVersionName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves information about a gallery image version. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Shared Image Gallery in which the Image Definition resides. -// - galleryImageName - The name of the gallery image definition in which the Image Version resides. -// - galleryImageVersionName - The name of the gallery image version to be retrieved. -// - options - GalleryImageVersionsClientGetOptions contains the optional parameters for the GalleryImageVersionsClient.Get -// method. -func (client *GalleryImageVersionsClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, options *GalleryImageVersionsClientGetOptions) (GalleryImageVersionsClientGetResponse, error) { - var err error - const operationName = "GalleryImageVersionsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options) - if err != nil { - return GalleryImageVersionsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return GalleryImageVersionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return GalleryImageVersionsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *GalleryImageVersionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, options *GalleryImageVersionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - if galleryImageVersionName == "" { - return nil, errors.New("parameter galleryImageVersionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageVersionName}", url.PathEscape(galleryImageVersionName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *GalleryImageVersionsClient) getHandleResponse(resp *http.Response) (GalleryImageVersionsClientGetResponse, error) { - result := GalleryImageVersionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GalleryImageVersion); err != nil { - return GalleryImageVersionsClientGetResponse{}, err - } - return result, nil -} - -// NewListByGalleryImagePager - List gallery image versions in a gallery image definition. -// -// Generated from API version 2023-07-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Shared Image Gallery in which the Image Definition resides. -// - galleryImageName - The name of the Shared Image Gallery Image Definition from which the Image Versions are to be listed. -// - options - GalleryImageVersionsClientListByGalleryImageOptions contains the optional parameters for the GalleryImageVersionsClient.NewListByGalleryImagePager -// method. -func (client *GalleryImageVersionsClient) NewListByGalleryImagePager(resourceGroupName string, galleryName string, galleryImageName string, options *GalleryImageVersionsClientListByGalleryImageOptions) *runtime.Pager[GalleryImageVersionsClientListByGalleryImageResponse] { - return runtime.NewPager(runtime.PagingHandler[GalleryImageVersionsClientListByGalleryImageResponse]{ - More: func(page GalleryImageVersionsClientListByGalleryImageResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *GalleryImageVersionsClientListByGalleryImageResponse) (GalleryImageVersionsClientListByGalleryImageResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "GalleryImageVersionsClient.NewListByGalleryImagePager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByGalleryImageCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, options) - }, nil) - if err != nil { - return GalleryImageVersionsClientListByGalleryImageResponse{}, err - } - return client.listByGalleryImageHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByGalleryImageCreateRequest creates the ListByGalleryImage request. -func (client *GalleryImageVersionsClient) listByGalleryImageCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, options *GalleryImageVersionsClientListByGalleryImageOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByGalleryImageHandleResponse handles the ListByGalleryImage response. -func (client *GalleryImageVersionsClient) listByGalleryImageHandleResponse(resp *http.Response) (GalleryImageVersionsClientListByGalleryImageResponse, error) { - result := GalleryImageVersionsClientListByGalleryImageResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GalleryImageVersionList); err != nil { - return GalleryImageVersionsClientListByGalleryImageResponse{}, err - } - return result, nil -} - -// BeginUpdate - Update a gallery image version. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Shared Image Gallery in which the Image Definition resides. -// - galleryImageName - The name of the gallery image definition in which the Image Version is to be updated. -// - galleryImageVersionName - The name of the gallery image version to be updated. Needs to follow semantic version name pattern: -// The allowed characters are digit and period. Digits must be within the range of a 32-bit integer. -// Format: .. -// - galleryImageVersion - Parameters supplied to the update gallery image version operation. -// - options - GalleryImageVersionsClientBeginUpdateOptions contains the optional parameters for the GalleryImageVersionsClient.BeginUpdate -// method. -func (client *GalleryImageVersionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersionUpdate, options *GalleryImageVersionsClientBeginUpdateOptions) (*runtime.Poller[GalleryImageVersionsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryImageVersionsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryImageVersionsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Update a gallery image version. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -func (client *GalleryImageVersionsClient) update(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersionUpdate, options *GalleryImageVersionsClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "GalleryImageVersionsClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *GalleryImageVersionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersionUpdate, options *GalleryImageVersionsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - if galleryImageVersionName == "" { - return nil, errors.New("parameter galleryImageVersionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageVersionName}", url.PathEscape(galleryImageVersionName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, galleryImageVersion); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/gallerysharingprofile_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/gallerysharingprofile_client.go deleted file mode 100644 index 0ccc5ce9fd6..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/gallerysharingprofile_client.go +++ /dev/null @@ -1,125 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// GallerySharingProfileClient contains the methods for the GallerySharingProfile group. -// Don't use this type directly, use NewGallerySharingProfileClient() instead. -type GallerySharingProfileClient struct { - internal *arm.Client - subscriptionID string -} - -// NewGallerySharingProfileClient creates a new instance of GallerySharingProfileClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewGallerySharingProfileClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GallerySharingProfileClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &GallerySharingProfileClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginUpdate - Update sharing profile of a gallery. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Shared Image Gallery. -// - sharingUpdate - Parameters supplied to the update gallery sharing profile. -// - options - GallerySharingProfileClientBeginUpdateOptions contains the optional parameters for the GallerySharingProfileClient.BeginUpdate -// method. -func (client *GallerySharingProfileClient) BeginUpdate(ctx context.Context, resourceGroupName string, galleryName string, sharingUpdate SharingUpdate, options *GallerySharingProfileClientBeginUpdateOptions) (*runtime.Poller[GallerySharingProfileClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, galleryName, sharingUpdate, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GallerySharingProfileClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GallerySharingProfileClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Update sharing profile of a gallery. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -func (client *GallerySharingProfileClient) update(ctx context.Context, resourceGroupName string, galleryName string, sharingUpdate SharingUpdate, options *GallerySharingProfileClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "GallerySharingProfileClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, galleryName, sharingUpdate, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *GallerySharingProfileClient) updateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, sharingUpdate SharingUpdate, options *GallerySharingProfileClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/share" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, sharingUpdate); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/images_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/images_client.go deleted file mode 100644 index 5fecdbf1d7c..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/images_client.go +++ /dev/null @@ -1,462 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ImagesClient contains the methods for the Images group. -// Don't use this type directly, use NewImagesClient() instead. -type ImagesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewImagesClient creates a new instance of ImagesClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewImagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ImagesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &ImagesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create or update an image. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - imageName - The name of the image. -// - parameters - Parameters supplied to the Create Image operation. -// - options - ImagesClientBeginCreateOrUpdateOptions contains the optional parameters for the ImagesClient.BeginCreateOrUpdate -// method. -func (client *ImagesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, imageName string, parameters Image, options *ImagesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ImagesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, imageName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ImagesClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ImagesClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Create or update an image. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *ImagesClient) createOrUpdate(ctx context.Context, resourceGroupName string, imageName string, parameters Image, options *ImagesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "ImagesClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, imageName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ImagesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, imageName string, parameters Image, options *ImagesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if imageName == "" { - return nil, errors.New("parameter imageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{imageName}", url.PathEscape(imageName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - Deletes an Image. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - imageName - The name of the image. -// - options - ImagesClientBeginDeleteOptions contains the optional parameters for the ImagesClient.BeginDelete method. -func (client *ImagesClient) BeginDelete(ctx context.Context, resourceGroupName string, imageName string, options *ImagesClientBeginDeleteOptions) (*runtime.Poller[ImagesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, imageName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ImagesClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ImagesClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Deletes an Image. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *ImagesClient) deleteOperation(ctx context.Context, resourceGroupName string, imageName string, options *ImagesClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "ImagesClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, imageName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *ImagesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, imageName string, options *ImagesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if imageName == "" { - return nil, errors.New("parameter imageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{imageName}", url.PathEscape(imageName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets an image. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - imageName - The name of the image. -// - options - ImagesClientGetOptions contains the optional parameters for the ImagesClient.Get method. -func (client *ImagesClient) Get(ctx context.Context, resourceGroupName string, imageName string, options *ImagesClientGetOptions) (ImagesClientGetResponse, error) { - var err error - const operationName = "ImagesClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, imageName, options) - if err != nil { - return ImagesClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ImagesClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return ImagesClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *ImagesClient) getCreateRequest(ctx context.Context, resourceGroupName string, imageName string, options *ImagesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if imageName == "" { - return nil, errors.New("parameter imageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{imageName}", url.PathEscape(imageName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ImagesClient) getHandleResponse(resp *http.Response) (ImagesClientGetResponse, error) { - result := ImagesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Image); err != nil { - return ImagesClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets the list of Images in the subscription. Use nextLink property in the response to get the next page -// of Images. Do this till nextLink is null to fetch all the Images. -// -// Generated from API version 2024-03-01 -// - options - ImagesClientListOptions contains the optional parameters for the ImagesClient.NewListPager method. -func (client *ImagesClient) NewListPager(options *ImagesClientListOptions) *runtime.Pager[ImagesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ImagesClientListResponse]{ - More: func(page ImagesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ImagesClientListResponse) (ImagesClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ImagesClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, options) - }, nil) - if err != nil { - return ImagesClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *ImagesClient) listCreateRequest(ctx context.Context, options *ImagesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/images" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ImagesClient) listHandleResponse(resp *http.Response) (ImagesClientListResponse, error) { - result := ImagesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ImageListResult); err != nil { - return ImagesClientListResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Gets the list of images under a resource group. Use nextLink property in the response to -// get the next page of Images. Do this till nextLink is null to fetch all the Images. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - options - ImagesClientListByResourceGroupOptions contains the optional parameters for the ImagesClient.NewListByResourceGroupPager -// method. -func (client *ImagesClient) NewListByResourceGroupPager(resourceGroupName string, options *ImagesClientListByResourceGroupOptions) *runtime.Pager[ImagesClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[ImagesClientListByResourceGroupResponse]{ - More: func(page ImagesClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ImagesClientListByResourceGroupResponse) (ImagesClientListByResourceGroupResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ImagesClient.NewListByResourceGroupPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - }, nil) - if err != nil { - return ImagesClientListByResourceGroupResponse{}, err - } - return client.listByResourceGroupHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *ImagesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ImagesClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *ImagesClient) listByResourceGroupHandleResponse(resp *http.Response) (ImagesClientListByResourceGroupResponse, error) { - result := ImagesClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ImageListResult); err != nil { - return ImagesClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// BeginUpdate - Update an image. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - imageName - The name of the image. -// - parameters - Parameters supplied to the Update Image operation. -// - options - ImagesClientBeginUpdateOptions contains the optional parameters for the ImagesClient.BeginUpdate method. -func (client *ImagesClient) BeginUpdate(ctx context.Context, resourceGroupName string, imageName string, parameters ImageUpdate, options *ImagesClientBeginUpdateOptions) (*runtime.Poller[ImagesClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, imageName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ImagesClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ImagesClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Update an image. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *ImagesClient) update(ctx context.Context, resourceGroupName string, imageName string, parameters ImageUpdate, options *ImagesClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "ImagesClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, imageName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *ImagesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, imageName string, parameters ImageUpdate, options *ImagesClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if imageName == "" { - return nil, errors.New("parameter imageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{imageName}", url.PathEscape(imageName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/loganalytics_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/loganalytics_client.go deleted file mode 100644 index a3b77f82837..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/loganalytics_client.go +++ /dev/null @@ -1,200 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// LogAnalyticsClient contains the methods for the LogAnalytics group. -// Don't use this type directly, use NewLogAnalyticsClient() instead. -type LogAnalyticsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewLogAnalyticsClient creates a new instance of LogAnalyticsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewLogAnalyticsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LogAnalyticsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &LogAnalyticsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginExportRequestRateByInterval - Export logs that show Api requests made by this subscription in the given time window -// to show throttling activities. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - location - The location upon which virtual-machine-sizes is queried. -// - parameters - Parameters supplied to the LogAnalytics getRequestRateByInterval Api. -// - options - LogAnalyticsClientBeginExportRequestRateByIntervalOptions contains the optional parameters for the LogAnalyticsClient.BeginExportRequestRateByInterval -// method. -func (client *LogAnalyticsClient) BeginExportRequestRateByInterval(ctx context.Context, location string, parameters RequestRateByIntervalInput, options *LogAnalyticsClientBeginExportRequestRateByIntervalOptions) (*runtime.Poller[LogAnalyticsClientExportRequestRateByIntervalResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.exportRequestRateByInterval(ctx, location, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LogAnalyticsClientExportRequestRateByIntervalResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[LogAnalyticsClientExportRequestRateByIntervalResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// ExportRequestRateByInterval - Export logs that show Api requests made by this subscription in the given time window to -// show throttling activities. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *LogAnalyticsClient) exportRequestRateByInterval(ctx context.Context, location string, parameters RequestRateByIntervalInput, options *LogAnalyticsClientBeginExportRequestRateByIntervalOptions) (*http.Response, error) { - var err error - const operationName = "LogAnalyticsClient.BeginExportRequestRateByInterval" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.exportRequestRateByIntervalCreateRequest(ctx, location, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// exportRequestRateByIntervalCreateRequest creates the ExportRequestRateByInterval request. -func (client *LogAnalyticsClient) exportRequestRateByIntervalCreateRequest(ctx context.Context, location string, parameters RequestRateByIntervalInput, options *LogAnalyticsClientBeginExportRequestRateByIntervalOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getRequestRateByInterval" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginExportThrottledRequests - Export logs that show total throttled Api requests for this subscription in the given time -// window. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - location - The location upon which virtual-machine-sizes is queried. -// - parameters - Parameters supplied to the LogAnalytics getThrottledRequests Api. -// - options - LogAnalyticsClientBeginExportThrottledRequestsOptions contains the optional parameters for the LogAnalyticsClient.BeginExportThrottledRequests -// method. -func (client *LogAnalyticsClient) BeginExportThrottledRequests(ctx context.Context, location string, parameters ThrottledRequestsInput, options *LogAnalyticsClientBeginExportThrottledRequestsOptions) (*runtime.Poller[LogAnalyticsClientExportThrottledRequestsResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.exportThrottledRequests(ctx, location, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LogAnalyticsClientExportThrottledRequestsResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[LogAnalyticsClientExportThrottledRequestsResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// ExportThrottledRequests - Export logs that show total throttled Api requests for this subscription in the given time window. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *LogAnalyticsClient) exportThrottledRequests(ctx context.Context, location string, parameters ThrottledRequestsInput, options *LogAnalyticsClientBeginExportThrottledRequestsOptions) (*http.Response, error) { - var err error - const operationName = "LogAnalyticsClient.BeginExportThrottledRequests" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.exportThrottledRequestsCreateRequest(ctx, location, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// exportThrottledRequestsCreateRequest creates the ExportThrottledRequests request. -func (client *LogAnalyticsClient) exportThrottledRequestsCreateRequest(ctx context.Context, location string, parameters ThrottledRequestsInput, options *LogAnalyticsClientBeginExportThrottledRequestsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getThrottledRequests" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/models.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/models.go deleted file mode 100644 index 1fad0acd2a7..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/models.go +++ /dev/null @@ -1,8643 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import "time" - -// APIEntityReference - The API entity reference. -type APIEntityReference struct { - // The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/… - ID *string -} - -// APIError - Api error. -type APIError struct { - // The error code. - Code *string - - // The Api error details - Details []*APIErrorBase - - // The Api inner error - Innererror *InnerError - - // The error message. - Message *string - - // The target of the particular error. - Target *string -} - -// APIErrorBase - Api error base. -type APIErrorBase struct { - // The error code. - Code *string - - // The error message. - Message *string - - // The target of the particular error. - Target *string -} - -// AccessURI - A disk access SAS uri. -type AccessURI struct { - // READ-ONLY; A SAS uri for accessing a disk. - AccessSAS *string - - // READ-ONLY; A SAS uri for accessing a VM guest state. - SecurityDataAccessSAS *string -} - -// AdditionalCapabilities - Enables or disables a capability on the virtual machine or virtual machine scale set. -type AdditionalCapabilities struct { - // The flag that enables or disables hibernation capability on the VM. - HibernationEnabled *bool - - // The flag that enables or disables a capability to have one or more managed data disks with UltraSSDLRS storage account - // type on the VM or VMSS. Managed disks with storage account type UltraSSDLRS can - // be added to a virtual machine or virtual machine scale set only if this property is enabled. - UltraSSDEnabled *bool -} - -// AdditionalUnattendContent - Specifies additional XML formatted information that can be included in the Unattend.xml file, -// which is used by Windows Setup. Contents are defined by setting name, component name, and the pass in -// which the content is applied. -type AdditionalUnattendContent struct { - // The component name. Currently, the only allowable value is Microsoft-Windows-Shell-Setup. - ComponentName *string - - // Specifies the XML formatted content that is added to the unattend.xml file for the specified path and component. The XML - // must be less than 4KB and must include the root element for the setting or - // feature that is being inserted. - Content *string - - // The pass name. Currently, the only allowable value is OobeSystem. - PassName *string - - // Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon. - SettingName *SettingNames -} - -// AlternativeOption - Describes the alternative option specified by the Publisher for this image when this image is deprecated. -type AlternativeOption struct { - // Describes the type of the alternative option. - Type *AlternativeType - - // Indicates the alternative option value specified by the Publisher. This is the Offer name when the type is Offer or the - // Plan name when the type is Plan. - Value *string -} - -// ApplicationProfile - Contains the list of gallery applications that should be made available to the VM/VMSS -type ApplicationProfile struct { - // Specifies the gallery applications that should be made available to the VM/VMSS - GalleryApplications []*VMGalleryApplication -} - -// AttachDetachDataDisksRequest - Specifies the input for attaching and detaching a list of managed data disks. -type AttachDetachDataDisksRequest struct { - // The list of managed data disks to be attached. - DataDisksToAttach []*DataDisksToAttach - - // The list of managed data disks to be detached. - DataDisksToDetach []*DataDisksToDetach -} - -// AutomaticOSUpgradePolicy - The configuration parameters used for performing automatic OS upgrade. -type AutomaticOSUpgradePolicy struct { - // Whether OS image rollback feature should be disabled. Default value is false. - DisableAutomaticRollback *bool - - // Indicates whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer - // version of the OS image becomes available. Default value is false. If this is set - // to true for Windows based scale sets, enableAutomaticUpdates - // [https://docs.microsoft.com/dotnet/api/microsoft.azure.management.compute.models.windowsconfiguration.enableautomaticupdates?view=azure-dotnet] - // is automatically set to false and cannot be set to true. - EnableAutomaticOSUpgrade *bool - - // Indicates whether Auto OS Upgrade should undergo deferral. Deferred OS upgrades will send advanced notifications on a per-VM - // basis that an OS upgrade from rolling upgrades is incoming, via the IMDS - // tag 'Platform.PendingOSUpgrade'. The upgrade then defers until the upgrade is approved via an ApproveRollingUpgrade call. - OSRollingUpgradeDeferral *bool - - // Indicates whether rolling upgrade policy should be used during Auto OS Upgrade. Default value is false. Auto OS Upgrade - // will fallback to the default policy if no policy is defined on the VMSS. - UseRollingUpgradePolicy *bool -} - -// AutomaticOSUpgradeProperties - Describes automatic OS upgrade properties on the image. -type AutomaticOSUpgradeProperties struct { - // REQUIRED; Specifies whether automatic OS upgrade is supported on the image. - AutomaticOSUpgradeSupported *bool -} - -// AutomaticRepairsPolicy - Specifies the configuration parameters for automatic repairs on the virtual machine scale set. -type AutomaticRepairsPolicy struct { - // Specifies whether automatic repairs should be enabled on the virtual machine scale set. The default value is false. - Enabled *bool - - // The amount of time for which automatic repairs are suspended due to a state change on VM. The grace time starts after the - // state change has completed. This helps avoid premature or accidental repairs. - // The time duration should be specified in ISO 8601 format. The minimum allowed grace period is 10 minutes (PT10M), which - // is also the default value. The maximum allowed grace period is 90 minutes - // (PT90M). - GracePeriod *string - - // Type of repair action (replace, restart, reimage) that will be used for repairing unhealthy virtual machines in the scale - // set. Default value is replace. - RepairAction *RepairAction -} - -// AvailabilitySet - Specifies information about the availability set that the virtual machine should be assigned to. Virtual -// machines specified in the same availability set are allocated to different nodes to maximize -// availability. For more information about availability sets, see Availability sets overview [https://docs.microsoft.com/azure/virtual-machines/availability-set-overview]. -// For more information on Azure -// planned maintenance, see Maintenance and updates for Virtual Machines in Azure [https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates]. -// Currently, a VM can only be added to an -// availability set at creation time. An existing VM cannot be added to an availability set. -type AvailabilitySet struct { - // REQUIRED; Resource location - Location *string - - // The instance view of a resource. - Properties *AvailabilitySetProperties - - // Sku of the availability set, only name is required to be set. See AvailabilitySetSkuTypes for possible set of values. Use - // 'Aligned' for virtual machines with managed disks and 'Classic' for virtual - // machines with unmanaged disks. Default value is 'Classic'. - SKU *SKU - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// AvailabilitySetListResult - The List Availability Set operation response. -type AvailabilitySetListResult struct { - // REQUIRED; The list of availability sets - Value []*AvailabilitySet - - // The URI to fetch the next page of AvailabilitySets. Call ListNext() with this URI to fetch the next page of AvailabilitySets. - NextLink *string -} - -// AvailabilitySetProperties - The instance view of a resource. -type AvailabilitySetProperties struct { - // Fault Domain count. - PlatformFaultDomainCount *int32 - - // Update Domain count. - PlatformUpdateDomainCount *int32 - - // Specifies information about the proximity placement group that the availability set should be assigned to. Minimum api-version: - // 2018-04-01. - ProximityPlacementGroup *SubResource - - // A list of references to all virtual machines in the availability set. - VirtualMachines []*SubResource - - // READ-ONLY; The resource status information. - Statuses []*InstanceViewStatus -} - -// AvailabilitySetUpdate - Specifies information about the availability set that the virtual machine should be assigned to. -// Only tags may be updated. -type AvailabilitySetUpdate struct { - // The instance view of a resource. - Properties *AvailabilitySetProperties - - // Sku of the availability set - SKU *SKU - - // Resource tags - Tags map[string]*string -} - -// AvailablePatchSummary - Describes the properties of an virtual machine instance view for available patch summary. -type AvailablePatchSummary struct { - // READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension - // logs. - AssessmentActivityID *string - - // READ-ONLY; The number of critical or security patches that have been detected as available and not yet installed. - CriticalAndSecurityPatchCount *int32 - - // READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. - Error *APIError - - // READ-ONLY; The UTC timestamp when the operation began. - LastModifiedTime *time.Time - - // READ-ONLY; The number of all available patches excluding critical and security. - OtherPatchCount *int32 - - // READ-ONLY; The overall reboot status of the VM. It will be true when partially installed patches require a reboot to complete - // installation but the reboot has not yet occurred. - RebootPending *bool - - // READ-ONLY; The UTC timestamp when the operation began. - StartTime *time.Time - - // READ-ONLY; The overall success or failure status of the operation. It remains "InProgress" until the operation completes. - // At that point it will become "Unknown", "Failed", "Succeeded", or - // "CompletedWithWarnings." - Status *PatchOperationStatus -} - -// BillingProfile - Specifies the billing related details of a Azure Spot VM or VMSS. Minimum api-version: 2019-03-01. -type BillingProfile struct { - // Specifies the maximum price you are willing to pay for a Azure Spot VM/VMSS. This price is in US Dollars. - // This price will be compared with the current Azure Spot price for the VM size. Also, the prices are compared at the time - // of create/update of Azure Spot VM/VMSS and the operation will only succeed if - // the maxPrice is greater than the current Azure Spot price. - // The maxPrice will also be used for evicting a Azure Spot VM/VMSS if the current Azure Spot price goes beyond the maxPrice - // after creation of VM/VMSS. - // Possible values are: - // - Any decimal value greater than zero. Example: 0.01538 - // -1 – indicates default price to be up-to on-demand. - // You can set the maxPrice to -1 to indicate that the Azure Spot VM/VMSS should not be evicted for price reasons. Also, the - // default max price is -1 if it is not provided by you. - // Minimum api-version: 2019-03-01. - MaxPrice *float64 -} - -// BootDiagnostics - Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose -// VM status. You can easily view the output of your console log. Azure also enables you to see -// a screenshot of the VM from the hypervisor. -type BootDiagnostics struct { - // Whether boot diagnostics should be enabled on the Virtual Machine. - Enabled *bool - - // Uri of the storage account to use for placing the console output and screenshot. If storageUri is not specified while enabling - // boot diagnostics, managed storage will be used. - StorageURI *string -} - -// BootDiagnosticsInstanceView - The instance view of a virtual machine boot diagnostics. -type BootDiagnosticsInstanceView struct { - // READ-ONLY; The console screenshot blob URI. Note: This will not be set if boot diagnostics is currently enabled with managed - // storage. - ConsoleScreenshotBlobURI *string - - // READ-ONLY; The serial console log blob Uri. Note: This will not be set if boot diagnostics is currently enabled with managed - // storage. - SerialConsoleLogBlobURI *string - - // READ-ONLY; The boot diagnostics status information for the VM. Note: It will be set only if there are errors encountered - // in enabling boot diagnostics. - Status *InstanceViewStatus -} - -// CapacityReservation - Specifies information about the capacity reservation. -type CapacityReservation struct { - // REQUIRED; Resource location - Location *string - - // REQUIRED; SKU of the resource for which capacity needs be reserved. The SKU name and capacity is required to be set. Currently - // VM Skus with the capability called 'CapacityReservationSupported' set to true are - // supported. Refer to List Microsoft.Compute SKUs in a region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) - // for supported values. - SKU *SKU - - // Properties of the Capacity reservation. - Properties *CapacityReservationProperties - - // Resource tags - Tags map[string]*string - - // Availability Zone to use for this capacity reservation. The zone has to be single value and also should be part for the - // list of zones specified during the capacity reservation group creation. The zone - // can be assigned only during creation. If not provided, the reservation supports only non-zonal deployments. If provided, - // enforces VM/VMSS using this capacity reservation to be in same zone. - Zones []*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// CapacityReservationGroup - Specifies information about the capacity reservation group that the capacity reservations should -// be assigned to. Currently, a capacity reservation can only be added to a capacity reservation group at -// creation time. An existing capacity reservation cannot be added or moved to another capacity reservation group. -type CapacityReservationGroup struct { - // REQUIRED; Resource location - Location *string - - // capacity reservation group Properties. - Properties *CapacityReservationGroupProperties - - // Resource tags - Tags map[string]*string - - // Availability Zones to use for this capacity reservation group. The zones can be assigned only during creation. If not provided, - // the group supports only regional resources in the region. If provided, - // enforces each capacity reservation in the group to be in one of the zones. - Zones []*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -type CapacityReservationGroupInstanceView struct { - // READ-ONLY; List of instance view of the capacity reservations under the capacity reservation group. - CapacityReservations []*CapacityReservationInstanceViewWithName - - // READ-ONLY; List of the subscriptions that the capacity reservation group is shared with. Note: Minimum api-version: 2024-03-01. - // Please refer to https://aka.ms/computereservationsharing for more details. - SharedSubscriptionIDs []*SubResourceReadOnly -} - -// CapacityReservationGroupListResult - The List capacity reservation group with resource group response. -type CapacityReservationGroupListResult struct { - // REQUIRED; The list of capacity reservation groups - Value []*CapacityReservationGroup - - // The URI to fetch the next page of capacity reservation groups. Call ListNext() with this URI to fetch the next page of - // capacity reservation groups. - NextLink *string -} - -// CapacityReservationGroupProperties - capacity reservation group Properties. -type CapacityReservationGroupProperties struct { - // Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. Pls. keep in - // mind the capacity reservation group resource generally can be shared across - // subscriptions belonging to a single azure AAD tenant or cross AAD tenant if there is a trust relationship established between - // the AAD tenants. Note: Minimum api-version: 2024-03-01. Please refer to - // https://aka.ms/computereservationsharing for more details. - SharingProfile *ResourceSharingProfile - - // READ-ONLY; A list of all capacity reservation resource ids that belong to capacity reservation group. - CapacityReservations []*SubResourceReadOnly - - // READ-ONLY; The capacity reservation group instance view which has the list of instance views for all the capacity reservations - // that belong to the capacity reservation group. - InstanceView *CapacityReservationGroupInstanceView - - // READ-ONLY; A list of references to all virtual machines associated to the capacity reservation group. - VirtualMachinesAssociated []*SubResourceReadOnly -} - -// CapacityReservationGroupUpdate - Specifies information about the capacity reservation group. Only tags can be updated. -type CapacityReservationGroupUpdate struct { - // capacity reservation group Properties. - Properties *CapacityReservationGroupProperties - - // Resource tags - Tags map[string]*string -} - -// CapacityReservationInstanceView - The instance view of a capacity reservation that provides as snapshot of the runtime -// properties of the capacity reservation that is managed by the platform and can change outside of control plane -// operations. -type CapacityReservationInstanceView struct { - // The resource status information. - Statuses []*InstanceViewStatus - - // Unutilized capacity of the capacity reservation. - UtilizationInfo *CapacityReservationUtilization -} - -// CapacityReservationInstanceViewWithName - The instance view of a capacity reservation that includes the name of the capacity -// reservation. It is used for the response to the instance view of a capacity reservation group. -type CapacityReservationInstanceViewWithName struct { - // The resource status information. - Statuses []*InstanceViewStatus - - // Unutilized capacity of the capacity reservation. - UtilizationInfo *CapacityReservationUtilization - - // READ-ONLY; The name of the capacity reservation. - Name *string -} - -// CapacityReservationListResult - The list capacity reservation operation response. -type CapacityReservationListResult struct { - // REQUIRED; The list of capacity reservations - Value []*CapacityReservation - - // The URI to fetch the next page of capacity reservations. Call ListNext() with this URI to fetch the next page of capacity - // reservations. - NextLink *string -} - -// CapacityReservationProfile - The parameters of a capacity reservation Profile. -type CapacityReservationProfile struct { - // Specifies the capacity reservation group resource id that should be used for allocating the virtual machine or scaleset - // vm instances provided enough capacity has been reserved. Please refer to - // https://aka.ms/CapacityReservation for more details. - CapacityReservationGroup *SubResource -} - -// CapacityReservationProperties - Properties of the Capacity reservation. -type CapacityReservationProperties struct { - // READ-ONLY; The Capacity reservation instance view. - InstanceView *CapacityReservationInstanceView - - // READ-ONLY; Specifies the value of fault domain count that Capacity Reservation supports for requested VM size. Note: The - // fault domain count specified for a resource (like virtual machines scale set) must be less - // than or equal to this value if it deploys using capacity reservation. Minimum api-version: 2022-08-01. - PlatformFaultDomainCount *int32 - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string - - // READ-ONLY; The date time when the capacity reservation was last updated. - ProvisioningTime *time.Time - - // READ-ONLY; A unique id generated and assigned to the capacity reservation by the platform which does not change throughout - // the lifetime of the resource. - ReservationID *string - - // READ-ONLY; Specifies the time at which the Capacity Reservation resource was created. Minimum api-version: 2021-11-01. - TimeCreated *time.Time - - // READ-ONLY; A list of all virtual machine resource ids that are associated with the capacity reservation. - VirtualMachinesAssociated []*SubResourceReadOnly -} - -// CapacityReservationUpdate - Specifies information about the capacity reservation. Only tags and sku.capacity can be updated. -type CapacityReservationUpdate struct { - // Properties of the Capacity reservation. - Properties *CapacityReservationProperties - - // SKU of the resource for which capacity needs be reserved. The SKU name and capacity is required to be set. Currently VM - // Skus with the capability called 'CapacityReservationSupported' set to true are - // supported. Refer to List Microsoft.Compute SKUs in a region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) - // for supported values. - SKU *SKU - - // Resource tags - Tags map[string]*string -} - -// CapacityReservationUtilization - Represents the capacity reservation utilization in terms of resources allocated. -type CapacityReservationUtilization struct { - // READ-ONLY; The value provides the current capacity of the VM size which was reserved successfully and for which the customer - // is getting billed. Minimum api-version: 2022-08-01. - CurrentCapacity *int32 - - // READ-ONLY; A list of all virtual machines resource ids allocated against the capacity reservation. - VirtualMachinesAllocated []*SubResourceReadOnly -} - -// CloudService - Describes the cloud service. -type CloudService struct { - // REQUIRED; Resource location. - Location *string - - // Cloud service properties - Properties *CloudServiceProperties - - // The system meta data relating to this resource. - SystemData *SystemData - - // Resource tags. - Tags map[string]*string - - // List of logical availability zone of the resource. List should contain only 1 zone where cloud service should be provisioned. - // This field is optional. - Zones []*string - - // READ-ONLY; Resource Id. - ID *string - - // READ-ONLY; Resource name. - Name *string - - // READ-ONLY; Resource type. - Type *string -} - -// CloudServiceExtensionProfile - Describes a cloud service extension profile. -type CloudServiceExtensionProfile struct { - // List of extensions for the cloud service. - Extensions []*Extension -} - -// CloudServiceExtensionProperties - Extension Properties. -type CloudServiceExtensionProperties struct { - // Explicitly specify whether platform can automatically upgrade typeHandlerVersion to higher minor versions when they become - // available. - AutoUpgradeMinorVersion *bool - - // Tag to force apply the provided public and protected settings. Changing the tag value allows for re-running the extension - // without changing any of the public or protected settings. If forceUpdateTag is - // not changed, updates to public or protected settings would still be applied by the handler. If neither forceUpdateTag nor - // any of public or protected settings change, extension would flow to the role - // instance with the same sequence-number, and it is up to handler implementation whether to re-run it or not - ForceUpdateTag *string - - // Protected settings for the extension which are encrypted before sent to the role instance. - ProtectedSettings any - - // Protected settings for the extension, referenced using KeyVault which are encrypted before sent to the role instance. - ProtectedSettingsFromKeyVault *CloudServiceVaultAndSecretReference - - // The name of the extension handler publisher. - Publisher *string - - // Optional list of roles to apply this extension. If property is not specified or '*' is specified, extension is applied - // to all roles in the cloud service. - RolesAppliedTo []*string - - // Public settings for the extension. For JSON extensions, this is the JSON settings for the extension. For XML Extension - // (like RDP), this is the XML setting for the extension. - Settings any - - // Specifies the type of the extension. - Type *string - - // Specifies the version of the extension. Specifies the version of the extension. If this element is not specified or an - // asterisk (*) is used as the value, the latest version of the extension is used. - // If the value is specified with a major version number and an asterisk as the minor version number (X.), the latest minor - // version of the specified major version is selected. If a major version number - // and a minor version number are specified (X.Y), the specific extension version is selected. If a version is specified, - // an auto-upgrade is performed on the role instance. - TypeHandlerVersion *string - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string -} - -// CloudServiceInstanceView - InstanceView of CloudService as a whole -type CloudServiceInstanceView struct { - // Instance view statuses. - RoleInstance *InstanceViewStatusesSummary - - // READ-ONLY; Specifies a list of unique identifiers generated internally for the cloud service. - // NOTE: If you are using Azure Diagnostics extension, this property can be used as 'DeploymentId' for querying details. - PrivateIDs []*string - - // READ-ONLY; The version of the SDK that was used to generate the package for the cloud service. - SdkVersion *string - - // READ-ONLY - Statuses []*ResourceInstanceViewStatus -} - -// CloudServiceListResult - The list operation result. -type CloudServiceListResult struct { - // REQUIRED; The list of resources. - Value []*CloudService - - // The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null - // to fetch all the resources. - NextLink *string -} - -// CloudServiceNetworkProfile - Network Profile for the cloud service. -type CloudServiceNetworkProfile struct { - // List of Load balancer configurations. Cloud service can have up to two load balancer configurations, corresponding to a - // Public Load Balancer and an Internal Load Balancer. - LoadBalancerConfigurations []*LoadBalancerConfiguration - - // Slot type for the cloud service. Possible values are - // Production - // Staging - // If not specified, the default value is Production. - SlotType *CloudServiceSlotType - - // The id reference of the cloud service containing the target IP with which the subject cloud service can perform a swap. - // This property cannot be updated once it is set. The swappable cloud service - // referred by this id must be present otherwise an error will be thrown. - SwappableCloudService *SubResource -} - -// CloudServiceOsProfile - Describes the OS profile for the cloud service. -type CloudServiceOsProfile struct { - // Specifies set of certificates that should be installed onto the role instances. - Secrets []*CloudServiceVaultSecretGroup -} - -// CloudServiceProperties - Cloud service properties -type CloudServiceProperties struct { - // (Optional) Indicates whether the role sku properties (roleProfile.roles.sku) specified in the model/template should override - // the role instance count and vm size specified in the .cscfg and .csdef - // respectively. The default value is false. - AllowModelOverride *bool - - // Specifies the XML service configuration (.cscfg) for the cloud service. - Configuration *string - - // Specifies a URL that refers to the location of the service configuration in the Blob service. The service package URL can - // be Shared Access Signature (SAS) URI from any storage account. This is a - // write-only property and is not returned in GET calls. - ConfigurationURL *string - - // Describes a cloud service extension profile. - ExtensionProfile *CloudServiceExtensionProfile - - // Network Profile for the cloud service. - NetworkProfile *CloudServiceNetworkProfile - - // Describes the OS profile for the cloud service. - OSProfile *CloudServiceOsProfile - - // Specifies a URL that refers to the location of the service package in the Blob service. The service package URL can be - // Shared Access Signature (SAS) URI from any storage account. This is a write-only - // property and is not returned in GET calls. - PackageURL *string - - // Describes the role profile for the cloud service. - RoleProfile *CloudServiceRoleProfile - - // (Optional) Indicates whether to start the cloud service immediately after it is created. The default value is true. If - // false, the service model is still deployed, but the code is not run immediately. - // Instead, the service is PoweredOff until you call Start, at which time the service will be started. A deployed service - // still incurs charges, even if it is poweredoff. - StartCloudService *bool - - // Update mode for the cloud service. Role instances are allocated to update domains when the service is deployed. Updates - // can be initiated manually in each update domain or initiated automatically in - // all update domains. Possible Values are - // Auto - // Manual - // Simultaneous - // If not specified, the default value is Auto. If set to Manual, PUT UpdateDomain must be called to apply the update. If - // set to Auto, the update is automatically applied to each update domain in - // sequence. - UpgradeMode *CloudServiceUpgradeMode - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string - - // READ-ONLY; The unique identifier for the cloud service. - UniqueID *string -} - -// CloudServiceRole - Describes a role of the cloud service. -type CloudServiceRole struct { - // The cloud service role properties. - Properties *CloudServiceRoleProperties - - // Describes the cloud service role sku. - SKU *CloudServiceRoleSKU - - // READ-ONLY; Resource id - ID *string - - // READ-ONLY; Resource location - Location *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// CloudServiceRoleListResult - The list operation result. -type CloudServiceRoleListResult struct { - // REQUIRED; The list of resources. - Value []*CloudServiceRole - - // The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null - // to fetch all the resources. - NextLink *string -} - -// CloudServiceRoleProfile - Describes the role profile for the cloud service. -type CloudServiceRoleProfile struct { - // List of roles for the cloud service. - Roles []*CloudServiceRoleProfileProperties -} - -// CloudServiceRoleProfileProperties - Describes the role properties. -type CloudServiceRoleProfileProperties struct { - // Resource name. - Name *string - - // Describes the cloud service role sku. - SKU *CloudServiceRoleSKU -} - -// CloudServiceRoleProperties - The cloud service role properties. -type CloudServiceRoleProperties struct { - // READ-ONLY; Specifies the ID which uniquely identifies a cloud service role. - UniqueID *string -} - -// CloudServiceRoleSKU - Describes the cloud service role sku. -type CloudServiceRoleSKU struct { - // Specifies the number of role instances in the cloud service. - Capacity *int64 - - // The sku name. NOTE: If the new SKU is not supported on the hardware the cloud service is currently on, you need to delete - // and recreate the cloud service or move back to the old sku. - Name *string - - // Specifies the tier of the cloud service. Possible Values are - // Standard - // Basic - Tier *string -} - -type CloudServiceUpdate struct { - // Resource tags - Tags map[string]*string -} - -// CloudServiceVaultAndSecretReference - Protected settings for the extension, referenced using KeyVault which are encrypted -// before sent to the role instance. -type CloudServiceVaultAndSecretReference struct { - // Secret URL which contains the protected settings of the extension - SecretURL *string - - // The ARM Resource ID of the Key Vault - SourceVault *SubResource -} - -// CloudServiceVaultCertificate - Describes a single certificate reference in a Key Vault, and where the certificate should -// reside on the role instance. -type CloudServiceVaultCertificate struct { - // This is the URL of a certificate that has been uploaded to Key Vault as a secret. - CertificateURL *string -} - -// CloudServiceVaultSecretGroup - Describes a set of certificates which are all in the same Key Vault. -type CloudServiceVaultSecretGroup struct { - // The relative URL of the Key Vault containing all of the certificates in VaultCertificates. - SourceVault *SubResource - - // The list of key vault references in SourceVault which contain certificates. - VaultCertificates []*CloudServiceVaultCertificate -} - -// CommunityGallery - Specifies information about the Community Gallery that you want to create or update. -type CommunityGallery struct { - // The identifier information of community gallery. - Identifier *CommunityGalleryIdentifier - - // Describes the properties of a community gallery. - Properties *CommunityGalleryProperties - - // READ-ONLY; Resource location - Location *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// CommunityGalleryIdentifier - The identifier information of community gallery. -type CommunityGalleryIdentifier struct { - // The unique id of this community gallery. - UniqueID *string -} - -// CommunityGalleryImage - Specifies information about the gallery image definition that you want to create or update. -type CommunityGalleryImage struct { - // The identifier information of community gallery. - Identifier *CommunityGalleryIdentifier - - // Describes the properties of a gallery image definition. - Properties *CommunityGalleryImageProperties - - // READ-ONLY; Resource location - Location *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// CommunityGalleryImageIdentifier - This is the community gallery image definition identifier. -type CommunityGalleryImageIdentifier struct { - // The name of the gallery image definition offer. - Offer *string - - // The name of the gallery image definition publisher. - Publisher *string - - // The name of the gallery image definition SKU. - SKU *string -} - -// CommunityGalleryImageList - The List Community Gallery Images operation response. -type CommunityGalleryImageList struct { - // REQUIRED; A list of community gallery images. - Value []*CommunityGalleryImage - - // The URI to fetch the next page of community gallery images. Call ListNext() with this to fetch the next page of community - // gallery images. - NextLink *string -} - -// CommunityGalleryImageProperties - Describes the properties of a gallery image definition. -type CommunityGalleryImageProperties struct { - // REQUIRED; This is the community gallery image definition identifier. - Identifier *CommunityGalleryImageIdentifier - - // REQUIRED; This property allows the user to specify whether the virtual machines created under this image are 'Generalized' - // or 'Specialized'. - OSState *OperatingSystemStateTypes - - // REQUIRED; This property allows you to specify the type of the OS that is included in the disk when creating a VM from a - // managed image. Possible values are: Windows, Linux. - OSType *OperatingSystemTypes - - // The architecture of the image. Applicable to OS disks only. - Architecture *Architecture - - // The artifact tags of a community gallery resource. - ArtifactTags map[string]*string - - // Describes the disallowed disk types. - Disallowed *Disallowed - - // The disclaimer for a community gallery resource. - Disclaimer *string - - // The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property - // is updatable. - EndOfLifeDate *time.Time - - // The end-user license agreement for the current community gallery image. - Eula *string - - // A list of gallery image features. - Features []*GalleryImageFeature - - // The hypervisor generation of the Virtual Machine. Applicable to OS disks only. - HyperVGeneration *HyperVGeneration - - // Privacy statement URI for the current community gallery image. - PrivacyStatementURI *string - - // Describes the gallery image definition purchase plan. This is used by marketplace images. - PurchasePlan *ImagePurchasePlan - - // The properties describe the recommended machine configuration for this Image Definition. These properties are updatable. - Recommended *RecommendedMachineConfiguration -} - -// CommunityGalleryImageVersion - Specifies information about the gallery image version that you want to create or update. -type CommunityGalleryImageVersion struct { - // The identifier information of community gallery. - Identifier *CommunityGalleryIdentifier - - // Describes the properties of a gallery image version. - Properties *CommunityGalleryImageVersionProperties - - // READ-ONLY; Resource location - Location *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// CommunityGalleryImageVersionList - The List Community Gallery Image versions operation response. -type CommunityGalleryImageVersionList struct { - // REQUIRED; A list of community gallery image versions. - Value []*CommunityGalleryImageVersion - - // The URI to fetch the next page of community gallery image versions. Call ListNext() with this to fetch the next page of - // community gallery image versions. - NextLink *string -} - -// CommunityGalleryImageVersionProperties - Describes the properties of a gallery image version. -type CommunityGalleryImageVersionProperties struct { - // The artifact tags of a community gallery resource. - ArtifactTags map[string]*string - - // The disclaimer for a community gallery resource. - Disclaimer *string - - // The end of life date of the gallery image version Definition. This property can be used for decommissioning purposes. This - // property is updatable. - EndOfLifeDate *time.Time - - // If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. - ExcludeFromLatest *bool - - // The published date of the gallery image version Definition. This property can be used for decommissioning purposes. This - // property is updatable. - PublishedDate *time.Time - - // Describes the storage profile of the image version. - StorageProfile *SharedGalleryImageVersionStorageProfile -} - -// CommunityGalleryInfo - Information of community gallery if current gallery is shared to community -type CommunityGalleryInfo struct { - // End-user license agreement for community gallery image. - Eula *string - - // The prefix of the gallery name that will be displayed publicly. Visible to all users. - PublicNamePrefix *string - - // Community gallery publisher support email. The email address of the publisher. Visible to all users. - PublisherContact *string - - // The link to the publisher website. Visible to all users. - PublisherURI *string - - // READ-ONLY; Contains info about whether community gallery sharing is enabled. - CommunityGalleryEnabled *bool - - // READ-ONLY; Community gallery public name list. - PublicNames []*string -} - -// CommunityGalleryMetadata - The metadata of community gallery. -type CommunityGalleryMetadata struct { - // REQUIRED; A list of public names the gallery has. - PublicNames []*string - - // REQUIRED; The publisher email id of this community gallery. - PublisherContact *string - - // The end-user license agreement for this community gallery. - Eula *string - - // The link for the privacy statement of this community gallery from the gallery publisher. - PrivacyStatementURI *string - - // The publisher URI of this community gallery. - PublisherURI *string -} - -// CommunityGalleryProperties - Describes the properties of a community gallery. -type CommunityGalleryProperties struct { - // The artifact tags of a community gallery resource. - ArtifactTags map[string]*string - - // The metadata of community gallery. - CommunityMetadata *CommunityGalleryMetadata - - // The disclaimer for a community gallery resource. - Disclaimer *string -} - -// CopyCompletionError - Indicates the error details if the background copy of a resource created via the CopyStart operation -// fails. -type CopyCompletionError struct { - // REQUIRED; Indicates the error code if the background copy of a resource created via the CopyStart operation fails. - ErrorCode *CopyCompletionErrorReason - - // REQUIRED; Indicates the error message if the background copy of a resource created via the CopyStart operation fails. - ErrorMessage *string -} - -// CreationData - Data used when creating a disk. -type CreationData struct { - // REQUIRED; This enumerates the possible sources of a disk's creation. - CreateOption *DiskCreateOption - - // Required if createOption is CopyFromSanSnapshot. This is the ARM id of the source elastic san volume snapshot. - ElasticSanResourceID *string - - // Required if creating from a Gallery Image. The id/sharedGalleryImageId/communityGalleryImageId of the ImageDiskReference - // will be the ARM id of the shared galley image version from which to create a - // disk. - GalleryImageReference *ImageDiskReference - - // Disk source information for PIR or user images. - ImageReference *ImageDiskReference - - // Logical sector size in bytes for Ultra disks. Supported values are 512 ad 4096. 4096 is the default. - LogicalSectorSize *int32 - - // Set this flag to true to get a boost on the performance target of the disk deployed, see here on the respective performance - // target. This flag can only be set on disk creation time and cannot be - // disabled after enabled. - PerformancePlus *bool - - // If this field is set on a snapshot and createOption is CopyStart, the snapshot will be copied at a quicker speed. - ProvisionedBandwidthCopySpeed *ProvisionedBandwidthCopyOption - - // If createOption is ImportSecure, this is the URI of a blob to be imported into VM guest state. - SecurityDataURI *string - - // If createOption is Copy, this is the ARM id of the source snapshot or disk. - SourceResourceID *string - - // If createOption is Import, this is the URI of a blob to be imported into a managed disk. - SourceURI *string - - // Required if createOption is Import. The Azure Resource Manager identifier of the storage account containing the blob to - // import as a disk. - StorageAccountID *string - - // If createOption is Upload, this is the size of the contents of the upload including the VHD footer. This value should be - // between 20972032 (20 MiB + 512 bytes for the VHD footer) and 35183298347520 - // bytes (32 TiB + 512 bytes for the VHD footer). - UploadSizeBytes *int64 - - // READ-ONLY; If this field is set, this is the unique id identifying the source of this resource. - SourceUniqueID *string -} - -// DataDisk - Describes a data disk. -type DataDisk struct { - // REQUIRED; Specifies how the virtual machine disk should be created. Possible values are Attach: This value is used when - // you are using a specialized disk to create the virtual machine. FromImage: This value is - // used when you are using an image to create the virtual machine data disk. If you are using a platform image, you should - // also use the imageReference element described above. If you are using a - // marketplace image, you should also use the plan element previously described. Empty: This value is used when creating an - // empty data disk. Copy: This value is used to create a data disk from a snapshot - // or another disk. Restore: This value is used to create a data disk from a disk restore point. - CreateOption *DiskCreateOptionTypes - - // REQUIRED; Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and - // therefore must be unique for each data disk attached to a VM. - Lun *int32 - - // Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The defaulting behavior is: None for - // Standard storage. ReadOnly for Premium storage. - Caching *CachingTypes - - // Specifies whether data disk should be deleted or detached upon VM deletion. Possible values are: Delete. If this value - // is used, the data disk is deleted when VM is deleted. Detach. If this value is - // used, the data disk is retained after VM is deleted. The default value is set to Detach. - DeleteOption *DiskDeleteOptionTypes - - // Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the - // virtual machine. Supported values: ForceDetach. detachOption: ForceDetach is - // applicable only for managed data disks. If a previous detachment attempt of the data disk did not complete due to an unexpected - // failure from the virtual machine and the disk is still not released then - // use force-detach as a last resort option to detach the disk forcibly from the VM. All writes might not have been flushed - // when using this detach behavior. This feature is still in preview mode and is - // not supported for VirtualMachineScaleSet. To force-detach a data disk update toBeDetached to 'true' along with setting - // detachOption: 'ForceDetach'. - DetachOption *DiskDetachOptionTypes - - // Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a - // virtual machine image. The property 'diskSizeGB' is the number of bytes x 1024^3 - // for the disk and the value cannot be larger than 1023. - DiskSizeGB *int32 - - // The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. - // If SourceImage is provided, the destination virtual hard drive must not - // exist. - Image *VirtualHardDisk - - // The managed disk parameters. - ManagedDisk *ManagedDiskParameters - - // The disk name. - Name *string - - // The source resource identifier. It can be a snapshot, or disk restore point from which to create a disk. - SourceResource *APIEntityReference - - // Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset - ToBeDetached *bool - - // The virtual hard disk. - Vhd *VirtualHardDisk - - // Specifies whether writeAccelerator should be enabled or disabled on the disk. - WriteAcceleratorEnabled *bool - - // READ-ONLY; Specifies the Read-Write IOPS for the managed disk when StorageAccountType is UltraSSD_LRS. Returned only for - // VirtualMachine ScaleSet VM disks. Can be updated only via updates to the VirtualMachine - // Scale Set. - DiskIOPSReadWrite *int64 - - // READ-ONLY; Specifies the bandwidth in MB per second for the managed disk when StorageAccountType is UltraSSD_LRS. Returned - // only for VirtualMachine ScaleSet VM disks. Can be updated only via updates to the - // VirtualMachine Scale Set. - DiskMBpsReadWrite *int64 -} - -// DataDiskImage - Contains the data disk images information. -type DataDiskImage struct { - // READ-ONLY; Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM - // and therefore must be unique for each data disk attached to a VM. - Lun *int32 -} - -// DataDiskImageEncryption - Contains encryption settings for a data disk image. -type DataDiskImageEncryption struct { - // REQUIRED; This property specifies the logical unit number of the data disk. This value is used to identify data disks within - // the Virtual Machine and therefore must be unique for each data disk attached to the - // Virtual Machine. - Lun *int32 - - // A relative URI containing the resource ID of the disk encryption set. - DiskEncryptionSetID *string -} - -// DataDisksToAttach - Describes the data disk to be attached. -type DataDisksToAttach struct { - // REQUIRED; ID of the managed data disk. - DiskID *string - - // Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The defaulting behavior is: None for - // Standard storage. ReadOnly for Premium storage. - Caching *CachingTypes - - // Specifies whether data disk should be deleted or detached upon VM deletion. Possible values are: Delete. If this value - // is used, the data disk is deleted when VM is deleted. Detach. If this value is - // used, the data disk is retained after VM is deleted. The default value is set to Detach. - DeleteOption *DiskDeleteOptionTypes - - // Specifies the customer managed disk encryption set resource id for the managed disk. - DiskEncryptionSet *DiskEncryptionSetParameters - - // The logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be - // unique for each data disk attached to a VM. If not specified, lun would be auto - // assigned. - Lun *int32 - - // Specifies whether writeAccelerator should be enabled or disabled on the disk. - WriteAcceleratorEnabled *bool -} - -// DataDisksToDetach - Describes the data disk to be detached. -type DataDisksToDetach struct { - // REQUIRED; ID of the managed data disk. - DiskID *string - - // Supported options available for Detach of a disk from a VM. Refer to DetachOption object reference for more details. - DetachOption *DiskDetachOptionTypes -} - -// DedicatedHost - Specifies information about the Dedicated host. -type DedicatedHost struct { - // REQUIRED; Resource location - Location *string - - // REQUIRED; SKU of the dedicated host for Hardware Generation and VM family. Only name is required to be set. List Microsoft.Compute - // SKUs for a list of possible values. - SKU *SKU - - // Properties of the dedicated host. - Properties *DedicatedHostProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// DedicatedHostAllocatableVM - Represents the dedicated host unutilized capacity in terms of a specific VM size. -type DedicatedHostAllocatableVM struct { - // Maximum number of VMs of size vmSize that can fit in the dedicated host's remaining capacity. - Count *float64 - - // VM size in terms of which the unutilized capacity is represented. - VMSize *string -} - -// DedicatedHostAvailableCapacity - Dedicated host unutilized capacity. -type DedicatedHostAvailableCapacity struct { - // The unutilized capacity of the dedicated host represented in terms of each VM size that is allowed to be deployed to the - // dedicated host. - AllocatableVMs []*DedicatedHostAllocatableVM -} - -// DedicatedHostGroup - Specifies information about the dedicated host group that the dedicated hosts should be assigned to. -// Currently, a dedicated host can only be added to a dedicated host group at creation time. An -// existing dedicated host cannot be added to another dedicated host group. -type DedicatedHostGroup struct { - // REQUIRED; Resource location - Location *string - - // Dedicated Host Group Properties. - Properties *DedicatedHostGroupProperties - - // Resource tags - Tags map[string]*string - - // Availability Zone to use for this host group. Only single zone is supported. The zone can be assigned only during creation. - // If not provided, the group supports all zones in the region. If provided, - // enforces each host in the group to be in the same zone. - Zones []*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -type DedicatedHostGroupInstanceView struct { - // List of instance view of the dedicated hosts under the dedicated host group. - Hosts []*DedicatedHostInstanceViewWithName -} - -// DedicatedHostGroupListResult - The List Dedicated Host Group with resource group response. -type DedicatedHostGroupListResult struct { - // REQUIRED; The list of dedicated host groups - Value []*DedicatedHostGroup - - // The URI to fetch the next page of Dedicated Host Groups. Call ListNext() with this URI to fetch the next page of Dedicated - // Host Groups. - NextLink *string -} - -// DedicatedHostGroupProperties - Dedicated Host Group Properties. -type DedicatedHostGroupProperties struct { - // REQUIRED; Number of fault domains that the host group can span. - PlatformFaultDomainCount *int32 - - // Enables or disables a capability on the dedicated host group. Minimum api-version: 2022-03-01. - AdditionalCapabilities *DedicatedHostGroupPropertiesAdditionalCapabilities - - // Specifies whether virtual machines or virtual machine scale sets can be placed automatically on the dedicated host group. - // Automatic placement means resources are allocated on dedicated hosts, that are - // chosen by Azure, under the dedicated host group. The value is defaulted to 'false' when not provided. Minimum api-version: - // 2020-06-01. - SupportAutomaticPlacement *bool - - // READ-ONLY; A list of references to all dedicated hosts in the dedicated host group. - Hosts []*SubResourceReadOnly - - // READ-ONLY; The dedicated host group instance view, which has the list of instance view of the dedicated hosts under the - // dedicated host group. - InstanceView *DedicatedHostGroupInstanceView -} - -// DedicatedHostGroupPropertiesAdditionalCapabilities - Enables or disables a capability on the dedicated host group. Minimum -// api-version: 2022-03-01. -type DedicatedHostGroupPropertiesAdditionalCapabilities struct { - // The flag that enables or disables a capability to have UltraSSD Enabled Virtual Machines on Dedicated Hosts of the Dedicated - // Host Group. For the Virtual Machines to be UltraSSD Enabled, - // UltraSSDEnabled flag for the resource needs to be set true as well. The value is defaulted to 'false' when not provided. - // Please refer to - // https://docs.microsoft.com/en-us/azure/virtual-machines/disks-enable-ultra-ssd for more details on Ultra SSD feature. Note: - // The ultraSSDEnabled setting can only be enabled for Host Groups that are - // created as zonal. Minimum api-version: 2022-03-01. - UltraSSDEnabled *bool -} - -// DedicatedHostGroupUpdate - Specifies information about the dedicated host group that the dedicated host should be assigned -// to. Only tags may be updated. -type DedicatedHostGroupUpdate struct { - // Dedicated Host Group Properties. - Properties *DedicatedHostGroupProperties - - // Resource tags - Tags map[string]*string - - // Availability Zone to use for this host group. Only single zone is supported. The zone can be assigned only during creation. - // If not provided, the group supports all zones in the region. If provided, - // enforces each host in the group to be in the same zone. - Zones []*string -} - -// DedicatedHostInstanceView - The instance view of a dedicated host. -type DedicatedHostInstanceView struct { - // Unutilized capacity of the dedicated host. - AvailableCapacity *DedicatedHostAvailableCapacity - - // The resource status information. - Statuses []*InstanceViewStatus - - // READ-ONLY; Specifies the unique id of the dedicated physical machine on which the dedicated host resides. - AssetID *string -} - -// DedicatedHostInstanceViewWithName - The instance view of a dedicated host that includes the name of the dedicated host. -// It is used for the response to the instance view of a dedicated host group. -type DedicatedHostInstanceViewWithName struct { - // Unutilized capacity of the dedicated host. - AvailableCapacity *DedicatedHostAvailableCapacity - - // The resource status information. - Statuses []*InstanceViewStatus - - // READ-ONLY; Specifies the unique id of the dedicated physical machine on which the dedicated host resides. - AssetID *string - - // READ-ONLY; The name of the dedicated host. - Name *string -} - -// DedicatedHostListResult - The list dedicated host operation response. -type DedicatedHostListResult struct { - // REQUIRED; The list of dedicated hosts - Value []*DedicatedHost - - // The URI to fetch the next page of dedicated hosts. Call ListNext() with this URI to fetch the next page of dedicated hosts. - NextLink *string -} - -// DedicatedHostProperties - Properties of the dedicated host. -type DedicatedHostProperties struct { - // Specifies whether the dedicated host should be replaced automatically in case of a failure. The value is defaulted to 'true' - // when not provided. - AutoReplaceOnFailure *bool - - // Specifies the software license type that will be applied to the VMs deployed on the dedicated host. Possible values are: - // None, WindowsServerHybrid, WindowsServerPerpetual. The default value is: None. - LicenseType *DedicatedHostLicenseTypes - - // Fault domain of the dedicated host within a dedicated host group. - PlatformFaultDomain *int32 - - // READ-ONLY; A unique id generated and assigned to the dedicated host by the platform. Does not change throughout the lifetime - // of the host. - HostID *string - - // READ-ONLY; The dedicated host instance view. - InstanceView *DedicatedHostInstanceView - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string - - // READ-ONLY; The date when the host was first provisioned. - ProvisioningTime *time.Time - - // READ-ONLY; Specifies the time at which the Dedicated Host resource was created. Minimum api-version: 2021-11-01. - TimeCreated *time.Time - - // READ-ONLY; A list of references to all virtual machines in the Dedicated Host. - VirtualMachines []*SubResourceReadOnly -} - -// DedicatedHostSizeListResult - The List Dedicated Host sizes operation response. -type DedicatedHostSizeListResult struct { - // The list of dedicated host sizes. - Value []*string -} - -// DedicatedHostUpdate - Specifies information about the dedicated host. Only tags, autoReplaceOnFailure and licenseType may -// be updated. -type DedicatedHostUpdate struct { - // Properties of the dedicated host. - Properties *DedicatedHostProperties - - // List all available dedicated host sizes for resizing [https://docs.microsoft.com/rest/api/compute/dedicated-hosts/listavailablesizes]. - // Resizing can be only used to scale up DedicatedHost. Only name is - // required to be set. - SKU *SKU - - // Resource tags - Tags map[string]*string -} - -// DiagnosticsProfile - Specifies the boot diagnostic settings state. Minimum api-version: 2015-06-15. -type DiagnosticsProfile struct { - // Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status. NOTE: - // If storageUri is being specified then ensure that the storage account is in - // the same region and subscription as the VM. You can easily view the output of your console log. Azure also enables you - // to see a screenshot of the VM from the hypervisor. - BootDiagnostics *BootDiagnostics -} - -// DiffDiskSettings - Describes the parameters of ephemeral disk settings that can be specified for operating system disk. -// Note: The ephemeral disk settings can only be specified for managed disk. -type DiffDiskSettings struct { - // Specifies the ephemeral disk settings for operating system disk. - Option *DiffDiskOptions - - // Specifies the ephemeral disk placement for operating system disk. Possible values are: CacheDisk, ResourceDisk, NvmeDisk. - // The defaulting behavior is: CacheDisk if one is configured for the VM size - // otherwise ResourceDisk or NvmeDisk is used. Refer to the VM size documentation for Windows VM at https://docs.microsoft.com/azure/virtual-machines/windows/sizes - // and Linux VM at - // https://docs.microsoft.com/azure/virtual-machines/linux/sizes to check which VM sizes exposes a cache disk. Minimum api-version - // for NvmeDisk: 2024-03-01. - Placement *DiffDiskPlacement -} - -// Disallowed - Describes the disallowed disk types. -type Disallowed struct { - // A list of disk types. - DiskTypes []*string -} - -// DisallowedConfiguration - Specifies the disallowed configuration for a virtual machine image. -type DisallowedConfiguration struct { - // VM disk types which are disallowed. - VMDiskType *VMDiskTypes -} - -// Disk resource. -type Disk struct { - // REQUIRED; Resource location - Location *string - - // The extended location where the disk will be created. Extended location cannot be changed. - ExtendedLocation *ExtendedLocation - - // Disk resource properties. - Properties *DiskProperties - - // The disks sku name. Can be StandardLRS, PremiumLRS, StandardSSDLRS, UltraSSDLRS, PremiumZRS, StandardSSDZRS, or PremiumV2_LRS. - SKU *DiskSKU - - // Resource tags - Tags map[string]*string - - // The Logical zone list for Disk. - Zones []*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; A relative URI containing the ID of the VM that has the disk attached. - ManagedBy *string - - // READ-ONLY; List of relative URIs containing the IDs of the VMs that have the disk attached. maxShares should be set to - // a value greater than one for disks to allow attaching them to multiple VMs. - ManagedByExtended []*string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// DiskAccess - disk access resource. -type DiskAccess struct { - // REQUIRED; Resource location - Location *string - - // The extended location where the disk access will be created. Extended location cannot be changed. - ExtendedLocation *ExtendedLocation - Properties *DiskAccessProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// DiskAccessList - The List disk access operation response. -type DiskAccessList struct { - // REQUIRED; A list of disk access resources. - Value []*DiskAccess - - // The uri to fetch the next page of disk access resources. Call ListNext() with this to fetch the next page of disk access - // resources. - NextLink *string -} - -type DiskAccessProperties struct { - // READ-ONLY; A readonly collection of private endpoint connections created on the disk. Currently only one endpoint connection - // is supported. - PrivateEndpointConnections []*PrivateEndpointConnection - - // READ-ONLY; The disk access resource provisioning state. - ProvisioningState *string - - // READ-ONLY; The time when the disk access was created. - TimeCreated *time.Time -} - -// DiskAccessUpdate - Used for updating a disk access resource. -type DiskAccessUpdate struct { - // Resource tags - Tags map[string]*string -} - -// DiskEncryptionSet - disk encryption set resource. -type DiskEncryptionSet struct { - // REQUIRED; Resource location - Location *string - - // The managed identity for the disk encryption set. It should be given permission on the key vault before it can be used - // to encrypt disks. - Identity *EncryptionSetIdentity - Properties *EncryptionSetProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// DiskEncryptionSetList - The List disk encryption set operation response. -type DiskEncryptionSetList struct { - // REQUIRED; A list of disk encryption sets. - Value []*DiskEncryptionSet - - // The uri to fetch the next page of disk encryption sets. Call ListNext() with this to fetch the next page of disk encryption - // sets. - NextLink *string -} - -// DiskEncryptionSetParameters - Describes the parameter of customer managed disk encryption set resource id that can be specified -// for disk. Note: The disk encryption set resource id can only be specified for managed disk. Please -// refer https://aka.ms/mdssewithcmkoverview for more details. -type DiskEncryptionSetParameters struct { - // Resource Id - ID *string -} - -// DiskEncryptionSetUpdate - disk encryption set update resource. -type DiskEncryptionSetUpdate struct { - // The managed identity for the disk encryption set. It should be given permission on the key vault before it can be used - // to encrypt disks. - Identity *EncryptionSetIdentity - - // disk encryption set resource update properties. - Properties *DiskEncryptionSetUpdateProperties - - // Resource tags - Tags map[string]*string -} - -// DiskEncryptionSetUpdateProperties - disk encryption set resource update properties. -type DiskEncryptionSetUpdateProperties struct { - // Key Vault Key Url to be used for server side encryption of Managed Disks and Snapshots - ActiveKey *KeyForDiskEncryptionSet - - // The type of key used to encrypt the data of the disk. - EncryptionType *DiskEncryptionSetType - - // Multi-tenant application client id to access key vault in a different tenant. Setting the value to 'None' will clear the - // property. - FederatedClientID *string - - // Set this flag to true to enable auto-updating of this disk encryption set to the latest key version. - RotationToLatestKeyVersionEnabled *bool -} - -// DiskEncryptionSettings - Describes a Encryption Settings for a Disk -type DiskEncryptionSettings struct { - // Specifies the location of the disk encryption key, which is a Key Vault Secret. - DiskEncryptionKey *KeyVaultSecretReference - - // Specifies whether disk encryption should be enabled on the virtual machine. - Enabled *bool - - // Specifies the location of the key encryption key in Key Vault. - KeyEncryptionKey *KeyVaultKeyReference -} - -// DiskImageEncryption - This is the disk image encryption base class. -type DiskImageEncryption struct { - // A relative URI containing the resource ID of the disk encryption set. - DiskEncryptionSetID *string -} - -// DiskInstanceView - The instance view of the disk. -type DiskInstanceView struct { - // Specifies the encryption settings for the OS Disk. - // Minimum api-version: 2015-06-15 - EncryptionSettings []*DiskEncryptionSettings - - // The disk name. - Name *string - - // The resource status information. - Statuses []*InstanceViewStatus -} - -// DiskList - The List Disks operation response. -type DiskList struct { - // REQUIRED; A list of disks. - Value []*Disk - - // The uri to fetch the next page of disks. Call ListNext() with this to fetch the next page of disks. - NextLink *string -} - -// DiskProperties - Disk resource properties. -type DiskProperties struct { - // REQUIRED; Disk source information. CreationData information cannot be changed after the disk has been created. - CreationData *CreationData - - // Set to true to enable bursting beyond the provisioned performance target of the disk. Bursting is disabled by default. - // Does not apply to Ultra disks. - BurstingEnabled *bool - - // Percentage complete for the background copy when a resource is created via the CopyStart operation. - CompletionPercent *float32 - - // Additional authentication requirements when exporting or uploading to a disk or snapshot. - DataAccessAuthMode *DataAccessAuthMode - - // ARM id of the DiskAccess resource for using private endpoints on disks. - DiskAccessID *string - - // The total number of IOPS that will be allowed across all VMs mounting the shared disk as ReadOnly. One operation can transfer - // between 4k and 256k bytes. - DiskIOPSReadOnly *int64 - - // The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k - // bytes. - DiskIOPSReadWrite *int64 - - // The total throughput (MBps) that will be allowed across all VMs mounting the shared disk as ReadOnly. MBps means millions - // of bytes per second - MB here uses the ISO notation, of powers of 10. - DiskMBpsReadOnly *int64 - - // The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps means millions of bytes per second - MB here - // uses the ISO notation, of powers of 10. - DiskMBpsReadWrite *int64 - - // If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this - // field is present for updates or creation with other options, it indicates a - // resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. - DiskSizeGB *int32 - - // Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. - Encryption *Encryption - - // Encryption settings collection used for Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. - EncryptionSettingsCollection *EncryptionSettingsCollection - - // The hypervisor generation of the Virtual Machine. Applicable to OS disks only. - HyperVGeneration *HyperVGeneration - - // The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a disk that can - // be mounted on multiple VMs at the same time. - MaxShares *int32 - - // Policy for accessing the disk via network. - NetworkAccessPolicy *NetworkAccessPolicy - - // The Operating System type. - OSType *OperatingSystemTypes - - // Setting this property to true improves reliability and performance of data disks that are frequently (more than 5 times - // a day) by detached from one virtual machine and attached to another. This - // property should not be set for disks that are not detached and attached frequently as it causes the disks to not align - // with the fault domain of the virtual machine. - OptimizedForFrequentAttach *bool - - // Policy for controlling export on the disk. - PublicNetworkAccess *PublicNetworkAccess - - // Purchase plan information for the the image from which the OS disk was created. E.g. - {name: 2019-Datacenter, publisher: - // MicrosoftWindowsServer, product: WindowsServer} - PurchasePlan *DiskPurchasePlan - - // Contains the security related information for the resource. - SecurityProfile *DiskSecurityProfile - - // List of supported capabilities for the image from which the OS disk was created. - SupportedCapabilities *SupportedCapabilities - - // Indicates the OS on a disk supports hibernation. - SupportsHibernation *bool - - // Performance tier of the disk (e.g, P4, S10) as described here: https://azure.microsoft.com/en-us/pricing/details/managed-disks/. - // Does not apply to Ultra disks. - Tier *string - - // READ-ONLY; Latest time when bursting was last enabled on a disk. - BurstingEnabledTime *time.Time - - // READ-ONLY; The size of the disk in bytes. This field is read only. - DiskSizeBytes *int64 - - // READ-ONLY; The state of the disk. - DiskState *DiskState - - // READ-ONLY; The UTC time when the ownership state of the disk was last changed i.e., the time the disk was last attached - // or detached from a VM or the time when the VM to which the disk was attached was - // deallocated or started. - LastOwnershipUpdateTime *time.Time - - // READ-ONLY; Properties of the disk for which update is pending. - PropertyUpdatesInProgress *PropertyUpdatesInProgress - - // READ-ONLY; The disk provisioning state. - ProvisioningState *string - - // READ-ONLY; Details of the list of all VMs that have the disk attached. maxShares should be set to a value greater than - // one for disks to allow attaching them to multiple VMs. - ShareInfo []*ShareInfoElement - - // READ-ONLY; The time when the disk was created. - TimeCreated *time.Time - - // READ-ONLY; Unique Guid identifying the resource. - UniqueID *string -} - -// DiskPurchasePlan - Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. -type DiskPurchasePlan struct { - // REQUIRED; The plan ID. - Name *string - - // REQUIRED; Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference - // element. - Product *string - - // REQUIRED; The publisher ID. - Publisher *string - - // The Offer Promotion Code. - PromotionCode *string -} - -// DiskRestorePoint - Properties of disk restore point -type DiskRestorePoint struct { - // Properties of an incremental disk restore point - Properties *DiskRestorePointProperties - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// DiskRestorePointAttributes - Disk Restore Point details. -type DiskRestorePointAttributes struct { - // Encryption at rest settings for disk restore point. It is an optional property that can be specified in the input while - // creating a restore point. - Encryption *RestorePointEncryption - - // Resource Id of the source disk restore point. - SourceDiskRestorePoint *APIEntityReference - - // READ-ONLY; Resource Id - ID *string -} - -// DiskRestorePointInstanceView - The instance view of a disk restore point. -type DiskRestorePointInstanceView struct { - // Disk restore point Id. - ID *string - - // The disk restore point replication status information. - ReplicationStatus *DiskRestorePointReplicationStatus -} - -// DiskRestorePointList - The List Disk Restore Points operation response. -type DiskRestorePointList struct { - // REQUIRED; A list of disk restore points. - Value []*DiskRestorePoint - - // The uri to fetch the next page of disk restore points. Call ListNext() with this to fetch the next page of disk restore - // points. - NextLink *string -} - -// DiskRestorePointProperties - Properties of an incremental disk restore point -type DiskRestorePointProperties struct { - // Percentage complete for the background copy of disk restore point when source resource is from a different region. - CompletionPercent *float32 - - // ARM id of the DiskAccess resource for using private endpoints on disks. - DiskAccessID *string - - // The hypervisor generation of the Virtual Machine. Applicable to OS disks only. - HyperVGeneration *HyperVGeneration - - // Policy for accessing the disk via network. - NetworkAccessPolicy *NetworkAccessPolicy - - // Policy for controlling export on the disk. - PublicNetworkAccess *PublicNetworkAccess - - // Purchase plan information for the the image from which the OS disk was created. - PurchasePlan *DiskPurchasePlan - - // Contains the security related information for the resource. - SecurityProfile *DiskSecurityProfile - - // List of supported capabilities for the image from which the OS disk was created. - SupportedCapabilities *SupportedCapabilities - - // Indicates the OS on a disk supports hibernation. - SupportsHibernation *bool - - // READ-ONLY; Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. - Encryption *Encryption - - // READ-ONLY; id of the backing snapshot's MIS family - FamilyID *string - - // READ-ONLY; The Operating System type. - OSType *OperatingSystemTypes - - // READ-ONLY; Replication state of disk restore point when source resource is from a different region. - ReplicationState *string - - // READ-ONLY; arm id of source disk or source disk restore point. - SourceResourceID *string - - // READ-ONLY; Location of source disk or source disk restore point when source resource is from a different region. - SourceResourceLocation *string - - // READ-ONLY; unique incarnation id of the source disk - SourceUniqueID *string - - // READ-ONLY; The timestamp of restorePoint creation - TimeCreated *time.Time -} - -// DiskRestorePointReplicationStatus - The instance view of a disk restore point. -type DiskRestorePointReplicationStatus struct { - // Replication completion percentage. - CompletionPercent *int32 - - // The resource status information. - Status *InstanceViewStatus -} - -// DiskSKU - The disks sku name. Can be StandardLRS, PremiumLRS, StandardSSDLRS, UltraSSDLRS, PremiumZRS, StandardSSDZRS, -// or PremiumV2_LRS. -type DiskSKU struct { - // The sku name. - Name *DiskStorageAccountTypes - - // READ-ONLY; The sku tier. - Tier *string -} - -// DiskSecurityProfile - Contains the security related information for the resource. -type DiskSecurityProfile struct { - // ResourceId of the disk encryption set associated to Confidential VM supported disk encrypted with customer managed key - SecureVMDiskEncryptionSetID *string - - // Specifies the SecurityType of the VM. Applicable for OS disks only. - SecurityType *DiskSecurityTypes -} - -// DiskUpdate - Disk update resource. -type DiskUpdate struct { - // Disk resource update properties. - Properties *DiskUpdateProperties - - // The disks sku name. Can be StandardLRS, PremiumLRS, StandardSSDLRS, UltraSSDLRS, PremiumZRS, StandardSSDZRS, or PremiumV2_LRS. - SKU *DiskSKU - - // Resource tags - Tags map[string]*string -} - -// DiskUpdateProperties - Disk resource update properties. -type DiskUpdateProperties struct { - // Set to true to enable bursting beyond the provisioned performance target of the disk. Bursting is disabled by default. - // Does not apply to Ultra disks. - BurstingEnabled *bool - - // Additional authentication requirements when exporting or uploading to a disk or snapshot. - DataAccessAuthMode *DataAccessAuthMode - - // ARM id of the DiskAccess resource for using private endpoints on disks. - DiskAccessID *string - - // The total number of IOPS that will be allowed across all VMs mounting the shared disk as ReadOnly. One operation can transfer - // between 4k and 256k bytes. - DiskIOPSReadOnly *int64 - - // The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k - // bytes. - DiskIOPSReadWrite *int64 - - // The total throughput (MBps) that will be allowed across all VMs mounting the shared disk as ReadOnly. MBps means millions - // of bytes per second - MB here uses the ISO notation, of powers of 10. - DiskMBpsReadOnly *int64 - - // The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps means millions of bytes per second - MB here - // uses the ISO notation, of powers of 10. - DiskMBpsReadWrite *int64 - - // If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this - // field is present for updates or creation with other options, it indicates a - // resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. - DiskSizeGB *int32 - - // Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. - Encryption *Encryption - - // Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. - EncryptionSettingsCollection *EncryptionSettingsCollection - - // The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a disk that can - // be mounted on multiple VMs at the same time. - MaxShares *int32 - - // Policy for accessing the disk via network. - NetworkAccessPolicy *NetworkAccessPolicy - - // the Operating System type. - OSType *OperatingSystemTypes - - // Setting this property to true improves reliability and performance of data disks that are frequently (more than 5 times - // a day) by detached from one virtual machine and attached to another. This - // property should not be set for disks that are not detached and attached frequently as it causes the disks to not align - // with the fault domain of the virtual machine. - OptimizedForFrequentAttach *bool - - // Policy for controlling export on the disk. - PublicNetworkAccess *PublicNetworkAccess - - // Purchase plan information to be added on the OS disk - PurchasePlan *DiskPurchasePlan - - // List of supported capabilities to be added on the OS disk. - SupportedCapabilities *SupportedCapabilities - - // Indicates the OS on a disk supports hibernation. - SupportsHibernation *bool - - // Performance tier of the disk (e.g, P4, S10) as described here: https://azure.microsoft.com/en-us/pricing/details/managed-disks/. - // Does not apply to Ultra disks. - Tier *string - - // READ-ONLY; Properties of the disk for which update is pending. - PropertyUpdatesInProgress *PropertyUpdatesInProgress -} - -// Encryption at rest settings for disk or snapshot -type Encryption struct { - // ResourceId of the disk encryption set to use for enabling encryption at rest. - DiskEncryptionSetID *string - - // The type of key used to encrypt the data of the disk. - Type *EncryptionType -} - -// EncryptionIdentity - Specifies the Managed Identity used by ADE to get access token for keyvault operations. -type EncryptionIdentity struct { - // Specifies ARM Resource ID of one of the user identities associated with the VM. - UserAssignedIdentityResourceID *string -} - -// EncryptionImages - Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the -// gallery artifact. -type EncryptionImages struct { - // A list of encryption specifications for data disk images. - DataDiskImages []*DataDiskImageEncryption - - // Contains encryption settings for an OS disk image. - OSDiskImage *OSDiskImageEncryption -} - -// EncryptionSetIdentity - The managed identity for the disk encryption set. It should be given permission on the key vault -// before it can be used to encrypt disks. -type EncryptionSetIdentity struct { - // The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is supported for new creations. Disk Encryption - // Sets can be updated with Identity type None during migration of - // subscription to a new Azure Active Directory tenant; it will cause the encrypted resources to lose access to the keys. - Type *DiskEncryptionSetIdentityType - - // The list of user identities associated with the disk encryption set. The user identity dictionary key references will be - // ARM resource ids in the form: - // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - UserAssignedIdentities map[string]*UserAssignedIdentitiesValue - - // READ-ONLY; The object id of the Managed Identity Resource. This will be sent to the RP from ARM via the x-ms-identity-principal-id - // header in the PUT request if the resource has a systemAssigned(implicit) - // identity - PrincipalID *string - - // READ-ONLY; The tenant id of the Managed Identity Resource. This will be sent to the RP from ARM via the x-ms-client-tenant-id - // header in the PUT request if the resource has a systemAssigned(implicit) identity - TenantID *string -} - -type EncryptionSetProperties struct { - // The key vault key which is currently used by this disk encryption set. - ActiveKey *KeyForDiskEncryptionSet - - // The type of key used to encrypt the data of the disk. - EncryptionType *DiskEncryptionSetType - - // Multi-tenant application client id to access key vault in a different tenant. Setting the value to 'None' will clear the - // property. - FederatedClientID *string - - // Set this flag to true to enable auto-updating of this disk encryption set to the latest key version. - RotationToLatestKeyVersionEnabled *bool - - // READ-ONLY; The error that was encountered during auto-key rotation. If an error is present, then auto-key rotation will - // not be attempted until the error on this disk encryption set is fixed. - AutoKeyRotationError *APIError - - // READ-ONLY; The time when the active key of this disk encryption set was updated. - LastKeyRotationTimestamp *time.Time - - // READ-ONLY; A readonly collection of key vault keys previously used by this disk encryption set while a key rotation is - // in progress. It will be empty if there is no ongoing key rotation. - PreviousKeys []*KeyForDiskEncryptionSet - - // READ-ONLY; The disk encryption set provisioning state. - ProvisioningState *string -} - -// EncryptionSettingsCollection - Encryption settings for disk or snapshot -type EncryptionSettingsCollection struct { - // REQUIRED; Set this flag to true and provide DiskEncryptionKey and optional KeyEncryptionKey to enable encryption. Set this - // flag to false and remove DiskEncryptionKey and KeyEncryptionKey to disable encryption. - // If EncryptionSettings is null in the request object, the existing settings remain unchanged. - Enabled *bool - - // A collection of encryption settings, one for each disk volume. - EncryptionSettings []*EncryptionSettingsElement - - // Describes what type of encryption is used for the disks. Once this field is set, it cannot be overwritten. '1.0' corresponds - // to Azure Disk Encryption with AAD app.'1.1' corresponds to Azure Disk - // Encryption. - EncryptionSettingsVersion *string -} - -// EncryptionSettingsElement - Encryption settings for one disk volume. -type EncryptionSettingsElement struct { - // Key Vault Secret Url and vault id of the disk encryption key - DiskEncryptionKey *KeyVaultAndSecretReference - - // Key Vault Key Url and vault id of the key encryption key. KeyEncryptionKey is optional and when provided is used to unwrap - // the disk encryption key. - KeyEncryptionKey *KeyVaultAndKeyReference -} - -// EventGridAndResourceGraph - Specifies eventGridAndResourceGraph related Scheduled Event related configurations. -type EventGridAndResourceGraph struct { - // Specifies if event grid and resource graph is enabled for Scheduled event related configurations. - Enable *bool -} - -// ExtendedLocation - The complex type of the extended location. -type ExtendedLocation struct { - // The name of the extended location. - Name *string - - // The type of the extended location. - Type *ExtendedLocationTypes -} - -// Extension - Describes a cloud service Extension. -type Extension struct { - // The name of the extension. - Name *string - - // Extension Properties. - Properties *CloudServiceExtensionProperties -} - -// Gallery - Specifies information about the Shared Image Gallery that you want to create or update. -type Gallery struct { - // REQUIRED; Resource location - Location *string - - // Describes the properties of a Shared Image Gallery. - Properties *GalleryProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// GalleryApplication - Specifies information about the gallery Application Definition that you want to create or update. -type GalleryApplication struct { - // REQUIRED; Resource location - Location *string - - // Describes the properties of a gallery Application Definition. - Properties *GalleryApplicationProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// GalleryApplicationCustomAction - A custom action that can be performed with a Gallery Application Version. -type GalleryApplicationCustomAction struct { - // REQUIRED; The name of the custom action. Must be unique within the Gallery Application Version. - Name *string - - // REQUIRED; The script to run when executing this custom action. - Script *string - - // Description to help the users understand what this custom action does. - Description *string - - // The parameters that this custom action uses - Parameters []*GalleryApplicationCustomActionParameter -} - -// GalleryApplicationCustomActionParameter - The definition of a parameter that can be passed to a custom action of a Gallery -// Application Version. -type GalleryApplicationCustomActionParameter struct { - // REQUIRED; The name of the custom action. Must be unique within the Gallery Application Version. - Name *string - - // The default value of the parameter. Only applies to string types - DefaultValue *string - - // A description to help users understand what this parameter means - Description *string - - // Indicates whether this parameter must be passed when running the custom action. - Required *bool - - // Specifies the type of the custom action parameter. Possible values are: String, ConfigurationDataBlob or LogOutputBlob - Type *GalleryApplicationCustomActionParameterType -} - -// GalleryApplicationList - The List Gallery Applications operation response. -type GalleryApplicationList struct { - // REQUIRED; A list of Gallery Applications. - Value []*GalleryApplication - - // The uri to fetch the next page of Application Definitions in the Application Gallery. Call ListNext() with this to fetch - // the next page of gallery Application Definitions. - NextLink *string -} - -// GalleryApplicationProperties - Describes the properties of a gallery Application Definition. -type GalleryApplicationProperties struct { - // REQUIRED; This property allows you to specify the supported type of the OS that application is built for. Possible values - // are: Windows, Linux. - SupportedOSType *OperatingSystemTypes - - // A list of custom actions that can be performed with all of the Gallery Application Versions within this Gallery Application. - CustomActions []*GalleryApplicationCustomAction - - // The description of this gallery Application Definition resource. This property is updatable. - Description *string - - // The end of life date of the gallery Application Definition. This property can be used for decommissioning purposes. This - // property is updatable. - EndOfLifeDate *time.Time - - // The Eula agreement for the gallery Application Definition. - Eula *string - - // The privacy statement uri. - PrivacyStatementURI *string - - // The release note uri. - ReleaseNoteURI *string -} - -// GalleryApplicationUpdate - Specifies information about the gallery Application Definition that you want to update. -type GalleryApplicationUpdate struct { - // Describes the properties of a gallery Application Definition. - Properties *GalleryApplicationProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// GalleryApplicationVersion - Specifies information about the gallery Application Version that you want to create or update. -type GalleryApplicationVersion struct { - // REQUIRED; Resource location - Location *string - - // Describes the properties of a gallery image version. - Properties *GalleryApplicationVersionProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// GalleryApplicationVersionList - The List Gallery Application version operation response. -type GalleryApplicationVersionList struct { - // REQUIRED; A list of gallery Application Versions. - Value []*GalleryApplicationVersion - - // The uri to fetch the next page of gallery Application Versions. Call ListNext() with this to fetch the next page of gallery - // Application Versions. - NextLink *string -} - -// GalleryApplicationVersionProperties - Describes the properties of a gallery image version. -type GalleryApplicationVersionProperties struct { - // REQUIRED; The publishing profile of a gallery image version. - PublishingProfile *GalleryApplicationVersionPublishingProfile - - // The safety profile of the Gallery Application Version. - SafetyProfile *GalleryApplicationVersionSafetyProfile - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *GalleryProvisioningState - - // READ-ONLY; This is the replication status of the gallery image version. - ReplicationStatus *ReplicationStatus -} - -// GalleryApplicationVersionPublishingProfile - The publishing profile of a gallery image version. -type GalleryApplicationVersionPublishingProfile struct { - // REQUIRED; The source image from which the Image Version is going to be created. - Source *UserArtifactSource - - // Optional. Additional settings to pass to the vm-application-manager extension. For advanced use only. - AdvancedSettings map[string]*string - - // A list of custom actions that can be performed with this Gallery Application Version. - CustomActions []*GalleryApplicationCustomAction - - // Optional. Whether or not this application reports health. - EnableHealthCheck *bool - - // The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property - // is updatable. - EndOfLifeDate *time.Time - - // If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. - ExcludeFromLatest *bool - ManageActions *UserArtifactManage - - // The number of replicas of the Image Version to be created per region. This property would take effect for a region when - // regionalReplicaCount is not specified. This property is updatable. - ReplicaCount *int32 - - // Optional parameter which specifies the mode to be used for replication. This property is not updatable. - ReplicationMode *ReplicationMode - - // Additional settings for the VM app that contains the target package and config file name when it is deployed to target - // VM or VM scale set. - Settings *UserArtifactSettings - - // Specifies the storage account type to be used to store the image. This property is not updatable. - StorageAccountType *StorageAccountType - - // The target extended locations where the Image Version is going to be replicated to. This property is updatable. - TargetExtendedLocations []*GalleryTargetExtendedLocation - - // The target regions where the Image Version is going to be replicated to. This property is updatable. - TargetRegions []*TargetRegion - - // READ-ONLY; The timestamp for when the gallery image version is published. - PublishedDate *time.Time -} - -// GalleryApplicationVersionSafetyProfile - The safety profile of the Gallery Application Version. -type GalleryApplicationVersionSafetyProfile struct { - // Indicates whether or not removing this Gallery Image Version from replicated regions is allowed. - AllowDeletionOfReplicatedLocations *bool -} - -// GalleryApplicationVersionUpdate - Specifies information about the gallery Application Version that you want to update. -type GalleryApplicationVersionUpdate struct { - // Describes the properties of a gallery image version. - Properties *GalleryApplicationVersionProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// GalleryArtifactPublishingProfileBase - Describes the basic gallery artifact publishing profile. -type GalleryArtifactPublishingProfileBase struct { - // The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property - // is updatable. - EndOfLifeDate *time.Time - - // If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. - ExcludeFromLatest *bool - - // The number of replicas of the Image Version to be created per region. This property would take effect for a region when - // regionalReplicaCount is not specified. This property is updatable. - ReplicaCount *int32 - - // Optional parameter which specifies the mode to be used for replication. This property is not updatable. - ReplicationMode *ReplicationMode - - // Specifies the storage account type to be used to store the image. This property is not updatable. - StorageAccountType *StorageAccountType - - // The target extended locations where the Image Version is going to be replicated to. This property is updatable. - TargetExtendedLocations []*GalleryTargetExtendedLocation - - // The target regions where the Image Version is going to be replicated to. This property is updatable. - TargetRegions []*TargetRegion - - // READ-ONLY; The timestamp for when the gallery image version is published. - PublishedDate *time.Time -} - -// GalleryArtifactSafetyProfileBase - This is the safety profile of the Gallery Artifact Version. -type GalleryArtifactSafetyProfileBase struct { - // Indicates whether or not removing this Gallery Image Version from replicated regions is allowed. - AllowDeletionOfReplicatedLocations *bool -} - -// GalleryArtifactSource - The source image from which the Image Version is going to be created. -type GalleryArtifactSource struct { - // REQUIRED; The managed artifact. - ManagedImage *ManagedArtifact -} - -// GalleryArtifactVersionFullSource - The source of the gallery artifact version. -type GalleryArtifactVersionFullSource struct { - // The resource Id of the source Community Gallery Image. Only required when using Community Gallery Image as a source. - CommunityGalleryImageID *string - - // The id of the gallery artifact version source. - ID *string - - // The resource Id of the source virtual machine. Only required when capturing a virtual machine to source this Gallery Image - // Version. - VirtualMachineID *string -} - -// GalleryArtifactVersionSource - The gallery artifact version source. -type GalleryArtifactVersionSource struct { - // The id of the gallery artifact version source. - ID *string -} - -// GalleryDataDiskImage - This is the data disk image. -type GalleryDataDiskImage struct { - // REQUIRED; This property specifies the logical unit number of the data disk. This value is used to identify data disks within - // the Virtual Machine and therefore must be unique for each data disk attached to the - // Virtual Machine. - Lun *int32 - - // The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' - HostCaching *HostCaching - - // The source for the disk image. - Source *GalleryDiskImageSource - - // READ-ONLY; This property indicates the size of the VHD to be created. - SizeInGB *int32 -} - -// GalleryDiskImage - This is the disk image base class. -type GalleryDiskImage struct { - // The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' - HostCaching *HostCaching - - // The source for the disk image. - Source *GalleryDiskImageSource - - // READ-ONLY; This property indicates the size of the VHD to be created. - SizeInGB *int32 -} - -// GalleryDiskImageSource - The source for the disk image. -type GalleryDiskImageSource struct { - // The id of the gallery artifact version source. - ID *string - - // The Storage Account Id that contains the vhd blob being used as a source for this artifact version. - StorageAccountID *string - - // The uri of the gallery artifact version source. Currently used to specify vhd/blob source. - URI *string -} - -// GalleryExtendedLocation - The name of the extended location. -type GalleryExtendedLocation struct { - Name *string - - // It is type of the extended location. - Type *GalleryExtendedLocationType -} - -// GalleryIdentifier - Describes the gallery unique name. -type GalleryIdentifier struct { - // READ-ONLY; The unique name of the Shared Image Gallery. This name is generated automatically by Azure. - UniqueName *string -} - -// GalleryImage - Specifies information about the gallery image definition that you want to create or update. -type GalleryImage struct { - // REQUIRED; Resource location - Location *string - - // Describes the properties of a gallery image definition. - Properties *GalleryImageProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// GalleryImageFeature - A feature for gallery image. -type GalleryImageFeature struct { - // The name of the gallery image feature. - Name *string - - // The value of the gallery image feature. - Value *string -} - -// GalleryImageIdentifier - This is the gallery image definition identifier. -type GalleryImageIdentifier struct { - // REQUIRED; The name of the gallery image definition offer. - Offer *string - - // REQUIRED; The name of the gallery image definition publisher. - Publisher *string - - // REQUIRED; The name of the gallery image definition SKU. - SKU *string -} - -// GalleryImageList - The List Gallery Images operation response. -type GalleryImageList struct { - // REQUIRED; A list of Shared Image Gallery images. - Value []*GalleryImage - - // The uri to fetch the next page of Image Definitions in the Shared Image Gallery. Call ListNext() with this to fetch the - // next page of gallery image definitions. - NextLink *string -} - -// GalleryImageProperties - Describes the properties of a gallery image definition. -type GalleryImageProperties struct { - // REQUIRED; This is the gallery image definition identifier. - Identifier *GalleryImageIdentifier - - // REQUIRED; This property allows the user to specify whether the virtual machines created under this image are 'Generalized' - // or 'Specialized'. - OSState *OperatingSystemStateTypes - - // REQUIRED; This property allows you to specify the type of the OS that is included in the disk when creating a VM from a - // managed image. Possible values are: Windows, Linux. - OSType *OperatingSystemTypes - - // The architecture of the image. Applicable to OS disks only. - Architecture *Architecture - - // The description of this gallery image definition resource. This property is updatable. - Description *string - - // Describes the disallowed disk types. - Disallowed *Disallowed - - // The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property - // is updatable. - EndOfLifeDate *time.Time - - // The Eula agreement for the gallery image definition. - Eula *string - - // A list of gallery image features. - Features []*GalleryImageFeature - - // The hypervisor generation of the Virtual Machine. Applicable to OS disks only. - HyperVGeneration *HyperVGeneration - - // The privacy statement uri. - PrivacyStatementURI *string - - // Describes the gallery image definition purchase plan. This is used by marketplace images. - PurchasePlan *ImagePurchasePlan - - // The properties describe the recommended machine configuration for this Image Definition. These properties are updatable. - Recommended *RecommendedMachineConfiguration - - // The release note uri. - ReleaseNoteURI *string - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *GalleryProvisioningState -} - -// GalleryImageUpdate - Specifies information about the gallery image definition that you want to update. -type GalleryImageUpdate struct { - // Describes the properties of a gallery image definition. - Properties *GalleryImageProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// GalleryImageVersion - Specifies information about the gallery image version that you want to create or update. -type GalleryImageVersion struct { - // REQUIRED; Resource location - Location *string - - // Describes the properties of a gallery image version. - Properties *GalleryImageVersionProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// GalleryImageVersionList - The List Gallery Image version operation response. -type GalleryImageVersionList struct { - // REQUIRED; A list of gallery image versions. - Value []*GalleryImageVersion - - // The uri to fetch the next page of gallery image versions. Call ListNext() with this to fetch the next page of gallery image - // versions. - NextLink *string -} - -// GalleryImageVersionProperties - Describes the properties of a gallery image version. -type GalleryImageVersionProperties struct { - // REQUIRED; This is the storage profile of a Gallery Image Version. - StorageProfile *GalleryImageVersionStorageProfile - - // The publishing profile of a gallery image Version. - PublishingProfile *GalleryImageVersionPublishingProfile - - // This is the safety profile of the Gallery Image Version. - SafetyProfile *GalleryImageVersionSafetyProfile - - // The security profile of a gallery image version - SecurityProfile *ImageVersionSecurityProfile - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *GalleryProvisioningState - - // READ-ONLY; This is the replication status of the gallery image version. - ReplicationStatus *ReplicationStatus -} - -// GalleryImageVersionPublishingProfile - The publishing profile of a gallery image Version. -type GalleryImageVersionPublishingProfile struct { - // The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property - // is updatable. - EndOfLifeDate *time.Time - - // If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. - ExcludeFromLatest *bool - - // The number of replicas of the Image Version to be created per region. This property would take effect for a region when - // regionalReplicaCount is not specified. This property is updatable. - ReplicaCount *int32 - - // Optional parameter which specifies the mode to be used for replication. This property is not updatable. - ReplicationMode *ReplicationMode - - // Specifies the storage account type to be used to store the image. This property is not updatable. - StorageAccountType *StorageAccountType - - // The target extended locations where the Image Version is going to be replicated to. This property is updatable. - TargetExtendedLocations []*GalleryTargetExtendedLocation - - // The target regions where the Image Version is going to be replicated to. This property is updatable. - TargetRegions []*TargetRegion - - // READ-ONLY; The timestamp for when the gallery image version is published. - PublishedDate *time.Time -} - -// GalleryImageVersionSafetyProfile - This is the safety profile of the Gallery Image Version. -type GalleryImageVersionSafetyProfile struct { - // Indicates whether or not removing this Gallery Image Version from replicated regions is allowed. - AllowDeletionOfReplicatedLocations *bool - - // READ-ONLY; A list of Policy Violations that have been reported for this Gallery Image Version. - PolicyViolations []*PolicyViolation - - // READ-ONLY; Indicates whether this image has been reported as violating Microsoft's policies. - ReportedForPolicyViolation *bool -} - -// GalleryImageVersionStorageProfile - This is the storage profile of a Gallery Image Version. -type GalleryImageVersionStorageProfile struct { - // A list of data disk images. - DataDiskImages []*GalleryDataDiskImage - - // This is the OS disk image. - OSDiskImage *GalleryOSDiskImage - - // The source of the gallery artifact version. - Source *GalleryArtifactVersionFullSource -} - -// GalleryImageVersionUefiSettings - Contains UEFI settings for the image version. -type GalleryImageVersionUefiSettings struct { - // Additional UEFI key signatures that will be added to the image in addition to the signature templates - AdditionalSignatures *UefiKeySignatures - - // The name of the template(s) that contains default UEFI key signatures that will be added to the image. - SignatureTemplateNames []*UefiSignatureTemplateName -} - -// GalleryImageVersionUpdate - Specifies information about the gallery image version that you want to update. -type GalleryImageVersionUpdate struct { - // Describes the properties of a gallery image version. - Properties *GalleryImageVersionProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// GalleryList - The List Galleries operation response. -type GalleryList struct { - // REQUIRED; A list of galleries. - Value []*Gallery - - // The uri to fetch the next page of galleries. Call ListNext() with this to fetch the next page of galleries. - NextLink *string -} - -// GalleryOSDiskImage - This is the OS disk image. -type GalleryOSDiskImage struct { - // The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' - HostCaching *HostCaching - - // The source for the disk image. - Source *GalleryDiskImageSource - - // READ-ONLY; This property indicates the size of the VHD to be created. - SizeInGB *int32 -} - -// GalleryProperties - Describes the properties of a Shared Image Gallery. -type GalleryProperties struct { - // The description of this Shared Image Gallery resource. This property is updatable. - Description *string - - // Describes the gallery unique name. - Identifier *GalleryIdentifier - - // Profile for gallery sharing to subscription or tenant - SharingProfile *SharingProfile - - // Contains information about the soft deletion policy of the gallery. - SoftDeletePolicy *SoftDeletePolicy - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *GalleryProvisioningState - - // READ-ONLY; Sharing status of current gallery. - SharingStatus *SharingStatus -} - -type GalleryTargetExtendedLocation struct { - // Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. - Encryption *EncryptionImages - - // The name of the extended location. - ExtendedLocation *GalleryExtendedLocation - - // The number of replicas of the Image Version to be created per extended location. This property is updatable. - ExtendedLocationReplicaCount *int32 - - // The name of the region. - Name *string - - // Specifies the storage account type to be used to store the image. This property is not updatable. - StorageAccountType *EdgeZoneStorageAccountType -} - -// GalleryUpdate - Specifies information about the Shared Image Gallery that you want to update. -type GalleryUpdate struct { - // Describes the properties of a Shared Image Gallery. - Properties *GalleryProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// GrantAccessData - Data used for requesting a SAS. -type GrantAccessData struct { - // REQUIRED - Access *AccessLevel - - // REQUIRED; Time duration in seconds until the SAS access expires. - DurationInSeconds *int32 - - // Used to specify the file format when making request for SAS on a VHDX file format snapshot - FileFormat *FileFormat - - // Set this flag to true to get additional SAS for VM guest state - GetSecureVMGuestStateSAS *bool -} - -// HardwareProfile - Specifies the hardware settings for the virtual machine. -type HardwareProfile struct { - // Specifies the size of the virtual machine. The enum data type is currently deprecated and will be removed by December 23rd - // 2023. The recommended way to get the list of available sizes is using these - // APIs: List all available virtual machine sizes in an availability set [https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes], - // List all available virtual machine sizes in a - // region [https://docs.microsoft.com/rest/api/compute/resourceskus/list], List all available virtual machine sizes for resizing - // [https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes]. For more information about virtual machine - // sizes, see Sizes for virtual machines - // [https://docs.microsoft.com/azure/virtual-machines/sizes]. The available VM sizes depend on region and availability set. - VMSize *VirtualMachineSizeTypes - - // Specifies the properties for customizing the size of the virtual machine. Minimum api-version: 2021-07-01. This feature - // is still in preview mode and is not supported for VirtualMachineScaleSet. Please - // follow the instructions in VM Customization [https://aka.ms/vmcustomization] for more details. - VMSizeProperties *VMSizeProperties -} - -// Image - The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual -// machine. If SourceImage is provided, the destination virtual hard drive must not -// exist. -type Image struct { - // REQUIRED; Resource location - Location *string - - // The extended location of the Image. - ExtendedLocation *ExtendedLocation - - // Describes the properties of an Image. - Properties *ImageProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// ImageDataDisk - Describes a data disk. -type ImageDataDisk struct { - // REQUIRED; Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and - // therefore must be unique for each data disk attached to a VM. - Lun *int32 - - // The Virtual Hard Disk. - BlobURI *string - - // Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The default values are: None for Standard - // storage. ReadOnly for Premium storage. - Caching *CachingTypes - - // Specifies the customer managed disk encryption set resource id for the managed image disk. - DiskEncryptionSet *DiskEncryptionSetParameters - - // Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual - // machine image. This value cannot be larger than 1023 GB. - DiskSizeGB *int32 - - // The managedDisk. - ManagedDisk *SubResource - - // The snapshot. - Snapshot *SubResource - - // Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot - // be used with OS Disk. - StorageAccountType *StorageAccountTypes -} - -// ImageDeprecationStatus - Describes image deprecation status properties on the image. -type ImageDeprecationStatus struct { - // Describes the alternative option specified by the Publisher for this image when this image is deprecated. - AlternativeOption *AlternativeOption - - // Describes the state of the image. - ImageState *ImageState - - // The time, in future, at which this image will be marked as deprecated. This scheduled time is chosen by the Publisher. - ScheduledDeprecationTime *time.Time -} - -// ImageDisk - Describes a image disk. -type ImageDisk struct { - // The Virtual Hard Disk. - BlobURI *string - - // Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The default values are: None for Standard - // storage. ReadOnly for Premium storage. - Caching *CachingTypes - - // Specifies the customer managed disk encryption set resource id for the managed image disk. - DiskEncryptionSet *DiskEncryptionSetParameters - - // Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual - // machine image. This value cannot be larger than 1023 GB. - DiskSizeGB *int32 - - // The managedDisk. - ManagedDisk *SubResource - - // The snapshot. - Snapshot *SubResource - - // Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot - // be used with OS Disk. - StorageAccountType *StorageAccountTypes -} - -// ImageDiskReference - The source image used for creating the disk. -type ImageDiskReference struct { - // A relative uri containing a community Azure Compute Gallery image reference. - CommunityGalleryImageID *string - - // A relative uri containing either a Platform Image Repository, user image, or Azure Compute Gallery image reference. - ID *string - - // If the disk is created from an image's data disk, this is an index that indicates which of the data disks in the image - // to use. For OS disks, this field is null. - Lun *int32 - - // A relative uri containing a direct shared Azure Compute Gallery image reference. - SharedGalleryImageID *string -} - -// ImageListResult - The List Image operation response. -type ImageListResult struct { - // REQUIRED; The list of Images. - Value []*Image - - // The uri to fetch the next page of Images. Call ListNext() with this to fetch the next page of Images. - NextLink *string -} - -// ImageOSDisk - Describes an Operating System disk. -type ImageOSDisk struct { - // REQUIRED; The OS State. For managed images, use Generalized. - OSState *OperatingSystemStateTypes - - // REQUIRED; This property allows you to specify the type of the OS that is included in the disk if creating a VM from a custom - // image. Possible values are: Windows, Linux. - OSType *OperatingSystemTypes - - // The Virtual Hard Disk. - BlobURI *string - - // Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The default values are: None for Standard - // storage. ReadOnly for Premium storage. - Caching *CachingTypes - - // Specifies the customer managed disk encryption set resource id for the managed image disk. - DiskEncryptionSet *DiskEncryptionSetParameters - - // Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual - // machine image. This value cannot be larger than 1023 GB. - DiskSizeGB *int32 - - // The managedDisk. - ManagedDisk *SubResource - - // The snapshot. - Snapshot *SubResource - - // Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot - // be used with OS Disk. - StorageAccountType *StorageAccountTypes -} - -// ImageProperties - Describes the properties of an Image. -type ImageProperties struct { - // Specifies the HyperVGenerationType of the VirtualMachine created from the image. From API Version 2019-03-01 if the image - // source is a blob, then we need the user to specify the value, if the source is - // managed resource like disk or snapshot, we may require the user to specify the property if we cannot deduce it from the - // source managed resource. - HyperVGeneration *HyperVGenerationTypes - - // The source virtual machine from which Image is created. - SourceVirtualMachine *SubResource - - // Specifies the storage settings for the virtual machine disks. - StorageProfile *ImageStorageProfile - - // READ-ONLY; The provisioning state. - ProvisioningState *string -} - -// ImagePurchasePlan - Describes the gallery image definition purchase plan. This is used by marketplace images. -type ImagePurchasePlan struct { - // The plan ID. - Name *string - - // The product ID. - Product *string - - // The publisher ID. - Publisher *string -} - -// ImageReference - Specifies information about the image to use. You can specify information about platform images, marketplace -// images, or virtual machine images. This element is required when you want to use a platform -// image, marketplace image, or virtual machine image, but is not used in other creation operations. NOTE: Image reference -// publisher and offer can only be set when you create the scale set. -type ImageReference struct { - // Specified the community gallery image unique id for vm deployment. This can be fetched from community gallery image GET - // call. - CommunityGalleryImageID *string - - // Resource Id - ID *string - - // Specifies the offer of the platform image or marketplace image used to create the virtual machine. - Offer *string - - // The image publisher. - Publisher *string - - // The image SKU. - SKU *string - - // Specified the shared gallery image unique id for vm deployment. This can be fetched from shared gallery image GET call. - SharedGalleryImageID *string - - // Specifies the version of the platform image or marketplace image used to create the virtual machine. The allowed formats - // are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal numbers. - // Specify 'latest' to use the latest version of an image available at deploy time. Even if you use 'latest', the VM image - // will not automatically update after deploy time even if a new version becomes - // available. Please do not use field 'version' for gallery image deployment, gallery image should always use 'id' field for - // deployment, to use 'latest' version of gallery image, just set - // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}' - // in the 'id' field without version input. - Version *string - - // READ-ONLY; Specifies in decimal numbers, the version of platform image or marketplace image used to create the virtual - // machine. This readonly field differs from 'version', only if the value specified in - // 'version' field is 'latest'. - ExactVersion *string -} - -// ImageStorageProfile - Describes a storage profile. -type ImageStorageProfile struct { - // Specifies the parameters that are used to add a data disk to a virtual machine. - // For more information about disks, see About disks and VHDs for Azure virtual machines [https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview]. - DataDisks []*ImageDataDisk - - // Specifies information about the operating system disk used by the virtual machine. - // For more information about disks, see About disks and VHDs for Azure virtual machines [https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview]. - OSDisk *ImageOSDisk - - // Specifies whether an image is zone resilient or not. Default is false. Zone resilient images can be created only in regions - // that provide Zone Redundant Storage (ZRS). - ZoneResilient *bool -} - -// ImageUpdate - The source user image virtual hard disk. Only tags may be updated. -type ImageUpdate struct { - // Describes the properties of an Image. - Properties *ImageProperties - - // Resource tags - Tags map[string]*string -} - -// ImageVersionSecurityProfile - The security profile of a gallery image version -type ImageVersionSecurityProfile struct { - // Contains UEFI settings for the image version. - UefiSettings *GalleryImageVersionUefiSettings -} - -// InnerError - Inner error details. -type InnerError struct { - // The internal error message or exception dump. - Errordetail *string - - // The exception type. - Exceptiontype *string -} - -// InstanceSKU - The role instance SKU. -type InstanceSKU struct { - // READ-ONLY; The sku name. - Name *string - - // READ-ONLY; The tier of the cloud service role instance. - Tier *string -} - -// InstanceViewStatus - Instance view status. -type InstanceViewStatus struct { - // The status code. - Code *string - - // The short localizable label for the status. - DisplayStatus *string - - // The level code. - Level *StatusLevelTypes - - // The detailed status message, including for alerts and error messages. - Message *string - - // The time of the status. - Time *time.Time -} - -// InstanceViewStatusesSummary - Instance view statuses. -type InstanceViewStatusesSummary struct { - // READ-ONLY; The summary. - StatusesSummary []*StatusCodeCount -} - -// KeyForDiskEncryptionSet - Key Vault Key Url to be used for server side encryption of Managed Disks and Snapshots -type KeyForDiskEncryptionSet struct { - // REQUIRED; Fully versioned Key Url pointing to a key in KeyVault. Version segment of the Url is required regardless of rotationToLatestKeyVersionEnabled - // value. - KeyURL *string - - // Resource id of the KeyVault containing the key or secret. This property is optional and cannot be used if the KeyVault - // subscription is not the same as the Disk Encryption Set subscription. - SourceVault *SourceVault -} - -// KeyVaultAndKeyReference - Key Vault Key Url and vault id of KeK, KeK is optional and when provided is used to unwrap the -// encryptionKey -type KeyVaultAndKeyReference struct { - // REQUIRED; Url pointing to a key or secret in KeyVault - KeyURL *string - - // REQUIRED; Resource id of the KeyVault containing the key or secret - SourceVault *SourceVault -} - -// KeyVaultAndSecretReference - Key Vault Secret Url and vault id of the encryption key -type KeyVaultAndSecretReference struct { - // REQUIRED; Url pointing to a key or secret in KeyVault - SecretURL *string - - // REQUIRED; Resource id of the KeyVault containing the key or secret - SourceVault *SourceVault -} - -// KeyVaultKeyReference - Describes a reference to Key Vault Key -type KeyVaultKeyReference struct { - // REQUIRED; The URL referencing a key encryption key in Key Vault. - KeyURL *string - - // REQUIRED; The relative URL of the Key Vault containing the key. - SourceVault *SubResource -} - -// KeyVaultSecretReference - Describes a reference to Key Vault Secret -type KeyVaultSecretReference struct { - // REQUIRED; The URL referencing a secret in a Key Vault. - SecretURL *string - - // REQUIRED; The relative URL of the Key Vault containing the secret. - SourceVault *SubResource -} - -// LastPatchInstallationSummary - Describes the properties of the last installed patch summary. -type LastPatchInstallationSummary struct { - // READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. - Error *APIError - - // READ-ONLY; The number of all available patches but excluded explicitly by a customer-specified exclusion list match. - ExcludedPatchCount *int32 - - // READ-ONLY; The count of patches that failed installation. - FailedPatchCount *int32 - - // READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension - // logs. - InstallationActivityID *string - - // READ-ONLY; The count of patches that successfully installed. - InstalledPatchCount *int32 - - // READ-ONLY; The UTC timestamp when the operation began. - LastModifiedTime *time.Time - - // READ-ONLY; Describes whether the operation ran out of time before it completed all its intended actions - MaintenanceWindowExceeded *bool - - // READ-ONLY; The number of all available patches but not going to be installed because it didn't match a classification or - // inclusion list entry. - NotSelectedPatchCount *int32 - - // READ-ONLY; The number of all available patches expected to be installed over the course of the patch installation operation. - PendingPatchCount *int32 - - // READ-ONLY; The UTC timestamp when the operation began. - StartTime *time.Time - - // READ-ONLY; The overall success or failure status of the operation. It remains "InProgress" until the operation completes. - // At that point it will become "Unknown", "Failed", "Succeeded", or - // "CompletedWithWarnings." - Status *PatchOperationStatus -} - -// LatestGalleryImageVersion - The gallery image version with latest version in a particular region. -type LatestGalleryImageVersion struct { - // The name of the latest version in the region. - LatestVersionName *string - - // region of the Gallery Image Version. - Location *string -} - -// LinuxConfiguration - Specifies the Linux operating system settings on the virtual machine. For a list of supported Linux -// distributions, see Linux on Azure-Endorsed Distributions -// [https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros]. -type LinuxConfiguration struct { - // Specifies whether password authentication should be disabled. - DisablePasswordAuthentication *bool - - // Indicates whether VMAgent Platform Updates is enabled for the Linux virtual machine. Default value is false. - EnableVMAgentPlatformUpdates *bool - - // [Preview Feature] Specifies settings related to VM Guest Patching on Linux. - PatchSettings *LinuxPatchSettings - - // Indicates whether virtual machine agent should be provisioned on the virtual machine. When this property is not specified - // in the request body, default behavior is to set it to true. This will ensure - // that VM Agent is installed on the VM so that extensions can be added to the VM later. - ProvisionVMAgent *bool - - // Specifies the ssh key configuration for a Linux OS. - SSH *SSHConfiguration -} - -// LinuxParameters - Input for InstallPatches on a Linux VM, as directly received by the API -type LinuxParameters struct { - // The update classifications to select when installing patches for Linux. - ClassificationsToInclude []*VMGuestPatchClassificationLinux - - // This is used as a maintenance run identifier for Auto VM Guest Patching in Linux. - MaintenanceRunID *string - - // packages to exclude in the patch operation. Format: packageName_packageVersion - PackageNameMasksToExclude []*string - - // packages to include in the patch operation. Format: packageName_packageVersion - PackageNameMasksToInclude []*string -} - -// LinuxPatchSettings - Specifies settings related to VM Guest Patching on Linux. -type LinuxPatchSettings struct { - // Specifies the mode of VM Guest Patch Assessment for the IaaS virtual machine. - // Possible values are: - // ImageDefault - You control the timing of patch assessments on a virtual machine. - // AutomaticByPlatform - The platform will trigger periodic patch assessments. The property provisionVMAgent must be true. - AssessmentMode *LinuxPatchAssessmentMode - - // Specifies additional settings for patch mode AutomaticByPlatform in VM Guest Patching on Linux. - AutomaticByPlatformSettings *LinuxVMGuestPatchAutomaticByPlatformSettings - - // Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated to virtual machine scale - // set with OrchestrationMode as Flexible. - // Possible values are: - // ImageDefault - The virtual machine's default patching configuration is used. - // AutomaticByPlatform - The virtual machine will be automatically updated by the platform. The property provisionVMAgent - // must be true - PatchMode *LinuxVMGuestPatchMode -} - -// LinuxVMGuestPatchAutomaticByPlatformSettings - Specifies additional settings to be applied when patch mode AutomaticByPlatform -// is selected in Linux patch settings. -type LinuxVMGuestPatchAutomaticByPlatformSettings struct { - // Enables customer to schedule patching without accidental upgrades - BypassPlatformSafetyChecksOnUserSchedule *bool - - // Specifies the reboot setting for all AutomaticByPlatform patch installation operations. - RebootSetting *LinuxVMGuestPatchAutomaticByPlatformRebootSetting -} - -// ListUsagesResult - The List Usages operation response. -type ListUsagesResult struct { - // REQUIRED; The list of compute resource usages. - Value []*Usage - - // The URI to fetch the next page of compute resource usage information. Call ListNext() with this to fetch the next page - // of compute resource usage information. - NextLink *string -} - -// LoadBalancerConfiguration - Describes the load balancer configuration. -type LoadBalancerConfiguration struct { - // REQUIRED; The name of the Load balancer - Name *string - - // REQUIRED; Properties of the load balancer configuration. - Properties *LoadBalancerConfigurationProperties - - // Resource Id - ID *string -} - -// LoadBalancerConfigurationProperties - Describes the properties of the load balancer configuration. -type LoadBalancerConfigurationProperties struct { - // REQUIRED; Specifies the frontend IP to be used for the load balancer. Only IPv4 frontend IP address is supported. Each - // load balancer configuration must have exactly one frontend IP configuration. - FrontendIPConfigurations []*LoadBalancerFrontendIPConfiguration -} - -// LoadBalancerFrontendIPConfiguration - Specifies the frontend IP to be used for the load balancer. Only IPv4 frontend IP -// address is supported. Each load balancer configuration must have exactly one frontend IP configuration. -type LoadBalancerFrontendIPConfiguration struct { - // REQUIRED; The name of the resource that is unique within the set of frontend IP configurations used by the load balancer. - // This name can be used to access the resource. - Name *string - - // REQUIRED; Properties of load balancer frontend ip configuration. - Properties *LoadBalancerFrontendIPConfigurationProperties -} - -// LoadBalancerFrontendIPConfigurationProperties - Describes a cloud service IP Configuration -type LoadBalancerFrontendIPConfigurationProperties struct { - // The virtual network private IP address of the IP configuration. - PrivateIPAddress *string - - // The reference to the public ip address resource. - PublicIPAddress *SubResource - - // The reference to the virtual network subnet resource. - Subnet *SubResource -} - -// LogAnalyticsInputBase - Api input base class for LogAnalytics Api. -type LogAnalyticsInputBase struct { - // REQUIRED; SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. - BlobContainerSasURI *string - - // REQUIRED; From time of the query - FromTime *time.Time - - // REQUIRED; To time of the query - ToTime *time.Time - - // Group query result by Client Application ID. - GroupByClientApplicationID *bool - - // Group query result by Operation Name. - GroupByOperationName *bool - - // Group query result by Resource Name. - GroupByResourceName *bool - - // Group query result by Throttle Policy applied. - GroupByThrottlePolicy *bool - - // Group query result by User Agent. - GroupByUserAgent *bool -} - -// LogAnalyticsOperationResult - LogAnalytics operation status response -type LogAnalyticsOperationResult struct { - // READ-ONLY; LogAnalyticsOutput - Properties *LogAnalyticsOutput -} - -// LogAnalyticsOutput - LogAnalytics output properties -type LogAnalyticsOutput struct { - // READ-ONLY; Output file Uri path to blob container. - Output *string -} - -// MaintenanceRedeployStatus - Maintenance Operation Status. -type MaintenanceRedeployStatus struct { - // True, if customer is allowed to perform Maintenance. - IsCustomerInitiatedMaintenanceAllowed *bool - - // Message returned for the last Maintenance Operation. - LastOperationMessage *string - - // The Last Maintenance Operation Result Code. - LastOperationResultCode *MaintenanceOperationResultCodeTypes - - // End Time for the Maintenance Window. - MaintenanceWindowEndTime *time.Time - - // Start Time for the Maintenance Window. - MaintenanceWindowStartTime *time.Time - - // End Time for the Pre Maintenance Window. - PreMaintenanceWindowEndTime *time.Time - - // Start Time for the Pre Maintenance Window. - PreMaintenanceWindowStartTime *time.Time -} - -// ManagedArtifact - The managed artifact. -type ManagedArtifact struct { - // REQUIRED; The managed artifact id. - ID *string -} - -// ManagedDiskParameters - The parameters of a managed disk. -type ManagedDiskParameters struct { - // Specifies the customer managed disk encryption set resource id for the managed disk. - DiskEncryptionSet *DiskEncryptionSetParameters - - // Resource Id - ID *string - - // Specifies the security profile for the managed disk. - SecurityProfile *VMDiskSecurityProfile - - // Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot - // be used with OS Disk. - StorageAccountType *StorageAccountTypes -} - -// NetworkInterfaceReference - Describes a network interface reference. -type NetworkInterfaceReference struct { - // Resource Id - ID *string - - // Describes a network interface reference properties. - Properties *NetworkInterfaceReferenceProperties -} - -// NetworkInterfaceReferenceProperties - Describes a network interface reference properties. -type NetworkInterfaceReferenceProperties struct { - // Specify what happens to the network interface when the VM is deleted - DeleteOption *DeleteOptions - - // Specifies the primary network interface in case the virtual machine has more than 1 network interface. - Primary *bool -} - -// NetworkProfile - Specifies the network interfaces or the networking configuration of the virtual machine. -type NetworkProfile struct { - // specifies the Microsoft.Network API version used when creating networking resources in the Network Interface Configurations - NetworkAPIVersion *NetworkAPIVersion - - // Specifies the networking configurations that will be used to create the virtual machine networking resources. - NetworkInterfaceConfigurations []*VirtualMachineNetworkInterfaceConfiguration - - // Specifies the list of resource Ids for the network interfaces associated with the virtual machine. - NetworkInterfaces []*NetworkInterfaceReference -} - -// OSDisk - Specifies information about the operating system disk used by the virtual machine. For more information about -// disks, see About disks and VHDs for Azure virtual machines -// [https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview]. -type OSDisk struct { - // REQUIRED; Specifies how the virtual machine disk should be created. Possible values are Attach: This value is used when - // you are using a specialized disk to create the virtual machine. FromImage: This value is - // used when you are using an image to create the virtual machine. If you are using a platform image, you should also use - // the imageReference element described above. If you are using a marketplace image, - // you should also use the plan element previously described. - CreateOption *DiskCreateOptionTypes - - // Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The defaulting behavior is: None for - // Standard storage. ReadOnly for Premium storage. - Caching *CachingTypes - - // Specifies whether OS Disk should be deleted or detached upon VM deletion. Possible values are: Delete. If this value is - // used, the OS disk is deleted when VM is deleted. Detach. If this value is used, - // the os disk is retained after VM is deleted. The default value is set to Detach. For an ephemeral OS Disk, the default - // value is set to Delete. The user cannot change the delete option for an ephemeral - // OS Disk. - DeleteOption *DiskDeleteOptionTypes - - // Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine. - DiffDiskSettings *DiffDiskSettings - - // Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a - // virtual machine image. The property 'diskSizeGB' is the number of bytes x 1024^3 - // for the disk and the value cannot be larger than 1023. - DiskSizeGB *int32 - - // Specifies the encryption settings for the OS Disk. Minimum api-version: 2015-06-15. - EncryptionSettings *DiskEncryptionSettings - - // The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. - // If SourceImage is provided, the destination virtual hard drive must not - // exist. - Image *VirtualHardDisk - - // The managed disk parameters. - ManagedDisk *ManagedDiskParameters - - // The disk name. - Name *string - - // This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or - // a specialized VHD. Possible values are: Windows, Linux. - OSType *OperatingSystemTypes - - // The virtual hard disk. - Vhd *VirtualHardDisk - - // Specifies whether writeAccelerator should be enabled or disabled on the disk. - WriteAcceleratorEnabled *bool -} - -// OSDiskImage - Contains the os disk image information. -type OSDiskImage struct { - // REQUIRED; The operating system of the osDiskImage. - OperatingSystem *OperatingSystemTypes -} - -// OSDiskImageEncryption - Contains encryption settings for an OS disk image. -type OSDiskImageEncryption struct { - // A relative URI containing the resource ID of the disk encryption set. - DiskEncryptionSetID *string - - // This property specifies the security profile of an OS disk image. - SecurityProfile *OSDiskImageSecurityProfile -} - -// OSDiskImageSecurityProfile - Contains security profile for an OS disk image. -type OSDiskImageSecurityProfile struct { - // confidential VM encryption types - ConfidentialVMEncryptionType *ConfidentialVMEncryptionType - - // secure VM disk encryption set id - SecureVMDiskEncryptionSetID *string -} - -// OSFamily - Describes a cloud service OS family. -type OSFamily struct { - // OS family properties. - Properties *OSFamilyProperties - - // READ-ONLY; Resource Id. - ID *string - - // READ-ONLY; Resource location. - Location *string - - // READ-ONLY; Resource name. - Name *string - - // READ-ONLY; Resource type. - Type *string -} - -// OSFamilyListResult - The list operation result. -type OSFamilyListResult struct { - // REQUIRED; The list of resources. - Value []*OSFamily - - // The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null - // to fetch all the resources. - NextLink *string -} - -// OSFamilyProperties - OS family properties. -type OSFamilyProperties struct { - // READ-ONLY; The OS family label. - Label *string - - // READ-ONLY; The OS family name. - Name *string - - // READ-ONLY; List of OS versions belonging to this family. - Versions []*OSVersionPropertiesBase -} - -type OSImageNotificationProfile struct { - // Specifies whether the OS Image Scheduled event is enabled or disabled. - Enable *bool - - // Length of time a Virtual Machine being reimaged or having its OS upgraded will have to potentially approve the OS Image - // Scheduled Event before the event is auto approved (timed out). The configuration - // is specified in ISO 8601 format, and the value must be 15 minutes (PT15M) - NotBeforeTimeout *string -} - -// OSProfile - Specifies the operating system settings for the virtual machine. Some of the settings cannot be changed once -// VM is provisioned. -type OSProfile struct { - // Specifies the password of the administrator account. - // Minimum-length (Windows): 8 characters - // Minimum-length (Linux): 6 characters - // Max-length (Windows): 123 characters - // Max-length (Linux): 72 characters - // Complexity requirements: 3 out of 4 conditions below need to be fulfilled - // Has lower characters - // Has upper characters - // Has a digit - // Has a special character (Regex match [\W_]) - // Disallowed values: "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", - // "Password22", "iloveyou!" - // For resetting the password, see How to reset the Remote Desktop service or its login password in a Windows VM [https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp] - // For resetting root password, see Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension - // [https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection] - AdminPassword *string - - // Specifies the name of the administrator account. - // This property cannot be updated after the VM is created. - // Windows-only restriction: Cannot end in "." - // Disallowed values: "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", - // "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", - // "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". - // Minimum-length (Linux): 1 character - // Max-length (Linux): 64 characters - // Max-length (Windows): 20 characters. - AdminUsername *string - - // Specifies whether extension operations should be allowed on the virtual machine. This may only be set to False when no - // extensions are present on the virtual machine. - AllowExtensionOperations *bool - - // Specifies the host OS name of the virtual machine. This name cannot be updated after the VM is created. Max-length (Windows): - // 15 characters. Max-length (Linux): 64 characters. For naming conventions - // and restrictions see Azure infrastructure services implementation guidelines [https://docs.microsoft.com/azure/azure-resource-manager/management/resource-name-rules]. - ComputerName *string - - // Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved - // as a file on the Virtual Machine. The maximum length of the binary array is - // 65535 bytes. Note: Do not pass any secrets or passwords in customData property. This property cannot be updated after the - // VM is created. The property 'customData' is passed to the VM to be saved as a - // file, for more information see Custom Data on Azure VMs [https://azure.microsoft.com/blog/custom-data-and-cloud-init-on-windows-azure/]. - // For using cloud-init for your Linux VM, see Using cloud-init to - // customize a Linux VM during creation [https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init]. - CustomData *string - - // Specifies the Linux operating system settings on the virtual machine. For a list of supported Linux distributions, see - // Linux on Azure-Endorsed Distributions - // [https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros]. - LinuxConfiguration *LinuxConfiguration - - // Optional property which must either be set to True or omitted. - RequireGuestProvisionSignal *bool - - // Specifies set of certificates that should be installed onto the virtual machine. To install certificates on a virtual machine - // it is recommended to use the Azure Key Vault virtual machine extension for - // Linux [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux] or the Azure Key Vault virtual machine - // extension for Windows - // [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows]. - Secrets []*VaultSecretGroup - - // Specifies Windows operating system settings on the virtual machine. - WindowsConfiguration *WindowsConfiguration -} - -// OSProfileProvisioningData - Additional parameters for Reimaging Non-Ephemeral Virtual Machine. -type OSProfileProvisioningData struct { - // Specifies the password of the administrator account. - // Minimum-length (Windows): 8 characters - // Minimum-length (Linux): 6 characters - // Max-length (Windows): 123 characters - // Max-length (Linux): 72 characters - // Complexity requirements: 3 out of 4 conditions below need to be fulfilled - // Has lower characters - // Has upper characters - // Has a digit - // Has a special character (Regex match [\W_]) - // Disallowed values: "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", - // "Password22", "iloveyou!" - // For resetting the password, see How to reset the Remote Desktop service or its login password in a Windows VM [https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp] - // For resetting root password, see Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension - // [https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection] - AdminPassword *string - - // Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved - // as a file on the Virtual Machine. The maximum length of the binary array is - // 65535 bytes. Note: Do not pass any secrets or passwords in customData property. This property cannot be updated after the - // VM is created. The property customData is passed to the VM to be saved as a - // file, for more information see Custom Data on Azure VMs [https://azure.microsoft.com/blog/custom-data-and-cloud-init-on-windows-azure/]. - // If using cloud-init for your Linux VM, see Using cloud-init to - // customize a Linux VM during creation [https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init]. - CustomData *string -} - -// OSVersion - Describes a cloud service OS version. -type OSVersion struct { - // OS version properties. - Properties *OSVersionProperties - - // READ-ONLY; Resource Id. - ID *string - - // READ-ONLY; Resource location. - Location *string - - // READ-ONLY; Resource name. - Name *string - - // READ-ONLY; Resource type. - Type *string -} - -// OSVersionListResult - The list operation result. -type OSVersionListResult struct { - // REQUIRED; The list of resources. - Value []*OSVersion - - // The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null - // to fetch all the resources. - NextLink *string -} - -// OSVersionProperties - OS version properties. -type OSVersionProperties struct { - // READ-ONLY; The family of this OS version. - Family *string - - // READ-ONLY; The family label of this OS version. - FamilyLabel *string - - // READ-ONLY; Specifies whether this OS version is active. - IsActive *bool - - // READ-ONLY; Specifies whether this is the default OS version for its family. - IsDefault *bool - - // READ-ONLY; The OS version label. - Label *string - - // READ-ONLY; The OS version. - Version *string -} - -// OSVersionPropertiesBase - Configuration view of an OS version. -type OSVersionPropertiesBase struct { - // READ-ONLY; Specifies whether this OS version is active. - IsActive *bool - - // READ-ONLY; Specifies whether this is the default OS version for its family. - IsDefault *bool - - // READ-ONLY; The OS version label. - Label *string - - // READ-ONLY; The OS version. - Version *string -} - -// OperationListResult - The List Compute Operation operation response. -type OperationListResult struct { - // READ-ONLY; The list of compute operations - Value []*OperationValue -} - -// OperationValue - Describes the properties of a Compute Operation value. -type OperationValue struct { - // Describes the properties of a Compute Operation Value Display. - Display *OperationValueDisplay - - // READ-ONLY; The name of the compute operation. - Name *string - - // READ-ONLY; The origin of the compute operation. - Origin *string -} - -// OperationValueDisplay - Describes the properties of a Compute Operation Value Display. -type OperationValueDisplay struct { - // READ-ONLY; The description of the operation. - Description *string - - // READ-ONLY; The display name of the compute operation. - Operation *string - - // READ-ONLY; The resource provider for the operation. - Provider *string - - // READ-ONLY; The display name of the resource the operation applies to. - Resource *string -} - -// OrchestrationServiceStateInput - The input for OrchestrationServiceState -type OrchestrationServiceStateInput struct { - // REQUIRED; The action to be performed. - Action *OrchestrationServiceStateAction - - // REQUIRED; The name of the service. - ServiceName *OrchestrationServiceNames -} - -// OrchestrationServiceSummary - Summary for an orchestration service of a virtual machine scale set. -type OrchestrationServiceSummary struct { - // READ-ONLY; The name of the service. - ServiceName *OrchestrationServiceNames - - // READ-ONLY; The current state of the service. - ServiceState *OrchestrationServiceState -} - -// PatchInstallationDetail - Information about a specific patch that was encountered during an installation action. -type PatchInstallationDetail struct { - // READ-ONLY; The classification(s) of the patch as provided by the patch publisher. - Classifications []*string - - // READ-ONLY; The state of the patch after the installation operation completed. - InstallationState *PatchInstallationState - - // READ-ONLY; The KBID of the patch. Only applies to Windows patches. - KbID *string - - // READ-ONLY; The friendly name of the patch. - Name *string - - // READ-ONLY; A unique identifier for the patch. - PatchID *string - - // READ-ONLY; The version string of the package. It may conform to Semantic Versioning. Only applies to Linux. - Version *string -} - -// PatchSettings - Specifies settings related to VM Guest Patching on Windows. -type PatchSettings struct { - // Specifies the mode of VM Guest patch assessment for the IaaS virtual machine. - // Possible values are: - // ImageDefault - You control the timing of patch assessments on a virtual machine. - // AutomaticByPlatform - The platform will trigger periodic patch assessments. The property provisionVMAgent must be true. - AssessmentMode *WindowsPatchAssessmentMode - - // Specifies additional settings for patch mode AutomaticByPlatform in VM Guest Patching on Windows. - AutomaticByPlatformSettings *WindowsVMGuestPatchAutomaticByPlatformSettings - - // Enables customers to patch their Azure VMs without requiring a reboot. For enableHotpatching, the 'provisionVMAgent' must - // be set to true and 'patchMode' must be set to 'AutomaticByPlatform'. - EnableHotpatching *bool - - // Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated to virtual machine scale - // set with OrchestrationMode as Flexible. - // Possible values are: - // Manual - You control the application of patches to a virtual machine. You do this by applying patches manually inside the - // VM. In this mode, automatic updates are disabled; the property - // WindowsConfiguration.enableAutomaticUpdates must be false - // AutomaticByOS - The virtual machine will automatically be updated by the OS. The property WindowsConfiguration.enableAutomaticUpdates - // must be true. - // AutomaticByPlatform - the virtual machine will automatically updated by the platform. The properties provisionVMAgent and - // WindowsConfiguration.enableAutomaticUpdates must be true - PatchMode *WindowsVMGuestPatchMode -} - -// PirCommunityGalleryResource - Base information about the community gallery resource in azure compute gallery. -type PirCommunityGalleryResource struct { - // The identifier information of community gallery. - Identifier *CommunityGalleryIdentifier - - // READ-ONLY; Resource location - Location *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// PirResource - The Resource model definition. -type PirResource struct { - // READ-ONLY; Resource location - Location *string - - // READ-ONLY; Resource name - Name *string -} - -// PirSharedGalleryResource - Base information about the shared gallery resource in pir. -type PirSharedGalleryResource struct { - // The identifier information of shared gallery. - Identifier *SharedGalleryIdentifier - - // READ-ONLY; Resource location - Location *string - - // READ-ONLY; Resource name - Name *string -} - -// Plan - Specifies information about the marketplace image used to create the virtual machine. This element is only used -// for marketplace images. Before you can use a marketplace image from an API, you must -// enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click -// Want to deploy programmatically, Get Started ->. Enter any required -// information and then click Save. -type Plan struct { - // The plan ID. - Name *string - - // Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. - Product *string - - // The promotion code. - PromotionCode *string - - // The publisher ID. - Publisher *string -} - -// PolicyViolation - A policy violation reported against a gallery artifact. -type PolicyViolation struct { - // Describes the nature of the policy violation. - Category *PolicyViolationCategory - - // Describes specific details about why this policy violation was reported. - Details *string -} - -// PriorityMixPolicy - Specifies the target splits for Spot and Regular priority VMs within a scale set with flexible orchestration -// mode. With this property the customer is able to specify the base number of regular -// priority VMs created as the VMSS flex instance scales out and the split between Spot and Regular priority VMs after this -// base target has been reached. -type PriorityMixPolicy struct { - // The base number of regular priority VMs that will be created in this scale set as it scales out. - BaseRegularPriorityCount *int32 - - // The percentage of VM instances, after the base regular priority count has been reached, that are expected to use regular - // priority. - RegularPriorityPercentageAboveBase *int32 -} - -// PrivateEndpoint - The Private Endpoint resource. -type PrivateEndpoint struct { - // READ-ONLY; The ARM identifier for Private Endpoint - ID *string -} - -// PrivateEndpointConnection - The Private Endpoint Connection resource. -type PrivateEndpointConnection struct { - // Resource properties. - Properties *PrivateEndpointConnectionProperties - - // READ-ONLY; private endpoint connection Id - ID *string - - // READ-ONLY; private endpoint connection name - Name *string - - // READ-ONLY; private endpoint connection type - Type *string -} - -// PrivateEndpointConnectionListResult - A list of private link resources -type PrivateEndpointConnectionListResult struct { - // The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the next page of snapshots. - NextLink *string - - // Array of private endpoint connections - Value []*PrivateEndpointConnection -} - -// PrivateEndpointConnectionProperties - Properties of the PrivateEndpointConnectProperties. -type PrivateEndpointConnectionProperties struct { - // REQUIRED; A collection of information about the state of the connection between DiskAccess and Virtual Network. - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState - - // READ-ONLY; The resource of private end point. - PrivateEndpoint *PrivateEndpoint - - // READ-ONLY; The provisioning state of the private endpoint connection resource. - ProvisioningState *PrivateEndpointConnectionProvisioningState -} - -// PrivateLinkResource - A private link resource -type PrivateLinkResource struct { - // Resource properties. - Properties *PrivateLinkResourceProperties - - // READ-ONLY; private link resource Id - ID *string - - // READ-ONLY; private link resource name - Name *string - - // READ-ONLY; private link resource type - Type *string -} - -// PrivateLinkResourceListResult - A list of private link resources -type PrivateLinkResourceListResult struct { - // Array of private link resources - Value []*PrivateLinkResource -} - -// PrivateLinkResourceProperties - Properties of a private link resource. -type PrivateLinkResourceProperties struct { - // The private link resource DNS zone name. - RequiredZoneNames []*string - - // READ-ONLY; The private link resource group id. - GroupID *string - - // READ-ONLY; The private link resource required member names. - RequiredMembers []*string -} - -// PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer -// and provider. -type PrivateLinkServiceConnectionState struct { - // A message indicating if changes on the service provider require any updates on the consumer. - ActionsRequired *string - - // The reason for approval/rejection of the connection. - Description *string - - // Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. - Status *PrivateEndpointServiceConnectionStatus -} - -// PropertyUpdatesInProgress - Properties of the disk for which update is pending. -type PropertyUpdatesInProgress struct { - // The target performance tier of the disk if a tier change operation is in progress. - TargetTier *string -} - -// ProximityPlacementGroup - Specifies information about the proximity placement group. -type ProximityPlacementGroup struct { - // REQUIRED; Resource location - Location *string - - // Describes the properties of a Proximity Placement Group. - Properties *ProximityPlacementGroupProperties - - // Resource tags - Tags map[string]*string - - // Specifies the Availability Zone where virtual machine, virtual machine scale set or availability set associated with the - // proximity placement group can be created. - Zones []*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// ProximityPlacementGroupListResult - The List Proximity Placement Group operation response. -type ProximityPlacementGroupListResult struct { - // REQUIRED; The list of proximity placement groups - Value []*ProximityPlacementGroup - - // The URI to fetch the next page of proximity placement groups. - NextLink *string -} - -// ProximityPlacementGroupProperties - Describes the properties of a Proximity Placement Group. -type ProximityPlacementGroupProperties struct { - // Describes colocation status of the Proximity Placement Group. - ColocationStatus *InstanceViewStatus - - // Specifies the user intent of the proximity placement group. - Intent *ProximityPlacementGroupPropertiesIntent - - // Specifies the type of the proximity placement group. Possible values are: Standard : Co-locate resources within an Azure - // region or Availability Zone. Ultra : For future use. - ProximityPlacementGroupType *ProximityPlacementGroupType - - // READ-ONLY; A list of references to all availability sets in the proximity placement group. - AvailabilitySets []*SubResourceWithColocationStatus - - // READ-ONLY; A list of references to all virtual machine scale sets in the proximity placement group. - VirtualMachineScaleSets []*SubResourceWithColocationStatus - - // READ-ONLY; A list of references to all virtual machines in the proximity placement group. - VirtualMachines []*SubResourceWithColocationStatus -} - -// ProximityPlacementGroupPropertiesIntent - Specifies the user intent of the proximity placement group. -type ProximityPlacementGroupPropertiesIntent struct { - // Specifies possible sizes of virtual machines that can be created in the proximity placement group. - VMSizes []*string -} - -// ProximityPlacementGroupUpdate - Specifies information about the proximity placement group. -type ProximityPlacementGroupUpdate struct { - // Resource tags - Tags map[string]*string -} - -// ProxyAgentSettings - Specifies ProxyAgent settings while creating the virtual machine. Minimum api-version: 2024-03-01. -type ProxyAgentSettings struct { - // Specifies whether ProxyAgent feature should be enabled on the virtual machine or virtual machine scale set. - Enabled *bool - - // Increase the value of this property allows user to reset the key used for securing communication channel between guest - // and host. - KeyIncarnationID *int32 - - // Specifies the mode that ProxyAgent will execute on if the feature is enabled. ProxyAgent will start to audit or monitor - // but not enforce access control over requests to host endpoints in Audit mode, - // while in Enforce mode it will enforce access control. The default value is Enforce mode. - Mode *Mode -} - -// ProxyOnlyResource - The ProxyOnly Resource model definition. -type ProxyOnlyResource struct { - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// ProxyResource - The resource model definition for an Azure Resource Manager proxy resource. It will not have tags and a -// location -type ProxyResource struct { - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// PublicIPAddressSKU - Describes the public IP Sku. It can only be set with OrchestrationMode as Flexible. -type PublicIPAddressSKU struct { - // Specify public IP sku name - Name *PublicIPAddressSKUName - - // Specify public IP sku tier - Tier *PublicIPAddressSKUTier -} - -// PurchasePlan - Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. -type PurchasePlan struct { - // REQUIRED; The plan ID. - Name *string - - // REQUIRED; Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference - // element. - Product *string - - // REQUIRED; The publisher ID. - Publisher *string -} - -// RecommendedMachineConfiguration - The properties describe the recommended machine configuration for this Image Definition. -// These properties are updatable. -type RecommendedMachineConfiguration struct { - // Describes the resource range. - Memory *ResourceRange - - // Describes the resource range. - VCPUs *ResourceRange -} - -// RecoveryWalkResponse - Response after calling a manual recovery walk -type RecoveryWalkResponse struct { - // READ-ONLY; The next update domain that needs to be walked. Null means walk spanning all update domains has been completed - NextPlatformUpdateDomain *int32 - - // READ-ONLY; Whether the recovery walk was performed - WalkPerformed *bool -} - -// RegionalReplicationStatus - This is the regional replication status. -type RegionalReplicationStatus struct { - // READ-ONLY; The details of the replication status. - Details *string - - // READ-ONLY; It indicates progress of the replication job. - Progress *int32 - - // READ-ONLY; The region to which the gallery image version is being replicated to. - Region *string - - // READ-ONLY; This is the regional replication state. - State *ReplicationState -} - -// RegionalSharingStatus - Gallery regional sharing status -type RegionalSharingStatus struct { - // Details of gallery regional sharing failure. - Details *string - - // Region name - Region *string - - // READ-ONLY; Gallery sharing state in current region - State *SharingState -} - -// ReplicationStatus - This is the replication status of the gallery image version. -type ReplicationStatus struct { - // READ-ONLY; This is the aggregated replication status based on all the regional replication status flags. - AggregatedState *AggregatedReplicationState - - // READ-ONLY; This is a summary of replication status for each region. - Summary []*RegionalReplicationStatus -} - -// RequestRateByIntervalInput - Api request input for LogAnalytics getRequestRateByInterval Api. -type RequestRateByIntervalInput struct { - // REQUIRED; SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. - BlobContainerSasURI *string - - // REQUIRED; From time of the query - FromTime *time.Time - - // REQUIRED; Interval value in minutes used to create LogAnalytics call rate logs. - IntervalLength *IntervalInMins - - // REQUIRED; To time of the query - ToTime *time.Time - - // Group query result by Client Application ID. - GroupByClientApplicationID *bool - - // Group query result by Operation Name. - GroupByOperationName *bool - - // Group query result by Resource Name. - GroupByResourceName *bool - - // Group query result by Throttle Policy applied. - GroupByThrottlePolicy *bool - - // Group query result by User Agent. - GroupByUserAgent *bool -} - -// ResiliencyPolicy - Describes an resiliency policy - resilientVMCreationPolicy and/or resilientVMDeletionPolicy. -type ResiliencyPolicy struct { - // The configuration parameters used while performing resilient VM creation. - ResilientVMCreationPolicy *ResilientVMCreationPolicy - - // The configuration parameters used while performing resilient VM deletion. - ResilientVMDeletionPolicy *ResilientVMDeletionPolicy -} - -// ResilientVMCreationPolicy - The configuration parameters used while performing resilient VM creation. -type ResilientVMCreationPolicy struct { - // Specifies whether resilient VM creation should be enabled on the virtual machine scale set. The default value is false. - Enabled *bool -} - -// ResilientVMDeletionPolicy - The configuration parameters used while performing resilient VM deletion. -type ResilientVMDeletionPolicy struct { - // Specifies whether resilient VM deletion should be enabled on the virtual machine scale set. The default value is false. - Enabled *bool -} - -// Resource - The Resource model definition. -type Resource struct { - // REQUIRED; Resource location - Location *string - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// ResourceInstanceViewStatus - Instance view status. -type ResourceInstanceViewStatus struct { - // The level code. - Level *StatusLevelTypes - - // READ-ONLY; The status code. - Code *string - - // READ-ONLY; The short localizable label for the status. - DisplayStatus *string - - // READ-ONLY; The detailed status message, including for alerts and error messages. - Message *string - - // READ-ONLY; The time of the status. - Time *time.Time -} - -// ResourceRange - Describes the resource range. -type ResourceRange struct { - // The maximum number of the resource. - Max *int32 - - // The minimum number of the resource. - Min *int32 -} - -// ResourceSKU - Describes an available Compute SKU. -type ResourceSKU struct { - // READ-ONLY; The api versions that support this SKU. - APIVersions []*string - - // READ-ONLY; A name value pair to describe the capability. - Capabilities []*ResourceSKUCapabilities - - // READ-ONLY; Specifies the number of virtual machines in the scale set. - Capacity *ResourceSKUCapacity - - // READ-ONLY; Metadata for retrieving price info. - Costs []*ResourceSKUCosts - - // READ-ONLY; The Family of this particular SKU. - Family *string - - // READ-ONLY; The Kind of resources that are supported in this SKU. - Kind *string - - // READ-ONLY; A list of locations and availability zones in those locations where the SKU is available. - LocationInfo []*ResourceSKULocationInfo - - // READ-ONLY; The set of locations that the SKU is available. - Locations []*string - - // READ-ONLY; The name of SKU. - Name *string - - // READ-ONLY; The type of resource the SKU applies to. - ResourceType *string - - // READ-ONLY; The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. - Restrictions []*ResourceSKURestrictions - - // READ-ONLY; The Size of the SKU. - Size *string - - // READ-ONLY; Specifies the tier of virtual machines in a scale set. - // Possible Values: - // Standard - // Basic - Tier *string -} - -// ResourceSKUCapabilities - Describes The SKU capabilities object. -type ResourceSKUCapabilities struct { - // READ-ONLY; An invariant to describe the feature. - Name *string - - // READ-ONLY; An invariant if the feature is measured by quantity. - Value *string -} - -// ResourceSKUCapacity - Describes scaling information of a SKU. -type ResourceSKUCapacity struct { - // READ-ONLY; The default capacity. - Default *int64 - - // READ-ONLY; The maximum capacity that can be set. - Maximum *int64 - - // READ-ONLY; The minimum capacity. - Minimum *int64 - - // READ-ONLY; The scale type applicable to the sku. - ScaleType *ResourceSKUCapacityScaleType -} - -// ResourceSKUCosts - Describes metadata for retrieving price info. -type ResourceSKUCosts struct { - // READ-ONLY; An invariant to show the extended unit. - ExtendedUnit *string - - // READ-ONLY; Used for querying price from commerce. - MeterID *string - - // READ-ONLY; The multiplier is needed to extend the base metered cost. - Quantity *int64 -} - -// ResourceSKULocationInfo - Describes an available Compute SKU Location Information. -type ResourceSKULocationInfo struct { - // READ-ONLY; The names of extended locations. - ExtendedLocations []*string - - // READ-ONLY; Location of the SKU - Location *string - - // READ-ONLY; The type of the extended location. - Type *ExtendedLocationType - - // READ-ONLY; Details of capabilities available to a SKU in specific zones. - ZoneDetails []*ResourceSKUZoneDetails - - // READ-ONLY; List of availability zones where the SKU is supported. - Zones []*string -} - -// ResourceSKURestrictionInfo - Describes an available Compute SKU Restriction Information. -type ResourceSKURestrictionInfo struct { - // READ-ONLY; Locations where the SKU is restricted - Locations []*string - - // READ-ONLY; List of availability zones where the SKU is restricted. - Zones []*string -} - -// ResourceSKURestrictions - Describes scaling information of a SKU. -type ResourceSKURestrictions struct { - // READ-ONLY; The reason for restriction. - ReasonCode *ResourceSKURestrictionsReasonCode - - // READ-ONLY; The information about the restriction where the SKU cannot be used. - RestrictionInfo *ResourceSKURestrictionInfo - - // READ-ONLY; The type of restrictions. - Type *ResourceSKURestrictionsType - - // READ-ONLY; The value of restrictions. If the restriction type is set to location. This would be different locations where - // the SKU is restricted. - Values []*string -} - -// ResourceSKUZoneDetails - Describes The zonal capabilities of a SKU. -type ResourceSKUZoneDetails struct { - // READ-ONLY; A list of capabilities that are available for the SKU in the specified list of zones. - Capabilities []*ResourceSKUCapabilities - - // READ-ONLY; The set of zones that the SKU is available in with the specified capabilities. - Name []*string -} - -// ResourceSKUsResult - The List Resource Skus operation response. -type ResourceSKUsResult struct { - // REQUIRED; The list of skus available for the subscription. - Value []*ResourceSKU - - // The URI to fetch the next page of Resource Skus. Call ListNext() with this URI to fetch the next page of Resource Skus - NextLink *string -} - -type ResourceSharingProfile struct { - // Specifies an array of subscription resource IDs that capacity reservation group is shared with. Note: Minimum api-version: - // 2024-03-01. Please refer to https://aka.ms/computereservationsharing for more - // details. - SubscriptionIDs []*SubResource -} - -// ResourceURIList - The List resources which are encrypted with the disk encryption set. -type ResourceURIList struct { - // REQUIRED; A list of IDs or Owner IDs of resources which are encrypted with the disk encryption set. - Value []*string - - // The uri to fetch the next page of encrypted resources. Call ListNext() with this to fetch the next page of encrypted resources. - NextLink *string -} - -// ResourceWithOptionalLocation - The Resource model definition with location property as optional. -type ResourceWithOptionalLocation struct { - // Resource location - Location *string - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// RestorePoint - Restore Point details. -type RestorePoint struct { - // The restore point properties. - Properties *RestorePointProperties - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// RestorePointCollection - Create or update Restore Point collection parameters. -type RestorePointCollection struct { - // REQUIRED; Resource location - Location *string - - // The restore point collection properties. - Properties *RestorePointCollectionProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// RestorePointCollectionListResult - The List restore point collection operation response. -type RestorePointCollectionListResult struct { - // The uri to fetch the next page of RestorePointCollections. Call ListNext() with this to fetch the next page of RestorePointCollections - NextLink *string - - // Gets the list of restore point collections. - Value []*RestorePointCollection -} - -// RestorePointCollectionProperties - The restore point collection properties. -type RestorePointCollectionProperties struct { - // The properties of the source resource that this restore point collection is created from. - Source *RestorePointCollectionSourceProperties - - // READ-ONLY; The provisioning state of the restore point collection. - ProvisioningState *string - - // READ-ONLY; The unique id of the restore point collection. - RestorePointCollectionID *string - - // READ-ONLY; A list containing all restore points created under this restore point collection. - RestorePoints []*RestorePoint -} - -// RestorePointCollectionSourceProperties - The properties of the source resource that this restore point collection is created -// from. -type RestorePointCollectionSourceProperties struct { - // Resource Id of the source resource used to create this restore point collection - ID *string - - // READ-ONLY; Location of the source resource used to create this restore point collection. - Location *string -} - -// RestorePointCollectionUpdate - Update Restore Point collection parameters. -type RestorePointCollectionUpdate struct { - // The restore point collection properties. - Properties *RestorePointCollectionProperties - - // Resource tags - Tags map[string]*string -} - -// RestorePointEncryption - Encryption at rest settings for disk restore point. It is an optional property that can be specified -// in the input while creating a restore point. -type RestorePointEncryption struct { - // Describes the parameter of customer managed disk encryption set resource id that can be specified for disk. Note: The disk - // encryption set resource id can only be specified for managed disk. Please - // refer https://aka.ms/mdssewithcmkoverview for more details. - DiskEncryptionSet *DiskEncryptionSetParameters - - // The type of key used to encrypt the data of the disk restore point. - Type *RestorePointEncryptionType -} - -// RestorePointInstanceView - The instance view of a restore point. -type RestorePointInstanceView struct { - // The disk restore points information. - DiskRestorePoints []*DiskRestorePointInstanceView - - // The resource status information. - Statuses []*InstanceViewStatus -} - -// RestorePointProperties - The restore point properties. -type RestorePointProperties struct { - // ConsistencyMode of the RestorePoint. Can be specified in the input while creating a restore point. For now, only CrashConsistent - // is accepted as a valid input. Please refer to - // https://aka.ms/RestorePoints for more details. - ConsistencyMode *ConsistencyModeTypes - - // List of disk resource ids that the customer wishes to exclude from the restore point. If no disks are specified, all disks - // will be included. - ExcludeDisks []*APIEntityReference - - // Gets the details of the VM captured at the time of the restore point creation. - SourceMetadata *RestorePointSourceMetadata - - // Resource Id of the source restore point from which a copy needs to be created. - SourceRestorePoint *APIEntityReference - - // Gets the creation time of the restore point. - TimeCreated *time.Time - - // READ-ONLY; The restore point instance view. - InstanceView *RestorePointInstanceView - - // READ-ONLY; Gets the provisioning state of the restore point. - ProvisioningState *string -} - -// RestorePointSourceMetadata - Describes the properties of the Virtual Machine for which the restore point was created. The -// properties provided are a subset and the snapshot of the overall Virtual Machine properties captured at the -// time of the restore point creation. -type RestorePointSourceMetadata struct { - // Gets the storage profile. - StorageProfile *RestorePointSourceVMStorageProfile - - // READ-ONLY; Gets the diagnostics profile. - DiagnosticsProfile *DiagnosticsProfile - - // READ-ONLY; Gets the hardware profile. - HardwareProfile *HardwareProfile - - // READ-ONLY; HyperVGeneration of the source VM for which restore point is captured. - HyperVGeneration *HyperVGenerationTypes - - // READ-ONLY; Gets the license type, which is for bring your own license scenario. - LicenseType *string - - // READ-ONLY; Location of the VM from which the restore point was created. - Location *string - - // READ-ONLY; Gets the OS profile. - OSProfile *OSProfile - - // READ-ONLY; Gets the security profile. - SecurityProfile *SecurityProfile - - // READ-ONLY; UserData associated with the source VM for which restore point is captured, which is a base-64 encoded value. - UserData *string - - // READ-ONLY; Gets the virtual machine unique id. - VMID *string -} - -// RestorePointSourceVMDataDisk - Describes a data disk. -type RestorePointSourceVMDataDisk struct { - // Contains Disk Restore Point properties. - DiskRestorePoint *DiskRestorePointAttributes - - // Contains the managed disk details. - ManagedDisk *ManagedDiskParameters - - // READ-ONLY; Gets the caching type. - Caching *CachingTypes - - // READ-ONLY; Gets the initial disk size in GB for blank data disks, and the new desired size for existing OS and Data disks. - DiskSizeGB *int32 - - // READ-ONLY; Gets the logical unit number. - Lun *int32 - - // READ-ONLY; Gets the disk name. - Name *string - - // READ-ONLY; Shows true if the disk is write-accelerator enabled. - WriteAcceleratorEnabled *bool -} - -// RestorePointSourceVMOSDisk - Describes an Operating System disk. -type RestorePointSourceVMOSDisk struct { - // Contains Disk Restore Point properties. - DiskRestorePoint *DiskRestorePointAttributes - - // Gets the managed disk details - ManagedDisk *ManagedDiskParameters - - // READ-ONLY; Gets the caching type. - Caching *CachingTypes - - // READ-ONLY; Gets the disk size in GB. - DiskSizeGB *int32 - - // READ-ONLY; Gets the disk encryption settings. - EncryptionSettings *DiskEncryptionSettings - - // READ-ONLY; Gets the disk name. - Name *string - - // READ-ONLY; Gets the Operating System type. - OSType *OperatingSystemType - - // READ-ONLY; Shows true if the disk is write-accelerator enabled. - WriteAcceleratorEnabled *bool -} - -// RestorePointSourceVMStorageProfile - Describes the storage profile. -type RestorePointSourceVMStorageProfile struct { - // Gets the data disks of the VM captured at the time of the restore point creation. - DataDisks []*RestorePointSourceVMDataDisk - - // Gets the OS disk of the VM captured at the time of the restore point creation. - OSDisk *RestorePointSourceVMOSDisk - - // READ-ONLY; Gets the disk controller type of the VM captured at the time of the restore point creation. - DiskControllerType *DiskControllerTypes -} - -// RetrieveBootDiagnosticsDataResult - The SAS URIs of the console screenshot and serial log blobs. -type RetrieveBootDiagnosticsDataResult struct { - // READ-ONLY; The console screenshot blob URI - ConsoleScreenshotBlobURI *string - - // READ-ONLY; The serial console log blob URI. - SerialConsoleLogBlobURI *string -} - -// RoleInstance - Describes the cloud service role instance. -type RoleInstance struct { - // Role instance properties. - Properties *RoleInstanceProperties - - // The role instance SKU. - SKU *InstanceSKU - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource Location. - Location *string - - // READ-ONLY; Resource Name. - Name *string - - // READ-ONLY; Resource tags. - Tags map[string]*string - - // READ-ONLY; Resource Type. - Type *string -} - -// RoleInstanceListResult - The list operation result. -type RoleInstanceListResult struct { - // REQUIRED; The list of resources. - Value []*RoleInstance - - // The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null - // to fetch all the resources. - NextLink *string -} - -// RoleInstanceNetworkProfile - Describes the network profile for the role instance. -type RoleInstanceNetworkProfile struct { - // READ-ONLY; Specifies the list of resource Ids for the network interfaces associated with the role instance. - NetworkInterfaces []*SubResource -} - -// RoleInstanceProperties - Role instance properties. -type RoleInstanceProperties struct { - // The instance view of the role instance. - InstanceView *RoleInstanceView - - // Describes the network profile for the role instance. - NetworkProfile *RoleInstanceNetworkProfile -} - -// RoleInstanceView - The instance view of the role instance. -type RoleInstanceView struct { - // READ-ONLY; The Fault Domain. - PlatformFaultDomain *int32 - - // READ-ONLY; The Update Domain. - PlatformUpdateDomain *int32 - - // READ-ONLY; Specifies a unique identifier generated internally for the cloud service associated with this role instance. - // NOTE: If you are using Azure Diagnostics extension, this property can be used as 'DeploymentId' for querying details. - PrivateID *string - - // READ-ONLY - Statuses []*ResourceInstanceViewStatus -} - -// RoleInstances - Specifies a list of role instances from the cloud service. -type RoleInstances struct { - // REQUIRED; List of cloud service role instance names. Value of '*' will signify all role instances of the cloud service. - RoleInstances []*string -} - -// RollbackStatusInfo - Information about rollback on failed VM instances after a OS Upgrade operation. -type RollbackStatusInfo struct { - // READ-ONLY; The number of instances which failed to rollback. - FailedRolledbackInstanceCount *int32 - - // READ-ONLY; Error details if OS rollback failed. - RollbackError *APIError - - // READ-ONLY; The number of instances which have been successfully rolled back. - SuccessfullyRolledbackInstanceCount *int32 -} - -// RollingUpgradePolicy - The configuration parameters used while performing a rolling upgrade. -type RollingUpgradePolicy struct { - // Allow VMSS to ignore AZ boundaries when constructing upgrade batches. Take into consideration the Update Domain and maxBatchInstancePercent - // to determine the batch size. - EnableCrossZoneUpgrade *bool - - // The maximum percent of total virtual machine instances that will be upgraded simultaneously by the rolling upgrade in one - // batch. As this is a maximum, unhealthy instances in previous or future batches - // can cause the percentage of instances in a batch to decrease to ensure higher reliability. The default value for this parameter - // is 20%. - MaxBatchInstancePercent *int32 - - // Create new virtual machines to upgrade the scale set, rather than updating the existing virtual machines. Existing virtual - // machines will be deleted once the new virtual machines are created for each - // batch. - MaxSurge *bool - - // The maximum percentage of the total virtual machine instances in the scale set that can be simultaneously unhealthy, either - // as a result of being upgraded, or by being found in an unhealthy state by - // the virtual machine health checks before the rolling upgrade aborts. This constraint will be checked prior to starting - // any batch. The default value for this parameter is 20%. - MaxUnhealthyInstancePercent *int32 - - // The maximum percentage of upgraded virtual machine instances that can be found to be in an unhealthy state. This check - // will happen after each batch is upgraded. If this percentage is ever exceeded, - // the rolling update aborts. The default value for this parameter is 20%. - MaxUnhealthyUpgradedInstancePercent *int32 - - // The wait time between completing the update for all virtual machines in one batch and starting the next batch. The time - // duration should be specified in ISO 8601 format. The default value is 0 seconds - // (PT0S). - PauseTimeBetweenBatches *string - - // Upgrade all unhealthy instances in a scale set before any healthy instances. - PrioritizeUnhealthyInstances *bool - - // Rollback failed instances to previous model if the Rolling Upgrade policy is violated. - RollbackFailedInstancesOnPolicyBreach *bool -} - -// RollingUpgradeProgressInfo - Information about the number of virtual machine instances in each upgrade state. -type RollingUpgradeProgressInfo struct { - // READ-ONLY; The number of instances that have failed to be upgraded successfully. - FailedInstanceCount *int32 - - // READ-ONLY; The number of instances that are currently being upgraded. - InProgressInstanceCount *int32 - - // READ-ONLY; The number of instances that have not yet begun to be upgraded. - PendingInstanceCount *int32 - - // READ-ONLY; The number of instances that have been successfully upgraded. - SuccessfulInstanceCount *int32 -} - -// RollingUpgradeRunningStatus - Information about the current running state of the overall upgrade. -type RollingUpgradeRunningStatus struct { - // READ-ONLY; Code indicating the current status of the upgrade. - Code *RollingUpgradeStatusCode - - // READ-ONLY; The last action performed on the rolling upgrade. - LastAction *RollingUpgradeActionType - - // READ-ONLY; Last action time of the upgrade. - LastActionTime *time.Time - - // READ-ONLY; Start time of the upgrade. - StartTime *time.Time -} - -// RollingUpgradeStatusInfo - The status of the latest virtual machine scale set rolling upgrade. -type RollingUpgradeStatusInfo struct { - // REQUIRED; Resource location - Location *string - - // The status of the latest virtual machine scale set rolling upgrade. - Properties *RollingUpgradeStatusInfoProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// RollingUpgradeStatusInfoProperties - The status of the latest virtual machine scale set rolling upgrade. -type RollingUpgradeStatusInfoProperties struct { - // READ-ONLY; Error details for this upgrade, if there are any. - Error *APIError - - // READ-ONLY; The rolling upgrade policies applied for this upgrade. - Policy *RollingUpgradePolicy - - // READ-ONLY; Information about the number of virtual machine instances in each upgrade state. - Progress *RollingUpgradeProgressInfo - - // READ-ONLY; Information about the current running state of the overall upgrade. - RunningStatus *RollingUpgradeRunningStatus -} - -// RunCommandDocument - Describes the properties of a Run Command. -type RunCommandDocument struct { - // REQUIRED; The VM run command description. - Description *string - - // REQUIRED; The VM run command id. - ID *string - - // REQUIRED; The VM run command label. - Label *string - - // REQUIRED; The Operating System type. - OSType *OperatingSystemTypes - - // REQUIRED; The VM run command schema. - Schema *string - - // REQUIRED; The script to be executed. - Script []*string - - // The parameters used by the script. - Parameters []*RunCommandParameterDefinition -} - -// RunCommandDocumentBase - Describes the properties of a Run Command metadata. -type RunCommandDocumentBase struct { - // REQUIRED; The VM run command description. - Description *string - - // REQUIRED; The VM run command id. - ID *string - - // REQUIRED; The VM run command label. - Label *string - - // REQUIRED; The Operating System type. - OSType *OperatingSystemTypes - - // REQUIRED; The VM run command schema. - Schema *string -} - -// RunCommandInput - Capture Virtual Machine parameters. -type RunCommandInput struct { - // REQUIRED; The run command id. - CommandID *string - - // The run command parameters. - Parameters []*RunCommandInputParameter - - // Optional. The script to be executed. When this value is given, the given script will override the default script of the - // command. - Script []*string -} - -// RunCommandInputParameter - Describes the properties of a run command parameter. -type RunCommandInputParameter struct { - // REQUIRED; The run command parameter name. - Name *string - - // REQUIRED; The run command parameter value. - Value *string -} - -// RunCommandListResult - The List Virtual Machine operation response. -type RunCommandListResult struct { - // REQUIRED; The list of virtual machine run commands. - Value []*RunCommandDocumentBase - - // The uri to fetch the next page of run commands. Call ListNext() with this to fetch the next page of run commands. - NextLink *string -} - -// RunCommandManagedIdentity - Contains clientId or objectId (use only one, not both) of a user-assigned managed identity -// that has access to storage blob used in Run Command. Use an empty RunCommandManagedIdentity object in case of -// system-assigned identity. Make sure the Azure storage blob exists in case of scriptUri, and managed identity has been given -// access to blob's container with 'Storage Blob Data Reader' role assignment -// with scriptUri blob and 'Storage Blob Data Contributor' for Append blobs(outputBlobUri, errorBlobUri). In case of user -// assigned identity, make sure you add it under VM's identity. For more info on -// managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. -type RunCommandManagedIdentity struct { - // Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - ClientID *string - - // Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - ObjectID *string -} - -// RunCommandParameterDefinition - Describes the properties of a run command parameter. -type RunCommandParameterDefinition struct { - // REQUIRED; The run command parameter name. - Name *string - - // REQUIRED; The run command parameter type. - Type *string - - // The run command parameter default value. - DefaultValue *string - - // The run command parameter required. - Required *bool -} - -type RunCommandResult struct { - // Run command operation response. - Value []*InstanceViewStatus -} - -// SKU - Describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware the scale set -// is currently on, you need to deallocate the VMs in the scale set before you modify the -// SKU name. -type SKU struct { - // Specifies the number of virtual machines in the scale set. - Capacity *int64 - - // The sku name. - Name *string - - // Specifies the tier of virtual machines in a scale set. - // Possible Values: - // Standard - // Basic - Tier *string -} - -// SSHConfiguration - SSH configuration for Linux based VMs running on Azure -type SSHConfiguration struct { - // The list of SSH public keys used to authenticate with linux based VMs. - PublicKeys []*SSHPublicKey -} - -// SSHGenerateKeyPairInputParameters - Parameters for GenerateSshKeyPair. -type SSHGenerateKeyPairInputParameters struct { - // The encryption type of the SSH keys to be generated. See SshEncryptionTypes for possible set of values. If not provided, - // will default to RSA - EncryptionType *SSHEncryptionTypes -} - -// SSHPublicKey - Contains information about SSH certificate public key and the path on the Linux VM where the public key -// is placed. -type SSHPublicKey struct { - // SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit and in ssh-rsa - // format. For creating ssh keys, see [Create SSH keys on Linux and Mac for - // Linux VMs in Azure]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). - KeyData *string - - // Specifies the full path on the created VM where ssh public key is stored. If the file already exists, the specified key - // is appended to the file. Example: /home/user/.ssh/authorized_keys - Path *string -} - -// SSHPublicKeyGenerateKeyPairResult - Response from generation of an SSH key pair. -type SSHPublicKeyGenerateKeyPairResult struct { - // REQUIRED; The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{SshPublicKeyName} - ID *string - - // REQUIRED; Private key portion of the key pair used to authenticate to a virtual machine through ssh. The private key is - // returned in RFC3447 format and should be treated as a secret. - PrivateKey *string - - // REQUIRED; Public key portion of the key pair used to authenticate to a virtual machine through ssh. The public key is in - // ssh-rsa format. - PublicKey *string -} - -// SSHPublicKeyResource - Specifies information about the SSH public key. -type SSHPublicKeyResource struct { - // REQUIRED; Resource location - Location *string - - // Properties of the SSH public key. - Properties *SSHPublicKeyResourceProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// SSHPublicKeyResourceProperties - Properties of the SSH public key. -type SSHPublicKeyResourceProperties struct { - // SSH public key used to authenticate to a virtual machine through ssh. If this property is not initially provided when the - // resource is created, the publicKey property will be populated when - // generateKeyPair is called. If the public key is provided upon resource creation, the provided public key needs to be at - // least 2048-bit and in ssh-rsa format. - PublicKey *string -} - -// SSHPublicKeyUpdateResource - Specifies information about the SSH public key. -type SSHPublicKeyUpdateResource struct { - // Properties of the SSH public key. - Properties *SSHPublicKeyResourceProperties - - // Resource tags - Tags map[string]*string -} - -// SSHPublicKeysGroupListResult - The list SSH public keys operation response. -type SSHPublicKeysGroupListResult struct { - // REQUIRED; The list of SSH public keys - Value []*SSHPublicKeyResource - - // The URI to fetch the next page of SSH public keys. Call ListNext() with this URI to fetch the next page of SSH public keys. - NextLink *string -} - -// ScaleInPolicy - Describes a scale-in policy for a virtual machine scale set. -type ScaleInPolicy struct { - // This property allows you to specify if virtual machines chosen for removal have to be force deleted when a virtual machine - // scale set is being scaled-in.(Feature in Preview) - ForceDeletion *bool - - // The rules to be followed when scaling-in a virtual machine scale set. - // Possible values are: - // Default When a virtual machine scale set is scaled in, the scale set will first be balanced across zones if it is a zonal - // scale set. Then, it will be balanced across Fault Domains as far as possible. - // Within each Fault Domain, the virtual machines chosen for removal will be the newest ones that are not protected from scale-in. - // OldestVM When a virtual machine scale set is being scaled-in, the oldest virtual machines that are not protected from scale-in - // will be chosen for removal. For zonal virtual machine scale sets, the - // scale set will first be balanced across zones. Within each zone, the oldest virtual machines that are not protected will - // be chosen for removal. - // NewestVM When a virtual machine scale set is being scaled-in, the newest virtual machines that are not protected from scale-in - // will be chosen for removal. For zonal virtual machine scale sets, the - // scale set will first be balanced across zones. Within each zone, the newest virtual machines that are not protected will - // be chosen for removal. - Rules []*VirtualMachineScaleSetScaleInRules -} - -type ScheduledEventsAdditionalPublishingTargets struct { - // The configuration parameters used while creating eventGridAndResourceGraph Scheduled Event setting. - EventGridAndResourceGraph *EventGridAndResourceGraph -} - -// ScheduledEventsPolicy - Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets Scheduled Event related -// configurations. -type ScheduledEventsPolicy struct { - // The configuration parameters used while publishing scheduledEventsAdditionalPublishingTargets. - ScheduledEventsAdditionalPublishingTargets *ScheduledEventsAdditionalPublishingTargets - - // The configuration parameters used while creating userInitiatedReboot scheduled event setting creation. - UserInitiatedReboot *UserInitiatedReboot - - // The configuration parameters used while creating userInitiatedRedeploy scheduled event setting creation. - UserInitiatedRedeploy *UserInitiatedRedeploy -} - -type ScheduledEventsProfile struct { - // Specifies OS Image Scheduled Event related configurations. - OSImageNotificationProfile *OSImageNotificationProfile - - // Specifies Terminate Scheduled Event related configurations. - TerminateNotificationProfile *TerminateNotificationProfile -} - -// SecurityPostureReference - Specifies the security posture to be used for all virtual machines in the scale set. Minimum -// api-version: 2023-03-01 -type SecurityPostureReference struct { - // List of virtual machine extensions to exclude when applying the Security Posture. - ExcludeExtensions []*VirtualMachineExtension - - // The security posture reference id in the form of /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest - ID *string -} - -// SecurityProfile - Specifies the Security profile settings for the virtual machine or virtual machine scale set. -type SecurityProfile struct { - // This property can be used by user in the request to enable or disable the Host Encryption for the virtual machine or virtual - // machine scale set. This will enable the encryption for all the disks - // including Resource/Temp disk at host itself. The default behavior is: The Encryption at host will be disabled unless this - // property is set to true for the resource. - EncryptionAtHost *bool - - // Specifies the Managed Identity used by ADE to get access token for keyvault operations. - EncryptionIdentity *EncryptionIdentity - - // Specifies ProxyAgent settings while creating the virtual machine. Minimum api-version: 2024-03-01. - ProxyAgentSettings *ProxyAgentSettings - - // Specifies the SecurityType of the virtual machine. It has to be set to any specified value to enable UefiSettings. The - // default behavior is: UefiSettings will not be enabled unless this property is - // set. - SecurityType *SecurityTypes - - // Specifies the security settings like secure boot and vTPM used while creating the virtual machine. Minimum api-version: - // 2020-12-01. - UefiSettings *UefiSettings -} - -// ServiceArtifactReference - Specifies the service artifact reference id used to set same image version for all virtual machines -// in the scale set when using 'latest' image version. Minimum api-version: 2022-11-01 -type ServiceArtifactReference struct { - // The service artifact reference id in the form of - // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactName}/vmArtifactsProfiles/{vmArtifactsProfilesName} - ID *string -} - -type ShareInfoElement struct { - // READ-ONLY; A relative URI containing the ID of the VM that has the disk attached. - VMURI *string -} - -// SharedGallery - Specifies information about the Shared Gallery that you want to create or update. -type SharedGallery struct { - // The identifier information of shared gallery. - Identifier *SharedGalleryIdentifier - - // Specifies the properties of a shared gallery - Properties *SharedGalleryProperties - - // READ-ONLY; Resource location - Location *string - - // READ-ONLY; Resource name - Name *string -} - -// SharedGalleryDataDiskImage - This is the data disk image. -type SharedGalleryDataDiskImage struct { - // REQUIRED; This property specifies the logical unit number of the data disk. This value is used to identify data disks within - // the Virtual Machine and therefore must be unique for each data disk attached to the - // Virtual Machine. - Lun *int32 - - // The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' - HostCaching *SharedGalleryHostCaching - - // READ-ONLY; This property indicates the size of the VHD to be created. - DiskSizeGB *int32 -} - -// SharedGalleryDiskImage - This is the disk image base class. -type SharedGalleryDiskImage struct { - // The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' - HostCaching *SharedGalleryHostCaching - - // READ-ONLY; This property indicates the size of the VHD to be created. - DiskSizeGB *int32 -} - -// SharedGalleryIdentifier - The identifier information of shared gallery. -type SharedGalleryIdentifier struct { - // The unique id of this shared gallery. - UniqueID *string -} - -// SharedGalleryImage - Specifies information about the gallery image definition that you want to create or update. -type SharedGalleryImage struct { - // The identifier information of shared gallery. - Identifier *SharedGalleryIdentifier - - // Describes the properties of a gallery image definition. - Properties *SharedGalleryImageProperties - - // READ-ONLY; Resource location - Location *string - - // READ-ONLY; Resource name - Name *string -} - -// SharedGalleryImageList - The List Shared Gallery Images operation response. -type SharedGalleryImageList struct { - // REQUIRED; A list of shared gallery images. - Value []*SharedGalleryImage - - // The uri to fetch the next page of shared gallery images. Call ListNext() with this to fetch the next page of shared gallery - // images. - NextLink *string -} - -// SharedGalleryImageProperties - Describes the properties of a gallery image definition. -type SharedGalleryImageProperties struct { - // REQUIRED; This is the gallery image definition identifier. - Identifier *GalleryImageIdentifier - - // REQUIRED; This property allows the user to specify whether the virtual machines created under this image are 'Generalized' - // or 'Specialized'. - OSState *OperatingSystemStateTypes - - // REQUIRED; This property allows you to specify the type of the OS that is included in the disk when creating a VM from a - // managed image. Possible values are: Windows, Linux. - OSType *OperatingSystemTypes - - // The architecture of the image. Applicable to OS disks only. - Architecture *Architecture - - // The artifact tags of a shared gallery resource. - ArtifactTags map[string]*string - - // Describes the disallowed disk types. - Disallowed *Disallowed - - // The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property - // is updatable. - EndOfLifeDate *time.Time - - // End-user license agreement for the current community gallery image. - Eula *string - - // A list of gallery image features. - Features []*GalleryImageFeature - - // The hypervisor generation of the Virtual Machine. Applicable to OS disks only. - HyperVGeneration *HyperVGeneration - - // Privacy statement uri for the current community gallery image. - PrivacyStatementURI *string - - // Describes the gallery image definition purchase plan. This is used by marketplace images. - PurchasePlan *ImagePurchasePlan - - // The properties describe the recommended machine configuration for this Image Definition. These properties are updatable. - Recommended *RecommendedMachineConfiguration -} - -// SharedGalleryImageVersion - Specifies information about the gallery image version that you want to create or update. -type SharedGalleryImageVersion struct { - // The identifier information of shared gallery. - Identifier *SharedGalleryIdentifier - - // Describes the properties of a gallery image version. - Properties *SharedGalleryImageVersionProperties - - // READ-ONLY; Resource location - Location *string - - // READ-ONLY; Resource name - Name *string -} - -// SharedGalleryImageVersionList - The List Shared Gallery Image versions operation response. -type SharedGalleryImageVersionList struct { - // REQUIRED; A list of shared gallery images versions. - Value []*SharedGalleryImageVersion - - // The uri to fetch the next page of shared gallery image versions. Call ListNext() with this to fetch the next page of shared - // gallery image versions. - NextLink *string -} - -// SharedGalleryImageVersionProperties - Describes the properties of a gallery image version. -type SharedGalleryImageVersionProperties struct { - // The artifact tags of a shared gallery resource. - ArtifactTags map[string]*string - - // The end of life date of the gallery image version Definition. This property can be used for decommissioning purposes. This - // property is updatable. - EndOfLifeDate *time.Time - - // If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. - ExcludeFromLatest *bool - - // The published date of the gallery image version Definition. This property can be used for decommissioning purposes. This - // property is updatable. - PublishedDate *time.Time - - // Describes the storage profile of the image version. - StorageProfile *SharedGalleryImageVersionStorageProfile -} - -// SharedGalleryImageVersionStorageProfile - This is the storage profile of a Gallery Image Version. -type SharedGalleryImageVersionStorageProfile struct { - // A list of data disk images. - DataDiskImages []*SharedGalleryDataDiskImage - - // This is the OS disk image. - OSDiskImage *SharedGalleryOSDiskImage -} - -// SharedGalleryList - The List Shared Galleries operation response. -type SharedGalleryList struct { - // REQUIRED; A list of shared galleries. - Value []*SharedGallery - - // The uri to fetch the next page of shared galleries. Call ListNext() with this to fetch the next page of shared galleries. - NextLink *string -} - -// SharedGalleryOSDiskImage - This is the OS disk image. -type SharedGalleryOSDiskImage struct { - // The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' - HostCaching *SharedGalleryHostCaching - - // READ-ONLY; This property indicates the size of the VHD to be created. - DiskSizeGB *int32 -} - -// SharedGalleryProperties - Specifies the properties of a shared gallery -type SharedGalleryProperties struct { - // READ-ONLY; The artifact tags of a shared gallery resource. - ArtifactTags map[string]*string -} - -// SharingProfile - Profile for gallery sharing to subscription or tenant -type SharingProfile struct { - // Information of community gallery if current gallery is shared to community. - CommunityGalleryInfo *CommunityGalleryInfo - - // This property allows you to specify the permission of sharing gallery. Possible values are: Private, Groups, Community. - Permissions *GallerySharingPermissionTypes - - // READ-ONLY; A list of sharing profile groups. - Groups []*SharingProfileGroup -} - -// SharingProfileGroup - Group of the gallery sharing profile -type SharingProfileGroup struct { - // A list of subscription/tenant ids the gallery is aimed to be shared to. - IDs []*string - - // This property allows you to specify the type of sharing group. Possible values are: Subscriptions, AADTenants. - Type *SharingProfileGroupTypes -} - -// SharingStatus - Sharing status of current gallery. -type SharingStatus struct { - // Summary of all regional sharing status. - Summary []*RegionalSharingStatus - - // READ-ONLY; Aggregated sharing state of current gallery. - AggregatedState *SharingState -} - -// SharingUpdate - Specifies information about the gallery sharing profile update. -type SharingUpdate struct { - // REQUIRED; This property allows you to specify the operation type of gallery sharing update. Possible values are: Add, Remove, - // Reset. - OperationType *SharingUpdateOperationTypes - - // A list of sharing profile groups. - Groups []*SharingProfileGroup -} - -// Snapshot resource. -type Snapshot struct { - // REQUIRED; Resource location - Location *string - - // The extended location where the snapshot will be created. Extended location cannot be changed. - ExtendedLocation *ExtendedLocation - - // Snapshot resource properties. - Properties *SnapshotProperties - - // The snapshots sku name. Can be StandardLRS, PremiumLRS, or Standard_ZRS. This is an optional parameter for incremental - // snapshot and the default behavior is the SKU will be set to the same sku as the - // previous snapshot - SKU *SnapshotSKU - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Unused. Always Null. - ManagedBy *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// SnapshotList - The List Snapshots operation response. -type SnapshotList struct { - // REQUIRED; A list of snapshots. - Value []*Snapshot - - // The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the next page of snapshots. - NextLink *string -} - -// SnapshotProperties - Snapshot resource properties. -type SnapshotProperties struct { - // REQUIRED; Disk source information. CreationData information cannot be changed after the disk has been created. - CreationData *CreationData - - // Percentage complete for the background copy when a resource is created via the CopyStart operation. - CompletionPercent *float32 - - // Indicates the error details if the background copy of a resource created via the CopyStart operation fails. - CopyCompletionError *CopyCompletionError - - // Additional authentication requirements when exporting or uploading to a disk or snapshot. - DataAccessAuthMode *DataAccessAuthMode - - // ARM id of the DiskAccess resource for using private endpoints on disks. - DiskAccessID *string - - // If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this - // field is present for updates or creation with other options, it indicates a - // resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. - DiskSizeGB *int32 - - // Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. - Encryption *Encryption - - // Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. - EncryptionSettingsCollection *EncryptionSettingsCollection - - // The hypervisor generation of the Virtual Machine. Applicable to OS disks only. - HyperVGeneration *HyperVGeneration - - // Whether a snapshot is incremental. Incremental snapshots on the same disk occupy less space than full snapshots and can - // be diffed. - Incremental *bool - - // Policy for accessing the disk via network. - NetworkAccessPolicy *NetworkAccessPolicy - - // The Operating System type. - OSType *OperatingSystemTypes - - // Policy for controlling export on the disk. - PublicNetworkAccess *PublicNetworkAccess - - // Purchase plan information for the image from which the source disk for the snapshot was originally created. - PurchasePlan *DiskPurchasePlan - - // Contains the security related information for the resource. - SecurityProfile *DiskSecurityProfile - - // List of supported capabilities for the image from which the source disk from the snapshot was originally created. - SupportedCapabilities *SupportedCapabilities - - // Indicates the OS on a snapshot supports hibernation. - SupportsHibernation *bool - - // READ-ONLY; The size of the disk in bytes. This field is read only. - DiskSizeBytes *int64 - - // READ-ONLY; The state of the snapshot. - DiskState *DiskState - - // READ-ONLY; Incremental snapshots for a disk share an incremental snapshot family id. The Get Page Range Diff API can only - // be called on incremental snapshots with the same family id. - IncrementalSnapshotFamilyID *string - - // READ-ONLY; The disk provisioning state. - ProvisioningState *string - - // READ-ONLY; The time when the snapshot was created. - TimeCreated *time.Time - - // READ-ONLY; Unique Guid identifying the resource. - UniqueID *string -} - -// SnapshotSKU - The snapshots sku name. Can be StandardLRS, PremiumLRS, or Standard_ZRS. This is an optional parameter for -// incremental snapshot and the default behavior is the SKU will be set to the same sku as the -// previous snapshot -type SnapshotSKU struct { - // The sku name. - Name *SnapshotStorageAccountTypes - - // READ-ONLY; The sku tier. - Tier *string -} - -// SnapshotUpdate - Snapshot update resource. -type SnapshotUpdate struct { - // Snapshot resource update properties. - Properties *SnapshotUpdateProperties - - // The snapshots sku name. Can be StandardLRS, PremiumLRS, or Standard_ZRS. This is an optional parameter for incremental - // snapshot and the default behavior is the SKU will be set to the same sku as the - // previous snapshot - SKU *SnapshotSKU - - // Resource tags - Tags map[string]*string -} - -// SnapshotUpdateProperties - Snapshot resource update properties. -type SnapshotUpdateProperties struct { - // Additional authentication requirements when exporting or uploading to a disk or snapshot. - DataAccessAuthMode *DataAccessAuthMode - - // ARM id of the DiskAccess resource for using private endpoints on disks. - DiskAccessID *string - - // If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this - // field is present for updates or creation with other options, it indicates a - // resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. - DiskSizeGB *int32 - - // Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. - Encryption *Encryption - - // Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. - EncryptionSettingsCollection *EncryptionSettingsCollection - - // Policy for accessing the disk via network. - NetworkAccessPolicy *NetworkAccessPolicy - - // the Operating System type. - OSType *OperatingSystemTypes - - // Policy for controlling export on the disk. - PublicNetworkAccess *PublicNetworkAccess - - // List of supported capabilities for the image from which the OS disk was created. - SupportedCapabilities *SupportedCapabilities - - // Indicates the OS on a snapshot supports hibernation. - SupportsHibernation *bool -} - -// SoftDeletePolicy - Contains information about the soft deletion policy of the gallery. -type SoftDeletePolicy struct { - // Enables soft-deletion for resources in this gallery, allowing them to be recovered within retention time. - IsSoftDeleteEnabled *bool -} - -// SourceVault - The vault id is an Azure Resource Manager Resource id in the form /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName} -type SourceVault struct { - // Resource Id - ID *string -} - -// SpotRestorePolicy - Specifies the Spot-Try-Restore properties for the virtual machine scale set. With this property customer -// can enable or disable automatic restore of the evicted Spot VMSS VM instances opportunistically -// based on capacity availability and pricing constraint. -type SpotRestorePolicy struct { - // Enables the Spot-Try-Restore feature where evicted VMSS SPOT instances will be tried to be restored opportunistically based - // on capacity availability and pricing constraints - Enabled *bool - - // Timeout value expressed as an ISO 8601 time duration after which the platform will not try to restore the VMSS SPOT instances - RestoreTimeout *string -} - -// StatusCodeCount - The status code and count of the cloud service instance view statuses -type StatusCodeCount struct { - // READ-ONLY; The instance view status code - Code *string - - // READ-ONLY; Number of instances having this status code - Count *int32 -} - -// StorageProfile - Specifies the storage settings for the virtual machine disks. -type StorageProfile struct { - // Specifies the parameters that are used to add a data disk to a virtual machine. For more information about disks, see About - // disks and VHDs for Azure virtual machines - // [https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview]. - DataDisks []*DataDisk - - // Specifies the disk controller type configured for the VM. Note: This property will be set to the default disk controller - // type if not specified provided virtual machine is being created with - // 'hyperVGeneration' set to V2 based on the capabilities of the operating system disk and VM size from the the specified - // minimum api version. You need to deallocate the VM before updating its disk - // controller type unless you are updating the VM size in the VM configuration which implicitly deallocates and reallocates - // the VM. Minimum api-version: 2022-08-01. - DiskControllerType *DiskControllerTypes - - // Specifies information about the image to use. You can specify information about platform images, marketplace images, or - // virtual machine images. This element is required when you want to use a platform - // image, marketplace image, or virtual machine image, but is not used in other creation operations. - ImageReference *ImageReference - - // Specifies information about the operating system disk used by the virtual machine. For more information about disks, see - // About disks and VHDs for Azure virtual machines - // [https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview]. - OSDisk *OSDisk -} - -type SubResource struct { - // Resource Id - ID *string -} - -type SubResourceReadOnly struct { - // READ-ONLY; Resource Id - ID *string -} - -type SubResourceWithColocationStatus struct { - // Describes colocation status of a resource in the Proximity Placement Group. - ColocationStatus *InstanceViewStatus - - // Resource Id - ID *string -} - -// SupportedCapabilities - List of supported capabilities persisted on the disk resource for VM use. -type SupportedCapabilities struct { - // True if the image from which the OS disk is created supports accelerated networking. - AcceleratedNetwork *bool - - // CPU architecture supported by an OS disk. - Architecture *Architecture - - // The disk controllers that an OS disk supports. If set it can be SCSI or SCSI, NVME or NVME, SCSI. - DiskControllerTypes *string -} - -// SystemData - The system meta data relating to this resource. -type SystemData struct { - // READ-ONLY; Specifies the time in UTC at which the Cloud Service (extended support) resource was created. - // Minimum api-version: 2022-04-04. - CreatedAt *time.Time - - // READ-ONLY; Specifies the time in UTC at which the Cloud Service (extended support) resource was last modified. - // Minimum api-version: 2022-04-04. - LastModifiedAt *time.Time -} - -// TargetRegion - Describes the target region information. -type TargetRegion struct { - // REQUIRED; The name of the region. - Name *string - - // Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. - Encryption *EncryptionImages - - // Contains the flag setting to hide an image when users specify version='latest' - ExcludeFromLatest *bool - - // The number of replicas of the Image Version to be created per region. This property is updatable. - RegionalReplicaCount *int32 - - // Specifies the storage account type to be used to store the image. This property is not updatable. - StorageAccountType *StorageAccountType -} - -type TerminateNotificationProfile struct { - // Specifies whether the Terminate Scheduled event is enabled or disabled. - Enable *bool - - // Configurable length of time a Virtual Machine being deleted will have to potentially approve the Terminate Scheduled Event - // before the event is auto approved (timed out). The configuration must be - // specified in ISO 8601 format, the default value is 5 minutes (PT5M) - NotBeforeTimeout *string -} - -// ThrottledRequestsInput - Api request input for LogAnalytics getThrottledRequests Api. -type ThrottledRequestsInput struct { - // REQUIRED; SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. - BlobContainerSasURI *string - - // REQUIRED; From time of the query - FromTime *time.Time - - // REQUIRED; To time of the query - ToTime *time.Time - - // Group query result by Client Application ID. - GroupByClientApplicationID *bool - - // Group query result by Operation Name. - GroupByOperationName *bool - - // Group query result by Resource Name. - GroupByResourceName *bool - - // Group query result by Throttle Policy applied. - GroupByThrottlePolicy *bool - - // Group query result by User Agent. - GroupByUserAgent *bool -} - -// UefiKey - A UEFI key signature. -type UefiKey struct { - // The type of key signature. - Type *UefiKeyType - - // The value of the key signature. - Value []*string -} - -// UefiKeySignatures - Additional UEFI key signatures that will be added to the image in addition to the signature templates -type UefiKeySignatures struct { - // The database of UEFI keys for this image version. - Db []*UefiKey - - // The database of revoked UEFI keys for this image version. - Dbx []*UefiKey - - // The Key Encryption Keys of this image version. - Kek []*UefiKey - - // The Platform Key of this image version. - Pk *UefiKey -} - -// UefiSettings - Specifies the security settings like secure boot and vTPM used while creating the virtual machine. Minimum -// api-version: 2020-12-01. -type UefiSettings struct { - // Specifies whether secure boot should be enabled on the virtual machine. Minimum api-version: 2020-12-01. - SecureBootEnabled *bool - - // Specifies whether vTPM should be enabled on the virtual machine. Minimum api-version: 2020-12-01. - VTpmEnabled *bool -} - -// UpdateDomain - Defines an update domain for the cloud service. -type UpdateDomain struct { - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource Name - Name *string -} - -// UpdateDomainListResult - The list operation result. -type UpdateDomainListResult struct { - // REQUIRED; The list of resources. - Value []*UpdateDomain - - // The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null - // to fetch all the resources. - NextLink *string -} - -// UpdateResource - The Update Resource model definition. -type UpdateResource struct { - // Resource tags - Tags map[string]*string -} - -// UpdateResourceDefinition - The Update Resource model definition. -type UpdateResourceDefinition struct { - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// UpgradeOperationHistoricalStatusInfo - Virtual Machine Scale Set OS Upgrade History operation response. -type UpgradeOperationHistoricalStatusInfo struct { - // READ-ONLY; Resource location - Location *string - - // READ-ONLY; Information about the properties of the upgrade operation. - Properties *UpgradeOperationHistoricalStatusInfoProperties - - // READ-ONLY; Resource type - Type *string -} - -// UpgradeOperationHistoricalStatusInfoProperties - Describes each OS upgrade on the Virtual Machine Scale Set. -type UpgradeOperationHistoricalStatusInfoProperties struct { - // READ-ONLY; Error Details for this upgrade if there are any. - Error *APIError - - // READ-ONLY; Counts of the VMs in each state. - Progress *RollingUpgradeProgressInfo - - // READ-ONLY; Information about OS rollback if performed - RollbackInfo *RollbackStatusInfo - - // READ-ONLY; Information about the overall status of the upgrade operation. - RunningStatus *UpgradeOperationHistoryStatus - - // READ-ONLY; Invoker of the Upgrade Operation - StartedBy *UpgradeOperationInvoker - - // READ-ONLY; Image Reference details - TargetImageReference *ImageReference -} - -// UpgradeOperationHistoryStatus - Information about the current running state of the overall upgrade. -type UpgradeOperationHistoryStatus struct { - // READ-ONLY; Code indicating the current status of the upgrade. - Code *UpgradeState - - // READ-ONLY; End time of the upgrade. - EndTime *time.Time - - // READ-ONLY; Start time of the upgrade. - StartTime *time.Time -} - -// UpgradePolicy - Describes an upgrade policy - automatic, manual, or rolling. -type UpgradePolicy struct { - // Configuration parameters used for performing automatic OS Upgrade. - AutomaticOSUpgradePolicy *AutomaticOSUpgradePolicy - - // Specifies the mode of an upgrade to virtual machines in the scale set. - // Possible values are: - // Manual - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade - // action. - // Automatic - All virtual machines in the scale set are automatically updated at the same time. - Mode *UpgradeMode - - // The configuration parameters used while performing a rolling upgrade. - RollingUpgradePolicy *RollingUpgradePolicy -} - -// Usage - Describes Compute Resource Usage. -type Usage struct { - // REQUIRED; The current usage of the resource. - CurrentValue *int32 - - // REQUIRED; The maximum permitted usage of the resource. - Limit *int64 - - // REQUIRED; The name of the type of usage. - Name *UsageName - - // REQUIRED; An enum describing the unit of usage measurement. - Unit *string -} - -// UsageName - The Usage Names. -type UsageName struct { - // The localized name of the resource. - LocalizedValue *string - - // The name of the resource. - Value *string -} - -type UserArtifactManage struct { - // REQUIRED; Required. The path and arguments to install the gallery application. This is limited to 4096 characters. - Install *string - - // REQUIRED; Required. The path and arguments to remove the gallery application. This is limited to 4096 characters. - Remove *string - - // Optional. The path and arguments to update the gallery application. If not present, then update operation will invoke remove - // command on the previous version and install command on the current version - // of the gallery application. This is limited to 4096 characters. - Update *string -} - -// UserArtifactSettings - Additional settings for the VM app that contains the target package and config file name when it -// is deployed to target VM or VM scale set. -type UserArtifactSettings struct { - // Optional. The name to assign the downloaded config file on the VM. This is limited to 4096 characters. If not specified, - // the config file will be named the Gallery Application name appended with - // "_config". - ConfigFileName *string - - // Optional. The name to assign the downloaded package file on the VM. This is limited to 4096 characters. If not specified, - // the package file will be named the same as the Gallery Application name. - PackageFileName *string -} - -// UserArtifactSource - The source image from which the Image Version is going to be created. -type UserArtifactSource struct { - // REQUIRED; Required. The mediaLink of the artifact, must be a readable storage page blob. - MediaLink *string - - // Optional. The defaultConfigurationLink of the artifact, must be a readable storage page blob. - DefaultConfigurationLink *string -} - -type UserAssignedIdentitiesValue struct { - // READ-ONLY; The client id of user assigned identity. - ClientID *string - - // READ-ONLY; The principal id of user assigned identity. - PrincipalID *string -} - -// UserInitiatedReboot - Specifies Reboot related Scheduled Event related configurations. -type UserInitiatedReboot struct { - // Specifies Reboot Scheduled Event related configurations. - AutomaticallyApprove *bool -} - -// UserInitiatedRedeploy - Specifies Redeploy related Scheduled Event related configurations. -type UserInitiatedRedeploy struct { - // Specifies Redeploy Scheduled Event related configurations. - AutomaticallyApprove *bool -} - -// VMDiskSecurityProfile - Specifies the security profile settings for the managed disk. Note: It can only be set for Confidential -// VMs. -type VMDiskSecurityProfile struct { - // Specifies the customer managed disk encryption set resource id for the managed disk that is used for Customer Managed Key - // encrypted ConfidentialVM OS Disk and VMGuest blob. - DiskEncryptionSet *DiskEncryptionSetParameters - - // Specifies the EncryptionType of the managed disk. It is set to DiskWithVMGuestState for encryption of the managed disk - // along with VMGuestState blob, VMGuestStateOnly for encryption of just the - // VMGuestState blob, and NonPersistedTPM for not persisting firmware state in the VMGuestState blob.. Note: It can be set - // for only Confidential VMs. - SecurityEncryptionType *SecurityEncryptionTypes -} - -// VMGalleryApplication - Specifies the required information to reference a compute gallery application version -type VMGalleryApplication struct { - // REQUIRED; Specifies the GalleryApplicationVersion resource id on the form of - // /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{application}/versions/{version} - PackageReferenceID *string - - // Optional, Specifies the uri to an azure blob that will replace the default configuration for the package if provided - ConfigurationReference *string - - // If set to true, when a new Gallery Application version is available in PIR/SIG, it will be automatically updated for the - // VM/VMSS - EnableAutomaticUpgrade *bool - - // Optional, Specifies the order in which the packages have to be installed - Order *int32 - - // Optional, Specifies a passthrough value for more generic context. - Tags *string - - // Optional, If true, any failure for any operation in the VmApplication will fail the deployment - TreatFailureAsDeploymentFailure *bool -} - -// VMImagesInEdgeZoneListResult - The List VmImages in EdgeZone operation response. -type VMImagesInEdgeZoneListResult struct { - // The URI to fetch the next page of VMImages in EdgeZone. Call ListNext() with this URI to fetch the next page of VmImages. - NextLink *string - - // The list of VMImages in EdgeZone - Value []*VirtualMachineImageResource -} - -type VMScaleSetConvertToSinglePlacementGroupInput struct { - // Id of the placement group in which you want future virtual machine instances to be placed. To query placement group Id, - // please use Virtual Machine Scale Set VMs - Get API. If not provided, the - // platform will choose one with maximum number of virtual machine instances. - ActivePlacementGroupID *string -} - -// VMSizeProperties - Specifies VM Size Property settings on the virtual machine. -type VMSizeProperties struct { - // Specifies the number of vCPUs available for the VM. When this property is not specified in the request body the default - // behavior is to set it to the value of vCPUs available for that VM size exposed - // in api response of List all available virtual machine sizes in a region [https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list]. - VCPUsAvailable *int32 - - // Specifies the vCPU to physical core ratio. When this property is not specified in the request body the default behavior - // is set to the value of vCPUsPerCore for the VM Size exposed in api response of - // List all available virtual machine sizes in a region [https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list]. - // Setting this property to 1 also means that hyper-threading is disabled. - VCPUsPerCore *int32 -} - -// VaultCertificate - Describes a single certificate reference in a Key Vault, and where the certificate should reside on -// the VM. -type VaultCertificate struct { - // For Windows VMs, specifies the certificate store on the Virtual Machine to which the certificate should be added. The specified - // certificate store is implicitly in the LocalMachine account. For Linux - // VMs, the certificate file is placed under the /var/lib/waagent directory, with the file name .crt - // for the X509 certificate file and .prv for private key. Both - // of these files are .pem formatted. - CertificateStore *string - - // This is the URL of a certificate that has been uploaded to Key Vault as a secret. For adding a secret to the Key Vault, - // see Add a key or secret to the key vault - // [https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add]. In this case, your certificate needs to be It - // is the Base64 encoding of the following JSON Object which is encoded in UTF-8: - // { - // "data":"", - // "dataType":"pfx", - // "password":"" - // } - // To install certificates on a virtual machine it is recommended to use the Azure Key Vault virtual machine extension for - // Linux - // [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux] or the Azure Key Vault virtual machine extension - // for Windows - // [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows]. - CertificateURL *string -} - -// VaultSecretGroup - Describes a set of certificates which are all in the same Key Vault. -type VaultSecretGroup struct { - // The relative URL of the Key Vault containing all of the certificates in VaultCertificates. - SourceVault *SubResource - - // The list of key vault references in SourceVault which contain certificates. - VaultCertificates []*VaultCertificate -} - -// VirtualHardDisk - Describes the uri of a disk. -type VirtualHardDisk struct { - // Specifies the virtual hard disk's uri. - URI *string -} - -// VirtualMachine - Describes a Virtual Machine. -type VirtualMachine struct { - // REQUIRED; Resource location - Location *string - - // The extended location of the Virtual Machine. - ExtendedLocation *ExtendedLocation - - // The identity of the virtual machine, if configured. - Identity *VirtualMachineIdentity - - // Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace - // images. Before you can use a marketplace image from an API, you must - // enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click - // Want to deploy programmatically, Get Started ->. Enter any required - // information and then click Save. - Plan *Plan - - // Describes the properties of a Virtual Machine. - Properties *VirtualMachineProperties - - // Resource tags - Tags map[string]*string - - // The virtual machine zones. - Zones []*string - - // READ-ONLY; Etag is property returned in Create/Update/Get response of the VM, so that customer can supply it in the header - // to ensure optimistic updates. - Etag *string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; ManagedBy is set to Virtual Machine Scale Set(VMSS) flex ARM resourceID, if the VM is part of the VMSS. This - // property is used by platform for internal resource group delete optimization. - ManagedBy *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; The virtual machine child extension resources. - Resources []*VirtualMachineExtension - - // READ-ONLY; Resource type - Type *string -} - -// VirtualMachineAgentInstanceView - The instance view of the VM Agent running on the virtual machine. -type VirtualMachineAgentInstanceView struct { - // The virtual machine extension handler instance view. - ExtensionHandlers []*VirtualMachineExtensionHandlerInstanceView - - // The resource status information. - Statuses []*InstanceViewStatus - - // The VM Agent full version. - VMAgentVersion *string -} - -// VirtualMachineAssessPatchesResult - Describes the properties of an AssessPatches result. -type VirtualMachineAssessPatchesResult struct { - // READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension - // logs. - AssessmentActivityID *string - - // READ-ONLY; The list of patches that have been detected as available for installation. - AvailablePatches []*VirtualMachineSoftwarePatchProperties - - // READ-ONLY; The number of critical or security patches that have been detected as available and not yet installed. - CriticalAndSecurityPatchCount *int32 - - // READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. - Error *APIError - - // READ-ONLY; The number of all available patches excluding critical and security. - OtherPatchCount *int32 - - // READ-ONLY; The overall reboot status of the VM. It will be true when partially installed patches require a reboot to complete - // installation but the reboot has not yet occurred. - RebootPending *bool - - // READ-ONLY; The UTC timestamp when the operation began. - StartDateTime *time.Time - - // READ-ONLY; The overall success or failure status of the operation. It remains "InProgress" until the operation completes. - // At that point it will become "Unknown", "Failed", "Succeeded", or - // "CompletedWithWarnings." - Status *PatchOperationStatus -} - -// VirtualMachineCaptureParameters - Capture Virtual Machine parameters. -type VirtualMachineCaptureParameters struct { - // REQUIRED; The destination container name. - DestinationContainerName *string - - // REQUIRED; Specifies whether to overwrite the destination virtual hard disk, in case of conflict. - OverwriteVhds *bool - - // REQUIRED; The captured virtual hard disk's name prefix. - VhdPrefix *string -} - -// VirtualMachineCaptureResult - Output of virtual machine capture operation. -type VirtualMachineCaptureResult struct { - // Resource Id - ID *string - - // READ-ONLY; the version of the content - ContentVersion *string - - // READ-ONLY; parameters of the captured virtual machine - Parameters any - - // READ-ONLY; a list of resource items of the captured virtual machine - Resources []any - - // READ-ONLY; the schema of the captured virtual machine - Schema *string -} - -// VirtualMachineExtension - Describes a Virtual Machine Extension. -type VirtualMachineExtension struct { - // Resource location - Location *string - - // Describes the properties of a Virtual Machine Extension. - Properties *VirtualMachineExtensionProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// VirtualMachineExtensionHandlerInstanceView - The instance view of a virtual machine extension handler. -type VirtualMachineExtensionHandlerInstanceView struct { - // The extension handler status. - Status *InstanceViewStatus - - // Specifies the type of the extension; an example is "CustomScriptExtension". - Type *string - - // Specifies the version of the script handler. - TypeHandlerVersion *string -} - -// VirtualMachineExtensionImage - Describes a Virtual Machine Extension Image. -type VirtualMachineExtensionImage struct { - // REQUIRED; Resource location - Location *string - - // Describes the properties of a Virtual Machine Extension Image. - Properties *VirtualMachineExtensionImageProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// VirtualMachineExtensionImageProperties - Describes the properties of a Virtual Machine Extension Image. -type VirtualMachineExtensionImageProperties struct { - // REQUIRED; The type of role (IaaS or PaaS) this extension supports. - ComputeRole *string - - // REQUIRED; The schema defined by publisher, where extension consumers should provide settings in a matching schema. - HandlerSchema *string - - // REQUIRED; The operating system this extension supports. - OperatingSystem *string - - // Whether the handler can support multiple extensions. - SupportsMultipleExtensions *bool - - // Whether the extension can be used on xRP VMScaleSets. By default existing extensions are usable on scalesets, but there - // might be cases where a publisher wants to explicitly indicate the extension is - // only enabled for CRP VMs but not VMSS. - VMScaleSetEnabled *bool -} - -// VirtualMachineExtensionInstanceView - The instance view of a virtual machine extension. -type VirtualMachineExtensionInstanceView struct { - // The virtual machine extension name. - Name *string - - // The resource status information. - Statuses []*InstanceViewStatus - - // The resource status information. - Substatuses []*InstanceViewStatus - - // Specifies the type of the extension; an example is "CustomScriptExtension". - Type *string - - // Specifies the version of the script handler. - TypeHandlerVersion *string -} - -// VirtualMachineExtensionProperties - Describes the properties of a Virtual Machine Extension. -type VirtualMachineExtensionProperties struct { - // Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, - // however, the extension will not upgrade minor versions unless redeployed, even - // with this property set to true. - AutoUpgradeMinorVersion *bool - - // Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension - // available. - EnableAutomaticUpgrade *bool - - // How the extension handler should be forced to update even if the extension configuration has not changed. - ForceUpdateTag *string - - // The virtual machine extension instance view. - InstanceView *VirtualMachineExtensionInstanceView - - // The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - ProtectedSettings any - - // The extensions protected settings that are passed by reference, and consumed from key vault - ProtectedSettingsFromKeyVault *KeyVaultSecretReference - - // Collection of extension names after which this extension needs to be provisioned. - ProvisionAfterExtensions []*string - - // The name of the extension handler publisher. - Publisher *string - - // Json formatted public settings for the extension. - Settings any - - // Indicates whether failures stemming from the extension will be suppressed (Operational failures such as not connecting - // to the VM will not be suppressed regardless of this value). The default is false. - SuppressFailures *bool - - // Specifies the type of the extension; an example is "CustomScriptExtension". - Type *string - - // Specifies the version of the script handler. - TypeHandlerVersion *string - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string -} - -// VirtualMachineExtensionUpdate - Describes a Virtual Machine Extension. -type VirtualMachineExtensionUpdate struct { - // Describes the properties of a Virtual Machine Extension. - Properties *VirtualMachineExtensionUpdateProperties - - // Resource tags - Tags map[string]*string -} - -// VirtualMachineExtensionUpdateProperties - Describes the properties of a Virtual Machine Extension. -type VirtualMachineExtensionUpdateProperties struct { - // Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, - // however, the extension will not upgrade minor versions unless redeployed, even - // with this property set to true. - AutoUpgradeMinorVersion *bool - - // Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension - // available. - EnableAutomaticUpgrade *bool - - // How the extension handler should be forced to update even if the extension configuration has not changed. - ForceUpdateTag *string - - // The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - ProtectedSettings any - - // The extensions protected settings that are passed by reference, and consumed from key vault - ProtectedSettingsFromKeyVault *KeyVaultSecretReference - - // The name of the extension handler publisher. - Publisher *string - - // Json formatted public settings for the extension. - Settings any - - // Indicates whether failures stemming from the extension will be suppressed (Operational failures such as not connecting - // to the VM will not be suppressed regardless of this value). The default is false. - SuppressFailures *bool - - // Specifies the type of the extension; an example is "CustomScriptExtension". - Type *string - - // Specifies the version of the script handler. - TypeHandlerVersion *string -} - -// VirtualMachineExtensionsListResult - The List Extension operation response -type VirtualMachineExtensionsListResult struct { - // The list of extensions - Value []*VirtualMachineExtension -} - -// VirtualMachineHealthStatus - The health status of the VM. -type VirtualMachineHealthStatus struct { - // READ-ONLY; The health status information for the VM. - Status *InstanceViewStatus -} - -// VirtualMachineIPTag - Contains the IP tag associated with the public IP address. -type VirtualMachineIPTag struct { - // IP tag type. Example: FirstPartyUsage. - IPTagType *string - - // IP tag associated with the public IP. Example: SQL, Storage etc. - Tag *string -} - -// VirtualMachineIdentity - Identity for the virtual machine. -type VirtualMachineIdentity struct { - // The type of identity used for the virtual machine. The type 'SystemAssigned, UserAssigned' includes both an implicitly - // created identity and a set of user assigned identities. The type 'None' will - // remove any identities from the virtual machine. - Type *ResourceIdentityType - - // The list of user identities associated with the Virtual Machine. The user identity dictionary key references will be ARM - // resource ids in the form: - // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - UserAssignedIdentities map[string]*UserAssignedIdentitiesValue - - // READ-ONLY; The principal id of virtual machine identity. This property will only be provided for a system assigned identity. - PrincipalID *string - - // READ-ONLY; The tenant id associated with the virtual machine. This property will only be provided for a system assigned - // identity. - TenantID *string -} - -// VirtualMachineImage - Describes a Virtual Machine Image. -type VirtualMachineImage struct { - // REQUIRED; The supported Azure location of the resource. - Location *string - - // REQUIRED; The name of the resource. - Name *string - - // The extended location of the Virtual Machine. - ExtendedLocation *ExtendedLocation - - // Resource Id - ID *string - - // Describes the properties of a Virtual Machine Image. - Properties *VirtualMachineImageProperties - - // Specifies the tags that are assigned to the virtual machine. For more information about using tags, see Using tags to organize - // your Azure resources - // [https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md]. - Tags map[string]*string -} - -// VirtualMachineImageFeature - Specifies additional capabilities supported by the image -type VirtualMachineImageFeature struct { - // The name of the feature. - Name *string - - // The corresponding value for the feature. - Value *string -} - -// VirtualMachineImageProperties - Describes the properties of a Virtual Machine Image. -type VirtualMachineImageProperties struct { - // Specifies the Architecture Type - Architecture *ArchitectureTypes - - // Describes automatic OS upgrade properties on the image. - AutomaticOSUpgradeProperties *AutomaticOSUpgradeProperties - DataDiskImages []*DataDiskImage - - // Specifies disallowed configuration for the VirtualMachine created from the image - Disallowed *DisallowedConfiguration - Features []*VirtualMachineImageFeature - - // Specifies the HyperVGeneration Type - HyperVGeneration *HyperVGenerationTypes - - // Describes image deprecation status properties on the image. - ImageDeprecationStatus *ImageDeprecationStatus - - // Contains the os disk image information. - OSDiskImage *OSDiskImage - - // Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. - Plan *PurchasePlan -} - -// VirtualMachineImageResource - Virtual machine image resource information. -type VirtualMachineImageResource struct { - // REQUIRED; The supported Azure location of the resource. - Location *string - - // REQUIRED; The name of the resource. - Name *string - - // The extended location of the Virtual Machine. - ExtendedLocation *ExtendedLocation - - // Resource Id - ID *string - - // Specifies the tags that are assigned to the virtual machine. For more information about using tags, see Using tags to organize - // your Azure resources - // [https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md]. - Tags map[string]*string -} - -// VirtualMachineInstallPatchesParameters - Input for InstallPatches as directly received by the API -type VirtualMachineInstallPatchesParameters struct { - // REQUIRED; Defines when it is acceptable to reboot a VM during a software update operation. - RebootSetting *VMGuestPatchRebootSetting - - // Input for InstallPatches on a Linux VM, as directly received by the API - LinuxParameters *LinuxParameters - - // Specifies the maximum amount of time that the operation will run. It must be an ISO 8601-compliant duration string such - // as PT4H (4 hours) - MaximumDuration *string - - // Input for InstallPatches on a Windows VM, as directly received by the API - WindowsParameters *WindowsParameters -} - -// VirtualMachineInstallPatchesResult - The result summary of an installation operation. -type VirtualMachineInstallPatchesResult struct { - // READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. - Error *APIError - - // READ-ONLY; The number of patches that were not installed due to the user blocking their installation. - ExcludedPatchCount *int32 - - // READ-ONLY; The number of patches that could not be installed due to some issue. See errors for details. - FailedPatchCount *int32 - - // READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension - // logs. - InstallationActivityID *string - - // READ-ONLY; The number of patches successfully installed. - InstalledPatchCount *int32 - - // READ-ONLY; Whether the operation ran out of time before it completed all its intended actions. - MaintenanceWindowExceeded *bool - - // READ-ONLY; The number of patches that were detected as available for install, but did not meet the operation's criteria. - NotSelectedPatchCount *int32 - - // READ-ONLY; The patches that were installed during the operation. - Patches []*PatchInstallationDetail - - // READ-ONLY; The number of patches that were identified as meeting the installation criteria, but were not able to be installed. - // Typically this happens when maintenanceWindowExceeded == true. - PendingPatchCount *int32 - - // READ-ONLY; The reboot state of the VM following completion of the operation. - RebootStatus *VMGuestPatchRebootStatus - - // READ-ONLY; The UTC timestamp when the operation began. - StartDateTime *time.Time - - // READ-ONLY; The overall success or failure status of the operation. It remains "InProgress" until the operation completes. - // At that point it will become "Failed", "Succeeded", "Unknown" or "CompletedWithWarnings." - Status *PatchOperationStatus -} - -// VirtualMachineInstanceView - The instance view of a virtual machine. -type VirtualMachineInstanceView struct { - // Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status. You - // can easily view the output of your console log. Azure also enables you to see - // a screenshot of the VM from the hypervisor. - BootDiagnostics *BootDiagnosticsInstanceView - - // The computer name assigned to the virtual machine. - ComputerName *string - - // The virtual machine disk information. - Disks []*DiskInstanceView - - // The extensions information. - Extensions []*VirtualMachineExtensionInstanceView - - // Specifies the HyperVGeneration Type associated with a resource - HyperVGeneration *HyperVGenerationType - - // The Maintenance Operation status on the virtual machine. - MaintenanceRedeployStatus *MaintenanceRedeployStatus - - // The Operating System running on the virtual machine. - OSName *string - - // The version of Operating System running on the virtual machine. - OSVersion *string - - // [Preview Feature] The status of virtual machine patch operations. - PatchStatus *VirtualMachinePatchStatus - - // Specifies the fault domain of the virtual machine. - PlatformFaultDomain *int32 - - // Specifies the update domain of the virtual machine. - PlatformUpdateDomain *int32 - - // The Remote desktop certificate thumbprint. - RdpThumbPrint *string - - // The resource status information. - Statuses []*InstanceViewStatus - - // The VM Agent running on the virtual machine. - VMAgent *VirtualMachineAgentInstanceView - - // READ-ONLY; Resource id of the dedicated host, on which the virtual machine is allocated through automatic placement, when - // the virtual machine is associated with a dedicated host group that has automatic - // placement enabled. Minimum api-version: 2020-06-01. - AssignedHost *string - - // READ-ONLY; [Preview Feature] Specifies whether the VM is currently in or out of the Standby Pool. - IsVMInStandbyPool *bool - - // READ-ONLY; The health status for the VM. - VMHealth *VirtualMachineHealthStatus -} - -// VirtualMachineListResult - The List Virtual Machine operation response. -type VirtualMachineListResult struct { - // REQUIRED; The list of virtual machines. - Value []*VirtualMachine - - // The URI to fetch the next page of VMs. Call ListNext() with this URI to fetch the next page of Virtual Machines. - NextLink *string -} - -// VirtualMachineNetworkInterfaceConfiguration - Describes a virtual machine network interface configurations. -type VirtualMachineNetworkInterfaceConfiguration struct { - // REQUIRED; The network interface configuration name. - Name *string - - // Describes a virtual machine network profile's IP configuration. - Properties *VirtualMachineNetworkInterfaceConfigurationProperties -} - -// VirtualMachineNetworkInterfaceConfigurationProperties - Describes a virtual machine network profile's IP configuration. -type VirtualMachineNetworkInterfaceConfigurationProperties struct { - // REQUIRED; Specifies the IP configurations of the network interface. - IPConfigurations []*VirtualMachineNetworkInterfaceIPConfiguration - - // Specifies whether the Auxiliary mode is enabled for the Network Interface resource. - AuxiliaryMode *NetworkInterfaceAuxiliaryMode - - // Specifies whether the Auxiliary sku is enabled for the Network Interface resource. - AuxiliarySKU *NetworkInterfaceAuxiliarySKU - - // The dns settings to be applied on the network interfaces. - DNSSettings *VirtualMachineNetworkInterfaceDNSSettingsConfiguration - - // Specify what happens to the network interface when the VM is deleted - DeleteOption *DeleteOptions - - // Specifies whether the network interface is disabled for tcp state tracking. - DisableTCPStateTracking *bool - DscpConfiguration *SubResource - - // Specifies whether the network interface is accelerated networking-enabled. - EnableAcceleratedNetworking *bool - - // Specifies whether the network interface is FPGA networking-enabled. - EnableFpga *bool - - // Whether IP forwarding enabled on this NIC. - EnableIPForwarding *bool - - // The network security group. - NetworkSecurityGroup *SubResource - - // Specifies the primary network interface in case the virtual machine has more than 1 network interface. - Primary *bool -} - -// VirtualMachineNetworkInterfaceDNSSettingsConfiguration - Describes a virtual machines network configuration's DNS settings. -type VirtualMachineNetworkInterfaceDNSSettingsConfiguration struct { - // List of DNS servers IP addresses - DNSServers []*string -} - -// VirtualMachineNetworkInterfaceIPConfiguration - Describes a virtual machine network profile's IP configuration. -type VirtualMachineNetworkInterfaceIPConfiguration struct { - // REQUIRED; The IP configuration name. - Name *string - - // Describes a virtual machine network interface IP configuration properties. - Properties *VirtualMachineNetworkInterfaceIPConfigurationProperties -} - -// VirtualMachineNetworkInterfaceIPConfigurationProperties - Describes a virtual machine network interface IP configuration -// properties. -type VirtualMachineNetworkInterfaceIPConfigurationProperties struct { - // Specifies an array of references to backend address pools of application gateways. A virtual machine can reference backend - // address pools of multiple application gateways. Multiple virtual machines - // cannot use the same application gateway. - ApplicationGatewayBackendAddressPools []*SubResource - - // Specifies an array of references to application security group. - ApplicationSecurityGroups []*SubResource - - // Specifies an array of references to backend address pools of load balancers. A virtual machine can reference backend address - // pools of one public and one internal load balancer. [Multiple virtual - // machines cannot use the same basic sku load balancer]. - LoadBalancerBackendAddressPools []*SubResource - - // Specifies the primary network interface in case the virtual machine has more than 1 network interface. - Primary *bool - - // Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default - // is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. - PrivateIPAddressVersion *IPVersions - - // The publicIPAddressConfiguration. - PublicIPAddressConfiguration *VirtualMachinePublicIPAddressConfiguration - - // Specifies the identifier of the subnet. - Subnet *SubResource -} - -// VirtualMachinePatchStatus - The status of virtual machine patch operations. -type VirtualMachinePatchStatus struct { - // The available patch summary of the latest assessment operation for the virtual machine. - AvailablePatchSummary *AvailablePatchSummary - - // The installation summary of the latest installation operation for the virtual machine. - LastPatchInstallationSummary *LastPatchInstallationSummary - - // READ-ONLY; The enablement status of the specified patchMode - ConfigurationStatuses []*InstanceViewStatus -} - -// VirtualMachineProperties - Describes the properties of a Virtual Machine. -type VirtualMachineProperties struct { - // Specifies additional capabilities enabled or disabled on the virtual machine. - AdditionalCapabilities *AdditionalCapabilities - - // Specifies the gallery applications that should be made available to the VM/VMSS. - ApplicationProfile *ApplicationProfile - - // Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified - // in the same availability set are allocated to different nodes to maximize - // availability. For more information about availability sets, see Availability sets overview [https://docs.microsoft.com/azure/virtual-machines/availability-set-overview]. - // For more information on Azure - // planned maintenance, see Maintenance and updates for Virtual Machines in Azure [https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates]. - // Currently, a VM can only be added to - // availability set at creation time. The availability set to which the VM is being added should be under the same resource - // group as the availability set resource. An existing VM cannot be added to an - // availability set. This property cannot exist along with a non-null properties.virtualMachineScaleSet reference. - AvailabilitySet *SubResource - - // Specifies the billing related details of a Azure Spot virtual machine. Minimum api-version: 2019-03-01. - BillingProfile *BillingProfile - - // Specifies information about the capacity reservation that is used to allocate virtual machine. Minimum api-version: 2021-04-01. - CapacityReservation *CapacityReservationProfile - - // Specifies the boot diagnostic settings state. Minimum api-version: 2015-06-15. - DiagnosticsProfile *DiagnosticsProfile - - // Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set. For Azure Spot virtual machines, - // both 'Deallocate' and 'Delete' are supported and the minimum api-version is - // 2019-03-01. For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. - EvictionPolicy *VirtualMachineEvictionPolicyTypes - - // Specifies the time alloted for all extensions to start. The time duration should be between 15 minutes and 120 minutes - // (inclusive) and should be specified in ISO 8601 format. The default value is 90 - // minutes (PT1H30M). Minimum api-version: 2020-06-01. - ExtensionsTimeBudget *string - - // Specifies the hardware settings for the virtual machine. - HardwareProfile *HardwareProfile - - // Specifies information about the dedicated host that the virtual machine resides in. Minimum api-version: 2018-10-01. - Host *SubResource - - // Specifies information about the dedicated host group that the virtual machine resides in. Note: User cannot specify both - // host and hostGroup properties. Minimum api-version: 2020-06-01. - HostGroup *SubResource - - // Specifies that the image or disk that is being used was licensed on-premises. - // Possible values for Windows Server operating system are: - // WindowsClient - // WindowsServer - // Possible values for Linux Server operating system are: - // RHELBYOS (for RHEL) - // SLESBYOS (for SUSE) - // For more information, see Azure Hybrid Use Benefit for Windows Server [https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing] - // Azure Hybrid Use Benefit for Linux Server [https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux] - // Minimum api-version: 2015-06-15 - LicenseType *string - - // Specifies the network interfaces of the virtual machine. - NetworkProfile *NetworkProfile - - // Specifies the operating system settings used while creating the virtual machine. Some of the settings cannot be changed - // once VM is provisioned. - OSProfile *OSProfile - - // Specifies the scale set logical fault domain into which the Virtual Machine will be created. By default, the Virtual Machine - // will by automatically assigned to a fault domain that best maintains - // balance across available fault domains. This is applicable only if the 'virtualMachineScaleSet' property of this Virtual - // Machine is set. The Virtual Machine Scale Set that is referenced, must have - // 'platformFaultDomainCount' greater than 1. This property cannot be updated once the Virtual Machine is created. Fault domain - // assignment can be viewed in the Virtual Machine Instance View. Minimum - // api‐version: 2020‐12‐01. - PlatformFaultDomain *int32 - - // Specifies the priority for the virtual machine. Minimum api-version: 2019-03-01 - Priority *VirtualMachinePriorityTypes - - // Specifies information about the proximity placement group that the virtual machine should be assigned to. Minimum api-version: - // 2018-04-01. - ProximityPlacementGroup *SubResource - - // Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets Scheduled Event related configurations for the - // virtual machine. - ScheduledEventsPolicy *ScheduledEventsPolicy - - // Specifies Scheduled Event related configurations. - ScheduledEventsProfile *ScheduledEventsProfile - - // Specifies the Security related profile settings for the virtual machine. - SecurityProfile *SecurityProfile - - // Specifies the storage settings for the virtual machine disks. - StorageProfile *StorageProfile - - // UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. Minimum api-version: - // 2021-03-01. - UserData *string - - // Specifies information about the virtual machine scale set that the virtual machine should be assigned to. Virtual machines - // specified in the same virtual machine scale set are allocated to different - // nodes to maximize availability. Currently, a VM can only be added to virtual machine scale set at creation time. An existing - // VM cannot be added to a virtual machine scale set. This property cannot - // exist along with a non-null properties.availabilitySet reference. Minimum api‐version: 2019‐03‐01. - VirtualMachineScaleSet *SubResource - - // READ-ONLY; The virtual machine instance view. - InstanceView *VirtualMachineInstanceView - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string - - // READ-ONLY; Specifies the time at which the Virtual Machine resource was created. Minimum api-version: 2021-11-01. - TimeCreated *time.Time - - // READ-ONLY; Specifies the VM unique ID which is a 128-bits identifier that is encoded and stored in all Azure IaaS VMs SMBIOS - // and can be read using platform BIOS commands. - VMID *string -} - -// VirtualMachinePublicIPAddressConfiguration - Describes a virtual machines IP Configuration's PublicIPAddress configuration -type VirtualMachinePublicIPAddressConfiguration struct { - // REQUIRED; The publicIP address configuration name. - Name *string - - // Describes a virtual machines IP Configuration's PublicIPAddress configuration - Properties *VirtualMachinePublicIPAddressConfigurationProperties - - // Describes the public IP Sku. It can only be set with OrchestrationMode as Flexible. - SKU *PublicIPAddressSKU -} - -// VirtualMachinePublicIPAddressConfigurationProperties - Describes a virtual machines IP Configuration's PublicIPAddress -// configuration -type VirtualMachinePublicIPAddressConfigurationProperties struct { - // The dns settings to be applied on the publicIP addresses . - DNSSettings *VirtualMachinePublicIPAddressDNSSettingsConfiguration - - // Specify what happens to the public IP address when the VM is deleted - DeleteOption *DeleteOptions - - // The list of IP tags associated with the public IP address. - IPTags []*VirtualMachineIPTag - - // The idle timeout of the public IP address. - IdleTimeoutInMinutes *int32 - - // Available from Api-Version 2019-07-01 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default - // is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. - PublicIPAddressVersion *IPVersions - - // Specify the public IP allocation type - PublicIPAllocationMethod *PublicIPAllocationMethod - - // The PublicIPPrefix from which to allocate publicIP addresses. - PublicIPPrefix *SubResource -} - -// VirtualMachinePublicIPAddressDNSSettingsConfiguration - Describes a virtual machines network configuration's DNS settings. -type VirtualMachinePublicIPAddressDNSSettingsConfiguration struct { - // REQUIRED; The Domain name label prefix of the PublicIPAddress resources that will be created. The generated name label - // is the concatenation of the domain name label and vm network profile unique ID. - DomainNameLabel *string - - // The Domain name label scope of the PublicIPAddress resources that will be created. The generated name label is the concatenation - // of the hashed domain name label with policy according to the domain - // name label scope and vm network profile unique ID. - DomainNameLabelScope *DomainNameLabelScopeTypes -} - -// VirtualMachineReimageParameters - Parameters for Reimaging Virtual Machine. NOTE: Virtual Machine OS disk will always be -// reimaged -type VirtualMachineReimageParameters struct { - // Specifies in decimal number, the version the OS disk should be reimaged to. If exact version is not provided, the OS disk - // is reimaged to the existing version of OS Disk. - ExactVersion *string - - // Specifies information required for reimaging the non-ephemeral OS disk. - OSProfile *OSProfileProvisioningData - - // Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage parameter is only supported - // for VM/VMSS with Ephemeral OS disk. - TempDisk *bool -} - -// VirtualMachineRunCommand - Describes a Virtual Machine run command. -type VirtualMachineRunCommand struct { - // REQUIRED; Resource location - Location *string - - // Describes the properties of a Virtual Machine run command. - Properties *VirtualMachineRunCommandProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// VirtualMachineRunCommandInstanceView - The instance view of a virtual machine run command. -type VirtualMachineRunCommandInstanceView struct { - // Script end time. - EndTime *time.Time - - // Script error stream. - Error *string - - // Communicate script configuration errors or execution messages. - ExecutionMessage *string - - // Script execution status. - ExecutionState *ExecutionState - - // Exit code returned from script execution. - ExitCode *int32 - - // Script output stream. - Output *string - - // Script start time. - StartTime *time.Time - - // The resource status information. - Statuses []*InstanceViewStatus -} - -// VirtualMachineRunCommandProperties - Describes the properties of a Virtual Machine run command. -type VirtualMachineRunCommandProperties struct { - // Optional. If set to true, provisioning will complete as soon as the script starts and will not wait for script to complete. - AsyncExecution *bool - - // User-assigned managed identity that has access to errorBlobUri storage blob. Use an empty object in case of system-assigned - // identity. Make sure managed identity has been given access to blob's - // container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it - // under VM's identity. For more info on managed identity and Run Command, refer - // https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged - ErrorBlobManagedIdentity *RunCommandManagedIdentity - - // Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write - // access OR use managed identity to provide the VM access to the blob. Refer - // errorBlobManagedIdentity parameter. - ErrorBlobURI *string - - // User-assigned managed identity that has access to outputBlobUri storage blob. Use an empty object in case of system-assigned - // identity. Make sure managed identity has been given access to blob's - // container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it - // under VM's identity. For more info on managed identity and Run Command, refer - // https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged - OutputBlobManagedIdentity *RunCommandManagedIdentity - - // Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, - // write access OR use managed identity to provide the VM access to the blob. Refer - // outputBlobManagedIdentity parameter. - OutputBlobURI *string - - // The parameters used by the script. - Parameters []*RunCommandInputParameter - - // The parameters used by the script. - ProtectedParameters []*RunCommandInputParameter - - // Specifies the user account password on the VM when executing the run command. - RunAsPassword *string - - // Specifies the user account on the VM when executing the run command. - RunAsUser *string - - // The source of the run command script. - Source *VirtualMachineRunCommandScriptSource - - // The timeout in seconds to execute the run command. - TimeoutInSeconds *int32 - - // Optional. If set to true, any failure in the script will fail the deployment and ProvisioningState will be marked as Failed. - // If set to false, ProvisioningState would only reflect whether the run - // command was run or not by the extensions platform, it would not indicate whether script failed in case of script failures. - // See instance view of run command in case of script failures to see - // executionMessage, output, error: https://aka.ms/runcommandmanaged#get-execution-status-and-results - TreatFailureAsDeploymentFailure *bool - - // READ-ONLY; The virtual machine run command instance view. - InstanceView *VirtualMachineRunCommandInstanceView - - // READ-ONLY; The provisioning state, which only appears in the response. If treatFailureAsDeploymentFailure set to true, - // any failure in the script will fail the deployment and ProvisioningState will be marked as - // Failed. If treatFailureAsDeploymentFailure set to false, ProvisioningState would only reflect whether the run command was - // run or not by the extensions platform, it would not indicate whether script - // failed in case of script failures. See instance view of run command in case of script failures to see executionMessage, - // output, error: https://aka.ms/runcommandmanaged#get-execution-status-and-results - ProvisioningState *string -} - -// VirtualMachineRunCommandScriptSource - Describes the script sources for run command. Use only one of script, scriptUri, -// commandId. -type VirtualMachineRunCommandScriptSource struct { - // Specifies a commandId of predefined built-in script. - CommandID *string - - // Specifies the script content to be executed on the VM. - Script *string - - // Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI. - ScriptURI *string - - // User-assigned managed identity that has access to scriptUri in case of Azure storage blob. Use an empty object in case - // of system-assigned identity. Make sure the Azure storage blob exists, and managed - // identity has been given access to blob's container with 'Storage Blob Data Reader' role assignment. In case of user-assigned - // identity, make sure you add it under VM's identity. For more info on - // managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. - ScriptURIManagedIdentity *RunCommandManagedIdentity -} - -// VirtualMachineRunCommandUpdate - Describes a Virtual Machine run command. -type VirtualMachineRunCommandUpdate struct { - // Describes the properties of a Virtual Machine run command. - Properties *VirtualMachineRunCommandProperties - - // Resource tags - Tags map[string]*string -} - -// VirtualMachineRunCommandsListResult - The List run command operation response -type VirtualMachineRunCommandsListResult struct { - // REQUIRED; The list of run commands - Value []*VirtualMachineRunCommand - - // The uri to fetch the next page of run commands. - NextLink *string -} - -// VirtualMachineScaleSet - Describes a Virtual Machine Scale Set. -type VirtualMachineScaleSet struct { - // REQUIRED; Resource location - Location *string - - // The extended location of the Virtual Machine Scale Set. - ExtendedLocation *ExtendedLocation - - // The identity of the virtual machine scale set, if configured. - Identity *VirtualMachineScaleSetIdentity - - // Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace - // images. Before you can use a marketplace image from an API, you must - // enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click - // Want to deploy programmatically, Get Started ->. Enter any required - // information and then click Save. - Plan *Plan - - // Describes the properties of a Virtual Machine Scale Set. - Properties *VirtualMachineScaleSetProperties - - // The virtual machine scale set sku. - SKU *SKU - - // Resource tags - Tags map[string]*string - - // The virtual machine scale set zones. NOTE: Availability zones can only be set when you create the scale set - Zones []*string - - // READ-ONLY; Etag is property returned in Create/Update/Get response of the VMSS, so that customer can supply it in the header - // to ensure optimistic updates - Etag *string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// VirtualMachineScaleSetDataDisk - Describes a virtual machine scale set data disk. -type VirtualMachineScaleSetDataDisk struct { - // REQUIRED; The create option. - CreateOption *DiskCreateOptionTypes - - // REQUIRED; Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and - // therefore must be unique for each data disk attached to a VM. - Lun *int32 - - // Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The default values are: None for Standard - // storage. ReadOnly for Premium storage. - Caching *CachingTypes - - // Specifies whether data disk should be deleted or detached upon VMSS Flex deletion (This feature is available for VMSS with - // Flexible OrchestrationMode only). - // Possible values: - // Delete If this value is used, the data disk is deleted when the VMSS Flex VM is deleted. - // Detach If this value is used, the data disk is retained after VMSS Flex VM is deleted. - // The default value is set to Delete. - DeleteOption *DiskDeleteOptionTypes - - // Specifies the Read-Write IOPS for the managed disk. Should be used only when StorageAccountType is UltraSSD_LRS. If not - // specified, a default value would be assigned based on diskSizeGB. - DiskIOPSReadWrite *int64 - - // Specifies the bandwidth in MB per second for the managed disk. Should be used only when StorageAccountType is UltraSSD_LRS. - // If not specified, a default value would be assigned based on diskSizeGB. - DiskMBpsReadWrite *int64 - - // Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a - // virtual machine image. The property diskSizeGB is the number of bytes x 1024^3 - // for the disk and the value cannot be larger than 1023. - DiskSizeGB *int32 - - // The managed disk parameters. - ManagedDisk *VirtualMachineScaleSetManagedDiskParameters - - // The disk name. - Name *string - - // Specifies whether writeAccelerator should be enabled or disabled on the disk. - WriteAcceleratorEnabled *bool -} - -// VirtualMachineScaleSetExtension - Describes a Virtual Machine Scale Set Extension. -type VirtualMachineScaleSetExtension struct { - // The name of the extension. - Name *string - - // Describes the properties of a Virtual Machine Scale Set Extension. - Properties *VirtualMachineScaleSetExtensionProperties - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource type - Type *string -} - -// VirtualMachineScaleSetExtensionListResult - The List VM scale set extension operation response. -type VirtualMachineScaleSetExtensionListResult struct { - // REQUIRED; The list of VM scale set extensions. - Value []*VirtualMachineScaleSetExtension - - // The uri to fetch the next page of VM scale set extensions. Call ListNext() with this to fetch the next page of VM scale - // set extensions. - NextLink *string -} - -// VirtualMachineScaleSetExtensionProfile - Describes a virtual machine scale set extension profile. -type VirtualMachineScaleSetExtensionProfile struct { - // The virtual machine scale set child extension resources. - Extensions []*VirtualMachineScaleSetExtension - - // Specifies the time alloted for all extensions to start. The time duration should be between 15 minutes and 120 minutes - // (inclusive) and should be specified in ISO 8601 format. The default value is 90 - // minutes (PT1H30M). Minimum api-version: 2020-06-01. - ExtensionsTimeBudget *string -} - -// VirtualMachineScaleSetExtensionProperties - Describes the properties of a Virtual Machine Scale Set Extension. -type VirtualMachineScaleSetExtensionProperties struct { - // Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, - // however, the extension will not upgrade minor versions unless redeployed, even - // with this property set to true. - AutoUpgradeMinorVersion *bool - - // Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension - // available. - EnableAutomaticUpgrade *bool - - // If a value is provided and is different from the previous value, the extension handler will be forced to update even if - // the extension configuration has not changed. - ForceUpdateTag *string - - // The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - ProtectedSettings any - - // The extensions protected settings that are passed by reference, and consumed from key vault - ProtectedSettingsFromKeyVault *KeyVaultSecretReference - - // Collection of extension names after which this extension needs to be provisioned. - ProvisionAfterExtensions []*string - - // The name of the extension handler publisher. - Publisher *string - - // Json formatted public settings for the extension. - Settings any - - // Indicates whether failures stemming from the extension will be suppressed (Operational failures such as not connecting - // to the VM will not be suppressed regardless of this value). The default is false. - SuppressFailures *bool - - // Specifies the type of the extension; an example is "CustomScriptExtension". - Type *string - - // Specifies the version of the script handler. - TypeHandlerVersion *string - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string -} - -// VirtualMachineScaleSetExtensionUpdate - Describes a Virtual Machine Scale Set Extension. -type VirtualMachineScaleSetExtensionUpdate struct { - // Describes the properties of a Virtual Machine Scale Set Extension. - Properties *VirtualMachineScaleSetExtensionProperties - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; The name of the extension. - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// VirtualMachineScaleSetHardwareProfile - Specifies the hardware settings for the virtual machine scale set. -type VirtualMachineScaleSetHardwareProfile struct { - // Specifies the properties for customizing the size of the virtual machine. Minimum api-version: 2021-11-01. Please follow - // the instructions in VM Customization [https://aka.ms/vmcustomization] for more - // details. - VMSizeProperties *VMSizeProperties -} - -// VirtualMachineScaleSetIPConfiguration - Describes a virtual machine scale set network profile's IP configuration. -type VirtualMachineScaleSetIPConfiguration struct { - // REQUIRED; The IP configuration name. - Name *string - - // Describes a virtual machine scale set network profile's IP configuration properties. - Properties *VirtualMachineScaleSetIPConfigurationProperties -} - -// VirtualMachineScaleSetIPConfigurationProperties - Describes a virtual machine scale set network profile's IP configuration -// properties. -type VirtualMachineScaleSetIPConfigurationProperties struct { - // Specifies an array of references to backend address pools of application gateways. A scale set can reference backend address - // pools of multiple application gateways. Multiple scale sets cannot use the - // same application gateway. - ApplicationGatewayBackendAddressPools []*SubResource - - // Specifies an array of references to application security group. - ApplicationSecurityGroups []*SubResource - - // Specifies an array of references to backend address pools of load balancers. A scale set can reference backend address - // pools of one public and one internal load balancer. Multiple scale sets cannot - // use the same basic sku load balancer. - LoadBalancerBackendAddressPools []*SubResource - - // Specifies an array of references to inbound Nat pools of the load balancers. A scale set can reference inbound nat pools - // of one public and one internal load balancer. Multiple scale sets cannot use - // the same basic sku load balancer. - LoadBalancerInboundNatPools []*SubResource - - // Specifies the primary network interface in case the virtual machine has more than 1 network interface. - Primary *bool - - // Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default - // is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. - PrivateIPAddressVersion *IPVersion - - // The publicIPAddressConfiguration. - PublicIPAddressConfiguration *VirtualMachineScaleSetPublicIPAddressConfiguration - - // Specifies the identifier of the subnet. - Subnet *APIEntityReference -} - -// VirtualMachineScaleSetIPTag - Contains the IP tag associated with the public IP address. -type VirtualMachineScaleSetIPTag struct { - // IP tag type. Example: FirstPartyUsage. - IPTagType *string - - // IP tag associated with the public IP. Example: SQL, Storage etc. - Tag *string -} - -// VirtualMachineScaleSetIdentity - Identity for the virtual machine scale set. -type VirtualMachineScaleSetIdentity struct { - // The type of identity used for the virtual machine scale set. The type 'SystemAssigned, UserAssigned' includes both an implicitly - // created identity and a set of user assigned identities. The type 'None' - // will remove any identities from the virtual machine scale set. - Type *ResourceIdentityType - - // The list of user identities associated with the virtual machine scale set. The user identity dictionary key references - // will be ARM resource ids in the form: - // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - UserAssignedIdentities map[string]*UserAssignedIdentitiesValue - - // READ-ONLY; The principal id of virtual machine scale set identity. This property will only be provided for a system assigned - // identity. - PrincipalID *string - - // READ-ONLY; The tenant id associated with the virtual machine scale set. This property will only be provided for a system - // assigned identity. - TenantID *string -} - -// VirtualMachineScaleSetInstanceView - The instance view of a virtual machine scale set. -type VirtualMachineScaleSetInstanceView struct { - // The resource status information. - Statuses []*InstanceViewStatus - - // READ-ONLY; The extensions information. - Extensions []*VirtualMachineScaleSetVMExtensionsSummary - - // READ-ONLY; The orchestration services information. - OrchestrationServices []*OrchestrationServiceSummary - - // READ-ONLY; The instance view status summary for the virtual machine scale set. - VirtualMachine *VirtualMachineScaleSetInstanceViewStatusesSummary -} - -// VirtualMachineScaleSetInstanceViewStatusesSummary - Instance view statuses summary for virtual machines of a virtual machine -// scale set. -type VirtualMachineScaleSetInstanceViewStatusesSummary struct { - // READ-ONLY; The extensions information. - StatusesSummary []*VirtualMachineStatusCodeCount -} - -// VirtualMachineScaleSetListOSUpgradeHistory - List of Virtual Machine Scale Set OS Upgrade History operation response. -type VirtualMachineScaleSetListOSUpgradeHistory struct { - // REQUIRED; The list of OS upgrades performed on the virtual machine scale set. - Value []*UpgradeOperationHistoricalStatusInfo - - // The uri to fetch the next page of OS Upgrade History. Call ListNext() with this to fetch the next page of history of upgrades. - NextLink *string -} - -// VirtualMachineScaleSetListResult - The List Virtual Machine operation response. -type VirtualMachineScaleSetListResult struct { - // REQUIRED; The list of virtual machine scale sets. - Value []*VirtualMachineScaleSet - - // The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with this to fetch the next page of VMSS. - NextLink *string -} - -// VirtualMachineScaleSetListSKUsResult - The Virtual Machine Scale Set List Skus operation response. -type VirtualMachineScaleSetListSKUsResult struct { - // REQUIRED; The list of skus available for the virtual machine scale set. - Value []*VirtualMachineScaleSetSKU - - // The uri to fetch the next page of Virtual Machine Scale Set Skus. Call ListNext() with this to fetch the next page of VMSS - // Skus. - NextLink *string -} - -// VirtualMachineScaleSetListWithLinkResult - The List Virtual Machine operation response. -type VirtualMachineScaleSetListWithLinkResult struct { - // REQUIRED; The list of virtual machine scale sets. - Value []*VirtualMachineScaleSet - - // The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with this to fetch the next page of Virtual - // Machine Scale Sets. - NextLink *string -} - -// VirtualMachineScaleSetManagedDiskParameters - Describes the parameters of a ScaleSet managed disk. -type VirtualMachineScaleSetManagedDiskParameters struct { - // Specifies the customer managed disk encryption set resource id for the managed disk. - DiskEncryptionSet *DiskEncryptionSetParameters - - // Specifies the security profile for the managed disk. - SecurityProfile *VMDiskSecurityProfile - - // Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot - // be used with OS Disk. - StorageAccountType *StorageAccountTypes -} - -// VirtualMachineScaleSetNetworkConfiguration - Describes a virtual machine scale set network profile's network configurations. -type VirtualMachineScaleSetNetworkConfiguration struct { - // REQUIRED; The network configuration name. - Name *string - - // Describes a virtual machine scale set network profile's IP configuration. - Properties *VirtualMachineScaleSetNetworkConfigurationProperties -} - -// VirtualMachineScaleSetNetworkConfigurationDNSSettings - Describes a virtual machines scale sets network configuration's -// DNS settings. -type VirtualMachineScaleSetNetworkConfigurationDNSSettings struct { - // List of DNS servers IP addresses - DNSServers []*string -} - -// VirtualMachineScaleSetNetworkConfigurationProperties - Describes a virtual machine scale set network profile's IP configuration. -type VirtualMachineScaleSetNetworkConfigurationProperties struct { - // REQUIRED; Specifies the IP configurations of the network interface. - IPConfigurations []*VirtualMachineScaleSetIPConfiguration - - // Specifies whether the Auxiliary mode is enabled for the Network Interface resource. - AuxiliaryMode *NetworkInterfaceAuxiliaryMode - - // Specifies whether the Auxiliary sku is enabled for the Network Interface resource. - AuxiliarySKU *NetworkInterfaceAuxiliarySKU - - // The dns settings to be applied on the network interfaces. - DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings - - // Specify what happens to the network interface when the VM is deleted - DeleteOption *DeleteOptions - - // Specifies whether the network interface is disabled for tcp state tracking. - DisableTCPStateTracking *bool - - // Specifies whether the network interface is accelerated networking-enabled. - EnableAcceleratedNetworking *bool - - // Specifies whether the network interface is FPGA networking-enabled. - EnableFpga *bool - - // Whether IP forwarding enabled on this NIC. - EnableIPForwarding *bool - - // The network security group. - NetworkSecurityGroup *SubResource - - // Specifies the primary network interface in case the virtual machine has more than 1 network interface. - Primary *bool -} - -// VirtualMachineScaleSetNetworkProfile - Describes a virtual machine scale set network profile. -type VirtualMachineScaleSetNetworkProfile struct { - // A reference to a load balancer probe used to determine the health of an instance in the virtual machine scale set. The - // reference will be in the form: - // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. - HealthProbe *APIEntityReference - - // specifies the Microsoft.Network API version used when creating networking resources in the Network Interface Configurations - // for Virtual Machine Scale Set with orchestration mode 'Flexible' - NetworkAPIVersion *NetworkAPIVersion - - // The list of network configurations. - NetworkInterfaceConfigurations []*VirtualMachineScaleSetNetworkConfiguration -} - -// VirtualMachineScaleSetOSDisk - Describes a virtual machine scale set operating system disk. -type VirtualMachineScaleSetOSDisk struct { - // REQUIRED; Specifies how the virtual machines in the scale set should be created. The only allowed value is: FromImage. - // This value is used when you are using an image to create the virtual machine. If you are - // using a platform image, you also use the imageReference element described above. If you are using a marketplace image, - // you also use the plan element previously described. - CreateOption *DiskCreateOptionTypes - - // Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The default values are: None for Standard - // storage. ReadOnly for Premium storage. - Caching *CachingTypes - - // Specifies whether OS Disk should be deleted or detached upon VMSS Flex deletion (This feature is available for VMSS with - // Flexible OrchestrationMode only). - // Possible values: - // Delete If this value is used, the OS disk is deleted when VMSS Flex VM is deleted. - // Detach If this value is used, the OS disk is retained after VMSS Flex VM is deleted. - // The default value is set to Delete. For an Ephemeral OS Disk, the default value is set to Delete. User cannot change the - // delete option for Ephemeral OS Disk. - DeleteOption *DiskDeleteOptionTypes - - // Specifies the ephemeral disk Settings for the operating system disk used by the virtual machine scale set. - DiffDiskSettings *DiffDiskSettings - - // Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a - // virtual machine image. The property 'diskSizeGB' is the number of bytes x 1024^3 - // for the disk and the value cannot be larger than 1023. - DiskSizeGB *int32 - - // Specifies information about the unmanaged user image to base the scale set on. - Image *VirtualHardDisk - - // The managed disk parameters. - ManagedDisk *VirtualMachineScaleSetManagedDiskParameters - - // The disk name. - Name *string - - // This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or - // a specialized VHD. Possible values are: Windows, Linux. - OSType *OperatingSystemTypes - - // Specifies the container urls that are used to store operating system disks for the scale set. - VhdContainers []*string - - // Specifies whether writeAccelerator should be enabled or disabled on the disk. - WriteAcceleratorEnabled *bool -} - -// VirtualMachineScaleSetOSProfile - Describes a virtual machine scale set OS profile. -type VirtualMachineScaleSetOSProfile struct { - // Specifies the password of the administrator account. - // Minimum-length (Windows): 8 characters - // Minimum-length (Linux): 6 characters - // Max-length (Windows): 123 characters - // Max-length (Linux): 72 characters - // Complexity requirements: 3 out of 4 conditions below need to be fulfilled - // Has lower characters - // Has upper characters - // Has a digit - // Has a special character (Regex match [\W_]) - // Disallowed values: "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", - // "Password22", "iloveyou!" - // For resetting the password, see How to reset the Remote Desktop service or its login password in a Windows VM [https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp] - // For resetting root password, see Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension - // [https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection] - AdminPassword *string - - // Specifies the name of the administrator account. - // Windows-only restriction: Cannot end in "." - // Disallowed values: "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", - // "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", - // "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". - // Minimum-length (Linux): 1 character - // Max-length (Linux): 64 characters - // Max-length (Windows): 20 characters - AdminUsername *string - - // Specifies whether extension operations should be allowed on the virtual machine scale set. This may only be set to False - // when no extensions are present on the virtual machine scale set. - AllowExtensionOperations *bool - - // Specifies the computer name prefix for all of the virtual machines in the scale set. Computer name prefixes must be 1 to - // 15 characters long. - ComputerNamePrefix *string - - // Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved - // as a file on the Virtual Machine. The maximum length of the binary array is - // 65535 bytes. For using cloud-init for your VM, see Using cloud-init to customize a Linux VM during creation [https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init] - CustomData *string - - // Specifies the Linux operating system settings on the virtual machine. For a list of supported Linux distributions, see - // Linux on Azure-Endorsed Distributions - // [https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros]. - LinuxConfiguration *LinuxConfiguration - - // Optional property which must either be set to True or omitted. - RequireGuestProvisionSignal *bool - - // Specifies set of certificates that should be installed onto the virtual machines in the scale set. To install certificates - // on a virtual machine it is recommended to use the Azure Key Vault virtual - // machine extension for Linux [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux] or the Azure - // Key Vault virtual machine extension for Windows - // [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows]. - Secrets []*VaultSecretGroup - - // Specifies Windows operating system settings on the virtual machine. - WindowsConfiguration *WindowsConfiguration -} - -// VirtualMachineScaleSetProperties - Describes the properties of a Virtual Machine Scale Set. -type VirtualMachineScaleSetProperties struct { - // Specifies additional capabilities enabled or disabled on the Virtual Machines in the Virtual Machine Scale Set. For instance: - // whether the Virtual Machines have the capability to support attaching - // managed data disks with UltraSSD_LRS storage account type. - AdditionalCapabilities *AdditionalCapabilities - - // Policy for automatic repairs. - AutomaticRepairsPolicy *AutomaticRepairsPolicy - - // Optional property which must either be set to True or omitted. - ConstrainedMaximumCapacity *bool - - // When Overprovision is enabled, extensions are launched only on the requested number of VMs which are finally kept. This - // property will hence ensure that the extensions do not run on the extra - // overprovisioned VMs. - DoNotRunExtensionsOnOverprovisionedVMs *bool - - // Specifies information about the dedicated host group that the virtual machine scale set resides in. Minimum api-version: - // 2020-06-01. - HostGroup *SubResource - - // Specifies the orchestration mode for the virtual machine scale set. - OrchestrationMode *OrchestrationMode - - // Specifies whether the Virtual Machine Scale Set should be overprovisioned. - Overprovision *bool - - // Fault Domain count for each placement group. - PlatformFaultDomainCount *int32 - - // Specifies the desired targets for mixing Spot and Regular priority VMs within the same VMSS Flex instance. - PriorityMixPolicy *PriorityMixPolicy - - // Specifies information about the proximity placement group that the virtual machine scale set should be assigned to. Minimum - // api-version: 2018-04-01. - ProximityPlacementGroup *SubResource - - // Policy for Resiliency - ResiliencyPolicy *ResiliencyPolicy - - // Specifies the policies applied when scaling in Virtual Machines in the Virtual Machine Scale Set. - ScaleInPolicy *ScaleInPolicy - - // The ScheduledEventsPolicy. - ScheduledEventsPolicy *ScheduledEventsPolicy - - // When true this limits the scale set to a single placement group, of max size 100 virtual machines. NOTE: If singlePlacementGroup - // is true, it may be modified to false. However, if singlePlacementGroup - // is false, it may not be modified to true. - SinglePlacementGroup *bool - - // Specifies the Spot Restore properties for the virtual machine scale set. - SpotRestorePolicy *SpotRestorePolicy - - // The upgrade policy. - UpgradePolicy *UpgradePolicy - - // The virtual machine profile. - VirtualMachineProfile *VirtualMachineScaleSetVMProfile - - // Whether to force strictly even Virtual Machine distribution cross x-zones in case there is zone outage. zoneBalance property - // can only be set if the zones property of the scale set contains more than - // one zone. If there are no zones or only one zone specified, then zoneBalance property should not be set. - ZoneBalance *bool - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string - - // READ-ONLY; Specifies the time at which the Virtual Machine Scale Set resource was created. Minimum api-version: 2021-11-01. - TimeCreated *time.Time - - // READ-ONLY; Specifies the ID which uniquely identifies a Virtual Machine Scale Set. - UniqueID *string -} - -// VirtualMachineScaleSetPublicIPAddressConfiguration - Describes a virtual machines scale set IP Configuration's PublicIPAddress -// configuration -type VirtualMachineScaleSetPublicIPAddressConfiguration struct { - // REQUIRED; The publicIP address configuration name. - Name *string - - // Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration - Properties *VirtualMachineScaleSetPublicIPAddressConfigurationProperties - - // Describes the public IP Sku. It can only be set with OrchestrationMode as Flexible. - SKU *PublicIPAddressSKU -} - -// VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings - Describes a virtual machines scale sets network configuration's -// DNS settings. -type VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings struct { - // REQUIRED; The Domain name label.The concatenation of the domain name label and vm index will be the domain name labels - // of the PublicIPAddress resources that will be created - DomainNameLabel *string - - // The Domain name label scope.The concatenation of the hashed domain name label that generated according to the policy from - // domain name label scope and vm index will be the domain name labels of the - // PublicIPAddress resources that will be created - DomainNameLabelScope *DomainNameLabelScopeTypes -} - -// VirtualMachineScaleSetPublicIPAddressConfigurationProperties - Describes a virtual machines scale set IP Configuration's -// PublicIPAddress configuration -type VirtualMachineScaleSetPublicIPAddressConfigurationProperties struct { - // The dns settings to be applied on the publicIP addresses . - DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings - - // Specify what happens to the public IP when the VM is deleted - DeleteOption *DeleteOptions - - // The list of IP tags associated with the public IP address. - IPTags []*VirtualMachineScaleSetIPTag - - // The idle timeout of the public IP address. - IdleTimeoutInMinutes *int32 - - // Available from Api-Version 2019-07-01 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default - // is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. - PublicIPAddressVersion *IPVersion - - // The PublicIPPrefix from which to allocate publicIP addresses. - PublicIPPrefix *SubResource -} - -// VirtualMachineScaleSetReimageParameters - Describes a Virtual Machine Scale Set VM Reimage Parameters. -type VirtualMachineScaleSetReimageParameters struct { - // Specifies in decimal number, the version the OS disk should be reimaged to. If exact version is not provided, the OS disk - // is reimaged to the existing version of OS Disk. - ExactVersion *string - - // Parameter to force update ephemeral OS disk for a virtual machine scale set VM - ForceUpdateOSDiskForEphemeral *bool - - // The virtual machine scale set instance ids. Omitting the virtual machine scale set instance ids will result in the operation - // being performed on all virtual machines in the virtual machine scale set. - InstanceIDs []*string - - // Specifies information required for reimaging the non-ephemeral OS disk. - OSProfile *OSProfileProvisioningData - - // Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage parameter is only supported - // for VM/VMSS with Ephemeral OS disk. - TempDisk *bool -} - -// VirtualMachineScaleSetSKU - Describes an available virtual machine scale set sku. -type VirtualMachineScaleSetSKU struct { - // READ-ONLY; Specifies the number of virtual machines in the scale set. - Capacity *VirtualMachineScaleSetSKUCapacity - - // READ-ONLY; The type of resource the sku applies to. - ResourceType *string - - // READ-ONLY; The Sku. - SKU *SKU -} - -// VirtualMachineScaleSetSKUCapacity - Describes scaling information of a sku. -type VirtualMachineScaleSetSKUCapacity struct { - // READ-ONLY; The default capacity. - DefaultCapacity *int64 - - // READ-ONLY; The maximum capacity that can be set. - Maximum *int64 - - // READ-ONLY; The minimum capacity. - Minimum *int64 - - // READ-ONLY; The scale type applicable to the sku. - ScaleType *VirtualMachineScaleSetSKUScaleType -} - -// VirtualMachineScaleSetStorageProfile - Describes a virtual machine scale set storage profile. -type VirtualMachineScaleSetStorageProfile struct { - // Specifies the parameters that are used to add data disks to the virtual machines in the scale set. For more information - // about disks, see About disks and VHDs for Azure virtual machines - // [https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview]. - DataDisks []*VirtualMachineScaleSetDataDisk - DiskControllerType *string - - // Specifies information about the image to use. You can specify information about platform images, marketplace images, or - // virtual machine images. This element is required when you want to use a platform - // image, marketplace image, or virtual machine image, but is not used in other creation operations. - ImageReference *ImageReference - - // Specifies information about the operating system disk used by the virtual machines in the scale set. For more information - // about disks, see About disks and VHDs for Azure virtual machines - // [https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview]. - OSDisk *VirtualMachineScaleSetOSDisk -} - -// VirtualMachineScaleSetUpdate - Describes a Virtual Machine Scale Set. -type VirtualMachineScaleSetUpdate struct { - // The identity of the virtual machine scale set, if configured. - Identity *VirtualMachineScaleSetIdentity - - // The purchase plan when deploying a virtual machine scale set from VM Marketplace images. - Plan *Plan - - // Describes the properties of a Virtual Machine Scale Set. - Properties *VirtualMachineScaleSetUpdateProperties - - // The virtual machine scale set sku. - SKU *SKU - - // Resource tags - Tags map[string]*string -} - -// VirtualMachineScaleSetUpdateIPConfiguration - Describes a virtual machine scale set network profile's IP configuration. -// NOTE: The subnet of a scale set may be modified as long as the original subnet and the new subnet are in the same virtual -// network -type VirtualMachineScaleSetUpdateIPConfiguration struct { - // The IP configuration name. - Name *string - - // Describes a virtual machine scale set network profile's IP configuration properties. - Properties *VirtualMachineScaleSetUpdateIPConfigurationProperties -} - -// VirtualMachineScaleSetUpdateIPConfigurationProperties - Describes a virtual machine scale set network profile's IP configuration -// properties. -type VirtualMachineScaleSetUpdateIPConfigurationProperties struct { - // The application gateway backend address pools. - ApplicationGatewayBackendAddressPools []*SubResource - - // Specifies an array of references to application security group. - ApplicationSecurityGroups []*SubResource - - // The load balancer backend address pools. - LoadBalancerBackendAddressPools []*SubResource - - // The load balancer inbound nat pools. - LoadBalancerInboundNatPools []*SubResource - - // Specifies the primary IP Configuration in case the network interface has more than one IP Configuration. - Primary *bool - - // Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default - // is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. - PrivateIPAddressVersion *IPVersion - - // The publicIPAddressConfiguration. - PublicIPAddressConfiguration *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration - - // The subnet. - Subnet *APIEntityReference -} - -// VirtualMachineScaleSetUpdateNetworkConfiguration - Describes a virtual machine scale set network profile's network configurations. -type VirtualMachineScaleSetUpdateNetworkConfiguration struct { - // The network configuration name. - Name *string - - // Describes a virtual machine scale set updatable network profile's IP configuration.Use this object for updating network - // profile's IP Configuration. - Properties *VirtualMachineScaleSetUpdateNetworkConfigurationProperties -} - -// VirtualMachineScaleSetUpdateNetworkConfigurationProperties - Describes a virtual machine scale set updatable network profile's -// IP configuration.Use this object for updating network profile's IP Configuration. -type VirtualMachineScaleSetUpdateNetworkConfigurationProperties struct { - // Specifies whether the Auxiliary mode is enabled for the Network Interface resource. - AuxiliaryMode *NetworkInterfaceAuxiliaryMode - - // Specifies whether the Auxiliary sku is enabled for the Network Interface resource. - AuxiliarySKU *NetworkInterfaceAuxiliarySKU - - // The dns settings to be applied on the network interfaces. - DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings - - // Specify what happens to the network interface when the VM is deleted - DeleteOption *DeleteOptions - - // Specifies whether the network interface is disabled for tcp state tracking. - DisableTCPStateTracking *bool - - // Specifies whether the network interface is accelerated networking-enabled. - EnableAcceleratedNetworking *bool - - // Specifies whether the network interface is FPGA networking-enabled. - EnableFpga *bool - - // Whether IP forwarding enabled on this NIC. - EnableIPForwarding *bool - - // The virtual machine scale set IP Configuration. - IPConfigurations []*VirtualMachineScaleSetUpdateIPConfiguration - - // The network security group. - NetworkSecurityGroup *SubResource - - // Whether this is a primary NIC on a virtual machine. - Primary *bool -} - -// VirtualMachineScaleSetUpdateNetworkProfile - Describes a virtual machine scale set network profile. -type VirtualMachineScaleSetUpdateNetworkProfile struct { - // A reference to a load balancer probe used to determine the health of an instance in the virtual machine scale set. The - // reference will be in the form: - // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. - HealthProbe *APIEntityReference - - // specifies the Microsoft.Network API version used when creating networking resources in the Network Interface Configurations - // for Virtual Machine Scale Set with orchestration mode 'Flexible' - NetworkAPIVersion *NetworkAPIVersion - - // The list of network configurations. - NetworkInterfaceConfigurations []*VirtualMachineScaleSetUpdateNetworkConfiguration -} - -// VirtualMachineScaleSetUpdateOSDisk - Describes virtual machine scale set operating system disk Update Object. This should -// be used for Updating VMSS OS Disk. -type VirtualMachineScaleSetUpdateOSDisk struct { - // The caching type. - Caching *CachingTypes - - // Specifies whether OS Disk should be deleted or detached upon VMSS Flex deletion (This feature is available for VMSS with - // Flexible OrchestrationMode only). - // Possible values: - // Delete If this value is used, the OS disk is deleted when VMSS Flex VM is deleted. - // Detach If this value is used, the OS disk is retained after VMSS Flex VM is deleted. - // The default value is set to Delete. For an Ephemeral OS Disk, the default value is set to Delete. User cannot change the - // delete option for Ephemeral OS Disk. - DeleteOption *DiskDeleteOptionTypes - - // Specifies the ephemeral disk Settings for the operating system disk used by the virtual machine scale set. - DiffDiskSettings *DiffDiskSettings - - // Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a - // virtual machine image. - // diskSizeGB is the number of bytes x 1024^3 for the disk and the value cannot be larger than 1023 - DiskSizeGB *int32 - - // The Source User Image VirtualHardDisk. This VirtualHardDisk will be copied before using it to attach to the Virtual Machine. - // If SourceImage is provided, the destination VirtualHardDisk should not - // exist. - Image *VirtualHardDisk - - // The managed disk parameters. - ManagedDisk *VirtualMachineScaleSetManagedDiskParameters - - // The list of virtual hard disk container uris. - VhdContainers []*string - - // Specifies whether writeAccelerator should be enabled or disabled on the disk. - WriteAcceleratorEnabled *bool -} - -// VirtualMachineScaleSetUpdateOSProfile - Describes a virtual machine scale set OS profile. -type VirtualMachineScaleSetUpdateOSProfile struct { - // A base-64 encoded string of custom data. - CustomData *string - - // The Linux Configuration of the OS profile. - LinuxConfiguration *LinuxConfiguration - - // The List of certificates for addition to the VM. - Secrets []*VaultSecretGroup - - // The Windows Configuration of the OS profile. - WindowsConfiguration *WindowsConfiguration -} - -// VirtualMachineScaleSetUpdateProperties - Describes the properties of a Virtual Machine Scale Set. -type VirtualMachineScaleSetUpdateProperties struct { - // Specifies additional capabilities enabled or disabled on the Virtual Machines in the Virtual Machine Scale Set. For instance: - // whether the Virtual Machines have the capability to support attaching - // managed data disks with UltraSSD_LRS storage account type. - AdditionalCapabilities *AdditionalCapabilities - - // Policy for automatic repairs. - AutomaticRepairsPolicy *AutomaticRepairsPolicy - - // When Overprovision is enabled, extensions are launched only on the requested number of VMs which are finally kept. This - // property will hence ensure that the extensions do not run on the extra - // overprovisioned VMs. - DoNotRunExtensionsOnOverprovisionedVMs *bool - - // Specifies whether the Virtual Machine Scale Set should be overprovisioned. - Overprovision *bool - - // Specifies the desired targets for mixing Spot and Regular priority VMs within the same VMSS Flex instance. - PriorityMixPolicy *PriorityMixPolicy - - // Specifies information about the proximity placement group that the virtual machine scale set should be assigned to. - // Minimum api-version: 2018-04-01. - ProximityPlacementGroup *SubResource - - // Policy for Resiliency - ResiliencyPolicy *ResiliencyPolicy - - // Specifies the policies applied when scaling in Virtual Machines in the Virtual Machine Scale Set. - ScaleInPolicy *ScaleInPolicy - - // When true this limits the scale set to a single placement group, of max size 100 virtual machines. NOTE: If singlePlacementGroup - // is true, it may be modified to false. However, if singlePlacementGroup - // is false, it may not be modified to true. - SinglePlacementGroup *bool - - // Specifies the Spot Restore properties for the virtual machine scale set. - SpotRestorePolicy *SpotRestorePolicy - - // The upgrade policy. - UpgradePolicy *UpgradePolicy - - // The virtual machine profile. - VirtualMachineProfile *VirtualMachineScaleSetUpdateVMProfile -} - -// VirtualMachineScaleSetUpdatePublicIPAddressConfiguration - Describes a virtual machines scale set IP Configuration's PublicIPAddress -// configuration -type VirtualMachineScaleSetUpdatePublicIPAddressConfiguration struct { - // The publicIP address configuration name. - Name *string - - // Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration - Properties *VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties -} - -// VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties - Describes a virtual machines scale set IP Configuration's -// PublicIPAddress configuration -type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties struct { - // The dns settings to be applied on the publicIP addresses . - DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings - - // Specify what happens to the public IP when the VM is deleted - DeleteOption *DeleteOptions - - // The idle timeout of the public IP address. - IdleTimeoutInMinutes *int32 - - // The PublicIPPrefix from which to allocate publicIP addresses. - PublicIPPrefix *SubResource -} - -// VirtualMachineScaleSetUpdateStorageProfile - Describes a virtual machine scale set storage profile. -type VirtualMachineScaleSetUpdateStorageProfile struct { - // The data disks. - DataDisks []*VirtualMachineScaleSetDataDisk - DiskControllerType *string - - // The image reference. - ImageReference *ImageReference - - // The OS disk. - OSDisk *VirtualMachineScaleSetUpdateOSDisk -} - -// VirtualMachineScaleSetUpdateVMProfile - Describes a virtual machine scale set virtual machine profile. -type VirtualMachineScaleSetUpdateVMProfile struct { - // Specifies the billing related details of a Azure Spot VMSS. Minimum api-version: 2019-03-01. - BillingProfile *BillingProfile - - // The virtual machine scale set diagnostics profile. - DiagnosticsProfile *DiagnosticsProfile - - // The virtual machine scale set extension profile. - ExtensionProfile *VirtualMachineScaleSetExtensionProfile - - // Specifies the hardware profile related details of a scale set. Minimum api-version: 2021-11-01. - HardwareProfile *VirtualMachineScaleSetHardwareProfile - - // The license type, which is for bring your own license scenario. - LicenseType *string - - // The virtual machine scale set network profile. - NetworkProfile *VirtualMachineScaleSetUpdateNetworkProfile - - // The virtual machine scale set OS profile. - OSProfile *VirtualMachineScaleSetUpdateOSProfile - - // Specifies Scheduled Event related configurations. - ScheduledEventsProfile *ScheduledEventsProfile - - // The virtual machine scale set Security profile - SecurityProfile *SecurityProfile - - // The virtual machine scale set storage profile. - StorageProfile *VirtualMachineScaleSetUpdateStorageProfile - - // UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. - // Minimum api-version: 2021-03-01 - UserData *string -} - -// VirtualMachineScaleSetVM - Describes a virtual machine scale set virtual machine. -type VirtualMachineScaleSetVM struct { - // REQUIRED; Resource location - Location *string - - // The identity of the virtual machine, if configured. - Identity *VirtualMachineIdentity - - // Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace - // images. Before you can use a marketplace image from an API, you must - // enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click - // Want to deploy programmatically, Get Started ->. Enter any required - // information and then click Save. - Plan *Plan - - // Describes the properties of a virtual machine scale set virtual machine. - Properties *VirtualMachineScaleSetVMProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Etag is property returned in Update/Get response of the VMSS VM, so that customer can supply it in the header - // to ensure optimistic updates. - Etag *string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; The virtual machine instance ID. - InstanceID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; The virtual machine child extension resources. - Resources []*VirtualMachineExtension - - // READ-ONLY; The virtual machine SKU. - SKU *SKU - - // READ-ONLY; Resource type - Type *string - - // READ-ONLY; The virtual machine zones. - Zones []*string -} - -// VirtualMachineScaleSetVMExtension - Describes a VMSS VM Extension. -type VirtualMachineScaleSetVMExtension struct { - // The location of the extension. - Location *string - - // Describes the properties of a Virtual Machine Extension. - Properties *VirtualMachineExtensionProperties - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; The name of the extension. - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// VirtualMachineScaleSetVMExtensionUpdate - Describes a VMSS VM Extension. -type VirtualMachineScaleSetVMExtensionUpdate struct { - // Describes the properties of a Virtual Machine Extension. - Properties *VirtualMachineExtensionUpdateProperties - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; The name of the extension. - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// VirtualMachineScaleSetVMExtensionsListResult - The List VMSS VM Extension operation response -type VirtualMachineScaleSetVMExtensionsListResult struct { - // The list of VMSS VM extensions - Value []*VirtualMachineScaleSetVMExtension -} - -// VirtualMachineScaleSetVMExtensionsSummary - Extensions summary for virtual machines of a virtual machine scale set. -type VirtualMachineScaleSetVMExtensionsSummary struct { - // READ-ONLY; The extension name. - Name *string - - // READ-ONLY; The extensions information. - StatusesSummary []*VirtualMachineStatusCodeCount -} - -// VirtualMachineScaleSetVMInstanceIDs - Specifies a list of virtual machine instance IDs from the VM scale set. -type VirtualMachineScaleSetVMInstanceIDs struct { - // The virtual machine scale set instance ids. Omitting the virtual machine scale set instance ids will result in the operation - // being performed on all virtual machines in the virtual machine scale set. - InstanceIDs []*string -} - -// VirtualMachineScaleSetVMInstanceRequiredIDs - Specifies a list of virtual machine instance IDs from the VM scale set. -type VirtualMachineScaleSetVMInstanceRequiredIDs struct { - // REQUIRED; The virtual machine scale set instance ids. - InstanceIDs []*string -} - -// VirtualMachineScaleSetVMInstanceView - The instance view of a virtual machine scale set VM. -type VirtualMachineScaleSetVMInstanceView struct { - // Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status. You - // can easily view the output of your console log. Azure also enables you to see - // a screenshot of the VM from the hypervisor. - BootDiagnostics *BootDiagnosticsInstanceView - - // Specifies the host OS name of the virtual machine. - // This name cannot be updated after the VM is created. - // Max-length (Windows): 15 characters - // Max-length (Linux): 64 characters. - // For naming conventions and restrictions see Azure infrastructure services implementation guidelines - // [https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions]. - ComputerName *string - - // The disks information. - Disks []*DiskInstanceView - - // The extensions information. - Extensions []*VirtualMachineExtensionInstanceView - - // The hypervisor generation of the Virtual Machine [V1, V2] - HyperVGeneration *HyperVGeneration - - // The Maintenance Operation status on the virtual machine. - MaintenanceRedeployStatus *MaintenanceRedeployStatus - - // The Operating System running on the hybrid machine. - OSName *string - - // The version of Operating System running on the hybrid machine. - OSVersion *string - - // The placement group in which the VM is running. If the VM is deallocated it will not have a placementGroupId. - PlacementGroupID *string - - // The Fault Domain count. - PlatformFaultDomain *int32 - - // The Update Domain count. - PlatformUpdateDomain *int32 - - // The Remote desktop certificate thumbprint. - RdpThumbPrint *string - - // The resource status information. - Statuses []*InstanceViewStatus - - // The VM Agent running on the virtual machine. - VMAgent *VirtualMachineAgentInstanceView - - // READ-ONLY; Resource id of the dedicated host, on which the virtual machine is allocated through automatic placement, when - // the virtual machine is associated with a dedicated host group that has automatic - // placement enabled. Minimum api-version: 2020-06-01. - AssignedHost *string - - // READ-ONLY; The health status for the VM. - VMHealth *VirtualMachineHealthStatus -} - -// VirtualMachineScaleSetVMListResult - The List Virtual Machine Scale Set VMs operation response. -type VirtualMachineScaleSetVMListResult struct { - // REQUIRED; The list of virtual machine scale sets VMs. - Value []*VirtualMachineScaleSetVM - - // The uri to fetch the next page of Virtual Machine Scale Set VMs. Call ListNext() with this to fetch the next page of VMSS - // VMs - NextLink *string -} - -// VirtualMachineScaleSetVMNetworkProfileConfiguration - Describes a virtual machine scale set VM network profile. -type VirtualMachineScaleSetVMNetworkProfileConfiguration struct { - // The list of network configurations. - NetworkInterfaceConfigurations []*VirtualMachineScaleSetNetworkConfiguration -} - -// VirtualMachineScaleSetVMProfile - Describes a virtual machine scale set virtual machine profile. -type VirtualMachineScaleSetVMProfile struct { - // Specifies the gallery applications that should be made available to the VM/VMSS - ApplicationProfile *ApplicationProfile - - // Specifies the billing related details of a Azure Spot VMSS. Minimum api-version: 2019-03-01. - BillingProfile *BillingProfile - - // Specifies the capacity reservation related details of a scale set. Minimum api-version: 2021-04-01. - CapacityReservation *CapacityReservationProfile - - // Specifies the boot diagnostic settings state. Minimum api-version: 2015-06-15. - DiagnosticsProfile *DiagnosticsProfile - - // Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set. For Azure Spot virtual machines, - // both 'Deallocate' and 'Delete' are supported and the minimum api-version is - // 2019-03-01. For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. - EvictionPolicy *VirtualMachineEvictionPolicyTypes - - // Specifies a collection of settings for extensions installed on virtual machines in the scale set. - ExtensionProfile *VirtualMachineScaleSetExtensionProfile - - // Specifies the hardware profile related details of a scale set. Minimum api-version: 2021-11-01. - HardwareProfile *VirtualMachineScaleSetHardwareProfile - - // Specifies that the image or disk that is being used was licensed on-premises. - // Possible values for Windows Server operating system are: - // WindowsClient - // WindowsServer - // Possible values for Linux Server operating system are: - // RHELBYOS (for RHEL) - // SLESBYOS (for SUSE) - // For more information, see Azure Hybrid Use Benefit for Windows Server [https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing] - // Azure Hybrid Use Benefit for Linux Server [https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux] - // Minimum api-version: 2015-06-15 - LicenseType *string - - // Specifies properties of the network interfaces of the virtual machines in the scale set. - NetworkProfile *VirtualMachineScaleSetNetworkProfile - - // Specifies the operating system settings for the virtual machines in the scale set. - OSProfile *VirtualMachineScaleSetOSProfile - - // Specifies the priority for the virtual machines in the scale set. Minimum api-version: 2017-10-30-preview. - Priority *VirtualMachinePriorityTypes - - // Specifies Scheduled Event related configurations. - ScheduledEventsProfile *ScheduledEventsProfile - - // Specifies the security posture to be used for all virtual machines in the scale set. Minimum api-version: 2023-03-01 - SecurityPostureReference *SecurityPostureReference - - // Specifies the Security related profile settings for the virtual machines in the scale set. - SecurityProfile *SecurityProfile - - // Specifies the service artifact reference id used to set same image version for all virtual machines in the scale set when - // using 'latest' image version. Minimum api-version: 2022-11-01 - ServiceArtifactReference *ServiceArtifactReference - - // Specifies the storage settings for the virtual machine disks. - StorageProfile *VirtualMachineScaleSetStorageProfile - - // UserData for the virtual machines in the scale set, which must be base-64 encoded. Customer should not pass any secrets - // in here. Minimum api-version: 2021-03-01. - UserData *string - - // READ-ONLY; Specifies the time in which this VM profile for the Virtual Machine Scale Set was created. Minimum API version - // for this property is 2024-03-01. This value will be added to VMSS Flex VM tags when - // creating/updating the VMSS VM Profile with minimum api-version 2024-03-01. - TimeCreated *time.Time -} - -// VirtualMachineScaleSetVMProperties - Describes the properties of a virtual machine scale set virtual machine. -type VirtualMachineScaleSetVMProperties struct { - // Specifies additional capabilities enabled or disabled on the virtual machine in the scale set. For instance: whether the - // virtual machine has the capability to support attaching managed data disks with - // UltraSSD_LRS storage account type. - AdditionalCapabilities *AdditionalCapabilities - - // Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified - // in the same availability set are allocated to different nodes to maximize - // availability. For more information about availability sets, see Availability sets overview [https://docs.microsoft.com/azure/virtual-machines/availability-set-overview]. - // For more information on Azure - // planned maintenance, see Maintenance and updates for Virtual Machines in Azure [https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates]. - // Currently, a VM can only be added to - // availability set at creation time. An existing VM cannot be added to an availability set. - AvailabilitySet *SubResource - - // Specifies the boot diagnostic settings state. Minimum api-version: 2015-06-15. - DiagnosticsProfile *DiagnosticsProfile - - // Specifies the hardware settings for the virtual machine. - HardwareProfile *HardwareProfile - - // Specifies that the image or disk that is being used was licensed on-premises. - // Possible values for Windows Server operating system are: - // WindowsClient - // WindowsServer - // Possible values for Linux Server operating system are: - // RHELBYOS (for RHEL) - // SLESBYOS (for SUSE) - // For more information, see Azure Hybrid Use Benefit for Windows Server [https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing] - // Azure Hybrid Use Benefit for Linux Server [https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux] - // Minimum api-version: 2015-06-15 - LicenseType *string - - // Specifies the network interfaces of the virtual machine. - NetworkProfile *NetworkProfile - - // Specifies the network profile configuration of the virtual machine. - NetworkProfileConfiguration *VirtualMachineScaleSetVMNetworkProfileConfiguration - - // Specifies the operating system settings for the virtual machine. - OSProfile *OSProfile - - // Specifies the protection policy of the virtual machine. - ProtectionPolicy *VirtualMachineScaleSetVMProtectionPolicy - - // Specifies the Security related profile settings for the virtual machine. - SecurityProfile *SecurityProfile - - // Specifies the storage settings for the virtual machine disks. - StorageProfile *StorageProfile - - // UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. - // Minimum api-version: 2021-03-01 - UserData *string - - // READ-ONLY; The virtual machine instance view. - InstanceView *VirtualMachineScaleSetVMInstanceView - - // READ-ONLY; Specifies whether the latest model has been applied to the virtual machine. - LatestModelApplied *bool - - // READ-ONLY; Specifies whether the model applied to the virtual machine is the model of the virtual machine scale set or - // the customized model for the virtual machine. - ModelDefinitionApplied *string - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string - - // READ-ONLY; Specifies the time at which the Virtual Machine resource was created. - // Minimum api-version: 2021-11-01. - TimeCreated *time.Time - - // READ-ONLY; Azure VM unique ID. - VMID *string -} - -// VirtualMachineScaleSetVMProtectionPolicy - The protection policy of a virtual machine scale set VM. -type VirtualMachineScaleSetVMProtectionPolicy struct { - // Indicates that the virtual machine scale set VM shouldn't be considered for deletion during a scale-in operation. - ProtectFromScaleIn *bool - - // Indicates that model updates or actions (including scale-in) initiated on the virtual machine scale set should not be applied - // to the virtual machine scale set VM. - ProtectFromScaleSetActions *bool -} - -// VirtualMachineScaleSetVMReimageParameters - Describes a Virtual Machine Scale Set VM Reimage Parameters. -type VirtualMachineScaleSetVMReimageParameters struct { - // Specifies in decimal number, the version the OS disk should be reimaged to. If exact version is not provided, the OS disk - // is reimaged to the existing version of OS Disk. - ExactVersion *string - - // Parameter to force update ephemeral OS disk for a virtual machine scale set VM - ForceUpdateOSDiskForEphemeral *bool - - // Specifies information required for reimaging the non-ephemeral OS disk. - OSProfile *OSProfileProvisioningData - - // Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage parameter is only supported - // for VM/VMSS with Ephemeral OS disk. - TempDisk *bool -} - -// VirtualMachineSize - Describes the properties of a VM size. -type VirtualMachineSize struct { - // The maximum number of data disks that can be attached to the virtual machine size. - MaxDataDiskCount *int32 - - // The amount of memory, in MB, supported by the virtual machine size. - MemoryInMB *int32 - - // The name of the virtual machine size. - Name *string - - // The number of cores supported by the virtual machine size. For Constrained vCPU capable VM sizes, this number represents - // the total vCPUs of quota that the VM uses. For accurate vCPU count, please - // refer to https://docs.microsoft.com/azure/virtual-machines/constrained-vcpu or https://docs.microsoft.com/rest/api/compute/resourceskus/list - NumberOfCores *int32 - - // The OS disk size, in MB, allowed by the virtual machine size. - OSDiskSizeInMB *int32 - - // The resource disk size, in MB, allowed by the virtual machine size. - ResourceDiskSizeInMB *int32 -} - -// VirtualMachineSizeListResult - The List Virtual Machine operation response. -type VirtualMachineSizeListResult struct { - // The list of virtual machine sizes. - Value []*VirtualMachineSize -} - -// VirtualMachineSoftwarePatchProperties - Describes the properties of a Virtual Machine software patch. -type VirtualMachineSoftwarePatchProperties struct { - // READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension - // logs. - ActivityID *string - - // READ-ONLY; Describes the availability of a given patch. - AssessmentState *PatchAssessmentState - - // READ-ONLY; The classification(s) of the patch as provided by the patch publisher. - Classifications []*string - - // READ-ONLY; The KBID of the patch. Only applies to Windows patches. - KbID *string - - // READ-ONLY; The UTC timestamp of the last update to this patch record. - LastModifiedDateTime *time.Time - - // READ-ONLY; The friendly name of the patch. - Name *string - - // READ-ONLY; A unique identifier for the patch. - PatchID *string - - // READ-ONLY; The UTC timestamp when the repository published this patch. - PublishedDate *time.Time - - // READ-ONLY; Describes the reboot requirements of the patch. - RebootBehavior *VMGuestPatchRebootBehavior - - // READ-ONLY; The version number of the patch. This property applies only to Linux patches. - Version *string -} - -// VirtualMachineStatusCodeCount - The status code and count of the virtual machine scale set instance view status summary. -type VirtualMachineStatusCodeCount struct { - // READ-ONLY; The instance view status code. - Code *string - - // READ-ONLY; The number of instances having a particular status code. - Count *int32 -} - -// VirtualMachineUpdate - Describes a Virtual Machine Update. -type VirtualMachineUpdate struct { - // The identity of the virtual machine, if configured. - Identity *VirtualMachineIdentity - - // Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace - // images. Before you can use a marketplace image from an API, you must - // enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click - // Want to deploy programmatically, Get Started ->. Enter any required - // information and then click Save. - Plan *Plan - - // Describes the properties of a Virtual Machine. - Properties *VirtualMachineProperties - - // Resource tags - Tags map[string]*string - - // The virtual machine zones. - Zones []*string -} - -// WinRMConfiguration - Describes Windows Remote Management configuration of the VM -type WinRMConfiguration struct { - // The list of Windows Remote Management listeners - Listeners []*WinRMListener -} - -// WinRMListener - Describes Protocol and thumbprint of Windows Remote Management listener -type WinRMListener struct { - // This is the URL of a certificate that has been uploaded to Key Vault as a secret. For adding a secret to the Key Vault, - // see Add a key or secret to the key vault - // [https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add]. In this case, your certificate needs to be the - // Base64 encoding of the following JSON Object which is encoded in UTF-8: - // { - // "data":"", - // "dataType":"pfx", - // "password":"" - // } - // To install certificates on a virtual machine it is recommended to use the Azure Key Vault virtual machine extension for - // Linux - // [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux] or the Azure Key Vault virtual machine extension - // for Windows - // [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows]. - CertificateURL *string - - // Specifies the protocol of WinRM listener. Possible values are: http, https. - Protocol *ProtocolTypes -} - -// WindowsConfiguration - Specifies Windows operating system settings on the virtual machine. -type WindowsConfiguration struct { - // Specifies additional base-64 encoded XML formatted information that can be included in the Unattend.xml file, which is - // used by Windows Setup. - AdditionalUnattendContent []*AdditionalUnattendContent - - // Indicates whether Automatic Updates is enabled for the Windows virtual machine. Default value is true. For virtual machine - // scale sets, this property can be updated and updates will take effect on OS - // reprovisioning. - EnableAutomaticUpdates *bool - - // Indicates whether VMAgent Platform Updates is enabled for the Windows virtual machine. Default value is false. - EnableVMAgentPlatformUpdates *bool - - // [Preview Feature] Specifies settings related to VM Guest Patching on Windows. - PatchSettings *PatchSettings - - // Indicates whether virtual machine agent should be provisioned on the virtual machine. When this property is not specified - // in the request body, it is set to true by default. This will ensure that VM - // Agent is installed on the VM so that extensions can be added to the VM later. - ProvisionVMAgent *bool - - // Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time". Possible values can be TimeZoneInfo.Id - // [https://docs.microsoft.com/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id] value from time zones returned by - // TimeZoneInfo.GetSystemTimeZones - // [https://docs.microsoft.com/dotnet/api/system.timezoneinfo.getsystemtimezones]. - TimeZone *string - - // Specifies the Windows Remote Management listeners. This enables remote Windows PowerShell. - WinRM *WinRMConfiguration -} - -// WindowsParameters - Input for InstallPatches on a Windows VM, as directly received by the API -type WindowsParameters struct { - // The update classifications to select when installing patches for Windows. - ClassificationsToInclude []*VMGuestPatchClassificationWindows - - // Filters out Kbs that don't have an InstallationRebootBehavior of 'NeverReboots' when this is set to true. - ExcludeKbsRequiringReboot *bool - - // Kbs to exclude in the patch operation - KbNumbersToExclude []*string - - // Kbs to include in the patch operation - KbNumbersToInclude []*string - - // This is used to install patches that were published on or before this given max published date. - MaxPatchPublishDate *time.Time -} - -// WindowsVMGuestPatchAutomaticByPlatformSettings - Specifies additional settings to be applied when patch mode AutomaticByPlatform -// is selected in Windows patch settings. -type WindowsVMGuestPatchAutomaticByPlatformSettings struct { - // Enables customer to schedule patching without accidental upgrades - BypassPlatformSafetyChecksOnUserSchedule *bool - - // Specifies the reboot setting for all AutomaticByPlatform patch installation operations. - RebootSetting *WindowsVMGuestPatchAutomaticByPlatformRebootSetting -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/models_serde.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/models_serde.go deleted file mode 100644 index 1bdfcb44226..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/models_serde.go +++ /dev/null @@ -1,19966 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" -) - -// MarshalJSON implements the json.Marshaller interface for type APIEntityReference. -func (a APIEntityReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", a.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type APIEntityReference. -func (a *APIEntityReference) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type APIError. -func (a APIError) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "code", a.Code) - populate(objectMap, "details", a.Details) - populate(objectMap, "innererror", a.Innererror) - populate(objectMap, "message", a.Message) - populate(objectMap, "target", a.Target) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type APIError. -func (a *APIError) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "code": - err = unpopulate(val, "Code", &a.Code) - delete(rawMsg, key) - case "details": - err = unpopulate(val, "Details", &a.Details) - delete(rawMsg, key) - case "innererror": - err = unpopulate(val, "Innererror", &a.Innererror) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &a.Message) - delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &a.Target) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type APIErrorBase. -func (a APIErrorBase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "code", a.Code) - populate(objectMap, "message", a.Message) - populate(objectMap, "target", a.Target) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type APIErrorBase. -func (a *APIErrorBase) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "code": - err = unpopulate(val, "Code", &a.Code) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &a.Message) - delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &a.Target) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AccessURI. -func (a AccessURI) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "accessSAS", a.AccessSAS) - populate(objectMap, "securityDataAccessSAS", a.SecurityDataAccessSAS) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AccessURI. -func (a *AccessURI) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "accessSAS": - err = unpopulate(val, "AccessSAS", &a.AccessSAS) - delete(rawMsg, key) - case "securityDataAccessSAS": - err = unpopulate(val, "SecurityDataAccessSAS", &a.SecurityDataAccessSAS) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AdditionalCapabilities. -func (a AdditionalCapabilities) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "hibernationEnabled", a.HibernationEnabled) - populate(objectMap, "ultraSSDEnabled", a.UltraSSDEnabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AdditionalCapabilities. -func (a *AdditionalCapabilities) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "hibernationEnabled": - err = unpopulate(val, "HibernationEnabled", &a.HibernationEnabled) - delete(rawMsg, key) - case "ultraSSDEnabled": - err = unpopulate(val, "UltraSSDEnabled", &a.UltraSSDEnabled) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AdditionalUnattendContent. -func (a AdditionalUnattendContent) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - objectMap["componentName"] = "Microsoft-Windows-Shell-Setup" - populate(objectMap, "content", a.Content) - objectMap["passName"] = "OobeSystem" - populate(objectMap, "settingName", a.SettingName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AdditionalUnattendContent. -func (a *AdditionalUnattendContent) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "componentName": - err = unpopulate(val, "ComponentName", &a.ComponentName) - delete(rawMsg, key) - case "content": - err = unpopulate(val, "Content", &a.Content) - delete(rawMsg, key) - case "passName": - err = unpopulate(val, "PassName", &a.PassName) - delete(rawMsg, key) - case "settingName": - err = unpopulate(val, "SettingName", &a.SettingName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AlternativeOption. -func (a AlternativeOption) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "type", a.Type) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AlternativeOption. -func (a *AlternativeOption) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &a.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationProfile. -func (a ApplicationProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "galleryApplications", a.GalleryApplications) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationProfile. -func (a *ApplicationProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "galleryApplications": - err = unpopulate(val, "GalleryApplications", &a.GalleryApplications) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AttachDetachDataDisksRequest. -func (a AttachDetachDataDisksRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "dataDisksToAttach", a.DataDisksToAttach) - populate(objectMap, "dataDisksToDetach", a.DataDisksToDetach) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AttachDetachDataDisksRequest. -func (a *AttachDetachDataDisksRequest) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dataDisksToAttach": - err = unpopulate(val, "DataDisksToAttach", &a.DataDisksToAttach) - delete(rawMsg, key) - case "dataDisksToDetach": - err = unpopulate(val, "DataDisksToDetach", &a.DataDisksToDetach) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AutomaticOSUpgradePolicy. -func (a AutomaticOSUpgradePolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "disableAutomaticRollback", a.DisableAutomaticRollback) - populate(objectMap, "enableAutomaticOSUpgrade", a.EnableAutomaticOSUpgrade) - populate(objectMap, "osRollingUpgradeDeferral", a.OSRollingUpgradeDeferral) - populate(objectMap, "useRollingUpgradePolicy", a.UseRollingUpgradePolicy) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AutomaticOSUpgradePolicy. -func (a *AutomaticOSUpgradePolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "disableAutomaticRollback": - err = unpopulate(val, "DisableAutomaticRollback", &a.DisableAutomaticRollback) - delete(rawMsg, key) - case "enableAutomaticOSUpgrade": - err = unpopulate(val, "EnableAutomaticOSUpgrade", &a.EnableAutomaticOSUpgrade) - delete(rawMsg, key) - case "osRollingUpgradeDeferral": - err = unpopulate(val, "OSRollingUpgradeDeferral", &a.OSRollingUpgradeDeferral) - delete(rawMsg, key) - case "useRollingUpgradePolicy": - err = unpopulate(val, "UseRollingUpgradePolicy", &a.UseRollingUpgradePolicy) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AutomaticOSUpgradeProperties. -func (a AutomaticOSUpgradeProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "automaticOSUpgradeSupported", a.AutomaticOSUpgradeSupported) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AutomaticOSUpgradeProperties. -func (a *AutomaticOSUpgradeProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "automaticOSUpgradeSupported": - err = unpopulate(val, "AutomaticOSUpgradeSupported", &a.AutomaticOSUpgradeSupported) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AutomaticRepairsPolicy. -func (a AutomaticRepairsPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "enabled", a.Enabled) - populate(objectMap, "gracePeriod", a.GracePeriod) - populate(objectMap, "repairAction", a.RepairAction) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AutomaticRepairsPolicy. -func (a *AutomaticRepairsPolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enabled": - err = unpopulate(val, "Enabled", &a.Enabled) - delete(rawMsg, key) - case "gracePeriod": - err = unpopulate(val, "GracePeriod", &a.GracePeriod) - delete(rawMsg, key) - case "repairAction": - err = unpopulate(val, "RepairAction", &a.RepairAction) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AvailabilitySet. -func (a AvailabilitySet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", a.ID) - populate(objectMap, "location", a.Location) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "sku", a.SKU) - populate(objectMap, "tags", a.Tags) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AvailabilitySet. -func (a *AvailabilitySet) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &a.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &a.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &a.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AvailabilitySetListResult. -func (a AvailabilitySetListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", a.NextLink) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AvailabilitySetListResult. -func (a *AvailabilitySetListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &a.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &a.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AvailabilitySetProperties. -func (a AvailabilitySetProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "platformFaultDomainCount", a.PlatformFaultDomainCount) - populate(objectMap, "platformUpdateDomainCount", a.PlatformUpdateDomainCount) - populate(objectMap, "proximityPlacementGroup", a.ProximityPlacementGroup) - populate(objectMap, "statuses", a.Statuses) - populate(objectMap, "virtualMachines", a.VirtualMachines) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AvailabilitySetProperties. -func (a *AvailabilitySetProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "platformFaultDomainCount": - err = unpopulate(val, "PlatformFaultDomainCount", &a.PlatformFaultDomainCount) - delete(rawMsg, key) - case "platformUpdateDomainCount": - err = unpopulate(val, "PlatformUpdateDomainCount", &a.PlatformUpdateDomainCount) - delete(rawMsg, key) - case "proximityPlacementGroup": - err = unpopulate(val, "ProximityPlacementGroup", &a.ProximityPlacementGroup) - delete(rawMsg, key) - case "statuses": - err = unpopulate(val, "Statuses", &a.Statuses) - delete(rawMsg, key) - case "virtualMachines": - err = unpopulate(val, "VirtualMachines", &a.VirtualMachines) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AvailabilitySetUpdate. -func (a AvailabilitySetUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "sku", a.SKU) - populate(objectMap, "tags", a.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AvailabilitySetUpdate. -func (a *AvailabilitySetUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &a.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &a.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AvailablePatchSummary. -func (a AvailablePatchSummary) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "assessmentActivityId", a.AssessmentActivityID) - populate(objectMap, "criticalAndSecurityPatchCount", a.CriticalAndSecurityPatchCount) - populate(objectMap, "error", a.Error) - populateDateTimeRFC3339(objectMap, "lastModifiedTime", a.LastModifiedTime) - populate(objectMap, "otherPatchCount", a.OtherPatchCount) - populate(objectMap, "rebootPending", a.RebootPending) - populateDateTimeRFC3339(objectMap, "startTime", a.StartTime) - populate(objectMap, "status", a.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AvailablePatchSummary. -func (a *AvailablePatchSummary) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "assessmentActivityId": - err = unpopulate(val, "AssessmentActivityID", &a.AssessmentActivityID) - delete(rawMsg, key) - case "criticalAndSecurityPatchCount": - err = unpopulate(val, "CriticalAndSecurityPatchCount", &a.CriticalAndSecurityPatchCount) - delete(rawMsg, key) - case "error": - err = unpopulate(val, "Error", &a.Error) - delete(rawMsg, key) - case "lastModifiedTime": - err = unpopulateDateTimeRFC3339(val, "LastModifiedTime", &a.LastModifiedTime) - delete(rawMsg, key) - case "otherPatchCount": - err = unpopulate(val, "OtherPatchCount", &a.OtherPatchCount) - delete(rawMsg, key) - case "rebootPending": - err = unpopulate(val, "RebootPending", &a.RebootPending) - delete(rawMsg, key) - case "startTime": - err = unpopulateDateTimeRFC3339(val, "StartTime", &a.StartTime) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &a.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BillingProfile. -func (b BillingProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "maxPrice", b.MaxPrice) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BillingProfile. -func (b *BillingProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "maxPrice": - err = unpopulate(val, "MaxPrice", &b.MaxPrice) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BootDiagnostics. -func (b BootDiagnostics) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "enabled", b.Enabled) - populate(objectMap, "storageUri", b.StorageURI) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BootDiagnostics. -func (b *BootDiagnostics) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enabled": - err = unpopulate(val, "Enabled", &b.Enabled) - delete(rawMsg, key) - case "storageUri": - err = unpopulate(val, "StorageURI", &b.StorageURI) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BootDiagnosticsInstanceView. -func (b BootDiagnosticsInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "consoleScreenshotBlobUri", b.ConsoleScreenshotBlobURI) - populate(objectMap, "serialConsoleLogBlobUri", b.SerialConsoleLogBlobURI) - populate(objectMap, "status", b.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BootDiagnosticsInstanceView. -func (b *BootDiagnosticsInstanceView) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "consoleScreenshotBlobUri": - err = unpopulate(val, "ConsoleScreenshotBlobURI", &b.ConsoleScreenshotBlobURI) - delete(rawMsg, key) - case "serialConsoleLogBlobUri": - err = unpopulate(val, "SerialConsoleLogBlobURI", &b.SerialConsoleLogBlobURI) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &b.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CapacityReservation. -func (c CapacityReservation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "sku", c.SKU) - populate(objectMap, "tags", c.Tags) - populate(objectMap, "type", c.Type) - populate(objectMap, "zones", c.Zones) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservation. -func (c *CapacityReservation) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &c.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &c.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &c.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &c.Zones) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CapacityReservationGroup. -func (c CapacityReservationGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "tags", c.Tags) - populate(objectMap, "type", c.Type) - populate(objectMap, "zones", c.Zones) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationGroup. -func (c *CapacityReservationGroup) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &c.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &c.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &c.Zones) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CapacityReservationGroupInstanceView. -func (c CapacityReservationGroupInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "capacityReservations", c.CapacityReservations) - populate(objectMap, "sharedSubscriptionIds", c.SharedSubscriptionIDs) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationGroupInstanceView. -func (c *CapacityReservationGroupInstanceView) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "capacityReservations": - err = unpopulate(val, "CapacityReservations", &c.CapacityReservations) - delete(rawMsg, key) - case "sharedSubscriptionIds": - err = unpopulate(val, "SharedSubscriptionIDs", &c.SharedSubscriptionIDs) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CapacityReservationGroupListResult. -func (c CapacityReservationGroupListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationGroupListResult. -func (c *CapacityReservationGroupListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CapacityReservationGroupProperties. -func (c CapacityReservationGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "capacityReservations", c.CapacityReservations) - populate(objectMap, "instanceView", c.InstanceView) - populate(objectMap, "sharingProfile", c.SharingProfile) - populate(objectMap, "virtualMachinesAssociated", c.VirtualMachinesAssociated) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationGroupProperties. -func (c *CapacityReservationGroupProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "capacityReservations": - err = unpopulate(val, "CapacityReservations", &c.CapacityReservations) - delete(rawMsg, key) - case "instanceView": - err = unpopulate(val, "InstanceView", &c.InstanceView) - delete(rawMsg, key) - case "sharingProfile": - err = unpopulate(val, "SharingProfile", &c.SharingProfile) - delete(rawMsg, key) - case "virtualMachinesAssociated": - err = unpopulate(val, "VirtualMachinesAssociated", &c.VirtualMachinesAssociated) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CapacityReservationGroupUpdate. -func (c CapacityReservationGroupUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "tags", c.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationGroupUpdate. -func (c *CapacityReservationGroupUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &c.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CapacityReservationInstanceView. -func (c CapacityReservationInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "statuses", c.Statuses) - populate(objectMap, "utilizationInfo", c.UtilizationInfo) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationInstanceView. -func (c *CapacityReservationInstanceView) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "statuses": - err = unpopulate(val, "Statuses", &c.Statuses) - delete(rawMsg, key) - case "utilizationInfo": - err = unpopulate(val, "UtilizationInfo", &c.UtilizationInfo) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CapacityReservationInstanceViewWithName. -func (c CapacityReservationInstanceViewWithName) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", c.Name) - populate(objectMap, "statuses", c.Statuses) - populate(objectMap, "utilizationInfo", c.UtilizationInfo) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationInstanceViewWithName. -func (c *CapacityReservationInstanceViewWithName) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "statuses": - err = unpopulate(val, "Statuses", &c.Statuses) - delete(rawMsg, key) - case "utilizationInfo": - err = unpopulate(val, "UtilizationInfo", &c.UtilizationInfo) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CapacityReservationListResult. -func (c CapacityReservationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationListResult. -func (c *CapacityReservationListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CapacityReservationProfile. -func (c CapacityReservationProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "capacityReservationGroup", c.CapacityReservationGroup) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationProfile. -func (c *CapacityReservationProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "capacityReservationGroup": - err = unpopulate(val, "CapacityReservationGroup", &c.CapacityReservationGroup) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CapacityReservationProperties. -func (c CapacityReservationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "instanceView", c.InstanceView) - populate(objectMap, "platformFaultDomainCount", c.PlatformFaultDomainCount) - populate(objectMap, "provisioningState", c.ProvisioningState) - populateDateTimeRFC3339(objectMap, "provisioningTime", c.ProvisioningTime) - populate(objectMap, "reservationId", c.ReservationID) - populateDateTimeRFC3339(objectMap, "timeCreated", c.TimeCreated) - populate(objectMap, "virtualMachinesAssociated", c.VirtualMachinesAssociated) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationProperties. -func (c *CapacityReservationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "instanceView": - err = unpopulate(val, "InstanceView", &c.InstanceView) - delete(rawMsg, key) - case "platformFaultDomainCount": - err = unpopulate(val, "PlatformFaultDomainCount", &c.PlatformFaultDomainCount) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) - delete(rawMsg, key) - case "provisioningTime": - err = unpopulateDateTimeRFC3339(val, "ProvisioningTime", &c.ProvisioningTime) - delete(rawMsg, key) - case "reservationId": - err = unpopulate(val, "ReservationID", &c.ReservationID) - delete(rawMsg, key) - case "timeCreated": - err = unpopulateDateTimeRFC3339(val, "TimeCreated", &c.TimeCreated) - delete(rawMsg, key) - case "virtualMachinesAssociated": - err = unpopulate(val, "VirtualMachinesAssociated", &c.VirtualMachinesAssociated) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CapacityReservationUpdate. -func (c CapacityReservationUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "sku", c.SKU) - populate(objectMap, "tags", c.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationUpdate. -func (c *CapacityReservationUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &c.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &c.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CapacityReservationUtilization. -func (c CapacityReservationUtilization) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "currentCapacity", c.CurrentCapacity) - populate(objectMap, "virtualMachinesAllocated", c.VirtualMachinesAllocated) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationUtilization. -func (c *CapacityReservationUtilization) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "currentCapacity": - err = unpopulate(val, "CurrentCapacity", &c.CurrentCapacity) - delete(rawMsg, key) - case "virtualMachinesAllocated": - err = unpopulate(val, "VirtualMachinesAllocated", &c.VirtualMachinesAllocated) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CloudService. -func (c CloudService) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "tags", c.Tags) - populate(objectMap, "type", c.Type) - populate(objectMap, "zones", c.Zones) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudService. -func (c *CloudService) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &c.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &c.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &c.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &c.Zones) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceExtensionProfile. -func (c CloudServiceExtensionProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "extensions", c.Extensions) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceExtensionProfile. -func (c *CloudServiceExtensionProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "extensions": - err = unpopulate(val, "Extensions", &c.Extensions) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceExtensionProperties. -func (c CloudServiceExtensionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "autoUpgradeMinorVersion", c.AutoUpgradeMinorVersion) - populate(objectMap, "forceUpdateTag", c.ForceUpdateTag) - populateAny(objectMap, "protectedSettings", c.ProtectedSettings) - populate(objectMap, "protectedSettingsFromKeyVault", c.ProtectedSettingsFromKeyVault) - populate(objectMap, "provisioningState", c.ProvisioningState) - populate(objectMap, "publisher", c.Publisher) - populate(objectMap, "rolesAppliedTo", c.RolesAppliedTo) - populateAny(objectMap, "settings", c.Settings) - populate(objectMap, "type", c.Type) - populate(objectMap, "typeHandlerVersion", c.TypeHandlerVersion) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceExtensionProperties. -func (c *CloudServiceExtensionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "autoUpgradeMinorVersion": - err = unpopulate(val, "AutoUpgradeMinorVersion", &c.AutoUpgradeMinorVersion) - delete(rawMsg, key) - case "forceUpdateTag": - err = unpopulate(val, "ForceUpdateTag", &c.ForceUpdateTag) - delete(rawMsg, key) - case "protectedSettings": - err = unpopulate(val, "ProtectedSettings", &c.ProtectedSettings) - delete(rawMsg, key) - case "protectedSettingsFromKeyVault": - err = unpopulate(val, "ProtectedSettingsFromKeyVault", &c.ProtectedSettingsFromKeyVault) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) - delete(rawMsg, key) - case "publisher": - err = unpopulate(val, "Publisher", &c.Publisher) - delete(rawMsg, key) - case "rolesAppliedTo": - err = unpopulate(val, "RolesAppliedTo", &c.RolesAppliedTo) - delete(rawMsg, key) - case "settings": - err = unpopulate(val, "Settings", &c.Settings) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - delete(rawMsg, key) - case "typeHandlerVersion": - err = unpopulate(val, "TypeHandlerVersion", &c.TypeHandlerVersion) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceInstanceView. -func (c CloudServiceInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "privateIds", c.PrivateIDs) - populate(objectMap, "roleInstance", c.RoleInstance) - populate(objectMap, "sdkVersion", c.SdkVersion) - populate(objectMap, "statuses", c.Statuses) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceInstanceView. -func (c *CloudServiceInstanceView) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "privateIds": - err = unpopulate(val, "PrivateIDs", &c.PrivateIDs) - delete(rawMsg, key) - case "roleInstance": - err = unpopulate(val, "RoleInstance", &c.RoleInstance) - delete(rawMsg, key) - case "sdkVersion": - err = unpopulate(val, "SdkVersion", &c.SdkVersion) - delete(rawMsg, key) - case "statuses": - err = unpopulate(val, "Statuses", &c.Statuses) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceListResult. -func (c CloudServiceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceListResult. -func (c *CloudServiceListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceNetworkProfile. -func (c CloudServiceNetworkProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "loadBalancerConfigurations", c.LoadBalancerConfigurations) - populate(objectMap, "slotType", c.SlotType) - populate(objectMap, "swappableCloudService", c.SwappableCloudService) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceNetworkProfile. -func (c *CloudServiceNetworkProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "loadBalancerConfigurations": - err = unpopulate(val, "LoadBalancerConfigurations", &c.LoadBalancerConfigurations) - delete(rawMsg, key) - case "slotType": - err = unpopulate(val, "SlotType", &c.SlotType) - delete(rawMsg, key) - case "swappableCloudService": - err = unpopulate(val, "SwappableCloudService", &c.SwappableCloudService) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceOsProfile. -func (c CloudServiceOsProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "secrets", c.Secrets) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceOsProfile. -func (c *CloudServiceOsProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "secrets": - err = unpopulate(val, "Secrets", &c.Secrets) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceProperties. -func (c CloudServiceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "allowModelOverride", c.AllowModelOverride) - populate(objectMap, "configuration", c.Configuration) - populate(objectMap, "configurationUrl", c.ConfigurationURL) - populate(objectMap, "extensionProfile", c.ExtensionProfile) - populate(objectMap, "networkProfile", c.NetworkProfile) - populate(objectMap, "osProfile", c.OSProfile) - populate(objectMap, "packageUrl", c.PackageURL) - populate(objectMap, "provisioningState", c.ProvisioningState) - populate(objectMap, "roleProfile", c.RoleProfile) - populate(objectMap, "startCloudService", c.StartCloudService) - populate(objectMap, "uniqueId", c.UniqueID) - populate(objectMap, "upgradeMode", c.UpgradeMode) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceProperties. -func (c *CloudServiceProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "allowModelOverride": - err = unpopulate(val, "AllowModelOverride", &c.AllowModelOverride) - delete(rawMsg, key) - case "configuration": - err = unpopulate(val, "Configuration", &c.Configuration) - delete(rawMsg, key) - case "configurationUrl": - err = unpopulate(val, "ConfigurationURL", &c.ConfigurationURL) - delete(rawMsg, key) - case "extensionProfile": - err = unpopulate(val, "ExtensionProfile", &c.ExtensionProfile) - delete(rawMsg, key) - case "networkProfile": - err = unpopulate(val, "NetworkProfile", &c.NetworkProfile) - delete(rawMsg, key) - case "osProfile": - err = unpopulate(val, "OSProfile", &c.OSProfile) - delete(rawMsg, key) - case "packageUrl": - err = unpopulate(val, "PackageURL", &c.PackageURL) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) - delete(rawMsg, key) - case "roleProfile": - err = unpopulate(val, "RoleProfile", &c.RoleProfile) - delete(rawMsg, key) - case "startCloudService": - err = unpopulate(val, "StartCloudService", &c.StartCloudService) - delete(rawMsg, key) - case "uniqueId": - err = unpopulate(val, "UniqueID", &c.UniqueID) - delete(rawMsg, key) - case "upgradeMode": - err = unpopulate(val, "UpgradeMode", &c.UpgradeMode) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceRole. -func (c CloudServiceRole) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "sku", c.SKU) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceRole. -func (c *CloudServiceRole) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &c.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &c.SKU) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceRoleListResult. -func (c CloudServiceRoleListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceRoleListResult. -func (c *CloudServiceRoleListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceRoleProfile. -func (c CloudServiceRoleProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "roles", c.Roles) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceRoleProfile. -func (c *CloudServiceRoleProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "roles": - err = unpopulate(val, "Roles", &c.Roles) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceRoleProfileProperties. -func (c CloudServiceRoleProfileProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", c.Name) - populate(objectMap, "sku", c.SKU) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceRoleProfileProperties. -func (c *CloudServiceRoleProfileProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &c.SKU) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceRoleProperties. -func (c CloudServiceRoleProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "uniqueId", c.UniqueID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceRoleProperties. -func (c *CloudServiceRoleProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "uniqueId": - err = unpopulate(val, "UniqueID", &c.UniqueID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceRoleSKU. -func (c CloudServiceRoleSKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "capacity", c.Capacity) - populate(objectMap, "name", c.Name) - populate(objectMap, "tier", c.Tier) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceRoleSKU. -func (c *CloudServiceRoleSKU) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "capacity": - err = unpopulate(val, "Capacity", &c.Capacity) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &c.Tier) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceUpdate. -func (c CloudServiceUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "tags", c.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceUpdate. -func (c *CloudServiceUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "tags": - err = unpopulate(val, "Tags", &c.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceVaultAndSecretReference. -func (c CloudServiceVaultAndSecretReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "secretUrl", c.SecretURL) - populate(objectMap, "sourceVault", c.SourceVault) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceVaultAndSecretReference. -func (c *CloudServiceVaultAndSecretReference) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "secretUrl": - err = unpopulate(val, "SecretURL", &c.SecretURL) - delete(rawMsg, key) - case "sourceVault": - err = unpopulate(val, "SourceVault", &c.SourceVault) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceVaultCertificate. -func (c CloudServiceVaultCertificate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "certificateUrl", c.CertificateURL) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceVaultCertificate. -func (c *CloudServiceVaultCertificate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "certificateUrl": - err = unpopulate(val, "CertificateURL", &c.CertificateURL) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CloudServiceVaultSecretGroup. -func (c CloudServiceVaultSecretGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "sourceVault", c.SourceVault) - populate(objectMap, "vaultCertificates", c.VaultCertificates) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceVaultSecretGroup. -func (c *CloudServiceVaultSecretGroup) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "sourceVault": - err = unpopulate(val, "SourceVault", &c.SourceVault) - delete(rawMsg, key) - case "vaultCertificates": - err = unpopulate(val, "VaultCertificates", &c.VaultCertificates) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CommunityGallery. -func (c CommunityGallery) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "identifier", c.Identifier) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGallery. -func (c *CommunityGallery) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "identifier": - err = unpopulate(val, "Identifier", &c.Identifier) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &c.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CommunityGalleryIdentifier. -func (c CommunityGalleryIdentifier) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "uniqueId", c.UniqueID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryIdentifier. -func (c *CommunityGalleryIdentifier) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "uniqueId": - err = unpopulate(val, "UniqueID", &c.UniqueID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CommunityGalleryImage. -func (c CommunityGalleryImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "identifier", c.Identifier) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryImage. -func (c *CommunityGalleryImage) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "identifier": - err = unpopulate(val, "Identifier", &c.Identifier) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &c.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CommunityGalleryImageIdentifier. -func (c CommunityGalleryImageIdentifier) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "offer", c.Offer) - populate(objectMap, "publisher", c.Publisher) - populate(objectMap, "sku", c.SKU) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryImageIdentifier. -func (c *CommunityGalleryImageIdentifier) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "offer": - err = unpopulate(val, "Offer", &c.Offer) - delete(rawMsg, key) - case "publisher": - err = unpopulate(val, "Publisher", &c.Publisher) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &c.SKU) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CommunityGalleryImageList. -func (c CommunityGalleryImageList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryImageList. -func (c *CommunityGalleryImageList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CommunityGalleryImageProperties. -func (c CommunityGalleryImageProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "architecture", c.Architecture) - populate(objectMap, "artifactTags", c.ArtifactTags) - populate(objectMap, "disallowed", c.Disallowed) - populate(objectMap, "disclaimer", c.Disclaimer) - populateDateTimeRFC3339(objectMap, "endOfLifeDate", c.EndOfLifeDate) - populate(objectMap, "eula", c.Eula) - populate(objectMap, "features", c.Features) - populate(objectMap, "hyperVGeneration", c.HyperVGeneration) - populate(objectMap, "identifier", c.Identifier) - populate(objectMap, "osState", c.OSState) - populate(objectMap, "osType", c.OSType) - populate(objectMap, "privacyStatementUri", c.PrivacyStatementURI) - populate(objectMap, "purchasePlan", c.PurchasePlan) - populate(objectMap, "recommended", c.Recommended) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryImageProperties. -func (c *CommunityGalleryImageProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "architecture": - err = unpopulate(val, "Architecture", &c.Architecture) - delete(rawMsg, key) - case "artifactTags": - err = unpopulate(val, "ArtifactTags", &c.ArtifactTags) - delete(rawMsg, key) - case "disallowed": - err = unpopulate(val, "Disallowed", &c.Disallowed) - delete(rawMsg, key) - case "disclaimer": - err = unpopulate(val, "Disclaimer", &c.Disclaimer) - delete(rawMsg, key) - case "endOfLifeDate": - err = unpopulateDateTimeRFC3339(val, "EndOfLifeDate", &c.EndOfLifeDate) - delete(rawMsg, key) - case "eula": - err = unpopulate(val, "Eula", &c.Eula) - delete(rawMsg, key) - case "features": - err = unpopulate(val, "Features", &c.Features) - delete(rawMsg, key) - case "hyperVGeneration": - err = unpopulate(val, "HyperVGeneration", &c.HyperVGeneration) - delete(rawMsg, key) - case "identifier": - err = unpopulate(val, "Identifier", &c.Identifier) - delete(rawMsg, key) - case "osState": - err = unpopulate(val, "OSState", &c.OSState) - delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &c.OSType) - delete(rawMsg, key) - case "privacyStatementUri": - err = unpopulate(val, "PrivacyStatementURI", &c.PrivacyStatementURI) - delete(rawMsg, key) - case "purchasePlan": - err = unpopulate(val, "PurchasePlan", &c.PurchasePlan) - delete(rawMsg, key) - case "recommended": - err = unpopulate(val, "Recommended", &c.Recommended) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CommunityGalleryImageVersion. -func (c CommunityGalleryImageVersion) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "identifier", c.Identifier) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryImageVersion. -func (c *CommunityGalleryImageVersion) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "identifier": - err = unpopulate(val, "Identifier", &c.Identifier) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &c.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CommunityGalleryImageVersionList. -func (c CommunityGalleryImageVersionList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryImageVersionList. -func (c *CommunityGalleryImageVersionList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CommunityGalleryImageVersionProperties. -func (c CommunityGalleryImageVersionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "artifactTags", c.ArtifactTags) - populate(objectMap, "disclaimer", c.Disclaimer) - populateDateTimeRFC3339(objectMap, "endOfLifeDate", c.EndOfLifeDate) - populate(objectMap, "excludeFromLatest", c.ExcludeFromLatest) - populateDateTimeRFC3339(objectMap, "publishedDate", c.PublishedDate) - populate(objectMap, "storageProfile", c.StorageProfile) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryImageVersionProperties. -func (c *CommunityGalleryImageVersionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "artifactTags": - err = unpopulate(val, "ArtifactTags", &c.ArtifactTags) - delete(rawMsg, key) - case "disclaimer": - err = unpopulate(val, "Disclaimer", &c.Disclaimer) - delete(rawMsg, key) - case "endOfLifeDate": - err = unpopulateDateTimeRFC3339(val, "EndOfLifeDate", &c.EndOfLifeDate) - delete(rawMsg, key) - case "excludeFromLatest": - err = unpopulate(val, "ExcludeFromLatest", &c.ExcludeFromLatest) - delete(rawMsg, key) - case "publishedDate": - err = unpopulateDateTimeRFC3339(val, "PublishedDate", &c.PublishedDate) - delete(rawMsg, key) - case "storageProfile": - err = unpopulate(val, "StorageProfile", &c.StorageProfile) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CommunityGalleryInfo. -func (c CommunityGalleryInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "communityGalleryEnabled", c.CommunityGalleryEnabled) - populate(objectMap, "eula", c.Eula) - populate(objectMap, "publicNamePrefix", c.PublicNamePrefix) - populate(objectMap, "publicNames", c.PublicNames) - populate(objectMap, "publisherContact", c.PublisherContact) - populate(objectMap, "publisherUri", c.PublisherURI) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryInfo. -func (c *CommunityGalleryInfo) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "communityGalleryEnabled": - err = unpopulate(val, "CommunityGalleryEnabled", &c.CommunityGalleryEnabled) - delete(rawMsg, key) - case "eula": - err = unpopulate(val, "Eula", &c.Eula) - delete(rawMsg, key) - case "publicNamePrefix": - err = unpopulate(val, "PublicNamePrefix", &c.PublicNamePrefix) - delete(rawMsg, key) - case "publicNames": - err = unpopulate(val, "PublicNames", &c.PublicNames) - delete(rawMsg, key) - case "publisherContact": - err = unpopulate(val, "PublisherContact", &c.PublisherContact) - delete(rawMsg, key) - case "publisherUri": - err = unpopulate(val, "PublisherURI", &c.PublisherURI) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CommunityGalleryMetadata. -func (c CommunityGalleryMetadata) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "eula", c.Eula) - populate(objectMap, "privacyStatementUri", c.PrivacyStatementURI) - populate(objectMap, "publicNames", c.PublicNames) - populate(objectMap, "publisherContact", c.PublisherContact) - populate(objectMap, "publisherUri", c.PublisherURI) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryMetadata. -func (c *CommunityGalleryMetadata) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "eula": - err = unpopulate(val, "Eula", &c.Eula) - delete(rawMsg, key) - case "privacyStatementUri": - err = unpopulate(val, "PrivacyStatementURI", &c.PrivacyStatementURI) - delete(rawMsg, key) - case "publicNames": - err = unpopulate(val, "PublicNames", &c.PublicNames) - delete(rawMsg, key) - case "publisherContact": - err = unpopulate(val, "PublisherContact", &c.PublisherContact) - delete(rawMsg, key) - case "publisherUri": - err = unpopulate(val, "PublisherURI", &c.PublisherURI) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CommunityGalleryProperties. -func (c CommunityGalleryProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "artifactTags", c.ArtifactTags) - populate(objectMap, "communityMetadata", c.CommunityMetadata) - populate(objectMap, "disclaimer", c.Disclaimer) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryProperties. -func (c *CommunityGalleryProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "artifactTags": - err = unpopulate(val, "ArtifactTags", &c.ArtifactTags) - delete(rawMsg, key) - case "communityMetadata": - err = unpopulate(val, "CommunityMetadata", &c.CommunityMetadata) - delete(rawMsg, key) - case "disclaimer": - err = unpopulate(val, "Disclaimer", &c.Disclaimer) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CopyCompletionError. -func (c CopyCompletionError) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "errorCode", c.ErrorCode) - populate(objectMap, "errorMessage", c.ErrorMessage) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CopyCompletionError. -func (c *CopyCompletionError) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "errorCode": - err = unpopulate(val, "ErrorCode", &c.ErrorCode) - delete(rawMsg, key) - case "errorMessage": - err = unpopulate(val, "ErrorMessage", &c.ErrorMessage) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CreationData. -func (c CreationData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "createOption", c.CreateOption) - populate(objectMap, "elasticSanResourceId", c.ElasticSanResourceID) - populate(objectMap, "galleryImageReference", c.GalleryImageReference) - populate(objectMap, "imageReference", c.ImageReference) - populate(objectMap, "logicalSectorSize", c.LogicalSectorSize) - populate(objectMap, "performancePlus", c.PerformancePlus) - populate(objectMap, "provisionedBandwidthCopySpeed", c.ProvisionedBandwidthCopySpeed) - populate(objectMap, "securityDataUri", c.SecurityDataURI) - populate(objectMap, "sourceResourceId", c.SourceResourceID) - populate(objectMap, "sourceUri", c.SourceURI) - populate(objectMap, "sourceUniqueId", c.SourceUniqueID) - populate(objectMap, "storageAccountId", c.StorageAccountID) - populate(objectMap, "uploadSizeBytes", c.UploadSizeBytes) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CreationData. -func (c *CreationData) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "createOption": - err = unpopulate(val, "CreateOption", &c.CreateOption) - delete(rawMsg, key) - case "elasticSanResourceId": - err = unpopulate(val, "ElasticSanResourceID", &c.ElasticSanResourceID) - delete(rawMsg, key) - case "galleryImageReference": - err = unpopulate(val, "GalleryImageReference", &c.GalleryImageReference) - delete(rawMsg, key) - case "imageReference": - err = unpopulate(val, "ImageReference", &c.ImageReference) - delete(rawMsg, key) - case "logicalSectorSize": - err = unpopulate(val, "LogicalSectorSize", &c.LogicalSectorSize) - delete(rawMsg, key) - case "performancePlus": - err = unpopulate(val, "PerformancePlus", &c.PerformancePlus) - delete(rawMsg, key) - case "provisionedBandwidthCopySpeed": - err = unpopulate(val, "ProvisionedBandwidthCopySpeed", &c.ProvisionedBandwidthCopySpeed) - delete(rawMsg, key) - case "securityDataUri": - err = unpopulate(val, "SecurityDataURI", &c.SecurityDataURI) - delete(rawMsg, key) - case "sourceResourceId": - err = unpopulate(val, "SourceResourceID", &c.SourceResourceID) - delete(rawMsg, key) - case "sourceUri": - err = unpopulate(val, "SourceURI", &c.SourceURI) - delete(rawMsg, key) - case "sourceUniqueId": - err = unpopulate(val, "SourceUniqueID", &c.SourceUniqueID) - delete(rawMsg, key) - case "storageAccountId": - err = unpopulate(val, "StorageAccountID", &c.StorageAccountID) - delete(rawMsg, key) - case "uploadSizeBytes": - err = unpopulate(val, "UploadSizeBytes", &c.UploadSizeBytes) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DataDisk. -func (d DataDisk) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "caching", d.Caching) - populate(objectMap, "createOption", d.CreateOption) - populate(objectMap, "deleteOption", d.DeleteOption) - populate(objectMap, "detachOption", d.DetachOption) - populate(objectMap, "diskIOPSReadWrite", d.DiskIOPSReadWrite) - populate(objectMap, "diskMBpsReadWrite", d.DiskMBpsReadWrite) - populate(objectMap, "diskSizeGB", d.DiskSizeGB) - populate(objectMap, "image", d.Image) - populate(objectMap, "lun", d.Lun) - populate(objectMap, "managedDisk", d.ManagedDisk) - populate(objectMap, "name", d.Name) - populate(objectMap, "sourceResource", d.SourceResource) - populate(objectMap, "toBeDetached", d.ToBeDetached) - populate(objectMap, "vhd", d.Vhd) - populate(objectMap, "writeAcceleratorEnabled", d.WriteAcceleratorEnabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DataDisk. -func (d *DataDisk) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "caching": - err = unpopulate(val, "Caching", &d.Caching) - delete(rawMsg, key) - case "createOption": - err = unpopulate(val, "CreateOption", &d.CreateOption) - delete(rawMsg, key) - case "deleteOption": - err = unpopulate(val, "DeleteOption", &d.DeleteOption) - delete(rawMsg, key) - case "detachOption": - err = unpopulate(val, "DetachOption", &d.DetachOption) - delete(rawMsg, key) - case "diskIOPSReadWrite": - err = unpopulate(val, "DiskIOPSReadWrite", &d.DiskIOPSReadWrite) - delete(rawMsg, key) - case "diskMBpsReadWrite": - err = unpopulate(val, "DiskMBpsReadWrite", &d.DiskMBpsReadWrite) - delete(rawMsg, key) - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &d.DiskSizeGB) - delete(rawMsg, key) - case "image": - err = unpopulate(val, "Image", &d.Image) - delete(rawMsg, key) - case "lun": - err = unpopulate(val, "Lun", &d.Lun) - delete(rawMsg, key) - case "managedDisk": - err = unpopulate(val, "ManagedDisk", &d.ManagedDisk) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "sourceResource": - err = unpopulate(val, "SourceResource", &d.SourceResource) - delete(rawMsg, key) - case "toBeDetached": - err = unpopulate(val, "ToBeDetached", &d.ToBeDetached) - delete(rawMsg, key) - case "vhd": - err = unpopulate(val, "Vhd", &d.Vhd) - delete(rawMsg, key) - case "writeAcceleratorEnabled": - err = unpopulate(val, "WriteAcceleratorEnabled", &d.WriteAcceleratorEnabled) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DataDiskImage. -func (d DataDiskImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "lun", d.Lun) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DataDiskImage. -func (d *DataDiskImage) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "lun": - err = unpopulate(val, "Lun", &d.Lun) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DataDiskImageEncryption. -func (d DataDiskImageEncryption) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "diskEncryptionSetId", d.DiskEncryptionSetID) - populate(objectMap, "lun", d.Lun) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DataDiskImageEncryption. -func (d *DataDiskImageEncryption) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "diskEncryptionSetId": - err = unpopulate(val, "DiskEncryptionSetID", &d.DiskEncryptionSetID) - delete(rawMsg, key) - case "lun": - err = unpopulate(val, "Lun", &d.Lun) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DataDisksToAttach. -func (d DataDisksToAttach) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "caching", d.Caching) - populate(objectMap, "deleteOption", d.DeleteOption) - populate(objectMap, "diskEncryptionSet", d.DiskEncryptionSet) - populate(objectMap, "diskId", d.DiskID) - populate(objectMap, "lun", d.Lun) - populate(objectMap, "writeAcceleratorEnabled", d.WriteAcceleratorEnabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DataDisksToAttach. -func (d *DataDisksToAttach) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "caching": - err = unpopulate(val, "Caching", &d.Caching) - delete(rawMsg, key) - case "deleteOption": - err = unpopulate(val, "DeleteOption", &d.DeleteOption) - delete(rawMsg, key) - case "diskEncryptionSet": - err = unpopulate(val, "DiskEncryptionSet", &d.DiskEncryptionSet) - delete(rawMsg, key) - case "diskId": - err = unpopulate(val, "DiskID", &d.DiskID) - delete(rawMsg, key) - case "lun": - err = unpopulate(val, "Lun", &d.Lun) - delete(rawMsg, key) - case "writeAcceleratorEnabled": - err = unpopulate(val, "WriteAcceleratorEnabled", &d.WriteAcceleratorEnabled) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DataDisksToDetach. -func (d DataDisksToDetach) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "detachOption", d.DetachOption) - populate(objectMap, "diskId", d.DiskID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DataDisksToDetach. -func (d *DataDisksToDetach) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "detachOption": - err = unpopulate(val, "DetachOption", &d.DetachOption) - delete(rawMsg, key) - case "diskId": - err = unpopulate(val, "DiskID", &d.DiskID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHost. -func (d DedicatedHost) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - populate(objectMap, "location", d.Location) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "sku", d.SKU) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHost. -func (d *DedicatedHost) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &d.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &d.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHostAllocatableVM. -func (d DedicatedHostAllocatableVM) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "count", d.Count) - populate(objectMap, "vmSize", d.VMSize) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostAllocatableVM. -func (d *DedicatedHostAllocatableVM) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "count": - err = unpopulate(val, "Count", &d.Count) - delete(rawMsg, key) - case "vmSize": - err = unpopulate(val, "VMSize", &d.VMSize) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHostAvailableCapacity. -func (d DedicatedHostAvailableCapacity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "allocatableVMs", d.AllocatableVMs) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostAvailableCapacity. -func (d *DedicatedHostAvailableCapacity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "allocatableVMs": - err = unpopulate(val, "AllocatableVMs", &d.AllocatableVMs) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHostGroup. -func (d DedicatedHostGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - populate(objectMap, "location", d.Location) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "type", d.Type) - populate(objectMap, "zones", d.Zones) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostGroup. -func (d *DedicatedHostGroup) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &d.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &d.Zones) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHostGroupInstanceView. -func (d DedicatedHostGroupInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "hosts", d.Hosts) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostGroupInstanceView. -func (d *DedicatedHostGroupInstanceView) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "hosts": - err = unpopulate(val, "Hosts", &d.Hosts) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHostGroupListResult. -func (d DedicatedHostGroupListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostGroupListResult. -func (d *DedicatedHostGroupListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHostGroupProperties. -func (d DedicatedHostGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "additionalCapabilities", d.AdditionalCapabilities) - populate(objectMap, "hosts", d.Hosts) - populate(objectMap, "instanceView", d.InstanceView) - populate(objectMap, "platformFaultDomainCount", d.PlatformFaultDomainCount) - populate(objectMap, "supportAutomaticPlacement", d.SupportAutomaticPlacement) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostGroupProperties. -func (d *DedicatedHostGroupProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "additionalCapabilities": - err = unpopulate(val, "AdditionalCapabilities", &d.AdditionalCapabilities) - delete(rawMsg, key) - case "hosts": - err = unpopulate(val, "Hosts", &d.Hosts) - delete(rawMsg, key) - case "instanceView": - err = unpopulate(val, "InstanceView", &d.InstanceView) - delete(rawMsg, key) - case "platformFaultDomainCount": - err = unpopulate(val, "PlatformFaultDomainCount", &d.PlatformFaultDomainCount) - delete(rawMsg, key) - case "supportAutomaticPlacement": - err = unpopulate(val, "SupportAutomaticPlacement", &d.SupportAutomaticPlacement) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHostGroupPropertiesAdditionalCapabilities. -func (d DedicatedHostGroupPropertiesAdditionalCapabilities) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "ultraSSDEnabled", d.UltraSSDEnabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostGroupPropertiesAdditionalCapabilities. -func (d *DedicatedHostGroupPropertiesAdditionalCapabilities) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "ultraSSDEnabled": - err = unpopulate(val, "UltraSSDEnabled", &d.UltraSSDEnabled) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHostGroupUpdate. -func (d DedicatedHostGroupUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "zones", d.Zones) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostGroupUpdate. -func (d *DedicatedHostGroupUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &d.Zones) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHostInstanceView. -func (d DedicatedHostInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "assetId", d.AssetID) - populate(objectMap, "availableCapacity", d.AvailableCapacity) - populate(objectMap, "statuses", d.Statuses) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostInstanceView. -func (d *DedicatedHostInstanceView) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "assetId": - err = unpopulate(val, "AssetID", &d.AssetID) - delete(rawMsg, key) - case "availableCapacity": - err = unpopulate(val, "AvailableCapacity", &d.AvailableCapacity) - delete(rawMsg, key) - case "statuses": - err = unpopulate(val, "Statuses", &d.Statuses) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHostInstanceViewWithName. -func (d DedicatedHostInstanceViewWithName) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "assetId", d.AssetID) - populate(objectMap, "availableCapacity", d.AvailableCapacity) - populate(objectMap, "name", d.Name) - populate(objectMap, "statuses", d.Statuses) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostInstanceViewWithName. -func (d *DedicatedHostInstanceViewWithName) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "assetId": - err = unpopulate(val, "AssetID", &d.AssetID) - delete(rawMsg, key) - case "availableCapacity": - err = unpopulate(val, "AvailableCapacity", &d.AvailableCapacity) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "statuses": - err = unpopulate(val, "Statuses", &d.Statuses) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHostListResult. -func (d DedicatedHostListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostListResult. -func (d *DedicatedHostListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHostProperties. -func (d DedicatedHostProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "autoReplaceOnFailure", d.AutoReplaceOnFailure) - populate(objectMap, "hostId", d.HostID) - populate(objectMap, "instanceView", d.InstanceView) - populate(objectMap, "licenseType", d.LicenseType) - populate(objectMap, "platformFaultDomain", d.PlatformFaultDomain) - populate(objectMap, "provisioningState", d.ProvisioningState) - populateDateTimeRFC3339(objectMap, "provisioningTime", d.ProvisioningTime) - populateDateTimeRFC3339(objectMap, "timeCreated", d.TimeCreated) - populate(objectMap, "virtualMachines", d.VirtualMachines) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostProperties. -func (d *DedicatedHostProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "autoReplaceOnFailure": - err = unpopulate(val, "AutoReplaceOnFailure", &d.AutoReplaceOnFailure) - delete(rawMsg, key) - case "hostId": - err = unpopulate(val, "HostID", &d.HostID) - delete(rawMsg, key) - case "instanceView": - err = unpopulate(val, "InstanceView", &d.InstanceView) - delete(rawMsg, key) - case "licenseType": - err = unpopulate(val, "LicenseType", &d.LicenseType) - delete(rawMsg, key) - case "platformFaultDomain": - err = unpopulate(val, "PlatformFaultDomain", &d.PlatformFaultDomain) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) - delete(rawMsg, key) - case "provisioningTime": - err = unpopulateDateTimeRFC3339(val, "ProvisioningTime", &d.ProvisioningTime) - delete(rawMsg, key) - case "timeCreated": - err = unpopulateDateTimeRFC3339(val, "TimeCreated", &d.TimeCreated) - delete(rawMsg, key) - case "virtualMachines": - err = unpopulate(val, "VirtualMachines", &d.VirtualMachines) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHostSizeListResult. -func (d DedicatedHostSizeListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "value", d.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostSizeListResult. -func (d *DedicatedHostSizeListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "value": - err = unpopulate(val, "Value", &d.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DedicatedHostUpdate. -func (d DedicatedHostUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "sku", d.SKU) - populate(objectMap, "tags", d.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostUpdate. -func (d *DedicatedHostUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &d.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiagnosticsProfile. -func (d DiagnosticsProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "bootDiagnostics", d.BootDiagnostics) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticsProfile. -func (d *DiagnosticsProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "bootDiagnostics": - err = unpopulate(val, "BootDiagnostics", &d.BootDiagnostics) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiffDiskSettings. -func (d DiffDiskSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "option", d.Option) - populate(objectMap, "placement", d.Placement) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiffDiskSettings. -func (d *DiffDiskSettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "option": - err = unpopulate(val, "Option", &d.Option) - delete(rawMsg, key) - case "placement": - err = unpopulate(val, "Placement", &d.Placement) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Disallowed. -func (d Disallowed) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "diskTypes", d.DiskTypes) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Disallowed. -func (d *Disallowed) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "diskTypes": - err = unpopulate(val, "DiskTypes", &d.DiskTypes) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DisallowedConfiguration. -func (d DisallowedConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "vmDiskType", d.VMDiskType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DisallowedConfiguration. -func (d *DisallowedConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "vmDiskType": - err = unpopulate(val, "VMDiskType", &d.VMDiskType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Disk. -func (d Disk) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "extendedLocation", d.ExtendedLocation) - populate(objectMap, "id", d.ID) - populate(objectMap, "location", d.Location) - populate(objectMap, "managedBy", d.ManagedBy) - populate(objectMap, "managedByExtended", d.ManagedByExtended) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "sku", d.SKU) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "type", d.Type) - populate(objectMap, "zones", d.Zones) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Disk. -func (d *Disk) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "extendedLocation": - err = unpopulate(val, "ExtendedLocation", &d.ExtendedLocation) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &d.Location) - delete(rawMsg, key) - case "managedBy": - err = unpopulate(val, "ManagedBy", &d.ManagedBy) - delete(rawMsg, key) - case "managedByExtended": - err = unpopulate(val, "ManagedByExtended", &d.ManagedByExtended) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &d.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &d.Zones) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskAccess. -func (d DiskAccess) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "extendedLocation", d.ExtendedLocation) - populate(objectMap, "id", d.ID) - populate(objectMap, "location", d.Location) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskAccess. -func (d *DiskAccess) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "extendedLocation": - err = unpopulate(val, "ExtendedLocation", &d.ExtendedLocation) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &d.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskAccessList. -func (d DiskAccessList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskAccessList. -func (d *DiskAccessList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskAccessProperties. -func (d DiskAccessProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "privateEndpointConnections", d.PrivateEndpointConnections) - populate(objectMap, "provisioningState", d.ProvisioningState) - populateDateTimeRFC3339(objectMap, "timeCreated", d.TimeCreated) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskAccessProperties. -func (d *DiskAccessProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "privateEndpointConnections": - err = unpopulate(val, "PrivateEndpointConnections", &d.PrivateEndpointConnections) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) - delete(rawMsg, key) - case "timeCreated": - err = unpopulateDateTimeRFC3339(val, "TimeCreated", &d.TimeCreated) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskAccessUpdate. -func (d DiskAccessUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "tags", d.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskAccessUpdate. -func (d *DiskAccessUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "tags": - err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskEncryptionSet. -func (d DiskEncryptionSet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - populate(objectMap, "identity", d.Identity) - populate(objectMap, "location", d.Location) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskEncryptionSet. -func (d *DiskEncryptionSet) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &d.Identity) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &d.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskEncryptionSetList. -func (d DiskEncryptionSetList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskEncryptionSetList. -func (d *DiskEncryptionSetList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskEncryptionSetParameters. -func (d DiskEncryptionSetParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskEncryptionSetParameters. -func (d *DiskEncryptionSetParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskEncryptionSetUpdate. -func (d DiskEncryptionSetUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "identity", d.Identity) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "tags", d.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskEncryptionSetUpdate. -func (d *DiskEncryptionSetUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "identity": - err = unpopulate(val, "Identity", &d.Identity) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskEncryptionSetUpdateProperties. -func (d DiskEncryptionSetUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "activeKey", d.ActiveKey) - populate(objectMap, "encryptionType", d.EncryptionType) - populate(objectMap, "federatedClientId", d.FederatedClientID) - populate(objectMap, "rotationToLatestKeyVersionEnabled", d.RotationToLatestKeyVersionEnabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskEncryptionSetUpdateProperties. -func (d *DiskEncryptionSetUpdateProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "activeKey": - err = unpopulate(val, "ActiveKey", &d.ActiveKey) - delete(rawMsg, key) - case "encryptionType": - err = unpopulate(val, "EncryptionType", &d.EncryptionType) - delete(rawMsg, key) - case "federatedClientId": - err = unpopulate(val, "FederatedClientID", &d.FederatedClientID) - delete(rawMsg, key) - case "rotationToLatestKeyVersionEnabled": - err = unpopulate(val, "RotationToLatestKeyVersionEnabled", &d.RotationToLatestKeyVersionEnabled) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskEncryptionSettings. -func (d DiskEncryptionSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "diskEncryptionKey", d.DiskEncryptionKey) - populate(objectMap, "enabled", d.Enabled) - populate(objectMap, "keyEncryptionKey", d.KeyEncryptionKey) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskEncryptionSettings. -func (d *DiskEncryptionSettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "diskEncryptionKey": - err = unpopulate(val, "DiskEncryptionKey", &d.DiskEncryptionKey) - delete(rawMsg, key) - case "enabled": - err = unpopulate(val, "Enabled", &d.Enabled) - delete(rawMsg, key) - case "keyEncryptionKey": - err = unpopulate(val, "KeyEncryptionKey", &d.KeyEncryptionKey) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskImageEncryption. -func (d DiskImageEncryption) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "diskEncryptionSetId", d.DiskEncryptionSetID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskImageEncryption. -func (d *DiskImageEncryption) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "diskEncryptionSetId": - err = unpopulate(val, "DiskEncryptionSetID", &d.DiskEncryptionSetID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskInstanceView. -func (d DiskInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "encryptionSettings", d.EncryptionSettings) - populate(objectMap, "name", d.Name) - populate(objectMap, "statuses", d.Statuses) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskInstanceView. -func (d *DiskInstanceView) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "encryptionSettings": - err = unpopulate(val, "EncryptionSettings", &d.EncryptionSettings) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "statuses": - err = unpopulate(val, "Statuses", &d.Statuses) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskList. -func (d DiskList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskList. -func (d *DiskList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskProperties. -func (d DiskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "burstingEnabled", d.BurstingEnabled) - populateDateTimeRFC3339(objectMap, "burstingEnabledTime", d.BurstingEnabledTime) - populate(objectMap, "completionPercent", d.CompletionPercent) - populate(objectMap, "creationData", d.CreationData) - populate(objectMap, "dataAccessAuthMode", d.DataAccessAuthMode) - populate(objectMap, "diskAccessId", d.DiskAccessID) - populate(objectMap, "diskIOPSReadOnly", d.DiskIOPSReadOnly) - populate(objectMap, "diskIOPSReadWrite", d.DiskIOPSReadWrite) - populate(objectMap, "diskMBpsReadOnly", d.DiskMBpsReadOnly) - populate(objectMap, "diskMBpsReadWrite", d.DiskMBpsReadWrite) - populate(objectMap, "diskSizeBytes", d.DiskSizeBytes) - populate(objectMap, "diskSizeGB", d.DiskSizeGB) - populate(objectMap, "diskState", d.DiskState) - populate(objectMap, "encryption", d.Encryption) - populate(objectMap, "encryptionSettingsCollection", d.EncryptionSettingsCollection) - populate(objectMap, "hyperVGeneration", d.HyperVGeneration) - populateDateTimeRFC3339(objectMap, "LastOwnershipUpdateTime", d.LastOwnershipUpdateTime) - populate(objectMap, "maxShares", d.MaxShares) - populate(objectMap, "networkAccessPolicy", d.NetworkAccessPolicy) - populate(objectMap, "osType", d.OSType) - populate(objectMap, "optimizedForFrequentAttach", d.OptimizedForFrequentAttach) - populate(objectMap, "propertyUpdatesInProgress", d.PropertyUpdatesInProgress) - populate(objectMap, "provisioningState", d.ProvisioningState) - populate(objectMap, "publicNetworkAccess", d.PublicNetworkAccess) - populate(objectMap, "purchasePlan", d.PurchasePlan) - populate(objectMap, "securityProfile", d.SecurityProfile) - populate(objectMap, "shareInfo", d.ShareInfo) - populate(objectMap, "supportedCapabilities", d.SupportedCapabilities) - populate(objectMap, "supportsHibernation", d.SupportsHibernation) - populate(objectMap, "tier", d.Tier) - populateDateTimeRFC3339(objectMap, "timeCreated", d.TimeCreated) - populate(objectMap, "uniqueId", d.UniqueID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskProperties. -func (d *DiskProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "burstingEnabled": - err = unpopulate(val, "BurstingEnabled", &d.BurstingEnabled) - delete(rawMsg, key) - case "burstingEnabledTime": - err = unpopulateDateTimeRFC3339(val, "BurstingEnabledTime", &d.BurstingEnabledTime) - delete(rawMsg, key) - case "completionPercent": - err = unpopulate(val, "CompletionPercent", &d.CompletionPercent) - delete(rawMsg, key) - case "creationData": - err = unpopulate(val, "CreationData", &d.CreationData) - delete(rawMsg, key) - case "dataAccessAuthMode": - err = unpopulate(val, "DataAccessAuthMode", &d.DataAccessAuthMode) - delete(rawMsg, key) - case "diskAccessId": - err = unpopulate(val, "DiskAccessID", &d.DiskAccessID) - delete(rawMsg, key) - case "diskIOPSReadOnly": - err = unpopulate(val, "DiskIOPSReadOnly", &d.DiskIOPSReadOnly) - delete(rawMsg, key) - case "diskIOPSReadWrite": - err = unpopulate(val, "DiskIOPSReadWrite", &d.DiskIOPSReadWrite) - delete(rawMsg, key) - case "diskMBpsReadOnly": - err = unpopulate(val, "DiskMBpsReadOnly", &d.DiskMBpsReadOnly) - delete(rawMsg, key) - case "diskMBpsReadWrite": - err = unpopulate(val, "DiskMBpsReadWrite", &d.DiskMBpsReadWrite) - delete(rawMsg, key) - case "diskSizeBytes": - err = unpopulate(val, "DiskSizeBytes", &d.DiskSizeBytes) - delete(rawMsg, key) - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &d.DiskSizeGB) - delete(rawMsg, key) - case "diskState": - err = unpopulate(val, "DiskState", &d.DiskState) - delete(rawMsg, key) - case "encryption": - err = unpopulate(val, "Encryption", &d.Encryption) - delete(rawMsg, key) - case "encryptionSettingsCollection": - err = unpopulate(val, "EncryptionSettingsCollection", &d.EncryptionSettingsCollection) - delete(rawMsg, key) - case "hyperVGeneration": - err = unpopulate(val, "HyperVGeneration", &d.HyperVGeneration) - delete(rawMsg, key) - case "LastOwnershipUpdateTime": - err = unpopulateDateTimeRFC3339(val, "LastOwnershipUpdateTime", &d.LastOwnershipUpdateTime) - delete(rawMsg, key) - case "maxShares": - err = unpopulate(val, "MaxShares", &d.MaxShares) - delete(rawMsg, key) - case "networkAccessPolicy": - err = unpopulate(val, "NetworkAccessPolicy", &d.NetworkAccessPolicy) - delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &d.OSType) - delete(rawMsg, key) - case "optimizedForFrequentAttach": - err = unpopulate(val, "OptimizedForFrequentAttach", &d.OptimizedForFrequentAttach) - delete(rawMsg, key) - case "propertyUpdatesInProgress": - err = unpopulate(val, "PropertyUpdatesInProgress", &d.PropertyUpdatesInProgress) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &d.PublicNetworkAccess) - delete(rawMsg, key) - case "purchasePlan": - err = unpopulate(val, "PurchasePlan", &d.PurchasePlan) - delete(rawMsg, key) - case "securityProfile": - err = unpopulate(val, "SecurityProfile", &d.SecurityProfile) - delete(rawMsg, key) - case "shareInfo": - err = unpopulate(val, "ShareInfo", &d.ShareInfo) - delete(rawMsg, key) - case "supportedCapabilities": - err = unpopulate(val, "SupportedCapabilities", &d.SupportedCapabilities) - delete(rawMsg, key) - case "supportsHibernation": - err = unpopulate(val, "SupportsHibernation", &d.SupportsHibernation) - delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &d.Tier) - delete(rawMsg, key) - case "timeCreated": - err = unpopulateDateTimeRFC3339(val, "TimeCreated", &d.TimeCreated) - delete(rawMsg, key) - case "uniqueId": - err = unpopulate(val, "UniqueID", &d.UniqueID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskPurchasePlan. -func (d DiskPurchasePlan) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", d.Name) - populate(objectMap, "product", d.Product) - populate(objectMap, "promotionCode", d.PromotionCode) - populate(objectMap, "publisher", d.Publisher) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskPurchasePlan. -func (d *DiskPurchasePlan) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "product": - err = unpopulate(val, "Product", &d.Product) - delete(rawMsg, key) - case "promotionCode": - err = unpopulate(val, "PromotionCode", &d.PromotionCode) - delete(rawMsg, key) - case "publisher": - err = unpopulate(val, "Publisher", &d.Publisher) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskRestorePoint. -func (d DiskRestorePoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskRestorePoint. -func (d *DiskRestorePoint) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskRestorePointAttributes. -func (d DiskRestorePointAttributes) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "encryption", d.Encryption) - populate(objectMap, "id", d.ID) - populate(objectMap, "sourceDiskRestorePoint", d.SourceDiskRestorePoint) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskRestorePointAttributes. -func (d *DiskRestorePointAttributes) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "encryption": - err = unpopulate(val, "Encryption", &d.Encryption) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "sourceDiskRestorePoint": - err = unpopulate(val, "SourceDiskRestorePoint", &d.SourceDiskRestorePoint) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskRestorePointInstanceView. -func (d DiskRestorePointInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - populate(objectMap, "replicationStatus", d.ReplicationStatus) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskRestorePointInstanceView. -func (d *DiskRestorePointInstanceView) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "replicationStatus": - err = unpopulate(val, "ReplicationStatus", &d.ReplicationStatus) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskRestorePointList. -func (d DiskRestorePointList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskRestorePointList. -func (d *DiskRestorePointList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskRestorePointProperties. -func (d DiskRestorePointProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "completionPercent", d.CompletionPercent) - populate(objectMap, "diskAccessId", d.DiskAccessID) - populate(objectMap, "encryption", d.Encryption) - populate(objectMap, "familyId", d.FamilyID) - populate(objectMap, "hyperVGeneration", d.HyperVGeneration) - populate(objectMap, "networkAccessPolicy", d.NetworkAccessPolicy) - populate(objectMap, "osType", d.OSType) - populate(objectMap, "publicNetworkAccess", d.PublicNetworkAccess) - populate(objectMap, "purchasePlan", d.PurchasePlan) - populate(objectMap, "replicationState", d.ReplicationState) - populate(objectMap, "securityProfile", d.SecurityProfile) - populate(objectMap, "sourceResourceId", d.SourceResourceID) - populate(objectMap, "sourceResourceLocation", d.SourceResourceLocation) - populate(objectMap, "sourceUniqueId", d.SourceUniqueID) - populate(objectMap, "supportedCapabilities", d.SupportedCapabilities) - populate(objectMap, "supportsHibernation", d.SupportsHibernation) - populateDateTimeRFC3339(objectMap, "timeCreated", d.TimeCreated) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskRestorePointProperties. -func (d *DiskRestorePointProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "completionPercent": - err = unpopulate(val, "CompletionPercent", &d.CompletionPercent) - delete(rawMsg, key) - case "diskAccessId": - err = unpopulate(val, "DiskAccessID", &d.DiskAccessID) - delete(rawMsg, key) - case "encryption": - err = unpopulate(val, "Encryption", &d.Encryption) - delete(rawMsg, key) - case "familyId": - err = unpopulate(val, "FamilyID", &d.FamilyID) - delete(rawMsg, key) - case "hyperVGeneration": - err = unpopulate(val, "HyperVGeneration", &d.HyperVGeneration) - delete(rawMsg, key) - case "networkAccessPolicy": - err = unpopulate(val, "NetworkAccessPolicy", &d.NetworkAccessPolicy) - delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &d.OSType) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &d.PublicNetworkAccess) - delete(rawMsg, key) - case "purchasePlan": - err = unpopulate(val, "PurchasePlan", &d.PurchasePlan) - delete(rawMsg, key) - case "replicationState": - err = unpopulate(val, "ReplicationState", &d.ReplicationState) - delete(rawMsg, key) - case "securityProfile": - err = unpopulate(val, "SecurityProfile", &d.SecurityProfile) - delete(rawMsg, key) - case "sourceResourceId": - err = unpopulate(val, "SourceResourceID", &d.SourceResourceID) - delete(rawMsg, key) - case "sourceResourceLocation": - err = unpopulate(val, "SourceResourceLocation", &d.SourceResourceLocation) - delete(rawMsg, key) - case "sourceUniqueId": - err = unpopulate(val, "SourceUniqueID", &d.SourceUniqueID) - delete(rawMsg, key) - case "supportedCapabilities": - err = unpopulate(val, "SupportedCapabilities", &d.SupportedCapabilities) - delete(rawMsg, key) - case "supportsHibernation": - err = unpopulate(val, "SupportsHibernation", &d.SupportsHibernation) - delete(rawMsg, key) - case "timeCreated": - err = unpopulateDateTimeRFC3339(val, "TimeCreated", &d.TimeCreated) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskRestorePointReplicationStatus. -func (d DiskRestorePointReplicationStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "completionPercent", d.CompletionPercent) - populate(objectMap, "status", d.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskRestorePointReplicationStatus. -func (d *DiskRestorePointReplicationStatus) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "completionPercent": - err = unpopulate(val, "CompletionPercent", &d.CompletionPercent) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &d.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskSKU. -func (d DiskSKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", d.Name) - populate(objectMap, "tier", d.Tier) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskSKU. -func (d *DiskSKU) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &d.Tier) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskSecurityProfile. -func (d DiskSecurityProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "secureVMDiskEncryptionSetId", d.SecureVMDiskEncryptionSetID) - populate(objectMap, "securityType", d.SecurityType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskSecurityProfile. -func (d *DiskSecurityProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "secureVMDiskEncryptionSetId": - err = unpopulate(val, "SecureVMDiskEncryptionSetID", &d.SecureVMDiskEncryptionSetID) - delete(rawMsg, key) - case "securityType": - err = unpopulate(val, "SecurityType", &d.SecurityType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskUpdate. -func (d DiskUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "sku", d.SKU) - populate(objectMap, "tags", d.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskUpdate. -func (d *DiskUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &d.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiskUpdateProperties. -func (d DiskUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "burstingEnabled", d.BurstingEnabled) - populate(objectMap, "dataAccessAuthMode", d.DataAccessAuthMode) - populate(objectMap, "diskAccessId", d.DiskAccessID) - populate(objectMap, "diskIOPSReadOnly", d.DiskIOPSReadOnly) - populate(objectMap, "diskIOPSReadWrite", d.DiskIOPSReadWrite) - populate(objectMap, "diskMBpsReadOnly", d.DiskMBpsReadOnly) - populate(objectMap, "diskMBpsReadWrite", d.DiskMBpsReadWrite) - populate(objectMap, "diskSizeGB", d.DiskSizeGB) - populate(objectMap, "encryption", d.Encryption) - populate(objectMap, "encryptionSettingsCollection", d.EncryptionSettingsCollection) - populate(objectMap, "maxShares", d.MaxShares) - populate(objectMap, "networkAccessPolicy", d.NetworkAccessPolicy) - populate(objectMap, "osType", d.OSType) - populate(objectMap, "optimizedForFrequentAttach", d.OptimizedForFrequentAttach) - populate(objectMap, "propertyUpdatesInProgress", d.PropertyUpdatesInProgress) - populate(objectMap, "publicNetworkAccess", d.PublicNetworkAccess) - populate(objectMap, "purchasePlan", d.PurchasePlan) - populate(objectMap, "supportedCapabilities", d.SupportedCapabilities) - populate(objectMap, "supportsHibernation", d.SupportsHibernation) - populate(objectMap, "tier", d.Tier) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskUpdateProperties. -func (d *DiskUpdateProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "burstingEnabled": - err = unpopulate(val, "BurstingEnabled", &d.BurstingEnabled) - delete(rawMsg, key) - case "dataAccessAuthMode": - err = unpopulate(val, "DataAccessAuthMode", &d.DataAccessAuthMode) - delete(rawMsg, key) - case "diskAccessId": - err = unpopulate(val, "DiskAccessID", &d.DiskAccessID) - delete(rawMsg, key) - case "diskIOPSReadOnly": - err = unpopulate(val, "DiskIOPSReadOnly", &d.DiskIOPSReadOnly) - delete(rawMsg, key) - case "diskIOPSReadWrite": - err = unpopulate(val, "DiskIOPSReadWrite", &d.DiskIOPSReadWrite) - delete(rawMsg, key) - case "diskMBpsReadOnly": - err = unpopulate(val, "DiskMBpsReadOnly", &d.DiskMBpsReadOnly) - delete(rawMsg, key) - case "diskMBpsReadWrite": - err = unpopulate(val, "DiskMBpsReadWrite", &d.DiskMBpsReadWrite) - delete(rawMsg, key) - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &d.DiskSizeGB) - delete(rawMsg, key) - case "encryption": - err = unpopulate(val, "Encryption", &d.Encryption) - delete(rawMsg, key) - case "encryptionSettingsCollection": - err = unpopulate(val, "EncryptionSettingsCollection", &d.EncryptionSettingsCollection) - delete(rawMsg, key) - case "maxShares": - err = unpopulate(val, "MaxShares", &d.MaxShares) - delete(rawMsg, key) - case "networkAccessPolicy": - err = unpopulate(val, "NetworkAccessPolicy", &d.NetworkAccessPolicy) - delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &d.OSType) - delete(rawMsg, key) - case "optimizedForFrequentAttach": - err = unpopulate(val, "OptimizedForFrequentAttach", &d.OptimizedForFrequentAttach) - delete(rawMsg, key) - case "propertyUpdatesInProgress": - err = unpopulate(val, "PropertyUpdatesInProgress", &d.PropertyUpdatesInProgress) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &d.PublicNetworkAccess) - delete(rawMsg, key) - case "purchasePlan": - err = unpopulate(val, "PurchasePlan", &d.PurchasePlan) - delete(rawMsg, key) - case "supportedCapabilities": - err = unpopulate(val, "SupportedCapabilities", &d.SupportedCapabilities) - delete(rawMsg, key) - case "supportsHibernation": - err = unpopulate(val, "SupportsHibernation", &d.SupportsHibernation) - delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &d.Tier) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Encryption. -func (e Encryption) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "diskEncryptionSetId", e.DiskEncryptionSetID) - populate(objectMap, "type", e.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Encryption. -func (e *Encryption) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "diskEncryptionSetId": - err = unpopulate(val, "DiskEncryptionSetID", &e.DiskEncryptionSetID) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EncryptionIdentity. -func (e EncryptionIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "userAssignedIdentityResourceId", e.UserAssignedIdentityResourceID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionIdentity. -func (e *EncryptionIdentity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "userAssignedIdentityResourceId": - err = unpopulate(val, "UserAssignedIdentityResourceID", &e.UserAssignedIdentityResourceID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EncryptionImages. -func (e EncryptionImages) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "dataDiskImages", e.DataDiskImages) - populate(objectMap, "osDiskImage", e.OSDiskImage) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionImages. -func (e *EncryptionImages) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dataDiskImages": - err = unpopulate(val, "DataDiskImages", &e.DataDiskImages) - delete(rawMsg, key) - case "osDiskImage": - err = unpopulate(val, "OSDiskImage", &e.OSDiskImage) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EncryptionSetIdentity. -func (e EncryptionSetIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "principalId", e.PrincipalID) - populate(objectMap, "tenantId", e.TenantID) - populate(objectMap, "type", e.Type) - populate(objectMap, "userAssignedIdentities", e.UserAssignedIdentities) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionSetIdentity. -func (e *EncryptionSetIdentity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "principalId": - err = unpopulate(val, "PrincipalID", &e.PrincipalID) - delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &e.TenantID) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) - delete(rawMsg, key) - case "userAssignedIdentities": - err = unpopulate(val, "UserAssignedIdentities", &e.UserAssignedIdentities) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EncryptionSetProperties. -func (e EncryptionSetProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "activeKey", e.ActiveKey) - populate(objectMap, "autoKeyRotationError", e.AutoKeyRotationError) - populate(objectMap, "encryptionType", e.EncryptionType) - populate(objectMap, "federatedClientId", e.FederatedClientID) - populateDateTimeRFC3339(objectMap, "lastKeyRotationTimestamp", e.LastKeyRotationTimestamp) - populate(objectMap, "previousKeys", e.PreviousKeys) - populate(objectMap, "provisioningState", e.ProvisioningState) - populate(objectMap, "rotationToLatestKeyVersionEnabled", e.RotationToLatestKeyVersionEnabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionSetProperties. -func (e *EncryptionSetProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "activeKey": - err = unpopulate(val, "ActiveKey", &e.ActiveKey) - delete(rawMsg, key) - case "autoKeyRotationError": - err = unpopulate(val, "AutoKeyRotationError", &e.AutoKeyRotationError) - delete(rawMsg, key) - case "encryptionType": - err = unpopulate(val, "EncryptionType", &e.EncryptionType) - delete(rawMsg, key) - case "federatedClientId": - err = unpopulate(val, "FederatedClientID", &e.FederatedClientID) - delete(rawMsg, key) - case "lastKeyRotationTimestamp": - err = unpopulateDateTimeRFC3339(val, "LastKeyRotationTimestamp", &e.LastKeyRotationTimestamp) - delete(rawMsg, key) - case "previousKeys": - err = unpopulate(val, "PreviousKeys", &e.PreviousKeys) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) - delete(rawMsg, key) - case "rotationToLatestKeyVersionEnabled": - err = unpopulate(val, "RotationToLatestKeyVersionEnabled", &e.RotationToLatestKeyVersionEnabled) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EncryptionSettingsCollection. -func (e EncryptionSettingsCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "enabled", e.Enabled) - populate(objectMap, "encryptionSettings", e.EncryptionSettings) - populate(objectMap, "encryptionSettingsVersion", e.EncryptionSettingsVersion) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionSettingsCollection. -func (e *EncryptionSettingsCollection) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enabled": - err = unpopulate(val, "Enabled", &e.Enabled) - delete(rawMsg, key) - case "encryptionSettings": - err = unpopulate(val, "EncryptionSettings", &e.EncryptionSettings) - delete(rawMsg, key) - case "encryptionSettingsVersion": - err = unpopulate(val, "EncryptionSettingsVersion", &e.EncryptionSettingsVersion) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EncryptionSettingsElement. -func (e EncryptionSettingsElement) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "diskEncryptionKey", e.DiskEncryptionKey) - populate(objectMap, "keyEncryptionKey", e.KeyEncryptionKey) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionSettingsElement. -func (e *EncryptionSettingsElement) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "diskEncryptionKey": - err = unpopulate(val, "DiskEncryptionKey", &e.DiskEncryptionKey) - delete(rawMsg, key) - case "keyEncryptionKey": - err = unpopulate(val, "KeyEncryptionKey", &e.KeyEncryptionKey) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EventGridAndResourceGraph. -func (e EventGridAndResourceGraph) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "enable", e.Enable) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EventGridAndResourceGraph. -func (e *EventGridAndResourceGraph) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enable": - err = unpopulate(val, "Enable", &e.Enable) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExtendedLocation. -func (e ExtendedLocation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", e.Name) - populate(objectMap, "type", e.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedLocation. -func (e *ExtendedLocation) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &e.Name) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Extension. -func (e Extension) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Extension. -func (e *Extension) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &e.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &e.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Gallery. -func (g Gallery) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", g.ID) - populate(objectMap, "location", g.Location) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Gallery. -func (g *Gallery) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &g.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &g.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &g.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryApplication. -func (g GalleryApplication) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", g.ID) - populate(objectMap, "location", g.Location) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplication. -func (g *GalleryApplication) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &g.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &g.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &g.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryApplicationCustomAction. -func (g GalleryApplicationCustomAction) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "description", g.Description) - populate(objectMap, "name", g.Name) - populate(objectMap, "parameters", g.Parameters) - populate(objectMap, "script", g.Script) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationCustomAction. -func (g *GalleryApplicationCustomAction) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, "Description", &g.Description) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &g.Parameters) - delete(rawMsg, key) - case "script": - err = unpopulate(val, "Script", &g.Script) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryApplicationCustomActionParameter. -func (g GalleryApplicationCustomActionParameter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "defaultValue", g.DefaultValue) - populate(objectMap, "description", g.Description) - populate(objectMap, "name", g.Name) - populate(objectMap, "required", g.Required) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationCustomActionParameter. -func (g *GalleryApplicationCustomActionParameter) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "defaultValue": - err = unpopulate(val, "DefaultValue", &g.DefaultValue) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &g.Description) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "required": - err = unpopulate(val, "Required", &g.Required) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryApplicationList. -func (g GalleryApplicationList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", g.NextLink) - populate(objectMap, "value", g.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationList. -func (g *GalleryApplicationList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &g.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &g.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryApplicationProperties. -func (g GalleryApplicationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "customActions", g.CustomActions) - populate(objectMap, "description", g.Description) - populateDateTimeRFC3339(objectMap, "endOfLifeDate", g.EndOfLifeDate) - populate(objectMap, "eula", g.Eula) - populate(objectMap, "privacyStatementUri", g.PrivacyStatementURI) - populate(objectMap, "releaseNoteUri", g.ReleaseNoteURI) - populate(objectMap, "supportedOSType", g.SupportedOSType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationProperties. -func (g *GalleryApplicationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "customActions": - err = unpopulate(val, "CustomActions", &g.CustomActions) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &g.Description) - delete(rawMsg, key) - case "endOfLifeDate": - err = unpopulateDateTimeRFC3339(val, "EndOfLifeDate", &g.EndOfLifeDate) - delete(rawMsg, key) - case "eula": - err = unpopulate(val, "Eula", &g.Eula) - delete(rawMsg, key) - case "privacyStatementUri": - err = unpopulate(val, "PrivacyStatementURI", &g.PrivacyStatementURI) - delete(rawMsg, key) - case "releaseNoteUri": - err = unpopulate(val, "ReleaseNoteURI", &g.ReleaseNoteURI) - delete(rawMsg, key) - case "supportedOSType": - err = unpopulate(val, "SupportedOSType", &g.SupportedOSType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryApplicationUpdate. -func (g GalleryApplicationUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", g.ID) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationUpdate. -func (g *GalleryApplicationUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &g.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &g.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryApplicationVersion. -func (g GalleryApplicationVersion) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", g.ID) - populate(objectMap, "location", g.Location) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationVersion. -func (g *GalleryApplicationVersion) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &g.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &g.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &g.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryApplicationVersionList. -func (g GalleryApplicationVersionList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", g.NextLink) - populate(objectMap, "value", g.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationVersionList. -func (g *GalleryApplicationVersionList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &g.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &g.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryApplicationVersionProperties. -func (g GalleryApplicationVersionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "provisioningState", g.ProvisioningState) - populate(objectMap, "publishingProfile", g.PublishingProfile) - populate(objectMap, "replicationStatus", g.ReplicationStatus) - populate(objectMap, "safetyProfile", g.SafetyProfile) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationVersionProperties. -func (g *GalleryApplicationVersionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &g.ProvisioningState) - delete(rawMsg, key) - case "publishingProfile": - err = unpopulate(val, "PublishingProfile", &g.PublishingProfile) - delete(rawMsg, key) - case "replicationStatus": - err = unpopulate(val, "ReplicationStatus", &g.ReplicationStatus) - delete(rawMsg, key) - case "safetyProfile": - err = unpopulate(val, "SafetyProfile", &g.SafetyProfile) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryApplicationVersionPublishingProfile. -func (g GalleryApplicationVersionPublishingProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "advancedSettings", g.AdvancedSettings) - populate(objectMap, "customActions", g.CustomActions) - populate(objectMap, "enableHealthCheck", g.EnableHealthCheck) - populateDateTimeRFC3339(objectMap, "endOfLifeDate", g.EndOfLifeDate) - populate(objectMap, "excludeFromLatest", g.ExcludeFromLatest) - populate(objectMap, "manageActions", g.ManageActions) - populateDateTimeRFC3339(objectMap, "publishedDate", g.PublishedDate) - populate(objectMap, "replicaCount", g.ReplicaCount) - populate(objectMap, "replicationMode", g.ReplicationMode) - populate(objectMap, "settings", g.Settings) - populate(objectMap, "source", g.Source) - populate(objectMap, "storageAccountType", g.StorageAccountType) - populate(objectMap, "targetExtendedLocations", g.TargetExtendedLocations) - populate(objectMap, "targetRegions", g.TargetRegions) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationVersionPublishingProfile. -func (g *GalleryApplicationVersionPublishingProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "advancedSettings": - err = unpopulate(val, "AdvancedSettings", &g.AdvancedSettings) - delete(rawMsg, key) - case "customActions": - err = unpopulate(val, "CustomActions", &g.CustomActions) - delete(rawMsg, key) - case "enableHealthCheck": - err = unpopulate(val, "EnableHealthCheck", &g.EnableHealthCheck) - delete(rawMsg, key) - case "endOfLifeDate": - err = unpopulateDateTimeRFC3339(val, "EndOfLifeDate", &g.EndOfLifeDate) - delete(rawMsg, key) - case "excludeFromLatest": - err = unpopulate(val, "ExcludeFromLatest", &g.ExcludeFromLatest) - delete(rawMsg, key) - case "manageActions": - err = unpopulate(val, "ManageActions", &g.ManageActions) - delete(rawMsg, key) - case "publishedDate": - err = unpopulateDateTimeRFC3339(val, "PublishedDate", &g.PublishedDate) - delete(rawMsg, key) - case "replicaCount": - err = unpopulate(val, "ReplicaCount", &g.ReplicaCount) - delete(rawMsg, key) - case "replicationMode": - err = unpopulate(val, "ReplicationMode", &g.ReplicationMode) - delete(rawMsg, key) - case "settings": - err = unpopulate(val, "Settings", &g.Settings) - delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &g.Source) - delete(rawMsg, key) - case "storageAccountType": - err = unpopulate(val, "StorageAccountType", &g.StorageAccountType) - delete(rawMsg, key) - case "targetExtendedLocations": - err = unpopulate(val, "TargetExtendedLocations", &g.TargetExtendedLocations) - delete(rawMsg, key) - case "targetRegions": - err = unpopulate(val, "TargetRegions", &g.TargetRegions) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryApplicationVersionSafetyProfile. -func (g GalleryApplicationVersionSafetyProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "allowDeletionOfReplicatedLocations", g.AllowDeletionOfReplicatedLocations) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationVersionSafetyProfile. -func (g *GalleryApplicationVersionSafetyProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "allowDeletionOfReplicatedLocations": - err = unpopulate(val, "AllowDeletionOfReplicatedLocations", &g.AllowDeletionOfReplicatedLocations) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryApplicationVersionUpdate. -func (g GalleryApplicationVersionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", g.ID) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationVersionUpdate. -func (g *GalleryApplicationVersionUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &g.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &g.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryArtifactPublishingProfileBase. -func (g GalleryArtifactPublishingProfileBase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "endOfLifeDate", g.EndOfLifeDate) - populate(objectMap, "excludeFromLatest", g.ExcludeFromLatest) - populateDateTimeRFC3339(objectMap, "publishedDate", g.PublishedDate) - populate(objectMap, "replicaCount", g.ReplicaCount) - populate(objectMap, "replicationMode", g.ReplicationMode) - populate(objectMap, "storageAccountType", g.StorageAccountType) - populate(objectMap, "targetExtendedLocations", g.TargetExtendedLocations) - populate(objectMap, "targetRegions", g.TargetRegions) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryArtifactPublishingProfileBase. -func (g *GalleryArtifactPublishingProfileBase) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "endOfLifeDate": - err = unpopulateDateTimeRFC3339(val, "EndOfLifeDate", &g.EndOfLifeDate) - delete(rawMsg, key) - case "excludeFromLatest": - err = unpopulate(val, "ExcludeFromLatest", &g.ExcludeFromLatest) - delete(rawMsg, key) - case "publishedDate": - err = unpopulateDateTimeRFC3339(val, "PublishedDate", &g.PublishedDate) - delete(rawMsg, key) - case "replicaCount": - err = unpopulate(val, "ReplicaCount", &g.ReplicaCount) - delete(rawMsg, key) - case "replicationMode": - err = unpopulate(val, "ReplicationMode", &g.ReplicationMode) - delete(rawMsg, key) - case "storageAccountType": - err = unpopulate(val, "StorageAccountType", &g.StorageAccountType) - delete(rawMsg, key) - case "targetExtendedLocations": - err = unpopulate(val, "TargetExtendedLocations", &g.TargetExtendedLocations) - delete(rawMsg, key) - case "targetRegions": - err = unpopulate(val, "TargetRegions", &g.TargetRegions) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryArtifactSafetyProfileBase. -func (g GalleryArtifactSafetyProfileBase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "allowDeletionOfReplicatedLocations", g.AllowDeletionOfReplicatedLocations) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryArtifactSafetyProfileBase. -func (g *GalleryArtifactSafetyProfileBase) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "allowDeletionOfReplicatedLocations": - err = unpopulate(val, "AllowDeletionOfReplicatedLocations", &g.AllowDeletionOfReplicatedLocations) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryArtifactSource. -func (g GalleryArtifactSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "managedImage", g.ManagedImage) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryArtifactSource. -func (g *GalleryArtifactSource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "managedImage": - err = unpopulate(val, "ManagedImage", &g.ManagedImage) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryArtifactVersionFullSource. -func (g GalleryArtifactVersionFullSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "communityGalleryImageId", g.CommunityGalleryImageID) - populate(objectMap, "id", g.ID) - populate(objectMap, "virtualMachineId", g.VirtualMachineID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryArtifactVersionFullSource. -func (g *GalleryArtifactVersionFullSource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "communityGalleryImageId": - err = unpopulate(val, "CommunityGalleryImageID", &g.CommunityGalleryImageID) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "virtualMachineId": - err = unpopulate(val, "VirtualMachineID", &g.VirtualMachineID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryArtifactVersionSource. -func (g GalleryArtifactVersionSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", g.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryArtifactVersionSource. -func (g *GalleryArtifactVersionSource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryDataDiskImage. -func (g GalleryDataDiskImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "hostCaching", g.HostCaching) - populate(objectMap, "lun", g.Lun) - populate(objectMap, "sizeInGB", g.SizeInGB) - populate(objectMap, "source", g.Source) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryDataDiskImage. -func (g *GalleryDataDiskImage) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "hostCaching": - err = unpopulate(val, "HostCaching", &g.HostCaching) - delete(rawMsg, key) - case "lun": - err = unpopulate(val, "Lun", &g.Lun) - delete(rawMsg, key) - case "sizeInGB": - err = unpopulate(val, "SizeInGB", &g.SizeInGB) - delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &g.Source) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryDiskImage. -func (g GalleryDiskImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "hostCaching", g.HostCaching) - populate(objectMap, "sizeInGB", g.SizeInGB) - populate(objectMap, "source", g.Source) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryDiskImage. -func (g *GalleryDiskImage) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "hostCaching": - err = unpopulate(val, "HostCaching", &g.HostCaching) - delete(rawMsg, key) - case "sizeInGB": - err = unpopulate(val, "SizeInGB", &g.SizeInGB) - delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &g.Source) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryDiskImageSource. -func (g GalleryDiskImageSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", g.ID) - populate(objectMap, "storageAccountId", g.StorageAccountID) - populate(objectMap, "uri", g.URI) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryDiskImageSource. -func (g *GalleryDiskImageSource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "storageAccountId": - err = unpopulate(val, "StorageAccountID", &g.StorageAccountID) - delete(rawMsg, key) - case "uri": - err = unpopulate(val, "URI", &g.URI) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryExtendedLocation. -func (g GalleryExtendedLocation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", g.Name) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryExtendedLocation. -func (g *GalleryExtendedLocation) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryIdentifier. -func (g GalleryIdentifier) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "uniqueName", g.UniqueName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryIdentifier. -func (g *GalleryIdentifier) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "uniqueName": - err = unpopulate(val, "UniqueName", &g.UniqueName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryImage. -func (g GalleryImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", g.ID) - populate(objectMap, "location", g.Location) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImage. -func (g *GalleryImage) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &g.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &g.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &g.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryImageFeature. -func (g GalleryImageFeature) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", g.Name) - populate(objectMap, "value", g.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageFeature. -func (g *GalleryImageFeature) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &g.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryImageIdentifier. -func (g GalleryImageIdentifier) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "offer", g.Offer) - populate(objectMap, "publisher", g.Publisher) - populate(objectMap, "sku", g.SKU) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageIdentifier. -func (g *GalleryImageIdentifier) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "offer": - err = unpopulate(val, "Offer", &g.Offer) - delete(rawMsg, key) - case "publisher": - err = unpopulate(val, "Publisher", &g.Publisher) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &g.SKU) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryImageList. -func (g GalleryImageList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", g.NextLink) - populate(objectMap, "value", g.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageList. -func (g *GalleryImageList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &g.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &g.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryImageProperties. -func (g GalleryImageProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "architecture", g.Architecture) - populate(objectMap, "description", g.Description) - populate(objectMap, "disallowed", g.Disallowed) - populateDateTimeRFC3339(objectMap, "endOfLifeDate", g.EndOfLifeDate) - populate(objectMap, "eula", g.Eula) - populate(objectMap, "features", g.Features) - populate(objectMap, "hyperVGeneration", g.HyperVGeneration) - populate(objectMap, "identifier", g.Identifier) - populate(objectMap, "osState", g.OSState) - populate(objectMap, "osType", g.OSType) - populate(objectMap, "privacyStatementUri", g.PrivacyStatementURI) - populate(objectMap, "provisioningState", g.ProvisioningState) - populate(objectMap, "purchasePlan", g.PurchasePlan) - populate(objectMap, "recommended", g.Recommended) - populate(objectMap, "releaseNoteUri", g.ReleaseNoteURI) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageProperties. -func (g *GalleryImageProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "architecture": - err = unpopulate(val, "Architecture", &g.Architecture) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &g.Description) - delete(rawMsg, key) - case "disallowed": - err = unpopulate(val, "Disallowed", &g.Disallowed) - delete(rawMsg, key) - case "endOfLifeDate": - err = unpopulateDateTimeRFC3339(val, "EndOfLifeDate", &g.EndOfLifeDate) - delete(rawMsg, key) - case "eula": - err = unpopulate(val, "Eula", &g.Eula) - delete(rawMsg, key) - case "features": - err = unpopulate(val, "Features", &g.Features) - delete(rawMsg, key) - case "hyperVGeneration": - err = unpopulate(val, "HyperVGeneration", &g.HyperVGeneration) - delete(rawMsg, key) - case "identifier": - err = unpopulate(val, "Identifier", &g.Identifier) - delete(rawMsg, key) - case "osState": - err = unpopulate(val, "OSState", &g.OSState) - delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &g.OSType) - delete(rawMsg, key) - case "privacyStatementUri": - err = unpopulate(val, "PrivacyStatementURI", &g.PrivacyStatementURI) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &g.ProvisioningState) - delete(rawMsg, key) - case "purchasePlan": - err = unpopulate(val, "PurchasePlan", &g.PurchasePlan) - delete(rawMsg, key) - case "recommended": - err = unpopulate(val, "Recommended", &g.Recommended) - delete(rawMsg, key) - case "releaseNoteUri": - err = unpopulate(val, "ReleaseNoteURI", &g.ReleaseNoteURI) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryImageUpdate. -func (g GalleryImageUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", g.ID) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageUpdate. -func (g *GalleryImageUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &g.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &g.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryImageVersion. -func (g GalleryImageVersion) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", g.ID) - populate(objectMap, "location", g.Location) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageVersion. -func (g *GalleryImageVersion) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &g.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &g.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &g.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryImageVersionList. -func (g GalleryImageVersionList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", g.NextLink) - populate(objectMap, "value", g.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageVersionList. -func (g *GalleryImageVersionList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &g.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &g.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryImageVersionProperties. -func (g GalleryImageVersionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "provisioningState", g.ProvisioningState) - populate(objectMap, "publishingProfile", g.PublishingProfile) - populate(objectMap, "replicationStatus", g.ReplicationStatus) - populate(objectMap, "safetyProfile", g.SafetyProfile) - populate(objectMap, "securityProfile", g.SecurityProfile) - populate(objectMap, "storageProfile", g.StorageProfile) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageVersionProperties. -func (g *GalleryImageVersionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &g.ProvisioningState) - delete(rawMsg, key) - case "publishingProfile": - err = unpopulate(val, "PublishingProfile", &g.PublishingProfile) - delete(rawMsg, key) - case "replicationStatus": - err = unpopulate(val, "ReplicationStatus", &g.ReplicationStatus) - delete(rawMsg, key) - case "safetyProfile": - err = unpopulate(val, "SafetyProfile", &g.SafetyProfile) - delete(rawMsg, key) - case "securityProfile": - err = unpopulate(val, "SecurityProfile", &g.SecurityProfile) - delete(rawMsg, key) - case "storageProfile": - err = unpopulate(val, "StorageProfile", &g.StorageProfile) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryImageVersionPublishingProfile. -func (g GalleryImageVersionPublishingProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "endOfLifeDate", g.EndOfLifeDate) - populate(objectMap, "excludeFromLatest", g.ExcludeFromLatest) - populateDateTimeRFC3339(objectMap, "publishedDate", g.PublishedDate) - populate(objectMap, "replicaCount", g.ReplicaCount) - populate(objectMap, "replicationMode", g.ReplicationMode) - populate(objectMap, "storageAccountType", g.StorageAccountType) - populate(objectMap, "targetExtendedLocations", g.TargetExtendedLocations) - populate(objectMap, "targetRegions", g.TargetRegions) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageVersionPublishingProfile. -func (g *GalleryImageVersionPublishingProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "endOfLifeDate": - err = unpopulateDateTimeRFC3339(val, "EndOfLifeDate", &g.EndOfLifeDate) - delete(rawMsg, key) - case "excludeFromLatest": - err = unpopulate(val, "ExcludeFromLatest", &g.ExcludeFromLatest) - delete(rawMsg, key) - case "publishedDate": - err = unpopulateDateTimeRFC3339(val, "PublishedDate", &g.PublishedDate) - delete(rawMsg, key) - case "replicaCount": - err = unpopulate(val, "ReplicaCount", &g.ReplicaCount) - delete(rawMsg, key) - case "replicationMode": - err = unpopulate(val, "ReplicationMode", &g.ReplicationMode) - delete(rawMsg, key) - case "storageAccountType": - err = unpopulate(val, "StorageAccountType", &g.StorageAccountType) - delete(rawMsg, key) - case "targetExtendedLocations": - err = unpopulate(val, "TargetExtendedLocations", &g.TargetExtendedLocations) - delete(rawMsg, key) - case "targetRegions": - err = unpopulate(val, "TargetRegions", &g.TargetRegions) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryImageVersionSafetyProfile. -func (g GalleryImageVersionSafetyProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "allowDeletionOfReplicatedLocations", g.AllowDeletionOfReplicatedLocations) - populate(objectMap, "policyViolations", g.PolicyViolations) - populate(objectMap, "reportedForPolicyViolation", g.ReportedForPolicyViolation) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageVersionSafetyProfile. -func (g *GalleryImageVersionSafetyProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "allowDeletionOfReplicatedLocations": - err = unpopulate(val, "AllowDeletionOfReplicatedLocations", &g.AllowDeletionOfReplicatedLocations) - delete(rawMsg, key) - case "policyViolations": - err = unpopulate(val, "PolicyViolations", &g.PolicyViolations) - delete(rawMsg, key) - case "reportedForPolicyViolation": - err = unpopulate(val, "ReportedForPolicyViolation", &g.ReportedForPolicyViolation) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryImageVersionStorageProfile. -func (g GalleryImageVersionStorageProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "dataDiskImages", g.DataDiskImages) - populate(objectMap, "osDiskImage", g.OSDiskImage) - populate(objectMap, "source", g.Source) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageVersionStorageProfile. -func (g *GalleryImageVersionStorageProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dataDiskImages": - err = unpopulate(val, "DataDiskImages", &g.DataDiskImages) - delete(rawMsg, key) - case "osDiskImage": - err = unpopulate(val, "OSDiskImage", &g.OSDiskImage) - delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &g.Source) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryImageVersionUefiSettings. -func (g GalleryImageVersionUefiSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "additionalSignatures", g.AdditionalSignatures) - populate(objectMap, "signatureTemplateNames", g.SignatureTemplateNames) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageVersionUefiSettings. -func (g *GalleryImageVersionUefiSettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "additionalSignatures": - err = unpopulate(val, "AdditionalSignatures", &g.AdditionalSignatures) - delete(rawMsg, key) - case "signatureTemplateNames": - err = unpopulate(val, "SignatureTemplateNames", &g.SignatureTemplateNames) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryImageVersionUpdate. -func (g GalleryImageVersionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", g.ID) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageVersionUpdate. -func (g *GalleryImageVersionUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &g.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &g.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryList. -func (g GalleryList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", g.NextLink) - populate(objectMap, "value", g.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryList. -func (g *GalleryList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &g.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &g.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryOSDiskImage. -func (g GalleryOSDiskImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "hostCaching", g.HostCaching) - populate(objectMap, "sizeInGB", g.SizeInGB) - populate(objectMap, "source", g.Source) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryOSDiskImage. -func (g *GalleryOSDiskImage) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "hostCaching": - err = unpopulate(val, "HostCaching", &g.HostCaching) - delete(rawMsg, key) - case "sizeInGB": - err = unpopulate(val, "SizeInGB", &g.SizeInGB) - delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &g.Source) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryProperties. -func (g GalleryProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "description", g.Description) - populate(objectMap, "identifier", g.Identifier) - populate(objectMap, "provisioningState", g.ProvisioningState) - populate(objectMap, "sharingProfile", g.SharingProfile) - populate(objectMap, "sharingStatus", g.SharingStatus) - populate(objectMap, "softDeletePolicy", g.SoftDeletePolicy) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryProperties. -func (g *GalleryProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, "Description", &g.Description) - delete(rawMsg, key) - case "identifier": - err = unpopulate(val, "Identifier", &g.Identifier) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &g.ProvisioningState) - delete(rawMsg, key) - case "sharingProfile": - err = unpopulate(val, "SharingProfile", &g.SharingProfile) - delete(rawMsg, key) - case "sharingStatus": - err = unpopulate(val, "SharingStatus", &g.SharingStatus) - delete(rawMsg, key) - case "softDeletePolicy": - err = unpopulate(val, "SoftDeletePolicy", &g.SoftDeletePolicy) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryTargetExtendedLocation. -func (g GalleryTargetExtendedLocation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "encryption", g.Encryption) - populate(objectMap, "extendedLocation", g.ExtendedLocation) - populate(objectMap, "extendedLocationReplicaCount", g.ExtendedLocationReplicaCount) - populate(objectMap, "name", g.Name) - populate(objectMap, "storageAccountType", g.StorageAccountType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryTargetExtendedLocation. -func (g *GalleryTargetExtendedLocation) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "encryption": - err = unpopulate(val, "Encryption", &g.Encryption) - delete(rawMsg, key) - case "extendedLocation": - err = unpopulate(val, "ExtendedLocation", &g.ExtendedLocation) - delete(rawMsg, key) - case "extendedLocationReplicaCount": - err = unpopulate(val, "ExtendedLocationReplicaCount", &g.ExtendedLocationReplicaCount) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "storageAccountType": - err = unpopulate(val, "StorageAccountType", &g.StorageAccountType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryUpdate. -func (g GalleryUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", g.ID) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryUpdate. -func (g *GalleryUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &g.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &g.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GrantAccessData. -func (g GrantAccessData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "access", g.Access) - populate(objectMap, "durationInSeconds", g.DurationInSeconds) - populate(objectMap, "fileFormat", g.FileFormat) - populate(objectMap, "getSecureVMGuestStateSAS", g.GetSecureVMGuestStateSAS) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GrantAccessData. -func (g *GrantAccessData) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "access": - err = unpopulate(val, "Access", &g.Access) - delete(rawMsg, key) - case "durationInSeconds": - err = unpopulate(val, "DurationInSeconds", &g.DurationInSeconds) - delete(rawMsg, key) - case "fileFormat": - err = unpopulate(val, "FileFormat", &g.FileFormat) - delete(rawMsg, key) - case "getSecureVMGuestStateSAS": - err = unpopulate(val, "GetSecureVMGuestStateSAS", &g.GetSecureVMGuestStateSAS) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type HardwareProfile. -func (h HardwareProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "vmSize", h.VMSize) - populate(objectMap, "vmSizeProperties", h.VMSizeProperties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type HardwareProfile. -func (h *HardwareProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "vmSize": - err = unpopulate(val, "VMSize", &h.VMSize) - delete(rawMsg, key) - case "vmSizeProperties": - err = unpopulate(val, "VMSizeProperties", &h.VMSizeProperties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Image. -func (i Image) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "extendedLocation", i.ExtendedLocation) - populate(objectMap, "id", i.ID) - populate(objectMap, "location", i.Location) - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "tags", i.Tags) - populate(objectMap, "type", i.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Image. -func (i *Image) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "extendedLocation": - err = unpopulate(val, "ExtendedLocation", &i.ExtendedLocation) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &i.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &i.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &i.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &i.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &i.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ImageDataDisk. -func (i ImageDataDisk) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "blobUri", i.BlobURI) - populate(objectMap, "caching", i.Caching) - populate(objectMap, "diskEncryptionSet", i.DiskEncryptionSet) - populate(objectMap, "diskSizeGB", i.DiskSizeGB) - populate(objectMap, "lun", i.Lun) - populate(objectMap, "managedDisk", i.ManagedDisk) - populate(objectMap, "snapshot", i.Snapshot) - populate(objectMap, "storageAccountType", i.StorageAccountType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageDataDisk. -func (i *ImageDataDisk) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "blobUri": - err = unpopulate(val, "BlobURI", &i.BlobURI) - delete(rawMsg, key) - case "caching": - err = unpopulate(val, "Caching", &i.Caching) - delete(rawMsg, key) - case "diskEncryptionSet": - err = unpopulate(val, "DiskEncryptionSet", &i.DiskEncryptionSet) - delete(rawMsg, key) - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &i.DiskSizeGB) - delete(rawMsg, key) - case "lun": - err = unpopulate(val, "Lun", &i.Lun) - delete(rawMsg, key) - case "managedDisk": - err = unpopulate(val, "ManagedDisk", &i.ManagedDisk) - delete(rawMsg, key) - case "snapshot": - err = unpopulate(val, "Snapshot", &i.Snapshot) - delete(rawMsg, key) - case "storageAccountType": - err = unpopulate(val, "StorageAccountType", &i.StorageAccountType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ImageDeprecationStatus. -func (i ImageDeprecationStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "alternativeOption", i.AlternativeOption) - populate(objectMap, "imageState", i.ImageState) - populateDateTimeRFC3339(objectMap, "scheduledDeprecationTime", i.ScheduledDeprecationTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageDeprecationStatus. -func (i *ImageDeprecationStatus) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "alternativeOption": - err = unpopulate(val, "AlternativeOption", &i.AlternativeOption) - delete(rawMsg, key) - case "imageState": - err = unpopulate(val, "ImageState", &i.ImageState) - delete(rawMsg, key) - case "scheduledDeprecationTime": - err = unpopulateDateTimeRFC3339(val, "ScheduledDeprecationTime", &i.ScheduledDeprecationTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ImageDisk. -func (i ImageDisk) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "blobUri", i.BlobURI) - populate(objectMap, "caching", i.Caching) - populate(objectMap, "diskEncryptionSet", i.DiskEncryptionSet) - populate(objectMap, "diskSizeGB", i.DiskSizeGB) - populate(objectMap, "managedDisk", i.ManagedDisk) - populate(objectMap, "snapshot", i.Snapshot) - populate(objectMap, "storageAccountType", i.StorageAccountType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageDisk. -func (i *ImageDisk) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "blobUri": - err = unpopulate(val, "BlobURI", &i.BlobURI) - delete(rawMsg, key) - case "caching": - err = unpopulate(val, "Caching", &i.Caching) - delete(rawMsg, key) - case "diskEncryptionSet": - err = unpopulate(val, "DiskEncryptionSet", &i.DiskEncryptionSet) - delete(rawMsg, key) - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &i.DiskSizeGB) - delete(rawMsg, key) - case "managedDisk": - err = unpopulate(val, "ManagedDisk", &i.ManagedDisk) - delete(rawMsg, key) - case "snapshot": - err = unpopulate(val, "Snapshot", &i.Snapshot) - delete(rawMsg, key) - case "storageAccountType": - err = unpopulate(val, "StorageAccountType", &i.StorageAccountType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ImageDiskReference. -func (i ImageDiskReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "communityGalleryImageId", i.CommunityGalleryImageID) - populate(objectMap, "id", i.ID) - populate(objectMap, "lun", i.Lun) - populate(objectMap, "sharedGalleryImageId", i.SharedGalleryImageID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageDiskReference. -func (i *ImageDiskReference) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "communityGalleryImageId": - err = unpopulate(val, "CommunityGalleryImageID", &i.CommunityGalleryImageID) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &i.ID) - delete(rawMsg, key) - case "lun": - err = unpopulate(val, "Lun", &i.Lun) - delete(rawMsg, key) - case "sharedGalleryImageId": - err = unpopulate(val, "SharedGalleryImageID", &i.SharedGalleryImageID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ImageListResult. -func (i ImageListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", i.NextLink) - populate(objectMap, "value", i.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageListResult. -func (i *ImageListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &i.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &i.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ImageOSDisk. -func (i ImageOSDisk) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "blobUri", i.BlobURI) - populate(objectMap, "caching", i.Caching) - populate(objectMap, "diskEncryptionSet", i.DiskEncryptionSet) - populate(objectMap, "diskSizeGB", i.DiskSizeGB) - populate(objectMap, "managedDisk", i.ManagedDisk) - populate(objectMap, "osState", i.OSState) - populate(objectMap, "osType", i.OSType) - populate(objectMap, "snapshot", i.Snapshot) - populate(objectMap, "storageAccountType", i.StorageAccountType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageOSDisk. -func (i *ImageOSDisk) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "blobUri": - err = unpopulate(val, "BlobURI", &i.BlobURI) - delete(rawMsg, key) - case "caching": - err = unpopulate(val, "Caching", &i.Caching) - delete(rawMsg, key) - case "diskEncryptionSet": - err = unpopulate(val, "DiskEncryptionSet", &i.DiskEncryptionSet) - delete(rawMsg, key) - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &i.DiskSizeGB) - delete(rawMsg, key) - case "managedDisk": - err = unpopulate(val, "ManagedDisk", &i.ManagedDisk) - delete(rawMsg, key) - case "osState": - err = unpopulate(val, "OSState", &i.OSState) - delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &i.OSType) - delete(rawMsg, key) - case "snapshot": - err = unpopulate(val, "Snapshot", &i.Snapshot) - delete(rawMsg, key) - case "storageAccountType": - err = unpopulate(val, "StorageAccountType", &i.StorageAccountType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ImageProperties. -func (i ImageProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "hyperVGeneration", i.HyperVGeneration) - populate(objectMap, "provisioningState", i.ProvisioningState) - populate(objectMap, "sourceVirtualMachine", i.SourceVirtualMachine) - populate(objectMap, "storageProfile", i.StorageProfile) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageProperties. -func (i *ImageProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "hyperVGeneration": - err = unpopulate(val, "HyperVGeneration", &i.HyperVGeneration) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) - delete(rawMsg, key) - case "sourceVirtualMachine": - err = unpopulate(val, "SourceVirtualMachine", &i.SourceVirtualMachine) - delete(rawMsg, key) - case "storageProfile": - err = unpopulate(val, "StorageProfile", &i.StorageProfile) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ImagePurchasePlan. -func (i ImagePurchasePlan) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", i.Name) - populate(objectMap, "product", i.Product) - populate(objectMap, "publisher", i.Publisher) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ImagePurchasePlan. -func (i *ImagePurchasePlan) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &i.Name) - delete(rawMsg, key) - case "product": - err = unpopulate(val, "Product", &i.Product) - delete(rawMsg, key) - case "publisher": - err = unpopulate(val, "Publisher", &i.Publisher) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ImageReference. -func (i ImageReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "communityGalleryImageId", i.CommunityGalleryImageID) - populate(objectMap, "exactVersion", i.ExactVersion) - populate(objectMap, "id", i.ID) - populate(objectMap, "offer", i.Offer) - populate(objectMap, "publisher", i.Publisher) - populate(objectMap, "sku", i.SKU) - populate(objectMap, "sharedGalleryImageId", i.SharedGalleryImageID) - populate(objectMap, "version", i.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageReference. -func (i *ImageReference) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "communityGalleryImageId": - err = unpopulate(val, "CommunityGalleryImageID", &i.CommunityGalleryImageID) - delete(rawMsg, key) - case "exactVersion": - err = unpopulate(val, "ExactVersion", &i.ExactVersion) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &i.ID) - delete(rawMsg, key) - case "offer": - err = unpopulate(val, "Offer", &i.Offer) - delete(rawMsg, key) - case "publisher": - err = unpopulate(val, "Publisher", &i.Publisher) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &i.SKU) - delete(rawMsg, key) - case "sharedGalleryImageId": - err = unpopulate(val, "SharedGalleryImageID", &i.SharedGalleryImageID) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &i.Version) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ImageStorageProfile. -func (i ImageStorageProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "dataDisks", i.DataDisks) - populate(objectMap, "osDisk", i.OSDisk) - populate(objectMap, "zoneResilient", i.ZoneResilient) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageStorageProfile. -func (i *ImageStorageProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dataDisks": - err = unpopulate(val, "DataDisks", &i.DataDisks) - delete(rawMsg, key) - case "osDisk": - err = unpopulate(val, "OSDisk", &i.OSDisk) - delete(rawMsg, key) - case "zoneResilient": - err = unpopulate(val, "ZoneResilient", &i.ZoneResilient) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ImageUpdate. -func (i ImageUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "tags", i.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageUpdate. -func (i *ImageUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &i.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &i.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ImageVersionSecurityProfile. -func (i ImageVersionSecurityProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "uefiSettings", i.UefiSettings) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageVersionSecurityProfile. -func (i *ImageVersionSecurityProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "uefiSettings": - err = unpopulate(val, "UefiSettings", &i.UefiSettings) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type InnerError. -func (i InnerError) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "errordetail", i.Errordetail) - populate(objectMap, "exceptiontype", i.Exceptiontype) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type InnerError. -func (i *InnerError) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "errordetail": - err = unpopulate(val, "Errordetail", &i.Errordetail) - delete(rawMsg, key) - case "exceptiontype": - err = unpopulate(val, "Exceptiontype", &i.Exceptiontype) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type InstanceSKU. -func (i InstanceSKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", i.Name) - populate(objectMap, "tier", i.Tier) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type InstanceSKU. -func (i *InstanceSKU) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &i.Name) - delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &i.Tier) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type InstanceViewStatus. -func (i InstanceViewStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "code", i.Code) - populate(objectMap, "displayStatus", i.DisplayStatus) - populate(objectMap, "level", i.Level) - populate(objectMap, "message", i.Message) - populateDateTimeRFC3339(objectMap, "time", i.Time) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type InstanceViewStatus. -func (i *InstanceViewStatus) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "code": - err = unpopulate(val, "Code", &i.Code) - delete(rawMsg, key) - case "displayStatus": - err = unpopulate(val, "DisplayStatus", &i.DisplayStatus) - delete(rawMsg, key) - case "level": - err = unpopulate(val, "Level", &i.Level) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &i.Message) - delete(rawMsg, key) - case "time": - err = unpopulateDateTimeRFC3339(val, "Time", &i.Time) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type InstanceViewStatusesSummary. -func (i InstanceViewStatusesSummary) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "statusesSummary", i.StatusesSummary) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type InstanceViewStatusesSummary. -func (i *InstanceViewStatusesSummary) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "statusesSummary": - err = unpopulate(val, "StatusesSummary", &i.StatusesSummary) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type KeyForDiskEncryptionSet. -func (k KeyForDiskEncryptionSet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "keyUrl", k.KeyURL) - populate(objectMap, "sourceVault", k.SourceVault) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type KeyForDiskEncryptionSet. -func (k *KeyForDiskEncryptionSet) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "keyUrl": - err = unpopulate(val, "KeyURL", &k.KeyURL) - delete(rawMsg, key) - case "sourceVault": - err = unpopulate(val, "SourceVault", &k.SourceVault) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type KeyVaultAndKeyReference. -func (k KeyVaultAndKeyReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "keyUrl", k.KeyURL) - populate(objectMap, "sourceVault", k.SourceVault) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultAndKeyReference. -func (k *KeyVaultAndKeyReference) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "keyUrl": - err = unpopulate(val, "KeyURL", &k.KeyURL) - delete(rawMsg, key) - case "sourceVault": - err = unpopulate(val, "SourceVault", &k.SourceVault) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type KeyVaultAndSecretReference. -func (k KeyVaultAndSecretReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "secretUrl", k.SecretURL) - populate(objectMap, "sourceVault", k.SourceVault) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultAndSecretReference. -func (k *KeyVaultAndSecretReference) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "secretUrl": - err = unpopulate(val, "SecretURL", &k.SecretURL) - delete(rawMsg, key) - case "sourceVault": - err = unpopulate(val, "SourceVault", &k.SourceVault) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type KeyVaultKeyReference. -func (k KeyVaultKeyReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "keyUrl", k.KeyURL) - populate(objectMap, "sourceVault", k.SourceVault) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultKeyReference. -func (k *KeyVaultKeyReference) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "keyUrl": - err = unpopulate(val, "KeyURL", &k.KeyURL) - delete(rawMsg, key) - case "sourceVault": - err = unpopulate(val, "SourceVault", &k.SourceVault) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type KeyVaultSecretReference. -func (k KeyVaultSecretReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "secretUrl", k.SecretURL) - populate(objectMap, "sourceVault", k.SourceVault) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultSecretReference. -func (k *KeyVaultSecretReference) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "secretUrl": - err = unpopulate(val, "SecretURL", &k.SecretURL) - delete(rawMsg, key) - case "sourceVault": - err = unpopulate(val, "SourceVault", &k.SourceVault) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LastPatchInstallationSummary. -func (l LastPatchInstallationSummary) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "error", l.Error) - populate(objectMap, "excludedPatchCount", l.ExcludedPatchCount) - populate(objectMap, "failedPatchCount", l.FailedPatchCount) - populate(objectMap, "installationActivityId", l.InstallationActivityID) - populate(objectMap, "installedPatchCount", l.InstalledPatchCount) - populateDateTimeRFC3339(objectMap, "lastModifiedTime", l.LastModifiedTime) - populate(objectMap, "maintenanceWindowExceeded", l.MaintenanceWindowExceeded) - populate(objectMap, "notSelectedPatchCount", l.NotSelectedPatchCount) - populate(objectMap, "pendingPatchCount", l.PendingPatchCount) - populateDateTimeRFC3339(objectMap, "startTime", l.StartTime) - populate(objectMap, "status", l.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LastPatchInstallationSummary. -func (l *LastPatchInstallationSummary) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "error": - err = unpopulate(val, "Error", &l.Error) - delete(rawMsg, key) - case "excludedPatchCount": - err = unpopulate(val, "ExcludedPatchCount", &l.ExcludedPatchCount) - delete(rawMsg, key) - case "failedPatchCount": - err = unpopulate(val, "FailedPatchCount", &l.FailedPatchCount) - delete(rawMsg, key) - case "installationActivityId": - err = unpopulate(val, "InstallationActivityID", &l.InstallationActivityID) - delete(rawMsg, key) - case "installedPatchCount": - err = unpopulate(val, "InstalledPatchCount", &l.InstalledPatchCount) - delete(rawMsg, key) - case "lastModifiedTime": - err = unpopulateDateTimeRFC3339(val, "LastModifiedTime", &l.LastModifiedTime) - delete(rawMsg, key) - case "maintenanceWindowExceeded": - err = unpopulate(val, "MaintenanceWindowExceeded", &l.MaintenanceWindowExceeded) - delete(rawMsg, key) - case "notSelectedPatchCount": - err = unpopulate(val, "NotSelectedPatchCount", &l.NotSelectedPatchCount) - delete(rawMsg, key) - case "pendingPatchCount": - err = unpopulate(val, "PendingPatchCount", &l.PendingPatchCount) - delete(rawMsg, key) - case "startTime": - err = unpopulateDateTimeRFC3339(val, "StartTime", &l.StartTime) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &l.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LatestGalleryImageVersion. -func (l LatestGalleryImageVersion) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "latestVersionName", l.LatestVersionName) - populate(objectMap, "location", l.Location) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LatestGalleryImageVersion. -func (l *LatestGalleryImageVersion) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "latestVersionName": - err = unpopulate(val, "LatestVersionName", &l.LatestVersionName) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &l.Location) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LinuxConfiguration. -func (l LinuxConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "disablePasswordAuthentication", l.DisablePasswordAuthentication) - populate(objectMap, "enableVMAgentPlatformUpdates", l.EnableVMAgentPlatformUpdates) - populate(objectMap, "patchSettings", l.PatchSettings) - populate(objectMap, "provisionVMAgent", l.ProvisionVMAgent) - populate(objectMap, "ssh", l.SSH) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LinuxConfiguration. -func (l *LinuxConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "disablePasswordAuthentication": - err = unpopulate(val, "DisablePasswordAuthentication", &l.DisablePasswordAuthentication) - delete(rawMsg, key) - case "enableVMAgentPlatformUpdates": - err = unpopulate(val, "EnableVMAgentPlatformUpdates", &l.EnableVMAgentPlatformUpdates) - delete(rawMsg, key) - case "patchSettings": - err = unpopulate(val, "PatchSettings", &l.PatchSettings) - delete(rawMsg, key) - case "provisionVMAgent": - err = unpopulate(val, "ProvisionVMAgent", &l.ProvisionVMAgent) - delete(rawMsg, key) - case "ssh": - err = unpopulate(val, "SSH", &l.SSH) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LinuxParameters. -func (l LinuxParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "classificationsToInclude", l.ClassificationsToInclude) - populate(objectMap, "maintenanceRunId", l.MaintenanceRunID) - populate(objectMap, "packageNameMasksToExclude", l.PackageNameMasksToExclude) - populate(objectMap, "packageNameMasksToInclude", l.PackageNameMasksToInclude) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LinuxParameters. -func (l *LinuxParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "classificationsToInclude": - err = unpopulate(val, "ClassificationsToInclude", &l.ClassificationsToInclude) - delete(rawMsg, key) - case "maintenanceRunId": - err = unpopulate(val, "MaintenanceRunID", &l.MaintenanceRunID) - delete(rawMsg, key) - case "packageNameMasksToExclude": - err = unpopulate(val, "PackageNameMasksToExclude", &l.PackageNameMasksToExclude) - delete(rawMsg, key) - case "packageNameMasksToInclude": - err = unpopulate(val, "PackageNameMasksToInclude", &l.PackageNameMasksToInclude) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LinuxPatchSettings. -func (l LinuxPatchSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "assessmentMode", l.AssessmentMode) - populate(objectMap, "automaticByPlatformSettings", l.AutomaticByPlatformSettings) - populate(objectMap, "patchMode", l.PatchMode) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LinuxPatchSettings. -func (l *LinuxPatchSettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "assessmentMode": - err = unpopulate(val, "AssessmentMode", &l.AssessmentMode) - delete(rawMsg, key) - case "automaticByPlatformSettings": - err = unpopulate(val, "AutomaticByPlatformSettings", &l.AutomaticByPlatformSettings) - delete(rawMsg, key) - case "patchMode": - err = unpopulate(val, "PatchMode", &l.PatchMode) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LinuxVMGuestPatchAutomaticByPlatformSettings. -func (l LinuxVMGuestPatchAutomaticByPlatformSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "bypassPlatformSafetyChecksOnUserSchedule", l.BypassPlatformSafetyChecksOnUserSchedule) - populate(objectMap, "rebootSetting", l.RebootSetting) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LinuxVMGuestPatchAutomaticByPlatformSettings. -func (l *LinuxVMGuestPatchAutomaticByPlatformSettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "bypassPlatformSafetyChecksOnUserSchedule": - err = unpopulate(val, "BypassPlatformSafetyChecksOnUserSchedule", &l.BypassPlatformSafetyChecksOnUserSchedule) - delete(rawMsg, key) - case "rebootSetting": - err = unpopulate(val, "RebootSetting", &l.RebootSetting) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ListUsagesResult. -func (l ListUsagesResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ListUsagesResult. -func (l *ListUsagesResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &l.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &l.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LoadBalancerConfiguration. -func (l LoadBalancerConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", l.ID) - populate(objectMap, "name", l.Name) - populate(objectMap, "properties", l.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerConfiguration. -func (l *LoadBalancerConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &l.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &l.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &l.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LoadBalancerConfigurationProperties. -func (l LoadBalancerConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "frontendIpConfigurations", l.FrontendIPConfigurations) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerConfigurationProperties. -func (l *LoadBalancerConfigurationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "frontendIpConfigurations": - err = unpopulate(val, "FrontendIPConfigurations", &l.FrontendIPConfigurations) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LoadBalancerFrontendIPConfiguration. -func (l LoadBalancerFrontendIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", l.Name) - populate(objectMap, "properties", l.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerFrontendIPConfiguration. -func (l *LoadBalancerFrontendIPConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &l.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &l.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LoadBalancerFrontendIPConfigurationProperties. -func (l LoadBalancerFrontendIPConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "privateIPAddress", l.PrivateIPAddress) - populate(objectMap, "publicIPAddress", l.PublicIPAddress) - populate(objectMap, "subnet", l.Subnet) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerFrontendIPConfigurationProperties. -func (l *LoadBalancerFrontendIPConfigurationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "privateIPAddress": - err = unpopulate(val, "PrivateIPAddress", &l.PrivateIPAddress) - delete(rawMsg, key) - case "publicIPAddress": - err = unpopulate(val, "PublicIPAddress", &l.PublicIPAddress) - delete(rawMsg, key) - case "subnet": - err = unpopulate(val, "Subnet", &l.Subnet) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LogAnalyticsInputBase. -func (l LogAnalyticsInputBase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "blobContainerSasUri", l.BlobContainerSasURI) - populateDateTimeRFC3339(objectMap, "fromTime", l.FromTime) - populate(objectMap, "groupByClientApplicationId", l.GroupByClientApplicationID) - populate(objectMap, "groupByOperationName", l.GroupByOperationName) - populate(objectMap, "groupByResourceName", l.GroupByResourceName) - populate(objectMap, "groupByThrottlePolicy", l.GroupByThrottlePolicy) - populate(objectMap, "groupByUserAgent", l.GroupByUserAgent) - populateDateTimeRFC3339(objectMap, "toTime", l.ToTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsInputBase. -func (l *LogAnalyticsInputBase) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "blobContainerSasUri": - err = unpopulate(val, "BlobContainerSasURI", &l.BlobContainerSasURI) - delete(rawMsg, key) - case "fromTime": - err = unpopulateDateTimeRFC3339(val, "FromTime", &l.FromTime) - delete(rawMsg, key) - case "groupByClientApplicationId": - err = unpopulate(val, "GroupByClientApplicationID", &l.GroupByClientApplicationID) - delete(rawMsg, key) - case "groupByOperationName": - err = unpopulate(val, "GroupByOperationName", &l.GroupByOperationName) - delete(rawMsg, key) - case "groupByResourceName": - err = unpopulate(val, "GroupByResourceName", &l.GroupByResourceName) - delete(rawMsg, key) - case "groupByThrottlePolicy": - err = unpopulate(val, "GroupByThrottlePolicy", &l.GroupByThrottlePolicy) - delete(rawMsg, key) - case "groupByUserAgent": - err = unpopulate(val, "GroupByUserAgent", &l.GroupByUserAgent) - delete(rawMsg, key) - case "toTime": - err = unpopulateDateTimeRFC3339(val, "ToTime", &l.ToTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LogAnalyticsOperationResult. -func (l LogAnalyticsOperationResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", l.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsOperationResult. -func (l *LogAnalyticsOperationResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &l.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LogAnalyticsOutput. -func (l LogAnalyticsOutput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "output", l.Output) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsOutput. -func (l *LogAnalyticsOutput) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "output": - err = unpopulate(val, "Output", &l.Output) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MaintenanceRedeployStatus. -func (m MaintenanceRedeployStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "isCustomerInitiatedMaintenanceAllowed", m.IsCustomerInitiatedMaintenanceAllowed) - populate(objectMap, "lastOperationMessage", m.LastOperationMessage) - populate(objectMap, "lastOperationResultCode", m.LastOperationResultCode) - populateDateTimeRFC3339(objectMap, "maintenanceWindowEndTime", m.MaintenanceWindowEndTime) - populateDateTimeRFC3339(objectMap, "maintenanceWindowStartTime", m.MaintenanceWindowStartTime) - populateDateTimeRFC3339(objectMap, "preMaintenanceWindowEndTime", m.PreMaintenanceWindowEndTime) - populateDateTimeRFC3339(objectMap, "preMaintenanceWindowStartTime", m.PreMaintenanceWindowStartTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MaintenanceRedeployStatus. -func (m *MaintenanceRedeployStatus) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "isCustomerInitiatedMaintenanceAllowed": - err = unpopulate(val, "IsCustomerInitiatedMaintenanceAllowed", &m.IsCustomerInitiatedMaintenanceAllowed) - delete(rawMsg, key) - case "lastOperationMessage": - err = unpopulate(val, "LastOperationMessage", &m.LastOperationMessage) - delete(rawMsg, key) - case "lastOperationResultCode": - err = unpopulate(val, "LastOperationResultCode", &m.LastOperationResultCode) - delete(rawMsg, key) - case "maintenanceWindowEndTime": - err = unpopulateDateTimeRFC3339(val, "MaintenanceWindowEndTime", &m.MaintenanceWindowEndTime) - delete(rawMsg, key) - case "maintenanceWindowStartTime": - err = unpopulateDateTimeRFC3339(val, "MaintenanceWindowStartTime", &m.MaintenanceWindowStartTime) - delete(rawMsg, key) - case "preMaintenanceWindowEndTime": - err = unpopulateDateTimeRFC3339(val, "PreMaintenanceWindowEndTime", &m.PreMaintenanceWindowEndTime) - delete(rawMsg, key) - case "preMaintenanceWindowStartTime": - err = unpopulateDateTimeRFC3339(val, "PreMaintenanceWindowStartTime", &m.PreMaintenanceWindowStartTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedArtifact. -func (m ManagedArtifact) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", m.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedArtifact. -func (m *ManagedArtifact) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &m.ID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedDiskParameters. -func (m ManagedDiskParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "diskEncryptionSet", m.DiskEncryptionSet) - populate(objectMap, "id", m.ID) - populate(objectMap, "securityProfile", m.SecurityProfile) - populate(objectMap, "storageAccountType", m.StorageAccountType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDiskParameters. -func (m *ManagedDiskParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "diskEncryptionSet": - err = unpopulate(val, "DiskEncryptionSet", &m.DiskEncryptionSet) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &m.ID) - delete(rawMsg, key) - case "securityProfile": - err = unpopulate(val, "SecurityProfile", &m.SecurityProfile) - delete(rawMsg, key) - case "storageAccountType": - err = unpopulate(val, "StorageAccountType", &m.StorageAccountType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type NetworkInterfaceReference. -func (n NetworkInterfaceReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", n.ID) - populate(objectMap, "properties", n.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkInterfaceReference. -func (n *NetworkInterfaceReference) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &n.ID) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &n.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type NetworkInterfaceReferenceProperties. -func (n NetworkInterfaceReferenceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "deleteOption", n.DeleteOption) - populate(objectMap, "primary", n.Primary) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkInterfaceReferenceProperties. -func (n *NetworkInterfaceReferenceProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "deleteOption": - err = unpopulate(val, "DeleteOption", &n.DeleteOption) - delete(rawMsg, key) - case "primary": - err = unpopulate(val, "Primary", &n.Primary) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type NetworkProfile. -func (n NetworkProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "networkApiVersion", n.NetworkAPIVersion) - populate(objectMap, "networkInterfaceConfigurations", n.NetworkInterfaceConfigurations) - populate(objectMap, "networkInterfaces", n.NetworkInterfaces) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkProfile. -func (n *NetworkProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "networkApiVersion": - err = unpopulate(val, "NetworkAPIVersion", &n.NetworkAPIVersion) - delete(rawMsg, key) - case "networkInterfaceConfigurations": - err = unpopulate(val, "NetworkInterfaceConfigurations", &n.NetworkInterfaceConfigurations) - delete(rawMsg, key) - case "networkInterfaces": - err = unpopulate(val, "NetworkInterfaces", &n.NetworkInterfaces) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OSDisk. -func (o OSDisk) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "caching", o.Caching) - populate(objectMap, "createOption", o.CreateOption) - populate(objectMap, "deleteOption", o.DeleteOption) - populate(objectMap, "diffDiskSettings", o.DiffDiskSettings) - populate(objectMap, "diskSizeGB", o.DiskSizeGB) - populate(objectMap, "encryptionSettings", o.EncryptionSettings) - populate(objectMap, "image", o.Image) - populate(objectMap, "managedDisk", o.ManagedDisk) - populate(objectMap, "name", o.Name) - populate(objectMap, "osType", o.OSType) - populate(objectMap, "vhd", o.Vhd) - populate(objectMap, "writeAcceleratorEnabled", o.WriteAcceleratorEnabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OSDisk. -func (o *OSDisk) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "caching": - err = unpopulate(val, "Caching", &o.Caching) - delete(rawMsg, key) - case "createOption": - err = unpopulate(val, "CreateOption", &o.CreateOption) - delete(rawMsg, key) - case "deleteOption": - err = unpopulate(val, "DeleteOption", &o.DeleteOption) - delete(rawMsg, key) - case "diffDiskSettings": - err = unpopulate(val, "DiffDiskSettings", &o.DiffDiskSettings) - delete(rawMsg, key) - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &o.DiskSizeGB) - delete(rawMsg, key) - case "encryptionSettings": - err = unpopulate(val, "EncryptionSettings", &o.EncryptionSettings) - delete(rawMsg, key) - case "image": - err = unpopulate(val, "Image", &o.Image) - delete(rawMsg, key) - case "managedDisk": - err = unpopulate(val, "ManagedDisk", &o.ManagedDisk) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) - delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &o.OSType) - delete(rawMsg, key) - case "vhd": - err = unpopulate(val, "Vhd", &o.Vhd) - delete(rawMsg, key) - case "writeAcceleratorEnabled": - err = unpopulate(val, "WriteAcceleratorEnabled", &o.WriteAcceleratorEnabled) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OSDiskImage. -func (o OSDiskImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "operatingSystem", o.OperatingSystem) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OSDiskImage. -func (o *OSDiskImage) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "operatingSystem": - err = unpopulate(val, "OperatingSystem", &o.OperatingSystem) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OSDiskImageEncryption. -func (o OSDiskImageEncryption) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "diskEncryptionSetId", o.DiskEncryptionSetID) - populate(objectMap, "securityProfile", o.SecurityProfile) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OSDiskImageEncryption. -func (o *OSDiskImageEncryption) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "diskEncryptionSetId": - err = unpopulate(val, "DiskEncryptionSetID", &o.DiskEncryptionSetID) - delete(rawMsg, key) - case "securityProfile": - err = unpopulate(val, "SecurityProfile", &o.SecurityProfile) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OSDiskImageSecurityProfile. -func (o OSDiskImageSecurityProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "confidentialVMEncryptionType", o.ConfidentialVMEncryptionType) - populate(objectMap, "secureVMDiskEncryptionSetId", o.SecureVMDiskEncryptionSetID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OSDiskImageSecurityProfile. -func (o *OSDiskImageSecurityProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "confidentialVMEncryptionType": - err = unpopulate(val, "ConfidentialVMEncryptionType", &o.ConfidentialVMEncryptionType) - delete(rawMsg, key) - case "secureVMDiskEncryptionSetId": - err = unpopulate(val, "SecureVMDiskEncryptionSetID", &o.SecureVMDiskEncryptionSetID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OSFamily. -func (o OSFamily) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", o.ID) - populate(objectMap, "location", o.Location) - populate(objectMap, "name", o.Name) - populate(objectMap, "properties", o.Properties) - populate(objectMap, "type", o.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OSFamily. -func (o *OSFamily) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &o.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &o.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &o.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &o.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OSFamilyListResult. -func (o OSFamilyListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", o.NextLink) - populate(objectMap, "value", o.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OSFamilyListResult. -func (o *OSFamilyListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &o.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &o.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OSFamilyProperties. -func (o OSFamilyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "label", o.Label) - populate(objectMap, "name", o.Name) - populate(objectMap, "versions", o.Versions) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OSFamilyProperties. -func (o *OSFamilyProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "label": - err = unpopulate(val, "Label", &o.Label) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) - delete(rawMsg, key) - case "versions": - err = unpopulate(val, "Versions", &o.Versions) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OSImageNotificationProfile. -func (o OSImageNotificationProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "enable", o.Enable) - populate(objectMap, "notBeforeTimeout", o.NotBeforeTimeout) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OSImageNotificationProfile. -func (o *OSImageNotificationProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enable": - err = unpopulate(val, "Enable", &o.Enable) - delete(rawMsg, key) - case "notBeforeTimeout": - err = unpopulate(val, "NotBeforeTimeout", &o.NotBeforeTimeout) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OSProfile. -func (o OSProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "adminPassword", o.AdminPassword) - populate(objectMap, "adminUsername", o.AdminUsername) - populate(objectMap, "allowExtensionOperations", o.AllowExtensionOperations) - populate(objectMap, "computerName", o.ComputerName) - populate(objectMap, "customData", o.CustomData) - populate(objectMap, "linuxConfiguration", o.LinuxConfiguration) - populate(objectMap, "requireGuestProvisionSignal", o.RequireGuestProvisionSignal) - populate(objectMap, "secrets", o.Secrets) - populate(objectMap, "windowsConfiguration", o.WindowsConfiguration) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OSProfile. -func (o *OSProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "adminPassword": - err = unpopulate(val, "AdminPassword", &o.AdminPassword) - delete(rawMsg, key) - case "adminUsername": - err = unpopulate(val, "AdminUsername", &o.AdminUsername) - delete(rawMsg, key) - case "allowExtensionOperations": - err = unpopulate(val, "AllowExtensionOperations", &o.AllowExtensionOperations) - delete(rawMsg, key) - case "computerName": - err = unpopulate(val, "ComputerName", &o.ComputerName) - delete(rawMsg, key) - case "customData": - err = unpopulate(val, "CustomData", &o.CustomData) - delete(rawMsg, key) - case "linuxConfiguration": - err = unpopulate(val, "LinuxConfiguration", &o.LinuxConfiguration) - delete(rawMsg, key) - case "requireGuestProvisionSignal": - err = unpopulate(val, "RequireGuestProvisionSignal", &o.RequireGuestProvisionSignal) - delete(rawMsg, key) - case "secrets": - err = unpopulate(val, "Secrets", &o.Secrets) - delete(rawMsg, key) - case "windowsConfiguration": - err = unpopulate(val, "WindowsConfiguration", &o.WindowsConfiguration) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OSProfileProvisioningData. -func (o OSProfileProvisioningData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "adminPassword", o.AdminPassword) - populate(objectMap, "customData", o.CustomData) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OSProfileProvisioningData. -func (o *OSProfileProvisioningData) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "adminPassword": - err = unpopulate(val, "AdminPassword", &o.AdminPassword) - delete(rawMsg, key) - case "customData": - err = unpopulate(val, "CustomData", &o.CustomData) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OSVersion. -func (o OSVersion) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", o.ID) - populate(objectMap, "location", o.Location) - populate(objectMap, "name", o.Name) - populate(objectMap, "properties", o.Properties) - populate(objectMap, "type", o.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OSVersion. -func (o *OSVersion) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &o.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &o.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &o.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &o.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OSVersionListResult. -func (o OSVersionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", o.NextLink) - populate(objectMap, "value", o.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OSVersionListResult. -func (o *OSVersionListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &o.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &o.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OSVersionProperties. -func (o OSVersionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "family", o.Family) - populate(objectMap, "familyLabel", o.FamilyLabel) - populate(objectMap, "isActive", o.IsActive) - populate(objectMap, "isDefault", o.IsDefault) - populate(objectMap, "label", o.Label) - populate(objectMap, "version", o.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OSVersionProperties. -func (o *OSVersionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "family": - err = unpopulate(val, "Family", &o.Family) - delete(rawMsg, key) - case "familyLabel": - err = unpopulate(val, "FamilyLabel", &o.FamilyLabel) - delete(rawMsg, key) - case "isActive": - err = unpopulate(val, "IsActive", &o.IsActive) - delete(rawMsg, key) - case "isDefault": - err = unpopulate(val, "IsDefault", &o.IsDefault) - delete(rawMsg, key) - case "label": - err = unpopulate(val, "Label", &o.Label) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &o.Version) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OSVersionPropertiesBase. -func (o OSVersionPropertiesBase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "isActive", o.IsActive) - populate(objectMap, "isDefault", o.IsDefault) - populate(objectMap, "label", o.Label) - populate(objectMap, "version", o.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OSVersionPropertiesBase. -func (o *OSVersionPropertiesBase) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "isActive": - err = unpopulate(val, "IsActive", &o.IsActive) - delete(rawMsg, key) - case "isDefault": - err = unpopulate(val, "IsDefault", &o.IsDefault) - delete(rawMsg, key) - case "label": - err = unpopulate(val, "Label", &o.Label) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &o.Version) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OperationListResult. -func (o OperationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "value", o.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. -func (o *OperationListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "value": - err = unpopulate(val, "Value", &o.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OperationValue. -func (o OperationValue) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "display", o.Display) - populate(objectMap, "name", o.Name) - populate(objectMap, "origin", o.Origin) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationValue. -func (o *OperationValue) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "display": - err = unpopulate(val, "Display", &o.Display) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) - delete(rawMsg, key) - case "origin": - err = unpopulate(val, "Origin", &o.Origin) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OperationValueDisplay. -func (o OperationValueDisplay) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "description", o.Description) - populate(objectMap, "operation", o.Operation) - populate(objectMap, "provider", o.Provider) - populate(objectMap, "resource", o.Resource) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationValueDisplay. -func (o *OperationValueDisplay) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, "Description", &o.Description) - delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &o.Operation) - delete(rawMsg, key) - case "provider": - err = unpopulate(val, "Provider", &o.Provider) - delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &o.Resource) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OrchestrationServiceStateInput. -func (o OrchestrationServiceStateInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "action", o.Action) - populate(objectMap, "serviceName", o.ServiceName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OrchestrationServiceStateInput. -func (o *OrchestrationServiceStateInput) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "action": - err = unpopulate(val, "Action", &o.Action) - delete(rawMsg, key) - case "serviceName": - err = unpopulate(val, "ServiceName", &o.ServiceName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OrchestrationServiceSummary. -func (o OrchestrationServiceSummary) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "serviceName", o.ServiceName) - populate(objectMap, "serviceState", o.ServiceState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OrchestrationServiceSummary. -func (o *OrchestrationServiceSummary) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "serviceName": - err = unpopulate(val, "ServiceName", &o.ServiceName) - delete(rawMsg, key) - case "serviceState": - err = unpopulate(val, "ServiceState", &o.ServiceState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PatchInstallationDetail. -func (p PatchInstallationDetail) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "classifications", p.Classifications) - populate(objectMap, "installationState", p.InstallationState) - populate(objectMap, "kbId", p.KbID) - populate(objectMap, "name", p.Name) - populate(objectMap, "patchId", p.PatchID) - populate(objectMap, "version", p.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PatchInstallationDetail. -func (p *PatchInstallationDetail) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "classifications": - err = unpopulate(val, "Classifications", &p.Classifications) - delete(rawMsg, key) - case "installationState": - err = unpopulate(val, "InstallationState", &p.InstallationState) - delete(rawMsg, key) - case "kbId": - err = unpopulate(val, "KbID", &p.KbID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "patchId": - err = unpopulate(val, "PatchID", &p.PatchID) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &p.Version) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PatchSettings. -func (p PatchSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "assessmentMode", p.AssessmentMode) - populate(objectMap, "automaticByPlatformSettings", p.AutomaticByPlatformSettings) - populate(objectMap, "enableHotpatching", p.EnableHotpatching) - populate(objectMap, "patchMode", p.PatchMode) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PatchSettings. -func (p *PatchSettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "assessmentMode": - err = unpopulate(val, "AssessmentMode", &p.AssessmentMode) - delete(rawMsg, key) - case "automaticByPlatformSettings": - err = unpopulate(val, "AutomaticByPlatformSettings", &p.AutomaticByPlatformSettings) - delete(rawMsg, key) - case "enableHotpatching": - err = unpopulate(val, "EnableHotpatching", &p.EnableHotpatching) - delete(rawMsg, key) - case "patchMode": - err = unpopulate(val, "PatchMode", &p.PatchMode) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PirCommunityGalleryResource. -func (p PirCommunityGalleryResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "identifier", p.Identifier) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PirCommunityGalleryResource. -func (p *PirCommunityGalleryResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "identifier": - err = unpopulate(val, "Identifier", &p.Identifier) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &p.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PirResource. -func (p PirResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PirResource. -func (p *PirResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "location": - err = unpopulate(val, "Location", &p.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PirSharedGalleryResource. -func (p PirSharedGalleryResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "identifier", p.Identifier) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PirSharedGalleryResource. -func (p *PirSharedGalleryResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "identifier": - err = unpopulate(val, "Identifier", &p.Identifier) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &p.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Plan. -func (p Plan) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", p.Name) - populate(objectMap, "product", p.Product) - populate(objectMap, "promotionCode", p.PromotionCode) - populate(objectMap, "publisher", p.Publisher) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Plan. -func (p *Plan) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "product": - err = unpopulate(val, "Product", &p.Product) - delete(rawMsg, key) - case "promotionCode": - err = unpopulate(val, "PromotionCode", &p.PromotionCode) - delete(rawMsg, key) - case "publisher": - err = unpopulate(val, "Publisher", &p.Publisher) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PolicyViolation. -func (p PolicyViolation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "category", p.Category) - populate(objectMap, "details", p.Details) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PolicyViolation. -func (p *PolicyViolation) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "category": - err = unpopulate(val, "Category", &p.Category) - delete(rawMsg, key) - case "details": - err = unpopulate(val, "Details", &p.Details) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PriorityMixPolicy. -func (p PriorityMixPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "baseRegularPriorityCount", p.BaseRegularPriorityCount) - populate(objectMap, "regularPriorityPercentageAboveBase", p.RegularPriorityPercentageAboveBase) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PriorityMixPolicy. -func (p *PriorityMixPolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "baseRegularPriorityCount": - err = unpopulate(val, "BaseRegularPriorityCount", &p.BaseRegularPriorityCount) - delete(rawMsg, key) - case "regularPriorityPercentageAboveBase": - err = unpopulate(val, "RegularPriorityPercentageAboveBase", &p.RegularPriorityPercentageAboveBase) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpoint. -func (p PrivateEndpoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpoint. -func (p *PrivateEndpoint) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection. -func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection. -func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult. -func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResult. -func (p *PrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &p.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties. -func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "privateEndpoint", p.PrivateEndpoint) - populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) - populate(objectMap, "provisioningState", p.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties. -func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "privateEndpoint": - err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) - delete(rawMsg, key) - case "privateLinkServiceConnectionState": - err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource. -func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource. -func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult. -func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "value", p.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceListResult. -func (p *PrivateLinkResourceListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "value": - err = unpopulate(val, "Value", &p.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. -func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "groupId", p.GroupID) - populate(objectMap, "requiredMembers", p.RequiredMembers) - populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties. -func (p *PrivateLinkResourceProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "groupId": - err = unpopulate(val, "GroupID", &p.GroupID) - delete(rawMsg, key) - case "requiredMembers": - err = unpopulate(val, "RequiredMembers", &p.RequiredMembers) - delete(rawMsg, key) - case "requiredZoneNames": - err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionState. -func (p PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "actionsRequired", p.ActionsRequired) - populate(objectMap, "description", p.Description) - populate(objectMap, "status", p.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionState. -func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "actionsRequired": - err = unpopulate(val, "ActionsRequired", &p.ActionsRequired) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &p.Description) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &p.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PropertyUpdatesInProgress. -func (p PropertyUpdatesInProgress) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "targetTier", p.TargetTier) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PropertyUpdatesInProgress. -func (p *PropertyUpdatesInProgress) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "targetTier": - err = unpopulate(val, "TargetTier", &p.TargetTier) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ProximityPlacementGroup. -func (p ProximityPlacementGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "tags", p.Tags) - populate(objectMap, "type", p.Type) - populate(objectMap, "zones", p.Zones) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ProximityPlacementGroup. -func (p *ProximityPlacementGroup) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &p.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &p.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &p.Zones) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ProximityPlacementGroupListResult. -func (p ProximityPlacementGroupListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ProximityPlacementGroupListResult. -func (p *ProximityPlacementGroupListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &p.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ProximityPlacementGroupProperties. -func (p ProximityPlacementGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "availabilitySets", p.AvailabilitySets) - populate(objectMap, "colocationStatus", p.ColocationStatus) - populate(objectMap, "intent", p.Intent) - populate(objectMap, "proximityPlacementGroupType", p.ProximityPlacementGroupType) - populate(objectMap, "virtualMachineScaleSets", p.VirtualMachineScaleSets) - populate(objectMap, "virtualMachines", p.VirtualMachines) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ProximityPlacementGroupProperties. -func (p *ProximityPlacementGroupProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "availabilitySets": - err = unpopulate(val, "AvailabilitySets", &p.AvailabilitySets) - delete(rawMsg, key) - case "colocationStatus": - err = unpopulate(val, "ColocationStatus", &p.ColocationStatus) - delete(rawMsg, key) - case "intent": - err = unpopulate(val, "Intent", &p.Intent) - delete(rawMsg, key) - case "proximityPlacementGroupType": - err = unpopulate(val, "ProximityPlacementGroupType", &p.ProximityPlacementGroupType) - delete(rawMsg, key) - case "virtualMachineScaleSets": - err = unpopulate(val, "VirtualMachineScaleSets", &p.VirtualMachineScaleSets) - delete(rawMsg, key) - case "virtualMachines": - err = unpopulate(val, "VirtualMachines", &p.VirtualMachines) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ProximityPlacementGroupPropertiesIntent. -func (p ProximityPlacementGroupPropertiesIntent) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "vmSizes", p.VMSizes) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ProximityPlacementGroupPropertiesIntent. -func (p *ProximityPlacementGroupPropertiesIntent) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "vmSizes": - err = unpopulate(val, "VMSizes", &p.VMSizes) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ProximityPlacementGroupUpdate. -func (p ProximityPlacementGroupUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "tags", p.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ProximityPlacementGroupUpdate. -func (p *ProximityPlacementGroupUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "tags": - err = unpopulate(val, "Tags", &p.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ProxyAgentSettings. -func (p ProxyAgentSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "enabled", p.Enabled) - populate(objectMap, "keyIncarnationId", p.KeyIncarnationID) - populate(objectMap, "mode", p.Mode) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyAgentSettings. -func (p *ProxyAgentSettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enabled": - err = unpopulate(val, "Enabled", &p.Enabled) - delete(rawMsg, key) - case "keyIncarnationId": - err = unpopulate(val, "KeyIncarnationID", &p.KeyIncarnationID) - delete(rawMsg, key) - case "mode": - err = unpopulate(val, "Mode", &p.Mode) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ProxyOnlyResource. -func (p ProxyOnlyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyOnlyResource. -func (p *ProxyOnlyResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ProxyResource. -func (p ProxyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. -func (p *ProxyResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PublicIPAddressSKU. -func (p PublicIPAddressSKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", p.Name) - populate(objectMap, "tier", p.Tier) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PublicIPAddressSKU. -func (p *PublicIPAddressSKU) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &p.Tier) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PurchasePlan. -func (p PurchasePlan) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", p.Name) - populate(objectMap, "product", p.Product) - populate(objectMap, "publisher", p.Publisher) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PurchasePlan. -func (p *PurchasePlan) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "product": - err = unpopulate(val, "Product", &p.Product) - delete(rawMsg, key) - case "publisher": - err = unpopulate(val, "Publisher", &p.Publisher) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RecommendedMachineConfiguration. -func (r RecommendedMachineConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "memory", r.Memory) - populate(objectMap, "vCPUs", r.VCPUs) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedMachineConfiguration. -func (r *RecommendedMachineConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "memory": - err = unpopulate(val, "Memory", &r.Memory) - delete(rawMsg, key) - case "vCPUs": - err = unpopulate(val, "VCPUs", &r.VCPUs) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RecoveryWalkResponse. -func (r RecoveryWalkResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextPlatformUpdateDomain", r.NextPlatformUpdateDomain) - populate(objectMap, "walkPerformed", r.WalkPerformed) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RecoveryWalkResponse. -func (r *RecoveryWalkResponse) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextPlatformUpdateDomain": - err = unpopulate(val, "NextPlatformUpdateDomain", &r.NextPlatformUpdateDomain) - delete(rawMsg, key) - case "walkPerformed": - err = unpopulate(val, "WalkPerformed", &r.WalkPerformed) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RegionalReplicationStatus. -func (r RegionalReplicationStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "details", r.Details) - populate(objectMap, "progress", r.Progress) - populate(objectMap, "region", r.Region) - populate(objectMap, "state", r.State) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RegionalReplicationStatus. -func (r *RegionalReplicationStatus) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "details": - err = unpopulate(val, "Details", &r.Details) - delete(rawMsg, key) - case "progress": - err = unpopulate(val, "Progress", &r.Progress) - delete(rawMsg, key) - case "region": - err = unpopulate(val, "Region", &r.Region) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &r.State) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RegionalSharingStatus. -func (r RegionalSharingStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "details", r.Details) - populate(objectMap, "region", r.Region) - populate(objectMap, "state", r.State) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RegionalSharingStatus. -func (r *RegionalSharingStatus) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "details": - err = unpopulate(val, "Details", &r.Details) - delete(rawMsg, key) - case "region": - err = unpopulate(val, "Region", &r.Region) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &r.State) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ReplicationStatus. -func (r ReplicationStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "aggregatedState", r.AggregatedState) - populate(objectMap, "summary", r.Summary) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationStatus. -func (r *ReplicationStatus) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "aggregatedState": - err = unpopulate(val, "AggregatedState", &r.AggregatedState) - delete(rawMsg, key) - case "summary": - err = unpopulate(val, "Summary", &r.Summary) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RequestRateByIntervalInput. -func (r RequestRateByIntervalInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "blobContainerSasUri", r.BlobContainerSasURI) - populateDateTimeRFC3339(objectMap, "fromTime", r.FromTime) - populate(objectMap, "groupByClientApplicationId", r.GroupByClientApplicationID) - populate(objectMap, "groupByOperationName", r.GroupByOperationName) - populate(objectMap, "groupByResourceName", r.GroupByResourceName) - populate(objectMap, "groupByThrottlePolicy", r.GroupByThrottlePolicy) - populate(objectMap, "groupByUserAgent", r.GroupByUserAgent) - populate(objectMap, "intervalLength", r.IntervalLength) - populateDateTimeRFC3339(objectMap, "toTime", r.ToTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RequestRateByIntervalInput. -func (r *RequestRateByIntervalInput) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "blobContainerSasUri": - err = unpopulate(val, "BlobContainerSasURI", &r.BlobContainerSasURI) - delete(rawMsg, key) - case "fromTime": - err = unpopulateDateTimeRFC3339(val, "FromTime", &r.FromTime) - delete(rawMsg, key) - case "groupByClientApplicationId": - err = unpopulate(val, "GroupByClientApplicationID", &r.GroupByClientApplicationID) - delete(rawMsg, key) - case "groupByOperationName": - err = unpopulate(val, "GroupByOperationName", &r.GroupByOperationName) - delete(rawMsg, key) - case "groupByResourceName": - err = unpopulate(val, "GroupByResourceName", &r.GroupByResourceName) - delete(rawMsg, key) - case "groupByThrottlePolicy": - err = unpopulate(val, "GroupByThrottlePolicy", &r.GroupByThrottlePolicy) - delete(rawMsg, key) - case "groupByUserAgent": - err = unpopulate(val, "GroupByUserAgent", &r.GroupByUserAgent) - delete(rawMsg, key) - case "intervalLength": - err = unpopulate(val, "IntervalLength", &r.IntervalLength) - delete(rawMsg, key) - case "toTime": - err = unpopulateDateTimeRFC3339(val, "ToTime", &r.ToTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResiliencyPolicy. -func (r ResiliencyPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "resilientVMCreationPolicy", r.ResilientVMCreationPolicy) - populate(objectMap, "resilientVMDeletionPolicy", r.ResilientVMDeletionPolicy) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResiliencyPolicy. -func (r *ResiliencyPolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "resilientVMCreationPolicy": - err = unpopulate(val, "ResilientVMCreationPolicy", &r.ResilientVMCreationPolicy) - delete(rawMsg, key) - case "resilientVMDeletionPolicy": - err = unpopulate(val, "ResilientVMDeletionPolicy", &r.ResilientVMDeletionPolicy) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResilientVMCreationPolicy. -func (r ResilientVMCreationPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "enabled", r.Enabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResilientVMCreationPolicy. -func (r *ResilientVMCreationPolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enabled": - err = unpopulate(val, "Enabled", &r.Enabled) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResilientVMDeletionPolicy. -func (r ResilientVMDeletionPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "enabled", r.Enabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResilientVMDeletionPolicy. -func (r *ResilientVMDeletionPolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enabled": - err = unpopulate(val, "Enabled", &r.Enabled) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Resource. -func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. -func (r *Resource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &r.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceInstanceViewStatus. -func (r ResourceInstanceViewStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "code", r.Code) - populate(objectMap, "displayStatus", r.DisplayStatus) - populate(objectMap, "level", r.Level) - populate(objectMap, "message", r.Message) - populateDateTimeRFC3339(objectMap, "time", r.Time) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceInstanceViewStatus. -func (r *ResourceInstanceViewStatus) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "code": - err = unpopulate(val, "Code", &r.Code) - delete(rawMsg, key) - case "displayStatus": - err = unpopulate(val, "DisplayStatus", &r.DisplayStatus) - delete(rawMsg, key) - case "level": - err = unpopulate(val, "Level", &r.Level) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &r.Message) - delete(rawMsg, key) - case "time": - err = unpopulateDateTimeRFC3339(val, "Time", &r.Time) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceRange. -func (r ResourceRange) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "max", r.Max) - populate(objectMap, "min", r.Min) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceRange. -func (r *ResourceRange) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "max": - err = unpopulate(val, "Max", &r.Max) - delete(rawMsg, key) - case "min": - err = unpopulate(val, "Min", &r.Min) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceSKU. -func (r ResourceSKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "apiVersions", r.APIVersions) - populate(objectMap, "capabilities", r.Capabilities) - populate(objectMap, "capacity", r.Capacity) - populate(objectMap, "costs", r.Costs) - populate(objectMap, "family", r.Family) - populate(objectMap, "kind", r.Kind) - populate(objectMap, "locationInfo", r.LocationInfo) - populate(objectMap, "locations", r.Locations) - populate(objectMap, "name", r.Name) - populate(objectMap, "resourceType", r.ResourceType) - populate(objectMap, "restrictions", r.Restrictions) - populate(objectMap, "size", r.Size) - populate(objectMap, "tier", r.Tier) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKU. -func (r *ResourceSKU) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "apiVersions": - err = unpopulate(val, "APIVersions", &r.APIVersions) - delete(rawMsg, key) - case "capabilities": - err = unpopulate(val, "Capabilities", &r.Capabilities) - delete(rawMsg, key) - case "capacity": - err = unpopulate(val, "Capacity", &r.Capacity) - delete(rawMsg, key) - case "costs": - err = unpopulate(val, "Costs", &r.Costs) - delete(rawMsg, key) - case "family": - err = unpopulate(val, "Family", &r.Family) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &r.Kind) - delete(rawMsg, key) - case "locationInfo": - err = unpopulate(val, "LocationInfo", &r.LocationInfo) - delete(rawMsg, key) - case "locations": - err = unpopulate(val, "Locations", &r.Locations) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "resourceType": - err = unpopulate(val, "ResourceType", &r.ResourceType) - delete(rawMsg, key) - case "restrictions": - err = unpopulate(val, "Restrictions", &r.Restrictions) - delete(rawMsg, key) - case "size": - err = unpopulate(val, "Size", &r.Size) - delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &r.Tier) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceSKUCapabilities. -func (r ResourceSKUCapabilities) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", r.Name) - populate(objectMap, "value", r.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKUCapabilities. -func (r *ResourceSKUCapabilities) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceSKUCapacity. -func (r ResourceSKUCapacity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "default", r.Default) - populate(objectMap, "maximum", r.Maximum) - populate(objectMap, "minimum", r.Minimum) - populate(objectMap, "scaleType", r.ScaleType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKUCapacity. -func (r *ResourceSKUCapacity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "default": - err = unpopulate(val, "Default", &r.Default) - delete(rawMsg, key) - case "maximum": - err = unpopulate(val, "Maximum", &r.Maximum) - delete(rawMsg, key) - case "minimum": - err = unpopulate(val, "Minimum", &r.Minimum) - delete(rawMsg, key) - case "scaleType": - err = unpopulate(val, "ScaleType", &r.ScaleType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceSKUCosts. -func (r ResourceSKUCosts) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "extendedUnit", r.ExtendedUnit) - populate(objectMap, "meterID", r.MeterID) - populate(objectMap, "quantity", r.Quantity) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKUCosts. -func (r *ResourceSKUCosts) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "extendedUnit": - err = unpopulate(val, "ExtendedUnit", &r.ExtendedUnit) - delete(rawMsg, key) - case "meterID": - err = unpopulate(val, "MeterID", &r.MeterID) - delete(rawMsg, key) - case "quantity": - err = unpopulate(val, "Quantity", &r.Quantity) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceSKULocationInfo. -func (r ResourceSKULocationInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "extendedLocations", r.ExtendedLocations) - populate(objectMap, "location", r.Location) - populate(objectMap, "type", r.Type) - populate(objectMap, "zoneDetails", r.ZoneDetails) - populate(objectMap, "zones", r.Zones) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKULocationInfo. -func (r *ResourceSKULocationInfo) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "extendedLocations": - err = unpopulate(val, "ExtendedLocations", &r.ExtendedLocations) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) - case "zoneDetails": - err = unpopulate(val, "ZoneDetails", &r.ZoneDetails) - delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &r.Zones) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceSKURestrictionInfo. -func (r ResourceSKURestrictionInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "locations", r.Locations) - populate(objectMap, "zones", r.Zones) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKURestrictionInfo. -func (r *ResourceSKURestrictionInfo) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "locations": - err = unpopulate(val, "Locations", &r.Locations) - delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &r.Zones) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceSKURestrictions. -func (r ResourceSKURestrictions) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "reasonCode", r.ReasonCode) - populate(objectMap, "restrictionInfo", r.RestrictionInfo) - populate(objectMap, "type", r.Type) - populate(objectMap, "values", r.Values) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKURestrictions. -func (r *ResourceSKURestrictions) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "reasonCode": - err = unpopulate(val, "ReasonCode", &r.ReasonCode) - delete(rawMsg, key) - case "restrictionInfo": - err = unpopulate(val, "RestrictionInfo", &r.RestrictionInfo) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) - case "values": - err = unpopulate(val, "Values", &r.Values) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceSKUZoneDetails. -func (r ResourceSKUZoneDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "capabilities", r.Capabilities) - populate(objectMap, "name", r.Name) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKUZoneDetails. -func (r *ResourceSKUZoneDetails) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "capabilities": - err = unpopulate(val, "Capabilities", &r.Capabilities) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceSKUsResult. -func (r ResourceSKUsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", r.NextLink) - populate(objectMap, "value", r.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKUsResult. -func (r *ResourceSKUsResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &r.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceSharingProfile. -func (r ResourceSharingProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "subscriptionIds", r.SubscriptionIDs) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSharingProfile. -func (r *ResourceSharingProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "subscriptionIds": - err = unpopulate(val, "SubscriptionIDs", &r.SubscriptionIDs) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceURIList. -func (r ResourceURIList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", r.NextLink) - populate(objectMap, "value", r.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceURIList. -func (r *ResourceURIList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &r.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceWithOptionalLocation. -func (r ResourceWithOptionalLocation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceWithOptionalLocation. -func (r *ResourceWithOptionalLocation) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &r.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RestorePoint. -func (r RestorePoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePoint. -func (r *RestorePoint) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &r.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RestorePointCollection. -func (r RestorePointCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointCollection. -func (r *RestorePointCollection) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &r.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &r.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RestorePointCollectionListResult. -func (r RestorePointCollectionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", r.NextLink) - populate(objectMap, "value", r.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointCollectionListResult. -func (r *RestorePointCollectionListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &r.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RestorePointCollectionProperties. -func (r RestorePointCollectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "provisioningState", r.ProvisioningState) - populate(objectMap, "restorePointCollectionId", r.RestorePointCollectionID) - populate(objectMap, "restorePoints", r.RestorePoints) - populate(objectMap, "source", r.Source) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointCollectionProperties. -func (r *RestorePointCollectionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) - delete(rawMsg, key) - case "restorePointCollectionId": - err = unpopulate(val, "RestorePointCollectionID", &r.RestorePointCollectionID) - delete(rawMsg, key) - case "restorePoints": - err = unpopulate(val, "RestorePoints", &r.RestorePoints) - delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &r.Source) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RestorePointCollectionSourceProperties. -func (r RestorePointCollectionSourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointCollectionSourceProperties. -func (r *RestorePointCollectionSourceProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RestorePointCollectionUpdate. -func (r RestorePointCollectionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "tags", r.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointCollectionUpdate. -func (r *RestorePointCollectionUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &r.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &r.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RestorePointEncryption. -func (r RestorePointEncryption) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "diskEncryptionSet", r.DiskEncryptionSet) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointEncryption. -func (r *RestorePointEncryption) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "diskEncryptionSet": - err = unpopulate(val, "DiskEncryptionSet", &r.DiskEncryptionSet) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RestorePointInstanceView. -func (r RestorePointInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "diskRestorePoints", r.DiskRestorePoints) - populate(objectMap, "statuses", r.Statuses) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointInstanceView. -func (r *RestorePointInstanceView) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "diskRestorePoints": - err = unpopulate(val, "DiskRestorePoints", &r.DiskRestorePoints) - delete(rawMsg, key) - case "statuses": - err = unpopulate(val, "Statuses", &r.Statuses) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RestorePointProperties. -func (r RestorePointProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "consistencyMode", r.ConsistencyMode) - populate(objectMap, "excludeDisks", r.ExcludeDisks) - populate(objectMap, "instanceView", r.InstanceView) - populate(objectMap, "provisioningState", r.ProvisioningState) - populate(objectMap, "sourceMetadata", r.SourceMetadata) - populate(objectMap, "sourceRestorePoint", r.SourceRestorePoint) - populateDateTimeRFC3339(objectMap, "timeCreated", r.TimeCreated) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointProperties. -func (r *RestorePointProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "consistencyMode": - err = unpopulate(val, "ConsistencyMode", &r.ConsistencyMode) - delete(rawMsg, key) - case "excludeDisks": - err = unpopulate(val, "ExcludeDisks", &r.ExcludeDisks) - delete(rawMsg, key) - case "instanceView": - err = unpopulate(val, "InstanceView", &r.InstanceView) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) - delete(rawMsg, key) - case "sourceMetadata": - err = unpopulate(val, "SourceMetadata", &r.SourceMetadata) - delete(rawMsg, key) - case "sourceRestorePoint": - err = unpopulate(val, "SourceRestorePoint", &r.SourceRestorePoint) - delete(rawMsg, key) - case "timeCreated": - err = unpopulateDateTimeRFC3339(val, "TimeCreated", &r.TimeCreated) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RestorePointSourceMetadata. -func (r RestorePointSourceMetadata) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "diagnosticsProfile", r.DiagnosticsProfile) - populate(objectMap, "hardwareProfile", r.HardwareProfile) - populate(objectMap, "hyperVGeneration", r.HyperVGeneration) - populate(objectMap, "licenseType", r.LicenseType) - populate(objectMap, "location", r.Location) - populate(objectMap, "osProfile", r.OSProfile) - populate(objectMap, "securityProfile", r.SecurityProfile) - populate(objectMap, "storageProfile", r.StorageProfile) - populate(objectMap, "userData", r.UserData) - populate(objectMap, "vmId", r.VMID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointSourceMetadata. -func (r *RestorePointSourceMetadata) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "diagnosticsProfile": - err = unpopulate(val, "DiagnosticsProfile", &r.DiagnosticsProfile) - delete(rawMsg, key) - case "hardwareProfile": - err = unpopulate(val, "HardwareProfile", &r.HardwareProfile) - delete(rawMsg, key) - case "hyperVGeneration": - err = unpopulate(val, "HyperVGeneration", &r.HyperVGeneration) - delete(rawMsg, key) - case "licenseType": - err = unpopulate(val, "LicenseType", &r.LicenseType) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) - delete(rawMsg, key) - case "osProfile": - err = unpopulate(val, "OSProfile", &r.OSProfile) - delete(rawMsg, key) - case "securityProfile": - err = unpopulate(val, "SecurityProfile", &r.SecurityProfile) - delete(rawMsg, key) - case "storageProfile": - err = unpopulate(val, "StorageProfile", &r.StorageProfile) - delete(rawMsg, key) - case "userData": - err = unpopulate(val, "UserData", &r.UserData) - delete(rawMsg, key) - case "vmId": - err = unpopulate(val, "VMID", &r.VMID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RestorePointSourceVMDataDisk. -func (r RestorePointSourceVMDataDisk) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "caching", r.Caching) - populate(objectMap, "diskRestorePoint", r.DiskRestorePoint) - populate(objectMap, "diskSizeGB", r.DiskSizeGB) - populate(objectMap, "lun", r.Lun) - populate(objectMap, "managedDisk", r.ManagedDisk) - populate(objectMap, "name", r.Name) - populate(objectMap, "writeAcceleratorEnabled", r.WriteAcceleratorEnabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointSourceVMDataDisk. -func (r *RestorePointSourceVMDataDisk) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "caching": - err = unpopulate(val, "Caching", &r.Caching) - delete(rawMsg, key) - case "diskRestorePoint": - err = unpopulate(val, "DiskRestorePoint", &r.DiskRestorePoint) - delete(rawMsg, key) - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &r.DiskSizeGB) - delete(rawMsg, key) - case "lun": - err = unpopulate(val, "Lun", &r.Lun) - delete(rawMsg, key) - case "managedDisk": - err = unpopulate(val, "ManagedDisk", &r.ManagedDisk) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "writeAcceleratorEnabled": - err = unpopulate(val, "WriteAcceleratorEnabled", &r.WriteAcceleratorEnabled) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RestorePointSourceVMOSDisk. -func (r RestorePointSourceVMOSDisk) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "caching", r.Caching) - populate(objectMap, "diskRestorePoint", r.DiskRestorePoint) - populate(objectMap, "diskSizeGB", r.DiskSizeGB) - populate(objectMap, "encryptionSettings", r.EncryptionSettings) - populate(objectMap, "managedDisk", r.ManagedDisk) - populate(objectMap, "name", r.Name) - populate(objectMap, "osType", r.OSType) - populate(objectMap, "writeAcceleratorEnabled", r.WriteAcceleratorEnabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointSourceVMOSDisk. -func (r *RestorePointSourceVMOSDisk) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "caching": - err = unpopulate(val, "Caching", &r.Caching) - delete(rawMsg, key) - case "diskRestorePoint": - err = unpopulate(val, "DiskRestorePoint", &r.DiskRestorePoint) - delete(rawMsg, key) - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &r.DiskSizeGB) - delete(rawMsg, key) - case "encryptionSettings": - err = unpopulate(val, "EncryptionSettings", &r.EncryptionSettings) - delete(rawMsg, key) - case "managedDisk": - err = unpopulate(val, "ManagedDisk", &r.ManagedDisk) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &r.OSType) - delete(rawMsg, key) - case "writeAcceleratorEnabled": - err = unpopulate(val, "WriteAcceleratorEnabled", &r.WriteAcceleratorEnabled) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RestorePointSourceVMStorageProfile. -func (r RestorePointSourceVMStorageProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "dataDisks", r.DataDisks) - populate(objectMap, "diskControllerType", r.DiskControllerType) - populate(objectMap, "osDisk", r.OSDisk) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointSourceVMStorageProfile. -func (r *RestorePointSourceVMStorageProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dataDisks": - err = unpopulate(val, "DataDisks", &r.DataDisks) - delete(rawMsg, key) - case "diskControllerType": - err = unpopulate(val, "DiskControllerType", &r.DiskControllerType) - delete(rawMsg, key) - case "osDisk": - err = unpopulate(val, "OSDisk", &r.OSDisk) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RetrieveBootDiagnosticsDataResult. -func (r RetrieveBootDiagnosticsDataResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "consoleScreenshotBlobUri", r.ConsoleScreenshotBlobURI) - populate(objectMap, "serialConsoleLogBlobUri", r.SerialConsoleLogBlobURI) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RetrieveBootDiagnosticsDataResult. -func (r *RetrieveBootDiagnosticsDataResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "consoleScreenshotBlobUri": - err = unpopulate(val, "ConsoleScreenshotBlobURI", &r.ConsoleScreenshotBlobURI) - delete(rawMsg, key) - case "serialConsoleLogBlobUri": - err = unpopulate(val, "SerialConsoleLogBlobURI", &r.SerialConsoleLogBlobURI) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RoleInstance. -func (r RoleInstance) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "sku", r.SKU) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RoleInstance. -func (r *RoleInstance) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &r.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &r.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &r.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RoleInstanceListResult. -func (r RoleInstanceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", r.NextLink) - populate(objectMap, "value", r.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RoleInstanceListResult. -func (r *RoleInstanceListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &r.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RoleInstanceNetworkProfile. -func (r RoleInstanceNetworkProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "networkInterfaces", r.NetworkInterfaces) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RoleInstanceNetworkProfile. -func (r *RoleInstanceNetworkProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "networkInterfaces": - err = unpopulate(val, "NetworkInterfaces", &r.NetworkInterfaces) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RoleInstanceProperties. -func (r RoleInstanceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "instanceView", r.InstanceView) - populate(objectMap, "networkProfile", r.NetworkProfile) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RoleInstanceProperties. -func (r *RoleInstanceProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "instanceView": - err = unpopulate(val, "InstanceView", &r.InstanceView) - delete(rawMsg, key) - case "networkProfile": - err = unpopulate(val, "NetworkProfile", &r.NetworkProfile) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RoleInstanceView. -func (r RoleInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "platformFaultDomain", r.PlatformFaultDomain) - populate(objectMap, "platformUpdateDomain", r.PlatformUpdateDomain) - populate(objectMap, "privateId", r.PrivateID) - populate(objectMap, "statuses", r.Statuses) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RoleInstanceView. -func (r *RoleInstanceView) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "platformFaultDomain": - err = unpopulate(val, "PlatformFaultDomain", &r.PlatformFaultDomain) - delete(rawMsg, key) - case "platformUpdateDomain": - err = unpopulate(val, "PlatformUpdateDomain", &r.PlatformUpdateDomain) - delete(rawMsg, key) - case "privateId": - err = unpopulate(val, "PrivateID", &r.PrivateID) - delete(rawMsg, key) - case "statuses": - err = unpopulate(val, "Statuses", &r.Statuses) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RoleInstances. -func (r RoleInstances) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "roleInstances", r.RoleInstances) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RoleInstances. -func (r *RoleInstances) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "roleInstances": - err = unpopulate(val, "RoleInstances", &r.RoleInstances) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RollbackStatusInfo. -func (r RollbackStatusInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "failedRolledbackInstanceCount", r.FailedRolledbackInstanceCount) - populate(objectMap, "rollbackError", r.RollbackError) - populate(objectMap, "successfullyRolledbackInstanceCount", r.SuccessfullyRolledbackInstanceCount) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RollbackStatusInfo. -func (r *RollbackStatusInfo) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "failedRolledbackInstanceCount": - err = unpopulate(val, "FailedRolledbackInstanceCount", &r.FailedRolledbackInstanceCount) - delete(rawMsg, key) - case "rollbackError": - err = unpopulate(val, "RollbackError", &r.RollbackError) - delete(rawMsg, key) - case "successfullyRolledbackInstanceCount": - err = unpopulate(val, "SuccessfullyRolledbackInstanceCount", &r.SuccessfullyRolledbackInstanceCount) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RollingUpgradePolicy. -func (r RollingUpgradePolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "enableCrossZoneUpgrade", r.EnableCrossZoneUpgrade) - populate(objectMap, "maxBatchInstancePercent", r.MaxBatchInstancePercent) - populate(objectMap, "maxSurge", r.MaxSurge) - populate(objectMap, "maxUnhealthyInstancePercent", r.MaxUnhealthyInstancePercent) - populate(objectMap, "maxUnhealthyUpgradedInstancePercent", r.MaxUnhealthyUpgradedInstancePercent) - populate(objectMap, "pauseTimeBetweenBatches", r.PauseTimeBetweenBatches) - populate(objectMap, "prioritizeUnhealthyInstances", r.PrioritizeUnhealthyInstances) - populate(objectMap, "rollbackFailedInstancesOnPolicyBreach", r.RollbackFailedInstancesOnPolicyBreach) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RollingUpgradePolicy. -func (r *RollingUpgradePolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enableCrossZoneUpgrade": - err = unpopulate(val, "EnableCrossZoneUpgrade", &r.EnableCrossZoneUpgrade) - delete(rawMsg, key) - case "maxBatchInstancePercent": - err = unpopulate(val, "MaxBatchInstancePercent", &r.MaxBatchInstancePercent) - delete(rawMsg, key) - case "maxSurge": - err = unpopulate(val, "MaxSurge", &r.MaxSurge) - delete(rawMsg, key) - case "maxUnhealthyInstancePercent": - err = unpopulate(val, "MaxUnhealthyInstancePercent", &r.MaxUnhealthyInstancePercent) - delete(rawMsg, key) - case "maxUnhealthyUpgradedInstancePercent": - err = unpopulate(val, "MaxUnhealthyUpgradedInstancePercent", &r.MaxUnhealthyUpgradedInstancePercent) - delete(rawMsg, key) - case "pauseTimeBetweenBatches": - err = unpopulate(val, "PauseTimeBetweenBatches", &r.PauseTimeBetweenBatches) - delete(rawMsg, key) - case "prioritizeUnhealthyInstances": - err = unpopulate(val, "PrioritizeUnhealthyInstances", &r.PrioritizeUnhealthyInstances) - delete(rawMsg, key) - case "rollbackFailedInstancesOnPolicyBreach": - err = unpopulate(val, "RollbackFailedInstancesOnPolicyBreach", &r.RollbackFailedInstancesOnPolicyBreach) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RollingUpgradeProgressInfo. -func (r RollingUpgradeProgressInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "failedInstanceCount", r.FailedInstanceCount) - populate(objectMap, "inProgressInstanceCount", r.InProgressInstanceCount) - populate(objectMap, "pendingInstanceCount", r.PendingInstanceCount) - populate(objectMap, "successfulInstanceCount", r.SuccessfulInstanceCount) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RollingUpgradeProgressInfo. -func (r *RollingUpgradeProgressInfo) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "failedInstanceCount": - err = unpopulate(val, "FailedInstanceCount", &r.FailedInstanceCount) - delete(rawMsg, key) - case "inProgressInstanceCount": - err = unpopulate(val, "InProgressInstanceCount", &r.InProgressInstanceCount) - delete(rawMsg, key) - case "pendingInstanceCount": - err = unpopulate(val, "PendingInstanceCount", &r.PendingInstanceCount) - delete(rawMsg, key) - case "successfulInstanceCount": - err = unpopulate(val, "SuccessfulInstanceCount", &r.SuccessfulInstanceCount) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RollingUpgradeRunningStatus. -func (r RollingUpgradeRunningStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "code", r.Code) - populate(objectMap, "lastAction", r.LastAction) - populateDateTimeRFC3339(objectMap, "lastActionTime", r.LastActionTime) - populateDateTimeRFC3339(objectMap, "startTime", r.StartTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RollingUpgradeRunningStatus. -func (r *RollingUpgradeRunningStatus) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "code": - err = unpopulate(val, "Code", &r.Code) - delete(rawMsg, key) - case "lastAction": - err = unpopulate(val, "LastAction", &r.LastAction) - delete(rawMsg, key) - case "lastActionTime": - err = unpopulateDateTimeRFC3339(val, "LastActionTime", &r.LastActionTime) - delete(rawMsg, key) - case "startTime": - err = unpopulateDateTimeRFC3339(val, "StartTime", &r.StartTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RollingUpgradeStatusInfo. -func (r RollingUpgradeStatusInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RollingUpgradeStatusInfo. -func (r *RollingUpgradeStatusInfo) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &r.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &r.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RollingUpgradeStatusInfoProperties. -func (r RollingUpgradeStatusInfoProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "error", r.Error) - populate(objectMap, "policy", r.Policy) - populate(objectMap, "progress", r.Progress) - populate(objectMap, "runningStatus", r.RunningStatus) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RollingUpgradeStatusInfoProperties. -func (r *RollingUpgradeStatusInfoProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "error": - err = unpopulate(val, "Error", &r.Error) - delete(rawMsg, key) - case "policy": - err = unpopulate(val, "Policy", &r.Policy) - delete(rawMsg, key) - case "progress": - err = unpopulate(val, "Progress", &r.Progress) - delete(rawMsg, key) - case "runningStatus": - err = unpopulate(val, "RunningStatus", &r.RunningStatus) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RunCommandDocument. -func (r RunCommandDocument) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "description", r.Description) - populate(objectMap, "id", r.ID) - populate(objectMap, "label", r.Label) - populate(objectMap, "osType", r.OSType) - populate(objectMap, "parameters", r.Parameters) - populate(objectMap, "$schema", r.Schema) - populate(objectMap, "script", r.Script) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RunCommandDocument. -func (r *RunCommandDocument) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, "Description", &r.Description) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "label": - err = unpopulate(val, "Label", &r.Label) - delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &r.OSType) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &r.Parameters) - delete(rawMsg, key) - case "$schema": - err = unpopulate(val, "Schema", &r.Schema) - delete(rawMsg, key) - case "script": - err = unpopulate(val, "Script", &r.Script) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RunCommandDocumentBase. -func (r RunCommandDocumentBase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "description", r.Description) - populate(objectMap, "id", r.ID) - populate(objectMap, "label", r.Label) - populate(objectMap, "osType", r.OSType) - populate(objectMap, "$schema", r.Schema) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RunCommandDocumentBase. -func (r *RunCommandDocumentBase) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, "Description", &r.Description) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "label": - err = unpopulate(val, "Label", &r.Label) - delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &r.OSType) - delete(rawMsg, key) - case "$schema": - err = unpopulate(val, "Schema", &r.Schema) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RunCommandInput. -func (r RunCommandInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "commandId", r.CommandID) - populate(objectMap, "parameters", r.Parameters) - populate(objectMap, "script", r.Script) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RunCommandInput. -func (r *RunCommandInput) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "commandId": - err = unpopulate(val, "CommandID", &r.CommandID) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &r.Parameters) - delete(rawMsg, key) - case "script": - err = unpopulate(val, "Script", &r.Script) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RunCommandInputParameter. -func (r RunCommandInputParameter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", r.Name) - populate(objectMap, "value", r.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RunCommandInputParameter. -func (r *RunCommandInputParameter) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RunCommandListResult. -func (r RunCommandListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", r.NextLink) - populate(objectMap, "value", r.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RunCommandListResult. -func (r *RunCommandListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &r.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RunCommandManagedIdentity. -func (r RunCommandManagedIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "clientId", r.ClientID) - populate(objectMap, "objectId", r.ObjectID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RunCommandManagedIdentity. -func (r *RunCommandManagedIdentity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "clientId": - err = unpopulate(val, "ClientID", &r.ClientID) - delete(rawMsg, key) - case "objectId": - err = unpopulate(val, "ObjectID", &r.ObjectID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RunCommandParameterDefinition. -func (r RunCommandParameterDefinition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "defaultValue", r.DefaultValue) - populate(objectMap, "name", r.Name) - populate(objectMap, "required", r.Required) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RunCommandParameterDefinition. -func (r *RunCommandParameterDefinition) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "defaultValue": - err = unpopulate(val, "DefaultValue", &r.DefaultValue) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "required": - err = unpopulate(val, "Required", &r.Required) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RunCommandResult. -func (r RunCommandResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "value", r.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RunCommandResult. -func (r *RunCommandResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "value": - err = unpopulate(val, "Value", &r.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SKU. -func (s SKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "capacity", s.Capacity) - populate(objectMap, "name", s.Name) - populate(objectMap, "tier", s.Tier) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SKU. -func (s *SKU) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "capacity": - err = unpopulate(val, "Capacity", &s.Capacity) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &s.Tier) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SSHConfiguration. -func (s SSHConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "publicKeys", s.PublicKeys) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SSHConfiguration. -func (s *SSHConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "publicKeys": - err = unpopulate(val, "PublicKeys", &s.PublicKeys) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SSHGenerateKeyPairInputParameters. -func (s SSHGenerateKeyPairInputParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "encryptionType", s.EncryptionType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SSHGenerateKeyPairInputParameters. -func (s *SSHGenerateKeyPairInputParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "encryptionType": - err = unpopulate(val, "EncryptionType", &s.EncryptionType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SSHPublicKey. -func (s SSHPublicKey) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "keyData", s.KeyData) - populate(objectMap, "path", s.Path) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SSHPublicKey. -func (s *SSHPublicKey) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "keyData": - err = unpopulate(val, "KeyData", &s.KeyData) - delete(rawMsg, key) - case "path": - err = unpopulate(val, "Path", &s.Path) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SSHPublicKeyGenerateKeyPairResult. -func (s SSHPublicKeyGenerateKeyPairResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - populate(objectMap, "privateKey", s.PrivateKey) - populate(objectMap, "publicKey", s.PublicKey) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SSHPublicKeyGenerateKeyPairResult. -func (s *SSHPublicKeyGenerateKeyPairResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - case "privateKey": - err = unpopulate(val, "PrivateKey", &s.PrivateKey) - delete(rawMsg, key) - case "publicKey": - err = unpopulate(val, "PublicKey", &s.PublicKey) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SSHPublicKeyResource. -func (s SSHPublicKeyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SSHPublicKeyResource. -func (s *SSHPublicKeyResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &s.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &s.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SSHPublicKeyResourceProperties. -func (s SSHPublicKeyResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "publicKey", s.PublicKey) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SSHPublicKeyResourceProperties. -func (s *SSHPublicKeyResourceProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "publicKey": - err = unpopulate(val, "PublicKey", &s.PublicKey) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SSHPublicKeyUpdateResource. -func (s SSHPublicKeyUpdateResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "tags", s.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SSHPublicKeyUpdateResource. -func (s *SSHPublicKeyUpdateResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &s.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SSHPublicKeysGroupListResult. -func (s SSHPublicKeysGroupListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SSHPublicKeysGroupListResult. -func (s *SSHPublicKeysGroupListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ScaleInPolicy. -func (s ScaleInPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "forceDeletion", s.ForceDeletion) - populate(objectMap, "rules", s.Rules) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ScaleInPolicy. -func (s *ScaleInPolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "forceDeletion": - err = unpopulate(val, "ForceDeletion", &s.ForceDeletion) - delete(rawMsg, key) - case "rules": - err = unpopulate(val, "Rules", &s.Rules) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ScheduledEventsAdditionalPublishingTargets. -func (s ScheduledEventsAdditionalPublishingTargets) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "eventGridAndResourceGraph", s.EventGridAndResourceGraph) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ScheduledEventsAdditionalPublishingTargets. -func (s *ScheduledEventsAdditionalPublishingTargets) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "eventGridAndResourceGraph": - err = unpopulate(val, "EventGridAndResourceGraph", &s.EventGridAndResourceGraph) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ScheduledEventsPolicy. -func (s ScheduledEventsPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "scheduledEventsAdditionalPublishingTargets", s.ScheduledEventsAdditionalPublishingTargets) - populate(objectMap, "userInitiatedReboot", s.UserInitiatedReboot) - populate(objectMap, "userInitiatedRedeploy", s.UserInitiatedRedeploy) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ScheduledEventsPolicy. -func (s *ScheduledEventsPolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "scheduledEventsAdditionalPublishingTargets": - err = unpopulate(val, "ScheduledEventsAdditionalPublishingTargets", &s.ScheduledEventsAdditionalPublishingTargets) - delete(rawMsg, key) - case "userInitiatedReboot": - err = unpopulate(val, "UserInitiatedReboot", &s.UserInitiatedReboot) - delete(rawMsg, key) - case "userInitiatedRedeploy": - err = unpopulate(val, "UserInitiatedRedeploy", &s.UserInitiatedRedeploy) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ScheduledEventsProfile. -func (s ScheduledEventsProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "osImageNotificationProfile", s.OSImageNotificationProfile) - populate(objectMap, "terminateNotificationProfile", s.TerminateNotificationProfile) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ScheduledEventsProfile. -func (s *ScheduledEventsProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "osImageNotificationProfile": - err = unpopulate(val, "OSImageNotificationProfile", &s.OSImageNotificationProfile) - delete(rawMsg, key) - case "terminateNotificationProfile": - err = unpopulate(val, "TerminateNotificationProfile", &s.TerminateNotificationProfile) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SecurityPostureReference. -func (s SecurityPostureReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "excludeExtensions", s.ExcludeExtensions) - populate(objectMap, "id", s.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityPostureReference. -func (s *SecurityPostureReference) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "excludeExtensions": - err = unpopulate(val, "ExcludeExtensions", &s.ExcludeExtensions) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SecurityProfile. -func (s SecurityProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "encryptionAtHost", s.EncryptionAtHost) - populate(objectMap, "encryptionIdentity", s.EncryptionIdentity) - populate(objectMap, "proxyAgentSettings", s.ProxyAgentSettings) - populate(objectMap, "securityType", s.SecurityType) - populate(objectMap, "uefiSettings", s.UefiSettings) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityProfile. -func (s *SecurityProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "encryptionAtHost": - err = unpopulate(val, "EncryptionAtHost", &s.EncryptionAtHost) - delete(rawMsg, key) - case "encryptionIdentity": - err = unpopulate(val, "EncryptionIdentity", &s.EncryptionIdentity) - delete(rawMsg, key) - case "proxyAgentSettings": - err = unpopulate(val, "ProxyAgentSettings", &s.ProxyAgentSettings) - delete(rawMsg, key) - case "securityType": - err = unpopulate(val, "SecurityType", &s.SecurityType) - delete(rawMsg, key) - case "uefiSettings": - err = unpopulate(val, "UefiSettings", &s.UefiSettings) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceArtifactReference. -func (s ServiceArtifactReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceArtifactReference. -func (s *ServiceArtifactReference) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ShareInfoElement. -func (s ShareInfoElement) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "vmUri", s.VMURI) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ShareInfoElement. -func (s *ShareInfoElement) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "vmUri": - err = unpopulate(val, "VMURI", &s.VMURI) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SharedGallery. -func (s SharedGallery) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "identifier", s.Identifier) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGallery. -func (s *SharedGallery) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "identifier": - err = unpopulate(val, "Identifier", &s.Identifier) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &s.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SharedGalleryDataDiskImage. -func (s SharedGalleryDataDiskImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "diskSizeGB", s.DiskSizeGB) - populate(objectMap, "hostCaching", s.HostCaching) - populate(objectMap, "lun", s.Lun) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryDataDiskImage. -func (s *SharedGalleryDataDiskImage) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &s.DiskSizeGB) - delete(rawMsg, key) - case "hostCaching": - err = unpopulate(val, "HostCaching", &s.HostCaching) - delete(rawMsg, key) - case "lun": - err = unpopulate(val, "Lun", &s.Lun) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SharedGalleryDiskImage. -func (s SharedGalleryDiskImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "diskSizeGB", s.DiskSizeGB) - populate(objectMap, "hostCaching", s.HostCaching) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryDiskImage. -func (s *SharedGalleryDiskImage) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &s.DiskSizeGB) - delete(rawMsg, key) - case "hostCaching": - err = unpopulate(val, "HostCaching", &s.HostCaching) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SharedGalleryIdentifier. -func (s SharedGalleryIdentifier) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "uniqueId", s.UniqueID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryIdentifier. -func (s *SharedGalleryIdentifier) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "uniqueId": - err = unpopulate(val, "UniqueID", &s.UniqueID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SharedGalleryImage. -func (s SharedGalleryImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "identifier", s.Identifier) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryImage. -func (s *SharedGalleryImage) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "identifier": - err = unpopulate(val, "Identifier", &s.Identifier) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &s.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SharedGalleryImageList. -func (s SharedGalleryImageList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryImageList. -func (s *SharedGalleryImageList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SharedGalleryImageProperties. -func (s SharedGalleryImageProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "architecture", s.Architecture) - populate(objectMap, "artifactTags", s.ArtifactTags) - populate(objectMap, "disallowed", s.Disallowed) - populateDateTimeRFC3339(objectMap, "endOfLifeDate", s.EndOfLifeDate) - populate(objectMap, "eula", s.Eula) - populate(objectMap, "features", s.Features) - populate(objectMap, "hyperVGeneration", s.HyperVGeneration) - populate(objectMap, "identifier", s.Identifier) - populate(objectMap, "osState", s.OSState) - populate(objectMap, "osType", s.OSType) - populate(objectMap, "privacyStatementUri", s.PrivacyStatementURI) - populate(objectMap, "purchasePlan", s.PurchasePlan) - populate(objectMap, "recommended", s.Recommended) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryImageProperties. -func (s *SharedGalleryImageProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "architecture": - err = unpopulate(val, "Architecture", &s.Architecture) - delete(rawMsg, key) - case "artifactTags": - err = unpopulate(val, "ArtifactTags", &s.ArtifactTags) - delete(rawMsg, key) - case "disallowed": - err = unpopulate(val, "Disallowed", &s.Disallowed) - delete(rawMsg, key) - case "endOfLifeDate": - err = unpopulateDateTimeRFC3339(val, "EndOfLifeDate", &s.EndOfLifeDate) - delete(rawMsg, key) - case "eula": - err = unpopulate(val, "Eula", &s.Eula) - delete(rawMsg, key) - case "features": - err = unpopulate(val, "Features", &s.Features) - delete(rawMsg, key) - case "hyperVGeneration": - err = unpopulate(val, "HyperVGeneration", &s.HyperVGeneration) - delete(rawMsg, key) - case "identifier": - err = unpopulate(val, "Identifier", &s.Identifier) - delete(rawMsg, key) - case "osState": - err = unpopulate(val, "OSState", &s.OSState) - delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &s.OSType) - delete(rawMsg, key) - case "privacyStatementUri": - err = unpopulate(val, "PrivacyStatementURI", &s.PrivacyStatementURI) - delete(rawMsg, key) - case "purchasePlan": - err = unpopulate(val, "PurchasePlan", &s.PurchasePlan) - delete(rawMsg, key) - case "recommended": - err = unpopulate(val, "Recommended", &s.Recommended) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SharedGalleryImageVersion. -func (s SharedGalleryImageVersion) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "identifier", s.Identifier) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryImageVersion. -func (s *SharedGalleryImageVersion) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "identifier": - err = unpopulate(val, "Identifier", &s.Identifier) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &s.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SharedGalleryImageVersionList. -func (s SharedGalleryImageVersionList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryImageVersionList. -func (s *SharedGalleryImageVersionList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SharedGalleryImageVersionProperties. -func (s SharedGalleryImageVersionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "artifactTags", s.ArtifactTags) - populateDateTimeRFC3339(objectMap, "endOfLifeDate", s.EndOfLifeDate) - populate(objectMap, "excludeFromLatest", s.ExcludeFromLatest) - populateDateTimeRFC3339(objectMap, "publishedDate", s.PublishedDate) - populate(objectMap, "storageProfile", s.StorageProfile) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryImageVersionProperties. -func (s *SharedGalleryImageVersionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "artifactTags": - err = unpopulate(val, "ArtifactTags", &s.ArtifactTags) - delete(rawMsg, key) - case "endOfLifeDate": - err = unpopulateDateTimeRFC3339(val, "EndOfLifeDate", &s.EndOfLifeDate) - delete(rawMsg, key) - case "excludeFromLatest": - err = unpopulate(val, "ExcludeFromLatest", &s.ExcludeFromLatest) - delete(rawMsg, key) - case "publishedDate": - err = unpopulateDateTimeRFC3339(val, "PublishedDate", &s.PublishedDate) - delete(rawMsg, key) - case "storageProfile": - err = unpopulate(val, "StorageProfile", &s.StorageProfile) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SharedGalleryImageVersionStorageProfile. -func (s SharedGalleryImageVersionStorageProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "dataDiskImages", s.DataDiskImages) - populate(objectMap, "osDiskImage", s.OSDiskImage) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryImageVersionStorageProfile. -func (s *SharedGalleryImageVersionStorageProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dataDiskImages": - err = unpopulate(val, "DataDiskImages", &s.DataDiskImages) - delete(rawMsg, key) - case "osDiskImage": - err = unpopulate(val, "OSDiskImage", &s.OSDiskImage) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SharedGalleryList. -func (s SharedGalleryList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryList. -func (s *SharedGalleryList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SharedGalleryOSDiskImage. -func (s SharedGalleryOSDiskImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "diskSizeGB", s.DiskSizeGB) - populate(objectMap, "hostCaching", s.HostCaching) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryOSDiskImage. -func (s *SharedGalleryOSDiskImage) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &s.DiskSizeGB) - delete(rawMsg, key) - case "hostCaching": - err = unpopulate(val, "HostCaching", &s.HostCaching) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SharedGalleryProperties. -func (s SharedGalleryProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "artifactTags", s.ArtifactTags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryProperties. -func (s *SharedGalleryProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "artifactTags": - err = unpopulate(val, "ArtifactTags", &s.ArtifactTags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SharingProfile. -func (s SharingProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "communityGalleryInfo", s.CommunityGalleryInfo) - populate(objectMap, "groups", s.Groups) - populate(objectMap, "permissions", s.Permissions) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SharingProfile. -func (s *SharingProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "communityGalleryInfo": - err = unpopulate(val, "CommunityGalleryInfo", &s.CommunityGalleryInfo) - delete(rawMsg, key) - case "groups": - err = unpopulate(val, "Groups", &s.Groups) - delete(rawMsg, key) - case "permissions": - err = unpopulate(val, "Permissions", &s.Permissions) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SharingProfileGroup. -func (s SharingProfileGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "ids", s.IDs) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SharingProfileGroup. -func (s *SharingProfileGroup) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "ids": - err = unpopulate(val, "IDs", &s.IDs) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SharingStatus. -func (s SharingStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "aggregatedState", s.AggregatedState) - populate(objectMap, "summary", s.Summary) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SharingStatus. -func (s *SharingStatus) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "aggregatedState": - err = unpopulate(val, "AggregatedState", &s.AggregatedState) - delete(rawMsg, key) - case "summary": - err = unpopulate(val, "Summary", &s.Summary) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SharingUpdate. -func (s SharingUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "groups", s.Groups) - populate(objectMap, "operationType", s.OperationType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SharingUpdate. -func (s *SharingUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "groups": - err = unpopulate(val, "Groups", &s.Groups) - delete(rawMsg, key) - case "operationType": - err = unpopulate(val, "OperationType", &s.OperationType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Snapshot. -func (s Snapshot) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "extendedLocation", s.ExtendedLocation) - populate(objectMap, "id", s.ID) - populate(objectMap, "location", s.Location) - populate(objectMap, "managedBy", s.ManagedBy) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "sku", s.SKU) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Snapshot. -func (s *Snapshot) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "extendedLocation": - err = unpopulate(val, "ExtendedLocation", &s.ExtendedLocation) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &s.Location) - delete(rawMsg, key) - case "managedBy": - err = unpopulate(val, "ManagedBy", &s.ManagedBy) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &s.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &s.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SnapshotList. -func (s SnapshotList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SnapshotList. -func (s *SnapshotList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SnapshotProperties. -func (s SnapshotProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "completionPercent", s.CompletionPercent) - populate(objectMap, "copyCompletionError", s.CopyCompletionError) - populate(objectMap, "creationData", s.CreationData) - populate(objectMap, "dataAccessAuthMode", s.DataAccessAuthMode) - populate(objectMap, "diskAccessId", s.DiskAccessID) - populate(objectMap, "diskSizeBytes", s.DiskSizeBytes) - populate(objectMap, "diskSizeGB", s.DiskSizeGB) - populate(objectMap, "diskState", s.DiskState) - populate(objectMap, "encryption", s.Encryption) - populate(objectMap, "encryptionSettingsCollection", s.EncryptionSettingsCollection) - populate(objectMap, "hyperVGeneration", s.HyperVGeneration) - populate(objectMap, "incremental", s.Incremental) - populate(objectMap, "incrementalSnapshotFamilyId", s.IncrementalSnapshotFamilyID) - populate(objectMap, "networkAccessPolicy", s.NetworkAccessPolicy) - populate(objectMap, "osType", s.OSType) - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) - populate(objectMap, "purchasePlan", s.PurchasePlan) - populate(objectMap, "securityProfile", s.SecurityProfile) - populate(objectMap, "supportedCapabilities", s.SupportedCapabilities) - populate(objectMap, "supportsHibernation", s.SupportsHibernation) - populateDateTimeRFC3339(objectMap, "timeCreated", s.TimeCreated) - populate(objectMap, "uniqueId", s.UniqueID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SnapshotProperties. -func (s *SnapshotProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "completionPercent": - err = unpopulate(val, "CompletionPercent", &s.CompletionPercent) - delete(rawMsg, key) - case "copyCompletionError": - err = unpopulate(val, "CopyCompletionError", &s.CopyCompletionError) - delete(rawMsg, key) - case "creationData": - err = unpopulate(val, "CreationData", &s.CreationData) - delete(rawMsg, key) - case "dataAccessAuthMode": - err = unpopulate(val, "DataAccessAuthMode", &s.DataAccessAuthMode) - delete(rawMsg, key) - case "diskAccessId": - err = unpopulate(val, "DiskAccessID", &s.DiskAccessID) - delete(rawMsg, key) - case "diskSizeBytes": - err = unpopulate(val, "DiskSizeBytes", &s.DiskSizeBytes) - delete(rawMsg, key) - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &s.DiskSizeGB) - delete(rawMsg, key) - case "diskState": - err = unpopulate(val, "DiskState", &s.DiskState) - delete(rawMsg, key) - case "encryption": - err = unpopulate(val, "Encryption", &s.Encryption) - delete(rawMsg, key) - case "encryptionSettingsCollection": - err = unpopulate(val, "EncryptionSettingsCollection", &s.EncryptionSettingsCollection) - delete(rawMsg, key) - case "hyperVGeneration": - err = unpopulate(val, "HyperVGeneration", &s.HyperVGeneration) - delete(rawMsg, key) - case "incremental": - err = unpopulate(val, "Incremental", &s.Incremental) - delete(rawMsg, key) - case "incrementalSnapshotFamilyId": - err = unpopulate(val, "IncrementalSnapshotFamilyID", &s.IncrementalSnapshotFamilyID) - delete(rawMsg, key) - case "networkAccessPolicy": - err = unpopulate(val, "NetworkAccessPolicy", &s.NetworkAccessPolicy) - delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &s.OSType) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &s.PublicNetworkAccess) - delete(rawMsg, key) - case "purchasePlan": - err = unpopulate(val, "PurchasePlan", &s.PurchasePlan) - delete(rawMsg, key) - case "securityProfile": - err = unpopulate(val, "SecurityProfile", &s.SecurityProfile) - delete(rawMsg, key) - case "supportedCapabilities": - err = unpopulate(val, "SupportedCapabilities", &s.SupportedCapabilities) - delete(rawMsg, key) - case "supportsHibernation": - err = unpopulate(val, "SupportsHibernation", &s.SupportsHibernation) - delete(rawMsg, key) - case "timeCreated": - err = unpopulateDateTimeRFC3339(val, "TimeCreated", &s.TimeCreated) - delete(rawMsg, key) - case "uniqueId": - err = unpopulate(val, "UniqueID", &s.UniqueID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SnapshotSKU. -func (s SnapshotSKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", s.Name) - populate(objectMap, "tier", s.Tier) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SnapshotSKU. -func (s *SnapshotSKU) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &s.Tier) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SnapshotUpdate. -func (s SnapshotUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "sku", s.SKU) - populate(objectMap, "tags", s.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SnapshotUpdate. -func (s *SnapshotUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &s.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &s.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SnapshotUpdateProperties. -func (s SnapshotUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "dataAccessAuthMode", s.DataAccessAuthMode) - populate(objectMap, "diskAccessId", s.DiskAccessID) - populate(objectMap, "diskSizeGB", s.DiskSizeGB) - populate(objectMap, "encryption", s.Encryption) - populate(objectMap, "encryptionSettingsCollection", s.EncryptionSettingsCollection) - populate(objectMap, "networkAccessPolicy", s.NetworkAccessPolicy) - populate(objectMap, "osType", s.OSType) - populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) - populate(objectMap, "supportedCapabilities", s.SupportedCapabilities) - populate(objectMap, "supportsHibernation", s.SupportsHibernation) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SnapshotUpdateProperties. -func (s *SnapshotUpdateProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dataAccessAuthMode": - err = unpopulate(val, "DataAccessAuthMode", &s.DataAccessAuthMode) - delete(rawMsg, key) - case "diskAccessId": - err = unpopulate(val, "DiskAccessID", &s.DiskAccessID) - delete(rawMsg, key) - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &s.DiskSizeGB) - delete(rawMsg, key) - case "encryption": - err = unpopulate(val, "Encryption", &s.Encryption) - delete(rawMsg, key) - case "encryptionSettingsCollection": - err = unpopulate(val, "EncryptionSettingsCollection", &s.EncryptionSettingsCollection) - delete(rawMsg, key) - case "networkAccessPolicy": - err = unpopulate(val, "NetworkAccessPolicy", &s.NetworkAccessPolicy) - delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &s.OSType) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &s.PublicNetworkAccess) - delete(rawMsg, key) - case "supportedCapabilities": - err = unpopulate(val, "SupportedCapabilities", &s.SupportedCapabilities) - delete(rawMsg, key) - case "supportsHibernation": - err = unpopulate(val, "SupportsHibernation", &s.SupportsHibernation) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SoftDeletePolicy. -func (s SoftDeletePolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "isSoftDeleteEnabled", s.IsSoftDeleteEnabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SoftDeletePolicy. -func (s *SoftDeletePolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "isSoftDeleteEnabled": - err = unpopulate(val, "IsSoftDeleteEnabled", &s.IsSoftDeleteEnabled) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SourceVault. -func (s SourceVault) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SourceVault. -func (s *SourceVault) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SpotRestorePolicy. -func (s SpotRestorePolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "enabled", s.Enabled) - populate(objectMap, "restoreTimeout", s.RestoreTimeout) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SpotRestorePolicy. -func (s *SpotRestorePolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enabled": - err = unpopulate(val, "Enabled", &s.Enabled) - delete(rawMsg, key) - case "restoreTimeout": - err = unpopulate(val, "RestoreTimeout", &s.RestoreTimeout) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type StatusCodeCount. -func (s StatusCodeCount) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "code", s.Code) - populate(objectMap, "count", s.Count) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type StatusCodeCount. -func (s *StatusCodeCount) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "code": - err = unpopulate(val, "Code", &s.Code) - delete(rawMsg, key) - case "count": - err = unpopulate(val, "Count", &s.Count) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type StorageProfile. -func (s StorageProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "dataDisks", s.DataDisks) - populate(objectMap, "diskControllerType", s.DiskControllerType) - populate(objectMap, "imageReference", s.ImageReference) - populate(objectMap, "osDisk", s.OSDisk) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type StorageProfile. -func (s *StorageProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dataDisks": - err = unpopulate(val, "DataDisks", &s.DataDisks) - delete(rawMsg, key) - case "diskControllerType": - err = unpopulate(val, "DiskControllerType", &s.DiskControllerType) - delete(rawMsg, key) - case "imageReference": - err = unpopulate(val, "ImageReference", &s.ImageReference) - delete(rawMsg, key) - case "osDisk": - err = unpopulate(val, "OSDisk", &s.OSDisk) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SubResource. -func (s SubResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SubResource. -func (s *SubResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SubResourceReadOnly. -func (s SubResourceReadOnly) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SubResourceReadOnly. -func (s *SubResourceReadOnly) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SubResourceWithColocationStatus. -func (s SubResourceWithColocationStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "colocationStatus", s.ColocationStatus) - populate(objectMap, "id", s.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SubResourceWithColocationStatus. -func (s *SubResourceWithColocationStatus) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "colocationStatus": - err = unpopulate(val, "ColocationStatus", &s.ColocationStatus) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SupportedCapabilities. -func (s SupportedCapabilities) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "acceleratedNetwork", s.AcceleratedNetwork) - populate(objectMap, "architecture", s.Architecture) - populate(objectMap, "diskControllerTypes", s.DiskControllerTypes) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SupportedCapabilities. -func (s *SupportedCapabilities) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "acceleratedNetwork": - err = unpopulate(val, "AcceleratedNetwork", &s.AcceleratedNetwork) - delete(rawMsg, key) - case "architecture": - err = unpopulate(val, "Architecture", &s.Architecture) - delete(rawMsg, key) - case "diskControllerTypes": - err = unpopulate(val, "DiskControllerTypes", &s.DiskControllerTypes) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SystemData. -func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) - populateDateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. -func (s *SystemData) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "createdAt": - err = unpopulateDateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) - delete(rawMsg, key) - case "lastModifiedAt": - err = unpopulateDateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type TargetRegion. -func (t TargetRegion) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "encryption", t.Encryption) - populate(objectMap, "excludeFromLatest", t.ExcludeFromLatest) - populate(objectMap, "name", t.Name) - populate(objectMap, "regionalReplicaCount", t.RegionalReplicaCount) - populate(objectMap, "storageAccountType", t.StorageAccountType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TargetRegion. -func (t *TargetRegion) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "encryption": - err = unpopulate(val, "Encryption", &t.Encryption) - delete(rawMsg, key) - case "excludeFromLatest": - err = unpopulate(val, "ExcludeFromLatest", &t.ExcludeFromLatest) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &t.Name) - delete(rawMsg, key) - case "regionalReplicaCount": - err = unpopulate(val, "RegionalReplicaCount", &t.RegionalReplicaCount) - delete(rawMsg, key) - case "storageAccountType": - err = unpopulate(val, "StorageAccountType", &t.StorageAccountType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type TerminateNotificationProfile. -func (t TerminateNotificationProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "enable", t.Enable) - populate(objectMap, "notBeforeTimeout", t.NotBeforeTimeout) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TerminateNotificationProfile. -func (t *TerminateNotificationProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enable": - err = unpopulate(val, "Enable", &t.Enable) - delete(rawMsg, key) - case "notBeforeTimeout": - err = unpopulate(val, "NotBeforeTimeout", &t.NotBeforeTimeout) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ThrottledRequestsInput. -func (t ThrottledRequestsInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "blobContainerSasUri", t.BlobContainerSasURI) - populateDateTimeRFC3339(objectMap, "fromTime", t.FromTime) - populate(objectMap, "groupByClientApplicationId", t.GroupByClientApplicationID) - populate(objectMap, "groupByOperationName", t.GroupByOperationName) - populate(objectMap, "groupByResourceName", t.GroupByResourceName) - populate(objectMap, "groupByThrottlePolicy", t.GroupByThrottlePolicy) - populate(objectMap, "groupByUserAgent", t.GroupByUserAgent) - populateDateTimeRFC3339(objectMap, "toTime", t.ToTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ThrottledRequestsInput. -func (t *ThrottledRequestsInput) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "blobContainerSasUri": - err = unpopulate(val, "BlobContainerSasURI", &t.BlobContainerSasURI) - delete(rawMsg, key) - case "fromTime": - err = unpopulateDateTimeRFC3339(val, "FromTime", &t.FromTime) - delete(rawMsg, key) - case "groupByClientApplicationId": - err = unpopulate(val, "GroupByClientApplicationID", &t.GroupByClientApplicationID) - delete(rawMsg, key) - case "groupByOperationName": - err = unpopulate(val, "GroupByOperationName", &t.GroupByOperationName) - delete(rawMsg, key) - case "groupByResourceName": - err = unpopulate(val, "GroupByResourceName", &t.GroupByResourceName) - delete(rawMsg, key) - case "groupByThrottlePolicy": - err = unpopulate(val, "GroupByThrottlePolicy", &t.GroupByThrottlePolicy) - delete(rawMsg, key) - case "groupByUserAgent": - err = unpopulate(val, "GroupByUserAgent", &t.GroupByUserAgent) - delete(rawMsg, key) - case "toTime": - err = unpopulateDateTimeRFC3339(val, "ToTime", &t.ToTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UefiKey. -func (u UefiKey) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "type", u.Type) - populate(objectMap, "value", u.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UefiKey. -func (u *UefiKey) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "type": - err = unpopulate(val, "Type", &u.Type) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &u.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UefiKeySignatures. -func (u UefiKeySignatures) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "db", u.Db) - populate(objectMap, "dbx", u.Dbx) - populate(objectMap, "kek", u.Kek) - populate(objectMap, "pk", u.Pk) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UefiKeySignatures. -func (u *UefiKeySignatures) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "db": - err = unpopulate(val, "Db", &u.Db) - delete(rawMsg, key) - case "dbx": - err = unpopulate(val, "Dbx", &u.Dbx) - delete(rawMsg, key) - case "kek": - err = unpopulate(val, "Kek", &u.Kek) - delete(rawMsg, key) - case "pk": - err = unpopulate(val, "Pk", &u.Pk) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UefiSettings. -func (u UefiSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "secureBootEnabled", u.SecureBootEnabled) - populate(objectMap, "vTpmEnabled", u.VTpmEnabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UefiSettings. -func (u *UefiSettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "secureBootEnabled": - err = unpopulate(val, "SecureBootEnabled", &u.SecureBootEnabled) - delete(rawMsg, key) - case "vTpmEnabled": - err = unpopulate(val, "VTpmEnabled", &u.VTpmEnabled) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UpdateDomain. -func (u UpdateDomain) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", u.ID) - populate(objectMap, "name", u.Name) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateDomain. -func (u *UpdateDomain) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &u.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &u.Name) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UpdateDomainListResult. -func (u UpdateDomainListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", u.NextLink) - populate(objectMap, "value", u.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateDomainListResult. -func (u *UpdateDomainListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &u.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &u.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UpdateResource. -func (u UpdateResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "tags", u.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateResource. -func (u *UpdateResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "tags": - err = unpopulate(val, "Tags", &u.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UpdateResourceDefinition. -func (u UpdateResourceDefinition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", u.ID) - populate(objectMap, "name", u.Name) - populate(objectMap, "tags", u.Tags) - populate(objectMap, "type", u.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateResourceDefinition. -func (u *UpdateResourceDefinition) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &u.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &u.Name) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &u.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &u.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UpgradeOperationHistoricalStatusInfo. -func (u UpgradeOperationHistoricalStatusInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "location", u.Location) - populate(objectMap, "properties", u.Properties) - populate(objectMap, "type", u.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UpgradeOperationHistoricalStatusInfo. -func (u *UpgradeOperationHistoricalStatusInfo) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "location": - err = unpopulate(val, "Location", &u.Location) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &u.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &u.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UpgradeOperationHistoricalStatusInfoProperties. -func (u UpgradeOperationHistoricalStatusInfoProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "error", u.Error) - populate(objectMap, "progress", u.Progress) - populate(objectMap, "rollbackInfo", u.RollbackInfo) - populate(objectMap, "runningStatus", u.RunningStatus) - populate(objectMap, "startedBy", u.StartedBy) - populate(objectMap, "targetImageReference", u.TargetImageReference) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UpgradeOperationHistoricalStatusInfoProperties. -func (u *UpgradeOperationHistoricalStatusInfoProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "error": - err = unpopulate(val, "Error", &u.Error) - delete(rawMsg, key) - case "progress": - err = unpopulate(val, "Progress", &u.Progress) - delete(rawMsg, key) - case "rollbackInfo": - err = unpopulate(val, "RollbackInfo", &u.RollbackInfo) - delete(rawMsg, key) - case "runningStatus": - err = unpopulate(val, "RunningStatus", &u.RunningStatus) - delete(rawMsg, key) - case "startedBy": - err = unpopulate(val, "StartedBy", &u.StartedBy) - delete(rawMsg, key) - case "targetImageReference": - err = unpopulate(val, "TargetImageReference", &u.TargetImageReference) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UpgradeOperationHistoryStatus. -func (u UpgradeOperationHistoryStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "code", u.Code) - populateDateTimeRFC3339(objectMap, "endTime", u.EndTime) - populateDateTimeRFC3339(objectMap, "startTime", u.StartTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UpgradeOperationHistoryStatus. -func (u *UpgradeOperationHistoryStatus) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "code": - err = unpopulate(val, "Code", &u.Code) - delete(rawMsg, key) - case "endTime": - err = unpopulateDateTimeRFC3339(val, "EndTime", &u.EndTime) - delete(rawMsg, key) - case "startTime": - err = unpopulateDateTimeRFC3339(val, "StartTime", &u.StartTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UpgradePolicy. -func (u UpgradePolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "automaticOSUpgradePolicy", u.AutomaticOSUpgradePolicy) - populate(objectMap, "mode", u.Mode) - populate(objectMap, "rollingUpgradePolicy", u.RollingUpgradePolicy) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UpgradePolicy. -func (u *UpgradePolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "automaticOSUpgradePolicy": - err = unpopulate(val, "AutomaticOSUpgradePolicy", &u.AutomaticOSUpgradePolicy) - delete(rawMsg, key) - case "mode": - err = unpopulate(val, "Mode", &u.Mode) - delete(rawMsg, key) - case "rollingUpgradePolicy": - err = unpopulate(val, "RollingUpgradePolicy", &u.RollingUpgradePolicy) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Usage. -func (u Usage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "currentValue", u.CurrentValue) - populate(objectMap, "limit", u.Limit) - populate(objectMap, "name", u.Name) - objectMap["unit"] = "Count" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Usage. -func (u *Usage) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "currentValue": - err = unpopulate(val, "CurrentValue", &u.CurrentValue) - delete(rawMsg, key) - case "limit": - err = unpopulate(val, "Limit", &u.Limit) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &u.Name) - delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &u.Unit) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UsageName. -func (u UsageName) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "localizedValue", u.LocalizedValue) - populate(objectMap, "value", u.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UsageName. -func (u *UsageName) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "localizedValue": - err = unpopulate(val, "LocalizedValue", &u.LocalizedValue) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &u.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UserArtifactManage. -func (u UserArtifactManage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "install", u.Install) - populate(objectMap, "remove", u.Remove) - populate(objectMap, "update", u.Update) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UserArtifactManage. -func (u *UserArtifactManage) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "install": - err = unpopulate(val, "Install", &u.Install) - delete(rawMsg, key) - case "remove": - err = unpopulate(val, "Remove", &u.Remove) - delete(rawMsg, key) - case "update": - err = unpopulate(val, "Update", &u.Update) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UserArtifactSettings. -func (u UserArtifactSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "configFileName", u.ConfigFileName) - populate(objectMap, "packageFileName", u.PackageFileName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UserArtifactSettings. -func (u *UserArtifactSettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "configFileName": - err = unpopulate(val, "ConfigFileName", &u.ConfigFileName) - delete(rawMsg, key) - case "packageFileName": - err = unpopulate(val, "PackageFileName", &u.PackageFileName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UserArtifactSource. -func (u UserArtifactSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "defaultConfigurationLink", u.DefaultConfigurationLink) - populate(objectMap, "mediaLink", u.MediaLink) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UserArtifactSource. -func (u *UserArtifactSource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "defaultConfigurationLink": - err = unpopulate(val, "DefaultConfigurationLink", &u.DefaultConfigurationLink) - delete(rawMsg, key) - case "mediaLink": - err = unpopulate(val, "MediaLink", &u.MediaLink) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentitiesValue. -func (u UserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "clientId", u.ClientID) - populate(objectMap, "principalId", u.PrincipalID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedIdentitiesValue. -func (u *UserAssignedIdentitiesValue) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "clientId": - err = unpopulate(val, "ClientID", &u.ClientID) - delete(rawMsg, key) - case "principalId": - err = unpopulate(val, "PrincipalID", &u.PrincipalID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UserInitiatedReboot. -func (u UserInitiatedReboot) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "automaticallyApprove", u.AutomaticallyApprove) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UserInitiatedReboot. -func (u *UserInitiatedReboot) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "automaticallyApprove": - err = unpopulate(val, "AutomaticallyApprove", &u.AutomaticallyApprove) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UserInitiatedRedeploy. -func (u UserInitiatedRedeploy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "automaticallyApprove", u.AutomaticallyApprove) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UserInitiatedRedeploy. -func (u *UserInitiatedRedeploy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "automaticallyApprove": - err = unpopulate(val, "AutomaticallyApprove", &u.AutomaticallyApprove) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VMDiskSecurityProfile. -func (v VMDiskSecurityProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "diskEncryptionSet", v.DiskEncryptionSet) - populate(objectMap, "securityEncryptionType", v.SecurityEncryptionType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VMDiskSecurityProfile. -func (v *VMDiskSecurityProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "diskEncryptionSet": - err = unpopulate(val, "DiskEncryptionSet", &v.DiskEncryptionSet) - delete(rawMsg, key) - case "securityEncryptionType": - err = unpopulate(val, "SecurityEncryptionType", &v.SecurityEncryptionType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VMGalleryApplication. -func (v VMGalleryApplication) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "configurationReference", v.ConfigurationReference) - populate(objectMap, "enableAutomaticUpgrade", v.EnableAutomaticUpgrade) - populate(objectMap, "order", v.Order) - populate(objectMap, "packageReferenceId", v.PackageReferenceID) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "treatFailureAsDeploymentFailure", v.TreatFailureAsDeploymentFailure) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VMGalleryApplication. -func (v *VMGalleryApplication) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "configurationReference": - err = unpopulate(val, "ConfigurationReference", &v.ConfigurationReference) - delete(rawMsg, key) - case "enableAutomaticUpgrade": - err = unpopulate(val, "EnableAutomaticUpgrade", &v.EnableAutomaticUpgrade) - delete(rawMsg, key) - case "order": - err = unpopulate(val, "Order", &v.Order) - delete(rawMsg, key) - case "packageReferenceId": - err = unpopulate(val, "PackageReferenceID", &v.PackageReferenceID) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - case "treatFailureAsDeploymentFailure": - err = unpopulate(val, "TreatFailureAsDeploymentFailure", &v.TreatFailureAsDeploymentFailure) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VMImagesInEdgeZoneListResult. -func (v VMImagesInEdgeZoneListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", v.NextLink) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VMImagesInEdgeZoneListResult. -func (v *VMImagesInEdgeZoneListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &v.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VMScaleSetConvertToSinglePlacementGroupInput. -func (v VMScaleSetConvertToSinglePlacementGroupInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "activePlacementGroupId", v.ActivePlacementGroupID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VMScaleSetConvertToSinglePlacementGroupInput. -func (v *VMScaleSetConvertToSinglePlacementGroupInput) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "activePlacementGroupId": - err = unpopulate(val, "ActivePlacementGroupID", &v.ActivePlacementGroupID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VMSizeProperties. -func (v VMSizeProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "vCPUsAvailable", v.VCPUsAvailable) - populate(objectMap, "vCPUsPerCore", v.VCPUsPerCore) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VMSizeProperties. -func (v *VMSizeProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "vCPUsAvailable": - err = unpopulate(val, "VCPUsAvailable", &v.VCPUsAvailable) - delete(rawMsg, key) - case "vCPUsPerCore": - err = unpopulate(val, "VCPUsPerCore", &v.VCPUsPerCore) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VaultCertificate. -func (v VaultCertificate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "certificateStore", v.CertificateStore) - populate(objectMap, "certificateUrl", v.CertificateURL) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VaultCertificate. -func (v *VaultCertificate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "certificateStore": - err = unpopulate(val, "CertificateStore", &v.CertificateStore) - delete(rawMsg, key) - case "certificateUrl": - err = unpopulate(val, "CertificateURL", &v.CertificateURL) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VaultSecretGroup. -func (v VaultSecretGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "sourceVault", v.SourceVault) - populate(objectMap, "vaultCertificates", v.VaultCertificates) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VaultSecretGroup. -func (v *VaultSecretGroup) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "sourceVault": - err = unpopulate(val, "SourceVault", &v.SourceVault) - delete(rawMsg, key) - case "vaultCertificates": - err = unpopulate(val, "VaultCertificates", &v.VaultCertificates) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualHardDisk. -func (v VirtualHardDisk) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "uri", v.URI) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualHardDisk. -func (v *VirtualHardDisk) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "uri": - err = unpopulate(val, "URI", &v.URI) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachine. -func (v VirtualMachine) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "etag", v.Etag) - populate(objectMap, "extendedLocation", v.ExtendedLocation) - populate(objectMap, "id", v.ID) - populate(objectMap, "identity", v.Identity) - populate(objectMap, "location", v.Location) - populate(objectMap, "managedBy", v.ManagedBy) - populate(objectMap, "name", v.Name) - populate(objectMap, "plan", v.Plan) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "resources", v.Resources) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "type", v.Type) - populate(objectMap, "zones", v.Zones) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachine. -func (v *VirtualMachine) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &v.Etag) - delete(rawMsg, key) - case "extendedLocation": - err = unpopulate(val, "ExtendedLocation", &v.ExtendedLocation) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &v.Identity) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &v.Location) - delete(rawMsg, key) - case "managedBy": - err = unpopulate(val, "ManagedBy", &v.ManagedBy) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "plan": - err = unpopulate(val, "Plan", &v.Plan) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "resources": - err = unpopulate(val, "Resources", &v.Resources) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &v.Zones) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineAgentInstanceView. -func (v VirtualMachineAgentInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "extensionHandlers", v.ExtensionHandlers) - populate(objectMap, "statuses", v.Statuses) - populate(objectMap, "vmAgentVersion", v.VMAgentVersion) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineAgentInstanceView. -func (v *VirtualMachineAgentInstanceView) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "extensionHandlers": - err = unpopulate(val, "ExtensionHandlers", &v.ExtensionHandlers) - delete(rawMsg, key) - case "statuses": - err = unpopulate(val, "Statuses", &v.Statuses) - delete(rawMsg, key) - case "vmAgentVersion": - err = unpopulate(val, "VMAgentVersion", &v.VMAgentVersion) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineAssessPatchesResult. -func (v VirtualMachineAssessPatchesResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "assessmentActivityId", v.AssessmentActivityID) - populate(objectMap, "availablePatches", v.AvailablePatches) - populate(objectMap, "criticalAndSecurityPatchCount", v.CriticalAndSecurityPatchCount) - populate(objectMap, "error", v.Error) - populate(objectMap, "otherPatchCount", v.OtherPatchCount) - populate(objectMap, "rebootPending", v.RebootPending) - populateDateTimeRFC3339(objectMap, "startDateTime", v.StartDateTime) - populate(objectMap, "status", v.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineAssessPatchesResult. -func (v *VirtualMachineAssessPatchesResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "assessmentActivityId": - err = unpopulate(val, "AssessmentActivityID", &v.AssessmentActivityID) - delete(rawMsg, key) - case "availablePatches": - err = unpopulate(val, "AvailablePatches", &v.AvailablePatches) - delete(rawMsg, key) - case "criticalAndSecurityPatchCount": - err = unpopulate(val, "CriticalAndSecurityPatchCount", &v.CriticalAndSecurityPatchCount) - delete(rawMsg, key) - case "error": - err = unpopulate(val, "Error", &v.Error) - delete(rawMsg, key) - case "otherPatchCount": - err = unpopulate(val, "OtherPatchCount", &v.OtherPatchCount) - delete(rawMsg, key) - case "rebootPending": - err = unpopulate(val, "RebootPending", &v.RebootPending) - delete(rawMsg, key) - case "startDateTime": - err = unpopulateDateTimeRFC3339(val, "StartDateTime", &v.StartDateTime) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &v.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineCaptureParameters. -func (v VirtualMachineCaptureParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "destinationContainerName", v.DestinationContainerName) - populate(objectMap, "overwriteVhds", v.OverwriteVhds) - populate(objectMap, "vhdPrefix", v.VhdPrefix) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineCaptureParameters. -func (v *VirtualMachineCaptureParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "destinationContainerName": - err = unpopulate(val, "DestinationContainerName", &v.DestinationContainerName) - delete(rawMsg, key) - case "overwriteVhds": - err = unpopulate(val, "OverwriteVhds", &v.OverwriteVhds) - delete(rawMsg, key) - case "vhdPrefix": - err = unpopulate(val, "VhdPrefix", &v.VhdPrefix) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineCaptureResult. -func (v VirtualMachineCaptureResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "contentVersion", v.ContentVersion) - populate(objectMap, "id", v.ID) - populateAny(objectMap, "parameters", v.Parameters) - populate(objectMap, "resources", v.Resources) - populate(objectMap, "$schema", v.Schema) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineCaptureResult. -func (v *VirtualMachineCaptureResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "contentVersion": - err = unpopulate(val, "ContentVersion", &v.ContentVersion) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &v.Parameters) - delete(rawMsg, key) - case "resources": - err = unpopulate(val, "Resources", &v.Resources) - delete(rawMsg, key) - case "$schema": - err = unpopulate(val, "Schema", &v.Schema) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtension. -func (v VirtualMachineExtension) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", v.ID) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineExtension. -func (v *VirtualMachineExtension) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &v.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtensionHandlerInstanceView. -func (v VirtualMachineExtensionHandlerInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "status", v.Status) - populate(objectMap, "type", v.Type) - populate(objectMap, "typeHandlerVersion", v.TypeHandlerVersion) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineExtensionHandlerInstanceView. -func (v *VirtualMachineExtensionHandlerInstanceView) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "status": - err = unpopulate(val, "Status", &v.Status) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - case "typeHandlerVersion": - err = unpopulate(val, "TypeHandlerVersion", &v.TypeHandlerVersion) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtensionImage. -func (v VirtualMachineExtensionImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", v.ID) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineExtensionImage. -func (v *VirtualMachineExtensionImage) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &v.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtensionImageProperties. -func (v VirtualMachineExtensionImageProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "computeRole", v.ComputeRole) - populate(objectMap, "handlerSchema", v.HandlerSchema) - populate(objectMap, "operatingSystem", v.OperatingSystem) - populate(objectMap, "supportsMultipleExtensions", v.SupportsMultipleExtensions) - populate(objectMap, "vmScaleSetEnabled", v.VMScaleSetEnabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineExtensionImageProperties. -func (v *VirtualMachineExtensionImageProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "computeRole": - err = unpopulate(val, "ComputeRole", &v.ComputeRole) - delete(rawMsg, key) - case "handlerSchema": - err = unpopulate(val, "HandlerSchema", &v.HandlerSchema) - delete(rawMsg, key) - case "operatingSystem": - err = unpopulate(val, "OperatingSystem", &v.OperatingSystem) - delete(rawMsg, key) - case "supportsMultipleExtensions": - err = unpopulate(val, "SupportsMultipleExtensions", &v.SupportsMultipleExtensions) - delete(rawMsg, key) - case "vmScaleSetEnabled": - err = unpopulate(val, "VMScaleSetEnabled", &v.VMScaleSetEnabled) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtensionInstanceView. -func (v VirtualMachineExtensionInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", v.Name) - populate(objectMap, "statuses", v.Statuses) - populate(objectMap, "substatuses", v.Substatuses) - populate(objectMap, "type", v.Type) - populate(objectMap, "typeHandlerVersion", v.TypeHandlerVersion) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineExtensionInstanceView. -func (v *VirtualMachineExtensionInstanceView) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "statuses": - err = unpopulate(val, "Statuses", &v.Statuses) - delete(rawMsg, key) - case "substatuses": - err = unpopulate(val, "Substatuses", &v.Substatuses) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - case "typeHandlerVersion": - err = unpopulate(val, "TypeHandlerVersion", &v.TypeHandlerVersion) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtensionProperties. -func (v VirtualMachineExtensionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "autoUpgradeMinorVersion", v.AutoUpgradeMinorVersion) - populate(objectMap, "enableAutomaticUpgrade", v.EnableAutomaticUpgrade) - populate(objectMap, "forceUpdateTag", v.ForceUpdateTag) - populate(objectMap, "instanceView", v.InstanceView) - populateAny(objectMap, "protectedSettings", v.ProtectedSettings) - populate(objectMap, "protectedSettingsFromKeyVault", v.ProtectedSettingsFromKeyVault) - populate(objectMap, "provisionAfterExtensions", v.ProvisionAfterExtensions) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "publisher", v.Publisher) - populateAny(objectMap, "settings", v.Settings) - populate(objectMap, "suppressFailures", v.SuppressFailures) - populate(objectMap, "type", v.Type) - populate(objectMap, "typeHandlerVersion", v.TypeHandlerVersion) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineExtensionProperties. -func (v *VirtualMachineExtensionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "autoUpgradeMinorVersion": - err = unpopulate(val, "AutoUpgradeMinorVersion", &v.AutoUpgradeMinorVersion) - delete(rawMsg, key) - case "enableAutomaticUpgrade": - err = unpopulate(val, "EnableAutomaticUpgrade", &v.EnableAutomaticUpgrade) - delete(rawMsg, key) - case "forceUpdateTag": - err = unpopulate(val, "ForceUpdateTag", &v.ForceUpdateTag) - delete(rawMsg, key) - case "instanceView": - err = unpopulate(val, "InstanceView", &v.InstanceView) - delete(rawMsg, key) - case "protectedSettings": - err = unpopulate(val, "ProtectedSettings", &v.ProtectedSettings) - delete(rawMsg, key) - case "protectedSettingsFromKeyVault": - err = unpopulate(val, "ProtectedSettingsFromKeyVault", &v.ProtectedSettingsFromKeyVault) - delete(rawMsg, key) - case "provisionAfterExtensions": - err = unpopulate(val, "ProvisionAfterExtensions", &v.ProvisionAfterExtensions) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - case "publisher": - err = unpopulate(val, "Publisher", &v.Publisher) - delete(rawMsg, key) - case "settings": - err = unpopulate(val, "Settings", &v.Settings) - delete(rawMsg, key) - case "suppressFailures": - err = unpopulate(val, "SuppressFailures", &v.SuppressFailures) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - case "typeHandlerVersion": - err = unpopulate(val, "TypeHandlerVersion", &v.TypeHandlerVersion) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtensionUpdate. -func (v VirtualMachineExtensionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineExtensionUpdate. -func (v *VirtualMachineExtensionUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtensionUpdateProperties. -func (v VirtualMachineExtensionUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "autoUpgradeMinorVersion", v.AutoUpgradeMinorVersion) - populate(objectMap, "enableAutomaticUpgrade", v.EnableAutomaticUpgrade) - populate(objectMap, "forceUpdateTag", v.ForceUpdateTag) - populateAny(objectMap, "protectedSettings", v.ProtectedSettings) - populate(objectMap, "protectedSettingsFromKeyVault", v.ProtectedSettingsFromKeyVault) - populate(objectMap, "publisher", v.Publisher) - populateAny(objectMap, "settings", v.Settings) - populate(objectMap, "suppressFailures", v.SuppressFailures) - populate(objectMap, "type", v.Type) - populate(objectMap, "typeHandlerVersion", v.TypeHandlerVersion) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineExtensionUpdateProperties. -func (v *VirtualMachineExtensionUpdateProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "autoUpgradeMinorVersion": - err = unpopulate(val, "AutoUpgradeMinorVersion", &v.AutoUpgradeMinorVersion) - delete(rawMsg, key) - case "enableAutomaticUpgrade": - err = unpopulate(val, "EnableAutomaticUpgrade", &v.EnableAutomaticUpgrade) - delete(rawMsg, key) - case "forceUpdateTag": - err = unpopulate(val, "ForceUpdateTag", &v.ForceUpdateTag) - delete(rawMsg, key) - case "protectedSettings": - err = unpopulate(val, "ProtectedSettings", &v.ProtectedSettings) - delete(rawMsg, key) - case "protectedSettingsFromKeyVault": - err = unpopulate(val, "ProtectedSettingsFromKeyVault", &v.ProtectedSettingsFromKeyVault) - delete(rawMsg, key) - case "publisher": - err = unpopulate(val, "Publisher", &v.Publisher) - delete(rawMsg, key) - case "settings": - err = unpopulate(val, "Settings", &v.Settings) - delete(rawMsg, key) - case "suppressFailures": - err = unpopulate(val, "SuppressFailures", &v.SuppressFailures) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - case "typeHandlerVersion": - err = unpopulate(val, "TypeHandlerVersion", &v.TypeHandlerVersion) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtensionsListResult. -func (v VirtualMachineExtensionsListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineExtensionsListResult. -func (v *VirtualMachineExtensionsListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineHealthStatus. -func (v VirtualMachineHealthStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "status", v.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineHealthStatus. -func (v *VirtualMachineHealthStatus) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "status": - err = unpopulate(val, "Status", &v.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineIPTag. -func (v VirtualMachineIPTag) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "ipTagType", v.IPTagType) - populate(objectMap, "tag", v.Tag) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineIPTag. -func (v *VirtualMachineIPTag) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "ipTagType": - err = unpopulate(val, "IPTagType", &v.IPTagType) - delete(rawMsg, key) - case "tag": - err = unpopulate(val, "Tag", &v.Tag) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineIdentity. -func (v VirtualMachineIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "principalId", v.PrincipalID) - populate(objectMap, "tenantId", v.TenantID) - populate(objectMap, "type", v.Type) - populate(objectMap, "userAssignedIdentities", v.UserAssignedIdentities) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineIdentity. -func (v *VirtualMachineIdentity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "principalId": - err = unpopulate(val, "PrincipalID", &v.PrincipalID) - delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &v.TenantID) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - case "userAssignedIdentities": - err = unpopulate(val, "UserAssignedIdentities", &v.UserAssignedIdentities) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineImage. -func (v VirtualMachineImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "extendedLocation", v.ExtendedLocation) - populate(objectMap, "id", v.ID) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineImage. -func (v *VirtualMachineImage) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "extendedLocation": - err = unpopulate(val, "ExtendedLocation", &v.ExtendedLocation) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &v.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineImageFeature. -func (v VirtualMachineImageFeature) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", v.Name) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineImageFeature. -func (v *VirtualMachineImageFeature) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineImageProperties. -func (v VirtualMachineImageProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "architecture", v.Architecture) - populate(objectMap, "automaticOSUpgradeProperties", v.AutomaticOSUpgradeProperties) - populate(objectMap, "dataDiskImages", v.DataDiskImages) - populate(objectMap, "disallowed", v.Disallowed) - populate(objectMap, "features", v.Features) - populate(objectMap, "hyperVGeneration", v.HyperVGeneration) - populate(objectMap, "imageDeprecationStatus", v.ImageDeprecationStatus) - populate(objectMap, "osDiskImage", v.OSDiskImage) - populate(objectMap, "plan", v.Plan) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineImageProperties. -func (v *VirtualMachineImageProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "architecture": - err = unpopulate(val, "Architecture", &v.Architecture) - delete(rawMsg, key) - case "automaticOSUpgradeProperties": - err = unpopulate(val, "AutomaticOSUpgradeProperties", &v.AutomaticOSUpgradeProperties) - delete(rawMsg, key) - case "dataDiskImages": - err = unpopulate(val, "DataDiskImages", &v.DataDiskImages) - delete(rawMsg, key) - case "disallowed": - err = unpopulate(val, "Disallowed", &v.Disallowed) - delete(rawMsg, key) - case "features": - err = unpopulate(val, "Features", &v.Features) - delete(rawMsg, key) - case "hyperVGeneration": - err = unpopulate(val, "HyperVGeneration", &v.HyperVGeneration) - delete(rawMsg, key) - case "imageDeprecationStatus": - err = unpopulate(val, "ImageDeprecationStatus", &v.ImageDeprecationStatus) - delete(rawMsg, key) - case "osDiskImage": - err = unpopulate(val, "OSDiskImage", &v.OSDiskImage) - delete(rawMsg, key) - case "plan": - err = unpopulate(val, "Plan", &v.Plan) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineImageResource. -func (v VirtualMachineImageResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "extendedLocation", v.ExtendedLocation) - populate(objectMap, "id", v.ID) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "tags", v.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineImageResource. -func (v *VirtualMachineImageResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "extendedLocation": - err = unpopulate(val, "ExtendedLocation", &v.ExtendedLocation) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &v.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineInstallPatchesParameters. -func (v VirtualMachineInstallPatchesParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "linuxParameters", v.LinuxParameters) - populate(objectMap, "maximumDuration", v.MaximumDuration) - populate(objectMap, "rebootSetting", v.RebootSetting) - populate(objectMap, "windowsParameters", v.WindowsParameters) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineInstallPatchesParameters. -func (v *VirtualMachineInstallPatchesParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "linuxParameters": - err = unpopulate(val, "LinuxParameters", &v.LinuxParameters) - delete(rawMsg, key) - case "maximumDuration": - err = unpopulate(val, "MaximumDuration", &v.MaximumDuration) - delete(rawMsg, key) - case "rebootSetting": - err = unpopulate(val, "RebootSetting", &v.RebootSetting) - delete(rawMsg, key) - case "windowsParameters": - err = unpopulate(val, "WindowsParameters", &v.WindowsParameters) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineInstallPatchesResult. -func (v VirtualMachineInstallPatchesResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "error", v.Error) - populate(objectMap, "excludedPatchCount", v.ExcludedPatchCount) - populate(objectMap, "failedPatchCount", v.FailedPatchCount) - populate(objectMap, "installationActivityId", v.InstallationActivityID) - populate(objectMap, "installedPatchCount", v.InstalledPatchCount) - populate(objectMap, "maintenanceWindowExceeded", v.MaintenanceWindowExceeded) - populate(objectMap, "notSelectedPatchCount", v.NotSelectedPatchCount) - populate(objectMap, "patches", v.Patches) - populate(objectMap, "pendingPatchCount", v.PendingPatchCount) - populate(objectMap, "rebootStatus", v.RebootStatus) - populateDateTimeRFC3339(objectMap, "startDateTime", v.StartDateTime) - populate(objectMap, "status", v.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineInstallPatchesResult. -func (v *VirtualMachineInstallPatchesResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "error": - err = unpopulate(val, "Error", &v.Error) - delete(rawMsg, key) - case "excludedPatchCount": - err = unpopulate(val, "ExcludedPatchCount", &v.ExcludedPatchCount) - delete(rawMsg, key) - case "failedPatchCount": - err = unpopulate(val, "FailedPatchCount", &v.FailedPatchCount) - delete(rawMsg, key) - case "installationActivityId": - err = unpopulate(val, "InstallationActivityID", &v.InstallationActivityID) - delete(rawMsg, key) - case "installedPatchCount": - err = unpopulate(val, "InstalledPatchCount", &v.InstalledPatchCount) - delete(rawMsg, key) - case "maintenanceWindowExceeded": - err = unpopulate(val, "MaintenanceWindowExceeded", &v.MaintenanceWindowExceeded) - delete(rawMsg, key) - case "notSelectedPatchCount": - err = unpopulate(val, "NotSelectedPatchCount", &v.NotSelectedPatchCount) - delete(rawMsg, key) - case "patches": - err = unpopulate(val, "Patches", &v.Patches) - delete(rawMsg, key) - case "pendingPatchCount": - err = unpopulate(val, "PendingPatchCount", &v.PendingPatchCount) - delete(rawMsg, key) - case "rebootStatus": - err = unpopulate(val, "RebootStatus", &v.RebootStatus) - delete(rawMsg, key) - case "startDateTime": - err = unpopulateDateTimeRFC3339(val, "StartDateTime", &v.StartDateTime) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &v.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineInstanceView. -func (v VirtualMachineInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "assignedHost", v.AssignedHost) - populate(objectMap, "bootDiagnostics", v.BootDiagnostics) - populate(objectMap, "computerName", v.ComputerName) - populate(objectMap, "disks", v.Disks) - populate(objectMap, "extensions", v.Extensions) - populate(objectMap, "hyperVGeneration", v.HyperVGeneration) - populate(objectMap, "isVMInStandbyPool", v.IsVMInStandbyPool) - populate(objectMap, "maintenanceRedeployStatus", v.MaintenanceRedeployStatus) - populate(objectMap, "osName", v.OSName) - populate(objectMap, "osVersion", v.OSVersion) - populate(objectMap, "patchStatus", v.PatchStatus) - populate(objectMap, "platformFaultDomain", v.PlatformFaultDomain) - populate(objectMap, "platformUpdateDomain", v.PlatformUpdateDomain) - populate(objectMap, "rdpThumbPrint", v.RdpThumbPrint) - populate(objectMap, "statuses", v.Statuses) - populate(objectMap, "vmAgent", v.VMAgent) - populate(objectMap, "vmHealth", v.VMHealth) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineInstanceView. -func (v *VirtualMachineInstanceView) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "assignedHost": - err = unpopulate(val, "AssignedHost", &v.AssignedHost) - delete(rawMsg, key) - case "bootDiagnostics": - err = unpopulate(val, "BootDiagnostics", &v.BootDiagnostics) - delete(rawMsg, key) - case "computerName": - err = unpopulate(val, "ComputerName", &v.ComputerName) - delete(rawMsg, key) - case "disks": - err = unpopulate(val, "Disks", &v.Disks) - delete(rawMsg, key) - case "extensions": - err = unpopulate(val, "Extensions", &v.Extensions) - delete(rawMsg, key) - case "hyperVGeneration": - err = unpopulate(val, "HyperVGeneration", &v.HyperVGeneration) - delete(rawMsg, key) - case "isVMInStandbyPool": - err = unpopulate(val, "IsVMInStandbyPool", &v.IsVMInStandbyPool) - delete(rawMsg, key) - case "maintenanceRedeployStatus": - err = unpopulate(val, "MaintenanceRedeployStatus", &v.MaintenanceRedeployStatus) - delete(rawMsg, key) - case "osName": - err = unpopulate(val, "OSName", &v.OSName) - delete(rawMsg, key) - case "osVersion": - err = unpopulate(val, "OSVersion", &v.OSVersion) - delete(rawMsg, key) - case "patchStatus": - err = unpopulate(val, "PatchStatus", &v.PatchStatus) - delete(rawMsg, key) - case "platformFaultDomain": - err = unpopulate(val, "PlatformFaultDomain", &v.PlatformFaultDomain) - delete(rawMsg, key) - case "platformUpdateDomain": - err = unpopulate(val, "PlatformUpdateDomain", &v.PlatformUpdateDomain) - delete(rawMsg, key) - case "rdpThumbPrint": - err = unpopulate(val, "RdpThumbPrint", &v.RdpThumbPrint) - delete(rawMsg, key) - case "statuses": - err = unpopulate(val, "Statuses", &v.Statuses) - delete(rawMsg, key) - case "vmAgent": - err = unpopulate(val, "VMAgent", &v.VMAgent) - delete(rawMsg, key) - case "vmHealth": - err = unpopulate(val, "VMHealth", &v.VMHealth) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineListResult. -func (v VirtualMachineListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", v.NextLink) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineListResult. -func (v *VirtualMachineListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &v.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineNetworkInterfaceConfiguration. -func (v VirtualMachineNetworkInterfaceConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineNetworkInterfaceConfiguration. -func (v *VirtualMachineNetworkInterfaceConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineNetworkInterfaceConfigurationProperties. -func (v VirtualMachineNetworkInterfaceConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "auxiliaryMode", v.AuxiliaryMode) - populate(objectMap, "auxiliarySku", v.AuxiliarySKU) - populate(objectMap, "dnsSettings", v.DNSSettings) - populate(objectMap, "deleteOption", v.DeleteOption) - populate(objectMap, "disableTcpStateTracking", v.DisableTCPStateTracking) - populate(objectMap, "dscpConfiguration", v.DscpConfiguration) - populate(objectMap, "enableAcceleratedNetworking", v.EnableAcceleratedNetworking) - populate(objectMap, "enableFpga", v.EnableFpga) - populate(objectMap, "enableIPForwarding", v.EnableIPForwarding) - populate(objectMap, "ipConfigurations", v.IPConfigurations) - populate(objectMap, "networkSecurityGroup", v.NetworkSecurityGroup) - populate(objectMap, "primary", v.Primary) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineNetworkInterfaceConfigurationProperties. -func (v *VirtualMachineNetworkInterfaceConfigurationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "auxiliaryMode": - err = unpopulate(val, "AuxiliaryMode", &v.AuxiliaryMode) - delete(rawMsg, key) - case "auxiliarySku": - err = unpopulate(val, "AuxiliarySKU", &v.AuxiliarySKU) - delete(rawMsg, key) - case "dnsSettings": - err = unpopulate(val, "DNSSettings", &v.DNSSettings) - delete(rawMsg, key) - case "deleteOption": - err = unpopulate(val, "DeleteOption", &v.DeleteOption) - delete(rawMsg, key) - case "disableTcpStateTracking": - err = unpopulate(val, "DisableTCPStateTracking", &v.DisableTCPStateTracking) - delete(rawMsg, key) - case "dscpConfiguration": - err = unpopulate(val, "DscpConfiguration", &v.DscpConfiguration) - delete(rawMsg, key) - case "enableAcceleratedNetworking": - err = unpopulate(val, "EnableAcceleratedNetworking", &v.EnableAcceleratedNetworking) - delete(rawMsg, key) - case "enableFpga": - err = unpopulate(val, "EnableFpga", &v.EnableFpga) - delete(rawMsg, key) - case "enableIPForwarding": - err = unpopulate(val, "EnableIPForwarding", &v.EnableIPForwarding) - delete(rawMsg, key) - case "ipConfigurations": - err = unpopulate(val, "IPConfigurations", &v.IPConfigurations) - delete(rawMsg, key) - case "networkSecurityGroup": - err = unpopulate(val, "NetworkSecurityGroup", &v.NetworkSecurityGroup) - delete(rawMsg, key) - case "primary": - err = unpopulate(val, "Primary", &v.Primary) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineNetworkInterfaceDNSSettingsConfiguration. -func (v VirtualMachineNetworkInterfaceDNSSettingsConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "dnsServers", v.DNSServers) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineNetworkInterfaceDNSSettingsConfiguration. -func (v *VirtualMachineNetworkInterfaceDNSSettingsConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dnsServers": - err = unpopulate(val, "DNSServers", &v.DNSServers) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineNetworkInterfaceIPConfiguration. -func (v VirtualMachineNetworkInterfaceIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineNetworkInterfaceIPConfiguration. -func (v *VirtualMachineNetworkInterfaceIPConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineNetworkInterfaceIPConfigurationProperties. -func (v VirtualMachineNetworkInterfaceIPConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "applicationGatewayBackendAddressPools", v.ApplicationGatewayBackendAddressPools) - populate(objectMap, "applicationSecurityGroups", v.ApplicationSecurityGroups) - populate(objectMap, "loadBalancerBackendAddressPools", v.LoadBalancerBackendAddressPools) - populate(objectMap, "primary", v.Primary) - populate(objectMap, "privateIPAddressVersion", v.PrivateIPAddressVersion) - populate(objectMap, "publicIPAddressConfiguration", v.PublicIPAddressConfiguration) - populate(objectMap, "subnet", v.Subnet) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineNetworkInterfaceIPConfigurationProperties. -func (v *VirtualMachineNetworkInterfaceIPConfigurationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "applicationGatewayBackendAddressPools": - err = unpopulate(val, "ApplicationGatewayBackendAddressPools", &v.ApplicationGatewayBackendAddressPools) - delete(rawMsg, key) - case "applicationSecurityGroups": - err = unpopulate(val, "ApplicationSecurityGroups", &v.ApplicationSecurityGroups) - delete(rawMsg, key) - case "loadBalancerBackendAddressPools": - err = unpopulate(val, "LoadBalancerBackendAddressPools", &v.LoadBalancerBackendAddressPools) - delete(rawMsg, key) - case "primary": - err = unpopulate(val, "Primary", &v.Primary) - delete(rawMsg, key) - case "privateIPAddressVersion": - err = unpopulate(val, "PrivateIPAddressVersion", &v.PrivateIPAddressVersion) - delete(rawMsg, key) - case "publicIPAddressConfiguration": - err = unpopulate(val, "PublicIPAddressConfiguration", &v.PublicIPAddressConfiguration) - delete(rawMsg, key) - case "subnet": - err = unpopulate(val, "Subnet", &v.Subnet) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachinePatchStatus. -func (v VirtualMachinePatchStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "availablePatchSummary", v.AvailablePatchSummary) - populate(objectMap, "configurationStatuses", v.ConfigurationStatuses) - populate(objectMap, "lastPatchInstallationSummary", v.LastPatchInstallationSummary) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachinePatchStatus. -func (v *VirtualMachinePatchStatus) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "availablePatchSummary": - err = unpopulate(val, "AvailablePatchSummary", &v.AvailablePatchSummary) - delete(rawMsg, key) - case "configurationStatuses": - err = unpopulate(val, "ConfigurationStatuses", &v.ConfigurationStatuses) - delete(rawMsg, key) - case "lastPatchInstallationSummary": - err = unpopulate(val, "LastPatchInstallationSummary", &v.LastPatchInstallationSummary) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineProperties. -func (v VirtualMachineProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "additionalCapabilities", v.AdditionalCapabilities) - populate(objectMap, "applicationProfile", v.ApplicationProfile) - populate(objectMap, "availabilitySet", v.AvailabilitySet) - populate(objectMap, "billingProfile", v.BillingProfile) - populate(objectMap, "capacityReservation", v.CapacityReservation) - populate(objectMap, "diagnosticsProfile", v.DiagnosticsProfile) - populate(objectMap, "evictionPolicy", v.EvictionPolicy) - populate(objectMap, "extensionsTimeBudget", v.ExtensionsTimeBudget) - populate(objectMap, "hardwareProfile", v.HardwareProfile) - populate(objectMap, "host", v.Host) - populate(objectMap, "hostGroup", v.HostGroup) - populate(objectMap, "instanceView", v.InstanceView) - populate(objectMap, "licenseType", v.LicenseType) - populate(objectMap, "networkProfile", v.NetworkProfile) - populate(objectMap, "osProfile", v.OSProfile) - populate(objectMap, "platformFaultDomain", v.PlatformFaultDomain) - populate(objectMap, "priority", v.Priority) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "proximityPlacementGroup", v.ProximityPlacementGroup) - populate(objectMap, "scheduledEventsPolicy", v.ScheduledEventsPolicy) - populate(objectMap, "scheduledEventsProfile", v.ScheduledEventsProfile) - populate(objectMap, "securityProfile", v.SecurityProfile) - populate(objectMap, "storageProfile", v.StorageProfile) - populateDateTimeRFC3339(objectMap, "timeCreated", v.TimeCreated) - populate(objectMap, "userData", v.UserData) - populate(objectMap, "vmId", v.VMID) - populate(objectMap, "virtualMachineScaleSet", v.VirtualMachineScaleSet) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineProperties. -func (v *VirtualMachineProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "additionalCapabilities": - err = unpopulate(val, "AdditionalCapabilities", &v.AdditionalCapabilities) - delete(rawMsg, key) - case "applicationProfile": - err = unpopulate(val, "ApplicationProfile", &v.ApplicationProfile) - delete(rawMsg, key) - case "availabilitySet": - err = unpopulate(val, "AvailabilitySet", &v.AvailabilitySet) - delete(rawMsg, key) - case "billingProfile": - err = unpopulate(val, "BillingProfile", &v.BillingProfile) - delete(rawMsg, key) - case "capacityReservation": - err = unpopulate(val, "CapacityReservation", &v.CapacityReservation) - delete(rawMsg, key) - case "diagnosticsProfile": - err = unpopulate(val, "DiagnosticsProfile", &v.DiagnosticsProfile) - delete(rawMsg, key) - case "evictionPolicy": - err = unpopulate(val, "EvictionPolicy", &v.EvictionPolicy) - delete(rawMsg, key) - case "extensionsTimeBudget": - err = unpopulate(val, "ExtensionsTimeBudget", &v.ExtensionsTimeBudget) - delete(rawMsg, key) - case "hardwareProfile": - err = unpopulate(val, "HardwareProfile", &v.HardwareProfile) - delete(rawMsg, key) - case "host": - err = unpopulate(val, "Host", &v.Host) - delete(rawMsg, key) - case "hostGroup": - err = unpopulate(val, "HostGroup", &v.HostGroup) - delete(rawMsg, key) - case "instanceView": - err = unpopulate(val, "InstanceView", &v.InstanceView) - delete(rawMsg, key) - case "licenseType": - err = unpopulate(val, "LicenseType", &v.LicenseType) - delete(rawMsg, key) - case "networkProfile": - err = unpopulate(val, "NetworkProfile", &v.NetworkProfile) - delete(rawMsg, key) - case "osProfile": - err = unpopulate(val, "OSProfile", &v.OSProfile) - delete(rawMsg, key) - case "platformFaultDomain": - err = unpopulate(val, "PlatformFaultDomain", &v.PlatformFaultDomain) - delete(rawMsg, key) - case "priority": - err = unpopulate(val, "Priority", &v.Priority) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - case "proximityPlacementGroup": - err = unpopulate(val, "ProximityPlacementGroup", &v.ProximityPlacementGroup) - delete(rawMsg, key) - case "scheduledEventsPolicy": - err = unpopulate(val, "ScheduledEventsPolicy", &v.ScheduledEventsPolicy) - delete(rawMsg, key) - case "scheduledEventsProfile": - err = unpopulate(val, "ScheduledEventsProfile", &v.ScheduledEventsProfile) - delete(rawMsg, key) - case "securityProfile": - err = unpopulate(val, "SecurityProfile", &v.SecurityProfile) - delete(rawMsg, key) - case "storageProfile": - err = unpopulate(val, "StorageProfile", &v.StorageProfile) - delete(rawMsg, key) - case "timeCreated": - err = unpopulateDateTimeRFC3339(val, "TimeCreated", &v.TimeCreated) - delete(rawMsg, key) - case "userData": - err = unpopulate(val, "UserData", &v.UserData) - delete(rawMsg, key) - case "vmId": - err = unpopulate(val, "VMID", &v.VMID) - delete(rawMsg, key) - case "virtualMachineScaleSet": - err = unpopulate(val, "VirtualMachineScaleSet", &v.VirtualMachineScaleSet) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachinePublicIPAddressConfiguration. -func (v VirtualMachinePublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "sku", v.SKU) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachinePublicIPAddressConfiguration. -func (v *VirtualMachinePublicIPAddressConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &v.SKU) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachinePublicIPAddressConfigurationProperties. -func (v VirtualMachinePublicIPAddressConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "dnsSettings", v.DNSSettings) - populate(objectMap, "deleteOption", v.DeleteOption) - populate(objectMap, "ipTags", v.IPTags) - populate(objectMap, "idleTimeoutInMinutes", v.IdleTimeoutInMinutes) - populate(objectMap, "publicIPAddressVersion", v.PublicIPAddressVersion) - populate(objectMap, "publicIPAllocationMethod", v.PublicIPAllocationMethod) - populate(objectMap, "publicIPPrefix", v.PublicIPPrefix) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachinePublicIPAddressConfigurationProperties. -func (v *VirtualMachinePublicIPAddressConfigurationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dnsSettings": - err = unpopulate(val, "DNSSettings", &v.DNSSettings) - delete(rawMsg, key) - case "deleteOption": - err = unpopulate(val, "DeleteOption", &v.DeleteOption) - delete(rawMsg, key) - case "ipTags": - err = unpopulate(val, "IPTags", &v.IPTags) - delete(rawMsg, key) - case "idleTimeoutInMinutes": - err = unpopulate(val, "IdleTimeoutInMinutes", &v.IdleTimeoutInMinutes) - delete(rawMsg, key) - case "publicIPAddressVersion": - err = unpopulate(val, "PublicIPAddressVersion", &v.PublicIPAddressVersion) - delete(rawMsg, key) - case "publicIPAllocationMethod": - err = unpopulate(val, "PublicIPAllocationMethod", &v.PublicIPAllocationMethod) - delete(rawMsg, key) - case "publicIPPrefix": - err = unpopulate(val, "PublicIPPrefix", &v.PublicIPPrefix) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachinePublicIPAddressDNSSettingsConfiguration. -func (v VirtualMachinePublicIPAddressDNSSettingsConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "domainNameLabel", v.DomainNameLabel) - populate(objectMap, "domainNameLabelScope", v.DomainNameLabelScope) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachinePublicIPAddressDNSSettingsConfiguration. -func (v *VirtualMachinePublicIPAddressDNSSettingsConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "domainNameLabel": - err = unpopulate(val, "DomainNameLabel", &v.DomainNameLabel) - delete(rawMsg, key) - case "domainNameLabelScope": - err = unpopulate(val, "DomainNameLabelScope", &v.DomainNameLabelScope) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineReimageParameters. -func (v VirtualMachineReimageParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "exactVersion", v.ExactVersion) - populate(objectMap, "osProfile", v.OSProfile) - populate(objectMap, "tempDisk", v.TempDisk) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineReimageParameters. -func (v *VirtualMachineReimageParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "exactVersion": - err = unpopulate(val, "ExactVersion", &v.ExactVersion) - delete(rawMsg, key) - case "osProfile": - err = unpopulate(val, "OSProfile", &v.OSProfile) - delete(rawMsg, key) - case "tempDisk": - err = unpopulate(val, "TempDisk", &v.TempDisk) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineRunCommand. -func (v VirtualMachineRunCommand) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", v.ID) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineRunCommand. -func (v *VirtualMachineRunCommand) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &v.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineRunCommandInstanceView. -func (v VirtualMachineRunCommandInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "endTime", v.EndTime) - populate(objectMap, "error", v.Error) - populate(objectMap, "executionMessage", v.ExecutionMessage) - populate(objectMap, "executionState", v.ExecutionState) - populate(objectMap, "exitCode", v.ExitCode) - populate(objectMap, "output", v.Output) - populateDateTimeRFC3339(objectMap, "startTime", v.StartTime) - populate(objectMap, "statuses", v.Statuses) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineRunCommandInstanceView. -func (v *VirtualMachineRunCommandInstanceView) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "endTime": - err = unpopulateDateTimeRFC3339(val, "EndTime", &v.EndTime) - delete(rawMsg, key) - case "error": - err = unpopulate(val, "Error", &v.Error) - delete(rawMsg, key) - case "executionMessage": - err = unpopulate(val, "ExecutionMessage", &v.ExecutionMessage) - delete(rawMsg, key) - case "executionState": - err = unpopulate(val, "ExecutionState", &v.ExecutionState) - delete(rawMsg, key) - case "exitCode": - err = unpopulate(val, "ExitCode", &v.ExitCode) - delete(rawMsg, key) - case "output": - err = unpopulate(val, "Output", &v.Output) - delete(rawMsg, key) - case "startTime": - err = unpopulateDateTimeRFC3339(val, "StartTime", &v.StartTime) - delete(rawMsg, key) - case "statuses": - err = unpopulate(val, "Statuses", &v.Statuses) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineRunCommandProperties. -func (v VirtualMachineRunCommandProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "asyncExecution", v.AsyncExecution) - populate(objectMap, "errorBlobManagedIdentity", v.ErrorBlobManagedIdentity) - populate(objectMap, "errorBlobUri", v.ErrorBlobURI) - populate(objectMap, "instanceView", v.InstanceView) - populate(objectMap, "outputBlobManagedIdentity", v.OutputBlobManagedIdentity) - populate(objectMap, "outputBlobUri", v.OutputBlobURI) - populate(objectMap, "parameters", v.Parameters) - populate(objectMap, "protectedParameters", v.ProtectedParameters) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "runAsPassword", v.RunAsPassword) - populate(objectMap, "runAsUser", v.RunAsUser) - populate(objectMap, "source", v.Source) - populate(objectMap, "timeoutInSeconds", v.TimeoutInSeconds) - populate(objectMap, "treatFailureAsDeploymentFailure", v.TreatFailureAsDeploymentFailure) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineRunCommandProperties. -func (v *VirtualMachineRunCommandProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "asyncExecution": - err = unpopulate(val, "AsyncExecution", &v.AsyncExecution) - delete(rawMsg, key) - case "errorBlobManagedIdentity": - err = unpopulate(val, "ErrorBlobManagedIdentity", &v.ErrorBlobManagedIdentity) - delete(rawMsg, key) - case "errorBlobUri": - err = unpopulate(val, "ErrorBlobURI", &v.ErrorBlobURI) - delete(rawMsg, key) - case "instanceView": - err = unpopulate(val, "InstanceView", &v.InstanceView) - delete(rawMsg, key) - case "outputBlobManagedIdentity": - err = unpopulate(val, "OutputBlobManagedIdentity", &v.OutputBlobManagedIdentity) - delete(rawMsg, key) - case "outputBlobUri": - err = unpopulate(val, "OutputBlobURI", &v.OutputBlobURI) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &v.Parameters) - delete(rawMsg, key) - case "protectedParameters": - err = unpopulate(val, "ProtectedParameters", &v.ProtectedParameters) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - case "runAsPassword": - err = unpopulate(val, "RunAsPassword", &v.RunAsPassword) - delete(rawMsg, key) - case "runAsUser": - err = unpopulate(val, "RunAsUser", &v.RunAsUser) - delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &v.Source) - delete(rawMsg, key) - case "timeoutInSeconds": - err = unpopulate(val, "TimeoutInSeconds", &v.TimeoutInSeconds) - delete(rawMsg, key) - case "treatFailureAsDeploymentFailure": - err = unpopulate(val, "TreatFailureAsDeploymentFailure", &v.TreatFailureAsDeploymentFailure) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineRunCommandScriptSource. -func (v VirtualMachineRunCommandScriptSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "commandId", v.CommandID) - populate(objectMap, "script", v.Script) - populate(objectMap, "scriptUri", v.ScriptURI) - populate(objectMap, "scriptUriManagedIdentity", v.ScriptURIManagedIdentity) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineRunCommandScriptSource. -func (v *VirtualMachineRunCommandScriptSource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "commandId": - err = unpopulate(val, "CommandID", &v.CommandID) - delete(rawMsg, key) - case "script": - err = unpopulate(val, "Script", &v.Script) - delete(rawMsg, key) - case "scriptUri": - err = unpopulate(val, "ScriptURI", &v.ScriptURI) - delete(rawMsg, key) - case "scriptUriManagedIdentity": - err = unpopulate(val, "ScriptURIManagedIdentity", &v.ScriptURIManagedIdentity) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineRunCommandUpdate. -func (v VirtualMachineRunCommandUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineRunCommandUpdate. -func (v *VirtualMachineRunCommandUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineRunCommandsListResult. -func (v VirtualMachineRunCommandsListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", v.NextLink) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineRunCommandsListResult. -func (v *VirtualMachineRunCommandsListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &v.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSet. -func (v VirtualMachineScaleSet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "etag", v.Etag) - populate(objectMap, "extendedLocation", v.ExtendedLocation) - populate(objectMap, "id", v.ID) - populate(objectMap, "identity", v.Identity) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "plan", v.Plan) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "sku", v.SKU) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "type", v.Type) - populate(objectMap, "zones", v.Zones) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSet. -func (v *VirtualMachineScaleSet) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &v.Etag) - delete(rawMsg, key) - case "extendedLocation": - err = unpopulate(val, "ExtendedLocation", &v.ExtendedLocation) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &v.Identity) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &v.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "plan": - err = unpopulate(val, "Plan", &v.Plan) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &v.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &v.Zones) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetDataDisk. -func (v VirtualMachineScaleSetDataDisk) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "caching", v.Caching) - populate(objectMap, "createOption", v.CreateOption) - populate(objectMap, "deleteOption", v.DeleteOption) - populate(objectMap, "diskIOPSReadWrite", v.DiskIOPSReadWrite) - populate(objectMap, "diskMBpsReadWrite", v.DiskMBpsReadWrite) - populate(objectMap, "diskSizeGB", v.DiskSizeGB) - populate(objectMap, "lun", v.Lun) - populate(objectMap, "managedDisk", v.ManagedDisk) - populate(objectMap, "name", v.Name) - populate(objectMap, "writeAcceleratorEnabled", v.WriteAcceleratorEnabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetDataDisk. -func (v *VirtualMachineScaleSetDataDisk) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "caching": - err = unpopulate(val, "Caching", &v.Caching) - delete(rawMsg, key) - case "createOption": - err = unpopulate(val, "CreateOption", &v.CreateOption) - delete(rawMsg, key) - case "deleteOption": - err = unpopulate(val, "DeleteOption", &v.DeleteOption) - delete(rawMsg, key) - case "diskIOPSReadWrite": - err = unpopulate(val, "DiskIOPSReadWrite", &v.DiskIOPSReadWrite) - delete(rawMsg, key) - case "diskMBpsReadWrite": - err = unpopulate(val, "DiskMBpsReadWrite", &v.DiskMBpsReadWrite) - delete(rawMsg, key) - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &v.DiskSizeGB) - delete(rawMsg, key) - case "lun": - err = unpopulate(val, "Lun", &v.Lun) - delete(rawMsg, key) - case "managedDisk": - err = unpopulate(val, "ManagedDisk", &v.ManagedDisk) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "writeAcceleratorEnabled": - err = unpopulate(val, "WriteAcceleratorEnabled", &v.WriteAcceleratorEnabled) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetExtension. -func (v VirtualMachineScaleSetExtension) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", v.ID) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetExtension. -func (v *VirtualMachineScaleSetExtension) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetExtensionListResult. -func (v VirtualMachineScaleSetExtensionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", v.NextLink) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetExtensionListResult. -func (v *VirtualMachineScaleSetExtensionListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &v.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetExtensionProfile. -func (v VirtualMachineScaleSetExtensionProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "extensions", v.Extensions) - populate(objectMap, "extensionsTimeBudget", v.ExtensionsTimeBudget) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetExtensionProfile. -func (v *VirtualMachineScaleSetExtensionProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "extensions": - err = unpopulate(val, "Extensions", &v.Extensions) - delete(rawMsg, key) - case "extensionsTimeBudget": - err = unpopulate(val, "ExtensionsTimeBudget", &v.ExtensionsTimeBudget) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetExtensionProperties. -func (v VirtualMachineScaleSetExtensionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "autoUpgradeMinorVersion", v.AutoUpgradeMinorVersion) - populate(objectMap, "enableAutomaticUpgrade", v.EnableAutomaticUpgrade) - populate(objectMap, "forceUpdateTag", v.ForceUpdateTag) - populateAny(objectMap, "protectedSettings", v.ProtectedSettings) - populate(objectMap, "protectedSettingsFromKeyVault", v.ProtectedSettingsFromKeyVault) - populate(objectMap, "provisionAfterExtensions", v.ProvisionAfterExtensions) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "publisher", v.Publisher) - populateAny(objectMap, "settings", v.Settings) - populate(objectMap, "suppressFailures", v.SuppressFailures) - populate(objectMap, "type", v.Type) - populate(objectMap, "typeHandlerVersion", v.TypeHandlerVersion) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetExtensionProperties. -func (v *VirtualMachineScaleSetExtensionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "autoUpgradeMinorVersion": - err = unpopulate(val, "AutoUpgradeMinorVersion", &v.AutoUpgradeMinorVersion) - delete(rawMsg, key) - case "enableAutomaticUpgrade": - err = unpopulate(val, "EnableAutomaticUpgrade", &v.EnableAutomaticUpgrade) - delete(rawMsg, key) - case "forceUpdateTag": - err = unpopulate(val, "ForceUpdateTag", &v.ForceUpdateTag) - delete(rawMsg, key) - case "protectedSettings": - err = unpopulate(val, "ProtectedSettings", &v.ProtectedSettings) - delete(rawMsg, key) - case "protectedSettingsFromKeyVault": - err = unpopulate(val, "ProtectedSettingsFromKeyVault", &v.ProtectedSettingsFromKeyVault) - delete(rawMsg, key) - case "provisionAfterExtensions": - err = unpopulate(val, "ProvisionAfterExtensions", &v.ProvisionAfterExtensions) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - case "publisher": - err = unpopulate(val, "Publisher", &v.Publisher) - delete(rawMsg, key) - case "settings": - err = unpopulate(val, "Settings", &v.Settings) - delete(rawMsg, key) - case "suppressFailures": - err = unpopulate(val, "SuppressFailures", &v.SuppressFailures) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - case "typeHandlerVersion": - err = unpopulate(val, "TypeHandlerVersion", &v.TypeHandlerVersion) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetExtensionUpdate. -func (v VirtualMachineScaleSetExtensionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", v.ID) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetExtensionUpdate. -func (v *VirtualMachineScaleSetExtensionUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetHardwareProfile. -func (v VirtualMachineScaleSetHardwareProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "vmSizeProperties", v.VMSizeProperties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetHardwareProfile. -func (v *VirtualMachineScaleSetHardwareProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "vmSizeProperties": - err = unpopulate(val, "VMSizeProperties", &v.VMSizeProperties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetIPConfiguration. -func (v VirtualMachineScaleSetIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetIPConfiguration. -func (v *VirtualMachineScaleSetIPConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetIPConfigurationProperties. -func (v VirtualMachineScaleSetIPConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "applicationGatewayBackendAddressPools", v.ApplicationGatewayBackendAddressPools) - populate(objectMap, "applicationSecurityGroups", v.ApplicationSecurityGroups) - populate(objectMap, "loadBalancerBackendAddressPools", v.LoadBalancerBackendAddressPools) - populate(objectMap, "loadBalancerInboundNatPools", v.LoadBalancerInboundNatPools) - populate(objectMap, "primary", v.Primary) - populate(objectMap, "privateIPAddressVersion", v.PrivateIPAddressVersion) - populate(objectMap, "publicIPAddressConfiguration", v.PublicIPAddressConfiguration) - populate(objectMap, "subnet", v.Subnet) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetIPConfigurationProperties. -func (v *VirtualMachineScaleSetIPConfigurationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "applicationGatewayBackendAddressPools": - err = unpopulate(val, "ApplicationGatewayBackendAddressPools", &v.ApplicationGatewayBackendAddressPools) - delete(rawMsg, key) - case "applicationSecurityGroups": - err = unpopulate(val, "ApplicationSecurityGroups", &v.ApplicationSecurityGroups) - delete(rawMsg, key) - case "loadBalancerBackendAddressPools": - err = unpopulate(val, "LoadBalancerBackendAddressPools", &v.LoadBalancerBackendAddressPools) - delete(rawMsg, key) - case "loadBalancerInboundNatPools": - err = unpopulate(val, "LoadBalancerInboundNatPools", &v.LoadBalancerInboundNatPools) - delete(rawMsg, key) - case "primary": - err = unpopulate(val, "Primary", &v.Primary) - delete(rawMsg, key) - case "privateIPAddressVersion": - err = unpopulate(val, "PrivateIPAddressVersion", &v.PrivateIPAddressVersion) - delete(rawMsg, key) - case "publicIPAddressConfiguration": - err = unpopulate(val, "PublicIPAddressConfiguration", &v.PublicIPAddressConfiguration) - delete(rawMsg, key) - case "subnet": - err = unpopulate(val, "Subnet", &v.Subnet) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetIPTag. -func (v VirtualMachineScaleSetIPTag) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "ipTagType", v.IPTagType) - populate(objectMap, "tag", v.Tag) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetIPTag. -func (v *VirtualMachineScaleSetIPTag) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "ipTagType": - err = unpopulate(val, "IPTagType", &v.IPTagType) - delete(rawMsg, key) - case "tag": - err = unpopulate(val, "Tag", &v.Tag) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetIdentity. -func (v VirtualMachineScaleSetIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "principalId", v.PrincipalID) - populate(objectMap, "tenantId", v.TenantID) - populate(objectMap, "type", v.Type) - populate(objectMap, "userAssignedIdentities", v.UserAssignedIdentities) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetIdentity. -func (v *VirtualMachineScaleSetIdentity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "principalId": - err = unpopulate(val, "PrincipalID", &v.PrincipalID) - delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &v.TenantID) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - case "userAssignedIdentities": - err = unpopulate(val, "UserAssignedIdentities", &v.UserAssignedIdentities) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetInstanceView. -func (v VirtualMachineScaleSetInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "extensions", v.Extensions) - populate(objectMap, "orchestrationServices", v.OrchestrationServices) - populate(objectMap, "statuses", v.Statuses) - populate(objectMap, "virtualMachine", v.VirtualMachine) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetInstanceView. -func (v *VirtualMachineScaleSetInstanceView) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "extensions": - err = unpopulate(val, "Extensions", &v.Extensions) - delete(rawMsg, key) - case "orchestrationServices": - err = unpopulate(val, "OrchestrationServices", &v.OrchestrationServices) - delete(rawMsg, key) - case "statuses": - err = unpopulate(val, "Statuses", &v.Statuses) - delete(rawMsg, key) - case "virtualMachine": - err = unpopulate(val, "VirtualMachine", &v.VirtualMachine) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetInstanceViewStatusesSummary. -func (v VirtualMachineScaleSetInstanceViewStatusesSummary) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "statusesSummary", v.StatusesSummary) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetInstanceViewStatusesSummary. -func (v *VirtualMachineScaleSetInstanceViewStatusesSummary) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "statusesSummary": - err = unpopulate(val, "StatusesSummary", &v.StatusesSummary) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetListOSUpgradeHistory. -func (v VirtualMachineScaleSetListOSUpgradeHistory) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", v.NextLink) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetListOSUpgradeHistory. -func (v *VirtualMachineScaleSetListOSUpgradeHistory) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &v.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetListResult. -func (v VirtualMachineScaleSetListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", v.NextLink) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetListResult. -func (v *VirtualMachineScaleSetListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &v.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetListSKUsResult. -func (v VirtualMachineScaleSetListSKUsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", v.NextLink) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetListSKUsResult. -func (v *VirtualMachineScaleSetListSKUsResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &v.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetListWithLinkResult. -func (v VirtualMachineScaleSetListWithLinkResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", v.NextLink) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetListWithLinkResult. -func (v *VirtualMachineScaleSetListWithLinkResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &v.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetManagedDiskParameters. -func (v VirtualMachineScaleSetManagedDiskParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "diskEncryptionSet", v.DiskEncryptionSet) - populate(objectMap, "securityProfile", v.SecurityProfile) - populate(objectMap, "storageAccountType", v.StorageAccountType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetManagedDiskParameters. -func (v *VirtualMachineScaleSetManagedDiskParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "diskEncryptionSet": - err = unpopulate(val, "DiskEncryptionSet", &v.DiskEncryptionSet) - delete(rawMsg, key) - case "securityProfile": - err = unpopulate(val, "SecurityProfile", &v.SecurityProfile) - delete(rawMsg, key) - case "storageAccountType": - err = unpopulate(val, "StorageAccountType", &v.StorageAccountType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetNetworkConfiguration. -func (v VirtualMachineScaleSetNetworkConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetNetworkConfiguration. -func (v *VirtualMachineScaleSetNetworkConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetNetworkConfigurationDNSSettings. -func (v VirtualMachineScaleSetNetworkConfigurationDNSSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "dnsServers", v.DNSServers) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetNetworkConfigurationDNSSettings. -func (v *VirtualMachineScaleSetNetworkConfigurationDNSSettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dnsServers": - err = unpopulate(val, "DNSServers", &v.DNSServers) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetNetworkConfigurationProperties. -func (v VirtualMachineScaleSetNetworkConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "auxiliaryMode", v.AuxiliaryMode) - populate(objectMap, "auxiliarySku", v.AuxiliarySKU) - populate(objectMap, "dnsSettings", v.DNSSettings) - populate(objectMap, "deleteOption", v.DeleteOption) - populate(objectMap, "disableTcpStateTracking", v.DisableTCPStateTracking) - populate(objectMap, "enableAcceleratedNetworking", v.EnableAcceleratedNetworking) - populate(objectMap, "enableFpga", v.EnableFpga) - populate(objectMap, "enableIPForwarding", v.EnableIPForwarding) - populate(objectMap, "ipConfigurations", v.IPConfigurations) - populate(objectMap, "networkSecurityGroup", v.NetworkSecurityGroup) - populate(objectMap, "primary", v.Primary) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetNetworkConfigurationProperties. -func (v *VirtualMachineScaleSetNetworkConfigurationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "auxiliaryMode": - err = unpopulate(val, "AuxiliaryMode", &v.AuxiliaryMode) - delete(rawMsg, key) - case "auxiliarySku": - err = unpopulate(val, "AuxiliarySKU", &v.AuxiliarySKU) - delete(rawMsg, key) - case "dnsSettings": - err = unpopulate(val, "DNSSettings", &v.DNSSettings) - delete(rawMsg, key) - case "deleteOption": - err = unpopulate(val, "DeleteOption", &v.DeleteOption) - delete(rawMsg, key) - case "disableTcpStateTracking": - err = unpopulate(val, "DisableTCPStateTracking", &v.DisableTCPStateTracking) - delete(rawMsg, key) - case "enableAcceleratedNetworking": - err = unpopulate(val, "EnableAcceleratedNetworking", &v.EnableAcceleratedNetworking) - delete(rawMsg, key) - case "enableFpga": - err = unpopulate(val, "EnableFpga", &v.EnableFpga) - delete(rawMsg, key) - case "enableIPForwarding": - err = unpopulate(val, "EnableIPForwarding", &v.EnableIPForwarding) - delete(rawMsg, key) - case "ipConfigurations": - err = unpopulate(val, "IPConfigurations", &v.IPConfigurations) - delete(rawMsg, key) - case "networkSecurityGroup": - err = unpopulate(val, "NetworkSecurityGroup", &v.NetworkSecurityGroup) - delete(rawMsg, key) - case "primary": - err = unpopulate(val, "Primary", &v.Primary) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetNetworkProfile. -func (v VirtualMachineScaleSetNetworkProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "healthProbe", v.HealthProbe) - populate(objectMap, "networkApiVersion", v.NetworkAPIVersion) - populate(objectMap, "networkInterfaceConfigurations", v.NetworkInterfaceConfigurations) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetNetworkProfile. -func (v *VirtualMachineScaleSetNetworkProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "healthProbe": - err = unpopulate(val, "HealthProbe", &v.HealthProbe) - delete(rawMsg, key) - case "networkApiVersion": - err = unpopulate(val, "NetworkAPIVersion", &v.NetworkAPIVersion) - delete(rawMsg, key) - case "networkInterfaceConfigurations": - err = unpopulate(val, "NetworkInterfaceConfigurations", &v.NetworkInterfaceConfigurations) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetOSDisk. -func (v VirtualMachineScaleSetOSDisk) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "caching", v.Caching) - populate(objectMap, "createOption", v.CreateOption) - populate(objectMap, "deleteOption", v.DeleteOption) - populate(objectMap, "diffDiskSettings", v.DiffDiskSettings) - populate(objectMap, "diskSizeGB", v.DiskSizeGB) - populate(objectMap, "image", v.Image) - populate(objectMap, "managedDisk", v.ManagedDisk) - populate(objectMap, "name", v.Name) - populate(objectMap, "osType", v.OSType) - populate(objectMap, "vhdContainers", v.VhdContainers) - populate(objectMap, "writeAcceleratorEnabled", v.WriteAcceleratorEnabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetOSDisk. -func (v *VirtualMachineScaleSetOSDisk) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "caching": - err = unpopulate(val, "Caching", &v.Caching) - delete(rawMsg, key) - case "createOption": - err = unpopulate(val, "CreateOption", &v.CreateOption) - delete(rawMsg, key) - case "deleteOption": - err = unpopulate(val, "DeleteOption", &v.DeleteOption) - delete(rawMsg, key) - case "diffDiskSettings": - err = unpopulate(val, "DiffDiskSettings", &v.DiffDiskSettings) - delete(rawMsg, key) - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &v.DiskSizeGB) - delete(rawMsg, key) - case "image": - err = unpopulate(val, "Image", &v.Image) - delete(rawMsg, key) - case "managedDisk": - err = unpopulate(val, "ManagedDisk", &v.ManagedDisk) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &v.OSType) - delete(rawMsg, key) - case "vhdContainers": - err = unpopulate(val, "VhdContainers", &v.VhdContainers) - delete(rawMsg, key) - case "writeAcceleratorEnabled": - err = unpopulate(val, "WriteAcceleratorEnabled", &v.WriteAcceleratorEnabled) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetOSProfile. -func (v VirtualMachineScaleSetOSProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "adminPassword", v.AdminPassword) - populate(objectMap, "adminUsername", v.AdminUsername) - populate(objectMap, "allowExtensionOperations", v.AllowExtensionOperations) - populate(objectMap, "computerNamePrefix", v.ComputerNamePrefix) - populate(objectMap, "customData", v.CustomData) - populate(objectMap, "linuxConfiguration", v.LinuxConfiguration) - populate(objectMap, "requireGuestProvisionSignal", v.RequireGuestProvisionSignal) - populate(objectMap, "secrets", v.Secrets) - populate(objectMap, "windowsConfiguration", v.WindowsConfiguration) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetOSProfile. -func (v *VirtualMachineScaleSetOSProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "adminPassword": - err = unpopulate(val, "AdminPassword", &v.AdminPassword) - delete(rawMsg, key) - case "adminUsername": - err = unpopulate(val, "AdminUsername", &v.AdminUsername) - delete(rawMsg, key) - case "allowExtensionOperations": - err = unpopulate(val, "AllowExtensionOperations", &v.AllowExtensionOperations) - delete(rawMsg, key) - case "computerNamePrefix": - err = unpopulate(val, "ComputerNamePrefix", &v.ComputerNamePrefix) - delete(rawMsg, key) - case "customData": - err = unpopulate(val, "CustomData", &v.CustomData) - delete(rawMsg, key) - case "linuxConfiguration": - err = unpopulate(val, "LinuxConfiguration", &v.LinuxConfiguration) - delete(rawMsg, key) - case "requireGuestProvisionSignal": - err = unpopulate(val, "RequireGuestProvisionSignal", &v.RequireGuestProvisionSignal) - delete(rawMsg, key) - case "secrets": - err = unpopulate(val, "Secrets", &v.Secrets) - delete(rawMsg, key) - case "windowsConfiguration": - err = unpopulate(val, "WindowsConfiguration", &v.WindowsConfiguration) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetProperties. -func (v VirtualMachineScaleSetProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "additionalCapabilities", v.AdditionalCapabilities) - populate(objectMap, "automaticRepairsPolicy", v.AutomaticRepairsPolicy) - populate(objectMap, "constrainedMaximumCapacity", v.ConstrainedMaximumCapacity) - populate(objectMap, "doNotRunExtensionsOnOverprovisionedVMs", v.DoNotRunExtensionsOnOverprovisionedVMs) - populate(objectMap, "hostGroup", v.HostGroup) - populate(objectMap, "orchestrationMode", v.OrchestrationMode) - populate(objectMap, "overprovision", v.Overprovision) - populate(objectMap, "platformFaultDomainCount", v.PlatformFaultDomainCount) - populate(objectMap, "priorityMixPolicy", v.PriorityMixPolicy) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "proximityPlacementGroup", v.ProximityPlacementGroup) - populate(objectMap, "resiliencyPolicy", v.ResiliencyPolicy) - populate(objectMap, "scaleInPolicy", v.ScaleInPolicy) - populate(objectMap, "scheduledEventsPolicy", v.ScheduledEventsPolicy) - populate(objectMap, "singlePlacementGroup", v.SinglePlacementGroup) - populate(objectMap, "spotRestorePolicy", v.SpotRestorePolicy) - populateDateTimeRFC3339(objectMap, "timeCreated", v.TimeCreated) - populate(objectMap, "uniqueId", v.UniqueID) - populate(objectMap, "upgradePolicy", v.UpgradePolicy) - populate(objectMap, "virtualMachineProfile", v.VirtualMachineProfile) - populate(objectMap, "zoneBalance", v.ZoneBalance) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetProperties. -func (v *VirtualMachineScaleSetProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "additionalCapabilities": - err = unpopulate(val, "AdditionalCapabilities", &v.AdditionalCapabilities) - delete(rawMsg, key) - case "automaticRepairsPolicy": - err = unpopulate(val, "AutomaticRepairsPolicy", &v.AutomaticRepairsPolicy) - delete(rawMsg, key) - case "constrainedMaximumCapacity": - err = unpopulate(val, "ConstrainedMaximumCapacity", &v.ConstrainedMaximumCapacity) - delete(rawMsg, key) - case "doNotRunExtensionsOnOverprovisionedVMs": - err = unpopulate(val, "DoNotRunExtensionsOnOverprovisionedVMs", &v.DoNotRunExtensionsOnOverprovisionedVMs) - delete(rawMsg, key) - case "hostGroup": - err = unpopulate(val, "HostGroup", &v.HostGroup) - delete(rawMsg, key) - case "orchestrationMode": - err = unpopulate(val, "OrchestrationMode", &v.OrchestrationMode) - delete(rawMsg, key) - case "overprovision": - err = unpopulate(val, "Overprovision", &v.Overprovision) - delete(rawMsg, key) - case "platformFaultDomainCount": - err = unpopulate(val, "PlatformFaultDomainCount", &v.PlatformFaultDomainCount) - delete(rawMsg, key) - case "priorityMixPolicy": - err = unpopulate(val, "PriorityMixPolicy", &v.PriorityMixPolicy) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - case "proximityPlacementGroup": - err = unpopulate(val, "ProximityPlacementGroup", &v.ProximityPlacementGroup) - delete(rawMsg, key) - case "resiliencyPolicy": - err = unpopulate(val, "ResiliencyPolicy", &v.ResiliencyPolicy) - delete(rawMsg, key) - case "scaleInPolicy": - err = unpopulate(val, "ScaleInPolicy", &v.ScaleInPolicy) - delete(rawMsg, key) - case "scheduledEventsPolicy": - err = unpopulate(val, "ScheduledEventsPolicy", &v.ScheduledEventsPolicy) - delete(rawMsg, key) - case "singlePlacementGroup": - err = unpopulate(val, "SinglePlacementGroup", &v.SinglePlacementGroup) - delete(rawMsg, key) - case "spotRestorePolicy": - err = unpopulate(val, "SpotRestorePolicy", &v.SpotRestorePolicy) - delete(rawMsg, key) - case "timeCreated": - err = unpopulateDateTimeRFC3339(val, "TimeCreated", &v.TimeCreated) - delete(rawMsg, key) - case "uniqueId": - err = unpopulate(val, "UniqueID", &v.UniqueID) - delete(rawMsg, key) - case "upgradePolicy": - err = unpopulate(val, "UpgradePolicy", &v.UpgradePolicy) - delete(rawMsg, key) - case "virtualMachineProfile": - err = unpopulate(val, "VirtualMachineProfile", &v.VirtualMachineProfile) - delete(rawMsg, key) - case "zoneBalance": - err = unpopulate(val, "ZoneBalance", &v.ZoneBalance) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetPublicIPAddressConfiguration. -func (v VirtualMachineScaleSetPublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "sku", v.SKU) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetPublicIPAddressConfiguration. -func (v *VirtualMachineScaleSetPublicIPAddressConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &v.SKU) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings. -func (v VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "domainNameLabel", v.DomainNameLabel) - populate(objectMap, "domainNameLabelScope", v.DomainNameLabelScope) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings. -func (v *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "domainNameLabel": - err = unpopulate(val, "DomainNameLabel", &v.DomainNameLabel) - delete(rawMsg, key) - case "domainNameLabelScope": - err = unpopulate(val, "DomainNameLabelScope", &v.DomainNameLabelScope) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetPublicIPAddressConfigurationProperties. -func (v VirtualMachineScaleSetPublicIPAddressConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "dnsSettings", v.DNSSettings) - populate(objectMap, "deleteOption", v.DeleteOption) - populate(objectMap, "ipTags", v.IPTags) - populate(objectMap, "idleTimeoutInMinutes", v.IdleTimeoutInMinutes) - populate(objectMap, "publicIPAddressVersion", v.PublicIPAddressVersion) - populate(objectMap, "publicIPPrefix", v.PublicIPPrefix) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetPublicIPAddressConfigurationProperties. -func (v *VirtualMachineScaleSetPublicIPAddressConfigurationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dnsSettings": - err = unpopulate(val, "DNSSettings", &v.DNSSettings) - delete(rawMsg, key) - case "deleteOption": - err = unpopulate(val, "DeleteOption", &v.DeleteOption) - delete(rawMsg, key) - case "ipTags": - err = unpopulate(val, "IPTags", &v.IPTags) - delete(rawMsg, key) - case "idleTimeoutInMinutes": - err = unpopulate(val, "IdleTimeoutInMinutes", &v.IdleTimeoutInMinutes) - delete(rawMsg, key) - case "publicIPAddressVersion": - err = unpopulate(val, "PublicIPAddressVersion", &v.PublicIPAddressVersion) - delete(rawMsg, key) - case "publicIPPrefix": - err = unpopulate(val, "PublicIPPrefix", &v.PublicIPPrefix) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetReimageParameters. -func (v VirtualMachineScaleSetReimageParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "exactVersion", v.ExactVersion) - populate(objectMap, "forceUpdateOSDiskForEphemeral", v.ForceUpdateOSDiskForEphemeral) - populate(objectMap, "instanceIds", v.InstanceIDs) - populate(objectMap, "osProfile", v.OSProfile) - populate(objectMap, "tempDisk", v.TempDisk) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetReimageParameters. -func (v *VirtualMachineScaleSetReimageParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "exactVersion": - err = unpopulate(val, "ExactVersion", &v.ExactVersion) - delete(rawMsg, key) - case "forceUpdateOSDiskForEphemeral": - err = unpopulate(val, "ForceUpdateOSDiskForEphemeral", &v.ForceUpdateOSDiskForEphemeral) - delete(rawMsg, key) - case "instanceIds": - err = unpopulate(val, "InstanceIDs", &v.InstanceIDs) - delete(rawMsg, key) - case "osProfile": - err = unpopulate(val, "OSProfile", &v.OSProfile) - delete(rawMsg, key) - case "tempDisk": - err = unpopulate(val, "TempDisk", &v.TempDisk) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetSKU. -func (v VirtualMachineScaleSetSKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "capacity", v.Capacity) - populate(objectMap, "resourceType", v.ResourceType) - populate(objectMap, "sku", v.SKU) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetSKU. -func (v *VirtualMachineScaleSetSKU) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "capacity": - err = unpopulate(val, "Capacity", &v.Capacity) - delete(rawMsg, key) - case "resourceType": - err = unpopulate(val, "ResourceType", &v.ResourceType) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &v.SKU) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetSKUCapacity. -func (v VirtualMachineScaleSetSKUCapacity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "defaultCapacity", v.DefaultCapacity) - populate(objectMap, "maximum", v.Maximum) - populate(objectMap, "minimum", v.Minimum) - populate(objectMap, "scaleType", v.ScaleType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetSKUCapacity. -func (v *VirtualMachineScaleSetSKUCapacity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "defaultCapacity": - err = unpopulate(val, "DefaultCapacity", &v.DefaultCapacity) - delete(rawMsg, key) - case "maximum": - err = unpopulate(val, "Maximum", &v.Maximum) - delete(rawMsg, key) - case "minimum": - err = unpopulate(val, "Minimum", &v.Minimum) - delete(rawMsg, key) - case "scaleType": - err = unpopulate(val, "ScaleType", &v.ScaleType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetStorageProfile. -func (v VirtualMachineScaleSetStorageProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "dataDisks", v.DataDisks) - populate(objectMap, "diskControllerType", v.DiskControllerType) - populate(objectMap, "imageReference", v.ImageReference) - populate(objectMap, "osDisk", v.OSDisk) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetStorageProfile. -func (v *VirtualMachineScaleSetStorageProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dataDisks": - err = unpopulate(val, "DataDisks", &v.DataDisks) - delete(rawMsg, key) - case "diskControllerType": - err = unpopulate(val, "DiskControllerType", &v.DiskControllerType) - delete(rawMsg, key) - case "imageReference": - err = unpopulate(val, "ImageReference", &v.ImageReference) - delete(rawMsg, key) - case "osDisk": - err = unpopulate(val, "OSDisk", &v.OSDisk) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdate. -func (v VirtualMachineScaleSetUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "identity", v.Identity) - populate(objectMap, "plan", v.Plan) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "sku", v.SKU) - populate(objectMap, "tags", v.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdate. -func (v *VirtualMachineScaleSetUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "identity": - err = unpopulate(val, "Identity", &v.Identity) - delete(rawMsg, key) - case "plan": - err = unpopulate(val, "Plan", &v.Plan) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &v.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateIPConfiguration. -func (v VirtualMachineScaleSetUpdateIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateIPConfiguration. -func (v *VirtualMachineScaleSetUpdateIPConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateIPConfigurationProperties. -func (v VirtualMachineScaleSetUpdateIPConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "applicationGatewayBackendAddressPools", v.ApplicationGatewayBackendAddressPools) - populate(objectMap, "applicationSecurityGroups", v.ApplicationSecurityGroups) - populate(objectMap, "loadBalancerBackendAddressPools", v.LoadBalancerBackendAddressPools) - populate(objectMap, "loadBalancerInboundNatPools", v.LoadBalancerInboundNatPools) - populate(objectMap, "primary", v.Primary) - populate(objectMap, "privateIPAddressVersion", v.PrivateIPAddressVersion) - populate(objectMap, "publicIPAddressConfiguration", v.PublicIPAddressConfiguration) - populate(objectMap, "subnet", v.Subnet) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateIPConfigurationProperties. -func (v *VirtualMachineScaleSetUpdateIPConfigurationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "applicationGatewayBackendAddressPools": - err = unpopulate(val, "ApplicationGatewayBackendAddressPools", &v.ApplicationGatewayBackendAddressPools) - delete(rawMsg, key) - case "applicationSecurityGroups": - err = unpopulate(val, "ApplicationSecurityGroups", &v.ApplicationSecurityGroups) - delete(rawMsg, key) - case "loadBalancerBackendAddressPools": - err = unpopulate(val, "LoadBalancerBackendAddressPools", &v.LoadBalancerBackendAddressPools) - delete(rawMsg, key) - case "loadBalancerInboundNatPools": - err = unpopulate(val, "LoadBalancerInboundNatPools", &v.LoadBalancerInboundNatPools) - delete(rawMsg, key) - case "primary": - err = unpopulate(val, "Primary", &v.Primary) - delete(rawMsg, key) - case "privateIPAddressVersion": - err = unpopulate(val, "PrivateIPAddressVersion", &v.PrivateIPAddressVersion) - delete(rawMsg, key) - case "publicIPAddressConfiguration": - err = unpopulate(val, "PublicIPAddressConfiguration", &v.PublicIPAddressConfiguration) - delete(rawMsg, key) - case "subnet": - err = unpopulate(val, "Subnet", &v.Subnet) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateNetworkConfiguration. -func (v VirtualMachineScaleSetUpdateNetworkConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateNetworkConfiguration. -func (v *VirtualMachineScaleSetUpdateNetworkConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateNetworkConfigurationProperties. -func (v VirtualMachineScaleSetUpdateNetworkConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "auxiliaryMode", v.AuxiliaryMode) - populate(objectMap, "auxiliarySku", v.AuxiliarySKU) - populate(objectMap, "dnsSettings", v.DNSSettings) - populate(objectMap, "deleteOption", v.DeleteOption) - populate(objectMap, "disableTcpStateTracking", v.DisableTCPStateTracking) - populate(objectMap, "enableAcceleratedNetworking", v.EnableAcceleratedNetworking) - populate(objectMap, "enableFpga", v.EnableFpga) - populate(objectMap, "enableIPForwarding", v.EnableIPForwarding) - populate(objectMap, "ipConfigurations", v.IPConfigurations) - populate(objectMap, "networkSecurityGroup", v.NetworkSecurityGroup) - populate(objectMap, "primary", v.Primary) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateNetworkConfigurationProperties. -func (v *VirtualMachineScaleSetUpdateNetworkConfigurationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "auxiliaryMode": - err = unpopulate(val, "AuxiliaryMode", &v.AuxiliaryMode) - delete(rawMsg, key) - case "auxiliarySku": - err = unpopulate(val, "AuxiliarySKU", &v.AuxiliarySKU) - delete(rawMsg, key) - case "dnsSettings": - err = unpopulate(val, "DNSSettings", &v.DNSSettings) - delete(rawMsg, key) - case "deleteOption": - err = unpopulate(val, "DeleteOption", &v.DeleteOption) - delete(rawMsg, key) - case "disableTcpStateTracking": - err = unpopulate(val, "DisableTCPStateTracking", &v.DisableTCPStateTracking) - delete(rawMsg, key) - case "enableAcceleratedNetworking": - err = unpopulate(val, "EnableAcceleratedNetworking", &v.EnableAcceleratedNetworking) - delete(rawMsg, key) - case "enableFpga": - err = unpopulate(val, "EnableFpga", &v.EnableFpga) - delete(rawMsg, key) - case "enableIPForwarding": - err = unpopulate(val, "EnableIPForwarding", &v.EnableIPForwarding) - delete(rawMsg, key) - case "ipConfigurations": - err = unpopulate(val, "IPConfigurations", &v.IPConfigurations) - delete(rawMsg, key) - case "networkSecurityGroup": - err = unpopulate(val, "NetworkSecurityGroup", &v.NetworkSecurityGroup) - delete(rawMsg, key) - case "primary": - err = unpopulate(val, "Primary", &v.Primary) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateNetworkProfile. -func (v VirtualMachineScaleSetUpdateNetworkProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "healthProbe", v.HealthProbe) - populate(objectMap, "networkApiVersion", v.NetworkAPIVersion) - populate(objectMap, "networkInterfaceConfigurations", v.NetworkInterfaceConfigurations) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateNetworkProfile. -func (v *VirtualMachineScaleSetUpdateNetworkProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "healthProbe": - err = unpopulate(val, "HealthProbe", &v.HealthProbe) - delete(rawMsg, key) - case "networkApiVersion": - err = unpopulate(val, "NetworkAPIVersion", &v.NetworkAPIVersion) - delete(rawMsg, key) - case "networkInterfaceConfigurations": - err = unpopulate(val, "NetworkInterfaceConfigurations", &v.NetworkInterfaceConfigurations) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateOSDisk. -func (v VirtualMachineScaleSetUpdateOSDisk) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "caching", v.Caching) - populate(objectMap, "deleteOption", v.DeleteOption) - populate(objectMap, "diffDiskSettings", v.DiffDiskSettings) - populate(objectMap, "diskSizeGB", v.DiskSizeGB) - populate(objectMap, "image", v.Image) - populate(objectMap, "managedDisk", v.ManagedDisk) - populate(objectMap, "vhdContainers", v.VhdContainers) - populate(objectMap, "writeAcceleratorEnabled", v.WriteAcceleratorEnabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateOSDisk. -func (v *VirtualMachineScaleSetUpdateOSDisk) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "caching": - err = unpopulate(val, "Caching", &v.Caching) - delete(rawMsg, key) - case "deleteOption": - err = unpopulate(val, "DeleteOption", &v.DeleteOption) - delete(rawMsg, key) - case "diffDiskSettings": - err = unpopulate(val, "DiffDiskSettings", &v.DiffDiskSettings) - delete(rawMsg, key) - case "diskSizeGB": - err = unpopulate(val, "DiskSizeGB", &v.DiskSizeGB) - delete(rawMsg, key) - case "image": - err = unpopulate(val, "Image", &v.Image) - delete(rawMsg, key) - case "managedDisk": - err = unpopulate(val, "ManagedDisk", &v.ManagedDisk) - delete(rawMsg, key) - case "vhdContainers": - err = unpopulate(val, "VhdContainers", &v.VhdContainers) - delete(rawMsg, key) - case "writeAcceleratorEnabled": - err = unpopulate(val, "WriteAcceleratorEnabled", &v.WriteAcceleratorEnabled) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateOSProfile. -func (v VirtualMachineScaleSetUpdateOSProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "customData", v.CustomData) - populate(objectMap, "linuxConfiguration", v.LinuxConfiguration) - populate(objectMap, "secrets", v.Secrets) - populate(objectMap, "windowsConfiguration", v.WindowsConfiguration) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateOSProfile. -func (v *VirtualMachineScaleSetUpdateOSProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "customData": - err = unpopulate(val, "CustomData", &v.CustomData) - delete(rawMsg, key) - case "linuxConfiguration": - err = unpopulate(val, "LinuxConfiguration", &v.LinuxConfiguration) - delete(rawMsg, key) - case "secrets": - err = unpopulate(val, "Secrets", &v.Secrets) - delete(rawMsg, key) - case "windowsConfiguration": - err = unpopulate(val, "WindowsConfiguration", &v.WindowsConfiguration) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateProperties. -func (v VirtualMachineScaleSetUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "additionalCapabilities", v.AdditionalCapabilities) - populate(objectMap, "automaticRepairsPolicy", v.AutomaticRepairsPolicy) - populate(objectMap, "doNotRunExtensionsOnOverprovisionedVMs", v.DoNotRunExtensionsOnOverprovisionedVMs) - populate(objectMap, "overprovision", v.Overprovision) - populate(objectMap, "priorityMixPolicy", v.PriorityMixPolicy) - populate(objectMap, "proximityPlacementGroup", v.ProximityPlacementGroup) - populate(objectMap, "resiliencyPolicy", v.ResiliencyPolicy) - populate(objectMap, "scaleInPolicy", v.ScaleInPolicy) - populate(objectMap, "singlePlacementGroup", v.SinglePlacementGroup) - populate(objectMap, "spotRestorePolicy", v.SpotRestorePolicy) - populate(objectMap, "upgradePolicy", v.UpgradePolicy) - populate(objectMap, "virtualMachineProfile", v.VirtualMachineProfile) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateProperties. -func (v *VirtualMachineScaleSetUpdateProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "additionalCapabilities": - err = unpopulate(val, "AdditionalCapabilities", &v.AdditionalCapabilities) - delete(rawMsg, key) - case "automaticRepairsPolicy": - err = unpopulate(val, "AutomaticRepairsPolicy", &v.AutomaticRepairsPolicy) - delete(rawMsg, key) - case "doNotRunExtensionsOnOverprovisionedVMs": - err = unpopulate(val, "DoNotRunExtensionsOnOverprovisionedVMs", &v.DoNotRunExtensionsOnOverprovisionedVMs) - delete(rawMsg, key) - case "overprovision": - err = unpopulate(val, "Overprovision", &v.Overprovision) - delete(rawMsg, key) - case "priorityMixPolicy": - err = unpopulate(val, "PriorityMixPolicy", &v.PriorityMixPolicy) - delete(rawMsg, key) - case "proximityPlacementGroup": - err = unpopulate(val, "ProximityPlacementGroup", &v.ProximityPlacementGroup) - delete(rawMsg, key) - case "resiliencyPolicy": - err = unpopulate(val, "ResiliencyPolicy", &v.ResiliencyPolicy) - delete(rawMsg, key) - case "scaleInPolicy": - err = unpopulate(val, "ScaleInPolicy", &v.ScaleInPolicy) - delete(rawMsg, key) - case "singlePlacementGroup": - err = unpopulate(val, "SinglePlacementGroup", &v.SinglePlacementGroup) - delete(rawMsg, key) - case "spotRestorePolicy": - err = unpopulate(val, "SpotRestorePolicy", &v.SpotRestorePolicy) - delete(rawMsg, key) - case "upgradePolicy": - err = unpopulate(val, "UpgradePolicy", &v.UpgradePolicy) - delete(rawMsg, key) - case "virtualMachineProfile": - err = unpopulate(val, "VirtualMachineProfile", &v.VirtualMachineProfile) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdatePublicIPAddressConfiguration. -func (v VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdatePublicIPAddressConfiguration. -func (v *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties. -func (v VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "dnsSettings", v.DNSSettings) - populate(objectMap, "deleteOption", v.DeleteOption) - populate(objectMap, "idleTimeoutInMinutes", v.IdleTimeoutInMinutes) - populate(objectMap, "publicIPPrefix", v.PublicIPPrefix) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties. -func (v *VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dnsSettings": - err = unpopulate(val, "DNSSettings", &v.DNSSettings) - delete(rawMsg, key) - case "deleteOption": - err = unpopulate(val, "DeleteOption", &v.DeleteOption) - delete(rawMsg, key) - case "idleTimeoutInMinutes": - err = unpopulate(val, "IdleTimeoutInMinutes", &v.IdleTimeoutInMinutes) - delete(rawMsg, key) - case "publicIPPrefix": - err = unpopulate(val, "PublicIPPrefix", &v.PublicIPPrefix) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateStorageProfile. -func (v VirtualMachineScaleSetUpdateStorageProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "dataDisks", v.DataDisks) - populate(objectMap, "diskControllerType", v.DiskControllerType) - populate(objectMap, "imageReference", v.ImageReference) - populate(objectMap, "osDisk", v.OSDisk) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateStorageProfile. -func (v *VirtualMachineScaleSetUpdateStorageProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dataDisks": - err = unpopulate(val, "DataDisks", &v.DataDisks) - delete(rawMsg, key) - case "diskControllerType": - err = unpopulate(val, "DiskControllerType", &v.DiskControllerType) - delete(rawMsg, key) - case "imageReference": - err = unpopulate(val, "ImageReference", &v.ImageReference) - delete(rawMsg, key) - case "osDisk": - err = unpopulate(val, "OSDisk", &v.OSDisk) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateVMProfile. -func (v VirtualMachineScaleSetUpdateVMProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "billingProfile", v.BillingProfile) - populate(objectMap, "diagnosticsProfile", v.DiagnosticsProfile) - populate(objectMap, "extensionProfile", v.ExtensionProfile) - populate(objectMap, "hardwareProfile", v.HardwareProfile) - populate(objectMap, "licenseType", v.LicenseType) - populate(objectMap, "networkProfile", v.NetworkProfile) - populate(objectMap, "osProfile", v.OSProfile) - populate(objectMap, "scheduledEventsProfile", v.ScheduledEventsProfile) - populate(objectMap, "securityProfile", v.SecurityProfile) - populate(objectMap, "storageProfile", v.StorageProfile) - populate(objectMap, "userData", v.UserData) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateVMProfile. -func (v *VirtualMachineScaleSetUpdateVMProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "billingProfile": - err = unpopulate(val, "BillingProfile", &v.BillingProfile) - delete(rawMsg, key) - case "diagnosticsProfile": - err = unpopulate(val, "DiagnosticsProfile", &v.DiagnosticsProfile) - delete(rawMsg, key) - case "extensionProfile": - err = unpopulate(val, "ExtensionProfile", &v.ExtensionProfile) - delete(rawMsg, key) - case "hardwareProfile": - err = unpopulate(val, "HardwareProfile", &v.HardwareProfile) - delete(rawMsg, key) - case "licenseType": - err = unpopulate(val, "LicenseType", &v.LicenseType) - delete(rawMsg, key) - case "networkProfile": - err = unpopulate(val, "NetworkProfile", &v.NetworkProfile) - delete(rawMsg, key) - case "osProfile": - err = unpopulate(val, "OSProfile", &v.OSProfile) - delete(rawMsg, key) - case "scheduledEventsProfile": - err = unpopulate(val, "ScheduledEventsProfile", &v.ScheduledEventsProfile) - delete(rawMsg, key) - case "securityProfile": - err = unpopulate(val, "SecurityProfile", &v.SecurityProfile) - delete(rawMsg, key) - case "storageProfile": - err = unpopulate(val, "StorageProfile", &v.StorageProfile) - delete(rawMsg, key) - case "userData": - err = unpopulate(val, "UserData", &v.UserData) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVM. -func (v VirtualMachineScaleSetVM) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "etag", v.Etag) - populate(objectMap, "id", v.ID) - populate(objectMap, "identity", v.Identity) - populate(objectMap, "instanceId", v.InstanceID) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "plan", v.Plan) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "resources", v.Resources) - populate(objectMap, "sku", v.SKU) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "type", v.Type) - populate(objectMap, "zones", v.Zones) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVM. -func (v *VirtualMachineScaleSetVM) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, "Etag", &v.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &v.Identity) - delete(rawMsg, key) - case "instanceId": - err = unpopulate(val, "InstanceID", &v.InstanceID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &v.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "plan": - err = unpopulate(val, "Plan", &v.Plan) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "resources": - err = unpopulate(val, "Resources", &v.Resources) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &v.SKU) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &v.Zones) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMExtension. -func (v VirtualMachineScaleSetVMExtension) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", v.ID) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMExtension. -func (v *VirtualMachineScaleSetVMExtension) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &v.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMExtensionUpdate. -func (v VirtualMachineScaleSetVMExtensionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", v.ID) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMExtensionUpdate. -func (v *VirtualMachineScaleSetVMExtensionUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMExtensionsListResult. -func (v VirtualMachineScaleSetVMExtensionsListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMExtensionsListResult. -func (v *VirtualMachineScaleSetVMExtensionsListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMExtensionsSummary. -func (v VirtualMachineScaleSetVMExtensionsSummary) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", v.Name) - populate(objectMap, "statusesSummary", v.StatusesSummary) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMExtensionsSummary. -func (v *VirtualMachineScaleSetVMExtensionsSummary) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "statusesSummary": - err = unpopulate(val, "StatusesSummary", &v.StatusesSummary) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMInstanceIDs. -func (v VirtualMachineScaleSetVMInstanceIDs) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "instanceIds", v.InstanceIDs) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMInstanceIDs. -func (v *VirtualMachineScaleSetVMInstanceIDs) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "instanceIds": - err = unpopulate(val, "InstanceIDs", &v.InstanceIDs) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMInstanceRequiredIDs. -func (v VirtualMachineScaleSetVMInstanceRequiredIDs) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "instanceIds", v.InstanceIDs) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMInstanceRequiredIDs. -func (v *VirtualMachineScaleSetVMInstanceRequiredIDs) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "instanceIds": - err = unpopulate(val, "InstanceIDs", &v.InstanceIDs) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMInstanceView. -func (v VirtualMachineScaleSetVMInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "assignedHost", v.AssignedHost) - populate(objectMap, "bootDiagnostics", v.BootDiagnostics) - populate(objectMap, "computerName", v.ComputerName) - populate(objectMap, "disks", v.Disks) - populate(objectMap, "extensions", v.Extensions) - populate(objectMap, "hyperVGeneration", v.HyperVGeneration) - populate(objectMap, "maintenanceRedeployStatus", v.MaintenanceRedeployStatus) - populate(objectMap, "osName", v.OSName) - populate(objectMap, "osVersion", v.OSVersion) - populate(objectMap, "placementGroupId", v.PlacementGroupID) - populate(objectMap, "platformFaultDomain", v.PlatformFaultDomain) - populate(objectMap, "platformUpdateDomain", v.PlatformUpdateDomain) - populate(objectMap, "rdpThumbPrint", v.RdpThumbPrint) - populate(objectMap, "statuses", v.Statuses) - populate(objectMap, "vmAgent", v.VMAgent) - populate(objectMap, "vmHealth", v.VMHealth) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMInstanceView. -func (v *VirtualMachineScaleSetVMInstanceView) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "assignedHost": - err = unpopulate(val, "AssignedHost", &v.AssignedHost) - delete(rawMsg, key) - case "bootDiagnostics": - err = unpopulate(val, "BootDiagnostics", &v.BootDiagnostics) - delete(rawMsg, key) - case "computerName": - err = unpopulate(val, "ComputerName", &v.ComputerName) - delete(rawMsg, key) - case "disks": - err = unpopulate(val, "Disks", &v.Disks) - delete(rawMsg, key) - case "extensions": - err = unpopulate(val, "Extensions", &v.Extensions) - delete(rawMsg, key) - case "hyperVGeneration": - err = unpopulate(val, "HyperVGeneration", &v.HyperVGeneration) - delete(rawMsg, key) - case "maintenanceRedeployStatus": - err = unpopulate(val, "MaintenanceRedeployStatus", &v.MaintenanceRedeployStatus) - delete(rawMsg, key) - case "osName": - err = unpopulate(val, "OSName", &v.OSName) - delete(rawMsg, key) - case "osVersion": - err = unpopulate(val, "OSVersion", &v.OSVersion) - delete(rawMsg, key) - case "placementGroupId": - err = unpopulate(val, "PlacementGroupID", &v.PlacementGroupID) - delete(rawMsg, key) - case "platformFaultDomain": - err = unpopulate(val, "PlatformFaultDomain", &v.PlatformFaultDomain) - delete(rawMsg, key) - case "platformUpdateDomain": - err = unpopulate(val, "PlatformUpdateDomain", &v.PlatformUpdateDomain) - delete(rawMsg, key) - case "rdpThumbPrint": - err = unpopulate(val, "RdpThumbPrint", &v.RdpThumbPrint) - delete(rawMsg, key) - case "statuses": - err = unpopulate(val, "Statuses", &v.Statuses) - delete(rawMsg, key) - case "vmAgent": - err = unpopulate(val, "VMAgent", &v.VMAgent) - delete(rawMsg, key) - case "vmHealth": - err = unpopulate(val, "VMHealth", &v.VMHealth) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMListResult. -func (v VirtualMachineScaleSetVMListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", v.NextLink) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMListResult. -func (v *VirtualMachineScaleSetVMListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &v.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMNetworkProfileConfiguration. -func (v VirtualMachineScaleSetVMNetworkProfileConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "networkInterfaceConfigurations", v.NetworkInterfaceConfigurations) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMNetworkProfileConfiguration. -func (v *VirtualMachineScaleSetVMNetworkProfileConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "networkInterfaceConfigurations": - err = unpopulate(val, "NetworkInterfaceConfigurations", &v.NetworkInterfaceConfigurations) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMProfile. -func (v VirtualMachineScaleSetVMProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "applicationProfile", v.ApplicationProfile) - populate(objectMap, "billingProfile", v.BillingProfile) - populate(objectMap, "capacityReservation", v.CapacityReservation) - populate(objectMap, "diagnosticsProfile", v.DiagnosticsProfile) - populate(objectMap, "evictionPolicy", v.EvictionPolicy) - populate(objectMap, "extensionProfile", v.ExtensionProfile) - populate(objectMap, "hardwareProfile", v.HardwareProfile) - populate(objectMap, "licenseType", v.LicenseType) - populate(objectMap, "networkProfile", v.NetworkProfile) - populate(objectMap, "osProfile", v.OSProfile) - populate(objectMap, "priority", v.Priority) - populate(objectMap, "scheduledEventsProfile", v.ScheduledEventsProfile) - populate(objectMap, "securityPostureReference", v.SecurityPostureReference) - populate(objectMap, "securityProfile", v.SecurityProfile) - populate(objectMap, "serviceArtifactReference", v.ServiceArtifactReference) - populate(objectMap, "storageProfile", v.StorageProfile) - populateDateTimeRFC3339(objectMap, "timeCreated", v.TimeCreated) - populate(objectMap, "userData", v.UserData) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMProfile. -func (v *VirtualMachineScaleSetVMProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "applicationProfile": - err = unpopulate(val, "ApplicationProfile", &v.ApplicationProfile) - delete(rawMsg, key) - case "billingProfile": - err = unpopulate(val, "BillingProfile", &v.BillingProfile) - delete(rawMsg, key) - case "capacityReservation": - err = unpopulate(val, "CapacityReservation", &v.CapacityReservation) - delete(rawMsg, key) - case "diagnosticsProfile": - err = unpopulate(val, "DiagnosticsProfile", &v.DiagnosticsProfile) - delete(rawMsg, key) - case "evictionPolicy": - err = unpopulate(val, "EvictionPolicy", &v.EvictionPolicy) - delete(rawMsg, key) - case "extensionProfile": - err = unpopulate(val, "ExtensionProfile", &v.ExtensionProfile) - delete(rawMsg, key) - case "hardwareProfile": - err = unpopulate(val, "HardwareProfile", &v.HardwareProfile) - delete(rawMsg, key) - case "licenseType": - err = unpopulate(val, "LicenseType", &v.LicenseType) - delete(rawMsg, key) - case "networkProfile": - err = unpopulate(val, "NetworkProfile", &v.NetworkProfile) - delete(rawMsg, key) - case "osProfile": - err = unpopulate(val, "OSProfile", &v.OSProfile) - delete(rawMsg, key) - case "priority": - err = unpopulate(val, "Priority", &v.Priority) - delete(rawMsg, key) - case "scheduledEventsProfile": - err = unpopulate(val, "ScheduledEventsProfile", &v.ScheduledEventsProfile) - delete(rawMsg, key) - case "securityPostureReference": - err = unpopulate(val, "SecurityPostureReference", &v.SecurityPostureReference) - delete(rawMsg, key) - case "securityProfile": - err = unpopulate(val, "SecurityProfile", &v.SecurityProfile) - delete(rawMsg, key) - case "serviceArtifactReference": - err = unpopulate(val, "ServiceArtifactReference", &v.ServiceArtifactReference) - delete(rawMsg, key) - case "storageProfile": - err = unpopulate(val, "StorageProfile", &v.StorageProfile) - delete(rawMsg, key) - case "timeCreated": - err = unpopulateDateTimeRFC3339(val, "TimeCreated", &v.TimeCreated) - delete(rawMsg, key) - case "userData": - err = unpopulate(val, "UserData", &v.UserData) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMProperties. -func (v VirtualMachineScaleSetVMProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "additionalCapabilities", v.AdditionalCapabilities) - populate(objectMap, "availabilitySet", v.AvailabilitySet) - populate(objectMap, "diagnosticsProfile", v.DiagnosticsProfile) - populate(objectMap, "hardwareProfile", v.HardwareProfile) - populate(objectMap, "instanceView", v.InstanceView) - populate(objectMap, "latestModelApplied", v.LatestModelApplied) - populate(objectMap, "licenseType", v.LicenseType) - populate(objectMap, "modelDefinitionApplied", v.ModelDefinitionApplied) - populate(objectMap, "networkProfile", v.NetworkProfile) - populate(objectMap, "networkProfileConfiguration", v.NetworkProfileConfiguration) - populate(objectMap, "osProfile", v.OSProfile) - populate(objectMap, "protectionPolicy", v.ProtectionPolicy) - populate(objectMap, "provisioningState", v.ProvisioningState) - populate(objectMap, "securityProfile", v.SecurityProfile) - populate(objectMap, "storageProfile", v.StorageProfile) - populateDateTimeRFC3339(objectMap, "timeCreated", v.TimeCreated) - populate(objectMap, "userData", v.UserData) - populate(objectMap, "vmId", v.VMID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMProperties. -func (v *VirtualMachineScaleSetVMProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "additionalCapabilities": - err = unpopulate(val, "AdditionalCapabilities", &v.AdditionalCapabilities) - delete(rawMsg, key) - case "availabilitySet": - err = unpopulate(val, "AvailabilitySet", &v.AvailabilitySet) - delete(rawMsg, key) - case "diagnosticsProfile": - err = unpopulate(val, "DiagnosticsProfile", &v.DiagnosticsProfile) - delete(rawMsg, key) - case "hardwareProfile": - err = unpopulate(val, "HardwareProfile", &v.HardwareProfile) - delete(rawMsg, key) - case "instanceView": - err = unpopulate(val, "InstanceView", &v.InstanceView) - delete(rawMsg, key) - case "latestModelApplied": - err = unpopulate(val, "LatestModelApplied", &v.LatestModelApplied) - delete(rawMsg, key) - case "licenseType": - err = unpopulate(val, "LicenseType", &v.LicenseType) - delete(rawMsg, key) - case "modelDefinitionApplied": - err = unpopulate(val, "ModelDefinitionApplied", &v.ModelDefinitionApplied) - delete(rawMsg, key) - case "networkProfile": - err = unpopulate(val, "NetworkProfile", &v.NetworkProfile) - delete(rawMsg, key) - case "networkProfileConfiguration": - err = unpopulate(val, "NetworkProfileConfiguration", &v.NetworkProfileConfiguration) - delete(rawMsg, key) - case "osProfile": - err = unpopulate(val, "OSProfile", &v.OSProfile) - delete(rawMsg, key) - case "protectionPolicy": - err = unpopulate(val, "ProtectionPolicy", &v.ProtectionPolicy) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) - delete(rawMsg, key) - case "securityProfile": - err = unpopulate(val, "SecurityProfile", &v.SecurityProfile) - delete(rawMsg, key) - case "storageProfile": - err = unpopulate(val, "StorageProfile", &v.StorageProfile) - delete(rawMsg, key) - case "timeCreated": - err = unpopulateDateTimeRFC3339(val, "TimeCreated", &v.TimeCreated) - delete(rawMsg, key) - case "userData": - err = unpopulate(val, "UserData", &v.UserData) - delete(rawMsg, key) - case "vmId": - err = unpopulate(val, "VMID", &v.VMID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMProtectionPolicy. -func (v VirtualMachineScaleSetVMProtectionPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "protectFromScaleIn", v.ProtectFromScaleIn) - populate(objectMap, "protectFromScaleSetActions", v.ProtectFromScaleSetActions) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMProtectionPolicy. -func (v *VirtualMachineScaleSetVMProtectionPolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "protectFromScaleIn": - err = unpopulate(val, "ProtectFromScaleIn", &v.ProtectFromScaleIn) - delete(rawMsg, key) - case "protectFromScaleSetActions": - err = unpopulate(val, "ProtectFromScaleSetActions", &v.ProtectFromScaleSetActions) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMReimageParameters. -func (v VirtualMachineScaleSetVMReimageParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "exactVersion", v.ExactVersion) - populate(objectMap, "forceUpdateOSDiskForEphemeral", v.ForceUpdateOSDiskForEphemeral) - populate(objectMap, "osProfile", v.OSProfile) - populate(objectMap, "tempDisk", v.TempDisk) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMReimageParameters. -func (v *VirtualMachineScaleSetVMReimageParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "exactVersion": - err = unpopulate(val, "ExactVersion", &v.ExactVersion) - delete(rawMsg, key) - case "forceUpdateOSDiskForEphemeral": - err = unpopulate(val, "ForceUpdateOSDiskForEphemeral", &v.ForceUpdateOSDiskForEphemeral) - delete(rawMsg, key) - case "osProfile": - err = unpopulate(val, "OSProfile", &v.OSProfile) - delete(rawMsg, key) - case "tempDisk": - err = unpopulate(val, "TempDisk", &v.TempDisk) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineSize. -func (v VirtualMachineSize) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "maxDataDiskCount", v.MaxDataDiskCount) - populate(objectMap, "memoryInMB", v.MemoryInMB) - populate(objectMap, "name", v.Name) - populate(objectMap, "numberOfCores", v.NumberOfCores) - populate(objectMap, "osDiskSizeInMB", v.OSDiskSizeInMB) - populate(objectMap, "resourceDiskSizeInMB", v.ResourceDiskSizeInMB) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineSize. -func (v *VirtualMachineSize) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "maxDataDiskCount": - err = unpopulate(val, "MaxDataDiskCount", &v.MaxDataDiskCount) - delete(rawMsg, key) - case "memoryInMB": - err = unpopulate(val, "MemoryInMB", &v.MemoryInMB) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "numberOfCores": - err = unpopulate(val, "NumberOfCores", &v.NumberOfCores) - delete(rawMsg, key) - case "osDiskSizeInMB": - err = unpopulate(val, "OSDiskSizeInMB", &v.OSDiskSizeInMB) - delete(rawMsg, key) - case "resourceDiskSizeInMB": - err = unpopulate(val, "ResourceDiskSizeInMB", &v.ResourceDiskSizeInMB) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineSizeListResult. -func (v VirtualMachineSizeListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineSizeListResult. -func (v *VirtualMachineSizeListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineSoftwarePatchProperties. -func (v VirtualMachineSoftwarePatchProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "activityId", v.ActivityID) - populate(objectMap, "assessmentState", v.AssessmentState) - populate(objectMap, "classifications", v.Classifications) - populate(objectMap, "kbId", v.KbID) - populateDateTimeRFC3339(objectMap, "lastModifiedDateTime", v.LastModifiedDateTime) - populate(objectMap, "name", v.Name) - populate(objectMap, "patchId", v.PatchID) - populateDateTimeRFC3339(objectMap, "publishedDate", v.PublishedDate) - populate(objectMap, "rebootBehavior", v.RebootBehavior) - populate(objectMap, "version", v.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineSoftwarePatchProperties. -func (v *VirtualMachineSoftwarePatchProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "activityId": - err = unpopulate(val, "ActivityID", &v.ActivityID) - delete(rawMsg, key) - case "assessmentState": - err = unpopulate(val, "AssessmentState", &v.AssessmentState) - delete(rawMsg, key) - case "classifications": - err = unpopulate(val, "Classifications", &v.Classifications) - delete(rawMsg, key) - case "kbId": - err = unpopulate(val, "KbID", &v.KbID) - delete(rawMsg, key) - case "lastModifiedDateTime": - err = unpopulateDateTimeRFC3339(val, "LastModifiedDateTime", &v.LastModifiedDateTime) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "patchId": - err = unpopulate(val, "PatchID", &v.PatchID) - delete(rawMsg, key) - case "publishedDate": - err = unpopulateDateTimeRFC3339(val, "PublishedDate", &v.PublishedDate) - delete(rawMsg, key) - case "rebootBehavior": - err = unpopulate(val, "RebootBehavior", &v.RebootBehavior) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &v.Version) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineStatusCodeCount. -func (v VirtualMachineStatusCodeCount) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "code", v.Code) - populate(objectMap, "count", v.Count) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineStatusCodeCount. -func (v *VirtualMachineStatusCodeCount) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "code": - err = unpopulate(val, "Code", &v.Code) - delete(rawMsg, key) - case "count": - err = unpopulate(val, "Count", &v.Count) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualMachineUpdate. -func (v VirtualMachineUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "identity", v.Identity) - populate(objectMap, "plan", v.Plan) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "zones", v.Zones) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineUpdate. -func (v *VirtualMachineUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "identity": - err = unpopulate(val, "Identity", &v.Identity) - delete(rawMsg, key) - case "plan": - err = unpopulate(val, "Plan", &v.Plan) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &v.Tags) - delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &v.Zones) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type WinRMConfiguration. -func (w WinRMConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "listeners", w.Listeners) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type WinRMConfiguration. -func (w *WinRMConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "listeners": - err = unpopulate(val, "Listeners", &w.Listeners) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type WinRMListener. -func (w WinRMListener) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "certificateUrl", w.CertificateURL) - populate(objectMap, "protocol", w.Protocol) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type WinRMListener. -func (w *WinRMListener) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "certificateUrl": - err = unpopulate(val, "CertificateURL", &w.CertificateURL) - delete(rawMsg, key) - case "protocol": - err = unpopulate(val, "Protocol", &w.Protocol) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type WindowsConfiguration. -func (w WindowsConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "additionalUnattendContent", w.AdditionalUnattendContent) - populate(objectMap, "enableAutomaticUpdates", w.EnableAutomaticUpdates) - populate(objectMap, "enableVMAgentPlatformUpdates", w.EnableVMAgentPlatformUpdates) - populate(objectMap, "patchSettings", w.PatchSettings) - populate(objectMap, "provisionVMAgent", w.ProvisionVMAgent) - populate(objectMap, "timeZone", w.TimeZone) - populate(objectMap, "winRM", w.WinRM) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type WindowsConfiguration. -func (w *WindowsConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "additionalUnattendContent": - err = unpopulate(val, "AdditionalUnattendContent", &w.AdditionalUnattendContent) - delete(rawMsg, key) - case "enableAutomaticUpdates": - err = unpopulate(val, "EnableAutomaticUpdates", &w.EnableAutomaticUpdates) - delete(rawMsg, key) - case "enableVMAgentPlatformUpdates": - err = unpopulate(val, "EnableVMAgentPlatformUpdates", &w.EnableVMAgentPlatformUpdates) - delete(rawMsg, key) - case "patchSettings": - err = unpopulate(val, "PatchSettings", &w.PatchSettings) - delete(rawMsg, key) - case "provisionVMAgent": - err = unpopulate(val, "ProvisionVMAgent", &w.ProvisionVMAgent) - delete(rawMsg, key) - case "timeZone": - err = unpopulate(val, "TimeZone", &w.TimeZone) - delete(rawMsg, key) - case "winRM": - err = unpopulate(val, "WinRM", &w.WinRM) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type WindowsParameters. -func (w WindowsParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "classificationsToInclude", w.ClassificationsToInclude) - populate(objectMap, "excludeKbsRequiringReboot", w.ExcludeKbsRequiringReboot) - populate(objectMap, "kbNumbersToExclude", w.KbNumbersToExclude) - populate(objectMap, "kbNumbersToInclude", w.KbNumbersToInclude) - populateDateTimeRFC3339(objectMap, "maxPatchPublishDate", w.MaxPatchPublishDate) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type WindowsParameters. -func (w *WindowsParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "classificationsToInclude": - err = unpopulate(val, "ClassificationsToInclude", &w.ClassificationsToInclude) - delete(rawMsg, key) - case "excludeKbsRequiringReboot": - err = unpopulate(val, "ExcludeKbsRequiringReboot", &w.ExcludeKbsRequiringReboot) - delete(rawMsg, key) - case "kbNumbersToExclude": - err = unpopulate(val, "KbNumbersToExclude", &w.KbNumbersToExclude) - delete(rawMsg, key) - case "kbNumbersToInclude": - err = unpopulate(val, "KbNumbersToInclude", &w.KbNumbersToInclude) - delete(rawMsg, key) - case "maxPatchPublishDate": - err = unpopulateDateTimeRFC3339(val, "MaxPatchPublishDate", &w.MaxPatchPublishDate) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type WindowsVMGuestPatchAutomaticByPlatformSettings. -func (w WindowsVMGuestPatchAutomaticByPlatformSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "bypassPlatformSafetyChecksOnUserSchedule", w.BypassPlatformSafetyChecksOnUserSchedule) - populate(objectMap, "rebootSetting", w.RebootSetting) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type WindowsVMGuestPatchAutomaticByPlatformSettings. -func (w *WindowsVMGuestPatchAutomaticByPlatformSettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "bypassPlatformSafetyChecksOnUserSchedule": - err = unpopulate(val, "BypassPlatformSafetyChecksOnUserSchedule", &w.BypassPlatformSafetyChecksOnUserSchedule) - delete(rawMsg, key) - case "rebootSetting": - err = unpopulate(val, "RebootSetting", &w.RebootSetting) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - } - return nil -} - -func populate(m map[string]any, k string, v any) { - if v == nil { - return - } else if azcore.IsNullValue(v) { - m[k] = nil - } else if !reflect.ValueOf(v).IsNil() { - m[k] = v - } -} - -func populateAny(m map[string]any, k string, v any) { - if v == nil { - return - } else if azcore.IsNullValue(v) { - m[k] = nil - } else { - m[k] = v - } -} - -func unpopulate(data json.RawMessage, fn string, v any) error { - if data == nil || string(data) == "null" { - return nil - } - if err := json.Unmarshal(data, v); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - return nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/operations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/operations_client.go deleted file mode 100644 index 7c438a56155..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/operations_client.go +++ /dev/null @@ -1,89 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" -) - -// OperationsClient contains the methods for the Operations group. -// Don't use this type directly, use NewOperationsClient() instead. -type OperationsClient struct { - internal *arm.Client -} - -// NewOperationsClient creates a new instance of OperationsClient with the specified values. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &OperationsClient{ - internal: cl, - } - return client, nil -} - -// NewListPager - Gets a list of compute operations. -// -// Generated from API version 2024-03-01 -// - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. -func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ - More: func(page OperationsClientListResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *OperationsClientListResponse) (OperationsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "OperationsClient.NewListPager") - req, err := client.listCreateRequest(ctx, options) - if err != nil { - return OperationsClientListResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return OperationsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return OperationsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) { - urlPath := "/providers/Microsoft.Compute/operations" - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsClientListResponse, error) { - result := OperationsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.OperationListResult); err != nil { - return OperationsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/options.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/options.go deleted file mode 100644 index 5ea3446d061..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/options.go +++ /dev/null @@ -1,1986 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -// AvailabilitySetsClientCreateOrUpdateOptions contains the optional parameters for the AvailabilitySetsClient.CreateOrUpdate -// method. -type AvailabilitySetsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// AvailabilitySetsClientDeleteOptions contains the optional parameters for the AvailabilitySetsClient.Delete method. -type AvailabilitySetsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// AvailabilitySetsClientGetOptions contains the optional parameters for the AvailabilitySetsClient.Get method. -type AvailabilitySetsClientGetOptions struct { - // placeholder for future optional parameters -} - -// AvailabilitySetsClientListAvailableSizesOptions contains the optional parameters for the AvailabilitySetsClient.NewListAvailableSizesPager -// method. -type AvailabilitySetsClientListAvailableSizesOptions struct { - // placeholder for future optional parameters -} - -// AvailabilitySetsClientListBySubscriptionOptions contains the optional parameters for the AvailabilitySetsClient.NewListBySubscriptionPager -// method. -type AvailabilitySetsClientListBySubscriptionOptions struct { - // The expand expression to apply to the operation. Allowed values are 'instanceView'. - Expand *string -} - -// AvailabilitySetsClientListOptions contains the optional parameters for the AvailabilitySetsClient.NewListPager method. -type AvailabilitySetsClientListOptions struct { - // placeholder for future optional parameters -} - -// AvailabilitySetsClientUpdateOptions contains the optional parameters for the AvailabilitySetsClient.Update method. -type AvailabilitySetsClientUpdateOptions struct { - // placeholder for future optional parameters -} - -// CapacityReservationGroupsClientCreateOrUpdateOptions contains the optional parameters for the CapacityReservationGroupsClient.CreateOrUpdate -// method. -type CapacityReservationGroupsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// CapacityReservationGroupsClientDeleteOptions contains the optional parameters for the CapacityReservationGroupsClient.Delete -// method. -type CapacityReservationGroupsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// CapacityReservationGroupsClientGetOptions contains the optional parameters for the CapacityReservationGroupsClient.Get -// method. -type CapacityReservationGroupsClientGetOptions struct { - // The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance views of the capacity - // reservations under the capacity reservation group which is a snapshot of the - // runtime properties of a capacity reservation that is managed by the platform and can change outside of control plane operations. - Expand *CapacityReservationGroupInstanceViewTypes -} - -// CapacityReservationGroupsClientListByResourceGroupOptions contains the optional parameters for the CapacityReservationGroupsClient.NewListByResourceGroupPager -// method. -type CapacityReservationGroupsClientListByResourceGroupOptions struct { - // The expand expression to apply on the operation. Based on the expand param(s) specified we return Virtual Machine or ScaleSet - // VM Instance or both resource Ids which are associated to capacity - // reservation group in the response. - Expand *ExpandTypesForGetCapacityReservationGroups -} - -// CapacityReservationGroupsClientListBySubscriptionOptions contains the optional parameters for the CapacityReservationGroupsClient.NewListBySubscriptionPager -// method. -type CapacityReservationGroupsClientListBySubscriptionOptions struct { - // The expand expression to apply on the operation. Based on the expand param(s) specified we return Virtual Machine or ScaleSet - // VM Instance or both resource Ids which are associated to capacity - // reservation group in the response. - Expand *ExpandTypesForGetCapacityReservationGroups - - // The query option to fetch Capacity Reservation Group Resource Ids. - // 'CreatedInSubscription' enables fetching Resource Ids for all capacity reservation group resources created in the subscription. - // 'SharedWithSubscription' enables fetching Resource Ids for all capacity reservation group resources shared with the subscription. - // 'All' enables fetching Resource Ids for all capacity reservation group resources shared with the subscription and created - // in the subscription. - ResourceIDsOnly *ResourceIDOptionsForGetCapacityReservationGroups -} - -// CapacityReservationGroupsClientUpdateOptions contains the optional parameters for the CapacityReservationGroupsClient.Update -// method. -type CapacityReservationGroupsClientUpdateOptions struct { - // placeholder for future optional parameters -} - -// CapacityReservationsClientBeginCreateOrUpdateOptions contains the optional parameters for the CapacityReservationsClient.BeginCreateOrUpdate -// method. -type CapacityReservationsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CapacityReservationsClientBeginDeleteOptions contains the optional parameters for the CapacityReservationsClient.BeginDelete -// method. -type CapacityReservationsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CapacityReservationsClientBeginUpdateOptions contains the optional parameters for the CapacityReservationsClient.BeginUpdate -// method. -type CapacityReservationsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CapacityReservationsClientGetOptions contains the optional parameters for the CapacityReservationsClient.Get method. -type CapacityReservationsClientGetOptions struct { - // The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime properties of the capacity - // reservation that is managed by the platform and can change outside of - // control plane operations. - Expand *CapacityReservationInstanceViewTypes -} - -// CapacityReservationsClientListByCapacityReservationGroupOptions contains the optional parameters for the CapacityReservationsClient.NewListByCapacityReservationGroupPager -// method. -type CapacityReservationsClientListByCapacityReservationGroupOptions struct { - // placeholder for future optional parameters -} - -// CloudServiceOperatingSystemsClientGetOSFamilyOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.GetOSFamily -// method. -type CloudServiceOperatingSystemsClientGetOSFamilyOptions struct { - // placeholder for future optional parameters -} - -// CloudServiceOperatingSystemsClientGetOSVersionOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.GetOSVersion -// method. -type CloudServiceOperatingSystemsClientGetOSVersionOptions struct { - // placeholder for future optional parameters -} - -// CloudServiceOperatingSystemsClientListOSFamiliesOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.NewListOSFamiliesPager -// method. -type CloudServiceOperatingSystemsClientListOSFamiliesOptions struct { - // placeholder for future optional parameters -} - -// CloudServiceOperatingSystemsClientListOSVersionsOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.NewListOSVersionsPager -// method. -type CloudServiceOperatingSystemsClientListOSVersionsOptions struct { - // placeholder for future optional parameters -} - -// CloudServiceRoleInstancesClientBeginDeleteOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginDelete -// method. -type CloudServiceRoleInstancesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServiceRoleInstancesClientBeginRebuildOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginRebuild -// method. -type CloudServiceRoleInstancesClientBeginRebuildOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServiceRoleInstancesClientBeginReimageOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginReimage -// method. -type CloudServiceRoleInstancesClientBeginReimageOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServiceRoleInstancesClientBeginRestartOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginRestart -// method. -type CloudServiceRoleInstancesClientBeginRestartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServiceRoleInstancesClientGetInstanceViewOptions contains the optional parameters for the CloudServiceRoleInstancesClient.GetInstanceView -// method. -type CloudServiceRoleInstancesClientGetInstanceViewOptions struct { - // placeholder for future optional parameters -} - -// CloudServiceRoleInstancesClientGetOptions contains the optional parameters for the CloudServiceRoleInstancesClient.Get -// method. -type CloudServiceRoleInstancesClientGetOptions struct { - // The expand expression to apply to the operation. 'UserData' is not supported for cloud services. - Expand *InstanceViewTypes -} - -// CloudServiceRoleInstancesClientGetRemoteDesktopFileOptions contains the optional parameters for the CloudServiceRoleInstancesClient.GetRemoteDesktopFile -// method. -type CloudServiceRoleInstancesClientGetRemoteDesktopFileOptions struct { - // placeholder for future optional parameters -} - -// CloudServiceRoleInstancesClientListOptions contains the optional parameters for the CloudServiceRoleInstancesClient.NewListPager -// method. -type CloudServiceRoleInstancesClientListOptions struct { - // The expand expression to apply to the operation. 'UserData' is not supported for cloud services. - Expand *InstanceViewTypes -} - -// CloudServiceRolesClientGetOptions contains the optional parameters for the CloudServiceRolesClient.Get method. -type CloudServiceRolesClientGetOptions struct { - // placeholder for future optional parameters -} - -// CloudServiceRolesClientListOptions contains the optional parameters for the CloudServiceRolesClient.NewListPager method. -type CloudServiceRolesClientListOptions struct { - // placeholder for future optional parameters -} - -// CloudServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the CloudServicesClient.BeginCreateOrUpdate -// method. -type CloudServicesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesClientBeginDeleteInstancesOptions contains the optional parameters for the CloudServicesClient.BeginDeleteInstances -// method. -type CloudServicesClientBeginDeleteInstancesOptions struct { - // List of cloud service role instance names. - Parameters *RoleInstances - - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesClientBeginDeleteOptions contains the optional parameters for the CloudServicesClient.BeginDelete method. -type CloudServicesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesClientBeginPowerOffOptions contains the optional parameters for the CloudServicesClient.BeginPowerOff method. -type CloudServicesClientBeginPowerOffOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesClientBeginRebuildOptions contains the optional parameters for the CloudServicesClient.BeginRebuild method. -type CloudServicesClientBeginRebuildOptions struct { - // List of cloud service role instance names. - Parameters *RoleInstances - - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesClientBeginReimageOptions contains the optional parameters for the CloudServicesClient.BeginReimage method. -type CloudServicesClientBeginReimageOptions struct { - // List of cloud service role instance names. - Parameters *RoleInstances - - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesClientBeginRestartOptions contains the optional parameters for the CloudServicesClient.BeginRestart method. -type CloudServicesClientBeginRestartOptions struct { - // List of cloud service role instance names. - Parameters *RoleInstances - - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesClientBeginStartOptions contains the optional parameters for the CloudServicesClient.BeginStart method. -type CloudServicesClientBeginStartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesClientBeginUpdateOptions contains the optional parameters for the CloudServicesClient.BeginUpdate method. -type CloudServicesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesClientGetInstanceViewOptions contains the optional parameters for the CloudServicesClient.GetInstanceView -// method. -type CloudServicesClientGetInstanceViewOptions struct { - // placeholder for future optional parameters -} - -// CloudServicesClientGetOptions contains the optional parameters for the CloudServicesClient.Get method. -type CloudServicesClientGetOptions struct { - // placeholder for future optional parameters -} - -// CloudServicesClientListAllOptions contains the optional parameters for the CloudServicesClient.NewListAllPager method. -type CloudServicesClientListAllOptions struct { - // placeholder for future optional parameters -} - -// CloudServicesClientListOptions contains the optional parameters for the CloudServicesClient.NewListPager method. -type CloudServicesClientListOptions struct { - // placeholder for future optional parameters -} - -// CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions contains the optional parameters for the CloudServicesUpdateDomainClient.BeginWalkUpdateDomain -// method. -type CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesUpdateDomainClientGetUpdateDomainOptions contains the optional parameters for the CloudServicesUpdateDomainClient.GetUpdateDomain -// method. -type CloudServicesUpdateDomainClientGetUpdateDomainOptions struct { - // placeholder for future optional parameters -} - -// CloudServicesUpdateDomainClientListUpdateDomainsOptions contains the optional parameters for the CloudServicesUpdateDomainClient.NewListUpdateDomainsPager -// method. -type CloudServicesUpdateDomainClientListUpdateDomainsOptions struct { - // placeholder for future optional parameters -} - -// CommunityGalleriesClientGetOptions contains the optional parameters for the CommunityGalleriesClient.Get method. -type CommunityGalleriesClientGetOptions struct { - // placeholder for future optional parameters -} - -// CommunityGalleryImageVersionsClientGetOptions contains the optional parameters for the CommunityGalleryImageVersionsClient.Get -// method. -type CommunityGalleryImageVersionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// CommunityGalleryImageVersionsClientListOptions contains the optional parameters for the CommunityGalleryImageVersionsClient.NewListPager -// method. -type CommunityGalleryImageVersionsClientListOptions struct { - // placeholder for future optional parameters -} - -// CommunityGalleryImagesClientGetOptions contains the optional parameters for the CommunityGalleryImagesClient.Get method. -type CommunityGalleryImagesClientGetOptions struct { - // placeholder for future optional parameters -} - -// CommunityGalleryImagesClientListOptions contains the optional parameters for the CommunityGalleryImagesClient.NewListPager -// method. -type CommunityGalleryImagesClientListOptions struct { - // placeholder for future optional parameters -} - -// DedicatedHostGroupsClientCreateOrUpdateOptions contains the optional parameters for the DedicatedHostGroupsClient.CreateOrUpdate -// method. -type DedicatedHostGroupsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// DedicatedHostGroupsClientDeleteOptions contains the optional parameters for the DedicatedHostGroupsClient.Delete method. -type DedicatedHostGroupsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// DedicatedHostGroupsClientGetOptions contains the optional parameters for the DedicatedHostGroupsClient.Get method. -type DedicatedHostGroupsClientGetOptions struct { - // The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance views of the dedicated - // hosts under the dedicated host group. 'UserData' is not supported for - // dedicated host group. - Expand *InstanceViewTypes -} - -// DedicatedHostGroupsClientListByResourceGroupOptions contains the optional parameters for the DedicatedHostGroupsClient.NewListByResourceGroupPager -// method. -type DedicatedHostGroupsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// DedicatedHostGroupsClientListBySubscriptionOptions contains the optional parameters for the DedicatedHostGroupsClient.NewListBySubscriptionPager -// method. -type DedicatedHostGroupsClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// DedicatedHostGroupsClientUpdateOptions contains the optional parameters for the DedicatedHostGroupsClient.Update method. -type DedicatedHostGroupsClientUpdateOptions struct { - // placeholder for future optional parameters -} - -// DedicatedHostsClientBeginCreateOrUpdateOptions contains the optional parameters for the DedicatedHostsClient.BeginCreateOrUpdate -// method. -type DedicatedHostsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DedicatedHostsClientBeginDeleteOptions contains the optional parameters for the DedicatedHostsClient.BeginDelete method. -type DedicatedHostsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DedicatedHostsClientBeginRedeployOptions contains the optional parameters for the DedicatedHostsClient.BeginRedeploy method. -type DedicatedHostsClientBeginRedeployOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DedicatedHostsClientBeginRestartOptions contains the optional parameters for the DedicatedHostsClient.BeginRestart method. -type DedicatedHostsClientBeginRestartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DedicatedHostsClientBeginUpdateOptions contains the optional parameters for the DedicatedHostsClient.BeginUpdate method. -type DedicatedHostsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DedicatedHostsClientGetOptions contains the optional parameters for the DedicatedHostsClient.Get method. -type DedicatedHostsClientGetOptions struct { - // The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance views of the dedicated - // host. 'UserData' is not supported for dedicated host. - Expand *InstanceViewTypes -} - -// DedicatedHostsClientListAvailableSizesOptions contains the optional parameters for the DedicatedHostsClient.NewListAvailableSizesPager -// method. -type DedicatedHostsClientListAvailableSizesOptions struct { - // placeholder for future optional parameters -} - -// DedicatedHostsClientListByHostGroupOptions contains the optional parameters for the DedicatedHostsClient.NewListByHostGroupPager -// method. -type DedicatedHostsClientListByHostGroupOptions struct { - // placeholder for future optional parameters -} - -// DiskAccessesClientBeginCreateOrUpdateOptions contains the optional parameters for the DiskAccessesClient.BeginCreateOrUpdate -// method. -type DiskAccessesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskAccessesClientBeginDeleteAPrivateEndpointConnectionOptions contains the optional parameters for the DiskAccessesClient.BeginDeleteAPrivateEndpointConnection -// method. -type DiskAccessesClientBeginDeleteAPrivateEndpointConnectionOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskAccessesClientBeginDeleteOptions contains the optional parameters for the DiskAccessesClient.BeginDelete method. -type DiskAccessesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskAccessesClientBeginUpdateAPrivateEndpointConnectionOptions contains the optional parameters for the DiskAccessesClient.BeginUpdateAPrivateEndpointConnection -// method. -type DiskAccessesClientBeginUpdateAPrivateEndpointConnectionOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskAccessesClientBeginUpdateOptions contains the optional parameters for the DiskAccessesClient.BeginUpdate method. -type DiskAccessesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskAccessesClientGetAPrivateEndpointConnectionOptions contains the optional parameters for the DiskAccessesClient.GetAPrivateEndpointConnection -// method. -type DiskAccessesClientGetAPrivateEndpointConnectionOptions struct { - // placeholder for future optional parameters -} - -// DiskAccessesClientGetOptions contains the optional parameters for the DiskAccessesClient.Get method. -type DiskAccessesClientGetOptions struct { - // placeholder for future optional parameters -} - -// DiskAccessesClientGetPrivateLinkResourcesOptions contains the optional parameters for the DiskAccessesClient.GetPrivateLinkResources -// method. -type DiskAccessesClientGetPrivateLinkResourcesOptions struct { - // placeholder for future optional parameters -} - -// DiskAccessesClientListByResourceGroupOptions contains the optional parameters for the DiskAccessesClient.NewListByResourceGroupPager -// method. -type DiskAccessesClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// DiskAccessesClientListOptions contains the optional parameters for the DiskAccessesClient.NewListPager method. -type DiskAccessesClientListOptions struct { - // placeholder for future optional parameters -} - -// DiskAccessesClientListPrivateEndpointConnectionsOptions contains the optional parameters for the DiskAccessesClient.NewListPrivateEndpointConnectionsPager -// method. -type DiskAccessesClientListPrivateEndpointConnectionsOptions struct { - // placeholder for future optional parameters -} - -// DiskEncryptionSetsClientBeginCreateOrUpdateOptions contains the optional parameters for the DiskEncryptionSetsClient.BeginCreateOrUpdate -// method. -type DiskEncryptionSetsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskEncryptionSetsClientBeginDeleteOptions contains the optional parameters for the DiskEncryptionSetsClient.BeginDelete -// method. -type DiskEncryptionSetsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskEncryptionSetsClientBeginUpdateOptions contains the optional parameters for the DiskEncryptionSetsClient.BeginUpdate -// method. -type DiskEncryptionSetsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskEncryptionSetsClientGetOptions contains the optional parameters for the DiskEncryptionSetsClient.Get method. -type DiskEncryptionSetsClientGetOptions struct { - // placeholder for future optional parameters -} - -// DiskEncryptionSetsClientListAssociatedResourcesOptions contains the optional parameters for the DiskEncryptionSetsClient.NewListAssociatedResourcesPager -// method. -type DiskEncryptionSetsClientListAssociatedResourcesOptions struct { - // placeholder for future optional parameters -} - -// DiskEncryptionSetsClientListByResourceGroupOptions contains the optional parameters for the DiskEncryptionSetsClient.NewListByResourceGroupPager -// method. -type DiskEncryptionSetsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// DiskEncryptionSetsClientListOptions contains the optional parameters for the DiskEncryptionSetsClient.NewListPager method. -type DiskEncryptionSetsClientListOptions struct { - // placeholder for future optional parameters -} - -// DiskRestorePointClientBeginGrantAccessOptions contains the optional parameters for the DiskRestorePointClient.BeginGrantAccess -// method. -type DiskRestorePointClientBeginGrantAccessOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskRestorePointClientBeginRevokeAccessOptions contains the optional parameters for the DiskRestorePointClient.BeginRevokeAccess -// method. -type DiskRestorePointClientBeginRevokeAccessOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskRestorePointClientGetOptions contains the optional parameters for the DiskRestorePointClient.Get method. -type DiskRestorePointClientGetOptions struct { - // placeholder for future optional parameters -} - -// DiskRestorePointClientListByRestorePointOptions contains the optional parameters for the DiskRestorePointClient.NewListByRestorePointPager -// method. -type DiskRestorePointClientListByRestorePointOptions struct { - // placeholder for future optional parameters -} - -// DisksClientBeginCreateOrUpdateOptions contains the optional parameters for the DisksClient.BeginCreateOrUpdate method. -type DisksClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DisksClientBeginDeleteOptions contains the optional parameters for the DisksClient.BeginDelete method. -type DisksClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DisksClientBeginGrantAccessOptions contains the optional parameters for the DisksClient.BeginGrantAccess method. -type DisksClientBeginGrantAccessOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DisksClientBeginRevokeAccessOptions contains the optional parameters for the DisksClient.BeginRevokeAccess method. -type DisksClientBeginRevokeAccessOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DisksClientBeginUpdateOptions contains the optional parameters for the DisksClient.BeginUpdate method. -type DisksClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DisksClientGetOptions contains the optional parameters for the DisksClient.Get method. -type DisksClientGetOptions struct { - // placeholder for future optional parameters -} - -// DisksClientListByResourceGroupOptions contains the optional parameters for the DisksClient.NewListByResourceGroupPager -// method. -type DisksClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// DisksClientListOptions contains the optional parameters for the DisksClient.NewListPager method. -type DisksClientListOptions struct { - // placeholder for future optional parameters -} - -// GalleriesClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleriesClient.BeginCreateOrUpdate -// method. -type GalleriesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleriesClientBeginDeleteOptions contains the optional parameters for the GalleriesClient.BeginDelete method. -type GalleriesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleriesClientBeginUpdateOptions contains the optional parameters for the GalleriesClient.BeginUpdate method. -type GalleriesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleriesClientGetOptions contains the optional parameters for the GalleriesClient.Get method. -type GalleriesClientGetOptions struct { - // The expand query option to apply on the operation. - Expand *GalleryExpandParams - - // The select expression to apply on the operation. - Select *SelectPermissions -} - -// GalleriesClientListByResourceGroupOptions contains the optional parameters for the GalleriesClient.NewListByResourceGroupPager -// method. -type GalleriesClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// GalleriesClientListOptions contains the optional parameters for the GalleriesClient.NewListPager method. -type GalleriesClientListOptions struct { - // placeholder for future optional parameters -} - -// GalleryApplicationVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryApplicationVersionsClient.BeginCreateOrUpdate -// method. -type GalleryApplicationVersionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryApplicationVersionsClientBeginDeleteOptions contains the optional parameters for the GalleryApplicationVersionsClient.BeginDelete -// method. -type GalleryApplicationVersionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryApplicationVersionsClientBeginUpdateOptions contains the optional parameters for the GalleryApplicationVersionsClient.BeginUpdate -// method. -type GalleryApplicationVersionsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryApplicationVersionsClientGetOptions contains the optional parameters for the GalleryApplicationVersionsClient.Get -// method. -type GalleryApplicationVersionsClientGetOptions struct { - // The expand expression to apply on the operation. - Expand *ReplicationStatusTypes -} - -// GalleryApplicationVersionsClientListByGalleryApplicationOptions contains the optional parameters for the GalleryApplicationVersionsClient.NewListByGalleryApplicationPager -// method. -type GalleryApplicationVersionsClientListByGalleryApplicationOptions struct { - // placeholder for future optional parameters -} - -// GalleryApplicationsClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryApplicationsClient.BeginCreateOrUpdate -// method. -type GalleryApplicationsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryApplicationsClientBeginDeleteOptions contains the optional parameters for the GalleryApplicationsClient.BeginDelete -// method. -type GalleryApplicationsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryApplicationsClientBeginUpdateOptions contains the optional parameters for the GalleryApplicationsClient.BeginUpdate -// method. -type GalleryApplicationsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryApplicationsClientGetOptions contains the optional parameters for the GalleryApplicationsClient.Get method. -type GalleryApplicationsClientGetOptions struct { - // placeholder for future optional parameters -} - -// GalleryApplicationsClientListByGalleryOptions contains the optional parameters for the GalleryApplicationsClient.NewListByGalleryPager -// method. -type GalleryApplicationsClientListByGalleryOptions struct { - // placeholder for future optional parameters -} - -// GalleryImageVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryImageVersionsClient.BeginCreateOrUpdate -// method. -type GalleryImageVersionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryImageVersionsClientBeginDeleteOptions contains the optional parameters for the GalleryImageVersionsClient.BeginDelete -// method. -type GalleryImageVersionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryImageVersionsClientBeginUpdateOptions contains the optional parameters for the GalleryImageVersionsClient.BeginUpdate -// method. -type GalleryImageVersionsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryImageVersionsClientGetOptions contains the optional parameters for the GalleryImageVersionsClient.Get method. -type GalleryImageVersionsClientGetOptions struct { - // The expand expression to apply on the operation. - Expand *ReplicationStatusTypes -} - -// GalleryImageVersionsClientListByGalleryImageOptions contains the optional parameters for the GalleryImageVersionsClient.NewListByGalleryImagePager -// method. -type GalleryImageVersionsClientListByGalleryImageOptions struct { - // placeholder for future optional parameters -} - -// GalleryImagesClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryImagesClient.BeginCreateOrUpdate -// method. -type GalleryImagesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryImagesClientBeginDeleteOptions contains the optional parameters for the GalleryImagesClient.BeginDelete method. -type GalleryImagesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryImagesClientBeginUpdateOptions contains the optional parameters for the GalleryImagesClient.BeginUpdate method. -type GalleryImagesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryImagesClientGetOptions contains the optional parameters for the GalleryImagesClient.Get method. -type GalleryImagesClientGetOptions struct { - // placeholder for future optional parameters -} - -// GalleryImagesClientListByGalleryOptions contains the optional parameters for the GalleryImagesClient.NewListByGalleryPager -// method. -type GalleryImagesClientListByGalleryOptions struct { - // placeholder for future optional parameters -} - -// GallerySharingProfileClientBeginUpdateOptions contains the optional parameters for the GallerySharingProfileClient.BeginUpdate -// method. -type GallerySharingProfileClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ImagesClientBeginCreateOrUpdateOptions contains the optional parameters for the ImagesClient.BeginCreateOrUpdate method. -type ImagesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ImagesClientBeginDeleteOptions contains the optional parameters for the ImagesClient.BeginDelete method. -type ImagesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ImagesClientBeginUpdateOptions contains the optional parameters for the ImagesClient.BeginUpdate method. -type ImagesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ImagesClientGetOptions contains the optional parameters for the ImagesClient.Get method. -type ImagesClientGetOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - -// ImagesClientListByResourceGroupOptions contains the optional parameters for the ImagesClient.NewListByResourceGroupPager -// method. -type ImagesClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// ImagesClientListOptions contains the optional parameters for the ImagesClient.NewListPager method. -type ImagesClientListOptions struct { - // placeholder for future optional parameters -} - -// LogAnalyticsClientBeginExportRequestRateByIntervalOptions contains the optional parameters for the LogAnalyticsClient.BeginExportRequestRateByInterval -// method. -type LogAnalyticsClientBeginExportRequestRateByIntervalOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// LogAnalyticsClientBeginExportThrottledRequestsOptions contains the optional parameters for the LogAnalyticsClient.BeginExportThrottledRequests -// method. -type LogAnalyticsClientBeginExportThrottledRequestsOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. -type OperationsClientListOptions struct { - // placeholder for future optional parameters -} - -// ProximityPlacementGroupsClientCreateOrUpdateOptions contains the optional parameters for the ProximityPlacementGroupsClient.CreateOrUpdate -// method. -type ProximityPlacementGroupsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// ProximityPlacementGroupsClientDeleteOptions contains the optional parameters for the ProximityPlacementGroupsClient.Delete -// method. -type ProximityPlacementGroupsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ProximityPlacementGroupsClientGetOptions contains the optional parameters for the ProximityPlacementGroupsClient.Get method. -type ProximityPlacementGroupsClientGetOptions struct { - // includeColocationStatus=true enables fetching the colocation status of all the resources in the proximity placement group. - IncludeColocationStatus *string -} - -// ProximityPlacementGroupsClientListByResourceGroupOptions contains the optional parameters for the ProximityPlacementGroupsClient.NewListByResourceGroupPager -// method. -type ProximityPlacementGroupsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// ProximityPlacementGroupsClientListBySubscriptionOptions contains the optional parameters for the ProximityPlacementGroupsClient.NewListBySubscriptionPager -// method. -type ProximityPlacementGroupsClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// ProximityPlacementGroupsClientUpdateOptions contains the optional parameters for the ProximityPlacementGroupsClient.Update -// method. -type ProximityPlacementGroupsClientUpdateOptions struct { - // placeholder for future optional parameters -} - -// ResourceSKUsClientListOptions contains the optional parameters for the ResourceSKUsClient.NewListPager method. -type ResourceSKUsClientListOptions struct { - // The filter to apply on the operation. Only location filter is supported currently. - Filter *string - - // To Include Extended Locations information or not in the response. - IncludeExtendedLocations *string -} - -// RestorePointCollectionsClientBeginDeleteOptions contains the optional parameters for the RestorePointCollectionsClient.BeginDelete -// method. -type RestorePointCollectionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RestorePointCollectionsClientCreateOrUpdateOptions contains the optional parameters for the RestorePointCollectionsClient.CreateOrUpdate -// method. -type RestorePointCollectionsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// RestorePointCollectionsClientGetOptions contains the optional parameters for the RestorePointCollectionsClient.Get method. -type RestorePointCollectionsClientGetOptions struct { - // The expand expression to apply on the operation. If expand=restorePoints, server will return all contained restore points - // in the restorePointCollection. - Expand *RestorePointCollectionExpandOptions -} - -// RestorePointCollectionsClientListAllOptions contains the optional parameters for the RestorePointCollectionsClient.NewListAllPager -// method. -type RestorePointCollectionsClientListAllOptions struct { - // placeholder for future optional parameters -} - -// RestorePointCollectionsClientListOptions contains the optional parameters for the RestorePointCollectionsClient.NewListPager -// method. -type RestorePointCollectionsClientListOptions struct { - // placeholder for future optional parameters -} - -// RestorePointCollectionsClientUpdateOptions contains the optional parameters for the RestorePointCollectionsClient.Update -// method. -type RestorePointCollectionsClientUpdateOptions struct { - // placeholder for future optional parameters -} - -// RestorePointsClientBeginCreateOptions contains the optional parameters for the RestorePointsClient.BeginCreate method. -type RestorePointsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RestorePointsClientBeginDeleteOptions contains the optional parameters for the RestorePointsClient.BeginDelete method. -type RestorePointsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RestorePointsClientGetOptions contains the optional parameters for the RestorePointsClient.Get method. -type RestorePointsClientGetOptions struct { - // The expand expression to apply on the operation. 'InstanceView' retrieves information about the run-time state of a restore - // point. - Expand *RestorePointExpandOptions -} - -// SSHPublicKeysClientCreateOptions contains the optional parameters for the SSHPublicKeysClient.Create method. -type SSHPublicKeysClientCreateOptions struct { - // placeholder for future optional parameters -} - -// SSHPublicKeysClientDeleteOptions contains the optional parameters for the SSHPublicKeysClient.Delete method. -type SSHPublicKeysClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// SSHPublicKeysClientGenerateKeyPairOptions contains the optional parameters for the SSHPublicKeysClient.GenerateKeyPair -// method. -type SSHPublicKeysClientGenerateKeyPairOptions struct { - // Parameters supplied to generate the SSH public key. - Parameters *SSHGenerateKeyPairInputParameters -} - -// SSHPublicKeysClientGetOptions contains the optional parameters for the SSHPublicKeysClient.Get method. -type SSHPublicKeysClientGetOptions struct { - // placeholder for future optional parameters -} - -// SSHPublicKeysClientListByResourceGroupOptions contains the optional parameters for the SSHPublicKeysClient.NewListByResourceGroupPager -// method. -type SSHPublicKeysClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// SSHPublicKeysClientListBySubscriptionOptions contains the optional parameters for the SSHPublicKeysClient.NewListBySubscriptionPager -// method. -type SSHPublicKeysClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// SSHPublicKeysClientUpdateOptions contains the optional parameters for the SSHPublicKeysClient.Update method. -type SSHPublicKeysClientUpdateOptions struct { - // placeholder for future optional parameters -} - -// SharedGalleriesClientGetOptions contains the optional parameters for the SharedGalleriesClient.Get method. -type SharedGalleriesClientGetOptions struct { - // placeholder for future optional parameters -} - -// SharedGalleriesClientListOptions contains the optional parameters for the SharedGalleriesClient.NewListPager method. -type SharedGalleriesClientListOptions struct { - // The query parameter to decide what shared galleries to fetch when doing listing operations. - SharedTo *SharedToValues -} - -// SharedGalleryImageVersionsClientGetOptions contains the optional parameters for the SharedGalleryImageVersionsClient.Get -// method. -type SharedGalleryImageVersionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// SharedGalleryImageVersionsClientListOptions contains the optional parameters for the SharedGalleryImageVersionsClient.NewListPager -// method. -type SharedGalleryImageVersionsClientListOptions struct { - // The query parameter to decide what shared galleries to fetch when doing listing operations. - SharedTo *SharedToValues -} - -// SharedGalleryImagesClientGetOptions contains the optional parameters for the SharedGalleryImagesClient.Get method. -type SharedGalleryImagesClientGetOptions struct { - // placeholder for future optional parameters -} - -// SharedGalleryImagesClientListOptions contains the optional parameters for the SharedGalleryImagesClient.NewListPager method. -type SharedGalleryImagesClientListOptions struct { - // The query parameter to decide what shared galleries to fetch when doing listing operations. - SharedTo *SharedToValues -} - -// SnapshotsClientBeginCreateOrUpdateOptions contains the optional parameters for the SnapshotsClient.BeginCreateOrUpdate -// method. -type SnapshotsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SnapshotsClientBeginDeleteOptions contains the optional parameters for the SnapshotsClient.BeginDelete method. -type SnapshotsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SnapshotsClientBeginGrantAccessOptions contains the optional parameters for the SnapshotsClient.BeginGrantAccess method. -type SnapshotsClientBeginGrantAccessOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SnapshotsClientBeginRevokeAccessOptions contains the optional parameters for the SnapshotsClient.BeginRevokeAccess method. -type SnapshotsClientBeginRevokeAccessOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SnapshotsClientBeginUpdateOptions contains the optional parameters for the SnapshotsClient.BeginUpdate method. -type SnapshotsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SnapshotsClientGetOptions contains the optional parameters for the SnapshotsClient.Get method. -type SnapshotsClientGetOptions struct { - // placeholder for future optional parameters -} - -// SnapshotsClientListByResourceGroupOptions contains the optional parameters for the SnapshotsClient.NewListByResourceGroupPager -// method. -type SnapshotsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// SnapshotsClientListOptions contains the optional parameters for the SnapshotsClient.NewListPager method. -type SnapshotsClientListOptions struct { - // placeholder for future optional parameters -} - -// UsageClientListOptions contains the optional parameters for the UsageClient.NewListPager method. -type UsageClientListOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineExtensionImagesClientGetOptions contains the optional parameters for the VirtualMachineExtensionImagesClient.Get -// method. -type VirtualMachineExtensionImagesClientGetOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineExtensionImagesClientListTypesOptions contains the optional parameters for the VirtualMachineExtensionImagesClient.ListTypes -// method. -type VirtualMachineExtensionImagesClientListTypesOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineExtensionImagesClientListVersionsOptions contains the optional parameters for the VirtualMachineExtensionImagesClient.ListVersions -// method. -type VirtualMachineExtensionImagesClientListVersionsOptions struct { - // The filter to apply on the operation. - Filter *string - Orderby *string - Top *int32 -} - -// VirtualMachineExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineExtensionsClient.BeginCreateOrUpdate -// method. -type VirtualMachineExtensionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineExtensionsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineExtensionsClient.BeginDelete -// method. -type VirtualMachineExtensionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineExtensionsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineExtensionsClient.BeginUpdate -// method. -type VirtualMachineExtensionsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineExtensionsClientGetOptions contains the optional parameters for the VirtualMachineExtensionsClient.Get method. -type VirtualMachineExtensionsClientGetOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - -// VirtualMachineExtensionsClientListOptions contains the optional parameters for the VirtualMachineExtensionsClient.List -// method. -type VirtualMachineExtensionsClientListOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - -// VirtualMachineImagesClientGetOptions contains the optional parameters for the VirtualMachineImagesClient.Get method. -type VirtualMachineImagesClientGetOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineImagesClientListByEdgeZoneOptions contains the optional parameters for the VirtualMachineImagesClient.ListByEdgeZone -// method. -type VirtualMachineImagesClientListByEdgeZoneOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineImagesClientListOffersOptions contains the optional parameters for the VirtualMachineImagesClient.ListOffers -// method. -type VirtualMachineImagesClientListOffersOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineImagesClientListOptions contains the optional parameters for the VirtualMachineImagesClient.List method. -type VirtualMachineImagesClientListOptions struct { - // The expand expression to apply on the operation. - Expand *string - Orderby *string - Top *int32 -} - -// VirtualMachineImagesClientListPublishersOptions contains the optional parameters for the VirtualMachineImagesClient.ListPublishers -// method. -type VirtualMachineImagesClientListPublishersOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineImagesClientListSKUsOptions contains the optional parameters for the VirtualMachineImagesClient.ListSKUs -// method. -type VirtualMachineImagesClientListSKUsOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineImagesEdgeZoneClientGetOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.Get -// method. -type VirtualMachineImagesEdgeZoneClientGetOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineImagesEdgeZoneClientListOffersOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.ListOffers -// method. -type VirtualMachineImagesEdgeZoneClientListOffersOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineImagesEdgeZoneClientListOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.List -// method. -type VirtualMachineImagesEdgeZoneClientListOptions struct { - // The expand expression to apply on the operation. - Expand *string - - // Specifies the order of the results returned. Formatted as an OData query. - Orderby *string - - // An integer value specifying the number of images to return that matches supplied values. - Top *int32 -} - -// VirtualMachineImagesEdgeZoneClientListPublishersOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.ListPublishers -// method. -type VirtualMachineImagesEdgeZoneClientListPublishersOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineImagesEdgeZoneClientListSKUsOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.ListSKUs -// method. -type VirtualMachineImagesEdgeZoneClientListSKUsOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineRunCommandsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineRunCommandsClient.BeginCreateOrUpdate -// method. -type VirtualMachineRunCommandsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineRunCommandsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineRunCommandsClient.BeginDelete -// method. -type VirtualMachineRunCommandsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineRunCommandsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineRunCommandsClient.BeginUpdate -// method. -type VirtualMachineRunCommandsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineRunCommandsClientGetByVirtualMachineOptions contains the optional parameters for the VirtualMachineRunCommandsClient.GetByVirtualMachine -// method. -type VirtualMachineRunCommandsClientGetByVirtualMachineOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - -// VirtualMachineRunCommandsClientGetOptions contains the optional parameters for the VirtualMachineRunCommandsClient.Get -// method. -type VirtualMachineRunCommandsClientGetOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineRunCommandsClientListByVirtualMachineOptions contains the optional parameters for the VirtualMachineRunCommandsClient.NewListByVirtualMachinePager -// method. -type VirtualMachineRunCommandsClientListByVirtualMachineOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - -// VirtualMachineRunCommandsClientListOptions contains the optional parameters for the VirtualMachineRunCommandsClient.NewListPager -// method. -type VirtualMachineRunCommandsClientListOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.BeginCreateOrUpdate -// method. -type VirtualMachineScaleSetExtensionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetExtensionsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.BeginDelete -// method. -type VirtualMachineScaleSetExtensionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetExtensionsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.BeginUpdate -// method. -type VirtualMachineScaleSetExtensionsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetExtensionsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.Get -// method. -type VirtualMachineScaleSetExtensionsClientGetOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - -// VirtualMachineScaleSetExtensionsClientListOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.NewListPager -// method. -type VirtualMachineScaleSetExtensionsClientListOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.BeginCancel -// method. -type VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.BeginStartExtensionUpgrade -// method. -type VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.BeginStartOSUpgrade -// method. -type VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetRollingUpgradesClientGetLatestOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.GetLatest -// method. -type VirtualMachineScaleSetRollingUpgradesClientGetLatestOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetVMExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.BeginCreateOrUpdate -// method. -type VirtualMachineScaleSetVMExtensionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMExtensionsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.BeginDelete -// method. -type VirtualMachineScaleSetVMExtensionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMExtensionsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.BeginUpdate -// method. -type VirtualMachineScaleSetVMExtensionsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMExtensionsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.Get -// method. -type VirtualMachineScaleSetVMExtensionsClientGetOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - -// VirtualMachineScaleSetVMExtensionsClientListOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.List -// method. -type VirtualMachineScaleSetVMExtensionsClientListOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - -// VirtualMachineScaleSetVMRunCommandsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.BeginCreateOrUpdate -// method. -type VirtualMachineScaleSetVMRunCommandsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMRunCommandsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.BeginDelete -// method. -type VirtualMachineScaleSetVMRunCommandsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMRunCommandsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.BeginUpdate -// method. -type VirtualMachineScaleSetVMRunCommandsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMRunCommandsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.Get -// method. -type VirtualMachineScaleSetVMRunCommandsClientGetOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - -// VirtualMachineScaleSetVMRunCommandsClientListOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.NewListPager -// method. -type VirtualMachineScaleSetVMRunCommandsClientListOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - -// VirtualMachineScaleSetVMsClientBeginApproveRollingUpgradeOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginApproveRollingUpgrade -// method. -type VirtualMachineScaleSetVMsClientBeginApproveRollingUpgradeOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientBeginAttachDetachDataDisksOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginAttachDetachDataDisks -// method. -type VirtualMachineScaleSetVMsClientBeginAttachDetachDataDisksOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientBeginDeallocateOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginDeallocate -// method. -type VirtualMachineScaleSetVMsClientBeginDeallocateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginDelete -// method. -type VirtualMachineScaleSetVMsClientBeginDeleteOptions struct { - // Optional parameter to force delete a virtual machine from a VM scale set. (Feature in Preview) - ForceDeletion *bool - - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientBeginPerformMaintenanceOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginPerformMaintenance -// method. -type VirtualMachineScaleSetVMsClientBeginPerformMaintenanceOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientBeginPowerOffOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginPowerOff -// method. -type VirtualMachineScaleSetVMsClientBeginPowerOffOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - - // The parameter to request non-graceful VM shutdown. True value for this flag indicates non-graceful shutdown whereas false - // indicates otherwise. Default value for this flag is false if not specified - SkipShutdown *bool -} - -// VirtualMachineScaleSetVMsClientBeginRedeployOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginRedeploy -// method. -type VirtualMachineScaleSetVMsClientBeginRedeployOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientBeginReimageAllOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginReimageAll -// method. -type VirtualMachineScaleSetVMsClientBeginReimageAllOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientBeginReimageOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginReimage -// method. -type VirtualMachineScaleSetVMsClientBeginReimageOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - - // Parameters for the Reimaging Virtual machine in ScaleSet. - VMScaleSetVMReimageInput *VirtualMachineScaleSetVMReimageParameters -} - -// VirtualMachineScaleSetVMsClientBeginRestartOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginRestart -// method. -type VirtualMachineScaleSetVMsClientBeginRestartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientBeginRunCommandOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginRunCommand -// method. -type VirtualMachineScaleSetVMsClientBeginRunCommandOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientBeginStartOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginStart -// method. -type VirtualMachineScaleSetVMsClientBeginStartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginUpdate -// method. -type VirtualMachineScaleSetVMsClientBeginUpdateOptions struct { - // The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value - // to prevent accidentally overwriting concurrent changes. - IfMatch *string - - // Set to '*' to allow a new record set to be created, but to prevent updating an existing record set. Other values will result - // in error from server as they are not supported. - IfNoneMatch *string - - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientGetInstanceViewOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.GetInstanceView -// method. -type VirtualMachineScaleSetVMsClientGetInstanceViewOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetVMsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.Get -// method. -type VirtualMachineScaleSetVMsClientGetOptions struct { - // The expand expression to apply on the operation. 'InstanceView' will retrieve the instance view of the virtual machine. - // 'UserData' will retrieve the UserData of the virtual machine. - Expand *InstanceViewTypes -} - -// VirtualMachineScaleSetVMsClientListOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.NewListPager -// method. -type VirtualMachineScaleSetVMsClientListOptions struct { - // The expand expression to apply to the operation. Allowed values are 'instanceView'. - Expand *string - - // The filter to apply to the operation. Allowed values are 'startswith(instanceView/statuses/code, 'PowerState') eq true', - // 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq - // false'. - Filter *string - - // The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. - Select *string -} - -// VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.RetrieveBootDiagnosticsData -// method. -type VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataOptions struct { - // Expiration duration in minutes for the SAS URIs with a value between 1 to 1440 minutes. Note: If not specified, SAS URIs - // will be generated with a default expiration duration of 120 minutes. - SasURIExpirationTimeInMinutes *int32 -} - -// VirtualMachineScaleSetVMsClientSimulateEvictionOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.SimulateEviction -// method. -type VirtualMachineScaleSetVMsClientSimulateEvictionOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetsClientBeginApproveRollingUpgradeOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginApproveRollingUpgrade -// method. -type VirtualMachineScaleSetsClientBeginApproveRollingUpgradeOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - - // A list of virtual machine instance IDs from the VM scale set. - VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs -} - -// VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginCreateOrUpdate -// method. -type VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions struct { - // The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value - // to prevent accidentally overwriting concurrent changes. - IfMatch *string - - // Set to '*' to allow a new record set to be created, but to prevent updating an existing record set. Other values will result - // in error from server as they are not supported. - IfNoneMatch *string - - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetsClientBeginDeallocateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginDeallocate -// method. -type VirtualMachineScaleSetsClientBeginDeallocateOptions struct { - // Optional parameter to hibernate a virtual machine from the VM scale set. (This feature is available for VMSS with Flexible - // OrchestrationMode only) - Hibernate *bool - - // Resumes the LRO from the provided token. - ResumeToken string - - // A list of virtual machine instance IDs from the VM scale set. - VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs -} - -// VirtualMachineScaleSetsClientBeginDeleteInstancesOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginDeleteInstances -// method. -type VirtualMachineScaleSetsClientBeginDeleteInstancesOptions struct { - // Optional parameter to force delete virtual machines from the VM scale set. (Feature in Preview) - ForceDeletion *bool - - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginDelete -// method. -type VirtualMachineScaleSetsClientBeginDeleteOptions struct { - // Optional parameter to force delete a VM scale set. (Feature in Preview) - ForceDeletion *bool - - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginPerformMaintenance -// method. -type VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - - // A list of virtual machine instance IDs from the VM scale set. - VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs -} - -// VirtualMachineScaleSetsClientBeginPowerOffOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginPowerOff -// method. -type VirtualMachineScaleSetsClientBeginPowerOffOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - - // The parameter to request non-graceful VM shutdown. True value for this flag indicates non-graceful shutdown whereas false - // indicates otherwise. Default value for this flag is false if not specified - SkipShutdown *bool - - // A list of virtual machine instance IDs from the VM scale set. - VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs -} - -// VirtualMachineScaleSetsClientBeginReapplyOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginReapply -// method. -type VirtualMachineScaleSetsClientBeginReapplyOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetsClientBeginRedeployOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginRedeploy -// method. -type VirtualMachineScaleSetsClientBeginRedeployOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - - // A list of virtual machine instance IDs from the VM scale set. - VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs -} - -// VirtualMachineScaleSetsClientBeginReimageAllOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginReimageAll -// method. -type VirtualMachineScaleSetsClientBeginReimageAllOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - - // A list of virtual machine instance IDs from the VM scale set. - VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs -} - -// VirtualMachineScaleSetsClientBeginReimageOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginReimage -// method. -type VirtualMachineScaleSetsClientBeginReimageOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - - // Parameters for Reimaging VM ScaleSet. - VMScaleSetReimageInput *VirtualMachineScaleSetReimageParameters -} - -// VirtualMachineScaleSetsClientBeginRestartOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginRestart -// method. -type VirtualMachineScaleSetsClientBeginRestartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - - // A list of virtual machine instance IDs from the VM scale set. - VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs -} - -// VirtualMachineScaleSetsClientBeginSetOrchestrationServiceStateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginSetOrchestrationServiceState -// method. -type VirtualMachineScaleSetsClientBeginSetOrchestrationServiceStateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetsClientBeginStartOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginStart -// method. -type VirtualMachineScaleSetsClientBeginStartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - - // A list of virtual machine instance IDs from the VM scale set. - VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs -} - -// VirtualMachineScaleSetsClientBeginUpdateInstancesOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginUpdateInstances -// method. -type VirtualMachineScaleSetsClientBeginUpdateInstancesOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginUpdate -// method. -type VirtualMachineScaleSetsClientBeginUpdateOptions struct { - // The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value - // to prevent accidentally overwriting concurrent changes. - IfMatch *string - - // Set to '*' to allow a new record set to be created, but to prevent updating an existing record set. Other values will result - // in error from server as they are not supported. - IfNoneMatch *string - - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetsClientConvertToSinglePlacementGroupOptions contains the optional parameters for the VirtualMachineScaleSetsClient.ConvertToSinglePlacementGroup -// method. -type VirtualMachineScaleSetsClientConvertToSinglePlacementGroupOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions contains the optional parameters -// for the VirtualMachineScaleSetsClient.ForceRecoveryServiceFabricPlatformUpdateDomainWalk method. -type VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions struct { - // The placement group id for which the manual recovery walk is requested. - PlacementGroupID *string - - // The zone in which the manual recovery walk is requested for cross zone virtual machine scale set - Zone *string -} - -// VirtualMachineScaleSetsClientGetInstanceViewOptions contains the optional parameters for the VirtualMachineScaleSetsClient.GetInstanceView -// method. -type VirtualMachineScaleSetsClientGetInstanceViewOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetsClientGetOSUpgradeHistoryOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewGetOSUpgradeHistoryPager -// method. -type VirtualMachineScaleSetsClientGetOSUpgradeHistoryOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetsClient.Get method. -type VirtualMachineScaleSetsClientGetOptions struct { - // The expand expression to apply on the operation. 'UserData' retrieves the UserData property of the VM scale set that was - // provided by the user during the VM scale set Create/Update operation - Expand *ExpandTypesForGetVMScaleSets -} - -// VirtualMachineScaleSetsClientListAllOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListAllPager -// method. -type VirtualMachineScaleSetsClientListAllOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetsClientListByLocationOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListByLocationPager -// method. -type VirtualMachineScaleSetsClientListByLocationOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetsClientListOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListPager -// method. -type VirtualMachineScaleSetsClientListOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetsClientListSKUsOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListSKUsPager -// method. -type VirtualMachineScaleSetsClientListSKUsOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineSizesClientListOptions contains the optional parameters for the VirtualMachineSizesClient.NewListPager method. -type VirtualMachineSizesClientListOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachinesClientBeginAssessPatchesOptions contains the optional parameters for the VirtualMachinesClient.BeginAssessPatches -// method. -type VirtualMachinesClientBeginAssessPatchesOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginAttachDetachDataDisksOptions contains the optional parameters for the VirtualMachinesClient.BeginAttachDetachDataDisks -// method. -type VirtualMachinesClientBeginAttachDetachDataDisksOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginCaptureOptions contains the optional parameters for the VirtualMachinesClient.BeginCapture method. -type VirtualMachinesClientBeginCaptureOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginConvertToManagedDisksOptions contains the optional parameters for the VirtualMachinesClient.BeginConvertToManagedDisks -// method. -type VirtualMachinesClientBeginConvertToManagedDisksOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachinesClient.BeginCreateOrUpdate -// method. -type VirtualMachinesClientBeginCreateOrUpdateOptions struct { - // The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value - // to prevent accidentally overwriting concurrent changes. - IfMatch *string - - // Set to '*' to allow a new record set to be created, but to prevent updating an existing record set. Other values will result - // in error from server as they are not supported. - IfNoneMatch *string - - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginDeallocateOptions contains the optional parameters for the VirtualMachinesClient.BeginDeallocate -// method. -type VirtualMachinesClientBeginDeallocateOptions struct { - // Optional parameter to hibernate a virtual machine. (Feature in Preview) - Hibernate *bool - - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginDeleteOptions contains the optional parameters for the VirtualMachinesClient.BeginDelete method. -type VirtualMachinesClientBeginDeleteOptions struct { - // Optional parameter to force delete virtual machines. - ForceDeletion *bool - - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginInstallPatchesOptions contains the optional parameters for the VirtualMachinesClient.BeginInstallPatches -// method. -type VirtualMachinesClientBeginInstallPatchesOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginPerformMaintenanceOptions contains the optional parameters for the VirtualMachinesClient.BeginPerformMaintenance -// method. -type VirtualMachinesClientBeginPerformMaintenanceOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginPowerOffOptions contains the optional parameters for the VirtualMachinesClient.BeginPowerOff -// method. -type VirtualMachinesClientBeginPowerOffOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - - // The parameter to request non-graceful VM shutdown. True value for this flag indicates non-graceful shutdown whereas false - // indicates otherwise. Default value for this flag is false if not specified - SkipShutdown *bool -} - -// VirtualMachinesClientBeginReapplyOptions contains the optional parameters for the VirtualMachinesClient.BeginReapply method. -type VirtualMachinesClientBeginReapplyOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginRedeployOptions contains the optional parameters for the VirtualMachinesClient.BeginRedeploy -// method. -type VirtualMachinesClientBeginRedeployOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginReimageOptions contains the optional parameters for the VirtualMachinesClient.BeginReimage method. -type VirtualMachinesClientBeginReimageOptions struct { - // Parameters supplied to the Reimage Virtual Machine operation. - Parameters *VirtualMachineReimageParameters - - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginRestartOptions contains the optional parameters for the VirtualMachinesClient.BeginRestart method. -type VirtualMachinesClientBeginRestartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginRunCommandOptions contains the optional parameters for the VirtualMachinesClient.BeginRunCommand -// method. -type VirtualMachinesClientBeginRunCommandOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginStartOptions contains the optional parameters for the VirtualMachinesClient.BeginStart method. -type VirtualMachinesClientBeginStartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginUpdateOptions contains the optional parameters for the VirtualMachinesClient.BeginUpdate method. -type VirtualMachinesClientBeginUpdateOptions struct { - // The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value - // to prevent accidentally overwriting concurrent changes. - IfMatch *string - - // Set to '*' to allow a new record set to be created, but to prevent updating an existing record set. Other values will result - // in error from server as they are not supported. - IfNoneMatch *string - - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientGeneralizeOptions contains the optional parameters for the VirtualMachinesClient.Generalize method. -type VirtualMachinesClientGeneralizeOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachinesClientGetOptions contains the optional parameters for the VirtualMachinesClient.Get method. -type VirtualMachinesClientGetOptions struct { - // The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime properties of the virtual - // machine that is managed by the platform and can change outside of control - // plane operations. 'UserData' retrieves the UserData property as part of the VM model view that was provided by the user - // during the VM Create/Update operation. - Expand *InstanceViewTypes -} - -// VirtualMachinesClientInstanceViewOptions contains the optional parameters for the VirtualMachinesClient.InstanceView method. -type VirtualMachinesClientInstanceViewOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachinesClientListAllOptions contains the optional parameters for the VirtualMachinesClient.NewListAllPager method. -type VirtualMachinesClientListAllOptions struct { - // The expand expression to apply on operation. 'instanceView' enables fetching run time status of all Virtual Machines, this - // can only be specified if a valid $filter option is specified - Expand *ExpandTypesForListVMs - - // The system query option to filter VMs returned in the response. Allowed value is 'virtualMachineScaleSet/id' eq - // /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}' - Filter *string - - // statusOnly=true enables fetching run time status of all Virtual Machines in the subscription. - StatusOnly *string -} - -// VirtualMachinesClientListAvailableSizesOptions contains the optional parameters for the VirtualMachinesClient.NewListAvailableSizesPager -// method. -type VirtualMachinesClientListAvailableSizesOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachinesClientListByLocationOptions contains the optional parameters for the VirtualMachinesClient.NewListByLocationPager -// method. -type VirtualMachinesClientListByLocationOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachinesClientListOptions contains the optional parameters for the VirtualMachinesClient.NewListPager method. -type VirtualMachinesClientListOptions struct { - // The expand expression to apply on operation. 'instanceView' enables fetching run time status of all Virtual Machines, this - // can only be specified if a valid $filter option is specified - Expand *ExpandTypeForListVMs - - // The system query option to filter VMs returned in the response. Allowed value is 'virtualMachineScaleSet/id' eq - // /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}' - Filter *string -} - -// VirtualMachinesClientRetrieveBootDiagnosticsDataOptions contains the optional parameters for the VirtualMachinesClient.RetrieveBootDiagnosticsData -// method. -type VirtualMachinesClientRetrieveBootDiagnosticsDataOptions struct { - // Expiration duration in minutes for the SAS URIs with a value between 1 to 1440 minutes. Note: If not specified, SAS URIs - // will be generated with a default expiration duration of 120 minutes. - SasURIExpirationTimeInMinutes *int32 -} - -// VirtualMachinesClientSimulateEvictionOptions contains the optional parameters for the VirtualMachinesClient.SimulateEviction -// method. -type VirtualMachinesClientSimulateEvictionOptions struct { - // placeholder for future optional parameters -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/proximityplacementgroups_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/proximityplacementgroups_client.go deleted file mode 100644 index c186592038f..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/proximityplacementgroups_client.go +++ /dev/null @@ -1,421 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ProximityPlacementGroupsClient contains the methods for the ProximityPlacementGroups group. -// Don't use this type directly, use NewProximityPlacementGroupsClient() instead. -type ProximityPlacementGroupsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewProximityPlacementGroupsClient creates a new instance of ProximityPlacementGroupsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewProximityPlacementGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProximityPlacementGroupsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &ProximityPlacementGroupsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// CreateOrUpdate - Create or update a proximity placement group. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - proximityPlacementGroupName - The name of the proximity placement group. -// - parameters - Parameters supplied to the Create Proximity Placement Group operation. -// - options - ProximityPlacementGroupsClientCreateOrUpdateOptions contains the optional parameters for the ProximityPlacementGroupsClient.CreateOrUpdate -// method. -func (client *ProximityPlacementGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters ProximityPlacementGroup, options *ProximityPlacementGroupsClientCreateOrUpdateOptions) (ProximityPlacementGroupsClientCreateOrUpdateResponse, error) { - var err error - const operationName = "ProximityPlacementGroupsClient.CreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, proximityPlacementGroupName, parameters, options) - if err != nil { - return ProximityPlacementGroupsClientCreateOrUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ProximityPlacementGroupsClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return ProximityPlacementGroupsClientCreateOrUpdateResponse{}, err - } - resp, err := client.createOrUpdateHandleResponse(httpResp) - return resp, err -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ProximityPlacementGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters ProximityPlacementGroup, options *ProximityPlacementGroupsClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if proximityPlacementGroupName == "" { - return nil, errors.New("parameter proximityPlacementGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{proximityPlacementGroupName}", url.PathEscape(proximityPlacementGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *ProximityPlacementGroupsClient) createOrUpdateHandleResponse(resp *http.Response) (ProximityPlacementGroupsClientCreateOrUpdateResponse, error) { - result := ProximityPlacementGroupsClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ProximityPlacementGroup); err != nil { - return ProximityPlacementGroupsClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// Delete - Delete a proximity placement group. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - proximityPlacementGroupName - The name of the proximity placement group. -// - options - ProximityPlacementGroupsClientDeleteOptions contains the optional parameters for the ProximityPlacementGroupsClient.Delete -// method. -func (client *ProximityPlacementGroupsClient) Delete(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, options *ProximityPlacementGroupsClientDeleteOptions) (ProximityPlacementGroupsClientDeleteResponse, error) { - var err error - const operationName = "ProximityPlacementGroupsClient.Delete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, proximityPlacementGroupName, options) - if err != nil { - return ProximityPlacementGroupsClientDeleteResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ProximityPlacementGroupsClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return ProximityPlacementGroupsClientDeleteResponse{}, err - } - return ProximityPlacementGroupsClientDeleteResponse{}, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *ProximityPlacementGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, options *ProximityPlacementGroupsClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if proximityPlacementGroupName == "" { - return nil, errors.New("parameter proximityPlacementGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{proximityPlacementGroupName}", url.PathEscape(proximityPlacementGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves information about a proximity placement group . -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - proximityPlacementGroupName - The name of the proximity placement group. -// - options - ProximityPlacementGroupsClientGetOptions contains the optional parameters for the ProximityPlacementGroupsClient.Get -// method. -func (client *ProximityPlacementGroupsClient) Get(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, options *ProximityPlacementGroupsClientGetOptions) (ProximityPlacementGroupsClientGetResponse, error) { - var err error - const operationName = "ProximityPlacementGroupsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, proximityPlacementGroupName, options) - if err != nil { - return ProximityPlacementGroupsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ProximityPlacementGroupsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return ProximityPlacementGroupsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *ProximityPlacementGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, options *ProximityPlacementGroupsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if proximityPlacementGroupName == "" { - return nil, errors.New("parameter proximityPlacementGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{proximityPlacementGroupName}", url.PathEscape(proximityPlacementGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - if options != nil && options.IncludeColocationStatus != nil { - reqQP.Set("includeColocationStatus", *options.IncludeColocationStatus) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ProximityPlacementGroupsClient) getHandleResponse(resp *http.Response) (ProximityPlacementGroupsClientGetResponse, error) { - result := ProximityPlacementGroupsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ProximityPlacementGroup); err != nil { - return ProximityPlacementGroupsClientGetResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Lists all proximity placement groups in a resource group. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - options - ProximityPlacementGroupsClientListByResourceGroupOptions contains the optional parameters for the ProximityPlacementGroupsClient.NewListByResourceGroupPager -// method. -func (client *ProximityPlacementGroupsClient) NewListByResourceGroupPager(resourceGroupName string, options *ProximityPlacementGroupsClientListByResourceGroupOptions) *runtime.Pager[ProximityPlacementGroupsClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[ProximityPlacementGroupsClientListByResourceGroupResponse]{ - More: func(page ProximityPlacementGroupsClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ProximityPlacementGroupsClientListByResourceGroupResponse) (ProximityPlacementGroupsClientListByResourceGroupResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ProximityPlacementGroupsClient.NewListByResourceGroupPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - }, nil) - if err != nil { - return ProximityPlacementGroupsClientListByResourceGroupResponse{}, err - } - return client.listByResourceGroupHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *ProximityPlacementGroupsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ProximityPlacementGroupsClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *ProximityPlacementGroupsClient) listByResourceGroupHandleResponse(resp *http.Response) (ProximityPlacementGroupsClientListByResourceGroupResponse, error) { - result := ProximityPlacementGroupsClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ProximityPlacementGroupListResult); err != nil { - return ProximityPlacementGroupsClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// NewListBySubscriptionPager - Lists all proximity placement groups in a subscription. -// -// Generated from API version 2024-03-01 -// - options - ProximityPlacementGroupsClientListBySubscriptionOptions contains the optional parameters for the ProximityPlacementGroupsClient.NewListBySubscriptionPager -// method. -func (client *ProximityPlacementGroupsClient) NewListBySubscriptionPager(options *ProximityPlacementGroupsClientListBySubscriptionOptions) *runtime.Pager[ProximityPlacementGroupsClientListBySubscriptionResponse] { - return runtime.NewPager(runtime.PagingHandler[ProximityPlacementGroupsClientListBySubscriptionResponse]{ - More: func(page ProximityPlacementGroupsClientListBySubscriptionResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ProximityPlacementGroupsClientListBySubscriptionResponse) (ProximityPlacementGroupsClientListBySubscriptionResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ProximityPlacementGroupsClient.NewListBySubscriptionPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listBySubscriptionCreateRequest(ctx, options) - }, nil) - if err != nil { - return ProximityPlacementGroupsClientListBySubscriptionResponse{}, err - } - return client.listBySubscriptionHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *ProximityPlacementGroupsClient) listBySubscriptionCreateRequest(ctx context.Context, options *ProximityPlacementGroupsClientListBySubscriptionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/proximityPlacementGroups" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listBySubscriptionHandleResponse handles the ListBySubscription response. -func (client *ProximityPlacementGroupsClient) listBySubscriptionHandleResponse(resp *http.Response) (ProximityPlacementGroupsClientListBySubscriptionResponse, error) { - result := ProximityPlacementGroupsClientListBySubscriptionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ProximityPlacementGroupListResult); err != nil { - return ProximityPlacementGroupsClientListBySubscriptionResponse{}, err - } - return result, nil -} - -// Update - Update a proximity placement group. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - proximityPlacementGroupName - The name of the proximity placement group. -// - parameters - Parameters supplied to the Update Proximity Placement Group operation. -// - options - ProximityPlacementGroupsClientUpdateOptions contains the optional parameters for the ProximityPlacementGroupsClient.Update -// method. -func (client *ProximityPlacementGroupsClient) Update(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters ProximityPlacementGroupUpdate, options *ProximityPlacementGroupsClientUpdateOptions) (ProximityPlacementGroupsClientUpdateResponse, error) { - var err error - const operationName = "ProximityPlacementGroupsClient.Update" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, proximityPlacementGroupName, parameters, options) - if err != nil { - return ProximityPlacementGroupsClientUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ProximityPlacementGroupsClientUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return ProximityPlacementGroupsClientUpdateResponse{}, err - } - resp, err := client.updateHandleResponse(httpResp) - return resp, err -} - -// updateCreateRequest creates the Update request. -func (client *ProximityPlacementGroupsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters ProximityPlacementGroupUpdate, options *ProximityPlacementGroupsClientUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if proximityPlacementGroupName == "" { - return nil, errors.New("parameter proximityPlacementGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{proximityPlacementGroupName}", url.PathEscape(proximityPlacementGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// updateHandleResponse handles the Update response. -func (client *ProximityPlacementGroupsClient) updateHandleResponse(resp *http.Response) (ProximityPlacementGroupsClientUpdateResponse, error) { - result := ProximityPlacementGroupsClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ProximityPlacementGroup); err != nil { - return ProximityPlacementGroupsClientUpdateResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/resourceskus_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/resourceskus_client.go deleted file mode 100644 index f716c1ccf07..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/resourceskus_client.go +++ /dev/null @@ -1,105 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ResourceSKUsClient contains the methods for the ResourceSKUs group. -// Don't use this type directly, use NewResourceSKUsClient() instead. -type ResourceSKUsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewResourceSKUsClient creates a new instance of ResourceSKUsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewResourceSKUsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ResourceSKUsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &ResourceSKUsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// NewListPager - Gets the list of Microsoft.Compute SKUs available for your Subscription. -// -// Generated from API version 2021-07-01 -// - options - ResourceSKUsClientListOptions contains the optional parameters for the ResourceSKUsClient.NewListPager method. -func (client *ResourceSKUsClient) NewListPager(options *ResourceSKUsClientListOptions) *runtime.Pager[ResourceSKUsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ResourceSKUsClientListResponse]{ - More: func(page ResourceSKUsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ResourceSKUsClientListResponse) (ResourceSKUsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ResourceSKUsClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, options) - }, nil) - if err != nil { - return ResourceSKUsClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *ResourceSKUsClient) listCreateRequest(ctx context.Context, options *ResourceSKUsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/skus" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Filter != nil { - reqQP.Set("$filter", *options.Filter) - } - reqQP.Set("api-version", "2021-07-01") - if options != nil && options.IncludeExtendedLocations != nil { - reqQP.Set("includeExtendedLocations", *options.IncludeExtendedLocations) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ResourceSKUsClient) listHandleResponse(resp *http.Response) (ResourceSKUsClientListResponse, error) { - result := ResourceSKUsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ResourceSKUsResult); err != nil { - return ResourceSKUsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/responses.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/responses.go deleted file mode 100644 index db4fc2bd38e..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/responses.go +++ /dev/null @@ -1,1673 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import "io" - -// AvailabilitySetsClientCreateOrUpdateResponse contains the response from method AvailabilitySetsClient.CreateOrUpdate. -type AvailabilitySetsClientCreateOrUpdateResponse struct { - // Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified - // in the same availability set are allocated to different nodes to maximize availability. For more information about availability - // sets, see [Availability sets overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For - // more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). - // Currently, a VM can only be added to an availability set at creation time. An existing VM cannot be added to an availability - // set. - AvailabilitySet -} - -// AvailabilitySetsClientDeleteResponse contains the response from method AvailabilitySetsClient.Delete. -type AvailabilitySetsClientDeleteResponse struct { - // placeholder for future response values -} - -// AvailabilitySetsClientGetResponse contains the response from method AvailabilitySetsClient.Get. -type AvailabilitySetsClientGetResponse struct { - // Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified - // in the same availability set are allocated to different nodes to maximize availability. For more information about availability - // sets, see [Availability sets overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For - // more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). - // Currently, a VM can only be added to an availability set at creation time. An existing VM cannot be added to an availability - // set. - AvailabilitySet -} - -// AvailabilitySetsClientListAvailableSizesResponse contains the response from method AvailabilitySetsClient.NewListAvailableSizesPager. -type AvailabilitySetsClientListAvailableSizesResponse struct { - // The List Virtual Machine operation response. - VirtualMachineSizeListResult -} - -// AvailabilitySetsClientListBySubscriptionResponse contains the response from method AvailabilitySetsClient.NewListBySubscriptionPager. -type AvailabilitySetsClientListBySubscriptionResponse struct { - // The List Availability Set operation response. - AvailabilitySetListResult -} - -// AvailabilitySetsClientListResponse contains the response from method AvailabilitySetsClient.NewListPager. -type AvailabilitySetsClientListResponse struct { - // The List Availability Set operation response. - AvailabilitySetListResult -} - -// AvailabilitySetsClientUpdateResponse contains the response from method AvailabilitySetsClient.Update. -type AvailabilitySetsClientUpdateResponse struct { - // Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified - // in the same availability set are allocated to different nodes to maximize availability. For more information about availability - // sets, see [Availability sets overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For - // more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). - // Currently, a VM can only be added to an availability set at creation time. An existing VM cannot be added to an availability - // set. - AvailabilitySet -} - -// CapacityReservationGroupsClientCreateOrUpdateResponse contains the response from method CapacityReservationGroupsClient.CreateOrUpdate. -type CapacityReservationGroupsClientCreateOrUpdateResponse struct { - // Specifies information about the capacity reservation group that the capacity reservations should be assigned to. Currently, - // a capacity reservation can only be added to a capacity reservation group at creation time. An existing capacity reservation - // cannot be added or moved to another capacity reservation group. - CapacityReservationGroup -} - -// CapacityReservationGroupsClientDeleteResponse contains the response from method CapacityReservationGroupsClient.Delete. -type CapacityReservationGroupsClientDeleteResponse struct { - // placeholder for future response values -} - -// CapacityReservationGroupsClientGetResponse contains the response from method CapacityReservationGroupsClient.Get. -type CapacityReservationGroupsClientGetResponse struct { - // Specifies information about the capacity reservation group that the capacity reservations should be assigned to. Currently, - // a capacity reservation can only be added to a capacity reservation group at creation time. An existing capacity reservation - // cannot be added or moved to another capacity reservation group. - CapacityReservationGroup -} - -// CapacityReservationGroupsClientListByResourceGroupResponse contains the response from method CapacityReservationGroupsClient.NewListByResourceGroupPager. -type CapacityReservationGroupsClientListByResourceGroupResponse struct { - // The List capacity reservation group with resource group response. - CapacityReservationGroupListResult -} - -// CapacityReservationGroupsClientListBySubscriptionResponse contains the response from method CapacityReservationGroupsClient.NewListBySubscriptionPager. -type CapacityReservationGroupsClientListBySubscriptionResponse struct { - // The List capacity reservation group with resource group response. - CapacityReservationGroupListResult -} - -// CapacityReservationGroupsClientUpdateResponse contains the response from method CapacityReservationGroupsClient.Update. -type CapacityReservationGroupsClientUpdateResponse struct { - // Specifies information about the capacity reservation group that the capacity reservations should be assigned to. Currently, - // a capacity reservation can only be added to a capacity reservation group at creation time. An existing capacity reservation - // cannot be added or moved to another capacity reservation group. - CapacityReservationGroup -} - -// CapacityReservationsClientCreateOrUpdateResponse contains the response from method CapacityReservationsClient.BeginCreateOrUpdate. -type CapacityReservationsClientCreateOrUpdateResponse struct { - // Specifies information about the capacity reservation. - CapacityReservation -} - -// CapacityReservationsClientDeleteResponse contains the response from method CapacityReservationsClient.BeginDelete. -type CapacityReservationsClientDeleteResponse struct { - // placeholder for future response values -} - -// CapacityReservationsClientGetResponse contains the response from method CapacityReservationsClient.Get. -type CapacityReservationsClientGetResponse struct { - // Specifies information about the capacity reservation. - CapacityReservation -} - -// CapacityReservationsClientListByCapacityReservationGroupResponse contains the response from method CapacityReservationsClient.NewListByCapacityReservationGroupPager. -type CapacityReservationsClientListByCapacityReservationGroupResponse struct { - // The list capacity reservation operation response. - CapacityReservationListResult -} - -// CapacityReservationsClientUpdateResponse contains the response from method CapacityReservationsClient.BeginUpdate. -type CapacityReservationsClientUpdateResponse struct { - // Specifies information about the capacity reservation. - CapacityReservation -} - -// CloudServiceOperatingSystemsClientGetOSFamilyResponse contains the response from method CloudServiceOperatingSystemsClient.GetOSFamily. -type CloudServiceOperatingSystemsClientGetOSFamilyResponse struct { - // Describes a cloud service OS family. - OSFamily -} - -// CloudServiceOperatingSystemsClientGetOSVersionResponse contains the response from method CloudServiceOperatingSystemsClient.GetOSVersion. -type CloudServiceOperatingSystemsClientGetOSVersionResponse struct { - // Describes a cloud service OS version. - OSVersion -} - -// CloudServiceOperatingSystemsClientListOSFamiliesResponse contains the response from method CloudServiceOperatingSystemsClient.NewListOSFamiliesPager. -type CloudServiceOperatingSystemsClientListOSFamiliesResponse struct { - // The list operation result. - OSFamilyListResult -} - -// CloudServiceOperatingSystemsClientListOSVersionsResponse contains the response from method CloudServiceOperatingSystemsClient.NewListOSVersionsPager. -type CloudServiceOperatingSystemsClientListOSVersionsResponse struct { - // The list operation result. - OSVersionListResult -} - -// CloudServiceRoleInstancesClientDeleteResponse contains the response from method CloudServiceRoleInstancesClient.BeginDelete. -type CloudServiceRoleInstancesClientDeleteResponse struct { - // placeholder for future response values -} - -// CloudServiceRoleInstancesClientGetInstanceViewResponse contains the response from method CloudServiceRoleInstancesClient.GetInstanceView. -type CloudServiceRoleInstancesClientGetInstanceViewResponse struct { - // The instance view of the role instance. - RoleInstanceView -} - -// CloudServiceRoleInstancesClientGetRemoteDesktopFileResponse contains the response from method CloudServiceRoleInstancesClient.GetRemoteDesktopFile. -type CloudServiceRoleInstancesClientGetRemoteDesktopFileResponse struct { - // Body contains the streaming response. - Body io.ReadCloser -} - -// CloudServiceRoleInstancesClientGetResponse contains the response from method CloudServiceRoleInstancesClient.Get. -type CloudServiceRoleInstancesClientGetResponse struct { - // Describes the cloud service role instance. - RoleInstance -} - -// CloudServiceRoleInstancesClientListResponse contains the response from method CloudServiceRoleInstancesClient.NewListPager. -type CloudServiceRoleInstancesClientListResponse struct { - // The list operation result. - RoleInstanceListResult -} - -// CloudServiceRoleInstancesClientRebuildResponse contains the response from method CloudServiceRoleInstancesClient.BeginRebuild. -type CloudServiceRoleInstancesClientRebuildResponse struct { - // placeholder for future response values -} - -// CloudServiceRoleInstancesClientReimageResponse contains the response from method CloudServiceRoleInstancesClient.BeginReimage. -type CloudServiceRoleInstancesClientReimageResponse struct { - // placeholder for future response values -} - -// CloudServiceRoleInstancesClientRestartResponse contains the response from method CloudServiceRoleInstancesClient.BeginRestart. -type CloudServiceRoleInstancesClientRestartResponse struct { - // placeholder for future response values -} - -// CloudServiceRolesClientGetResponse contains the response from method CloudServiceRolesClient.Get. -type CloudServiceRolesClientGetResponse struct { - // Describes a role of the cloud service. - CloudServiceRole -} - -// CloudServiceRolesClientListResponse contains the response from method CloudServiceRolesClient.NewListPager. -type CloudServiceRolesClientListResponse struct { - // The list operation result. - CloudServiceRoleListResult -} - -// CloudServicesClientCreateOrUpdateResponse contains the response from method CloudServicesClient.BeginCreateOrUpdate. -type CloudServicesClientCreateOrUpdateResponse struct { - // Describes the cloud service. - CloudService -} - -// CloudServicesClientDeleteInstancesResponse contains the response from method CloudServicesClient.BeginDeleteInstances. -type CloudServicesClientDeleteInstancesResponse struct { - // placeholder for future response values -} - -// CloudServicesClientDeleteResponse contains the response from method CloudServicesClient.BeginDelete. -type CloudServicesClientDeleteResponse struct { - // placeholder for future response values -} - -// CloudServicesClientGetInstanceViewResponse contains the response from method CloudServicesClient.GetInstanceView. -type CloudServicesClientGetInstanceViewResponse struct { - // InstanceView of CloudService as a whole - CloudServiceInstanceView -} - -// CloudServicesClientGetResponse contains the response from method CloudServicesClient.Get. -type CloudServicesClientGetResponse struct { - // Describes the cloud service. - CloudService -} - -// CloudServicesClientListAllResponse contains the response from method CloudServicesClient.NewListAllPager. -type CloudServicesClientListAllResponse struct { - // The list operation result. - CloudServiceListResult -} - -// CloudServicesClientListResponse contains the response from method CloudServicesClient.NewListPager. -type CloudServicesClientListResponse struct { - // The list operation result. - CloudServiceListResult -} - -// CloudServicesClientPowerOffResponse contains the response from method CloudServicesClient.BeginPowerOff. -type CloudServicesClientPowerOffResponse struct { - // placeholder for future response values -} - -// CloudServicesClientRebuildResponse contains the response from method CloudServicesClient.BeginRebuild. -type CloudServicesClientRebuildResponse struct { - // placeholder for future response values -} - -// CloudServicesClientReimageResponse contains the response from method CloudServicesClient.BeginReimage. -type CloudServicesClientReimageResponse struct { - // placeholder for future response values -} - -// CloudServicesClientRestartResponse contains the response from method CloudServicesClient.BeginRestart. -type CloudServicesClientRestartResponse struct { - // placeholder for future response values -} - -// CloudServicesClientStartResponse contains the response from method CloudServicesClient.BeginStart. -type CloudServicesClientStartResponse struct { - // placeholder for future response values -} - -// CloudServicesClientUpdateResponse contains the response from method CloudServicesClient.BeginUpdate. -type CloudServicesClientUpdateResponse struct { - // Describes the cloud service. - CloudService -} - -// CloudServicesUpdateDomainClientGetUpdateDomainResponse contains the response from method CloudServicesUpdateDomainClient.GetUpdateDomain. -type CloudServicesUpdateDomainClientGetUpdateDomainResponse struct { - // Defines an update domain for the cloud service. - UpdateDomain -} - -// CloudServicesUpdateDomainClientListUpdateDomainsResponse contains the response from method CloudServicesUpdateDomainClient.NewListUpdateDomainsPager. -type CloudServicesUpdateDomainClientListUpdateDomainsResponse struct { - // The list operation result. - UpdateDomainListResult -} - -// CloudServicesUpdateDomainClientWalkUpdateDomainResponse contains the response from method CloudServicesUpdateDomainClient.BeginWalkUpdateDomain. -type CloudServicesUpdateDomainClientWalkUpdateDomainResponse struct { - // placeholder for future response values -} - -// CommunityGalleriesClientGetResponse contains the response from method CommunityGalleriesClient.Get. -type CommunityGalleriesClientGetResponse struct { - // Specifies information about the Community Gallery that you want to create or update. - CommunityGallery -} - -// CommunityGalleryImageVersionsClientGetResponse contains the response from method CommunityGalleryImageVersionsClient.Get. -type CommunityGalleryImageVersionsClientGetResponse struct { - // Specifies information about the gallery image version that you want to create or update. - CommunityGalleryImageVersion -} - -// CommunityGalleryImageVersionsClientListResponse contains the response from method CommunityGalleryImageVersionsClient.NewListPager. -type CommunityGalleryImageVersionsClientListResponse struct { - // The List Community Gallery Image versions operation response. - CommunityGalleryImageVersionList -} - -// CommunityGalleryImagesClientGetResponse contains the response from method CommunityGalleryImagesClient.Get. -type CommunityGalleryImagesClientGetResponse struct { - // Specifies information about the gallery image definition that you want to create or update. - CommunityGalleryImage -} - -// CommunityGalleryImagesClientListResponse contains the response from method CommunityGalleryImagesClient.NewListPager. -type CommunityGalleryImagesClientListResponse struct { - // The List Community Gallery Images operation response. - CommunityGalleryImageList -} - -// DedicatedHostGroupsClientCreateOrUpdateResponse contains the response from method DedicatedHostGroupsClient.CreateOrUpdate. -type DedicatedHostGroupsClientCreateOrUpdateResponse struct { - // Specifies information about the dedicated host group that the dedicated hosts should be assigned to. Currently, a dedicated - // host can only be added to a dedicated host group at creation time. An existing dedicated host cannot be added to another - // dedicated host group. - DedicatedHostGroup -} - -// DedicatedHostGroupsClientDeleteResponse contains the response from method DedicatedHostGroupsClient.Delete. -type DedicatedHostGroupsClientDeleteResponse struct { - // placeholder for future response values -} - -// DedicatedHostGroupsClientGetResponse contains the response from method DedicatedHostGroupsClient.Get. -type DedicatedHostGroupsClientGetResponse struct { - // Specifies information about the dedicated host group that the dedicated hosts should be assigned to. Currently, a dedicated - // host can only be added to a dedicated host group at creation time. An existing dedicated host cannot be added to another - // dedicated host group. - DedicatedHostGroup -} - -// DedicatedHostGroupsClientListByResourceGroupResponse contains the response from method DedicatedHostGroupsClient.NewListByResourceGroupPager. -type DedicatedHostGroupsClientListByResourceGroupResponse struct { - // The List Dedicated Host Group with resource group response. - DedicatedHostGroupListResult -} - -// DedicatedHostGroupsClientListBySubscriptionResponse contains the response from method DedicatedHostGroupsClient.NewListBySubscriptionPager. -type DedicatedHostGroupsClientListBySubscriptionResponse struct { - // The List Dedicated Host Group with resource group response. - DedicatedHostGroupListResult -} - -// DedicatedHostGroupsClientUpdateResponse contains the response from method DedicatedHostGroupsClient.Update. -type DedicatedHostGroupsClientUpdateResponse struct { - // Specifies information about the dedicated host group that the dedicated hosts should be assigned to. Currently, a dedicated - // host can only be added to a dedicated host group at creation time. An existing dedicated host cannot be added to another - // dedicated host group. - DedicatedHostGroup -} - -// DedicatedHostsClientCreateOrUpdateResponse contains the response from method DedicatedHostsClient.BeginCreateOrUpdate. -type DedicatedHostsClientCreateOrUpdateResponse struct { - // Specifies information about the Dedicated host. - DedicatedHost -} - -// DedicatedHostsClientDeleteResponse contains the response from method DedicatedHostsClient.BeginDelete. -type DedicatedHostsClientDeleteResponse struct { - // placeholder for future response values -} - -// DedicatedHostsClientGetResponse contains the response from method DedicatedHostsClient.Get. -type DedicatedHostsClientGetResponse struct { - // Specifies information about the Dedicated host. - DedicatedHost -} - -// DedicatedHostsClientListAvailableSizesResponse contains the response from method DedicatedHostsClient.NewListAvailableSizesPager. -type DedicatedHostsClientListAvailableSizesResponse struct { - // The List Dedicated Host sizes operation response. - DedicatedHostSizeListResult -} - -// DedicatedHostsClientListByHostGroupResponse contains the response from method DedicatedHostsClient.NewListByHostGroupPager. -type DedicatedHostsClientListByHostGroupResponse struct { - // The list dedicated host operation response. - DedicatedHostListResult -} - -// DedicatedHostsClientRedeployResponse contains the response from method DedicatedHostsClient.BeginRedeploy. -type DedicatedHostsClientRedeployResponse struct { - // placeholder for future response values -} - -// DedicatedHostsClientRestartResponse contains the response from method DedicatedHostsClient.BeginRestart. -type DedicatedHostsClientRestartResponse struct { - // placeholder for future response values -} - -// DedicatedHostsClientUpdateResponse contains the response from method DedicatedHostsClient.BeginUpdate. -type DedicatedHostsClientUpdateResponse struct { - // Specifies information about the Dedicated host. - DedicatedHost -} - -// DiskAccessesClientCreateOrUpdateResponse contains the response from method DiskAccessesClient.BeginCreateOrUpdate. -type DiskAccessesClientCreateOrUpdateResponse struct { - // disk access resource. - DiskAccess -} - -// DiskAccessesClientDeleteAPrivateEndpointConnectionResponse contains the response from method DiskAccessesClient.BeginDeleteAPrivateEndpointConnection. -type DiskAccessesClientDeleteAPrivateEndpointConnectionResponse struct { - // placeholder for future response values -} - -// DiskAccessesClientDeleteResponse contains the response from method DiskAccessesClient.BeginDelete. -type DiskAccessesClientDeleteResponse struct { - // placeholder for future response values -} - -// DiskAccessesClientGetAPrivateEndpointConnectionResponse contains the response from method DiskAccessesClient.GetAPrivateEndpointConnection. -type DiskAccessesClientGetAPrivateEndpointConnectionResponse struct { - // The Private Endpoint Connection resource. - PrivateEndpointConnection -} - -// DiskAccessesClientGetPrivateLinkResourcesResponse contains the response from method DiskAccessesClient.GetPrivateLinkResources. -type DiskAccessesClientGetPrivateLinkResourcesResponse struct { - // A list of private link resources - PrivateLinkResourceListResult -} - -// DiskAccessesClientGetResponse contains the response from method DiskAccessesClient.Get. -type DiskAccessesClientGetResponse struct { - // disk access resource. - DiskAccess -} - -// DiskAccessesClientListByResourceGroupResponse contains the response from method DiskAccessesClient.NewListByResourceGroupPager. -type DiskAccessesClientListByResourceGroupResponse struct { - // The List disk access operation response. - DiskAccessList -} - -// DiskAccessesClientListPrivateEndpointConnectionsResponse contains the response from method DiskAccessesClient.NewListPrivateEndpointConnectionsPager. -type DiskAccessesClientListPrivateEndpointConnectionsResponse struct { - // A list of private link resources - PrivateEndpointConnectionListResult -} - -// DiskAccessesClientListResponse contains the response from method DiskAccessesClient.NewListPager. -type DiskAccessesClientListResponse struct { - // The List disk access operation response. - DiskAccessList -} - -// DiskAccessesClientUpdateAPrivateEndpointConnectionResponse contains the response from method DiskAccessesClient.BeginUpdateAPrivateEndpointConnection. -type DiskAccessesClientUpdateAPrivateEndpointConnectionResponse struct { - // The Private Endpoint Connection resource. - PrivateEndpointConnection -} - -// DiskAccessesClientUpdateResponse contains the response from method DiskAccessesClient.BeginUpdate. -type DiskAccessesClientUpdateResponse struct { - // disk access resource. - DiskAccess -} - -// DiskEncryptionSetsClientCreateOrUpdateResponse contains the response from method DiskEncryptionSetsClient.BeginCreateOrUpdate. -type DiskEncryptionSetsClientCreateOrUpdateResponse struct { - // disk encryption set resource. - DiskEncryptionSet -} - -// DiskEncryptionSetsClientDeleteResponse contains the response from method DiskEncryptionSetsClient.BeginDelete. -type DiskEncryptionSetsClientDeleteResponse struct { - // placeholder for future response values -} - -// DiskEncryptionSetsClientGetResponse contains the response from method DiskEncryptionSetsClient.Get. -type DiskEncryptionSetsClientGetResponse struct { - // disk encryption set resource. - DiskEncryptionSet -} - -// DiskEncryptionSetsClientListAssociatedResourcesResponse contains the response from method DiskEncryptionSetsClient.NewListAssociatedResourcesPager. -type DiskEncryptionSetsClientListAssociatedResourcesResponse struct { - // The List resources which are encrypted with the disk encryption set. - ResourceURIList -} - -// DiskEncryptionSetsClientListByResourceGroupResponse contains the response from method DiskEncryptionSetsClient.NewListByResourceGroupPager. -type DiskEncryptionSetsClientListByResourceGroupResponse struct { - // The List disk encryption set operation response. - DiskEncryptionSetList -} - -// DiskEncryptionSetsClientListResponse contains the response from method DiskEncryptionSetsClient.NewListPager. -type DiskEncryptionSetsClientListResponse struct { - // The List disk encryption set operation response. - DiskEncryptionSetList -} - -// DiskEncryptionSetsClientUpdateResponse contains the response from method DiskEncryptionSetsClient.BeginUpdate. -type DiskEncryptionSetsClientUpdateResponse struct { - // disk encryption set resource. - DiskEncryptionSet -} - -// DiskRestorePointClientGetResponse contains the response from method DiskRestorePointClient.Get. -type DiskRestorePointClientGetResponse struct { - // Properties of disk restore point - DiskRestorePoint -} - -// DiskRestorePointClientGrantAccessResponse contains the response from method DiskRestorePointClient.BeginGrantAccess. -type DiskRestorePointClientGrantAccessResponse struct { - // A disk access SAS uri. - AccessURI -} - -// DiskRestorePointClientListByRestorePointResponse contains the response from method DiskRestorePointClient.NewListByRestorePointPager. -type DiskRestorePointClientListByRestorePointResponse struct { - // The List Disk Restore Points operation response. - DiskRestorePointList -} - -// DiskRestorePointClientRevokeAccessResponse contains the response from method DiskRestorePointClient.BeginRevokeAccess. -type DiskRestorePointClientRevokeAccessResponse struct { - // placeholder for future response values -} - -// DisksClientCreateOrUpdateResponse contains the response from method DisksClient.BeginCreateOrUpdate. -type DisksClientCreateOrUpdateResponse struct { - // Disk resource. - Disk -} - -// DisksClientDeleteResponse contains the response from method DisksClient.BeginDelete. -type DisksClientDeleteResponse struct { - // placeholder for future response values -} - -// DisksClientGetResponse contains the response from method DisksClient.Get. -type DisksClientGetResponse struct { - // Disk resource. - Disk -} - -// DisksClientGrantAccessResponse contains the response from method DisksClient.BeginGrantAccess. -type DisksClientGrantAccessResponse struct { - // A disk access SAS uri. - AccessURI -} - -// DisksClientListByResourceGroupResponse contains the response from method DisksClient.NewListByResourceGroupPager. -type DisksClientListByResourceGroupResponse struct { - // The List Disks operation response. - DiskList -} - -// DisksClientListResponse contains the response from method DisksClient.NewListPager. -type DisksClientListResponse struct { - // The List Disks operation response. - DiskList -} - -// DisksClientRevokeAccessResponse contains the response from method DisksClient.BeginRevokeAccess. -type DisksClientRevokeAccessResponse struct { - // placeholder for future response values -} - -// DisksClientUpdateResponse contains the response from method DisksClient.BeginUpdate. -type DisksClientUpdateResponse struct { - // Disk resource. - Disk -} - -// GalleriesClientCreateOrUpdateResponse contains the response from method GalleriesClient.BeginCreateOrUpdate. -type GalleriesClientCreateOrUpdateResponse struct { - // Specifies information about the Shared Image Gallery that you want to create or update. - Gallery -} - -// GalleriesClientDeleteResponse contains the response from method GalleriesClient.BeginDelete. -type GalleriesClientDeleteResponse struct { - // placeholder for future response values -} - -// GalleriesClientGetResponse contains the response from method GalleriesClient.Get. -type GalleriesClientGetResponse struct { - // Specifies information about the Shared Image Gallery that you want to create or update. - Gallery -} - -// GalleriesClientListByResourceGroupResponse contains the response from method GalleriesClient.NewListByResourceGroupPager. -type GalleriesClientListByResourceGroupResponse struct { - // The List Galleries operation response. - GalleryList -} - -// GalleriesClientListResponse contains the response from method GalleriesClient.NewListPager. -type GalleriesClientListResponse struct { - // The List Galleries operation response. - GalleryList -} - -// GalleriesClientUpdateResponse contains the response from method GalleriesClient.BeginUpdate. -type GalleriesClientUpdateResponse struct { - // Specifies information about the Shared Image Gallery that you want to create or update. - Gallery -} - -// GalleryApplicationVersionsClientCreateOrUpdateResponse contains the response from method GalleryApplicationVersionsClient.BeginCreateOrUpdate. -type GalleryApplicationVersionsClientCreateOrUpdateResponse struct { - // Specifies information about the gallery Application Version that you want to create or update. - GalleryApplicationVersion -} - -// GalleryApplicationVersionsClientDeleteResponse contains the response from method GalleryApplicationVersionsClient.BeginDelete. -type GalleryApplicationVersionsClientDeleteResponse struct { - // placeholder for future response values -} - -// GalleryApplicationVersionsClientGetResponse contains the response from method GalleryApplicationVersionsClient.Get. -type GalleryApplicationVersionsClientGetResponse struct { - // Specifies information about the gallery Application Version that you want to create or update. - GalleryApplicationVersion -} - -// GalleryApplicationVersionsClientListByGalleryApplicationResponse contains the response from method GalleryApplicationVersionsClient.NewListByGalleryApplicationPager. -type GalleryApplicationVersionsClientListByGalleryApplicationResponse struct { - // The List Gallery Application version operation response. - GalleryApplicationVersionList -} - -// GalleryApplicationVersionsClientUpdateResponse contains the response from method GalleryApplicationVersionsClient.BeginUpdate. -type GalleryApplicationVersionsClientUpdateResponse struct { - // Specifies information about the gallery Application Version that you want to create or update. - GalleryApplicationVersion -} - -// GalleryApplicationsClientCreateOrUpdateResponse contains the response from method GalleryApplicationsClient.BeginCreateOrUpdate. -type GalleryApplicationsClientCreateOrUpdateResponse struct { - // Specifies information about the gallery Application Definition that you want to create or update. - GalleryApplication -} - -// GalleryApplicationsClientDeleteResponse contains the response from method GalleryApplicationsClient.BeginDelete. -type GalleryApplicationsClientDeleteResponse struct { - // placeholder for future response values -} - -// GalleryApplicationsClientGetResponse contains the response from method GalleryApplicationsClient.Get. -type GalleryApplicationsClientGetResponse struct { - // Specifies information about the gallery Application Definition that you want to create or update. - GalleryApplication -} - -// GalleryApplicationsClientListByGalleryResponse contains the response from method GalleryApplicationsClient.NewListByGalleryPager. -type GalleryApplicationsClientListByGalleryResponse struct { - // The List Gallery Applications operation response. - GalleryApplicationList -} - -// GalleryApplicationsClientUpdateResponse contains the response from method GalleryApplicationsClient.BeginUpdate. -type GalleryApplicationsClientUpdateResponse struct { - // Specifies information about the gallery Application Definition that you want to create or update. - GalleryApplication -} - -// GalleryImageVersionsClientCreateOrUpdateResponse contains the response from method GalleryImageVersionsClient.BeginCreateOrUpdate. -type GalleryImageVersionsClientCreateOrUpdateResponse struct { - // Specifies information about the gallery image version that you want to create or update. - GalleryImageVersion -} - -// GalleryImageVersionsClientDeleteResponse contains the response from method GalleryImageVersionsClient.BeginDelete. -type GalleryImageVersionsClientDeleteResponse struct { - // placeholder for future response values -} - -// GalleryImageVersionsClientGetResponse contains the response from method GalleryImageVersionsClient.Get. -type GalleryImageVersionsClientGetResponse struct { - // Specifies information about the gallery image version that you want to create or update. - GalleryImageVersion -} - -// GalleryImageVersionsClientListByGalleryImageResponse contains the response from method GalleryImageVersionsClient.NewListByGalleryImagePager. -type GalleryImageVersionsClientListByGalleryImageResponse struct { - // The List Gallery Image version operation response. - GalleryImageVersionList -} - -// GalleryImageVersionsClientUpdateResponse contains the response from method GalleryImageVersionsClient.BeginUpdate. -type GalleryImageVersionsClientUpdateResponse struct { - // Specifies information about the gallery image version that you want to create or update. - GalleryImageVersion -} - -// GalleryImagesClientCreateOrUpdateResponse contains the response from method GalleryImagesClient.BeginCreateOrUpdate. -type GalleryImagesClientCreateOrUpdateResponse struct { - // Specifies information about the gallery image definition that you want to create or update. - GalleryImage -} - -// GalleryImagesClientDeleteResponse contains the response from method GalleryImagesClient.BeginDelete. -type GalleryImagesClientDeleteResponse struct { - // placeholder for future response values -} - -// GalleryImagesClientGetResponse contains the response from method GalleryImagesClient.Get. -type GalleryImagesClientGetResponse struct { - // Specifies information about the gallery image definition that you want to create or update. - GalleryImage -} - -// GalleryImagesClientListByGalleryResponse contains the response from method GalleryImagesClient.NewListByGalleryPager. -type GalleryImagesClientListByGalleryResponse struct { - // The List Gallery Images operation response. - GalleryImageList -} - -// GalleryImagesClientUpdateResponse contains the response from method GalleryImagesClient.BeginUpdate. -type GalleryImagesClientUpdateResponse struct { - // Specifies information about the gallery image definition that you want to create or update. - GalleryImage -} - -// GallerySharingProfileClientUpdateResponse contains the response from method GallerySharingProfileClient.BeginUpdate. -type GallerySharingProfileClientUpdateResponse struct { - // Specifies information about the gallery sharing profile update. - SharingUpdate -} - -// ImagesClientCreateOrUpdateResponse contains the response from method ImagesClient.BeginCreateOrUpdate. -type ImagesClientCreateOrUpdateResponse struct { - // The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. - // If SourceImage is provided, the destination virtual hard drive must not exist. - Image -} - -// ImagesClientDeleteResponse contains the response from method ImagesClient.BeginDelete. -type ImagesClientDeleteResponse struct { - // placeholder for future response values -} - -// ImagesClientGetResponse contains the response from method ImagesClient.Get. -type ImagesClientGetResponse struct { - // The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. - // If SourceImage is provided, the destination virtual hard drive must not exist. - Image -} - -// ImagesClientListByResourceGroupResponse contains the response from method ImagesClient.NewListByResourceGroupPager. -type ImagesClientListByResourceGroupResponse struct { - // The List Image operation response. - ImageListResult -} - -// ImagesClientListResponse contains the response from method ImagesClient.NewListPager. -type ImagesClientListResponse struct { - // The List Image operation response. - ImageListResult -} - -// ImagesClientUpdateResponse contains the response from method ImagesClient.BeginUpdate. -type ImagesClientUpdateResponse struct { - // The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. - // If SourceImage is provided, the destination virtual hard drive must not exist. - Image -} - -// LogAnalyticsClientExportRequestRateByIntervalResponse contains the response from method LogAnalyticsClient.BeginExportRequestRateByInterval. -type LogAnalyticsClientExportRequestRateByIntervalResponse struct { - // LogAnalytics operation status response - LogAnalyticsOperationResult -} - -// LogAnalyticsClientExportThrottledRequestsResponse contains the response from method LogAnalyticsClient.BeginExportThrottledRequests. -type LogAnalyticsClientExportThrottledRequestsResponse struct { - // LogAnalytics operation status response - LogAnalyticsOperationResult -} - -// OperationsClientListResponse contains the response from method OperationsClient.NewListPager. -type OperationsClientListResponse struct { - // The List Compute Operation operation response. - OperationListResult -} - -// ProximityPlacementGroupsClientCreateOrUpdateResponse contains the response from method ProximityPlacementGroupsClient.CreateOrUpdate. -type ProximityPlacementGroupsClientCreateOrUpdateResponse struct { - // Specifies information about the proximity placement group. - ProximityPlacementGroup -} - -// ProximityPlacementGroupsClientDeleteResponse contains the response from method ProximityPlacementGroupsClient.Delete. -type ProximityPlacementGroupsClientDeleteResponse struct { - // placeholder for future response values -} - -// ProximityPlacementGroupsClientGetResponse contains the response from method ProximityPlacementGroupsClient.Get. -type ProximityPlacementGroupsClientGetResponse struct { - // Specifies information about the proximity placement group. - ProximityPlacementGroup -} - -// ProximityPlacementGroupsClientListByResourceGroupResponse contains the response from method ProximityPlacementGroupsClient.NewListByResourceGroupPager. -type ProximityPlacementGroupsClientListByResourceGroupResponse struct { - // The List Proximity Placement Group operation response. - ProximityPlacementGroupListResult -} - -// ProximityPlacementGroupsClientListBySubscriptionResponse contains the response from method ProximityPlacementGroupsClient.NewListBySubscriptionPager. -type ProximityPlacementGroupsClientListBySubscriptionResponse struct { - // The List Proximity Placement Group operation response. - ProximityPlacementGroupListResult -} - -// ProximityPlacementGroupsClientUpdateResponse contains the response from method ProximityPlacementGroupsClient.Update. -type ProximityPlacementGroupsClientUpdateResponse struct { - // Specifies information about the proximity placement group. - ProximityPlacementGroup -} - -// ResourceSKUsClientListResponse contains the response from method ResourceSKUsClient.NewListPager. -type ResourceSKUsClientListResponse struct { - // The List Resource Skus operation response. - ResourceSKUsResult -} - -// RestorePointCollectionsClientCreateOrUpdateResponse contains the response from method RestorePointCollectionsClient.CreateOrUpdate. -type RestorePointCollectionsClientCreateOrUpdateResponse struct { - // Create or update Restore Point collection parameters. - RestorePointCollection -} - -// RestorePointCollectionsClientDeleteResponse contains the response from method RestorePointCollectionsClient.BeginDelete. -type RestorePointCollectionsClientDeleteResponse struct { - // placeholder for future response values -} - -// RestorePointCollectionsClientGetResponse contains the response from method RestorePointCollectionsClient.Get. -type RestorePointCollectionsClientGetResponse struct { - // Create or update Restore Point collection parameters. - RestorePointCollection -} - -// RestorePointCollectionsClientListAllResponse contains the response from method RestorePointCollectionsClient.NewListAllPager. -type RestorePointCollectionsClientListAllResponse struct { - // The List restore point collection operation response. - RestorePointCollectionListResult -} - -// RestorePointCollectionsClientListResponse contains the response from method RestorePointCollectionsClient.NewListPager. -type RestorePointCollectionsClientListResponse struct { - // The List restore point collection operation response. - RestorePointCollectionListResult -} - -// RestorePointCollectionsClientUpdateResponse contains the response from method RestorePointCollectionsClient.Update. -type RestorePointCollectionsClientUpdateResponse struct { - // Create or update Restore Point collection parameters. - RestorePointCollection -} - -// RestorePointsClientCreateResponse contains the response from method RestorePointsClient.BeginCreate. -type RestorePointsClientCreateResponse struct { - // Restore Point details. - RestorePoint -} - -// RestorePointsClientDeleteResponse contains the response from method RestorePointsClient.BeginDelete. -type RestorePointsClientDeleteResponse struct { - // placeholder for future response values -} - -// RestorePointsClientGetResponse contains the response from method RestorePointsClient.Get. -type RestorePointsClientGetResponse struct { - // Restore Point details. - RestorePoint -} - -// SSHPublicKeysClientCreateResponse contains the response from method SSHPublicKeysClient.Create. -type SSHPublicKeysClientCreateResponse struct { - // Specifies information about the SSH public key. - SSHPublicKeyResource -} - -// SSHPublicKeysClientDeleteResponse contains the response from method SSHPublicKeysClient.Delete. -type SSHPublicKeysClientDeleteResponse struct { - // placeholder for future response values -} - -// SSHPublicKeysClientGenerateKeyPairResponse contains the response from method SSHPublicKeysClient.GenerateKeyPair. -type SSHPublicKeysClientGenerateKeyPairResponse struct { - // Response from generation of an SSH key pair. - SSHPublicKeyGenerateKeyPairResult -} - -// SSHPublicKeysClientGetResponse contains the response from method SSHPublicKeysClient.Get. -type SSHPublicKeysClientGetResponse struct { - // Specifies information about the SSH public key. - SSHPublicKeyResource -} - -// SSHPublicKeysClientListByResourceGroupResponse contains the response from method SSHPublicKeysClient.NewListByResourceGroupPager. -type SSHPublicKeysClientListByResourceGroupResponse struct { - // The list SSH public keys operation response. - SSHPublicKeysGroupListResult -} - -// SSHPublicKeysClientListBySubscriptionResponse contains the response from method SSHPublicKeysClient.NewListBySubscriptionPager. -type SSHPublicKeysClientListBySubscriptionResponse struct { - // The list SSH public keys operation response. - SSHPublicKeysGroupListResult -} - -// SSHPublicKeysClientUpdateResponse contains the response from method SSHPublicKeysClient.Update. -type SSHPublicKeysClientUpdateResponse struct { - // Specifies information about the SSH public key. - SSHPublicKeyResource -} - -// SharedGalleriesClientGetResponse contains the response from method SharedGalleriesClient.Get. -type SharedGalleriesClientGetResponse struct { - // Specifies information about the Shared Gallery that you want to create or update. - SharedGallery -} - -// SharedGalleriesClientListResponse contains the response from method SharedGalleriesClient.NewListPager. -type SharedGalleriesClientListResponse struct { - // The List Shared Galleries operation response. - SharedGalleryList -} - -// SharedGalleryImageVersionsClientGetResponse contains the response from method SharedGalleryImageVersionsClient.Get. -type SharedGalleryImageVersionsClientGetResponse struct { - // Specifies information about the gallery image version that you want to create or update. - SharedGalleryImageVersion -} - -// SharedGalleryImageVersionsClientListResponse contains the response from method SharedGalleryImageVersionsClient.NewListPager. -type SharedGalleryImageVersionsClientListResponse struct { - // The List Shared Gallery Image versions operation response. - SharedGalleryImageVersionList -} - -// SharedGalleryImagesClientGetResponse contains the response from method SharedGalleryImagesClient.Get. -type SharedGalleryImagesClientGetResponse struct { - // Specifies information about the gallery image definition that you want to create or update. - SharedGalleryImage -} - -// SharedGalleryImagesClientListResponse contains the response from method SharedGalleryImagesClient.NewListPager. -type SharedGalleryImagesClientListResponse struct { - // The List Shared Gallery Images operation response. - SharedGalleryImageList -} - -// SnapshotsClientCreateOrUpdateResponse contains the response from method SnapshotsClient.BeginCreateOrUpdate. -type SnapshotsClientCreateOrUpdateResponse struct { - // Snapshot resource. - Snapshot -} - -// SnapshotsClientDeleteResponse contains the response from method SnapshotsClient.BeginDelete. -type SnapshotsClientDeleteResponse struct { - // placeholder for future response values -} - -// SnapshotsClientGetResponse contains the response from method SnapshotsClient.Get. -type SnapshotsClientGetResponse struct { - // Snapshot resource. - Snapshot -} - -// SnapshotsClientGrantAccessResponse contains the response from method SnapshotsClient.BeginGrantAccess. -type SnapshotsClientGrantAccessResponse struct { - // A disk access SAS uri. - AccessURI -} - -// SnapshotsClientListByResourceGroupResponse contains the response from method SnapshotsClient.NewListByResourceGroupPager. -type SnapshotsClientListByResourceGroupResponse struct { - // The List Snapshots operation response. - SnapshotList -} - -// SnapshotsClientListResponse contains the response from method SnapshotsClient.NewListPager. -type SnapshotsClientListResponse struct { - // The List Snapshots operation response. - SnapshotList -} - -// SnapshotsClientRevokeAccessResponse contains the response from method SnapshotsClient.BeginRevokeAccess. -type SnapshotsClientRevokeAccessResponse struct { - // placeholder for future response values -} - -// SnapshotsClientUpdateResponse contains the response from method SnapshotsClient.BeginUpdate. -type SnapshotsClientUpdateResponse struct { - // Snapshot resource. - Snapshot -} - -// UsageClientListResponse contains the response from method UsageClient.NewListPager. -type UsageClientListResponse struct { - // The List Usages operation response. - ListUsagesResult -} - -// VirtualMachineExtensionImagesClientGetResponse contains the response from method VirtualMachineExtensionImagesClient.Get. -type VirtualMachineExtensionImagesClientGetResponse struct { - // Describes a Virtual Machine Extension Image. - VirtualMachineExtensionImage -} - -// VirtualMachineExtensionImagesClientListTypesResponse contains the response from method VirtualMachineExtensionImagesClient.ListTypes. -type VirtualMachineExtensionImagesClientListTypesResponse struct { - // Array of VirtualMachineExtensionImage - VirtualMachineExtensionImageArray []*VirtualMachineExtensionImage -} - -// VirtualMachineExtensionImagesClientListVersionsResponse contains the response from method VirtualMachineExtensionImagesClient.ListVersions. -type VirtualMachineExtensionImagesClientListVersionsResponse struct { - // Array of VirtualMachineExtensionImage - VirtualMachineExtensionImageArray []*VirtualMachineExtensionImage -} - -// VirtualMachineExtensionsClientCreateOrUpdateResponse contains the response from method VirtualMachineExtensionsClient.BeginCreateOrUpdate. -type VirtualMachineExtensionsClientCreateOrUpdateResponse struct { - // Describes a Virtual Machine Extension. - VirtualMachineExtension -} - -// VirtualMachineExtensionsClientDeleteResponse contains the response from method VirtualMachineExtensionsClient.BeginDelete. -type VirtualMachineExtensionsClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualMachineExtensionsClientGetResponse contains the response from method VirtualMachineExtensionsClient.Get. -type VirtualMachineExtensionsClientGetResponse struct { - // Describes a Virtual Machine Extension. - VirtualMachineExtension -} - -// VirtualMachineExtensionsClientListResponse contains the response from method VirtualMachineExtensionsClient.List. -type VirtualMachineExtensionsClientListResponse struct { - // The List Extension operation response - VirtualMachineExtensionsListResult -} - -// VirtualMachineExtensionsClientUpdateResponse contains the response from method VirtualMachineExtensionsClient.BeginUpdate. -type VirtualMachineExtensionsClientUpdateResponse struct { - // Describes a Virtual Machine Extension. - VirtualMachineExtension -} - -// VirtualMachineImagesClientGetResponse contains the response from method VirtualMachineImagesClient.Get. -type VirtualMachineImagesClientGetResponse struct { - // Describes a Virtual Machine Image. - VirtualMachineImage -} - -// VirtualMachineImagesClientListByEdgeZoneResponse contains the response from method VirtualMachineImagesClient.ListByEdgeZone. -type VirtualMachineImagesClientListByEdgeZoneResponse struct { - // The List VmImages in EdgeZone operation response. - VMImagesInEdgeZoneListResult -} - -// VirtualMachineImagesClientListOffersResponse contains the response from method VirtualMachineImagesClient.ListOffers. -type VirtualMachineImagesClientListOffersResponse struct { - // Array of VirtualMachineImageResource - VirtualMachineImageResourceArray []*VirtualMachineImageResource -} - -// VirtualMachineImagesClientListPublishersResponse contains the response from method VirtualMachineImagesClient.ListPublishers. -type VirtualMachineImagesClientListPublishersResponse struct { - // Array of VirtualMachineImageResource - VirtualMachineImageResourceArray []*VirtualMachineImageResource -} - -// VirtualMachineImagesClientListResponse contains the response from method VirtualMachineImagesClient.List. -type VirtualMachineImagesClientListResponse struct { - // Array of VirtualMachineImageResource - VirtualMachineImageResourceArray []*VirtualMachineImageResource -} - -// VirtualMachineImagesClientListSKUsResponse contains the response from method VirtualMachineImagesClient.ListSKUs. -type VirtualMachineImagesClientListSKUsResponse struct { - // Array of VirtualMachineImageResource - VirtualMachineImageResourceArray []*VirtualMachineImageResource -} - -// VirtualMachineImagesEdgeZoneClientGetResponse contains the response from method VirtualMachineImagesEdgeZoneClient.Get. -type VirtualMachineImagesEdgeZoneClientGetResponse struct { - // Describes a Virtual Machine Image. - VirtualMachineImage -} - -// VirtualMachineImagesEdgeZoneClientListOffersResponse contains the response from method VirtualMachineImagesEdgeZoneClient.ListOffers. -type VirtualMachineImagesEdgeZoneClientListOffersResponse struct { - // Array of VirtualMachineImageResource - VirtualMachineImageResourceArray []*VirtualMachineImageResource -} - -// VirtualMachineImagesEdgeZoneClientListPublishersResponse contains the response from method VirtualMachineImagesEdgeZoneClient.ListPublishers. -type VirtualMachineImagesEdgeZoneClientListPublishersResponse struct { - // Array of VirtualMachineImageResource - VirtualMachineImageResourceArray []*VirtualMachineImageResource -} - -// VirtualMachineImagesEdgeZoneClientListResponse contains the response from method VirtualMachineImagesEdgeZoneClient.List. -type VirtualMachineImagesEdgeZoneClientListResponse struct { - // Array of VirtualMachineImageResource - VirtualMachineImageResourceArray []*VirtualMachineImageResource -} - -// VirtualMachineImagesEdgeZoneClientListSKUsResponse contains the response from method VirtualMachineImagesEdgeZoneClient.ListSKUs. -type VirtualMachineImagesEdgeZoneClientListSKUsResponse struct { - // Array of VirtualMachineImageResource - VirtualMachineImageResourceArray []*VirtualMachineImageResource -} - -// VirtualMachineRunCommandsClientCreateOrUpdateResponse contains the response from method VirtualMachineRunCommandsClient.BeginCreateOrUpdate. -type VirtualMachineRunCommandsClientCreateOrUpdateResponse struct { - // Describes a Virtual Machine run command. - VirtualMachineRunCommand -} - -// VirtualMachineRunCommandsClientDeleteResponse contains the response from method VirtualMachineRunCommandsClient.BeginDelete. -type VirtualMachineRunCommandsClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualMachineRunCommandsClientGetByVirtualMachineResponse contains the response from method VirtualMachineRunCommandsClient.GetByVirtualMachine. -type VirtualMachineRunCommandsClientGetByVirtualMachineResponse struct { - // Describes a Virtual Machine run command. - VirtualMachineRunCommand -} - -// VirtualMachineRunCommandsClientGetResponse contains the response from method VirtualMachineRunCommandsClient.Get. -type VirtualMachineRunCommandsClientGetResponse struct { - // Describes the properties of a Run Command. - RunCommandDocument -} - -// VirtualMachineRunCommandsClientListByVirtualMachineResponse contains the response from method VirtualMachineRunCommandsClient.NewListByVirtualMachinePager. -type VirtualMachineRunCommandsClientListByVirtualMachineResponse struct { - // The List run command operation response - VirtualMachineRunCommandsListResult -} - -// VirtualMachineRunCommandsClientListResponse contains the response from method VirtualMachineRunCommandsClient.NewListPager. -type VirtualMachineRunCommandsClientListResponse struct { - // The List Virtual Machine operation response. - RunCommandListResult -} - -// VirtualMachineRunCommandsClientUpdateResponse contains the response from method VirtualMachineRunCommandsClient.BeginUpdate. -type VirtualMachineRunCommandsClientUpdateResponse struct { - // Describes a Virtual Machine run command. - VirtualMachineRunCommand -} - -// VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse contains the response from method VirtualMachineScaleSetExtensionsClient.BeginCreateOrUpdate. -type VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse struct { - // Describes a Virtual Machine Scale Set Extension. - VirtualMachineScaleSetExtension -} - -// VirtualMachineScaleSetExtensionsClientDeleteResponse contains the response from method VirtualMachineScaleSetExtensionsClient.BeginDelete. -type VirtualMachineScaleSetExtensionsClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetExtensionsClientGetResponse contains the response from method VirtualMachineScaleSetExtensionsClient.Get. -type VirtualMachineScaleSetExtensionsClientGetResponse struct { - // Describes a Virtual Machine Scale Set Extension. - VirtualMachineScaleSetExtension -} - -// VirtualMachineScaleSetExtensionsClientListResponse contains the response from method VirtualMachineScaleSetExtensionsClient.NewListPager. -type VirtualMachineScaleSetExtensionsClientListResponse struct { - // The List VM scale set extension operation response. - VirtualMachineScaleSetExtensionListResult -} - -// VirtualMachineScaleSetExtensionsClientUpdateResponse contains the response from method VirtualMachineScaleSetExtensionsClient.BeginUpdate. -type VirtualMachineScaleSetExtensionsClientUpdateResponse struct { - // Describes a Virtual Machine Scale Set Extension. - VirtualMachineScaleSetExtension -} - -// VirtualMachineScaleSetRollingUpgradesClientCancelResponse contains the response from method VirtualMachineScaleSetRollingUpgradesClient.BeginCancel. -type VirtualMachineScaleSetRollingUpgradesClientCancelResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse contains the response from method VirtualMachineScaleSetRollingUpgradesClient.GetLatest. -type VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse struct { - // The status of the latest virtual machine scale set rolling upgrade. - RollingUpgradeStatusInfo -} - -// VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradeResponse contains the response from method VirtualMachineScaleSetRollingUpgradesClient.BeginStartExtensionUpgrade. -type VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradeResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradeResponse contains the response from method VirtualMachineScaleSetRollingUpgradesClient.BeginStartOSUpgrade. -type VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradeResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResponse contains the response from method VirtualMachineScaleSetVMExtensionsClient.BeginCreateOrUpdate. -type VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResponse struct { - // Describes a VMSS VM Extension. - VirtualMachineScaleSetVMExtension -} - -// VirtualMachineScaleSetVMExtensionsClientDeleteResponse contains the response from method VirtualMachineScaleSetVMExtensionsClient.BeginDelete. -type VirtualMachineScaleSetVMExtensionsClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMExtensionsClientGetResponse contains the response from method VirtualMachineScaleSetVMExtensionsClient.Get. -type VirtualMachineScaleSetVMExtensionsClientGetResponse struct { - // Describes a VMSS VM Extension. - VirtualMachineScaleSetVMExtension -} - -// VirtualMachineScaleSetVMExtensionsClientListResponse contains the response from method VirtualMachineScaleSetVMExtensionsClient.List. -type VirtualMachineScaleSetVMExtensionsClientListResponse struct { - // The List VMSS VM Extension operation response - VirtualMachineScaleSetVMExtensionsListResult -} - -// VirtualMachineScaleSetVMExtensionsClientUpdateResponse contains the response from method VirtualMachineScaleSetVMExtensionsClient.BeginUpdate. -type VirtualMachineScaleSetVMExtensionsClientUpdateResponse struct { - // Describes a VMSS VM Extension. - VirtualMachineScaleSetVMExtension -} - -// VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResponse contains the response from method VirtualMachineScaleSetVMRunCommandsClient.BeginCreateOrUpdate. -type VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResponse struct { - // Describes a Virtual Machine run command. - VirtualMachineRunCommand -} - -// VirtualMachineScaleSetVMRunCommandsClientDeleteResponse contains the response from method VirtualMachineScaleSetVMRunCommandsClient.BeginDelete. -type VirtualMachineScaleSetVMRunCommandsClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMRunCommandsClientGetResponse contains the response from method VirtualMachineScaleSetVMRunCommandsClient.Get. -type VirtualMachineScaleSetVMRunCommandsClientGetResponse struct { - // Describes a Virtual Machine run command. - VirtualMachineRunCommand -} - -// VirtualMachineScaleSetVMRunCommandsClientListResponse contains the response from method VirtualMachineScaleSetVMRunCommandsClient.NewListPager. -type VirtualMachineScaleSetVMRunCommandsClientListResponse struct { - // The List run command operation response - VirtualMachineRunCommandsListResult -} - -// VirtualMachineScaleSetVMRunCommandsClientUpdateResponse contains the response from method VirtualMachineScaleSetVMRunCommandsClient.BeginUpdate. -type VirtualMachineScaleSetVMRunCommandsClientUpdateResponse struct { - // Describes a Virtual Machine run command. - VirtualMachineRunCommand -} - -// VirtualMachineScaleSetVMsClientApproveRollingUpgradeResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginApproveRollingUpgrade. -type VirtualMachineScaleSetVMsClientApproveRollingUpgradeResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMsClientAttachDetachDataDisksResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginAttachDetachDataDisks. -type VirtualMachineScaleSetVMsClientAttachDetachDataDisksResponse struct { - // Specifies the storage settings for the virtual machine disks. - StorageProfile -} - -// VirtualMachineScaleSetVMsClientDeallocateResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginDeallocate. -type VirtualMachineScaleSetVMsClientDeallocateResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMsClientDeleteResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginDelete. -type VirtualMachineScaleSetVMsClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMsClientGetInstanceViewResponse contains the response from method VirtualMachineScaleSetVMsClient.GetInstanceView. -type VirtualMachineScaleSetVMsClientGetInstanceViewResponse struct { - // The instance view of a virtual machine scale set VM. - VirtualMachineScaleSetVMInstanceView -} - -// VirtualMachineScaleSetVMsClientGetResponse contains the response from method VirtualMachineScaleSetVMsClient.Get. -type VirtualMachineScaleSetVMsClientGetResponse struct { - // Describes a virtual machine scale set virtual machine. - VirtualMachineScaleSetVM -} - -// VirtualMachineScaleSetVMsClientListResponse contains the response from method VirtualMachineScaleSetVMsClient.NewListPager. -type VirtualMachineScaleSetVMsClientListResponse struct { - // The List Virtual Machine Scale Set VMs operation response. - VirtualMachineScaleSetVMListResult -} - -// VirtualMachineScaleSetVMsClientPerformMaintenanceResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginPerformMaintenance. -type VirtualMachineScaleSetVMsClientPerformMaintenanceResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMsClientPowerOffResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginPowerOff. -type VirtualMachineScaleSetVMsClientPowerOffResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMsClientRedeployResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginRedeploy. -type VirtualMachineScaleSetVMsClientRedeployResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMsClientReimageAllResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginReimageAll. -type VirtualMachineScaleSetVMsClientReimageAllResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMsClientReimageResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginReimage. -type VirtualMachineScaleSetVMsClientReimageResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMsClientRestartResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginRestart. -type VirtualMachineScaleSetVMsClientRestartResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse contains the response from method VirtualMachineScaleSetVMsClient.RetrieveBootDiagnosticsData. -type VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse struct { - // The SAS URIs of the console screenshot and serial log blobs. - RetrieveBootDiagnosticsDataResult -} - -// VirtualMachineScaleSetVMsClientRunCommandResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginRunCommand. -type VirtualMachineScaleSetVMsClientRunCommandResponse struct { - RunCommandResult -} - -// VirtualMachineScaleSetVMsClientSimulateEvictionResponse contains the response from method VirtualMachineScaleSetVMsClient.SimulateEviction. -type VirtualMachineScaleSetVMsClientSimulateEvictionResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMsClientStartResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginStart. -type VirtualMachineScaleSetVMsClientStartResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetVMsClientUpdateResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginUpdate. -type VirtualMachineScaleSetVMsClientUpdateResponse struct { - // Describes a virtual machine scale set virtual machine. - VirtualMachineScaleSetVM -} - -// VirtualMachineScaleSetsClientApproveRollingUpgradeResponse contains the response from method VirtualMachineScaleSetsClient.BeginApproveRollingUpgrade. -type VirtualMachineScaleSetsClientApproveRollingUpgradeResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientConvertToSinglePlacementGroupResponse contains the response from method VirtualMachineScaleSetsClient.ConvertToSinglePlacementGroup. -type VirtualMachineScaleSetsClientConvertToSinglePlacementGroupResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientCreateOrUpdateResponse contains the response from method VirtualMachineScaleSetsClient.BeginCreateOrUpdate. -type VirtualMachineScaleSetsClientCreateOrUpdateResponse struct { - // Describes a Virtual Machine Scale Set. - VirtualMachineScaleSet -} - -// VirtualMachineScaleSetsClientDeallocateResponse contains the response from method VirtualMachineScaleSetsClient.BeginDeallocate. -type VirtualMachineScaleSetsClientDeallocateResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientDeleteInstancesResponse contains the response from method VirtualMachineScaleSetsClient.BeginDeleteInstances. -type VirtualMachineScaleSetsClientDeleteInstancesResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientDeleteResponse contains the response from method VirtualMachineScaleSetsClient.BeginDelete. -type VirtualMachineScaleSetsClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse contains the response from method -// VirtualMachineScaleSetsClient.ForceRecoveryServiceFabricPlatformUpdateDomainWalk. -type VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse struct { - // Response after calling a manual recovery walk - RecoveryWalkResponse -} - -// VirtualMachineScaleSetsClientGetInstanceViewResponse contains the response from method VirtualMachineScaleSetsClient.GetInstanceView. -type VirtualMachineScaleSetsClientGetInstanceViewResponse struct { - // The instance view of a virtual machine scale set. - VirtualMachineScaleSetInstanceView -} - -// VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse contains the response from method VirtualMachineScaleSetsClient.NewGetOSUpgradeHistoryPager. -type VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse struct { - // List of Virtual Machine Scale Set OS Upgrade History operation response. - VirtualMachineScaleSetListOSUpgradeHistory -} - -// VirtualMachineScaleSetsClientGetResponse contains the response from method VirtualMachineScaleSetsClient.Get. -type VirtualMachineScaleSetsClientGetResponse struct { - // Describes a Virtual Machine Scale Set. - VirtualMachineScaleSet -} - -// VirtualMachineScaleSetsClientListAllResponse contains the response from method VirtualMachineScaleSetsClient.NewListAllPager. -type VirtualMachineScaleSetsClientListAllResponse struct { - // The List Virtual Machine operation response. - VirtualMachineScaleSetListWithLinkResult -} - -// VirtualMachineScaleSetsClientListByLocationResponse contains the response from method VirtualMachineScaleSetsClient.NewListByLocationPager. -type VirtualMachineScaleSetsClientListByLocationResponse struct { - // The List Virtual Machine operation response. - VirtualMachineScaleSetListResult -} - -// VirtualMachineScaleSetsClientListResponse contains the response from method VirtualMachineScaleSetsClient.NewListPager. -type VirtualMachineScaleSetsClientListResponse struct { - // The List Virtual Machine operation response. - VirtualMachineScaleSetListResult -} - -// VirtualMachineScaleSetsClientListSKUsResponse contains the response from method VirtualMachineScaleSetsClient.NewListSKUsPager. -type VirtualMachineScaleSetsClientListSKUsResponse struct { - // The Virtual Machine Scale Set List Skus operation response. - VirtualMachineScaleSetListSKUsResult -} - -// VirtualMachineScaleSetsClientPerformMaintenanceResponse contains the response from method VirtualMachineScaleSetsClient.BeginPerformMaintenance. -type VirtualMachineScaleSetsClientPerformMaintenanceResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientPowerOffResponse contains the response from method VirtualMachineScaleSetsClient.BeginPowerOff. -type VirtualMachineScaleSetsClientPowerOffResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientReapplyResponse contains the response from method VirtualMachineScaleSetsClient.BeginReapply. -type VirtualMachineScaleSetsClientReapplyResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientRedeployResponse contains the response from method VirtualMachineScaleSetsClient.BeginRedeploy. -type VirtualMachineScaleSetsClientRedeployResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientReimageAllResponse contains the response from method VirtualMachineScaleSetsClient.BeginReimageAll. -type VirtualMachineScaleSetsClientReimageAllResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientReimageResponse contains the response from method VirtualMachineScaleSetsClient.BeginReimage. -type VirtualMachineScaleSetsClientReimageResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientRestartResponse contains the response from method VirtualMachineScaleSetsClient.BeginRestart. -type VirtualMachineScaleSetsClientRestartResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientSetOrchestrationServiceStateResponse contains the response from method VirtualMachineScaleSetsClient.BeginSetOrchestrationServiceState. -type VirtualMachineScaleSetsClientSetOrchestrationServiceStateResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientStartResponse contains the response from method VirtualMachineScaleSetsClient.BeginStart. -type VirtualMachineScaleSetsClientStartResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientUpdateInstancesResponse contains the response from method VirtualMachineScaleSetsClient.BeginUpdateInstances. -type VirtualMachineScaleSetsClientUpdateInstancesResponse struct { - // placeholder for future response values -} - -// VirtualMachineScaleSetsClientUpdateResponse contains the response from method VirtualMachineScaleSetsClient.BeginUpdate. -type VirtualMachineScaleSetsClientUpdateResponse struct { - // Describes a Virtual Machine Scale Set. - VirtualMachineScaleSet -} - -// VirtualMachineSizesClientListResponse contains the response from method VirtualMachineSizesClient.NewListPager. -type VirtualMachineSizesClientListResponse struct { - // The List Virtual Machine operation response. - VirtualMachineSizeListResult -} - -// VirtualMachinesClientAssessPatchesResponse contains the response from method VirtualMachinesClient.BeginAssessPatches. -type VirtualMachinesClientAssessPatchesResponse struct { - // Describes the properties of an AssessPatches result. - VirtualMachineAssessPatchesResult -} - -// VirtualMachinesClientAttachDetachDataDisksResponse contains the response from method VirtualMachinesClient.BeginAttachDetachDataDisks. -type VirtualMachinesClientAttachDetachDataDisksResponse struct { - // Specifies the storage settings for the virtual machine disks. - StorageProfile -} - -// VirtualMachinesClientCaptureResponse contains the response from method VirtualMachinesClient.BeginCapture. -type VirtualMachinesClientCaptureResponse struct { - // Output of virtual machine capture operation. - VirtualMachineCaptureResult -} - -// VirtualMachinesClientConvertToManagedDisksResponse contains the response from method VirtualMachinesClient.BeginConvertToManagedDisks. -type VirtualMachinesClientConvertToManagedDisksResponse struct { - // placeholder for future response values -} - -// VirtualMachinesClientCreateOrUpdateResponse contains the response from method VirtualMachinesClient.BeginCreateOrUpdate. -type VirtualMachinesClientCreateOrUpdateResponse struct { - // Describes a Virtual Machine. - VirtualMachine -} - -// VirtualMachinesClientDeallocateResponse contains the response from method VirtualMachinesClient.BeginDeallocate. -type VirtualMachinesClientDeallocateResponse struct { - // placeholder for future response values -} - -// VirtualMachinesClientDeleteResponse contains the response from method VirtualMachinesClient.BeginDelete. -type VirtualMachinesClientDeleteResponse struct { - // placeholder for future response values -} - -// VirtualMachinesClientGeneralizeResponse contains the response from method VirtualMachinesClient.Generalize. -type VirtualMachinesClientGeneralizeResponse struct { - // placeholder for future response values -} - -// VirtualMachinesClientGetResponse contains the response from method VirtualMachinesClient.Get. -type VirtualMachinesClientGetResponse struct { - // Describes a Virtual Machine. - VirtualMachine -} - -// VirtualMachinesClientInstallPatchesResponse contains the response from method VirtualMachinesClient.BeginInstallPatches. -type VirtualMachinesClientInstallPatchesResponse struct { - // The result summary of an installation operation. - VirtualMachineInstallPatchesResult -} - -// VirtualMachinesClientInstanceViewResponse contains the response from method VirtualMachinesClient.InstanceView. -type VirtualMachinesClientInstanceViewResponse struct { - // The instance view of a virtual machine. - VirtualMachineInstanceView -} - -// VirtualMachinesClientListAllResponse contains the response from method VirtualMachinesClient.NewListAllPager. -type VirtualMachinesClientListAllResponse struct { - // The List Virtual Machine operation response. - VirtualMachineListResult -} - -// VirtualMachinesClientListAvailableSizesResponse contains the response from method VirtualMachinesClient.NewListAvailableSizesPager. -type VirtualMachinesClientListAvailableSizesResponse struct { - // The List Virtual Machine operation response. - VirtualMachineSizeListResult -} - -// VirtualMachinesClientListByLocationResponse contains the response from method VirtualMachinesClient.NewListByLocationPager. -type VirtualMachinesClientListByLocationResponse struct { - // The List Virtual Machine operation response. - VirtualMachineListResult -} - -// VirtualMachinesClientListResponse contains the response from method VirtualMachinesClient.NewListPager. -type VirtualMachinesClientListResponse struct { - // The List Virtual Machine operation response. - VirtualMachineListResult -} - -// VirtualMachinesClientPerformMaintenanceResponse contains the response from method VirtualMachinesClient.BeginPerformMaintenance. -type VirtualMachinesClientPerformMaintenanceResponse struct { - // placeholder for future response values -} - -// VirtualMachinesClientPowerOffResponse contains the response from method VirtualMachinesClient.BeginPowerOff. -type VirtualMachinesClientPowerOffResponse struct { - // placeholder for future response values -} - -// VirtualMachinesClientReapplyResponse contains the response from method VirtualMachinesClient.BeginReapply. -type VirtualMachinesClientReapplyResponse struct { - // placeholder for future response values -} - -// VirtualMachinesClientRedeployResponse contains the response from method VirtualMachinesClient.BeginRedeploy. -type VirtualMachinesClientRedeployResponse struct { - // placeholder for future response values -} - -// VirtualMachinesClientReimageResponse contains the response from method VirtualMachinesClient.BeginReimage. -type VirtualMachinesClientReimageResponse struct { - // placeholder for future response values -} - -// VirtualMachinesClientRestartResponse contains the response from method VirtualMachinesClient.BeginRestart. -type VirtualMachinesClientRestartResponse struct { - // placeholder for future response values -} - -// VirtualMachinesClientRetrieveBootDiagnosticsDataResponse contains the response from method VirtualMachinesClient.RetrieveBootDiagnosticsData. -type VirtualMachinesClientRetrieveBootDiagnosticsDataResponse struct { - // The SAS URIs of the console screenshot and serial log blobs. - RetrieveBootDiagnosticsDataResult -} - -// VirtualMachinesClientRunCommandResponse contains the response from method VirtualMachinesClient.BeginRunCommand. -type VirtualMachinesClientRunCommandResponse struct { - RunCommandResult -} - -// VirtualMachinesClientSimulateEvictionResponse contains the response from method VirtualMachinesClient.SimulateEviction. -type VirtualMachinesClientSimulateEvictionResponse struct { - // placeholder for future response values -} - -// VirtualMachinesClientStartResponse contains the response from method VirtualMachinesClient.BeginStart. -type VirtualMachinesClientStartResponse struct { - // placeholder for future response values -} - -// VirtualMachinesClientUpdateResponse contains the response from method VirtualMachinesClient.BeginUpdate. -type VirtualMachinesClientUpdateResponse struct { - // Describes a Virtual Machine. - VirtualMachine -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/restorepointcollections_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/restorepointcollections_client.go deleted file mode 100644 index f53e3a7d400..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/restorepointcollections_client.go +++ /dev/null @@ -1,447 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// RestorePointCollectionsClient contains the methods for the RestorePointCollections group. -// Don't use this type directly, use NewRestorePointCollectionsClient() instead. -type RestorePointCollectionsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewRestorePointCollectionsClient creates a new instance of RestorePointCollectionsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewRestorePointCollectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RestorePointCollectionsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &RestorePointCollectionsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// CreateOrUpdate - The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints -// for more details. When updating a restore point collection, only tags may be modified. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - restorePointCollectionName - The name of the restore point collection. -// - parameters - Parameters supplied to the Create or Update restore point collection operation. -// - options - RestorePointCollectionsClientCreateOrUpdateOptions contains the optional parameters for the RestorePointCollectionsClient.CreateOrUpdate -// method. -func (client *RestorePointCollectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, restorePointCollectionName string, parameters RestorePointCollection, options *RestorePointCollectionsClientCreateOrUpdateOptions) (RestorePointCollectionsClientCreateOrUpdateResponse, error) { - var err error - const operationName = "RestorePointCollectionsClient.CreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, restorePointCollectionName, parameters, options) - if err != nil { - return RestorePointCollectionsClientCreateOrUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return RestorePointCollectionsClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return RestorePointCollectionsClientCreateOrUpdateResponse{}, err - } - resp, err := client.createOrUpdateHandleResponse(httpResp) - return resp, err -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *RestorePointCollectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, parameters RestorePointCollection, options *RestorePointCollectionsClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if restorePointCollectionName == "" { - return nil, errors.New("parameter restorePointCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *RestorePointCollectionsClient) createOrUpdateHandleResponse(resp *http.Response) (RestorePointCollectionsClientCreateOrUpdateResponse, error) { - result := RestorePointCollectionsClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RestorePointCollection); err != nil { - return RestorePointCollectionsClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// BeginDelete - The operation to delete the restore point collection. This operation will also delete all the contained restore -// points. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - restorePointCollectionName - The name of the Restore Point Collection. -// - options - RestorePointCollectionsClientBeginDeleteOptions contains the optional parameters for the RestorePointCollectionsClient.BeginDelete -// method. -func (client *RestorePointCollectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, restorePointCollectionName string, options *RestorePointCollectionsClientBeginDeleteOptions) (*runtime.Poller[RestorePointCollectionsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, restorePointCollectionName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RestorePointCollectionsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[RestorePointCollectionsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - The operation to delete the restore point collection. This operation will also delete all the contained restore -// points. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *RestorePointCollectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, restorePointCollectionName string, options *RestorePointCollectionsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "RestorePointCollectionsClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, restorePointCollectionName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *RestorePointCollectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, options *RestorePointCollectionsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if restorePointCollectionName == "" { - return nil, errors.New("parameter restorePointCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - The operation to get the restore point collection. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - restorePointCollectionName - The name of the restore point collection. -// - options - RestorePointCollectionsClientGetOptions contains the optional parameters for the RestorePointCollectionsClient.Get -// method. -func (client *RestorePointCollectionsClient) Get(ctx context.Context, resourceGroupName string, restorePointCollectionName string, options *RestorePointCollectionsClientGetOptions) (RestorePointCollectionsClientGetResponse, error) { - var err error - const operationName = "RestorePointCollectionsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, restorePointCollectionName, options) - if err != nil { - return RestorePointCollectionsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return RestorePointCollectionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return RestorePointCollectionsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *RestorePointCollectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, options *RestorePointCollectionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if restorePointCollectionName == "" { - return nil, errors.New("parameter restorePointCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *RestorePointCollectionsClient) getHandleResponse(resp *http.Response) (RestorePointCollectionsClientGetResponse, error) { - result := RestorePointCollectionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RestorePointCollection); err != nil { - return RestorePointCollectionsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets the list of restore point collections in a resource group. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - options - RestorePointCollectionsClientListOptions contains the optional parameters for the RestorePointCollectionsClient.NewListPager -// method. -func (client *RestorePointCollectionsClient) NewListPager(resourceGroupName string, options *RestorePointCollectionsClientListOptions) *runtime.Pager[RestorePointCollectionsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[RestorePointCollectionsClientListResponse]{ - More: func(page RestorePointCollectionsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *RestorePointCollectionsClientListResponse) (RestorePointCollectionsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "RestorePointCollectionsClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, options) - }, nil) - if err != nil { - return RestorePointCollectionsClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *RestorePointCollectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *RestorePointCollectionsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *RestorePointCollectionsClient) listHandleResponse(resp *http.Response) (RestorePointCollectionsClientListResponse, error) { - result := RestorePointCollectionsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RestorePointCollectionListResult); err != nil { - return RestorePointCollectionsClientListResponse{}, err - } - return result, nil -} - -// NewListAllPager - Gets the list of restore point collections in the subscription. Use nextLink property in the response -// to get the next page of restore point collections. Do this till nextLink is not null to fetch all -// the restore point collections. -// -// Generated from API version 2024-03-01 -// - options - RestorePointCollectionsClientListAllOptions contains the optional parameters for the RestorePointCollectionsClient.NewListAllPager -// method. -func (client *RestorePointCollectionsClient) NewListAllPager(options *RestorePointCollectionsClientListAllOptions) *runtime.Pager[RestorePointCollectionsClientListAllResponse] { - return runtime.NewPager(runtime.PagingHandler[RestorePointCollectionsClientListAllResponse]{ - More: func(page RestorePointCollectionsClientListAllResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *RestorePointCollectionsClientListAllResponse) (RestorePointCollectionsClientListAllResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "RestorePointCollectionsClient.NewListAllPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listAllCreateRequest(ctx, options) - }, nil) - if err != nil { - return RestorePointCollectionsClientListAllResponse{}, err - } - return client.listAllHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listAllCreateRequest creates the ListAll request. -func (client *RestorePointCollectionsClient) listAllCreateRequest(ctx context.Context, options *RestorePointCollectionsClientListAllOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/restorePointCollections" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAllHandleResponse handles the ListAll response. -func (client *RestorePointCollectionsClient) listAllHandleResponse(resp *http.Response) (RestorePointCollectionsClientListAllResponse, error) { - result := RestorePointCollectionsClientListAllResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RestorePointCollectionListResult); err != nil { - return RestorePointCollectionsClientListAllResponse{}, err - } - return result, nil -} - -// Update - The operation to update the restore point collection. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - restorePointCollectionName - The name of the restore point collection. -// - parameters - Parameters supplied to the Update restore point collection operation. -// - options - RestorePointCollectionsClientUpdateOptions contains the optional parameters for the RestorePointCollectionsClient.Update -// method. -func (client *RestorePointCollectionsClient) Update(ctx context.Context, resourceGroupName string, restorePointCollectionName string, parameters RestorePointCollectionUpdate, options *RestorePointCollectionsClientUpdateOptions) (RestorePointCollectionsClientUpdateResponse, error) { - var err error - const operationName = "RestorePointCollectionsClient.Update" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, restorePointCollectionName, parameters, options) - if err != nil { - return RestorePointCollectionsClientUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return RestorePointCollectionsClientUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return RestorePointCollectionsClientUpdateResponse{}, err - } - resp, err := client.updateHandleResponse(httpResp) - return resp, err -} - -// updateCreateRequest creates the Update request. -func (client *RestorePointCollectionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, parameters RestorePointCollectionUpdate, options *RestorePointCollectionsClientUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if restorePointCollectionName == "" { - return nil, errors.New("parameter restorePointCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// updateHandleResponse handles the Update response. -func (client *RestorePointCollectionsClient) updateHandleResponse(resp *http.Response) (RestorePointCollectionsClientUpdateResponse, error) { - result := RestorePointCollectionsClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RestorePointCollection); err != nil { - return RestorePointCollectionsClientUpdateResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/restorepoints_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/restorepoints_client.go deleted file mode 100644 index dffafe2da35..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/restorepoints_client.go +++ /dev/null @@ -1,283 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// RestorePointsClient contains the methods for the RestorePoints group. -// Don't use this type directly, use NewRestorePointsClient() instead. -type RestorePointsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewRestorePointsClient creates a new instance of RestorePointsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewRestorePointsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RestorePointsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &RestorePointsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreate - The operation to create the restore point. Updating properties of an existing restore point is not allowed -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - restorePointCollectionName - The name of the restore point collection. -// - restorePointName - The name of the restore point. -// - parameters - Parameters supplied to the Create restore point operation. -// - options - RestorePointsClientBeginCreateOptions contains the optional parameters for the RestorePointsClient.BeginCreate -// method. -func (client *RestorePointsClient) BeginCreate(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, parameters RestorePoint, options *RestorePointsClientBeginCreateOptions) (*runtime.Poller[RestorePointsClientCreateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.create(ctx, resourceGroupName, restorePointCollectionName, restorePointName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RestorePointsClientCreateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[RestorePointsClientCreateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Create - The operation to create the restore point. Updating properties of an existing restore point is not allowed -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *RestorePointsClient) create(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, parameters RestorePoint, options *RestorePointsClientBeginCreateOptions) (*http.Response, error) { - var err error - const operationName = "RestorePointsClient.BeginCreate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createCreateRequest(ctx, resourceGroupName, restorePointCollectionName, restorePointName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createCreateRequest creates the Create request. -func (client *RestorePointsClient) createCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, parameters RestorePoint, options *RestorePointsClientBeginCreateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if restorePointCollectionName == "" { - return nil, errors.New("parameter restorePointCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName)) - if restorePointName == "" { - return nil, errors.New("parameter restorePointName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointName}", url.PathEscape(restorePointName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - The operation to delete the restore point. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - restorePointCollectionName - The name of the Restore Point Collection. -// - restorePointName - The name of the restore point. -// - options - RestorePointsClientBeginDeleteOptions contains the optional parameters for the RestorePointsClient.BeginDelete -// method. -func (client *RestorePointsClient) BeginDelete(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, options *RestorePointsClientBeginDeleteOptions) (*runtime.Poller[RestorePointsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, restorePointCollectionName, restorePointName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RestorePointsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[RestorePointsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - The operation to delete the restore point. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *RestorePointsClient) deleteOperation(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, options *RestorePointsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "RestorePointsClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, restorePointCollectionName, restorePointName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *RestorePointsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, options *RestorePointsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if restorePointCollectionName == "" { - return nil, errors.New("parameter restorePointCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName)) - if restorePointName == "" { - return nil, errors.New("parameter restorePointName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointName}", url.PathEscape(restorePointName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - The operation to get the restore point. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - restorePointCollectionName - The name of the restore point collection. -// - restorePointName - The name of the restore point. -// - options - RestorePointsClientGetOptions contains the optional parameters for the RestorePointsClient.Get method. -func (client *RestorePointsClient) Get(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, options *RestorePointsClientGetOptions) (RestorePointsClientGetResponse, error) { - var err error - const operationName = "RestorePointsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, restorePointCollectionName, restorePointName, options) - if err != nil { - return RestorePointsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return RestorePointsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return RestorePointsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *RestorePointsClient) getCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, options *RestorePointsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if restorePointCollectionName == "" { - return nil, errors.New("parameter restorePointCollectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName)) - if restorePointName == "" { - return nil, errors.New("parameter restorePointName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{restorePointName}", url.PathEscape(restorePointName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *RestorePointsClient) getHandleResponse(resp *http.Response) (RestorePointsClientGetResponse, error) { - result := RestorePointsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RestorePoint); err != nil { - return RestorePointsClientGetResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sharedgalleries_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sharedgalleries_client.go deleted file mode 100644 index ee8172bae84..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sharedgalleries_client.go +++ /dev/null @@ -1,172 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// SharedGalleriesClient contains the methods for the SharedGalleries group. -// Don't use this type directly, use NewSharedGalleriesClient() instead. -type SharedGalleriesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewSharedGalleriesClient creates a new instance of SharedGalleriesClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewSharedGalleriesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SharedGalleriesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &SharedGalleriesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Get - Get a shared gallery by subscription id or tenant id. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - location - Resource location. -// - galleryUniqueName - The unique name of the Shared Gallery. -// - options - SharedGalleriesClientGetOptions contains the optional parameters for the SharedGalleriesClient.Get method. -func (client *SharedGalleriesClient) Get(ctx context.Context, location string, galleryUniqueName string, options *SharedGalleriesClientGetOptions) (SharedGalleriesClientGetResponse, error) { - var err error - const operationName = "SharedGalleriesClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, location, galleryUniqueName, options) - if err != nil { - return SharedGalleriesClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return SharedGalleriesClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return SharedGalleriesClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *SharedGalleriesClient) getCreateRequest(ctx context.Context, location string, galleryUniqueName string, options *SharedGalleriesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if galleryUniqueName == "" { - return nil, errors.New("parameter galleryUniqueName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryUniqueName}", url.PathEscape(galleryUniqueName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *SharedGalleriesClient) getHandleResponse(resp *http.Response) (SharedGalleriesClientGetResponse, error) { - result := SharedGalleriesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SharedGallery); err != nil { - return SharedGalleriesClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - List shared galleries by subscription id or tenant id. -// -// Generated from API version 2023-07-03 -// - location - Resource location. -// - options - SharedGalleriesClientListOptions contains the optional parameters for the SharedGalleriesClient.NewListPager -// method. -func (client *SharedGalleriesClient) NewListPager(location string, options *SharedGalleriesClientListOptions) *runtime.Pager[SharedGalleriesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[SharedGalleriesClientListResponse]{ - More: func(page SharedGalleriesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *SharedGalleriesClientListResponse) (SharedGalleriesClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SharedGalleriesClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, location, options) - }, nil) - if err != nil { - return SharedGalleriesClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *SharedGalleriesClient) listCreateRequest(ctx context.Context, location string, options *SharedGalleriesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - if options != nil && options.SharedTo != nil { - reqQP.Set("sharedTo", string(*options.SharedTo)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *SharedGalleriesClient) listHandleResponse(resp *http.Response) (SharedGalleriesClientListResponse, error) { - result := SharedGalleriesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SharedGalleryList); err != nil { - return SharedGalleriesClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sharedgalleryimages_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sharedgalleryimages_client.go deleted file mode 100644 index 8f0ef79cfe0..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sharedgalleryimages_client.go +++ /dev/null @@ -1,182 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// SharedGalleryImagesClient contains the methods for the SharedGalleryImages group. -// Don't use this type directly, use NewSharedGalleryImagesClient() instead. -type SharedGalleryImagesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewSharedGalleryImagesClient creates a new instance of SharedGalleryImagesClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewSharedGalleryImagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SharedGalleryImagesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &SharedGalleryImagesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Get - Get a shared gallery image by subscription id or tenant id. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - location - Resource location. -// - galleryUniqueName - The unique name of the Shared Gallery. -// - galleryImageName - The name of the Shared Gallery Image Definition from which the Image Versions are to be listed. -// - options - SharedGalleryImagesClientGetOptions contains the optional parameters for the SharedGalleryImagesClient.Get method. -func (client *SharedGalleryImagesClient) Get(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, options *SharedGalleryImagesClientGetOptions) (SharedGalleryImagesClientGetResponse, error) { - var err error - const operationName = "SharedGalleryImagesClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, location, galleryUniqueName, galleryImageName, options) - if err != nil { - return SharedGalleryImagesClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return SharedGalleryImagesClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return SharedGalleryImagesClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *SharedGalleryImagesClient) getCreateRequest(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, options *SharedGalleryImagesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if galleryUniqueName == "" { - return nil, errors.New("parameter galleryUniqueName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryUniqueName}", url.PathEscape(galleryUniqueName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *SharedGalleryImagesClient) getHandleResponse(resp *http.Response) (SharedGalleryImagesClientGetResponse, error) { - result := SharedGalleryImagesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SharedGalleryImage); err != nil { - return SharedGalleryImagesClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - List shared gallery images by subscription id or tenant id. -// -// Generated from API version 2023-07-03 -// - location - Resource location. -// - galleryUniqueName - The unique name of the Shared Gallery. -// - options - SharedGalleryImagesClientListOptions contains the optional parameters for the SharedGalleryImagesClient.NewListPager -// method. -func (client *SharedGalleryImagesClient) NewListPager(location string, galleryUniqueName string, options *SharedGalleryImagesClientListOptions) *runtime.Pager[SharedGalleryImagesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[SharedGalleryImagesClientListResponse]{ - More: func(page SharedGalleryImagesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *SharedGalleryImagesClientListResponse) (SharedGalleryImagesClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SharedGalleryImagesClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, location, galleryUniqueName, options) - }, nil) - if err != nil { - return SharedGalleryImagesClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *SharedGalleryImagesClient) listCreateRequest(ctx context.Context, location string, galleryUniqueName string, options *SharedGalleryImagesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if galleryUniqueName == "" { - return nil, errors.New("parameter galleryUniqueName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryUniqueName}", url.PathEscape(galleryUniqueName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - if options != nil && options.SharedTo != nil { - reqQP.Set("sharedTo", string(*options.SharedTo)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *SharedGalleryImagesClient) listHandleResponse(resp *http.Response) (SharedGalleryImagesClientListResponse, error) { - result := SharedGalleryImagesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SharedGalleryImageList); err != nil { - return SharedGalleryImagesClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sharedgalleryimageversions_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sharedgalleryimageversions_client.go deleted file mode 100644 index 729b0e3c5d5..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sharedgalleryimageversions_client.go +++ /dev/null @@ -1,195 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// SharedGalleryImageVersionsClient contains the methods for the SharedGalleryImageVersions group. -// Don't use this type directly, use NewSharedGalleryImageVersionsClient() instead. -type SharedGalleryImageVersionsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewSharedGalleryImageVersionsClient creates a new instance of SharedGalleryImageVersionsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewSharedGalleryImageVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SharedGalleryImageVersionsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &SharedGalleryImageVersionsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Get - Get a shared gallery image version by subscription id or tenant id. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-07-03 -// - location - Resource location. -// - galleryUniqueName - The unique name of the Shared Gallery. -// - galleryImageName - The name of the Shared Gallery Image Definition from which the Image Versions are to be listed. -// - galleryImageVersionName - The name of the gallery image version to be created. Needs to follow semantic version name pattern: -// The allowed characters are digit and period. Digits must be within the range of a 32-bit integer. -// Format: .. -// - options - SharedGalleryImageVersionsClientGetOptions contains the optional parameters for the SharedGalleryImageVersionsClient.Get -// method. -func (client *SharedGalleryImageVersionsClient) Get(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, galleryImageVersionName string, options *SharedGalleryImageVersionsClientGetOptions) (SharedGalleryImageVersionsClientGetResponse, error) { - var err error - const operationName = "SharedGalleryImageVersionsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, location, galleryUniqueName, galleryImageName, galleryImageVersionName, options) - if err != nil { - return SharedGalleryImageVersionsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return SharedGalleryImageVersionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return SharedGalleryImageVersionsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *SharedGalleryImageVersionsClient) getCreateRequest(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, galleryImageVersionName string, options *SharedGalleryImageVersionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}/versions/{galleryImageVersionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if galleryUniqueName == "" { - return nil, errors.New("parameter galleryUniqueName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryUniqueName}", url.PathEscape(galleryUniqueName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - if galleryImageVersionName == "" { - return nil, errors.New("parameter galleryImageVersionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageVersionName}", url.PathEscape(galleryImageVersionName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *SharedGalleryImageVersionsClient) getHandleResponse(resp *http.Response) (SharedGalleryImageVersionsClientGetResponse, error) { - result := SharedGalleryImageVersionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SharedGalleryImageVersion); err != nil { - return SharedGalleryImageVersionsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - List shared gallery image versions by subscription id or tenant id. -// -// Generated from API version 2023-07-03 -// - location - Resource location. -// - galleryUniqueName - The unique name of the Shared Gallery. -// - galleryImageName - The name of the Shared Gallery Image Definition from which the Image Versions are to be listed. -// - options - SharedGalleryImageVersionsClientListOptions contains the optional parameters for the SharedGalleryImageVersionsClient.NewListPager -// method. -func (client *SharedGalleryImageVersionsClient) NewListPager(location string, galleryUniqueName string, galleryImageName string, options *SharedGalleryImageVersionsClientListOptions) *runtime.Pager[SharedGalleryImageVersionsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[SharedGalleryImageVersionsClientListResponse]{ - More: func(page SharedGalleryImageVersionsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *SharedGalleryImageVersionsClientListResponse) (SharedGalleryImageVersionsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SharedGalleryImageVersionsClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, location, galleryUniqueName, galleryImageName, options) - }, nil) - if err != nil { - return SharedGalleryImageVersionsClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *SharedGalleryImageVersionsClient) listCreateRequest(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, options *SharedGalleryImageVersionsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}/versions" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if galleryUniqueName == "" { - return nil, errors.New("parameter galleryUniqueName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryUniqueName}", url.PathEscape(galleryUniqueName)) - if galleryImageName == "" { - return nil, errors.New("parameter galleryImageName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-03") - if options != nil && options.SharedTo != nil { - reqQP.Set("sharedTo", string(*options.SharedTo)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *SharedGalleryImageVersionsClient) listHandleResponse(resp *http.Response) (SharedGalleryImageVersionsClientListResponse, error) { - result := SharedGalleryImageVersionsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SharedGalleryImageVersionList); err != nil { - return SharedGalleryImageVersionsClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/snapshots_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/snapshots_client.go deleted file mode 100644 index 8c73f7709e6..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/snapshots_client.go +++ /dev/null @@ -1,625 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// SnapshotsClient contains the methods for the Snapshots group. -// Don't use this type directly, use NewSnapshotsClient() instead. -type SnapshotsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewSnapshotsClient creates a new instance of SnapshotsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewSnapshotsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SnapshotsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &SnapshotsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a snapshot. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - snapshotName - The name of the snapshot that is being created. The name can't be changed after the snapshot is created. -// Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80 -// characters. -// - snapshot - Snapshot object supplied in the body of the Put disk operation. -// - options - SnapshotsClientBeginCreateOrUpdateOptions contains the optional parameters for the SnapshotsClient.BeginCreateOrUpdate -// method. -func (client *SnapshotsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, snapshotName string, snapshot Snapshot, options *SnapshotsClientBeginCreateOrUpdateOptions) (*runtime.Poller[SnapshotsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, snapshotName, snapshot, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SnapshotsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SnapshotsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Creates or updates a snapshot. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *SnapshotsClient) createOrUpdate(ctx context.Context, resourceGroupName string, snapshotName string, snapshot Snapshot, options *SnapshotsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "SnapshotsClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, snapshotName, snapshot, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *SnapshotsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, snapshotName string, snapshot Snapshot, options *SnapshotsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if snapshotName == "" { - return nil, errors.New("parameter snapshotName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{snapshotName}", url.PathEscape(snapshotName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, snapshot); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - Deletes a snapshot. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - snapshotName - The name of the snapshot that is being created. The name can't be changed after the snapshot is created. -// Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80 -// characters. -// - options - SnapshotsClientBeginDeleteOptions contains the optional parameters for the SnapshotsClient.BeginDelete method. -func (client *SnapshotsClient) BeginDelete(ctx context.Context, resourceGroupName string, snapshotName string, options *SnapshotsClientBeginDeleteOptions) (*runtime.Poller[SnapshotsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, snapshotName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SnapshotsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SnapshotsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Deletes a snapshot. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *SnapshotsClient) deleteOperation(ctx context.Context, resourceGroupName string, snapshotName string, options *SnapshotsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "SnapshotsClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, snapshotName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *SnapshotsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, snapshotName string, options *SnapshotsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if snapshotName == "" { - return nil, errors.New("parameter snapshotName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{snapshotName}", url.PathEscape(snapshotName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - return req, nil -} - -// Get - Gets information about a snapshot. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - snapshotName - The name of the snapshot that is being created. The name can't be changed after the snapshot is created. -// Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80 -// characters. -// - options - SnapshotsClientGetOptions contains the optional parameters for the SnapshotsClient.Get method. -func (client *SnapshotsClient) Get(ctx context.Context, resourceGroupName string, snapshotName string, options *SnapshotsClientGetOptions) (SnapshotsClientGetResponse, error) { - var err error - const operationName = "SnapshotsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, snapshotName, options) - if err != nil { - return SnapshotsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return SnapshotsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return SnapshotsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *SnapshotsClient) getCreateRequest(ctx context.Context, resourceGroupName string, snapshotName string, options *SnapshotsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if snapshotName == "" { - return nil, errors.New("parameter snapshotName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{snapshotName}", url.PathEscape(snapshotName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *SnapshotsClient) getHandleResponse(resp *http.Response) (SnapshotsClientGetResponse, error) { - result := SnapshotsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Snapshot); err != nil { - return SnapshotsClientGetResponse{}, err - } - return result, nil -} - -// BeginGrantAccess - Grants access to a snapshot. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - snapshotName - The name of the snapshot that is being created. The name can't be changed after the snapshot is created. -// Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80 -// characters. -// - grantAccessData - Access data object supplied in the body of the get snapshot access operation. -// - options - SnapshotsClientBeginGrantAccessOptions contains the optional parameters for the SnapshotsClient.BeginGrantAccess -// method. -func (client *SnapshotsClient) BeginGrantAccess(ctx context.Context, resourceGroupName string, snapshotName string, grantAccessData GrantAccessData, options *SnapshotsClientBeginGrantAccessOptions) (*runtime.Poller[SnapshotsClientGrantAccessResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.grantAccess(ctx, resourceGroupName, snapshotName, grantAccessData, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SnapshotsClientGrantAccessResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SnapshotsClientGrantAccessResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// GrantAccess - Grants access to a snapshot. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *SnapshotsClient) grantAccess(ctx context.Context, resourceGroupName string, snapshotName string, grantAccessData GrantAccessData, options *SnapshotsClientBeginGrantAccessOptions) (*http.Response, error) { - var err error - const operationName = "SnapshotsClient.BeginGrantAccess" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.grantAccessCreateRequest(ctx, resourceGroupName, snapshotName, grantAccessData, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// grantAccessCreateRequest creates the GrantAccess request. -func (client *SnapshotsClient) grantAccessCreateRequest(ctx context.Context, resourceGroupName string, snapshotName string, grantAccessData GrantAccessData, options *SnapshotsClientBeginGrantAccessOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/beginGetAccess" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if snapshotName == "" { - return nil, errors.New("parameter snapshotName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{snapshotName}", url.PathEscape(snapshotName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, grantAccessData); err != nil { - return nil, err - } - return req, nil -} - -// NewListPager - Lists snapshots under a subscription. -// -// Generated from API version 2023-10-02 -// - options - SnapshotsClientListOptions contains the optional parameters for the SnapshotsClient.NewListPager method. -func (client *SnapshotsClient) NewListPager(options *SnapshotsClientListOptions) *runtime.Pager[SnapshotsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[SnapshotsClientListResponse]{ - More: func(page SnapshotsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *SnapshotsClientListResponse) (SnapshotsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SnapshotsClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, options) - }, nil) - if err != nil { - return SnapshotsClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *SnapshotsClient) listCreateRequest(ctx context.Context, options *SnapshotsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/snapshots" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *SnapshotsClient) listHandleResponse(resp *http.Response) (SnapshotsClientListResponse, error) { - result := SnapshotsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SnapshotList); err != nil { - return SnapshotsClientListResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Lists snapshots under a resource group. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - options - SnapshotsClientListByResourceGroupOptions contains the optional parameters for the SnapshotsClient.NewListByResourceGroupPager -// method. -func (client *SnapshotsClient) NewListByResourceGroupPager(resourceGroupName string, options *SnapshotsClientListByResourceGroupOptions) *runtime.Pager[SnapshotsClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[SnapshotsClientListByResourceGroupResponse]{ - More: func(page SnapshotsClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *SnapshotsClientListByResourceGroupResponse) (SnapshotsClientListByResourceGroupResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SnapshotsClient.NewListByResourceGroupPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - }, nil) - if err != nil { - return SnapshotsClientListByResourceGroupResponse{}, err - } - return client.listByResourceGroupHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *SnapshotsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *SnapshotsClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *SnapshotsClient) listByResourceGroupHandleResponse(resp *http.Response) (SnapshotsClientListByResourceGroupResponse, error) { - result := SnapshotsClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SnapshotList); err != nil { - return SnapshotsClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// BeginRevokeAccess - Revokes access to a snapshot. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - snapshotName - The name of the snapshot that is being created. The name can't be changed after the snapshot is created. -// Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80 -// characters. -// - options - SnapshotsClientBeginRevokeAccessOptions contains the optional parameters for the SnapshotsClient.BeginRevokeAccess -// method. -func (client *SnapshotsClient) BeginRevokeAccess(ctx context.Context, resourceGroupName string, snapshotName string, options *SnapshotsClientBeginRevokeAccessOptions) (*runtime.Poller[SnapshotsClientRevokeAccessResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.revokeAccess(ctx, resourceGroupName, snapshotName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SnapshotsClientRevokeAccessResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SnapshotsClientRevokeAccessResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// RevokeAccess - Revokes access to a snapshot. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *SnapshotsClient) revokeAccess(ctx context.Context, resourceGroupName string, snapshotName string, options *SnapshotsClientBeginRevokeAccessOptions) (*http.Response, error) { - var err error - const operationName = "SnapshotsClient.BeginRevokeAccess" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.revokeAccessCreateRequest(ctx, resourceGroupName, snapshotName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// revokeAccessCreateRequest creates the RevokeAccess request. -func (client *SnapshotsClient) revokeAccessCreateRequest(ctx context.Context, resourceGroupName string, snapshotName string, options *SnapshotsClientBeginRevokeAccessOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/endGetAccess" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if snapshotName == "" { - return nil, errors.New("parameter snapshotName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{snapshotName}", url.PathEscape(snapshotName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - return req, nil -} - -// BeginUpdate - Updates (patches) a snapshot. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -// - resourceGroupName - The name of the resource group. -// - snapshotName - The name of the snapshot that is being created. The name can't be changed after the snapshot is created. -// Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80 -// characters. -// - snapshot - Snapshot object supplied in the body of the Patch snapshot operation. -// - options - SnapshotsClientBeginUpdateOptions contains the optional parameters for the SnapshotsClient.BeginUpdate method. -func (client *SnapshotsClient) BeginUpdate(ctx context.Context, resourceGroupName string, snapshotName string, snapshot SnapshotUpdate, options *SnapshotsClientBeginUpdateOptions) (*runtime.Poller[SnapshotsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, snapshotName, snapshot, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SnapshotsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SnapshotsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Updates (patches) a snapshot. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-10-02 -func (client *SnapshotsClient) update(ctx context.Context, resourceGroupName string, snapshotName string, snapshot SnapshotUpdate, options *SnapshotsClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "SnapshotsClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, snapshotName, snapshot, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *SnapshotsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, snapshotName string, snapshot SnapshotUpdate, options *SnapshotsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if snapshotName == "" { - return nil, errors.New("parameter snapshotName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{snapshotName}", url.PathEscape(snapshotName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-02") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, snapshot); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sshpublickeys_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sshpublickeys_client.go deleted file mode 100644 index 58d8d18ba95..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sshpublickeys_client.go +++ /dev/null @@ -1,489 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// SSHPublicKeysClient contains the methods for the SSHPublicKeys group. -// Don't use this type directly, use NewSSHPublicKeysClient() instead. -type SSHPublicKeysClient struct { - internal *arm.Client - subscriptionID string -} - -// NewSSHPublicKeysClient creates a new instance of SSHPublicKeysClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewSSHPublicKeysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SSHPublicKeysClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &SSHPublicKeysClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Create - Creates a new SSH public key resource. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - sshPublicKeyName - The name of the SSH public key. -// - parameters - Parameters supplied to create the SSH public key. -// - options - SSHPublicKeysClientCreateOptions contains the optional parameters for the SSHPublicKeysClient.Create method. -func (client *SSHPublicKeysClient) Create(ctx context.Context, resourceGroupName string, sshPublicKeyName string, parameters SSHPublicKeyResource, options *SSHPublicKeysClientCreateOptions) (SSHPublicKeysClientCreateResponse, error) { - var err error - const operationName = "SSHPublicKeysClient.Create" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createCreateRequest(ctx, resourceGroupName, sshPublicKeyName, parameters, options) - if err != nil { - return SSHPublicKeysClientCreateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return SSHPublicKeysClientCreateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return SSHPublicKeysClientCreateResponse{}, err - } - resp, err := client.createHandleResponse(httpResp) - return resp, err -} - -// createCreateRequest creates the Create request. -func (client *SSHPublicKeysClient) createCreateRequest(ctx context.Context, resourceGroupName string, sshPublicKeyName string, parameters SSHPublicKeyResource, options *SSHPublicKeysClientCreateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if sshPublicKeyName == "" { - return nil, errors.New("parameter sshPublicKeyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{sshPublicKeyName}", url.PathEscape(sshPublicKeyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// createHandleResponse handles the Create response. -func (client *SSHPublicKeysClient) createHandleResponse(resp *http.Response) (SSHPublicKeysClientCreateResponse, error) { - result := SSHPublicKeysClientCreateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SSHPublicKeyResource); err != nil { - return SSHPublicKeysClientCreateResponse{}, err - } - return result, nil -} - -// Delete - Delete an SSH public key. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - sshPublicKeyName - The name of the SSH public key. -// - options - SSHPublicKeysClientDeleteOptions contains the optional parameters for the SSHPublicKeysClient.Delete method. -func (client *SSHPublicKeysClient) Delete(ctx context.Context, resourceGroupName string, sshPublicKeyName string, options *SSHPublicKeysClientDeleteOptions) (SSHPublicKeysClientDeleteResponse, error) { - var err error - const operationName = "SSHPublicKeysClient.Delete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, sshPublicKeyName, options) - if err != nil { - return SSHPublicKeysClientDeleteResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return SSHPublicKeysClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return SSHPublicKeysClientDeleteResponse{}, err - } - return SSHPublicKeysClientDeleteResponse{}, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *SSHPublicKeysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, sshPublicKeyName string, options *SSHPublicKeysClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if sshPublicKeyName == "" { - return nil, errors.New("parameter sshPublicKeyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{sshPublicKeyName}", url.PathEscape(sshPublicKeyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// GenerateKeyPair - Generates and returns a public/private key pair and populates the SSH public key resource with the public -// key. The length of the key will be 3072 bits. This operation can only be performed once per -// SSH public key resource. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - sshPublicKeyName - The name of the SSH public key. -// - options - SSHPublicKeysClientGenerateKeyPairOptions contains the optional parameters for the SSHPublicKeysClient.GenerateKeyPair -// method. -func (client *SSHPublicKeysClient) GenerateKeyPair(ctx context.Context, resourceGroupName string, sshPublicKeyName string, options *SSHPublicKeysClientGenerateKeyPairOptions) (SSHPublicKeysClientGenerateKeyPairResponse, error) { - var err error - const operationName = "SSHPublicKeysClient.GenerateKeyPair" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.generateKeyPairCreateRequest(ctx, resourceGroupName, sshPublicKeyName, options) - if err != nil { - return SSHPublicKeysClientGenerateKeyPairResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return SSHPublicKeysClientGenerateKeyPairResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return SSHPublicKeysClientGenerateKeyPairResponse{}, err - } - resp, err := client.generateKeyPairHandleResponse(httpResp) - return resp, err -} - -// generateKeyPairCreateRequest creates the GenerateKeyPair request. -func (client *SSHPublicKeysClient) generateKeyPairCreateRequest(ctx context.Context, resourceGroupName string, sshPublicKeyName string, options *SSHPublicKeysClientGenerateKeyPairOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}/generateKeyPair" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if sshPublicKeyName == "" { - return nil, errors.New("parameter sshPublicKeyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{sshPublicKeyName}", url.PathEscape(sshPublicKeyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.Parameters != nil { - if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil { - return nil, err - } - return req, nil - } - return req, nil -} - -// generateKeyPairHandleResponse handles the GenerateKeyPair response. -func (client *SSHPublicKeysClient) generateKeyPairHandleResponse(resp *http.Response) (SSHPublicKeysClientGenerateKeyPairResponse, error) { - result := SSHPublicKeysClientGenerateKeyPairResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SSHPublicKeyGenerateKeyPairResult); err != nil { - return SSHPublicKeysClientGenerateKeyPairResponse{}, err - } - return result, nil -} - -// Get - Retrieves information about an SSH public key. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - sshPublicKeyName - The name of the SSH public key. -// - options - SSHPublicKeysClientGetOptions contains the optional parameters for the SSHPublicKeysClient.Get method. -func (client *SSHPublicKeysClient) Get(ctx context.Context, resourceGroupName string, sshPublicKeyName string, options *SSHPublicKeysClientGetOptions) (SSHPublicKeysClientGetResponse, error) { - var err error - const operationName = "SSHPublicKeysClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, sshPublicKeyName, options) - if err != nil { - return SSHPublicKeysClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return SSHPublicKeysClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return SSHPublicKeysClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *SSHPublicKeysClient) getCreateRequest(ctx context.Context, resourceGroupName string, sshPublicKeyName string, options *SSHPublicKeysClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if sshPublicKeyName == "" { - return nil, errors.New("parameter sshPublicKeyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{sshPublicKeyName}", url.PathEscape(sshPublicKeyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *SSHPublicKeysClient) getHandleResponse(resp *http.Response) (SSHPublicKeysClientGetResponse, error) { - result := SSHPublicKeysClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SSHPublicKeyResource); err != nil { - return SSHPublicKeysClientGetResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Lists all of the SSH public keys in the specified resource group. Use the nextLink property -// in the response to get the next page of SSH public keys. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - options - SSHPublicKeysClientListByResourceGroupOptions contains the optional parameters for the SSHPublicKeysClient.NewListByResourceGroupPager -// method. -func (client *SSHPublicKeysClient) NewListByResourceGroupPager(resourceGroupName string, options *SSHPublicKeysClientListByResourceGroupOptions) *runtime.Pager[SSHPublicKeysClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[SSHPublicKeysClientListByResourceGroupResponse]{ - More: func(page SSHPublicKeysClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *SSHPublicKeysClientListByResourceGroupResponse) (SSHPublicKeysClientListByResourceGroupResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SSHPublicKeysClient.NewListByResourceGroupPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - }, nil) - if err != nil { - return SSHPublicKeysClientListByResourceGroupResponse{}, err - } - return client.listByResourceGroupHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *SSHPublicKeysClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *SSHPublicKeysClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *SSHPublicKeysClient) listByResourceGroupHandleResponse(resp *http.Response) (SSHPublicKeysClientListByResourceGroupResponse, error) { - result := SSHPublicKeysClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SSHPublicKeysGroupListResult); err != nil { - return SSHPublicKeysClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// NewListBySubscriptionPager - Lists all of the SSH public keys in the subscription. Use the nextLink property in the response -// to get the next page of SSH public keys. -// -// Generated from API version 2024-03-01 -// - options - SSHPublicKeysClientListBySubscriptionOptions contains the optional parameters for the SSHPublicKeysClient.NewListBySubscriptionPager -// method. -func (client *SSHPublicKeysClient) NewListBySubscriptionPager(options *SSHPublicKeysClientListBySubscriptionOptions) *runtime.Pager[SSHPublicKeysClientListBySubscriptionResponse] { - return runtime.NewPager(runtime.PagingHandler[SSHPublicKeysClientListBySubscriptionResponse]{ - More: func(page SSHPublicKeysClientListBySubscriptionResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *SSHPublicKeysClientListBySubscriptionResponse) (SSHPublicKeysClientListBySubscriptionResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SSHPublicKeysClient.NewListBySubscriptionPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listBySubscriptionCreateRequest(ctx, options) - }, nil) - if err != nil { - return SSHPublicKeysClientListBySubscriptionResponse{}, err - } - return client.listBySubscriptionHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *SSHPublicKeysClient) listBySubscriptionCreateRequest(ctx context.Context, options *SSHPublicKeysClientListBySubscriptionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/sshPublicKeys" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listBySubscriptionHandleResponse handles the ListBySubscription response. -func (client *SSHPublicKeysClient) listBySubscriptionHandleResponse(resp *http.Response) (SSHPublicKeysClientListBySubscriptionResponse, error) { - result := SSHPublicKeysClientListBySubscriptionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SSHPublicKeysGroupListResult); err != nil { - return SSHPublicKeysClientListBySubscriptionResponse{}, err - } - return result, nil -} - -// Update - Updates a new SSH public key resource. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - sshPublicKeyName - The name of the SSH public key. -// - parameters - Parameters supplied to update the SSH public key. -// - options - SSHPublicKeysClientUpdateOptions contains the optional parameters for the SSHPublicKeysClient.Update method. -func (client *SSHPublicKeysClient) Update(ctx context.Context, resourceGroupName string, sshPublicKeyName string, parameters SSHPublicKeyUpdateResource, options *SSHPublicKeysClientUpdateOptions) (SSHPublicKeysClientUpdateResponse, error) { - var err error - const operationName = "SSHPublicKeysClient.Update" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, sshPublicKeyName, parameters, options) - if err != nil { - return SSHPublicKeysClientUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return SSHPublicKeysClientUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return SSHPublicKeysClientUpdateResponse{}, err - } - resp, err := client.updateHandleResponse(httpResp) - return resp, err -} - -// updateCreateRequest creates the Update request. -func (client *SSHPublicKeysClient) updateCreateRequest(ctx context.Context, resourceGroupName string, sshPublicKeyName string, parameters SSHPublicKeyUpdateResource, options *SSHPublicKeysClientUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if sshPublicKeyName == "" { - return nil, errors.New("parameter sshPublicKeyName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{sshPublicKeyName}", url.PathEscape(sshPublicKeyName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// updateHandleResponse handles the Update response. -func (client *SSHPublicKeysClient) updateHandleResponse(resp *http.Response) (SSHPublicKeysClientUpdateResponse, error) { - result := SSHPublicKeysClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SSHPublicKeyResource); err != nil { - return SSHPublicKeysClientUpdateResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/time_rfc3339.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/time_rfc3339.go deleted file mode 100644 index ae4e62dd427..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/time_rfc3339.go +++ /dev/null @@ -1,110 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "regexp" - "strings" - "time" -) - -// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) - -const ( - utcDateTime = "2006-01-02T15:04:05.999999999" - utcDateTimeJSON = `"` + utcDateTime + `"` - utcDateTimeNoT = "2006-01-02 15:04:05.999999999" - utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` - dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` - dateTimeJSON = `"` + time.RFC3339Nano + `"` - dateTimeJSONNoT = `"` + dateTimeNoT + `"` -) - -type dateTimeRFC3339 time.Time - -func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalJSON() -} - -func (t dateTimeRFC3339) MarshalText() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalText() -} - -func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = dateTimeJSON - } else if tzOffset { - layout = dateTimeJSONNoT - } else if hasT { - layout = utcDateTimeJSON - } else { - layout = utcDateTimeJSONNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = time.RFC3339Nano - } else if tzOffset { - layout = dateTimeNoT - } else if hasT { - layout = utcDateTime - } else { - layout = utcDateTimeNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) Parse(layout, value string) error { - p, err := time.Parse(layout, strings.ToUpper(value)) - *t = dateTimeRFC3339(p) - return err -} - -func (t dateTimeRFC3339) String() string { - return time.Time(t).Format(time.RFC3339Nano) -} - -func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { - if t == nil { - return - } else if azcore.IsNullValue(t) { - m[k] = nil - return - } else if reflect.ValueOf(t).IsNil() { - return - } - m[k] = (*dateTimeRFC3339)(t) -} - -func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || string(data) == "null" { - return nil - } - var aux dateTimeRFC3339 - if err := json.Unmarshal(data, &aux); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - *t = (*time.Time)(&aux) - return nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/usage_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/usage_client.go deleted file mode 100644 index e251486e972..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/usage_client.go +++ /dev/null @@ -1,105 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// UsageClient contains the methods for the Usage group. -// Don't use this type directly, use NewUsageClient() instead. -type UsageClient struct { - internal *arm.Client - subscriptionID string -} - -// NewUsageClient creates a new instance of UsageClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewUsageClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UsageClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &UsageClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// NewListPager - Gets, for the specified location, the current compute resource usage information as well as the limits for -// compute resources under the subscription. -// -// Generated from API version 2024-03-01 -// - location - The location for which resource usage is queried. -// - options - UsageClientListOptions contains the optional parameters for the UsageClient.NewListPager method. -func (client *UsageClient) NewListPager(location string, options *UsageClientListOptions) *runtime.Pager[UsageClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[UsageClientListResponse]{ - More: func(page UsageClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *UsageClientListResponse) (UsageClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "UsageClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, location, options) - }, nil) - if err != nil { - return UsageClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *UsageClient) listCreateRequest(ctx context.Context, location string, options *UsageClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/usages" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *UsageClient) listHandleResponse(resp *http.Response) (UsageClientListResponse, error) { - result := UsageClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ListUsagesResult); err != nil { - return UsageClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineextensionimages_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineextensionimages_client.go deleted file mode 100644 index a337d245392..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineextensionimages_client.go +++ /dev/null @@ -1,259 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// VirtualMachineExtensionImagesClient contains the methods for the VirtualMachineExtensionImages group. -// Don't use this type directly, use NewVirtualMachineExtensionImagesClient() instead. -type VirtualMachineExtensionImagesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewVirtualMachineExtensionImagesClient creates a new instance of VirtualMachineExtensionImagesClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewVirtualMachineExtensionImagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineExtensionImagesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &VirtualMachineExtensionImagesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Get - Gets a virtual machine extension image. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - location - The name of a supported Azure region. -// - options - VirtualMachineExtensionImagesClientGetOptions contains the optional parameters for the VirtualMachineExtensionImagesClient.Get -// method. -func (client *VirtualMachineExtensionImagesClient) Get(ctx context.Context, location string, publisherName string, typeParam string, version string, options *VirtualMachineExtensionImagesClientGetOptions) (VirtualMachineExtensionImagesClientGetResponse, error) { - var err error - const operationName = "VirtualMachineExtensionImagesClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, location, publisherName, typeParam, version, options) - if err != nil { - return VirtualMachineExtensionImagesClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineExtensionImagesClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineExtensionImagesClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *VirtualMachineExtensionImagesClient) getCreateRequest(ctx context.Context, location string, publisherName string, typeParam string, version string, options *VirtualMachineExtensionImagesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if publisherName == "" { - return nil, errors.New("parameter publisherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) - if typeParam == "" { - return nil, errors.New("parameter typeParam cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{type}", url.PathEscape(typeParam)) - if version == "" { - return nil, errors.New("parameter version cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualMachineExtensionImagesClient) getHandleResponse(resp *http.Response) (VirtualMachineExtensionImagesClientGetResponse, error) { - result := VirtualMachineExtensionImagesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineExtensionImage); err != nil { - return VirtualMachineExtensionImagesClientGetResponse{}, err - } - return result, nil -} - -// ListTypes - Gets a list of virtual machine extension image types. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - location - The name of a supported Azure region. -// - options - VirtualMachineExtensionImagesClientListTypesOptions contains the optional parameters for the VirtualMachineExtensionImagesClient.ListTypes -// method. -func (client *VirtualMachineExtensionImagesClient) ListTypes(ctx context.Context, location string, publisherName string, options *VirtualMachineExtensionImagesClientListTypesOptions) (VirtualMachineExtensionImagesClientListTypesResponse, error) { - var err error - const operationName = "VirtualMachineExtensionImagesClient.ListTypes" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.listTypesCreateRequest(ctx, location, publisherName, options) - if err != nil { - return VirtualMachineExtensionImagesClientListTypesResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineExtensionImagesClientListTypesResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineExtensionImagesClientListTypesResponse{}, err - } - resp, err := client.listTypesHandleResponse(httpResp) - return resp, err -} - -// listTypesCreateRequest creates the ListTypes request. -func (client *VirtualMachineExtensionImagesClient) listTypesCreateRequest(ctx context.Context, location string, publisherName string, options *VirtualMachineExtensionImagesClientListTypesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if publisherName == "" { - return nil, errors.New("parameter publisherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listTypesHandleResponse handles the ListTypes response. -func (client *VirtualMachineExtensionImagesClient) listTypesHandleResponse(resp *http.Response) (VirtualMachineExtensionImagesClientListTypesResponse, error) { - result := VirtualMachineExtensionImagesClientListTypesResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineExtensionImageArray); err != nil { - return VirtualMachineExtensionImagesClientListTypesResponse{}, err - } - return result, nil -} - -// ListVersions - Gets a list of virtual machine extension image versions. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - location - The name of a supported Azure region. -// - options - VirtualMachineExtensionImagesClientListVersionsOptions contains the optional parameters for the VirtualMachineExtensionImagesClient.ListVersions -// method. -func (client *VirtualMachineExtensionImagesClient) ListVersions(ctx context.Context, location string, publisherName string, typeParam string, options *VirtualMachineExtensionImagesClientListVersionsOptions) (VirtualMachineExtensionImagesClientListVersionsResponse, error) { - var err error - const operationName = "VirtualMachineExtensionImagesClient.ListVersions" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.listVersionsCreateRequest(ctx, location, publisherName, typeParam, options) - if err != nil { - return VirtualMachineExtensionImagesClientListVersionsResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineExtensionImagesClientListVersionsResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineExtensionImagesClientListVersionsResponse{}, err - } - resp, err := client.listVersionsHandleResponse(httpResp) - return resp, err -} - -// listVersionsCreateRequest creates the ListVersions request. -func (client *VirtualMachineExtensionImagesClient) listVersionsCreateRequest(ctx context.Context, location string, publisherName string, typeParam string, options *VirtualMachineExtensionImagesClientListVersionsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if publisherName == "" { - return nil, errors.New("parameter publisherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) - if typeParam == "" { - return nil, errors.New("parameter typeParam cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{type}", url.PathEscape(typeParam)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Filter != nil { - reqQP.Set("$filter", *options.Filter) - } - if options != nil && options.Orderby != nil { - reqQP.Set("$orderby", *options.Orderby) - } - if options != nil && options.Top != nil { - reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listVersionsHandleResponse handles the ListVersions response. -func (client *VirtualMachineExtensionImagesClient) listVersionsHandleResponse(resp *http.Response) (VirtualMachineExtensionImagesClientListVersionsResponse, error) { - result := VirtualMachineExtensionImagesClientListVersionsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineExtensionImageArray); err != nil { - return VirtualMachineExtensionImagesClientListVersionsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineextensions_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineextensions_client.go deleted file mode 100644 index bd62e8137a1..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineextensions_client.go +++ /dev/null @@ -1,437 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VirtualMachineExtensionsClient contains the methods for the VirtualMachineExtensions group. -// Don't use this type directly, use NewVirtualMachineExtensionsClient() instead. -type VirtualMachineExtensionsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewVirtualMachineExtensionsClient creates a new instance of VirtualMachineExtensionsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewVirtualMachineExtensionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineExtensionsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &VirtualMachineExtensionsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - The operation to create or update the extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine where the extension should be created or updated. -// - vmExtensionName - The name of the virtual machine extension. -// - extensionParameters - Parameters supplied to the Create Virtual Machine Extension operation. -// - options - VirtualMachineExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineExtensionsClient.BeginCreateOrUpdate -// method. -func (client *VirtualMachineExtensionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, extensionParameters VirtualMachineExtension, options *VirtualMachineExtensionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualMachineExtensionsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, vmName, vmExtensionName, extensionParameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineExtensionsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineExtensionsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - The operation to create or update the extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineExtensionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, extensionParameters VirtualMachineExtension, options *VirtualMachineExtensionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineExtensionsClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vmName, vmExtensionName, extensionParameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualMachineExtensionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, extensionParameters VirtualMachineExtension, options *VirtualMachineExtensionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if vmExtensionName == "" { - return nil, errors.New("parameter vmExtensionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmExtensionName}", url.PathEscape(vmExtensionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, extensionParameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - The operation to delete the extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine where the extension should be deleted. -// - vmExtensionName - The name of the virtual machine extension. -// - options - VirtualMachineExtensionsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineExtensionsClient.BeginDelete -// method. -func (client *VirtualMachineExtensionsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, options *VirtualMachineExtensionsClientBeginDeleteOptions) (*runtime.Poller[VirtualMachineExtensionsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, vmName, vmExtensionName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineExtensionsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineExtensionsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - The operation to delete the extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineExtensionsClient) deleteOperation(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, options *VirtualMachineExtensionsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineExtensionsClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, vmName, vmExtensionName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VirtualMachineExtensionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, options *VirtualMachineExtensionsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if vmExtensionName == "" { - return nil, errors.New("parameter vmExtensionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmExtensionName}", url.PathEscape(vmExtensionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - The operation to get the extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine containing the extension. -// - vmExtensionName - The name of the virtual machine extension. -// - options - VirtualMachineExtensionsClientGetOptions contains the optional parameters for the VirtualMachineExtensionsClient.Get -// method. -func (client *VirtualMachineExtensionsClient) Get(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, options *VirtualMachineExtensionsClientGetOptions) (VirtualMachineExtensionsClientGetResponse, error) { - var err error - const operationName = "VirtualMachineExtensionsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, vmName, vmExtensionName, options) - if err != nil { - return VirtualMachineExtensionsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineExtensionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineExtensionsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *VirtualMachineExtensionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, options *VirtualMachineExtensionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if vmExtensionName == "" { - return nil, errors.New("parameter vmExtensionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmExtensionName}", url.PathEscape(vmExtensionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualMachineExtensionsClient) getHandleResponse(resp *http.Response) (VirtualMachineExtensionsClientGetResponse, error) { - result := VirtualMachineExtensionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineExtension); err != nil { - return VirtualMachineExtensionsClientGetResponse{}, err - } - return result, nil -} - -// List - The operation to get all extensions of a Virtual Machine. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine containing the extension. -// - options - VirtualMachineExtensionsClientListOptions contains the optional parameters for the VirtualMachineExtensionsClient.List -// method. -func (client *VirtualMachineExtensionsClient) List(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachineExtensionsClientListOptions) (VirtualMachineExtensionsClientListResponse, error) { - var err error - const operationName = "VirtualMachineExtensionsClient.List" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.listCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return VirtualMachineExtensionsClientListResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineExtensionsClientListResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineExtensionsClientListResponse{}, err - } - resp, err := client.listHandleResponse(httpResp) - return resp, err -} - -// listCreateRequest creates the List request. -func (client *VirtualMachineExtensionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachineExtensionsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualMachineExtensionsClient) listHandleResponse(resp *http.Response) (VirtualMachineExtensionsClientListResponse, error) { - result := VirtualMachineExtensionsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineExtensionsListResult); err != nil { - return VirtualMachineExtensionsClientListResponse{}, err - } - return result, nil -} - -// BeginUpdate - The operation to update the extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine where the extension should be updated. -// - vmExtensionName - The name of the virtual machine extension. -// - extensionParameters - Parameters supplied to the Update Virtual Machine Extension operation. -// - options - VirtualMachineExtensionsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineExtensionsClient.BeginUpdate -// method. -func (client *VirtualMachineExtensionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, extensionParameters VirtualMachineExtensionUpdate, options *VirtualMachineExtensionsClientBeginUpdateOptions) (*runtime.Poller[VirtualMachineExtensionsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, vmName, vmExtensionName, extensionParameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineExtensionsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineExtensionsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - The operation to update the extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineExtensionsClient) update(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, extensionParameters VirtualMachineExtensionUpdate, options *VirtualMachineExtensionsClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineExtensionsClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, vmName, vmExtensionName, extensionParameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *VirtualMachineExtensionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, extensionParameters VirtualMachineExtensionUpdate, options *VirtualMachineExtensionsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if vmExtensionName == "" { - return nil, errors.New("parameter vmExtensionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmExtensionName}", url.PathEscape(vmExtensionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, extensionParameters); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineimages_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineimages_client.go deleted file mode 100644 index d2557d0d454..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineimages_client.go +++ /dev/null @@ -1,470 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// VirtualMachineImagesClient contains the methods for the VirtualMachineImages group. -// Don't use this type directly, use NewVirtualMachineImagesClient() instead. -type VirtualMachineImagesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewVirtualMachineImagesClient creates a new instance of VirtualMachineImagesClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewVirtualMachineImagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineImagesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &VirtualMachineImagesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Get - Gets a virtual machine image. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - location - The name of a supported Azure region. -// - publisherName - A valid image publisher. -// - offer - A valid image publisher offer. -// - skus - A valid image SKU. -// - version - A valid image SKU version. -// - options - VirtualMachineImagesClientGetOptions contains the optional parameters for the VirtualMachineImagesClient.Get -// method. -func (client *VirtualMachineImagesClient) Get(ctx context.Context, location string, publisherName string, offer string, skus string, version string, options *VirtualMachineImagesClientGetOptions) (VirtualMachineImagesClientGetResponse, error) { - var err error - const operationName = "VirtualMachineImagesClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, location, publisherName, offer, skus, version, options) - if err != nil { - return VirtualMachineImagesClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineImagesClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineImagesClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *VirtualMachineImagesClient) getCreateRequest(ctx context.Context, location string, publisherName string, offer string, skus string, version string, options *VirtualMachineImagesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if publisherName == "" { - return nil, errors.New("parameter publisherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) - if offer == "" { - return nil, errors.New("parameter offer cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{offer}", url.PathEscape(offer)) - if skus == "" { - return nil, errors.New("parameter skus cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{skus}", url.PathEscape(skus)) - if version == "" { - return nil, errors.New("parameter version cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualMachineImagesClient) getHandleResponse(resp *http.Response) (VirtualMachineImagesClientGetResponse, error) { - result := VirtualMachineImagesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImage); err != nil { - return VirtualMachineImagesClientGetResponse{}, err - } - return result, nil -} - -// List - Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - location - The name of a supported Azure region. -// - publisherName - A valid image publisher. -// - offer - A valid image publisher offer. -// - skus - A valid image SKU. -// - options - VirtualMachineImagesClientListOptions contains the optional parameters for the VirtualMachineImagesClient.List -// method. -func (client *VirtualMachineImagesClient) List(ctx context.Context, location string, publisherName string, offer string, skus string, options *VirtualMachineImagesClientListOptions) (VirtualMachineImagesClientListResponse, error) { - var err error - const operationName = "VirtualMachineImagesClient.List" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.listCreateRequest(ctx, location, publisherName, offer, skus, options) - if err != nil { - return VirtualMachineImagesClientListResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineImagesClientListResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineImagesClientListResponse{}, err - } - resp, err := client.listHandleResponse(httpResp) - return resp, err -} - -// listCreateRequest creates the List request. -func (client *VirtualMachineImagesClient) listCreateRequest(ctx context.Context, location string, publisherName string, offer string, skus string, options *VirtualMachineImagesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if publisherName == "" { - return nil, errors.New("parameter publisherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) - if offer == "" { - return nil, errors.New("parameter offer cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{offer}", url.PathEscape(offer)) - if skus == "" { - return nil, errors.New("parameter skus cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{skus}", url.PathEscape(skus)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - if options != nil && options.Orderby != nil { - reqQP.Set("$orderby", *options.Orderby) - } - if options != nil && options.Top != nil { - reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualMachineImagesClient) listHandleResponse(resp *http.Response) (VirtualMachineImagesClientListResponse, error) { - result := VirtualMachineImagesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImageResourceArray); err != nil { - return VirtualMachineImagesClientListResponse{}, err - } - return result, nil -} - -// ListByEdgeZone - Gets a list of all virtual machine image versions for the specified edge zone -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - location - The name of a supported Azure region. -// - edgeZone - The name of the edge zone. -// - options - VirtualMachineImagesClientListByEdgeZoneOptions contains the optional parameters for the VirtualMachineImagesClient.ListByEdgeZone -// method. -func (client *VirtualMachineImagesClient) ListByEdgeZone(ctx context.Context, location string, edgeZone string, options *VirtualMachineImagesClientListByEdgeZoneOptions) (VirtualMachineImagesClientListByEdgeZoneResponse, error) { - var err error - const operationName = "VirtualMachineImagesClient.ListByEdgeZone" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.listByEdgeZoneCreateRequest(ctx, location, edgeZone, options) - if err != nil { - return VirtualMachineImagesClientListByEdgeZoneResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineImagesClientListByEdgeZoneResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineImagesClientListByEdgeZoneResponse{}, err - } - resp, err := client.listByEdgeZoneHandleResponse(httpResp) - return resp, err -} - -// listByEdgeZoneCreateRequest creates the ListByEdgeZone request. -func (client *VirtualMachineImagesClient) listByEdgeZoneCreateRequest(ctx context.Context, location string, edgeZone string, options *VirtualMachineImagesClientListByEdgeZoneOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/vmimages" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if edgeZone == "" { - return nil, errors.New("parameter edgeZone cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{edgeZone}", url.PathEscape(edgeZone)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByEdgeZoneHandleResponse handles the ListByEdgeZone response. -func (client *VirtualMachineImagesClient) listByEdgeZoneHandleResponse(resp *http.Response) (VirtualMachineImagesClientListByEdgeZoneResponse, error) { - result := VirtualMachineImagesClientListByEdgeZoneResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VMImagesInEdgeZoneListResult); err != nil { - return VirtualMachineImagesClientListByEdgeZoneResponse{}, err - } - return result, nil -} - -// ListOffers - Gets a list of virtual machine image offers for the specified location and publisher. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - location - The name of a supported Azure region. -// - publisherName - A valid image publisher. -// - options - VirtualMachineImagesClientListOffersOptions contains the optional parameters for the VirtualMachineImagesClient.ListOffers -// method. -func (client *VirtualMachineImagesClient) ListOffers(ctx context.Context, location string, publisherName string, options *VirtualMachineImagesClientListOffersOptions) (VirtualMachineImagesClientListOffersResponse, error) { - var err error - const operationName = "VirtualMachineImagesClient.ListOffers" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.listOffersCreateRequest(ctx, location, publisherName, options) - if err != nil { - return VirtualMachineImagesClientListOffersResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineImagesClientListOffersResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineImagesClientListOffersResponse{}, err - } - resp, err := client.listOffersHandleResponse(httpResp) - return resp, err -} - -// listOffersCreateRequest creates the ListOffers request. -func (client *VirtualMachineImagesClient) listOffersCreateRequest(ctx context.Context, location string, publisherName string, options *VirtualMachineImagesClientListOffersOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if publisherName == "" { - return nil, errors.New("parameter publisherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listOffersHandleResponse handles the ListOffers response. -func (client *VirtualMachineImagesClient) listOffersHandleResponse(resp *http.Response) (VirtualMachineImagesClientListOffersResponse, error) { - result := VirtualMachineImagesClientListOffersResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImageResourceArray); err != nil { - return VirtualMachineImagesClientListOffersResponse{}, err - } - return result, nil -} - -// ListPublishers - Gets a list of virtual machine image publishers for the specified Azure location. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - location - The name of a supported Azure region. -// - options - VirtualMachineImagesClientListPublishersOptions contains the optional parameters for the VirtualMachineImagesClient.ListPublishers -// method. -func (client *VirtualMachineImagesClient) ListPublishers(ctx context.Context, location string, options *VirtualMachineImagesClientListPublishersOptions) (VirtualMachineImagesClientListPublishersResponse, error) { - var err error - const operationName = "VirtualMachineImagesClient.ListPublishers" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.listPublishersCreateRequest(ctx, location, options) - if err != nil { - return VirtualMachineImagesClientListPublishersResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineImagesClientListPublishersResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineImagesClientListPublishersResponse{}, err - } - resp, err := client.listPublishersHandleResponse(httpResp) - return resp, err -} - -// listPublishersCreateRequest creates the ListPublishers request. -func (client *VirtualMachineImagesClient) listPublishersCreateRequest(ctx context.Context, location string, options *VirtualMachineImagesClientListPublishersOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listPublishersHandleResponse handles the ListPublishers response. -func (client *VirtualMachineImagesClient) listPublishersHandleResponse(resp *http.Response) (VirtualMachineImagesClientListPublishersResponse, error) { - result := VirtualMachineImagesClientListPublishersResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImageResourceArray); err != nil { - return VirtualMachineImagesClientListPublishersResponse{}, err - } - return result, nil -} - -// ListSKUs - Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - location - The name of a supported Azure region. -// - publisherName - A valid image publisher. -// - offer - A valid image publisher offer. -// - options - VirtualMachineImagesClientListSKUsOptions contains the optional parameters for the VirtualMachineImagesClient.ListSKUs -// method. -func (client *VirtualMachineImagesClient) ListSKUs(ctx context.Context, location string, publisherName string, offer string, options *VirtualMachineImagesClientListSKUsOptions) (VirtualMachineImagesClientListSKUsResponse, error) { - var err error - const operationName = "VirtualMachineImagesClient.ListSKUs" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.listSKUsCreateRequest(ctx, location, publisherName, offer, options) - if err != nil { - return VirtualMachineImagesClientListSKUsResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineImagesClientListSKUsResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineImagesClientListSKUsResponse{}, err - } - resp, err := client.listSKUsHandleResponse(httpResp) - return resp, err -} - -// listSKUsCreateRequest creates the ListSKUs request. -func (client *VirtualMachineImagesClient) listSKUsCreateRequest(ctx context.Context, location string, publisherName string, offer string, options *VirtualMachineImagesClientListSKUsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if publisherName == "" { - return nil, errors.New("parameter publisherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) - if offer == "" { - return nil, errors.New("parameter offer cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{offer}", url.PathEscape(offer)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listSKUsHandleResponse handles the ListSKUs response. -func (client *VirtualMachineImagesClient) listSKUsHandleResponse(resp *http.Response) (VirtualMachineImagesClientListSKUsResponse, error) { - result := VirtualMachineImagesClientListSKUsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImageResourceArray); err != nil { - return VirtualMachineImagesClientListSKUsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineimagesedgezone_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineimagesedgezone_client.go deleted file mode 100644 index 8558798f5e2..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineimagesedgezone_client.go +++ /dev/null @@ -1,430 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// VirtualMachineImagesEdgeZoneClient contains the methods for the VirtualMachineImagesEdgeZone group. -// Don't use this type directly, use NewVirtualMachineImagesEdgeZoneClient() instead. -type VirtualMachineImagesEdgeZoneClient struct { - internal *arm.Client - subscriptionID string -} - -// NewVirtualMachineImagesEdgeZoneClient creates a new instance of VirtualMachineImagesEdgeZoneClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewVirtualMachineImagesEdgeZoneClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineImagesEdgeZoneClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &VirtualMachineImagesEdgeZoneClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Get - Gets a virtual machine image in an edge zone. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - location - The name of a supported Azure region. -// - edgeZone - The name of the edge zone. -// - publisherName - A valid image publisher. -// - offer - A valid image publisher offer. -// - skus - A valid image SKU. -// - version - A valid image SKU version. -// - options - VirtualMachineImagesEdgeZoneClientGetOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.Get -// method. -func (client *VirtualMachineImagesEdgeZoneClient) Get(ctx context.Context, location string, edgeZone string, publisherName string, offer string, skus string, version string, options *VirtualMachineImagesEdgeZoneClientGetOptions) (VirtualMachineImagesEdgeZoneClientGetResponse, error) { - var err error - const operationName = "VirtualMachineImagesEdgeZoneClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, location, edgeZone, publisherName, offer, skus, version, options) - if err != nil { - return VirtualMachineImagesEdgeZoneClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineImagesEdgeZoneClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineImagesEdgeZoneClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *VirtualMachineImagesEdgeZoneClient) getCreateRequest(ctx context.Context, location string, edgeZone string, publisherName string, offer string, skus string, version string, options *VirtualMachineImagesEdgeZoneClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if edgeZone == "" { - return nil, errors.New("parameter edgeZone cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{edgeZone}", url.PathEscape(edgeZone)) - if publisherName == "" { - return nil, errors.New("parameter publisherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) - if offer == "" { - return nil, errors.New("parameter offer cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{offer}", url.PathEscape(offer)) - if skus == "" { - return nil, errors.New("parameter skus cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{skus}", url.PathEscape(skus)) - if version == "" { - return nil, errors.New("parameter version cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualMachineImagesEdgeZoneClient) getHandleResponse(resp *http.Response) (VirtualMachineImagesEdgeZoneClientGetResponse, error) { - result := VirtualMachineImagesEdgeZoneClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImage); err != nil { - return VirtualMachineImagesEdgeZoneClientGetResponse{}, err - } - return result, nil -} - -// List - Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - location - The name of a supported Azure region. -// - edgeZone - The name of the edge zone. -// - publisherName - A valid image publisher. -// - offer - A valid image publisher offer. -// - skus - A valid image SKU. -// - options - VirtualMachineImagesEdgeZoneClientListOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.List -// method. -func (client *VirtualMachineImagesEdgeZoneClient) List(ctx context.Context, location string, edgeZone string, publisherName string, offer string, skus string, options *VirtualMachineImagesEdgeZoneClientListOptions) (VirtualMachineImagesEdgeZoneClientListResponse, error) { - var err error - const operationName = "VirtualMachineImagesEdgeZoneClient.List" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.listCreateRequest(ctx, location, edgeZone, publisherName, offer, skus, options) - if err != nil { - return VirtualMachineImagesEdgeZoneClientListResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineImagesEdgeZoneClientListResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineImagesEdgeZoneClientListResponse{}, err - } - resp, err := client.listHandleResponse(httpResp) - return resp, err -} - -// listCreateRequest creates the List request. -func (client *VirtualMachineImagesEdgeZoneClient) listCreateRequest(ctx context.Context, location string, edgeZone string, publisherName string, offer string, skus string, options *VirtualMachineImagesEdgeZoneClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if edgeZone == "" { - return nil, errors.New("parameter edgeZone cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{edgeZone}", url.PathEscape(edgeZone)) - if publisherName == "" { - return nil, errors.New("parameter publisherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) - if offer == "" { - return nil, errors.New("parameter offer cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{offer}", url.PathEscape(offer)) - if skus == "" { - return nil, errors.New("parameter skus cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{skus}", url.PathEscape(skus)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - if options != nil && options.Orderby != nil { - reqQP.Set("$orderby", *options.Orderby) - } - if options != nil && options.Top != nil { - reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualMachineImagesEdgeZoneClient) listHandleResponse(resp *http.Response) (VirtualMachineImagesEdgeZoneClientListResponse, error) { - result := VirtualMachineImagesEdgeZoneClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImageResourceArray); err != nil { - return VirtualMachineImagesEdgeZoneClientListResponse{}, err - } - return result, nil -} - -// ListOffers - Gets a list of virtual machine image offers for the specified location, edge zone and publisher. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - location - The name of a supported Azure region. -// - edgeZone - The name of the edge zone. -// - publisherName - A valid image publisher. -// - options - VirtualMachineImagesEdgeZoneClientListOffersOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.ListOffers -// method. -func (client *VirtualMachineImagesEdgeZoneClient) ListOffers(ctx context.Context, location string, edgeZone string, publisherName string, options *VirtualMachineImagesEdgeZoneClientListOffersOptions) (VirtualMachineImagesEdgeZoneClientListOffersResponse, error) { - var err error - const operationName = "VirtualMachineImagesEdgeZoneClient.ListOffers" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.listOffersCreateRequest(ctx, location, edgeZone, publisherName, options) - if err != nil { - return VirtualMachineImagesEdgeZoneClientListOffersResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineImagesEdgeZoneClientListOffersResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineImagesEdgeZoneClientListOffersResponse{}, err - } - resp, err := client.listOffersHandleResponse(httpResp) - return resp, err -} - -// listOffersCreateRequest creates the ListOffers request. -func (client *VirtualMachineImagesEdgeZoneClient) listOffersCreateRequest(ctx context.Context, location string, edgeZone string, publisherName string, options *VirtualMachineImagesEdgeZoneClientListOffersOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if edgeZone == "" { - return nil, errors.New("parameter edgeZone cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{edgeZone}", url.PathEscape(edgeZone)) - if publisherName == "" { - return nil, errors.New("parameter publisherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listOffersHandleResponse handles the ListOffers response. -func (client *VirtualMachineImagesEdgeZoneClient) listOffersHandleResponse(resp *http.Response) (VirtualMachineImagesEdgeZoneClientListOffersResponse, error) { - result := VirtualMachineImagesEdgeZoneClientListOffersResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImageResourceArray); err != nil { - return VirtualMachineImagesEdgeZoneClientListOffersResponse{}, err - } - return result, nil -} - -// ListPublishers - Gets a list of virtual machine image publishers for the specified Azure location and edge zone. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - location - The name of a supported Azure region. -// - edgeZone - The name of the edge zone. -// - options - VirtualMachineImagesEdgeZoneClientListPublishersOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.ListPublishers -// method. -func (client *VirtualMachineImagesEdgeZoneClient) ListPublishers(ctx context.Context, location string, edgeZone string, options *VirtualMachineImagesEdgeZoneClientListPublishersOptions) (VirtualMachineImagesEdgeZoneClientListPublishersResponse, error) { - var err error - const operationName = "VirtualMachineImagesEdgeZoneClient.ListPublishers" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.listPublishersCreateRequest(ctx, location, edgeZone, options) - if err != nil { - return VirtualMachineImagesEdgeZoneClientListPublishersResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineImagesEdgeZoneClientListPublishersResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineImagesEdgeZoneClientListPublishersResponse{}, err - } - resp, err := client.listPublishersHandleResponse(httpResp) - return resp, err -} - -// listPublishersCreateRequest creates the ListPublishers request. -func (client *VirtualMachineImagesEdgeZoneClient) listPublishersCreateRequest(ctx context.Context, location string, edgeZone string, options *VirtualMachineImagesEdgeZoneClientListPublishersOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if edgeZone == "" { - return nil, errors.New("parameter edgeZone cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{edgeZone}", url.PathEscape(edgeZone)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listPublishersHandleResponse handles the ListPublishers response. -func (client *VirtualMachineImagesEdgeZoneClient) listPublishersHandleResponse(resp *http.Response) (VirtualMachineImagesEdgeZoneClientListPublishersResponse, error) { - result := VirtualMachineImagesEdgeZoneClientListPublishersResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImageResourceArray); err != nil { - return VirtualMachineImagesEdgeZoneClientListPublishersResponse{}, err - } - return result, nil -} - -// ListSKUs - Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - location - The name of a supported Azure region. -// - edgeZone - The name of the edge zone. -// - publisherName - A valid image publisher. -// - offer - A valid image publisher offer. -// - options - VirtualMachineImagesEdgeZoneClientListSKUsOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.ListSKUs -// method. -func (client *VirtualMachineImagesEdgeZoneClient) ListSKUs(ctx context.Context, location string, edgeZone string, publisherName string, offer string, options *VirtualMachineImagesEdgeZoneClientListSKUsOptions) (VirtualMachineImagesEdgeZoneClientListSKUsResponse, error) { - var err error - const operationName = "VirtualMachineImagesEdgeZoneClient.ListSKUs" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.listSKUsCreateRequest(ctx, location, edgeZone, publisherName, offer, options) - if err != nil { - return VirtualMachineImagesEdgeZoneClientListSKUsResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineImagesEdgeZoneClientListSKUsResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineImagesEdgeZoneClientListSKUsResponse{}, err - } - resp, err := client.listSKUsHandleResponse(httpResp) - return resp, err -} - -// listSKUsCreateRequest creates the ListSKUs request. -func (client *VirtualMachineImagesEdgeZoneClient) listSKUsCreateRequest(ctx context.Context, location string, edgeZone string, publisherName string, offer string, options *VirtualMachineImagesEdgeZoneClientListSKUsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if edgeZone == "" { - return nil, errors.New("parameter edgeZone cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{edgeZone}", url.PathEscape(edgeZone)) - if publisherName == "" { - return nil, errors.New("parameter publisherName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName)) - if offer == "" { - return nil, errors.New("parameter offer cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{offer}", url.PathEscape(offer)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listSKUsHandleResponse handles the ListSKUs response. -func (client *VirtualMachineImagesEdgeZoneClient) listSKUsHandleResponse(resp *http.Response) (VirtualMachineImagesEdgeZoneClientListSKUsResponse, error) { - result := VirtualMachineImagesEdgeZoneClientListSKUsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImageResourceArray); err != nil { - return VirtualMachineImagesEdgeZoneClientListSKUsResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineruncommands_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineruncommands_client.go deleted file mode 100644 index c5ef4894c22..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineruncommands_client.go +++ /dev/null @@ -1,562 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VirtualMachineRunCommandsClient contains the methods for the VirtualMachineRunCommands group. -// Don't use this type directly, use NewVirtualMachineRunCommandsClient() instead. -type VirtualMachineRunCommandsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewVirtualMachineRunCommandsClient creates a new instance of VirtualMachineRunCommandsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewVirtualMachineRunCommandsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineRunCommandsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &VirtualMachineRunCommandsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - The operation to create or update the run command. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine where the run command should be created or updated. -// - runCommandName - The name of the virtual machine run command. -// - runCommand - Parameters supplied to the Create Virtual Machine RunCommand operation. -// - options - VirtualMachineRunCommandsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineRunCommandsClient.BeginCreateOrUpdate -// method. -func (client *VirtualMachineRunCommandsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, runCommand VirtualMachineRunCommand, options *VirtualMachineRunCommandsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualMachineRunCommandsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, vmName, runCommandName, runCommand, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineRunCommandsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineRunCommandsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - The operation to create or update the run command. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineRunCommandsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, runCommand VirtualMachineRunCommand, options *VirtualMachineRunCommandsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineRunCommandsClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vmName, runCommandName, runCommand, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualMachineRunCommandsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, runCommand VirtualMachineRunCommand, options *VirtualMachineRunCommandsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if runCommandName == "" { - return nil, errors.New("parameter runCommandName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{runCommandName}", url.PathEscape(runCommandName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - if err := runtime.MarshalAsJSON(req, runCommand); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - The operation to delete the run command. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine where the run command should be deleted. -// - runCommandName - The name of the virtual machine run command. -// - options - VirtualMachineRunCommandsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineRunCommandsClient.BeginDelete -// method. -func (client *VirtualMachineRunCommandsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, options *VirtualMachineRunCommandsClientBeginDeleteOptions) (*runtime.Poller[VirtualMachineRunCommandsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, vmName, runCommandName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineRunCommandsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineRunCommandsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - The operation to delete the run command. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineRunCommandsClient) deleteOperation(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, options *VirtualMachineRunCommandsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineRunCommandsClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, vmName, runCommandName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VirtualMachineRunCommandsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, options *VirtualMachineRunCommandsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if runCommandName == "" { - return nil, errors.New("parameter runCommandName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{runCommandName}", url.PathEscape(runCommandName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - return req, nil -} - -// Get - Gets specific run command for a subscription in a location. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - location - The location upon which run commands is queried. -// - commandID - The command id. -// - options - VirtualMachineRunCommandsClientGetOptions contains the optional parameters for the VirtualMachineRunCommandsClient.Get -// method. -func (client *VirtualMachineRunCommandsClient) Get(ctx context.Context, location string, commandID string, options *VirtualMachineRunCommandsClientGetOptions) (VirtualMachineRunCommandsClientGetResponse, error) { - var err error - const operationName = "VirtualMachineRunCommandsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, location, commandID, options) - if err != nil { - return VirtualMachineRunCommandsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineRunCommandsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineRunCommandsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *VirtualMachineRunCommandsClient) getCreateRequest(ctx context.Context, location string, commandID string, options *VirtualMachineRunCommandsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands/{commandId}" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if commandID == "" { - return nil, errors.New("parameter commandID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{commandId}", url.PathEscape(commandID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualMachineRunCommandsClient) getHandleResponse(resp *http.Response) (VirtualMachineRunCommandsClientGetResponse, error) { - result := VirtualMachineRunCommandsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RunCommandDocument); err != nil { - return VirtualMachineRunCommandsClientGetResponse{}, err - } - return result, nil -} - -// GetByVirtualMachine - The operation to get the run command. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine containing the run command. -// - runCommandName - The name of the virtual machine run command. -// - options - VirtualMachineRunCommandsClientGetByVirtualMachineOptions contains the optional parameters for the VirtualMachineRunCommandsClient.GetByVirtualMachine -// method. -func (client *VirtualMachineRunCommandsClient) GetByVirtualMachine(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, options *VirtualMachineRunCommandsClientGetByVirtualMachineOptions) (VirtualMachineRunCommandsClientGetByVirtualMachineResponse, error) { - var err error - const operationName = "VirtualMachineRunCommandsClient.GetByVirtualMachine" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getByVirtualMachineCreateRequest(ctx, resourceGroupName, vmName, runCommandName, options) - if err != nil { - return VirtualMachineRunCommandsClientGetByVirtualMachineResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineRunCommandsClientGetByVirtualMachineResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineRunCommandsClientGetByVirtualMachineResponse{}, err - } - resp, err := client.getByVirtualMachineHandleResponse(httpResp) - return resp, err -} - -// getByVirtualMachineCreateRequest creates the GetByVirtualMachine request. -func (client *VirtualMachineRunCommandsClient) getByVirtualMachineCreateRequest(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, options *VirtualMachineRunCommandsClientGetByVirtualMachineOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if runCommandName == "" { - return nil, errors.New("parameter runCommandName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{runCommandName}", url.PathEscape(runCommandName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - return req, nil -} - -// getByVirtualMachineHandleResponse handles the GetByVirtualMachine response. -func (client *VirtualMachineRunCommandsClient) getByVirtualMachineHandleResponse(resp *http.Response) (VirtualMachineRunCommandsClientGetByVirtualMachineResponse, error) { - result := VirtualMachineRunCommandsClientGetByVirtualMachineResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineRunCommand); err != nil { - return VirtualMachineRunCommandsClientGetByVirtualMachineResponse{}, err - } - return result, nil -} - -// NewListPager - Lists all available run commands for a subscription in a location. -// -// Generated from API version 2024-03-01 -// - location - The location upon which run commands is queried. -// - options - VirtualMachineRunCommandsClientListOptions contains the optional parameters for the VirtualMachineRunCommandsClient.NewListPager -// method. -func (client *VirtualMachineRunCommandsClient) NewListPager(location string, options *VirtualMachineRunCommandsClientListOptions) *runtime.Pager[VirtualMachineRunCommandsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachineRunCommandsClientListResponse]{ - More: func(page VirtualMachineRunCommandsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualMachineRunCommandsClientListResponse) (VirtualMachineRunCommandsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachineRunCommandsClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, location, options) - }, nil) - if err != nil { - return VirtualMachineRunCommandsClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *VirtualMachineRunCommandsClient) listCreateRequest(ctx context.Context, location string, options *VirtualMachineRunCommandsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualMachineRunCommandsClient) listHandleResponse(resp *http.Response) (VirtualMachineRunCommandsClientListResponse, error) { - result := VirtualMachineRunCommandsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RunCommandListResult); err != nil { - return VirtualMachineRunCommandsClientListResponse{}, err - } - return result, nil -} - -// NewListByVirtualMachinePager - The operation to get all run commands of a Virtual Machine. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine containing the run command. -// - options - VirtualMachineRunCommandsClientListByVirtualMachineOptions contains the optional parameters for the VirtualMachineRunCommandsClient.NewListByVirtualMachinePager -// method. -func (client *VirtualMachineRunCommandsClient) NewListByVirtualMachinePager(resourceGroupName string, vmName string, options *VirtualMachineRunCommandsClientListByVirtualMachineOptions) *runtime.Pager[VirtualMachineRunCommandsClientListByVirtualMachineResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachineRunCommandsClientListByVirtualMachineResponse]{ - More: func(page VirtualMachineRunCommandsClientListByVirtualMachineResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualMachineRunCommandsClientListByVirtualMachineResponse) (VirtualMachineRunCommandsClientListByVirtualMachineResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachineRunCommandsClient.NewListByVirtualMachinePager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByVirtualMachineCreateRequest(ctx, resourceGroupName, vmName, options) - }, nil) - if err != nil { - return VirtualMachineRunCommandsClientListByVirtualMachineResponse{}, err - } - return client.listByVirtualMachineHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByVirtualMachineCreateRequest creates the ListByVirtualMachine request. -func (client *VirtualMachineRunCommandsClient) listByVirtualMachineCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachineRunCommandsClientListByVirtualMachineOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - return req, nil -} - -// listByVirtualMachineHandleResponse handles the ListByVirtualMachine response. -func (client *VirtualMachineRunCommandsClient) listByVirtualMachineHandleResponse(resp *http.Response) (VirtualMachineRunCommandsClientListByVirtualMachineResponse, error) { - result := VirtualMachineRunCommandsClientListByVirtualMachineResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineRunCommandsListResult); err != nil { - return VirtualMachineRunCommandsClientListByVirtualMachineResponse{}, err - } - return result, nil -} - -// BeginUpdate - The operation to update the run command. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine where the run command should be updated. -// - runCommandName - The name of the virtual machine run command. -// - runCommand - Parameters supplied to the Update Virtual Machine RunCommand operation. -// - options - VirtualMachineRunCommandsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineRunCommandsClient.BeginUpdate -// method. -func (client *VirtualMachineRunCommandsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, runCommand VirtualMachineRunCommandUpdate, options *VirtualMachineRunCommandsClientBeginUpdateOptions) (*runtime.Poller[VirtualMachineRunCommandsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, vmName, runCommandName, runCommand, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineRunCommandsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineRunCommandsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - The operation to update the run command. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineRunCommandsClient) update(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, runCommand VirtualMachineRunCommandUpdate, options *VirtualMachineRunCommandsClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineRunCommandsClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, vmName, runCommandName, runCommand, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *VirtualMachineRunCommandsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, runCommand VirtualMachineRunCommandUpdate, options *VirtualMachineRunCommandsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if runCommandName == "" { - return nil, errors.New("parameter runCommandName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{runCommandName}", url.PathEscape(runCommandName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - if err := runtime.MarshalAsJSON(req, runCommand); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachines_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachines_client.go deleted file mode 100644 index dd55aabc3e1..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachines_client.go +++ /dev/null @@ -1,1984 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// VirtualMachinesClient contains the methods for the VirtualMachines group. -// Don't use this type directly, use NewVirtualMachinesClient() instead. -type VirtualMachinesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewVirtualMachinesClient creates a new instance of VirtualMachinesClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewVirtualMachinesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachinesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &VirtualMachinesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginAssessPatches - Assess patches on the VM. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - options - VirtualMachinesClientBeginAssessPatchesOptions contains the optional parameters for the VirtualMachinesClient.BeginAssessPatches -// method. -func (client *VirtualMachinesClient) BeginAssessPatches(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginAssessPatchesOptions) (*runtime.Poller[VirtualMachinesClientAssessPatchesResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.assessPatches(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientAssessPatchesResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientAssessPatchesResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// AssessPatches - Assess patches on the VM. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachinesClient) assessPatches(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginAssessPatchesOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachinesClient.BeginAssessPatches" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.assessPatchesCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// assessPatchesCreateRequest creates the AssessPatches request. -func (client *VirtualMachinesClient) assessPatchesCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginAssessPatchesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/assessPatches" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginAttachDetachDataDisks - Attach and detach data disks to/from the virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - parameters - Parameters supplied to the attach and detach data disks operation on the virtual machine. -// - options - VirtualMachinesClientBeginAttachDetachDataDisksOptions contains the optional parameters for the VirtualMachinesClient.BeginAttachDetachDataDisks -// method. -func (client *VirtualMachinesClient) BeginAttachDetachDataDisks(ctx context.Context, resourceGroupName string, vmName string, parameters AttachDetachDataDisksRequest, options *VirtualMachinesClientBeginAttachDetachDataDisksOptions) (*runtime.Poller[VirtualMachinesClientAttachDetachDataDisksResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.attachDetachDataDisks(ctx, resourceGroupName, vmName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientAttachDetachDataDisksResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientAttachDetachDataDisksResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// AttachDetachDataDisks - Attach and detach data disks to/from the virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachinesClient) attachDetachDataDisks(ctx context.Context, resourceGroupName string, vmName string, parameters AttachDetachDataDisksRequest, options *VirtualMachinesClientBeginAttachDetachDataDisksOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachinesClient.BeginAttachDetachDataDisks" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.attachDetachDataDisksCreateRequest(ctx, resourceGroupName, vmName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// attachDetachDataDisksCreateRequest creates the AttachDetachDataDisks request. -func (client *VirtualMachinesClient) attachDetachDataDisksCreateRequest(ctx context.Context, resourceGroupName string, vmName string, parameters AttachDetachDataDisksRequest, options *VirtualMachinesClientBeginAttachDetachDataDisksOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/attachDetachDataDisks" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginCapture - Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create -// similar VMs. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - parameters - Parameters supplied to the Capture Virtual Machine operation. -// - options - VirtualMachinesClientBeginCaptureOptions contains the optional parameters for the VirtualMachinesClient.BeginCapture -// method. -func (client *VirtualMachinesClient) BeginCapture(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachineCaptureParameters, options *VirtualMachinesClientBeginCaptureOptions) (*runtime.Poller[VirtualMachinesClientCaptureResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.capture(ctx, resourceGroupName, vmName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientCaptureResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientCaptureResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Capture - Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar -// VMs. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachinesClient) capture(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachineCaptureParameters, options *VirtualMachinesClientBeginCaptureOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachinesClient.BeginCapture" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.captureCreateRequest(ctx, resourceGroupName, vmName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// captureCreateRequest creates the Capture request. -func (client *VirtualMachinesClient) captureCreateRequest(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachineCaptureParameters, options *VirtualMachinesClientBeginCaptureOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginConvertToManagedDisks - Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated -// before invoking this operation. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - options - VirtualMachinesClientBeginConvertToManagedDisksOptions contains the optional parameters for the VirtualMachinesClient.BeginConvertToManagedDisks -// method. -func (client *VirtualMachinesClient) BeginConvertToManagedDisks(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginConvertToManagedDisksOptions) (*runtime.Poller[VirtualMachinesClientConvertToManagedDisksResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.convertToManagedDisks(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientConvertToManagedDisksResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientConvertToManagedDisksResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// ConvertToManagedDisks - Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated -// before invoking this operation. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachinesClient) convertToManagedDisks(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginConvertToManagedDisksOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachinesClient.BeginConvertToManagedDisks" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.convertToManagedDisksCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// convertToManagedDisksCreateRequest creates the ConvertToManagedDisks request. -func (client *VirtualMachinesClient) convertToManagedDisksCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginConvertToManagedDisksOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/convertToManagedDisks" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginCreateOrUpdate - The operation to create or update a virtual machine. Please note some properties can be set only -// during virtual machine creation. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - parameters - Parameters supplied to the Create Virtual Machine operation. -// - options - VirtualMachinesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachinesClient.BeginCreateOrUpdate -// method. -func (client *VirtualMachinesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachine, options *VirtualMachinesClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualMachinesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, vmName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - The operation to create or update a virtual machine. Please note some properties can be set only during -// virtual machine creation. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachinesClient) createOrUpdate(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachine, options *VirtualMachinesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachinesClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vmName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualMachinesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachine, options *VirtualMachinesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.IfMatch != nil { - req.Raw().Header["If-Match"] = []string{*options.IfMatch} - } - if options != nil && options.IfNoneMatch != nil { - req.Raw().Header["If-None-Match"] = []string{*options.IfNoneMatch} - } - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginDeallocate - Shuts down the virtual machine and releases the compute resources. You are not billed for the compute -// resources that this virtual machine uses. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - options - VirtualMachinesClientBeginDeallocateOptions contains the optional parameters for the VirtualMachinesClient.BeginDeallocate -// method. -func (client *VirtualMachinesClient) BeginDeallocate(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginDeallocateOptions) (*runtime.Poller[VirtualMachinesClientDeallocateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deallocate(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientDeallocateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientDeallocateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Deallocate - Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources -// that this virtual machine uses. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachinesClient) deallocate(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginDeallocateOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachinesClient.BeginDeallocate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deallocateCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deallocateCreateRequest creates the Deallocate request. -func (client *VirtualMachinesClient) deallocateCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginDeallocateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/deallocate" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - if options != nil && options.Hibernate != nil { - reqQP.Set("hibernate", strconv.FormatBool(*options.Hibernate)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginDelete - The operation to delete a virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - options - VirtualMachinesClientBeginDeleteOptions contains the optional parameters for the VirtualMachinesClient.BeginDelete -// method. -func (client *VirtualMachinesClient) BeginDelete(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginDeleteOptions) (*runtime.Poller[VirtualMachinesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - The operation to delete a virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachinesClient) deleteOperation(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachinesClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VirtualMachinesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - if options != nil && options.ForceDeletion != nil { - reqQP.Set("forceDeletion", strconv.FormatBool(*options.ForceDeletion)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Generalize - Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine -// before performing this operation. For Windows, please refer to Create a managed image of a -// generalized VM in Azure [https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource]. For Linux, -// please refer to How to create an image of a virtual machine or VHD -// [https://docs.microsoft.com/azure/virtual-machines/linux/capture-image]. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - options - VirtualMachinesClientGeneralizeOptions contains the optional parameters for the VirtualMachinesClient.Generalize -// method. -func (client *VirtualMachinesClient) Generalize(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientGeneralizeOptions) (VirtualMachinesClientGeneralizeResponse, error) { - var err error - const operationName = "VirtualMachinesClient.Generalize" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.generalizeCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return VirtualMachinesClientGeneralizeResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachinesClientGeneralizeResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachinesClientGeneralizeResponse{}, err - } - return VirtualMachinesClientGeneralizeResponse{}, nil -} - -// generalizeCreateRequest creates the Generalize request. -func (client *VirtualMachinesClient) generalizeCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientGeneralizeOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/generalize" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves information about the model view or the instance view of a virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - options - VirtualMachinesClientGetOptions contains the optional parameters for the VirtualMachinesClient.Get method. -func (client *VirtualMachinesClient) Get(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientGetOptions) (VirtualMachinesClientGetResponse, error) { - var err error - const operationName = "VirtualMachinesClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return VirtualMachinesClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachinesClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachinesClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *VirtualMachinesClient) getCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualMachinesClient) getHandleResponse(resp *http.Response) (VirtualMachinesClientGetResponse, error) { - result := VirtualMachinesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachine); err != nil { - return VirtualMachinesClientGetResponse{}, err - } - return result, nil -} - -// BeginInstallPatches - Installs patches on the VM. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - installPatchesInput - Input for InstallPatches as directly received by the API -// - options - VirtualMachinesClientBeginInstallPatchesOptions contains the optional parameters for the VirtualMachinesClient.BeginInstallPatches -// method. -func (client *VirtualMachinesClient) BeginInstallPatches(ctx context.Context, resourceGroupName string, vmName string, installPatchesInput VirtualMachineInstallPatchesParameters, options *VirtualMachinesClientBeginInstallPatchesOptions) (*runtime.Poller[VirtualMachinesClientInstallPatchesResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.installPatches(ctx, resourceGroupName, vmName, installPatchesInput, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientInstallPatchesResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientInstallPatchesResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// InstallPatches - Installs patches on the VM. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachinesClient) installPatches(ctx context.Context, resourceGroupName string, vmName string, installPatchesInput VirtualMachineInstallPatchesParameters, options *VirtualMachinesClientBeginInstallPatchesOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachinesClient.BeginInstallPatches" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.installPatchesCreateRequest(ctx, resourceGroupName, vmName, installPatchesInput, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// installPatchesCreateRequest creates the InstallPatches request. -func (client *VirtualMachinesClient) installPatchesCreateRequest(ctx context.Context, resourceGroupName string, vmName string, installPatchesInput VirtualMachineInstallPatchesParameters, options *VirtualMachinesClientBeginInstallPatchesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/installPatches" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, installPatchesInput); err != nil { - return nil, err - } - return req, nil -} - -// InstanceView - Retrieves information about the run-time state of a virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - options - VirtualMachinesClientInstanceViewOptions contains the optional parameters for the VirtualMachinesClient.InstanceView -// method. -func (client *VirtualMachinesClient) InstanceView(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientInstanceViewOptions) (VirtualMachinesClientInstanceViewResponse, error) { - var err error - const operationName = "VirtualMachinesClient.InstanceView" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.instanceViewCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return VirtualMachinesClientInstanceViewResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachinesClientInstanceViewResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachinesClientInstanceViewResponse{}, err - } - resp, err := client.instanceViewHandleResponse(httpResp) - return resp, err -} - -// instanceViewCreateRequest creates the InstanceView request. -func (client *VirtualMachinesClient) instanceViewCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientInstanceViewOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/instanceView" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// instanceViewHandleResponse handles the InstanceView response. -func (client *VirtualMachinesClient) instanceViewHandleResponse(resp *http.Response) (VirtualMachinesClientInstanceViewResponse, error) { - result := VirtualMachinesClientInstanceViewResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineInstanceView); err != nil { - return VirtualMachinesClientInstanceViewResponse{}, err - } - return result, nil -} - -// NewListPager - Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response -// to get the next page of virtual machines. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - options - VirtualMachinesClientListOptions contains the optional parameters for the VirtualMachinesClient.NewListPager -// method. -func (client *VirtualMachinesClient) NewListPager(resourceGroupName string, options *VirtualMachinesClientListOptions) *runtime.Pager[VirtualMachinesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachinesClientListResponse]{ - More: func(page VirtualMachinesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualMachinesClientListResponse) (VirtualMachinesClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachinesClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, options) - }, nil) - if err != nil { - return VirtualMachinesClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *VirtualMachinesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualMachinesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - if options != nil && options.Filter != nil { - reqQP.Set("$filter", *options.Filter) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualMachinesClient) listHandleResponse(resp *http.Response) (VirtualMachinesClientListResponse, error) { - result := VirtualMachinesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineListResult); err != nil { - return VirtualMachinesClientListResponse{}, err - } - return result, nil -} - -// NewListAllPager - Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response -// to get the next page of virtual machines. -// -// Generated from API version 2024-03-01 -// - options - VirtualMachinesClientListAllOptions contains the optional parameters for the VirtualMachinesClient.NewListAllPager -// method. -func (client *VirtualMachinesClient) NewListAllPager(options *VirtualMachinesClientListAllOptions) *runtime.Pager[VirtualMachinesClientListAllResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachinesClientListAllResponse]{ - More: func(page VirtualMachinesClientListAllResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualMachinesClientListAllResponse) (VirtualMachinesClientListAllResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachinesClient.NewListAllPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listAllCreateRequest(ctx, options) - }, nil) - if err != nil { - return VirtualMachinesClientListAllResponse{}, err - } - return client.listAllHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listAllCreateRequest creates the ListAll request. -func (client *VirtualMachinesClient) listAllCreateRequest(ctx context.Context, options *VirtualMachinesClientListAllOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - if options != nil && options.Filter != nil { - reqQP.Set("$filter", *options.Filter) - } - reqQP.Set("api-version", "2024-03-01") - if options != nil && options.StatusOnly != nil { - reqQP.Set("statusOnly", *options.StatusOnly) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAllHandleResponse handles the ListAll response. -func (client *VirtualMachinesClient) listAllHandleResponse(resp *http.Response) (VirtualMachinesClientListAllResponse, error) { - result := VirtualMachinesClientListAllResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineListResult); err != nil { - return VirtualMachinesClientListAllResponse{}, err - } - return result, nil -} - -// NewListAvailableSizesPager - Lists all available virtual machine sizes to which the specified virtual machine can be resized. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - options - VirtualMachinesClientListAvailableSizesOptions contains the optional parameters for the VirtualMachinesClient.NewListAvailableSizesPager -// method. -func (client *VirtualMachinesClient) NewListAvailableSizesPager(resourceGroupName string, vmName string, options *VirtualMachinesClientListAvailableSizesOptions) *runtime.Pager[VirtualMachinesClientListAvailableSizesResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachinesClientListAvailableSizesResponse]{ - More: func(page VirtualMachinesClientListAvailableSizesResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *VirtualMachinesClientListAvailableSizesResponse) (VirtualMachinesClientListAvailableSizesResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachinesClient.NewListAvailableSizesPager") - req, err := client.listAvailableSizesCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return VirtualMachinesClientListAvailableSizesResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachinesClientListAvailableSizesResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachinesClientListAvailableSizesResponse{}, runtime.NewResponseError(resp) - } - return client.listAvailableSizesHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listAvailableSizesCreateRequest creates the ListAvailableSizes request. -func (client *VirtualMachinesClient) listAvailableSizesCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientListAvailableSizesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/vmSizes" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAvailableSizesHandleResponse handles the ListAvailableSizes response. -func (client *VirtualMachinesClient) listAvailableSizesHandleResponse(resp *http.Response) (VirtualMachinesClientListAvailableSizesResponse, error) { - result := VirtualMachinesClientListAvailableSizesResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineSizeListResult); err != nil { - return VirtualMachinesClientListAvailableSizesResponse{}, err - } - return result, nil -} - -// NewListByLocationPager - Gets all the virtual machines under the specified subscription for the specified location. -// -// Generated from API version 2024-03-01 -// - location - The location for which virtual machines under the subscription are queried. -// - options - VirtualMachinesClientListByLocationOptions contains the optional parameters for the VirtualMachinesClient.NewListByLocationPager -// method. -func (client *VirtualMachinesClient) NewListByLocationPager(location string, options *VirtualMachinesClientListByLocationOptions) *runtime.Pager[VirtualMachinesClientListByLocationResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachinesClientListByLocationResponse]{ - More: func(page VirtualMachinesClientListByLocationResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualMachinesClientListByLocationResponse) (VirtualMachinesClientListByLocationResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachinesClient.NewListByLocationPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByLocationCreateRequest(ctx, location, options) - }, nil) - if err != nil { - return VirtualMachinesClientListByLocationResponse{}, err - } - return client.listByLocationHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByLocationCreateRequest creates the ListByLocation request. -func (client *VirtualMachinesClient) listByLocationCreateRequest(ctx context.Context, location string, options *VirtualMachinesClientListByLocationOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/virtualMachines" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByLocationHandleResponse handles the ListByLocation response. -func (client *VirtualMachinesClient) listByLocationHandleResponse(resp *http.Response) (VirtualMachinesClientListByLocationResponse, error) { - result := VirtualMachinesClientListByLocationResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineListResult); err != nil { - return VirtualMachinesClientListByLocationResponse{}, err - } - return result, nil -} - -// BeginPerformMaintenance - The operation to perform maintenance on a virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - options - VirtualMachinesClientBeginPerformMaintenanceOptions contains the optional parameters for the VirtualMachinesClient.BeginPerformMaintenance -// method. -func (client *VirtualMachinesClient) BeginPerformMaintenance(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginPerformMaintenanceOptions) (*runtime.Poller[VirtualMachinesClientPerformMaintenanceResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.performMaintenance(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientPerformMaintenanceResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientPerformMaintenanceResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// PerformMaintenance - The operation to perform maintenance on a virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachinesClient) performMaintenance(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginPerformMaintenanceOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachinesClient.BeginPerformMaintenance" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.performMaintenanceCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// performMaintenanceCreateRequest creates the PerformMaintenance request. -func (client *VirtualMachinesClient) performMaintenanceCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginPerformMaintenanceOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/performMaintenance" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginPowerOff - The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same -// provisioned resources. You are still charged for this virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - options - VirtualMachinesClientBeginPowerOffOptions contains the optional parameters for the VirtualMachinesClient.BeginPowerOff -// method. -func (client *VirtualMachinesClient) BeginPowerOff(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginPowerOffOptions) (*runtime.Poller[VirtualMachinesClientPowerOffResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.powerOff(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientPowerOffResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientPowerOffResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// PowerOff - The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned -// resources. You are still charged for this virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachinesClient) powerOff(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginPowerOffOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachinesClient.BeginPowerOff" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.powerOffCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// powerOffCreateRequest creates the PowerOff request. -func (client *VirtualMachinesClient) powerOffCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginPowerOffOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - if options != nil && options.SkipShutdown != nil { - reqQP.Set("skipShutdown", strconv.FormatBool(*options.SkipShutdown)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginReapply - The operation to reapply a virtual machine's state. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - options - VirtualMachinesClientBeginReapplyOptions contains the optional parameters for the VirtualMachinesClient.BeginReapply -// method. -func (client *VirtualMachinesClient) BeginReapply(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginReapplyOptions) (*runtime.Poller[VirtualMachinesClientReapplyResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.reapply(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientReapplyResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientReapplyResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Reapply - The operation to reapply a virtual machine's state. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachinesClient) reapply(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginReapplyOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachinesClient.BeginReapply" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.reapplyCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// reapplyCreateRequest creates the Reapply request. -func (client *VirtualMachinesClient) reapplyCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginReapplyOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/reapply" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginRedeploy - Shuts down the virtual machine, moves it to a new node, and powers it back on. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - options - VirtualMachinesClientBeginRedeployOptions contains the optional parameters for the VirtualMachinesClient.BeginRedeploy -// method. -func (client *VirtualMachinesClient) BeginRedeploy(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginRedeployOptions) (*runtime.Poller[VirtualMachinesClientRedeployResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.redeploy(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientRedeployResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientRedeployResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Redeploy - Shuts down the virtual machine, moves it to a new node, and powers it back on. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachinesClient) redeploy(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginRedeployOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachinesClient.BeginRedeploy" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.redeployCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// redeployCreateRequest creates the Redeploy request. -func (client *VirtualMachinesClient) redeployCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginRedeployOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/redeploy" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginReimage - Reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for virtual -// machines who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE: -// The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk -// will be preserved after reimage. If deleteOption is delete, the old OS disk -// will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - options - VirtualMachinesClientBeginReimageOptions contains the optional parameters for the VirtualMachinesClient.BeginReimage -// method. -func (client *VirtualMachinesClient) BeginReimage(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginReimageOptions) (*runtime.Poller[VirtualMachinesClientReimageResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.reimage(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientReimageResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientReimageResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Reimage - Reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for virtual machines -// who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE: -// The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk -// will be preserved after reimage. If deleteOption is delete, the old OS disk -// will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachinesClient) reimage(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginReimageOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachinesClient.BeginReimage" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.reimageCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// reimageCreateRequest creates the Reimage request. -func (client *VirtualMachinesClient) reimageCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginReimageOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/reimage" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.Parameters != nil { - if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil { - return nil, err - } - return req, nil - } - return req, nil -} - -// BeginRestart - The operation to restart a virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - options - VirtualMachinesClientBeginRestartOptions contains the optional parameters for the VirtualMachinesClient.BeginRestart -// method. -func (client *VirtualMachinesClient) BeginRestart(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginRestartOptions) (*runtime.Poller[VirtualMachinesClientRestartResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.restart(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientRestartResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientRestartResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Restart - The operation to restart a virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachinesClient) restart(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginRestartOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachinesClient.BeginRestart" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.restartCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// restartCreateRequest creates the Restart request. -func (client *VirtualMachinesClient) restartCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginRestartOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/restart" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// RetrieveBootDiagnosticsData - The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - options - VirtualMachinesClientRetrieveBootDiagnosticsDataOptions contains the optional parameters for the VirtualMachinesClient.RetrieveBootDiagnosticsData -// method. -func (client *VirtualMachinesClient) RetrieveBootDiagnosticsData(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientRetrieveBootDiagnosticsDataOptions) (VirtualMachinesClientRetrieveBootDiagnosticsDataResponse, error) { - var err error - const operationName = "VirtualMachinesClient.RetrieveBootDiagnosticsData" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.retrieveBootDiagnosticsDataCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return VirtualMachinesClientRetrieveBootDiagnosticsDataResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachinesClientRetrieveBootDiagnosticsDataResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachinesClientRetrieveBootDiagnosticsDataResponse{}, err - } - resp, err := client.retrieveBootDiagnosticsDataHandleResponse(httpResp) - return resp, err -} - -// retrieveBootDiagnosticsDataCreateRequest creates the RetrieveBootDiagnosticsData request. -func (client *VirtualMachinesClient) retrieveBootDiagnosticsDataCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientRetrieveBootDiagnosticsDataOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/retrieveBootDiagnosticsData" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - if options != nil && options.SasURIExpirationTimeInMinutes != nil { - reqQP.Set("sasUriExpirationTimeInMinutes", strconv.FormatInt(int64(*options.SasURIExpirationTimeInMinutes), 10)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// retrieveBootDiagnosticsDataHandleResponse handles the RetrieveBootDiagnosticsData response. -func (client *VirtualMachinesClient) retrieveBootDiagnosticsDataHandleResponse(resp *http.Response) (VirtualMachinesClientRetrieveBootDiagnosticsDataResponse, error) { - result := VirtualMachinesClientRetrieveBootDiagnosticsDataResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RetrieveBootDiagnosticsDataResult); err != nil { - return VirtualMachinesClientRetrieveBootDiagnosticsDataResponse{}, err - } - return result, nil -} - -// BeginRunCommand - Run command on the VM. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - parameters - Parameters supplied to the Run command operation. -// - options - VirtualMachinesClientBeginRunCommandOptions contains the optional parameters for the VirtualMachinesClient.BeginRunCommand -// method. -func (client *VirtualMachinesClient) BeginRunCommand(ctx context.Context, resourceGroupName string, vmName string, parameters RunCommandInput, options *VirtualMachinesClientBeginRunCommandOptions) (*runtime.Poller[VirtualMachinesClientRunCommandResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.runCommand(ctx, resourceGroupName, vmName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientRunCommandResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientRunCommandResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// RunCommand - Run command on the VM. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachinesClient) runCommand(ctx context.Context, resourceGroupName string, vmName string, parameters RunCommandInput, options *VirtualMachinesClientBeginRunCommandOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachinesClient.BeginRunCommand" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.runCommandCreateRequest(ctx, resourceGroupName, vmName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// runCommandCreateRequest creates the RunCommand request. -func (client *VirtualMachinesClient) runCommandCreateRequest(ctx context.Context, resourceGroupName string, vmName string, parameters RunCommandInput, options *VirtualMachinesClientBeginRunCommandOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommand" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// SimulateEviction - The operation to simulate the eviction of spot virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - options - VirtualMachinesClientSimulateEvictionOptions contains the optional parameters for the VirtualMachinesClient.SimulateEviction -// method. -func (client *VirtualMachinesClient) SimulateEviction(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientSimulateEvictionOptions) (VirtualMachinesClientSimulateEvictionResponse, error) { - var err error - const operationName = "VirtualMachinesClient.SimulateEviction" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.simulateEvictionCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return VirtualMachinesClientSimulateEvictionResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachinesClientSimulateEvictionResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return VirtualMachinesClientSimulateEvictionResponse{}, err - } - return VirtualMachinesClientSimulateEvictionResponse{}, nil -} - -// simulateEvictionCreateRequest creates the SimulateEviction request. -func (client *VirtualMachinesClient) simulateEvictionCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientSimulateEvictionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/simulateEviction" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginStart - The operation to start a virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - options - VirtualMachinesClientBeginStartOptions contains the optional parameters for the VirtualMachinesClient.BeginStart -// method. -func (client *VirtualMachinesClient) BeginStart(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginStartOptions) (*runtime.Poller[VirtualMachinesClientStartResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.start(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientStartResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientStartResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Start - The operation to start a virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachinesClient) start(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginStartOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachinesClient.BeginStart" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.startCreateRequest(ctx, resourceGroupName, vmName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// startCreateRequest creates the Start request. -func (client *VirtualMachinesClient) startCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginStartOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/start" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginUpdate - The operation to update a virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmName - The name of the virtual machine. -// - parameters - Parameters supplied to the Update Virtual Machine operation. -// - options - VirtualMachinesClientBeginUpdateOptions contains the optional parameters for the VirtualMachinesClient.BeginUpdate -// method. -func (client *VirtualMachinesClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachineUpdate, options *VirtualMachinesClientBeginUpdateOptions) (*runtime.Poller[VirtualMachinesClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, vmName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - The operation to update a virtual machine. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachinesClient) update(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachineUpdate, options *VirtualMachinesClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachinesClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, vmName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *VirtualMachinesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachineUpdate, options *VirtualMachinesClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmName == "" { - return nil, errors.New("parameter vmName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.IfMatch != nil { - req.Raw().Header["If-Match"] = []string{*options.IfMatch} - } - if options != nil && options.IfNoneMatch != nil { - req.Raw().Header["If-None-Match"] = []string{*options.IfNoneMatch} - } - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetextensions_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetextensions_client.go deleted file mode 100644 index 81ddfad6a6a..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetextensions_client.go +++ /dev/null @@ -1,434 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VirtualMachineScaleSetExtensionsClient contains the methods for the VirtualMachineScaleSetExtensions group. -// Don't use this type directly, use NewVirtualMachineScaleSetExtensionsClient() instead. -type VirtualMachineScaleSetExtensionsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewVirtualMachineScaleSetExtensionsClient creates a new instance of VirtualMachineScaleSetExtensionsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewVirtualMachineScaleSetExtensionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineScaleSetExtensionsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &VirtualMachineScaleSetExtensionsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - The operation to create or update an extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set where the extension should be create or updated. -// - vmssExtensionName - The name of the VM scale set extension. -// - extensionParameters - Parameters supplied to the Create VM scale set Extension operation. -// - options - VirtualMachineScaleSetExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.BeginCreateOrUpdate -// method. -func (client *VirtualMachineScaleSetExtensionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtension, options *VirtualMachineScaleSetExtensionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - The operation to create or update an extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetExtensionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtension, options *VirtualMachineScaleSetExtensionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetExtensionsClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualMachineScaleSetExtensionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtension, options *VirtualMachineScaleSetExtensionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if vmssExtensionName == "" { - return nil, errors.New("parameter vmssExtensionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmssExtensionName}", url.PathEscape(vmssExtensionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, extensionParameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - The operation to delete the extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set where the extension should be deleted. -// - vmssExtensionName - The name of the VM scale set extension. -// - options - VirtualMachineScaleSetExtensionsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.BeginDelete -// method. -func (client *VirtualMachineScaleSetExtensionsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, options *VirtualMachineScaleSetExtensionsClientBeginDeleteOptions) (*runtime.Poller[VirtualMachineScaleSetExtensionsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, vmScaleSetName, vmssExtensionName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetExtensionsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetExtensionsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - The operation to delete the extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetExtensionsClient) deleteOperation(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, options *VirtualMachineScaleSetExtensionsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetExtensionsClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, vmScaleSetName, vmssExtensionName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VirtualMachineScaleSetExtensionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, options *VirtualMachineScaleSetExtensionsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if vmssExtensionName == "" { - return nil, errors.New("parameter vmssExtensionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmssExtensionName}", url.PathEscape(vmssExtensionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - The operation to get the extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set containing the extension. -// - vmssExtensionName - The name of the VM scale set extension. -// - options - VirtualMachineScaleSetExtensionsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.Get -// method. -func (client *VirtualMachineScaleSetExtensionsClient) Get(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, options *VirtualMachineScaleSetExtensionsClientGetOptions) (VirtualMachineScaleSetExtensionsClientGetResponse, error) { - var err error - const operationName = "VirtualMachineScaleSetExtensionsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, vmScaleSetName, vmssExtensionName, options) - if err != nil { - return VirtualMachineScaleSetExtensionsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineScaleSetExtensionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineScaleSetExtensionsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *VirtualMachineScaleSetExtensionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, options *VirtualMachineScaleSetExtensionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if vmssExtensionName == "" { - return nil, errors.New("parameter vmssExtensionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmssExtensionName}", url.PathEscape(vmssExtensionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualMachineScaleSetExtensionsClient) getHandleResponse(resp *http.Response) (VirtualMachineScaleSetExtensionsClientGetResponse, error) { - result := VirtualMachineScaleSetExtensionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetExtension); err != nil { - return VirtualMachineScaleSetExtensionsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets a list of all extensions in a VM scale set. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set containing the extension. -// - options - VirtualMachineScaleSetExtensionsClientListOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.NewListPager -// method. -func (client *VirtualMachineScaleSetExtensionsClient) NewListPager(resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetExtensionsClientListOptions) *runtime.Pager[VirtualMachineScaleSetExtensionsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachineScaleSetExtensionsClientListResponse]{ - More: func(page VirtualMachineScaleSetExtensionsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualMachineScaleSetExtensionsClientListResponse) (VirtualMachineScaleSetExtensionsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachineScaleSetExtensionsClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - }, nil) - if err != nil { - return VirtualMachineScaleSetExtensionsClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *VirtualMachineScaleSetExtensionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetExtensionsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualMachineScaleSetExtensionsClient) listHandleResponse(resp *http.Response) (VirtualMachineScaleSetExtensionsClientListResponse, error) { - result := VirtualMachineScaleSetExtensionsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetExtensionListResult); err != nil { - return VirtualMachineScaleSetExtensionsClientListResponse{}, err - } - return result, nil -} - -// BeginUpdate - The operation to update an extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set where the extension should be updated. -// - vmssExtensionName - The name of the VM scale set extension. -// - extensionParameters - Parameters supplied to the Update VM scale set Extension operation. -// - options - VirtualMachineScaleSetExtensionsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.BeginUpdate -// method. -func (client *VirtualMachineScaleSetExtensionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtensionUpdate, options *VirtualMachineScaleSetExtensionsClientBeginUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetExtensionsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetExtensionsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetExtensionsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - The operation to update an extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetExtensionsClient) update(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtensionUpdate, options *VirtualMachineScaleSetExtensionsClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetExtensionsClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *VirtualMachineScaleSetExtensionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtensionUpdate, options *VirtualMachineScaleSetExtensionsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if vmssExtensionName == "" { - return nil, errors.New("parameter vmssExtensionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmssExtensionName}", url.PathEscape(vmssExtensionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, extensionParameters); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetrollingupgrades_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetrollingupgrades_client.go deleted file mode 100644 index 41e01d5d74d..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetrollingupgrades_client.go +++ /dev/null @@ -1,346 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VirtualMachineScaleSetRollingUpgradesClient contains the methods for the VirtualMachineScaleSetRollingUpgrades group. -// Don't use this type directly, use NewVirtualMachineScaleSetRollingUpgradesClient() instead. -type VirtualMachineScaleSetRollingUpgradesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewVirtualMachineScaleSetRollingUpgradesClient creates a new instance of VirtualMachineScaleSetRollingUpgradesClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewVirtualMachineScaleSetRollingUpgradesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineScaleSetRollingUpgradesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &VirtualMachineScaleSetRollingUpgradesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCancel - Cancels the current virtual machine scale set rolling upgrade. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.BeginCancel -// method. -func (client *VirtualMachineScaleSetRollingUpgradesClient) BeginCancel(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions) (*runtime.Poller[VirtualMachineScaleSetRollingUpgradesClientCancelResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.cancel(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetRollingUpgradesClientCancelResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetRollingUpgradesClientCancelResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Cancel - Cancels the current virtual machine scale set rolling upgrade. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetRollingUpgradesClient) cancel(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetRollingUpgradesClient.BeginCancel" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.cancelCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// cancelCreateRequest creates the Cancel request. -func (client *VirtualMachineScaleSetRollingUpgradesClient) cancelCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/cancel" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// GetLatest - Gets the status of the latest virtual machine scale set rolling upgrade. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetRollingUpgradesClientGetLatestOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.GetLatest -// method. -func (client *VirtualMachineScaleSetRollingUpgradesClient) GetLatest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientGetLatestOptions) (VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse, error) { - var err error - const operationName = "VirtualMachineScaleSetRollingUpgradesClient.GetLatest" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getLatestCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse{}, err - } - resp, err := client.getLatestHandleResponse(httpResp) - return resp, err -} - -// getLatestCreateRequest creates the GetLatest request. -func (client *VirtualMachineScaleSetRollingUpgradesClient) getLatestCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientGetLatestOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/latest" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getLatestHandleResponse handles the GetLatest response. -func (client *VirtualMachineScaleSetRollingUpgradesClient) getLatestHandleResponse(resp *http.Response) (VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse, error) { - result := VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RollingUpgradeStatusInfo); err != nil { - return VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse{}, err - } - return result, nil -} - -// BeginStartExtensionUpgrade - Starts a rolling upgrade to move all extensions for all virtual machine scale set instances -// to the latest available extension version. Instances which are already running the latest extension versions -// are not affected. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions contains the optional parameters -// for the VirtualMachineScaleSetRollingUpgradesClient.BeginStartExtensionUpgrade method. -func (client *VirtualMachineScaleSetRollingUpgradesClient) BeginStartExtensionUpgrade(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions) (*runtime.Poller[VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradeResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.startExtensionUpgrade(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradeResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradeResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// StartExtensionUpgrade - Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to -// the latest available extension version. Instances which are already running the latest extension versions -// are not affected. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetRollingUpgradesClient) startExtensionUpgrade(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetRollingUpgradesClient.BeginStartExtensionUpgrade" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.startExtensionUpgradeCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// startExtensionUpgradeCreateRequest creates the StartExtensionUpgrade request. -func (client *VirtualMachineScaleSetRollingUpgradesClient) startExtensionUpgradeCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensionRollingUpgrade" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginStartOSUpgrade - Starts a rolling upgrade to move all virtual machine scale set instances to the latest available -// Platform Image OS version. Instances which are already running the latest available OS version are not -// affected. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions contains the optional parameters for the -// VirtualMachineScaleSetRollingUpgradesClient.BeginStartOSUpgrade method. -func (client *VirtualMachineScaleSetRollingUpgradesClient) BeginStartOSUpgrade(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions) (*runtime.Poller[VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradeResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.startOSUpgrade(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradeResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradeResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// StartOSUpgrade - Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform -// Image OS version. Instances which are already running the latest available OS version are not -// affected. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetRollingUpgradesClient) startOSUpgrade(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetRollingUpgradesClient.BeginStartOSUpgrade" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.startOSUpgradeCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// startOSUpgradeCreateRequest creates the StartOSUpgrade request. -func (client *VirtualMachineScaleSetRollingUpgradesClient) startOSUpgradeCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osRollingUpgrade" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesets_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesets_client.go deleted file mode 100644 index a03ff0c5083..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesets_client.go +++ /dev/null @@ -1,1957 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// VirtualMachineScaleSetsClient contains the methods for the VirtualMachineScaleSets group. -// Don't use this type directly, use NewVirtualMachineScaleSetsClient() instead. -type VirtualMachineScaleSetsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewVirtualMachineScaleSetsClient creates a new instance of VirtualMachineScaleSetsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewVirtualMachineScaleSetsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineScaleSetsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &VirtualMachineScaleSetsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginApproveRollingUpgrade - Approve upgrade on deferred rolling upgrades for OS disks in the virtual machines in a VM -// scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetsClientBeginApproveRollingUpgradeOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginApproveRollingUpgrade -// method. -func (client *VirtualMachineScaleSetsClient) BeginApproveRollingUpgrade(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginApproveRollingUpgradeOptions) (*runtime.Poller[VirtualMachineScaleSetsClientApproveRollingUpgradeResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.approveRollingUpgrade(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientApproveRollingUpgradeResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientApproveRollingUpgradeResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// ApproveRollingUpgrade - Approve upgrade on deferred rolling upgrades for OS disks in the virtual machines in a VM scale -// set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetsClient) approveRollingUpgrade(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginApproveRollingUpgradeOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.BeginApproveRollingUpgrade" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.approveRollingUpgradeCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// approveRollingUpgradeCreateRequest creates the ApproveRollingUpgrade request. -func (client *VirtualMachineScaleSetsClient) approveRollingUpgradeCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginApproveRollingUpgradeOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/approveRollingUpgrade" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.VMInstanceIDs != nil { - if err := runtime.MarshalAsJSON(req, *options.VMInstanceIDs); err != nil { - return nil, err - } - return req, nil - } - return req, nil -} - -// ConvertToSinglePlacementGroup - Converts SinglePlacementGroup property to false for a existing virtual machine scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the virtual machine scale set to create or update. -// - parameters - The input object for ConvertToSinglePlacementGroup API. -// - options - VirtualMachineScaleSetsClientConvertToSinglePlacementGroupOptions contains the optional parameters for the VirtualMachineScaleSetsClient.ConvertToSinglePlacementGroup -// method. -func (client *VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroup(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters VMScaleSetConvertToSinglePlacementGroupInput, options *VirtualMachineScaleSetsClientConvertToSinglePlacementGroupOptions) (VirtualMachineScaleSetsClientConvertToSinglePlacementGroupResponse, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.ConvertToSinglePlacementGroup" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.convertToSinglePlacementGroupCreateRequest(ctx, resourceGroupName, vmScaleSetName, parameters, options) - if err != nil { - return VirtualMachineScaleSetsClientConvertToSinglePlacementGroupResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineScaleSetsClientConvertToSinglePlacementGroupResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineScaleSetsClientConvertToSinglePlacementGroupResponse{}, err - } - return VirtualMachineScaleSetsClientConvertToSinglePlacementGroupResponse{}, nil -} - -// convertToSinglePlacementGroupCreateRequest creates the ConvertToSinglePlacementGroup request. -func (client *VirtualMachineScaleSetsClient) convertToSinglePlacementGroupCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters VMScaleSetConvertToSinglePlacementGroupInput, options *VirtualMachineScaleSetsClientConvertToSinglePlacementGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/convertToSinglePlacementGroup" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginCreateOrUpdate - Create or update a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set to create or update. -// - parameters - The scale set object. -// - options - VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginCreateOrUpdate -// method. -func (client *VirtualMachineScaleSetsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters VirtualMachineScaleSet, options *VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, vmScaleSetName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Create or update a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters VirtualMachineScaleSet, options *VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vmScaleSetName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualMachineScaleSetsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters VirtualMachineScaleSet, options *VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.IfMatch != nil { - req.Raw().Header["If-Match"] = []string{*options.IfMatch} - } - if options != nil && options.IfNoneMatch != nil { - req.Raw().Header["If-None-Match"] = []string{*options.IfNoneMatch} - } - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginDeallocate - Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases -// the compute resources. You are not billed for the compute resources that this virtual machine -// scale set deallocates. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetsClientBeginDeallocateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginDeallocate -// method. -func (client *VirtualMachineScaleSetsClient) BeginDeallocate(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginDeallocateOptions) (*runtime.Poller[VirtualMachineScaleSetsClientDeallocateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deallocate(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientDeallocateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientDeallocateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Deallocate - Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the -// compute resources. You are not billed for the compute resources that this virtual machine -// scale set deallocates. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetsClient) deallocate(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginDeallocateOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.BeginDeallocate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deallocateCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deallocateCreateRequest creates the Deallocate request. -func (client *VirtualMachineScaleSetsClient) deallocateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginDeallocateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - if options != nil && options.Hibernate != nil { - reqQP.Set("hibernate", strconv.FormatBool(*options.Hibernate)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.VMInstanceIDs != nil { - if err := runtime.MarshalAsJSON(req, *options.VMInstanceIDs); err != nil { - return nil, err - } - return req, nil - } - return req, nil -} - -// BeginDelete - Deletes a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginDelete -// method. -func (client *VirtualMachineScaleSetsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginDeleteOptions) (*runtime.Poller[VirtualMachineScaleSetsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Deletes a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetsClient) deleteOperation(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VirtualMachineScaleSetsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - if options != nil && options.ForceDeletion != nil { - reqQP.Set("forceDeletion", strconv.FormatBool(*options.ForceDeletion)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginDeleteInstances - Deletes virtual machines in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - vmInstanceIDs - A list of virtual machine instance IDs from the VM scale set. -// - options - VirtualMachineScaleSetsClientBeginDeleteInstancesOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginDeleteInstances -// method. -func (client *VirtualMachineScaleSetsClient) BeginDeleteInstances(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, options *VirtualMachineScaleSetsClientBeginDeleteInstancesOptions) (*runtime.Poller[VirtualMachineScaleSetsClientDeleteInstancesResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteInstances(ctx, resourceGroupName, vmScaleSetName, vmInstanceIDs, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientDeleteInstancesResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientDeleteInstancesResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// DeleteInstances - Deletes virtual machines in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetsClient) deleteInstances(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, options *VirtualMachineScaleSetsClientBeginDeleteInstancesOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.BeginDeleteInstances" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteInstancesCreateRequest(ctx, resourceGroupName, vmScaleSetName, vmInstanceIDs, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteInstancesCreateRequest creates the DeleteInstances request. -func (client *VirtualMachineScaleSetsClient) deleteInstancesCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, options *VirtualMachineScaleSetsClientBeginDeleteInstancesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - if options != nil && options.ForceDeletion != nil { - reqQP.Set("forceDeletion", strconv.FormatBool(*options.ForceDeletion)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, vmInstanceIDs); err != nil { - return nil, err - } - return req, nil -} - -// ForceRecoveryServiceFabricPlatformUpdateDomainWalk - Manual platform update domain walk to update virtual machines in a -// service fabric virtual machine scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - platformUpdateDomain - The platform update domain for which a manual recovery walk is requested -// - options - VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions contains the optional -// parameters for the VirtualMachineScaleSetsClient.ForceRecoveryServiceFabricPlatformUpdateDomainWalk method. -func (client *VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUpdateDomainWalk(ctx context.Context, resourceGroupName string, vmScaleSetName string, platformUpdateDomain int32, options *VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions) (VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.ForceRecoveryServiceFabricPlatformUpdateDomainWalk" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.forceRecoveryServiceFabricPlatformUpdateDomainWalkCreateRequest(ctx, resourceGroupName, vmScaleSetName, platformUpdateDomain, options) - if err != nil { - return VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse{}, err - } - resp, err := client.forceRecoveryServiceFabricPlatformUpdateDomainWalkHandleResponse(httpResp) - return resp, err -} - -// forceRecoveryServiceFabricPlatformUpdateDomainWalkCreateRequest creates the ForceRecoveryServiceFabricPlatformUpdateDomainWalk request. -func (client *VirtualMachineScaleSetsClient) forceRecoveryServiceFabricPlatformUpdateDomainWalkCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, platformUpdateDomain int32, options *VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/forceRecoveryServiceFabricPlatformUpdateDomainWalk" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - if options != nil && options.PlacementGroupID != nil { - reqQP.Set("placementGroupId", *options.PlacementGroupID) - } - reqQP.Set("platformUpdateDomain", strconv.FormatInt(int64(platformUpdateDomain), 10)) - if options != nil && options.Zone != nil { - reqQP.Set("zone", *options.Zone) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// forceRecoveryServiceFabricPlatformUpdateDomainWalkHandleResponse handles the ForceRecoveryServiceFabricPlatformUpdateDomainWalk response. -func (client *VirtualMachineScaleSetsClient) forceRecoveryServiceFabricPlatformUpdateDomainWalkHandleResponse(resp *http.Response) (VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse, error) { - result := VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RecoveryWalkResponse); err != nil { - return VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse{}, err - } - return result, nil -} - -// Get - Display information about a virtual machine scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetsClient.Get -// method. -func (client *VirtualMachineScaleSetsClient) Get(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientGetOptions) (VirtualMachineScaleSetsClientGetResponse, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return VirtualMachineScaleSetsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineScaleSetsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineScaleSetsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *VirtualMachineScaleSetsClient) getCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualMachineScaleSetsClient) getHandleResponse(resp *http.Response) (VirtualMachineScaleSetsClientGetResponse, error) { - result := VirtualMachineScaleSetsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSet); err != nil { - return VirtualMachineScaleSetsClientGetResponse{}, err - } - return result, nil -} - -// GetInstanceView - Gets the status of a VM scale set instance. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetsClientGetInstanceViewOptions contains the optional parameters for the VirtualMachineScaleSetsClient.GetInstanceView -// method. -func (client *VirtualMachineScaleSetsClient) GetInstanceView(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientGetInstanceViewOptions) (VirtualMachineScaleSetsClientGetInstanceViewResponse, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.GetInstanceView" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getInstanceViewCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return VirtualMachineScaleSetsClientGetInstanceViewResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineScaleSetsClientGetInstanceViewResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineScaleSetsClientGetInstanceViewResponse{}, err - } - resp, err := client.getInstanceViewHandleResponse(httpResp) - return resp, err -} - -// getInstanceViewCreateRequest creates the GetInstanceView request. -func (client *VirtualMachineScaleSetsClient) getInstanceViewCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientGetInstanceViewOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/instanceView" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getInstanceViewHandleResponse handles the GetInstanceView response. -func (client *VirtualMachineScaleSetsClient) getInstanceViewHandleResponse(resp *http.Response) (VirtualMachineScaleSetsClientGetInstanceViewResponse, error) { - result := VirtualMachineScaleSetsClientGetInstanceViewResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetInstanceView); err != nil { - return VirtualMachineScaleSetsClientGetInstanceViewResponse{}, err - } - return result, nil -} - -// NewGetOSUpgradeHistoryPager - Gets list of OS upgrades on a VM scale set instance. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetsClientGetOSUpgradeHistoryOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewGetOSUpgradeHistoryPager -// method. -func (client *VirtualMachineScaleSetsClient) NewGetOSUpgradeHistoryPager(resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientGetOSUpgradeHistoryOptions) *runtime.Pager[VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse]{ - More: func(page VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse) (VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachineScaleSetsClient.NewGetOSUpgradeHistoryPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.getOSUpgradeHistoryCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - }, nil) - if err != nil { - return VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse{}, err - } - return client.getOSUpgradeHistoryHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// getOSUpgradeHistoryCreateRequest creates the GetOSUpgradeHistory request. -func (client *VirtualMachineScaleSetsClient) getOSUpgradeHistoryCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientGetOSUpgradeHistoryOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osUpgradeHistory" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getOSUpgradeHistoryHandleResponse handles the GetOSUpgradeHistory response. -func (client *VirtualMachineScaleSetsClient) getOSUpgradeHistoryHandleResponse(resp *http.Response) (VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse, error) { - result := VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetListOSUpgradeHistory); err != nil { - return VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse{}, err - } - return result, nil -} - -// NewListPager - Gets a list of all VM scale sets under a resource group. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - options - VirtualMachineScaleSetsClientListOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListPager -// method. -func (client *VirtualMachineScaleSetsClient) NewListPager(resourceGroupName string, options *VirtualMachineScaleSetsClientListOptions) *runtime.Pager[VirtualMachineScaleSetsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachineScaleSetsClientListResponse]{ - More: func(page VirtualMachineScaleSetsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualMachineScaleSetsClientListResponse) (VirtualMachineScaleSetsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachineScaleSetsClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, options) - }, nil) - if err != nil { - return VirtualMachineScaleSetsClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *VirtualMachineScaleSetsClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualMachineScaleSetsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualMachineScaleSetsClient) listHandleResponse(resp *http.Response) (VirtualMachineScaleSetsClientListResponse, error) { - result := VirtualMachineScaleSetsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetListResult); err != nil { - return VirtualMachineScaleSetsClientListResponse{}, err - } - return result, nil -} - -// NewListAllPager - Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use -// nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is -// null to fetch all the VM Scale Sets. -// -// Generated from API version 2024-03-01 -// - options - VirtualMachineScaleSetsClientListAllOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListAllPager -// method. -func (client *VirtualMachineScaleSetsClient) NewListAllPager(options *VirtualMachineScaleSetsClientListAllOptions) *runtime.Pager[VirtualMachineScaleSetsClientListAllResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachineScaleSetsClientListAllResponse]{ - More: func(page VirtualMachineScaleSetsClientListAllResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualMachineScaleSetsClientListAllResponse) (VirtualMachineScaleSetsClientListAllResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachineScaleSetsClient.NewListAllPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listAllCreateRequest(ctx, options) - }, nil) - if err != nil { - return VirtualMachineScaleSetsClientListAllResponse{}, err - } - return client.listAllHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listAllCreateRequest creates the ListAll request. -func (client *VirtualMachineScaleSetsClient) listAllCreateRequest(ctx context.Context, options *VirtualMachineScaleSetsClientListAllOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listAllHandleResponse handles the ListAll response. -func (client *VirtualMachineScaleSetsClient) listAllHandleResponse(resp *http.Response) (VirtualMachineScaleSetsClientListAllResponse, error) { - result := VirtualMachineScaleSetsClientListAllResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetListWithLinkResult); err != nil { - return VirtualMachineScaleSetsClientListAllResponse{}, err - } - return result, nil -} - -// NewListByLocationPager - Gets all the VM scale sets under the specified subscription for the specified location. -// -// Generated from API version 2024-03-01 -// - location - The location for which VM scale sets under the subscription are queried. -// - options - VirtualMachineScaleSetsClientListByLocationOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListByLocationPager -// method. -func (client *VirtualMachineScaleSetsClient) NewListByLocationPager(location string, options *VirtualMachineScaleSetsClientListByLocationOptions) *runtime.Pager[VirtualMachineScaleSetsClientListByLocationResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachineScaleSetsClientListByLocationResponse]{ - More: func(page VirtualMachineScaleSetsClientListByLocationResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualMachineScaleSetsClientListByLocationResponse) (VirtualMachineScaleSetsClientListByLocationResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachineScaleSetsClient.NewListByLocationPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByLocationCreateRequest(ctx, location, options) - }, nil) - if err != nil { - return VirtualMachineScaleSetsClientListByLocationResponse{}, err - } - return client.listByLocationHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByLocationCreateRequest creates the ListByLocation request. -func (client *VirtualMachineScaleSetsClient) listByLocationCreateRequest(ctx context.Context, location string, options *VirtualMachineScaleSetsClientListByLocationOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/virtualMachineScaleSets" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByLocationHandleResponse handles the ListByLocation response. -func (client *VirtualMachineScaleSetsClient) listByLocationHandleResponse(resp *http.Response) (VirtualMachineScaleSetsClientListByLocationResponse, error) { - result := VirtualMachineScaleSetsClientListByLocationResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetListResult); err != nil { - return VirtualMachineScaleSetsClientListByLocationResponse{}, err - } - return result, nil -} - -// NewListSKUsPager - Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances -// allowed for each SKU. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetsClientListSKUsOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListSKUsPager -// method. -func (client *VirtualMachineScaleSetsClient) NewListSKUsPager(resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientListSKUsOptions) *runtime.Pager[VirtualMachineScaleSetsClientListSKUsResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachineScaleSetsClientListSKUsResponse]{ - More: func(page VirtualMachineScaleSetsClientListSKUsResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualMachineScaleSetsClientListSKUsResponse) (VirtualMachineScaleSetsClientListSKUsResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachineScaleSetsClient.NewListSKUsPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listSKUsCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - }, nil) - if err != nil { - return VirtualMachineScaleSetsClientListSKUsResponse{}, err - } - return client.listSKUsHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listSKUsCreateRequest creates the ListSKUs request. -func (client *VirtualMachineScaleSetsClient) listSKUsCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientListSKUsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/skus" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listSKUsHandleResponse handles the ListSKUs response. -func (client *VirtualMachineScaleSetsClient) listSKUsHandleResponse(resp *http.Response) (VirtualMachineScaleSetsClientListSKUsResponse, error) { - result := VirtualMachineScaleSetsClientListSKUsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetListSKUsResult); err != nil { - return VirtualMachineScaleSetsClientListSKUsResponse{}, err - } - return result, nil -} - -// BeginPerformMaintenance - Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances -// which are not eligible for perform maintenance will be failed. Please refer to best practices for more -// details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginPerformMaintenance -// method. -func (client *VirtualMachineScaleSetsClient) BeginPerformMaintenance(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions) (*runtime.Poller[VirtualMachineScaleSetsClientPerformMaintenanceResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.performMaintenance(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientPerformMaintenanceResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientPerformMaintenanceResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// PerformMaintenance - Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which -// are not eligible for perform maintenance will be failed. Please refer to best practices for more -// details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetsClient) performMaintenance(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.BeginPerformMaintenance" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.performMaintenanceCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// performMaintenanceCreateRequest creates the PerformMaintenance request. -func (client *VirtualMachineScaleSetsClient) performMaintenanceCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/performMaintenance" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.VMInstanceIDs != nil { - if err := runtime.MarshalAsJSON(req, *options.VMInstanceIDs); err != nil { - return nil, err - } - return req, nil - } - return req, nil -} - -// BeginPowerOff - Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached -// and you are getting charged for the resources. Instead, use deallocate to release resources and -// avoid charges. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetsClientBeginPowerOffOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginPowerOff -// method. -func (client *VirtualMachineScaleSetsClient) BeginPowerOff(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginPowerOffOptions) (*runtime.Poller[VirtualMachineScaleSetsClientPowerOffResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.powerOff(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientPowerOffResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientPowerOffResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// PowerOff - Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and -// you are getting charged for the resources. Instead, use deallocate to release resources and -// avoid charges. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetsClient) powerOff(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginPowerOffOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.BeginPowerOff" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.powerOffCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// powerOffCreateRequest creates the PowerOff request. -func (client *VirtualMachineScaleSetsClient) powerOffCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginPowerOffOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - if options != nil && options.SkipShutdown != nil { - reqQP.Set("skipShutdown", strconv.FormatBool(*options.SkipShutdown)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.VMInstanceIDs != nil { - if err := runtime.MarshalAsJSON(req, *options.VMInstanceIDs); err != nil { - return nil, err - } - return req, nil - } - return req, nil -} - -// BeginReapply - Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetsClientBeginReapplyOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginReapply -// method. -func (client *VirtualMachineScaleSetsClient) BeginReapply(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginReapplyOptions) (*runtime.Poller[VirtualMachineScaleSetsClientReapplyResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.reapply(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientReapplyResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientReapplyResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Reapply - Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetsClient) reapply(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginReapplyOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.BeginReapply" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.reapplyCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// reapplyCreateRequest creates the Reapply request. -func (client *VirtualMachineScaleSetsClient) reapplyCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginReapplyOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reapply" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginRedeploy - Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers -// them back on. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetsClientBeginRedeployOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginRedeploy -// method. -func (client *VirtualMachineScaleSetsClient) BeginRedeploy(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginRedeployOptions) (*runtime.Poller[VirtualMachineScaleSetsClientRedeployResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.redeploy(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientRedeployResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientRedeployResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Redeploy - Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them -// back on. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetsClient) redeploy(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginRedeployOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.BeginRedeploy" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.redeployCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// redeployCreateRequest creates the Redeploy request. -func (client *VirtualMachineScaleSetsClient) redeployCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginRedeployOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/redeploy" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.VMInstanceIDs != nil { - if err := runtime.MarshalAsJSON(req, *options.VMInstanceIDs); err != nil { - return nil, err - } - return req, nil - } - return req, nil -} - -// BeginReimage - Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have -// a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is -// reset to initial state. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetsClientBeginReimageOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginReimage -// method. -func (client *VirtualMachineScaleSetsClient) BeginReimage(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginReimageOptions) (*runtime.Poller[VirtualMachineScaleSetsClientReimageResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.reimage(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientReimageResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientReimageResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Reimage - Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral -// OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is -// reset to initial state. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetsClient) reimage(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginReimageOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.BeginReimage" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.reimageCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// reimageCreateRequest creates the Reimage request. -func (client *VirtualMachineScaleSetsClient) reimageCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginReimageOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.VMScaleSetReimageInput != nil { - if err := runtime.MarshalAsJSON(req, *options.VMScaleSetReimageInput); err != nil { - return nil, err - } - return req, nil - } - return req, nil -} - -// BeginReimageAll - Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation -// is only supported for managed disks. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetsClientBeginReimageAllOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginReimageAll -// method. -func (client *VirtualMachineScaleSetsClient) BeginReimageAll(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginReimageAllOptions) (*runtime.Poller[VirtualMachineScaleSetsClientReimageAllResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.reimageAll(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientReimageAllResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientReimageAllResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// ReimageAll - Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation -// is only supported for managed disks. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetsClient) reimageAll(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginReimageAllOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.BeginReimageAll" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.reimageAllCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// reimageAllCreateRequest creates the ReimageAll request. -func (client *VirtualMachineScaleSetsClient) reimageAllCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginReimageAllOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimageall" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.VMInstanceIDs != nil { - if err := runtime.MarshalAsJSON(req, *options.VMInstanceIDs); err != nil { - return nil, err - } - return req, nil - } - return req, nil -} - -// BeginRestart - Restarts one or more virtual machines in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetsClientBeginRestartOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginRestart -// method. -func (client *VirtualMachineScaleSetsClient) BeginRestart(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginRestartOptions) (*runtime.Poller[VirtualMachineScaleSetsClientRestartResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.restart(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientRestartResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientRestartResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Restart - Restarts one or more virtual machines in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetsClient) restart(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginRestartOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.BeginRestart" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.restartCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// restartCreateRequest creates the Restart request. -func (client *VirtualMachineScaleSetsClient) restartCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginRestartOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.VMInstanceIDs != nil { - if err := runtime.MarshalAsJSON(req, *options.VMInstanceIDs); err != nil { - return nil, err - } - return req, nil - } - return req, nil -} - -// BeginSetOrchestrationServiceState - Changes ServiceState property for a given service -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the virtual machine scale set to create or update. -// - parameters - The input object for SetOrchestrationServiceState API. -// - options - VirtualMachineScaleSetsClientBeginSetOrchestrationServiceStateOptions contains the optional parameters for the -// VirtualMachineScaleSetsClient.BeginSetOrchestrationServiceState method. -func (client *VirtualMachineScaleSetsClient) BeginSetOrchestrationServiceState(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters OrchestrationServiceStateInput, options *VirtualMachineScaleSetsClientBeginSetOrchestrationServiceStateOptions) (*runtime.Poller[VirtualMachineScaleSetsClientSetOrchestrationServiceStateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.setOrchestrationServiceState(ctx, resourceGroupName, vmScaleSetName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientSetOrchestrationServiceStateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientSetOrchestrationServiceStateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// SetOrchestrationServiceState - Changes ServiceState property for a given service -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetsClient) setOrchestrationServiceState(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters OrchestrationServiceStateInput, options *VirtualMachineScaleSetsClientBeginSetOrchestrationServiceStateOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.BeginSetOrchestrationServiceState" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.setOrchestrationServiceStateCreateRequest(ctx, resourceGroupName, vmScaleSetName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// setOrchestrationServiceStateCreateRequest creates the SetOrchestrationServiceState request. -func (client *VirtualMachineScaleSetsClient) setOrchestrationServiceStateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters OrchestrationServiceStateInput, options *VirtualMachineScaleSetsClientBeginSetOrchestrationServiceStateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/setOrchestrationServiceState" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginStart - Starts one or more virtual machines in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetsClientBeginStartOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginStart -// method. -func (client *VirtualMachineScaleSetsClient) BeginStart(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginStartOptions) (*runtime.Poller[VirtualMachineScaleSetsClientStartResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.start(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientStartResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientStartResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Start - Starts one or more virtual machines in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetsClient) start(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginStartOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.BeginStart" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.startCreateRequest(ctx, resourceGroupName, vmScaleSetName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// startCreateRequest creates the Start request. -func (client *VirtualMachineScaleSetsClient) startCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginStartOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.VMInstanceIDs != nil { - if err := runtime.MarshalAsJSON(req, *options.VMInstanceIDs); err != nil { - return nil, err - } - return req, nil - } - return req, nil -} - -// BeginUpdate - Update a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set to create or update. -// - parameters - The scale set object. -// - options - VirtualMachineScaleSetsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginUpdate -// method. -func (client *VirtualMachineScaleSetsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters VirtualMachineScaleSetUpdate, options *VirtualMachineScaleSetsClientBeginUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, vmScaleSetName, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Update a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetsClient) update(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters VirtualMachineScaleSetUpdate, options *VirtualMachineScaleSetsClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, vmScaleSetName, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *VirtualMachineScaleSetsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters VirtualMachineScaleSetUpdate, options *VirtualMachineScaleSetsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.IfMatch != nil { - req.Raw().Header["If-Match"] = []string{*options.IfMatch} - } - if options != nil && options.IfNoneMatch != nil { - req.Raw().Header["If-None-Match"] = []string{*options.IfNoneMatch} - } - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginUpdateInstances - Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - vmInstanceIDs - A list of virtual machine instance IDs from the VM scale set. -// - options - VirtualMachineScaleSetsClientBeginUpdateInstancesOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginUpdateInstances -// method. -func (client *VirtualMachineScaleSetsClient) BeginUpdateInstances(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, options *VirtualMachineScaleSetsClientBeginUpdateInstancesOptions) (*runtime.Poller[VirtualMachineScaleSetsClientUpdateInstancesResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.updateInstances(ctx, resourceGroupName, vmScaleSetName, vmInstanceIDs, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientUpdateInstancesResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientUpdateInstancesResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// UpdateInstances - Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetsClient) updateInstances(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, options *VirtualMachineScaleSetsClientBeginUpdateInstancesOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetsClient.BeginUpdateInstances" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateInstancesCreateRequest(ctx, resourceGroupName, vmScaleSetName, vmInstanceIDs, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateInstancesCreateRequest creates the UpdateInstances request. -func (client *VirtualMachineScaleSetsClient) updateInstancesCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, options *VirtualMachineScaleSetsClientBeginUpdateInstancesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, vmInstanceIDs); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetvmextensions_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetvmextensions_client.go deleted file mode 100644 index c16821d834a..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetvmextensions_client.go +++ /dev/null @@ -1,462 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VirtualMachineScaleSetVMExtensionsClient contains the methods for the VirtualMachineScaleSetVMExtensions group. -// Don't use this type directly, use NewVirtualMachineScaleSetVMExtensionsClient() instead. -type VirtualMachineScaleSetVMExtensionsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewVirtualMachineScaleSetVMExtensionsClient creates a new instance of VirtualMachineScaleSetVMExtensionsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewVirtualMachineScaleSetVMExtensionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineScaleSetVMExtensionsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &VirtualMachineScaleSetVMExtensionsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - The operation to create or update the VMSS VM extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - vmExtensionName - The name of the virtual machine extension. -// - extensionParameters - Parameters supplied to the Create Virtual Machine Extension operation. -// - options - VirtualMachineScaleSetVMExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.BeginCreateOrUpdate -// method. -func (client *VirtualMachineScaleSetVMExtensionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, extensionParameters VirtualMachineScaleSetVMExtension, options *VirtualMachineScaleSetVMExtensionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, vmScaleSetName, instanceID, vmExtensionName, extensionParameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - The operation to create or update the VMSS VM extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetVMExtensionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, extensionParameters VirtualMachineScaleSetVMExtension, options *VirtualMachineScaleSetVMExtensionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetVMExtensionsClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, vmExtensionName, extensionParameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualMachineScaleSetVMExtensionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, extensionParameters VirtualMachineScaleSetVMExtension, options *VirtualMachineScaleSetVMExtensionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if vmExtensionName == "" { - return nil, errors.New("parameter vmExtensionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmExtensionName}", url.PathEscape(vmExtensionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, extensionParameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - The operation to delete the VMSS VM extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - vmExtensionName - The name of the virtual machine extension. -// - options - VirtualMachineScaleSetVMExtensionsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.BeginDelete -// method. -func (client *VirtualMachineScaleSetVMExtensionsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, options *VirtualMachineScaleSetVMExtensionsClientBeginDeleteOptions) (*runtime.Poller[VirtualMachineScaleSetVMExtensionsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, vmScaleSetName, instanceID, vmExtensionName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMExtensionsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMExtensionsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - The operation to delete the VMSS VM extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetVMExtensionsClient) deleteOperation(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, options *VirtualMachineScaleSetVMExtensionsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetVMExtensionsClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, vmExtensionName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VirtualMachineScaleSetVMExtensionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, options *VirtualMachineScaleSetVMExtensionsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if vmExtensionName == "" { - return nil, errors.New("parameter vmExtensionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmExtensionName}", url.PathEscape(vmExtensionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - The operation to get the VMSS VM extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - vmExtensionName - The name of the virtual machine extension. -// - options - VirtualMachineScaleSetVMExtensionsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.Get -// method. -func (client *VirtualMachineScaleSetVMExtensionsClient) Get(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, options *VirtualMachineScaleSetVMExtensionsClientGetOptions) (VirtualMachineScaleSetVMExtensionsClientGetResponse, error) { - var err error - const operationName = "VirtualMachineScaleSetVMExtensionsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, vmExtensionName, options) - if err != nil { - return VirtualMachineScaleSetVMExtensionsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineScaleSetVMExtensionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineScaleSetVMExtensionsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *VirtualMachineScaleSetVMExtensionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, options *VirtualMachineScaleSetVMExtensionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if vmExtensionName == "" { - return nil, errors.New("parameter vmExtensionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmExtensionName}", url.PathEscape(vmExtensionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualMachineScaleSetVMExtensionsClient) getHandleResponse(resp *http.Response) (VirtualMachineScaleSetVMExtensionsClientGetResponse, error) { - result := VirtualMachineScaleSetVMExtensionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetVMExtension); err != nil { - return VirtualMachineScaleSetVMExtensionsClientGetResponse{}, err - } - return result, nil -} - -// List - The operation to get all extensions of an instance in Virtual Machine Scaleset. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - options - VirtualMachineScaleSetVMExtensionsClientListOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.List -// method. -func (client *VirtualMachineScaleSetVMExtensionsClient) List(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMExtensionsClientListOptions) (VirtualMachineScaleSetVMExtensionsClientListResponse, error) { - var err error - const operationName = "VirtualMachineScaleSetVMExtensionsClient.List" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.listCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return VirtualMachineScaleSetVMExtensionsClientListResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineScaleSetVMExtensionsClientListResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineScaleSetVMExtensionsClientListResponse{}, err - } - resp, err := client.listHandleResponse(httpResp) - return resp, err -} - -// listCreateRequest creates the List request. -func (client *VirtualMachineScaleSetVMExtensionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMExtensionsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualMachineScaleSetVMExtensionsClient) listHandleResponse(resp *http.Response) (VirtualMachineScaleSetVMExtensionsClientListResponse, error) { - result := VirtualMachineScaleSetVMExtensionsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetVMExtensionsListResult); err != nil { - return VirtualMachineScaleSetVMExtensionsClientListResponse{}, err - } - return result, nil -} - -// BeginUpdate - The operation to update the VMSS VM extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - vmExtensionName - The name of the virtual machine extension. -// - extensionParameters - Parameters supplied to the Update Virtual Machine Extension operation. -// - options - VirtualMachineScaleSetVMExtensionsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.BeginUpdate -// method. -func (client *VirtualMachineScaleSetVMExtensionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, extensionParameters VirtualMachineScaleSetVMExtensionUpdate, options *VirtualMachineScaleSetVMExtensionsClientBeginUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetVMExtensionsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, vmScaleSetName, instanceID, vmExtensionName, extensionParameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMExtensionsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMExtensionsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - The operation to update the VMSS VM extension. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetVMExtensionsClient) update(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, extensionParameters VirtualMachineScaleSetVMExtensionUpdate, options *VirtualMachineScaleSetVMExtensionsClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetVMExtensionsClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, vmExtensionName, extensionParameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *VirtualMachineScaleSetVMExtensionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, extensionParameters VirtualMachineScaleSetVMExtensionUpdate, options *VirtualMachineScaleSetVMExtensionsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if vmExtensionName == "" { - return nil, errors.New("parameter vmExtensionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmExtensionName}", url.PathEscape(vmExtensionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, extensionParameters); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetvmruncommands_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetvmruncommands_client.go deleted file mode 100644 index 85e67fc5572..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetvmruncommands_client.go +++ /dev/null @@ -1,462 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VirtualMachineScaleSetVMRunCommandsClient contains the methods for the VirtualMachineScaleSetVMRunCommands group. -// Don't use this type directly, use NewVirtualMachineScaleSetVMRunCommandsClient() instead. -type VirtualMachineScaleSetVMRunCommandsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewVirtualMachineScaleSetVMRunCommandsClient creates a new instance of VirtualMachineScaleSetVMRunCommandsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewVirtualMachineScaleSetVMRunCommandsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineScaleSetVMRunCommandsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &VirtualMachineScaleSetVMRunCommandsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - The operation to create or update the VMSS VM run command. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - runCommandName - The name of the virtual machine run command. -// - runCommand - Parameters supplied to the Create Virtual Machine RunCommand operation. -// - options - VirtualMachineScaleSetVMRunCommandsClientBeginCreateOrUpdateOptions contains the optional parameters for the -// VirtualMachineScaleSetVMRunCommandsClient.BeginCreateOrUpdate method. -func (client *VirtualMachineScaleSetVMRunCommandsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommand, options *VirtualMachineScaleSetVMRunCommandsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, vmScaleSetName, instanceID, runCommandName, runCommand, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - The operation to create or update the VMSS VM run command. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetVMRunCommandsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommand, options *VirtualMachineScaleSetVMRunCommandsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetVMRunCommandsClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, runCommandName, runCommand, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualMachineScaleSetVMRunCommandsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommand, options *VirtualMachineScaleSetVMRunCommandsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if runCommandName == "" { - return nil, errors.New("parameter runCommandName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{runCommandName}", url.PathEscape(runCommandName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - if err := runtime.MarshalAsJSON(req, runCommand); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - The operation to delete the VMSS VM run command. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - runCommandName - The name of the virtual machine run command. -// - options - VirtualMachineScaleSetVMRunCommandsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.BeginDelete -// method. -func (client *VirtualMachineScaleSetVMRunCommandsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, options *VirtualMachineScaleSetVMRunCommandsClientBeginDeleteOptions) (*runtime.Poller[VirtualMachineScaleSetVMRunCommandsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, vmScaleSetName, instanceID, runCommandName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMRunCommandsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMRunCommandsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - The operation to delete the VMSS VM run command. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetVMRunCommandsClient) deleteOperation(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, options *VirtualMachineScaleSetVMRunCommandsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetVMRunCommandsClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, runCommandName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VirtualMachineScaleSetVMRunCommandsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, options *VirtualMachineScaleSetVMRunCommandsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if runCommandName == "" { - return nil, errors.New("parameter runCommandName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{runCommandName}", url.PathEscape(runCommandName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - return req, nil -} - -// Get - The operation to get the VMSS VM run command. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - runCommandName - The name of the virtual machine run command. -// - options - VirtualMachineScaleSetVMRunCommandsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.Get -// method. -func (client *VirtualMachineScaleSetVMRunCommandsClient) Get(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, options *VirtualMachineScaleSetVMRunCommandsClientGetOptions) (VirtualMachineScaleSetVMRunCommandsClientGetResponse, error) { - var err error - const operationName = "VirtualMachineScaleSetVMRunCommandsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, runCommandName, options) - if err != nil { - return VirtualMachineScaleSetVMRunCommandsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineScaleSetVMRunCommandsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineScaleSetVMRunCommandsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *VirtualMachineScaleSetVMRunCommandsClient) getCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, options *VirtualMachineScaleSetVMRunCommandsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if runCommandName == "" { - return nil, errors.New("parameter runCommandName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{runCommandName}", url.PathEscape(runCommandName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualMachineScaleSetVMRunCommandsClient) getHandleResponse(resp *http.Response) (VirtualMachineScaleSetVMRunCommandsClientGetResponse, error) { - result := VirtualMachineScaleSetVMRunCommandsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineRunCommand); err != nil { - return VirtualMachineScaleSetVMRunCommandsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - The operation to get all run commands of an instance in Virtual Machine Scaleset. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - options - VirtualMachineScaleSetVMRunCommandsClientListOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.NewListPager -// method. -func (client *VirtualMachineScaleSetVMRunCommandsClient) NewListPager(resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMRunCommandsClientListOptions) *runtime.Pager[VirtualMachineScaleSetVMRunCommandsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachineScaleSetVMRunCommandsClientListResponse]{ - More: func(page VirtualMachineScaleSetVMRunCommandsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualMachineScaleSetVMRunCommandsClientListResponse) (VirtualMachineScaleSetVMRunCommandsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachineScaleSetVMRunCommandsClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - }, nil) - if err != nil { - return VirtualMachineScaleSetVMRunCommandsClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *VirtualMachineScaleSetVMRunCommandsClient) listCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMRunCommandsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualMachineScaleSetVMRunCommandsClient) listHandleResponse(resp *http.Response) (VirtualMachineScaleSetVMRunCommandsClientListResponse, error) { - result := VirtualMachineScaleSetVMRunCommandsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineRunCommandsListResult); err != nil { - return VirtualMachineScaleSetVMRunCommandsClientListResponse{}, err - } - return result, nil -} - -// BeginUpdate - The operation to update the VMSS VM run command. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - runCommandName - The name of the virtual machine run command. -// - runCommand - Parameters supplied to the Update Virtual Machine RunCommand operation. -// - options - VirtualMachineScaleSetVMRunCommandsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.BeginUpdate -// method. -func (client *VirtualMachineScaleSetVMRunCommandsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommandUpdate, options *VirtualMachineScaleSetVMRunCommandsClientBeginUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetVMRunCommandsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, vmScaleSetName, instanceID, runCommandName, runCommand, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMRunCommandsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMRunCommandsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - The operation to update the VMSS VM run command. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetVMRunCommandsClient) update(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommandUpdate, options *VirtualMachineScaleSetVMRunCommandsClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetVMRunCommandsClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, runCommandName, runCommand, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *VirtualMachineScaleSetVMRunCommandsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommandUpdate, options *VirtualMachineScaleSetVMRunCommandsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if runCommandName == "" { - return nil, errors.New("parameter runCommandName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{runCommandName}", url.PathEscape(runCommandName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - if err := runtime.MarshalAsJSON(req, runCommand); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetvms_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetvms_client.go deleted file mode 100644 index 379ae96b244..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetvms_client.go +++ /dev/null @@ -1,1494 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// VirtualMachineScaleSetVMsClient contains the methods for the VirtualMachineScaleSetVMs group. -// Don't use this type directly, use NewVirtualMachineScaleSetVMsClient() instead. -type VirtualMachineScaleSetVMsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewVirtualMachineScaleSetVMsClient creates a new instance of VirtualMachineScaleSetVMsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewVirtualMachineScaleSetVMsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineScaleSetVMsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &VirtualMachineScaleSetVMsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginApproveRollingUpgrade - Approve upgrade on deferred rolling upgrade for OS disk on a VM scale set instance. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - options - VirtualMachineScaleSetVMsClientBeginApproveRollingUpgradeOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginApproveRollingUpgrade -// method. -func (client *VirtualMachineScaleSetVMsClient) BeginApproveRollingUpgrade(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginApproveRollingUpgradeOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientApproveRollingUpgradeResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.approveRollingUpgrade(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMsClientApproveRollingUpgradeResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMsClientApproveRollingUpgradeResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// ApproveRollingUpgrade - Approve upgrade on deferred rolling upgrade for OS disk on a VM scale set instance. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetVMsClient) approveRollingUpgrade(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginApproveRollingUpgradeOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetVMsClient.BeginApproveRollingUpgrade" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.approveRollingUpgradeCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// approveRollingUpgradeCreateRequest creates the ApproveRollingUpgrade request. -func (client *VirtualMachineScaleSetVMsClient) approveRollingUpgradeCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginApproveRollingUpgradeOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/approveRollingUpgrade" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginAttachDetachDataDisks - Attach and detach data disks to/from a virtual machine in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - parameters - Parameters supplied to the attach and detach data disks operation on a Virtual Machine Scale Sets VM. -// - options - VirtualMachineScaleSetVMsClientBeginAttachDetachDataDisksOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginAttachDetachDataDisks -// method. -func (client *VirtualMachineScaleSetVMsClient) BeginAttachDetachDataDisks(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, parameters AttachDetachDataDisksRequest, options *VirtualMachineScaleSetVMsClientBeginAttachDetachDataDisksOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientAttachDetachDataDisksResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.attachDetachDataDisks(ctx, resourceGroupName, vmScaleSetName, instanceID, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMsClientAttachDetachDataDisksResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMsClientAttachDetachDataDisksResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// AttachDetachDataDisks - Attach and detach data disks to/from a virtual machine in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetVMsClient) attachDetachDataDisks(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, parameters AttachDetachDataDisksRequest, options *VirtualMachineScaleSetVMsClientBeginAttachDetachDataDisksOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetVMsClient.BeginAttachDetachDataDisks" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.attachDetachDataDisksCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// attachDetachDataDisksCreateRequest creates the AttachDetachDataDisks request. -func (client *VirtualMachineScaleSetVMsClient) attachDetachDataDisksCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, parameters AttachDetachDataDisksRequest, options *VirtualMachineScaleSetVMsClientBeginAttachDetachDataDisksOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/attachDetachDataDisks" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// BeginDeallocate - Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases -// the compute resources it uses. You are not billed for the compute resources of this virtual -// machine once it is deallocated. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - options - VirtualMachineScaleSetVMsClientBeginDeallocateOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginDeallocate -// method. -func (client *VirtualMachineScaleSetVMsClient) BeginDeallocate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginDeallocateOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientDeallocateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deallocate(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMsClientDeallocateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMsClientDeallocateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Deallocate - Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the -// compute resources it uses. You are not billed for the compute resources of this virtual -// machine once it is deallocated. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetVMsClient) deallocate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginDeallocateOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetVMsClient.BeginDeallocate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deallocateCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deallocateCreateRequest creates the Deallocate request. -func (client *VirtualMachineScaleSetVMsClient) deallocateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginDeallocateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/deallocate" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginDelete - Deletes a virtual machine from a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - options - VirtualMachineScaleSetVMsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginDelete -// method. -func (client *VirtualMachineScaleSetVMsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginDeleteOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Deletes a virtual machine from a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetVMsClient) deleteOperation(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetVMsClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *VirtualMachineScaleSetVMsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - if options != nil && options.ForceDeletion != nil { - reqQP.Set("forceDeletion", strconv.FormatBool(*options.ForceDeletion)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets a virtual machine from a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - options - VirtualMachineScaleSetVMsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.Get -// method. -func (client *VirtualMachineScaleSetVMsClient) Get(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientGetOptions) (VirtualMachineScaleSetVMsClientGetResponse, error) { - var err error - const operationName = "VirtualMachineScaleSetVMsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return VirtualMachineScaleSetVMsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineScaleSetVMsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineScaleSetVMsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *VirtualMachineScaleSetVMsClient) getCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", string(*options.Expand)) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *VirtualMachineScaleSetVMsClient) getHandleResponse(resp *http.Response) (VirtualMachineScaleSetVMsClientGetResponse, error) { - result := VirtualMachineScaleSetVMsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetVM); err != nil { - return VirtualMachineScaleSetVMsClientGetResponse{}, err - } - return result, nil -} - -// GetInstanceView - Gets the status of a virtual machine from a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - options - VirtualMachineScaleSetVMsClientGetInstanceViewOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.GetInstanceView -// method. -func (client *VirtualMachineScaleSetVMsClient) GetInstanceView(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientGetInstanceViewOptions) (VirtualMachineScaleSetVMsClientGetInstanceViewResponse, error) { - var err error - const operationName = "VirtualMachineScaleSetVMsClient.GetInstanceView" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getInstanceViewCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return VirtualMachineScaleSetVMsClientGetInstanceViewResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineScaleSetVMsClientGetInstanceViewResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineScaleSetVMsClientGetInstanceViewResponse{}, err - } - resp, err := client.getInstanceViewHandleResponse(httpResp) - return resp, err -} - -// getInstanceViewCreateRequest creates the GetInstanceView request. -func (client *VirtualMachineScaleSetVMsClient) getInstanceViewCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientGetInstanceViewOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/instanceView" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getInstanceViewHandleResponse handles the GetInstanceView response. -func (client *VirtualMachineScaleSetVMsClient) getInstanceViewHandleResponse(resp *http.Response) (VirtualMachineScaleSetVMsClientGetInstanceViewResponse, error) { - result := VirtualMachineScaleSetVMsClientGetInstanceViewResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetVMInstanceView); err != nil { - return VirtualMachineScaleSetVMsClientGetInstanceViewResponse{}, err - } - return result, nil -} - -// NewListPager - Gets a list of all virtual machines in a VM scale sets. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - virtualMachineScaleSetName - The name of the VM scale set. -// - options - VirtualMachineScaleSetVMsClientListOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.NewListPager -// method. -func (client *VirtualMachineScaleSetVMsClient) NewListPager(resourceGroupName string, virtualMachineScaleSetName string, options *VirtualMachineScaleSetVMsClientListOptions) *runtime.Pager[VirtualMachineScaleSetVMsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachineScaleSetVMsClientListResponse]{ - More: func(page VirtualMachineScaleSetVMsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *VirtualMachineScaleSetVMsClientListResponse) (VirtualMachineScaleSetVMsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachineScaleSetVMsClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, virtualMachineScaleSetName, options) - }, nil) - if err != nil { - return VirtualMachineScaleSetVMsClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *VirtualMachineScaleSetVMsClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, options *VirtualMachineScaleSetVMsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if virtualMachineScaleSetName == "" { - return nil, errors.New("parameter virtualMachineScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{virtualMachineScaleSetName}", url.PathEscape(virtualMachineScaleSetName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Expand != nil { - reqQP.Set("$expand", *options.Expand) - } - if options != nil && options.Filter != nil { - reqQP.Set("$filter", *options.Filter) - } - if options != nil && options.Select != nil { - reqQP.Set("$select", *options.Select) - } - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualMachineScaleSetVMsClient) listHandleResponse(resp *http.Response) (VirtualMachineScaleSetVMsClientListResponse, error) { - result := VirtualMachineScaleSetVMsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetVMListResult); err != nil { - return VirtualMachineScaleSetVMsClientListResponse{}, err - } - return result, nil -} - -// BeginPerformMaintenance - Performs maintenance on a virtual machine in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - options - VirtualMachineScaleSetVMsClientBeginPerformMaintenanceOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginPerformMaintenance -// method. -func (client *VirtualMachineScaleSetVMsClient) BeginPerformMaintenance(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginPerformMaintenanceOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientPerformMaintenanceResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.performMaintenance(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMsClientPerformMaintenanceResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMsClientPerformMaintenanceResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// PerformMaintenance - Performs maintenance on a virtual machine in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetVMsClient) performMaintenance(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginPerformMaintenanceOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetVMsClient.BeginPerformMaintenance" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.performMaintenanceCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// performMaintenanceCreateRequest creates the PerformMaintenance request. -func (client *VirtualMachineScaleSetVMsClient) performMaintenanceCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginPerformMaintenanceOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/performMaintenance" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginPowerOff - Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are -// getting charged for the resources. Instead, use deallocate to release resources and avoid -// charges. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - options - VirtualMachineScaleSetVMsClientBeginPowerOffOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginPowerOff -// method. -func (client *VirtualMachineScaleSetVMsClient) BeginPowerOff(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginPowerOffOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientPowerOffResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.powerOff(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMsClientPowerOffResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMsClientPowerOffResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// PowerOff - Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting -// charged for the resources. Instead, use deallocate to release resources and avoid -// charges. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetVMsClient) powerOff(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginPowerOffOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetVMsClient.BeginPowerOff" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.powerOffCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// powerOffCreateRequest creates the PowerOff request. -func (client *VirtualMachineScaleSetVMsClient) powerOffCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginPowerOffOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - if options != nil && options.SkipShutdown != nil { - reqQP.Set("skipShutdown", strconv.FormatBool(*options.SkipShutdown)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginRedeploy - Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it -// back on. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - options - VirtualMachineScaleSetVMsClientBeginRedeployOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginRedeploy -// method. -func (client *VirtualMachineScaleSetVMsClient) BeginRedeploy(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginRedeployOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientRedeployResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.redeploy(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMsClientRedeployResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMsClientRedeployResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Redeploy - Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back -// on. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetVMsClient) redeploy(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginRedeployOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetVMsClient.BeginRedeploy" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.redeployCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// redeployCreateRequest creates the Redeploy request. -func (client *VirtualMachineScaleSetVMsClient) redeployCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginRedeployOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/redeploy" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginReimage - Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - options - VirtualMachineScaleSetVMsClientBeginReimageOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginReimage -// method. -func (client *VirtualMachineScaleSetVMsClient) BeginReimage(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginReimageOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientReimageResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.reimage(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMsClientReimageResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMsClientReimageResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Reimage - Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetVMsClient) reimage(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginReimageOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetVMsClient.BeginReimage" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.reimageCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// reimageCreateRequest creates the Reimage request. -func (client *VirtualMachineScaleSetVMsClient) reimageCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginReimageOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/reimage" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.VMScaleSetVMReimageInput != nil { - if err := runtime.MarshalAsJSON(req, *options.VMScaleSetVMReimageInput); err != nil { - return nil, err - } - return req, nil - } - return req, nil -} - -// BeginReimageAll - Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation -// is only supported for managed disks. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - options - VirtualMachineScaleSetVMsClientBeginReimageAllOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginReimageAll -// method. -func (client *VirtualMachineScaleSetVMsClient) BeginReimageAll(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginReimageAllOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientReimageAllResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.reimageAll(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMsClientReimageAllResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMsClientReimageAllResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// ReimageAll - Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation -// is only supported for managed disks. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetVMsClient) reimageAll(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginReimageAllOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetVMsClient.BeginReimageAll" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.reimageAllCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// reimageAllCreateRequest creates the ReimageAll request. -func (client *VirtualMachineScaleSetVMsClient) reimageAllCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginReimageAllOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/reimageall" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginRestart - Restarts a virtual machine in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - options - VirtualMachineScaleSetVMsClientBeginRestartOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginRestart -// method. -func (client *VirtualMachineScaleSetVMsClient) BeginRestart(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginRestartOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientRestartResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.restart(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMsClientRestartResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMsClientRestartResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Restart - Restarts a virtual machine in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetVMsClient) restart(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginRestartOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetVMsClient.BeginRestart" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.restartCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// restartCreateRequest creates the Restart request. -func (client *VirtualMachineScaleSetVMsClient) restartCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginRestartOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// RetrieveBootDiagnosticsData - The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM -// scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - options - VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.RetrieveBootDiagnosticsData -// method. -func (client *VirtualMachineScaleSetVMsClient) RetrieveBootDiagnosticsData(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataOptions) (VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse, error) { - var err error - const operationName = "VirtualMachineScaleSetVMsClient.RetrieveBootDiagnosticsData" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.retrieveBootDiagnosticsDataCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse{}, err - } - resp, err := client.retrieveBootDiagnosticsDataHandleResponse(httpResp) - return resp, err -} - -// retrieveBootDiagnosticsDataCreateRequest creates the RetrieveBootDiagnosticsData request. -func (client *VirtualMachineScaleSetVMsClient) retrieveBootDiagnosticsDataCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/retrieveBootDiagnosticsData" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - if options != nil && options.SasURIExpirationTimeInMinutes != nil { - reqQP.Set("sasUriExpirationTimeInMinutes", strconv.FormatInt(int64(*options.SasURIExpirationTimeInMinutes), 10)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// retrieveBootDiagnosticsDataHandleResponse handles the RetrieveBootDiagnosticsData response. -func (client *VirtualMachineScaleSetVMsClient) retrieveBootDiagnosticsDataHandleResponse(resp *http.Response) (VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse, error) { - result := VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RetrieveBootDiagnosticsDataResult); err != nil { - return VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse{}, err - } - return result, nil -} - -// BeginRunCommand - Run command on a virtual machine in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - parameters - Parameters supplied to the Run command operation. -// - options - VirtualMachineScaleSetVMsClientBeginRunCommandOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginRunCommand -// method. -func (client *VirtualMachineScaleSetVMsClient) BeginRunCommand(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, parameters RunCommandInput, options *VirtualMachineScaleSetVMsClientBeginRunCommandOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientRunCommandResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.runCommand(ctx, resourceGroupName, vmScaleSetName, instanceID, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMsClientRunCommandResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMsClientRunCommandResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// RunCommand - Run command on a virtual machine in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetVMsClient) runCommand(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, parameters RunCommandInput, options *VirtualMachineScaleSetVMsClientBeginRunCommandOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetVMsClient.BeginRunCommand" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.runCommandCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// runCommandCreateRequest creates the RunCommand request. -func (client *VirtualMachineScaleSetVMsClient) runCommandCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, parameters RunCommandInput, options *VirtualMachineScaleSetVMsClientBeginRunCommandOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/runCommand" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json, text/json"} - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} - -// SimulateEviction - The operation to simulate the eviction of spot virtual machine in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - options - VirtualMachineScaleSetVMsClientSimulateEvictionOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.SimulateEviction -// method. -func (client *VirtualMachineScaleSetVMsClient) SimulateEviction(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientSimulateEvictionOptions) (VirtualMachineScaleSetVMsClientSimulateEvictionResponse, error) { - var err error - const operationName = "VirtualMachineScaleSetVMsClient.SimulateEviction" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.simulateEvictionCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return VirtualMachineScaleSetVMsClientSimulateEvictionResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineScaleSetVMsClientSimulateEvictionResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return VirtualMachineScaleSetVMsClientSimulateEvictionResponse{}, err - } - return VirtualMachineScaleSetVMsClientSimulateEvictionResponse{}, nil -} - -// simulateEvictionCreateRequest creates the SimulateEviction request. -func (client *VirtualMachineScaleSetVMsClient) simulateEvictionCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientSimulateEvictionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/simulateEviction" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginStart - Starts a virtual machine in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set. -// - instanceID - The instance ID of the virtual machine. -// - options - VirtualMachineScaleSetVMsClientBeginStartOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginStart -// method. -func (client *VirtualMachineScaleSetVMsClient) BeginStart(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginStartOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientStartResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.start(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMsClientStartResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMsClientStartResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Start - Starts a virtual machine in a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetVMsClient) start(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginStartOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetVMsClient.BeginStart" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.startCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// startCreateRequest creates the Start request. -func (client *VirtualMachineScaleSetVMsClient) startCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginStartOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginUpdate - Updates a virtual machine of a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -// - resourceGroupName - The name of the resource group. -// - vmScaleSetName - The name of the VM scale set where the extension should be create or updated. -// - instanceID - The instance ID of the virtual machine. -// - parameters - Parameters supplied to the Update Virtual Machine Scale Sets VM operation. -// - options - VirtualMachineScaleSetVMsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginUpdate -// method. -func (client *VirtualMachineScaleSetVMsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, parameters VirtualMachineScaleSetVM, options *VirtualMachineScaleSetVMsClientBeginUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, vmScaleSetName, instanceID, parameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Updates a virtual machine of a VM scale set. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-01 -func (client *VirtualMachineScaleSetVMsClient) update(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, parameters VirtualMachineScaleSetVM, options *VirtualMachineScaleSetVMsClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "VirtualMachineScaleSetVMsClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, parameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *VirtualMachineScaleSetVMsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, parameters VirtualMachineScaleSetVM, options *VirtualMachineScaleSetVMsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if vmScaleSetName == "" { - return nil, errors.New("parameter vmScaleSetName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName)) - if instanceID == "" { - return nil, errors.New("parameter instanceID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.IfMatch != nil { - req.Raw().Header["If-Match"] = []string{*options.IfMatch} - } - if options != nil && options.IfNoneMatch != nil { - req.Raw().Header["If-None-Match"] = []string{*options.IfNoneMatch} - } - if err := runtime.MarshalAsJSON(req, parameters); err != nil { - return nil, err - } - return req, nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinesizes_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinesizes_client.go deleted file mode 100644 index 80a7316acd1..00000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinesizes_client.go +++ /dev/null @@ -1,106 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VirtualMachineSizesClient contains the methods for the VirtualMachineSizes group. -// Don't use this type directly, use NewVirtualMachineSizesClient() instead. -type VirtualMachineSizesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewVirtualMachineSizesClient creates a new instance of VirtualMachineSizesClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewVirtualMachineSizesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineSizesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &VirtualMachineSizesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// NewListPager - This API is deprecated. Use Resources Skus [https://docs.microsoft.com/rest/api/compute/resourceskus/list] -// -// Generated from API version 2024-03-01 -// - location - The location upon which virtual-machine-sizes is queried. -// - options - VirtualMachineSizesClientListOptions contains the optional parameters for the VirtualMachineSizesClient.NewListPager -// method. -func (client *VirtualMachineSizesClient) NewListPager(location string, options *VirtualMachineSizesClientListOptions) *runtime.Pager[VirtualMachineSizesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VirtualMachineSizesClientListResponse]{ - More: func(page VirtualMachineSizesClientListResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *VirtualMachineSizesClientListResponse) (VirtualMachineSizesClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachineSizesClient.NewListPager") - req, err := client.listCreateRequest(ctx, location, options) - if err != nil { - return VirtualMachineSizesClientListResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return VirtualMachineSizesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachineSizesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *VirtualMachineSizesClient) listCreateRequest(ctx context.Context, location string, options *VirtualMachineSizesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/vmSizes" - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VirtualMachineSizesClient) listHandleResponse(resp *http.Response) (VirtualMachineSizesClientListResponse, error) { - result := VirtualMachineSizesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineSizeListResult); err != nil { - return VirtualMachineSizesClientListResponse{}, err - } - return result, nil -} diff --git a/vendor/github.com/Azure/go-ansiterm/osc_string_state.go b/vendor/github.com/Azure/go-ansiterm/osc_string_state.go index 593b10ab696..194d5e9c94d 100644 --- a/vendor/github.com/Azure/go-ansiterm/osc_string_state.go +++ b/vendor/github.com/Azure/go-ansiterm/osc_string_state.go @@ -11,21 +11,13 @@ func (oscState oscStringState) Handle(b byte) (s state, e error) { return nextState, err } - switch { - case isOscStringTerminator(b): + // There are several control characters and sequences which can + // terminate an OSC string. Most of them are handled by the baseState + // handler. The ANSI_BEL character is a special case which behaves as a + // terminator only for an OSC string. + if b == ANSI_BEL { return oscState.parser.ground, nil } return oscState, nil } - -// See below for OSC string terminators for linux -// http://man7.org/linux/man-pages/man4/console_codes.4.html -func isOscStringTerminator(b byte) bool { - - if b == ANSI_BEL || b == 0x5C { - return true - } - - return false -} diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential/confidential.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential/confidential.go index 549d68ab991..29c004320d6 100644 --- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential/confidential.go +++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential/confidential.go @@ -596,6 +596,11 @@ func (cca Client) AcquireTokenSilent(ctx context.Context, scopes []string, opts return AuthResult{}, errors.New("call another AcquireToken method to request a new token having these claims") } + // For service principal scenarios, require WithSilentAccount for public API + if o.account.IsZero() { + return AuthResult{}, errors.New("WithSilentAccount option is required") + } + silentParameters := base.AcquireTokenSilentParameters{ Scopes: scopes, Account: o.account, @@ -604,8 +609,15 @@ func (cca Client) AcquireTokenSilent(ctx context.Context, scopes []string, opts IsAppCache: o.account.IsZero(), TenantID: o.tenantID, AuthnScheme: o.authnScheme, + Claims: o.claims, } + return cca.acquireTokenSilentInternal(ctx, silentParameters) +} + +// acquireTokenSilentInternal is the internal implementation shared by AcquireTokenSilent and AcquireTokenByCredential +func (cca Client) acquireTokenSilentInternal(ctx context.Context, silentParameters base.AcquireTokenSilentParameters) (AuthResult, error) { + return cca.base.AcquireTokenSilent(ctx, silentParameters) } @@ -708,8 +720,10 @@ func (cca Client) AcquireTokenByAuthCode(ctx context.Context, code string, redir // acquireTokenByCredentialOptions contains optional configuration for AcquireTokenByCredential type acquireTokenByCredentialOptions struct { - claims, tenantID string - authnScheme AuthenticationScheme + claims, tenantID string + authnScheme AuthenticationScheme + extraBodyParameters map[string]string + cacheKeyComponents map[string]string } // AcquireByCredentialOption is implemented by options for AcquireTokenByCredential @@ -719,7 +733,7 @@ type AcquireByCredentialOption interface { // AcquireTokenByCredential acquires a security token from the authority, using the client credentials grant. // -// Options: [WithClaims], [WithTenantID] +// Options: [WithClaims], [WithTenantID], [WithFMIPath], [WithAttribute] func (cca Client) AcquireTokenByCredential(ctx context.Context, scopes []string, opts ...AcquireByCredentialOption) (AuthResult, error) { o := acquireTokenByCredentialOptions{} err := options.ApplyOptions(&o, opts) @@ -736,6 +750,29 @@ func (cca Client) AcquireTokenByCredential(ctx context.Context, scopes []string, if o.authnScheme != nil { authParams.AuthnScheme = o.authnScheme } + authParams.ExtraBodyParameters = o.extraBodyParameters + authParams.CacheKeyComponents = o.cacheKeyComponents + if o.claims == "" { + silentParameters := base.AcquireTokenSilentParameters{ + Scopes: scopes, + Account: Account{}, // empty account for app token + RequestType: accesstokens.ATConfidential, + Credential: cca.cred, + IsAppCache: true, + TenantID: o.tenantID, + AuthnScheme: o.authnScheme, + Claims: o.claims, + ExtraBodyParameters: o.extraBodyParameters, + CacheKeyComponents: o.cacheKeyComponents, + } + + // Use internal method with empty account (service principal scenario) + cache, err := cca.acquireTokenSilentInternal(ctx, silentParameters) + if err == nil { + return cache, nil + } + } + token, err := cca.base.Token.Credential(ctx, authParams, cca.cred) if err != nil { return AuthResult{}, err @@ -781,3 +818,63 @@ func (cca Client) Account(ctx context.Context, accountID string) (Account, error func (cca Client) RemoveAccount(ctx context.Context, account Account) error { return cca.base.RemoveAccount(ctx, account) } + +// WithFMIPath specifies the path to a federated managed identity. +// The path should point to a valid FMI configuration file that contains the necessary +// identity information for authentication. +func WithFMIPath(path string) interface { + AcquireByCredentialOption + options.CallOption +} { + return struct { + AcquireByCredentialOption + options.CallOption + }{ + CallOption: options.NewCallOption( + func(a any) error { + switch t := a.(type) { + case *acquireTokenByCredentialOptions: + if t.extraBodyParameters == nil { + t.extraBodyParameters = make(map[string]string) + } + if t.cacheKeyComponents == nil { + t.cacheKeyComponents = make(map[string]string) + } + t.cacheKeyComponents["fmi_path"] = path + t.extraBodyParameters["fmi_path"] = path + default: + return fmt.Errorf("unexpected options type %T", a) + } + return nil + }, + ), + } +} + +// WithAttribute specifies an identity attribute to include in the token request. +// The attribute is sent as "attributes" in the request body and returned as "xmc_attr" +// in the access token claims. This is sometimes used withFMIPath +func WithAttribute(attrValue string) interface { + AcquireByCredentialOption + options.CallOption +} { + return struct { + AcquireByCredentialOption + options.CallOption + }{ + CallOption: options.NewCallOption( + func(a any) error { + switch t := a.(type) { + case *acquireTokenByCredentialOptions: + if t.extraBodyParameters == nil { + t.extraBodyParameters = make(map[string]string) + } + t.extraBodyParameters["attributes"] = attrValue + default: + return fmt.Errorf("unexpected options type %T", a) + } + return nil + }, + ), + } +} diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/base.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/base.go index 61c1c4cec1e..abf54f7e509 100644 --- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/base.go +++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/base.go @@ -46,16 +46,18 @@ type accountManager interface { // AcquireTokenSilentParameters contains the parameters to acquire a token silently (from cache). type AcquireTokenSilentParameters struct { - Scopes []string - Account shared.Account - RequestType accesstokens.AppType - Credential *accesstokens.Credential - IsAppCache bool - TenantID string - UserAssertion string - AuthorizationType authority.AuthorizeType - Claims string - AuthnScheme authority.AuthenticationScheme + Scopes []string + Account shared.Account + RequestType accesstokens.AppType + Credential *accesstokens.Credential + IsAppCache bool + TenantID string + UserAssertion string + AuthorizationType authority.AuthorizeType + Claims string + AuthnScheme authority.AuthenticationScheme + ExtraBodyParameters map[string]string + CacheKeyComponents map[string]string } // AcquireTokenAuthCodeParameters contains the parameters required to acquire an access token using the auth code flow. @@ -327,7 +329,12 @@ func (b Client) AcquireTokenSilent(ctx context.Context, silent AcquireTokenSilen if silent.AuthnScheme != nil { authParams.AuthnScheme = silent.AuthnScheme } - + if silent.CacheKeyComponents != nil { + authParams.CacheKeyComponents = silent.CacheKeyComponents + } + if silent.ExtraBodyParameters != nil { + authParams.ExtraBodyParameters = silent.ExtraBodyParameters + } m := b.pmanager if authParams.AuthorizationType != authority.ATOnBehalfOf { authParams.AuthorizationType = authority.ATRefreshToken @@ -367,8 +374,19 @@ func (b Client) AcquireTokenSilent(ctx context.Context, silent AcquireTokenSilen // If the token is not same, we don't need to refresh it. // Which means it refreshed. if str, err := m.Read(ctx, authParams); err == nil && str.AccessToken.Secret == ar.AccessToken { - if tr, er := b.Token.Credential(ctx, authParams, silent.Credential); er == nil { - return b.AuthResultFromToken(ctx, authParams, tr) + switch silent.RequestType { + case accesstokens.ATConfidential: + if tr, er := b.Token.Credential(ctx, authParams, silent.Credential); er == nil { + return b.AuthResultFromToken(ctx, authParams, tr) + } + case accesstokens.ATPublic: + token, err := b.Token.Refresh(ctx, silent.RequestType, authParams, silent.Credential, storageTokenResponse.RefreshToken) + if err != nil { + return ar, err + } + return b.AuthResultFromToken(ctx, authParams, token) + case accesstokens.ATUnknown: + return ar, errors.New("silent request type cannot be ATUnknown") } } } @@ -446,6 +464,9 @@ func (b Client) AcquireTokenOnBehalfOf(ctx context.Context, onBehalfOfParams Acq authParams.Claims = onBehalfOfParams.Claims authParams.Scopes = onBehalfOfParams.Scopes authParams.UserAssertion = onBehalfOfParams.UserAssertion + if authParams.ExtraBodyParameters != nil { + authParams.ExtraBodyParameters = silentParameters.ExtraBodyParameters + } token, err := b.Token.OnBehalfOf(ctx, authParams, onBehalfOfParams.Credential) if err == nil { ar, err = b.AuthResultFromToken(ctx, authParams, token) diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/storage/items.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/storage/items.go index 7379e2233c8..b7d1a670b1e 100644 --- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/storage/items.go +++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/storage/items.go @@ -79,6 +79,7 @@ type AccessToken struct { UserAssertionHash string `json:"user_assertion_hash,omitempty"` TokenType string `json:"token_type,omitempty"` AuthnSchemeKeyID string `json:"keyid,omitempty"` + ExtCacheKey string `json:"ext_cache_key,omitempty"` AdditionalFields map[string]interface{} } @@ -105,15 +106,21 @@ func NewAccessToken(homeID, env, realm, clientID string, cachedAt, refreshOn, ex // Key outputs the key that can be used to uniquely look up this entry in a map. func (a AccessToken) Key() string { ks := []string{a.HomeAccountID, a.Environment, a.CredentialType, a.ClientID, a.Realm, a.Scopes} - key := strings.Join( - ks, - shared.CacheKeySeparator, - ) + // add token type to key for new access tokens types. skip for bearer token type to // preserve fwd and back compat between a common cache and msal clients if !strings.EqualFold(a.TokenType, authority.AccessTokenTypeBearer) { - key = strings.Join([]string{key, a.TokenType}, shared.CacheKeySeparator) + ks = append(ks, a.TokenType) } + // add extra body param hash to key if present + if a.ExtCacheKey != "" { + ks[2] = "atext" // if the there is extra cache we add "atext" to the key replacing accesstoken + ks = append(ks, a.ExtCacheKey) + } + key := strings.Join( + ks, + shared.CacheKeySeparator, + ) return strings.ToLower(key) } diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/storage/storage.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/storage/storage.go index 84a234967ff..825d8a0f660 100644 --- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/storage/storage.go +++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/storage/storage.go @@ -135,7 +135,8 @@ func (m *Manager) Read(ctx context.Context, authParameters authority.AuthParams) aliases = metadata.Aliases } - accessToken := m.readAccessToken(homeAccountID, aliases, realm, clientID, scopes, tokenType, authnSchemeKeyID) + accessToken := m.readAccessToken(homeAccountID, aliases, realm, clientID, scopes, tokenType, authnSchemeKeyID, authParameters.CacheExtKeyGenerator()) + tr.AccessToken = accessToken if homeAccountID == "" { @@ -203,6 +204,7 @@ func (m *Manager) Write(authParameters authority.AuthParams, tokenResponse acces authnSchemeKeyID, ) + accessToken.ExtCacheKey = authParameters.CacheExtKeyGenerator() // Since we have a valid access token, cache it before moving on. if err := accessToken.Validate(); err == nil { if err := m.writeAccessToken(accessToken); err != nil { @@ -291,26 +293,49 @@ func (m *Manager) aadMetadata(ctx context.Context, authorityInfo authority.Info) return m.aadCache[authorityInfo.Host], nil } -func (m *Manager) readAccessToken(homeID string, envAliases []string, realm, clientID string, scopes []string, tokenType, authnSchemeKeyID string) AccessToken { +func (m *Manager) readAccessToken(homeID string, envAliases []string, realm, clientID string, scopes []string, tokenType, authnSchemeKeyID, extCacheKey string) AccessToken { m.contractMu.RLock() - // TODO: linear search (over a map no less) is slow for a large number (thousands) of tokens. - // this shows up as the dominating node in a profile. for real-world scenarios this likely isn't - // an issue, however if it does become a problem then we know where to look. - for k, at := range m.contract.AccessTokens { + + tokensToSearch := m.contract.AccessTokens + + for k, at := range tokensToSearch { + // TODO: linear search (over a map no less) is slow for a large number (thousands) of tokens. + // this shows up as the dominating node in a profile. for real-world scenarios this likely isn't + // an issue, however if it does become a problem then we know where to look. if at.HomeAccountID == homeID && at.Realm == realm && at.ClientID == clientID { - if (strings.EqualFold(at.TokenType, tokenType) && at.AuthnSchemeKeyID == authnSchemeKeyID) || (at.TokenType == "" && (tokenType == "" || tokenType == "Bearer")) { - if checkAlias(at.Environment, envAliases) && isMatchingScopes(scopes, at.Scopes) { - m.contractMu.RUnlock() - if needsUpgrade(k) { - m.contractMu.Lock() - defer m.contractMu.Unlock() - at = upgrade(m.contract.AccessTokens, k) + // Match token type and authentication scheme + tokenTypeMatch := (strings.EqualFold(at.TokenType, tokenType) && at.AuthnSchemeKeyID == authnSchemeKeyID) || + (at.TokenType == "" && (tokenType == "" || tokenType == "Bearer")) + environmentAndScopesMatch := checkAlias(at.Environment, envAliases) && isMatchingScopes(scopes, at.Scopes) + + if tokenTypeMatch && environmentAndScopesMatch { + // For hashed tokens, check that the key contains the hash + if extCacheKey != "" { + if !strings.Contains(k, extCacheKey) { + continue // Skip this token if the key doesn't contain the hash + } + } else { + // If no extCacheKey is provided, only match tokens that also have no extCacheKey + if at.ExtCacheKey != "" { + continue // Skip tokens that require a hash when no hash is provided } + } + // Handle token upgrade if needed + if needsUpgrade(k) { + m.contractMu.RUnlock() + m.contractMu.Lock() + at = upgrade(tokensToSearch, k) + m.contractMu.Unlock() return at } + + m.contractMu.RUnlock() + return at } } } + + // No token found, unlock and return empty token m.contractMu.RUnlock() return AccessToken{} } diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens/accesstokens.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens/accesstokens.go index d738c7591ee..481f9e43411 100644 --- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens/accesstokens.go +++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens/accesstokens.go @@ -281,6 +281,9 @@ func (c Client) FromClientSecret(ctx context.Context, authParameters authority.A qv.Set(clientID, authParameters.ClientID) addScopeQueryParam(qv, authParameters) + // Add extra body parameters if provided + addExtraBodyParameters(ctx, qv, authParameters) + return c.doTokenResp(ctx, authParameters, qv) } @@ -296,6 +299,9 @@ func (c Client) FromAssertion(ctx context.Context, authParameters authority.Auth qv.Set(clientInfo, clientInfoVal) addScopeQueryParam(qv, authParameters) + // Add extra body parameters if provided + addExtraBodyParameters(ctx, qv, authParameters) + return c.doTokenResp(ctx, authParameters, qv) } @@ -329,6 +335,8 @@ func (c Client) FromUserAssertionClientCertificate(ctx context.Context, authPara qv.Set("requested_token_use", "on_behalf_of") addScopeQueryParam(qv, authParameters) + // Add extra body parameters if provided + addExtraBodyParameters(ctx, qv, authParameters) return c.doTokenResp(ctx, authParameters, qv) } @@ -466,3 +474,12 @@ func addScopeQueryParam(queryParams url.Values, authParameters authority.AuthPar scopes := AppendDefaultScopes(authParameters) queryParams.Set("scope", strings.Join(scopes, " ")) } + +// addExtraBodyParameters evaluates and adds extra body parameters to the request +func addExtraBodyParameters(ctx context.Context, v url.Values, ap authority.AuthParams) { + for key, value := range ap.ExtraBodyParameters { + if value != "" { + v.Set(key, value) + } + } +} diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority/authority.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority/authority.go index 3f403746404..debd465dbad 100644 --- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority/authority.go +++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority/authority.go @@ -15,6 +15,7 @@ import ( "net/url" "os" "path" + "sort" "strings" "time" @@ -47,6 +48,8 @@ type jsonCaller interface { } // For backward compatibility, accept both old and new China endpoints for a transition period. +// This list is derived from the AAD instance discovery metadata and represents all known trusted hosts +// across different Azure clouds (Public, China, Germany, US Government, etc.) var aadTrustedHostList = map[string]bool{ "login.windows.net": true, // Microsoft Azure Worldwide - Used in validation scenarios where host is not this list "login.partner.microsoftonline.cn": true, // Microsoft Azure China (new) @@ -55,6 +58,9 @@ var aadTrustedHostList = map[string]bool{ "login-us.microsoftonline.com": true, // Microsoft Azure US Government - Legacy "login.microsoftonline.us": true, // Microsoft Azure US Government "login.microsoftonline.com": true, // Microsoft Azure Worldwide + "login.microsoft.com": true, + "sts.windows.net": true, + "login.usgovcloudapi.net": true, } // TrustedHost checks if an AAD host is trusted/valid. @@ -103,36 +109,46 @@ func (r *TenantDiscoveryResponse) Validate() error { // ValidateIssuerMatchesAuthority validates that the issuer in the TenantDiscoveryResponse matches the authority. // This is used to identity security or configuration issues in authorities and the OIDC endpoint func (r *TenantDiscoveryResponse) ValidateIssuerMatchesAuthority(authorityURI string, aliases map[string]bool) error { - if authorityURI == "" { return errors.New("TenantDiscoveryResponse: empty authorityURI provided for validation") } + if r.Issuer == "" { + return errors.New("TenantDiscoveryResponse: empty issuer in response") + } - // Parse the issuer URL issuerURL, err := url.Parse(r.Issuer) if err != nil { return fmt.Errorf("TenantDiscoveryResponse: failed to parse issuer URL: %w", err) } + authorityURL, err := url.Parse(authorityURI) + if err != nil { + return fmt.Errorf("TenantDiscoveryResponse: failed to parse authority URL: %w", err) + } + + // Fast path: exact scheme + host match + if issuerURL.Scheme == authorityURL.Scheme && issuerURL.Host == authorityURL.Host { + return nil + } - // Even if it doesn't match the authority, issuers from known and trusted hosts are valid + // Alias-based acceptance if aliases != nil && aliases[issuerURL.Host] { return nil } - // Parse the authority URL for comparison - authorityURL, err := url.Parse(authorityURI) - if err != nil { - return fmt.Errorf("TenantDiscoveryResponse: failed to parse authority URL: %w", err) + issuerHost := issuerURL.Host + authorityHost := authorityURL.Host + + // Accept if issuer host is trusted + if TrustedHost(issuerHost) { + return nil } - // Check if the scheme and host match (paths can be ignored when validating the issuer) - if issuerURL.Scheme == authorityURL.Scheme && issuerURL.Host == authorityURL.Host { + // Accept if authority is a regional variant ending with "." + if strings.HasSuffix(authorityHost, "."+issuerHost) { return nil } - // If we get here, validation failed - return fmt.Errorf("TenantDiscoveryResponse: issuer from OIDC discovery '%s' does not match authority '%s' or a known pattern", - r.Issuer, authorityURI) + return fmt.Errorf("TenantDiscoveryResponse: issuer '%s' does not match authority '%s' or any trusted/alias rule", r.Issuer, authorityURI) } type InstanceDiscoveryMetadata struct { @@ -256,6 +272,12 @@ type AuthParams struct { DomainHint string // AuthnScheme is an optional scheme for formatting access tokens AuthnScheme AuthenticationScheme + // ExtraBodyParameters are additional parameters to include in token requests. + // The functions are evaluated at request time to get the parameter values. + // These parameters are also included in the cache key. + ExtraBodyParameters map[string]string + // CacheKeyComponents are additional components to include in the cache key. + CacheKeyComponents map[string]string } // NewAuthParams creates an authorization parameters object. @@ -642,8 +664,42 @@ func (a *AuthParams) AssertionHash() string { } func (a *AuthParams) AppKey() string { + baseKey := a.ClientID + "_" if a.AuthorityInfo.Tenant != "" { - return fmt.Sprintf("%s_%s_AppTokenCache", a.ClientID, a.AuthorityInfo.Tenant) + baseKey += a.AuthorityInfo.Tenant + } + + // Include extra body parameters in the cache key + paramHash := a.CacheExtKeyGenerator() + if paramHash != "" { + baseKey = fmt.Sprintf("%s_%s", baseKey, paramHash) + } + + return baseKey + "_AppTokenCache" +} + +// CacheExtKeyGenerator computes a hash of the Cache key components key and values +// to include in the cache key. This ensures tokens acquired with different +// parameters are cached separately. +func (a *AuthParams) CacheExtKeyGenerator() string { + if len(a.CacheKeyComponents) == 0 { + return "" + } + + // Sort keys to ensure consistent hashing + keys := make([]string, 0, len(a.CacheKeyComponents)) + for k := range a.CacheKeyComponents { + keys = append(keys, k) } - return fmt.Sprintf("%s__AppTokenCache", a.ClientID) + sort.Strings(keys) + + // Create a string by concatenating key+value pairs + keyStr := "" + for _, key := range keys { + // Append key followed by its value with no separator + keyStr += key + a.CacheKeyComponents[key] + } + + hash := sha256.Sum256([]byte(keyStr)) + return strings.ToLower(base64.RawURLEncoding.EncodeToString(hash[:])) } diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/public/public.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/public/public.go index 7beed26174e..797c086cb87 100644 --- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/public/public.go +++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/public/public.go @@ -368,9 +368,9 @@ type AcquireByUsernamePasswordOption interface { acquireByUsernamePasswordOption() } -// AcquireTokenByUsernamePassword acquires a security token from the authority, via Username/Password Authentication. -// NOTE: this flow is NOT recommended. +// Deprecated: This API will be removed in a future release. Use a more secure flow instead. Follow this migration guide: https://aka.ms/msal-ropc-migration // +// AcquireTokenByUsernamePassword acquires a security token from the authority, via Username/Password Authentication. // Options: [WithClaims], [WithTenantID] func (pca Client) AcquireTokenByUsernamePassword(ctx context.Context, scopes []string, username, password string, opts ...AcquireByUsernamePasswordOption) (AuthResult, error) { o := acquireTokenByUsernamePasswordOptions{} diff --git a/vendor/github.com/BurntSushi/toml/README.md b/vendor/github.com/BurntSushi/toml/README.md index 639e6c39983..1101d206d40 100644 --- a/vendor/github.com/BurntSushi/toml/README.md +++ b/vendor/github.com/BurntSushi/toml/README.md @@ -1,9 +1,9 @@ TOML stands for Tom's Obvious, Minimal Language. This Go package provides a reflection interface similar to Go's standard library `json` and `xml` packages. -Compatible with TOML version [v1.0.0](https://toml.io/en/v1.0.0). +Compatible with TOML version [v1.1.0](https://toml.io/en/v1.1.0). -Documentation: https://godocs.io/github.com/BurntSushi/toml +Documentation: https://pkg.go.dev/github.com/BurntSushi/toml See the [releases page](https://github.com/BurntSushi/toml/releases) for a changelog; this information is also in the git tag annotations (e.g. `git show diff --git a/vendor/github.com/BurntSushi/toml/decode.go b/vendor/github.com/BurntSushi/toml/decode.go index c05a0b7e564..ed884840fb4 100644 --- a/vendor/github.com/BurntSushi/toml/decode.go +++ b/vendor/github.com/BurntSushi/toml/decode.go @@ -196,6 +196,26 @@ func (md *MetaData) PrimitiveDecode(primValue Primitive, v any) error { return md.unify(primValue.undecoded, rvalue(v)) } +// markDecodedRecursive is a helper to mark any key under the given tmap as +// decoded, recursing as needed +func markDecodedRecursive(md *MetaData, tmap map[string]any) { + for key := range tmap { + md.decoded[md.context.add(key).String()] = struct{}{} + if tmap, ok := tmap[key].(map[string]any); ok { + md.context = append(md.context, key) + markDecodedRecursive(md, tmap) + md.context = md.context[0 : len(md.context)-1] + } + if tarr, ok := tmap[key].([]map[string]any); ok { + for _, elm := range tarr { + md.context = append(md.context, key) + markDecodedRecursive(md, elm) + md.context = md.context[0 : len(md.context)-1] + } + } + } +} + // unify performs a sort of type unification based on the structure of `rv`, // which is the client representation. // @@ -222,6 +242,16 @@ func (md *MetaData) unify(data any, rv reflect.Value) error { if err != nil { return md.parseErr(err) } + // Assume the Unmarshaler decoded everything, so mark all keys under + // this table as decoded. + if tmap, ok := data.(map[string]any); ok { + markDecodedRecursive(md, tmap) + } + if aot, ok := data.([]map[string]any); ok { + for _, tmap := range aot { + markDecodedRecursive(md, tmap) + } + } return nil } if v, ok := rvi.(encoding.TextUnmarshaler); ok { @@ -400,7 +430,7 @@ func (md *MetaData) unifyString(data any, rv reflect.Value) error { if i, ok := data.(int64); ok { rv.SetString(strconv.FormatInt(i, 10)) } else if f, ok := data.(float64); ok { - rv.SetString(strconv.FormatFloat(f, 'f', -1, 64)) + rv.SetString(strconv.FormatFloat(f, 'g', -1, 64)) } else { return md.badtype("string", data) } diff --git a/vendor/github.com/BurntSushi/toml/encode.go b/vendor/github.com/BurntSushi/toml/encode.go index 73366c0d9a9..bd7aa18655d 100644 --- a/vendor/github.com/BurntSushi/toml/encode.go +++ b/vendor/github.com/BurntSushi/toml/encode.go @@ -228,9 +228,9 @@ func (enc *Encoder) eElement(rv reflect.Value) { } switch v.Location() { default: - enc.wf(v.Format(format)) + enc.write(v.Format(format)) case internal.LocalDatetime, internal.LocalDate, internal.LocalTime: - enc.wf(v.In(time.UTC).Format(format)) + enc.write(v.In(time.UTC).Format(format)) } return case Marshaler: @@ -279,40 +279,40 @@ func (enc *Encoder) eElement(rv reflect.Value) { case reflect.String: enc.writeQuoted(rv.String()) case reflect.Bool: - enc.wf(strconv.FormatBool(rv.Bool())) + enc.write(strconv.FormatBool(rv.Bool())) case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - enc.wf(strconv.FormatInt(rv.Int(), 10)) + enc.write(strconv.FormatInt(rv.Int(), 10)) case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - enc.wf(strconv.FormatUint(rv.Uint(), 10)) + enc.write(strconv.FormatUint(rv.Uint(), 10)) case reflect.Float32: f := rv.Float() if math.IsNaN(f) { if math.Signbit(f) { - enc.wf("-") + enc.write("-") } - enc.wf("nan") + enc.write("nan") } else if math.IsInf(f, 0) { if math.Signbit(f) { - enc.wf("-") + enc.write("-") } - enc.wf("inf") + enc.write("inf") } else { - enc.wf(floatAddDecimal(strconv.FormatFloat(f, 'f', -1, 32))) + enc.write(floatAddDecimal(strconv.FormatFloat(f, 'g', -1, 32))) } case reflect.Float64: f := rv.Float() if math.IsNaN(f) { if math.Signbit(f) { - enc.wf("-") + enc.write("-") } - enc.wf("nan") + enc.write("nan") } else if math.IsInf(f, 0) { if math.Signbit(f) { - enc.wf("-") + enc.write("-") } - enc.wf("inf") + enc.write("inf") } else { - enc.wf(floatAddDecimal(strconv.FormatFloat(f, 'f', -1, 64))) + enc.write(floatAddDecimal(strconv.FormatFloat(f, 'g', -1, 64))) } case reflect.Array, reflect.Slice: enc.eArrayOrSliceElement(rv) @@ -330,27 +330,32 @@ func (enc *Encoder) eElement(rv reflect.Value) { // By the TOML spec, all floats must have a decimal with at least one number on // either side. func floatAddDecimal(fstr string) string { - if !strings.Contains(fstr, ".") { - return fstr + ".0" + for _, c := range fstr { + if c == 'e' { // Exponent syntax + return fstr + } + if c == '.' { + return fstr + } } - return fstr + return fstr + ".0" } func (enc *Encoder) writeQuoted(s string) { - enc.wf("\"%s\"", dblQuotedReplacer.Replace(s)) + enc.write(`"` + dblQuotedReplacer.Replace(s) + `"`) } func (enc *Encoder) eArrayOrSliceElement(rv reflect.Value) { length := rv.Len() - enc.wf("[") + enc.write("[") for i := 0; i < length; i++ { elem := eindirect(rv.Index(i)) enc.eElement(elem) if i != length-1 { - enc.wf(", ") + enc.write(", ") } } - enc.wf("]") + enc.write("]") } func (enc *Encoder) eArrayOfTables(key Key, rv reflect.Value) { @@ -363,7 +368,7 @@ func (enc *Encoder) eArrayOfTables(key Key, rv reflect.Value) { continue } enc.newline() - enc.wf("%s[[%s]]", enc.indentStr(key), key) + enc.writef("%s[[%s]]", enc.indentStr(key), key) enc.newline() enc.eMapOrStruct(key, trv, false) } @@ -376,7 +381,7 @@ func (enc *Encoder) eTable(key Key, rv reflect.Value) { enc.newline() } if len(key) > 0 { - enc.wf("%s[%s]", enc.indentStr(key), key) + enc.writef("%s[%s]", enc.indentStr(key), key) enc.newline() } enc.eMapOrStruct(key, rv, false) @@ -402,47 +407,44 @@ func (enc *Encoder) eMap(key Key, rv reflect.Value, inline bool) { // Sort keys so that we have deterministic output. And write keys directly // underneath this key first, before writing sub-structs or sub-maps. - var mapKeysDirect, mapKeysSub []string + var mapKeysDirect, mapKeysSub []reflect.Value for _, mapKey := range rv.MapKeys() { - k := mapKey.String() if typeIsTable(tomlTypeOfGo(eindirect(rv.MapIndex(mapKey)))) { - mapKeysSub = append(mapKeysSub, k) + mapKeysSub = append(mapKeysSub, mapKey) } else { - mapKeysDirect = append(mapKeysDirect, k) + mapKeysDirect = append(mapKeysDirect, mapKey) } } - var writeMapKeys = func(mapKeys []string, trailC bool) { - sort.Strings(mapKeys) + writeMapKeys := func(mapKeys []reflect.Value, trailC bool) { + sort.Slice(mapKeys, func(i, j int) bool { return mapKeys[i].String() < mapKeys[j].String() }) for i, mapKey := range mapKeys { - val := eindirect(rv.MapIndex(reflect.ValueOf(mapKey))) + val := eindirect(rv.MapIndex(mapKey)) if isNil(val) { continue } if inline { - enc.writeKeyValue(Key{mapKey}, val, true) + enc.writeKeyValue(Key{mapKey.String()}, val, true) if trailC || i != len(mapKeys)-1 { - enc.wf(", ") + enc.write(", ") } } else { - enc.encode(key.add(mapKey), val) + enc.encode(key.add(mapKey.String()), val) } } } if inline { - enc.wf("{") + enc.write("{") } writeMapKeys(mapKeysDirect, len(mapKeysSub) > 0) writeMapKeys(mapKeysSub, false) if inline { - enc.wf("}") + enc.write("}") } } -const is32Bit = (32 << (^uint(0) >> 63)) == 32 - func pointerTo(t reflect.Type) reflect.Type { if t.Kind() == reflect.Ptr { return pointerTo(t.Elem()) @@ -477,15 +479,14 @@ func (enc *Encoder) eStruct(key Key, rv reflect.Value, inline bool) { frv := eindirect(rv.Field(i)) - if is32Bit { - // Copy so it works correct on 32bit archs; not clear why this - // is needed. See #314, and https://www.reddit.com/r/golang/comments/pnx8v4 - // This also works fine on 64bit, but 32bit archs are somewhat - // rare and this is a wee bit faster. - copyStart := make([]int, len(start)) - copy(copyStart, start) - start = copyStart - } + // Need to make a copy because ... ehm, I don't know why... I guess + // allocating a new array can cause it to fail(?) + // + // Done for: https://github.com/BurntSushi/toml/issues/430 + // Previously only on 32bit for: https://github.com/BurntSushi/toml/issues/314 + copyStart := make([]int, len(start)) + copy(copyStart, start) + start = copyStart // Treat anonymous struct fields with tag names as though they are // not anonymous, like encoding/json does. @@ -507,7 +508,7 @@ func (enc *Encoder) eStruct(key Key, rv reflect.Value, inline bool) { } addFields(rt, rv, nil) - writeFields := func(fields [][]int) { + writeFields := func(fields [][]int, totalFields int) { for _, fieldIndex := range fields { fieldType := rt.FieldByIndex(fieldIndex) fieldVal := rv.FieldByIndex(fieldIndex) @@ -537,8 +538,8 @@ func (enc *Encoder) eStruct(key Key, rv reflect.Value, inline bool) { if inline { enc.writeKeyValue(Key{keyName}, fieldVal, true) - if fieldIndex[0] != len(fields)-1 { - enc.wf(", ") + if fieldIndex[0] != totalFields-1 { + enc.write(", ") } } else { enc.encode(key.add(keyName), fieldVal) @@ -547,12 +548,14 @@ func (enc *Encoder) eStruct(key Key, rv reflect.Value, inline bool) { } if inline { - enc.wf("{") + enc.write("{") } - writeFields(fieldsDirect) - writeFields(fieldsSub) + + l := len(fieldsDirect) + len(fieldsSub) + writeFields(fieldsDirect, l) + writeFields(fieldsSub, l) if inline { - enc.wf("}") + enc.write("}") } } @@ -702,7 +705,7 @@ func isEmpty(rv reflect.Value) bool { func (enc *Encoder) newline() { if enc.hasWritten { - enc.wf("\n") + enc.write("\n") } } @@ -724,14 +727,22 @@ func (enc *Encoder) writeKeyValue(key Key, val reflect.Value, inline bool) { enc.eElement(val) return } - enc.wf("%s%s = ", enc.indentStr(key), key.maybeQuoted(len(key)-1)) + enc.writef("%s%s = ", enc.indentStr(key), key.maybeQuoted(len(key)-1)) enc.eElement(val) if !inline { enc.newline() } } -func (enc *Encoder) wf(format string, v ...any) { +func (enc *Encoder) write(s string) { + _, err := enc.w.WriteString(s) + if err != nil { + encPanic(err) + } + enc.hasWritten = true +} + +func (enc *Encoder) writef(format string, v ...any) { _, err := fmt.Fprintf(enc.w, format, v...) if err != nil { encPanic(err) diff --git a/vendor/github.com/BurntSushi/toml/error.go b/vendor/github.com/BurntSushi/toml/error.go index 1dd52321112..b7077d3ae33 100644 --- a/vendor/github.com/BurntSushi/toml/error.go +++ b/vendor/github.com/BurntSushi/toml/error.go @@ -69,7 +69,7 @@ type Position struct { Line int // Line number, starting at 1. Col int // Error column, starting at 1. Start int // Start of error, as byte offset starting at 0. - Len int // Lenght of the error in bytes. + Len int // Length of the error in bytes. } func (p Position) withCol(tomlFile string) Position { diff --git a/vendor/github.com/BurntSushi/toml/lex.go b/vendor/github.com/BurntSushi/toml/lex.go index 6878d9d698a..9f4396a0f75 100644 --- a/vendor/github.com/BurntSushi/toml/lex.go +++ b/vendor/github.com/BurntSushi/toml/lex.go @@ -13,7 +13,6 @@ type itemType int const ( itemError itemType = iota - itemNIL // used in the parser to indicate no type itemEOF itemText itemString @@ -47,14 +46,13 @@ func (p Position) String() string { } type lexer struct { - input string - start int - pos int - line int - state stateFn - items chan item - tomlNext bool - esc bool + input string + start int + pos int + line int + state stateFn + items chan item + esc bool // Allow for backing up up to 4 runes. This is necessary because TOML // contains 3-rune tokens (""" and '''). @@ -90,14 +88,13 @@ func (lx *lexer) nextItem() item { } } -func lex(input string, tomlNext bool) *lexer { +func lex(input string) *lexer { lx := &lexer{ - input: input, - state: lexTop, - items: make(chan item, 10), - stack: make([]stateFn, 0, 10), - line: 1, - tomlNext: tomlNext, + input: input, + state: lexTop, + items: make(chan item, 10), + stack: make([]stateFn, 0, 10), + line: 1, } return lx } @@ -108,7 +105,7 @@ func (lx *lexer) push(state stateFn) { func (lx *lexer) pop() stateFn { if len(lx.stack) == 0 { - return lx.errorf("BUG in lexer: no states to pop") + panic("BUG in lexer: no states to pop") } last := lx.stack[len(lx.stack)-1] lx.stack = lx.stack[0 : len(lx.stack)-1] @@ -275,7 +272,9 @@ func (lx *lexer) errorPos(start, length int, err error) stateFn { func (lx *lexer) errorf(format string, values ...any) stateFn { if lx.atEOF { pos := lx.getPos() - pos.Line-- + if lx.pos >= 1 && lx.input[lx.pos-1] == '\n' { + pos.Line-- + } pos.Len = 1 pos.Start = lx.pos - 1 lx.items <- item{typ: itemError, pos: pos, err: fmt.Errorf(format, values...)} @@ -303,6 +302,8 @@ func lexTop(lx *lexer) stateFn { return lexTableStart case eof: if lx.pos > lx.start { + // TODO: never reached? I think this can only occur on a bug in the + // lexer(?) return lx.errorf("unexpected EOF") } lx.emit(itemEOF) @@ -390,8 +391,6 @@ func lexTableNameStart(lx *lexer) stateFn { func lexTableNameEnd(lx *lexer) stateFn { lx.skip(isWhitespace) switch r := lx.next(); { - case isWhitespace(r): - return lexTableNameEnd case r == '.': lx.ignore() return lexTableNameStart @@ -410,7 +409,7 @@ func lexTableNameEnd(lx *lexer) stateFn { // Lexes only one part, e.g. only 'a' inside 'a.b'. func lexBareName(lx *lexer) stateFn { r := lx.next() - if isBareKeyChar(r, lx.tomlNext) { + if isBareKeyChar(r) { return lexBareName } lx.backup() @@ -418,23 +417,23 @@ func lexBareName(lx *lexer) stateFn { return lx.pop() } -// lexBareName lexes one part of a key or table. -// -// It assumes that at least one valid character for the table has already been -// read. +// lexQuotedName lexes one part of a quoted key or table name. It assumes that +// it starts lexing at the quote itself (" or '). // // Lexes only one part, e.g. only '"a"' inside '"a".b'. func lexQuotedName(lx *lexer) stateFn { r := lx.next() switch { - case isWhitespace(r): - return lexSkip(lx, lexValue) case r == '"': lx.ignore() // ignore the '"' return lexString case r == '\'': lx.ignore() // ignore the "'" return lexRawString + + // TODO: I don't think any of the below conditions can ever be reached? + case isWhitespace(r): + return lexSkip(lx, lexValue) case r == eof: return lx.errorf("unexpected EOF; expected value") default: @@ -462,17 +461,19 @@ func lexKeyStart(lx *lexer) stateFn { func lexKeyNameStart(lx *lexer) stateFn { lx.skip(isWhitespace) switch r := lx.peek(); { - case r == '=' || r == eof: - return lx.errorf("unexpected '='") - case r == '.': - return lx.errorf("unexpected '.'") + default: + lx.push(lexKeyEnd) + return lexBareName case r == '"' || r == '\'': lx.ignore() lx.push(lexKeyEnd) return lexQuotedName - default: - lx.push(lexKeyEnd) - return lexBareName + + // TODO: I think these can never be reached? + case r == '=' || r == eof: + return lx.errorf("unexpected '='") + case r == '.': + return lx.errorf("unexpected '.'") } } @@ -483,7 +484,7 @@ func lexKeyEnd(lx *lexer) stateFn { switch r := lx.next(); { case isWhitespace(r): return lexSkip(lx, lexKeyEnd) - case r == eof: + case r == eof: // TODO: never reached return lx.errorf("unexpected EOF; expected key separator '='") case r == '.': lx.ignore() @@ -626,10 +627,7 @@ func lexInlineTableValue(lx *lexer) stateFn { case isWhitespace(r): return lexSkip(lx, lexInlineTableValue) case isNL(r): - if lx.tomlNext { - return lexSkip(lx, lexInlineTableValue) - } - return lx.errorPrevLine(errLexInlineTableNL{}) + return lexSkip(lx, lexInlineTableValue) case r == '#': lx.push(lexInlineTableValue) return lexCommentStart @@ -651,10 +649,7 @@ func lexInlineTableValueEnd(lx *lexer) stateFn { case isWhitespace(r): return lexSkip(lx, lexInlineTableValueEnd) case isNL(r): - if lx.tomlNext { - return lexSkip(lx, lexInlineTableValueEnd) - } - return lx.errorPrevLine(errLexInlineTableNL{}) + return lexSkip(lx, lexInlineTableValueEnd) case r == '#': lx.push(lexInlineTableValueEnd) return lexCommentStart @@ -662,10 +657,7 @@ func lexInlineTableValueEnd(lx *lexer) stateFn { lx.ignore() lx.skip(isWhitespace) if lx.peek() == '}' { - if lx.tomlNext { - return lexInlineTableValueEnd - } - return lx.errorf("trailing comma not allowed in inline tables") + return lexInlineTableValueEnd } return lexInlineTableValue case r == '}': @@ -853,9 +845,6 @@ func lexStringEscape(lx *lexer) stateFn { r := lx.next() switch r { case 'e': - if !lx.tomlNext { - return lx.error(errLexEscape{r}) - } fallthrough case 'b': fallthrough @@ -876,9 +865,6 @@ func lexStringEscape(lx *lexer) stateFn { case '\\': return lx.pop() case 'x': - if !lx.tomlNext { - return lx.error(errLexEscape{r}) - } return lexHexEscape case 'u': return lexShortUnicodeEscape @@ -926,19 +912,9 @@ func lexLongUnicodeEscape(lx *lexer) stateFn { // lexBaseNumberOrDate can differentiate base prefixed integers from other // types. func lexNumberOrDateStart(lx *lexer) stateFn { - r := lx.next() - switch r { - case '0': + if lx.next() == '0' { return lexBaseNumberOrDate } - - if !isDigit(r) { - // The only way to reach this state is if the value starts - // with a digit, so specifically treat anything else as an - // error. - return lx.errorf("expected a digit but got %q", r) - } - return lexNumberOrDate } @@ -1117,7 +1093,7 @@ func lexBaseNumberOrDate(lx *lexer) stateFn { case 'x': r = lx.peek() if !isHex(r) { - lx.errorf("not a hexidecimal number: '%s%c'", lx.current(), r) + lx.errorf("not a hexadecimal number: '%s%c'", lx.current(), r) } return lexHexInteger } @@ -1194,13 +1170,13 @@ func lexSkip(lx *lexer, nextState stateFn) stateFn { } func (s stateFn) String() string { + if s == nil { + return "" + } name := runtime.FuncForPC(reflect.ValueOf(s).Pointer()).Name() if i := strings.LastIndexByte(name, '.'); i > -1 { name = name[i+1:] } - if s == nil { - name = "" - } return name + "()" } @@ -1208,8 +1184,6 @@ func (itype itemType) String() string { switch itype { case itemError: return "Error" - case itemNIL: - return "NIL" case itemEOF: return "EOF" case itemText: @@ -1224,18 +1198,22 @@ func (itype itemType) String() string { return "Float" case itemDatetime: return "DateTime" + case itemArray: + return "Array" + case itemArrayEnd: + return "ArrayEnd" case itemTableStart: return "TableStart" case itemTableEnd: return "TableEnd" + case itemArrayTableStart: + return "ArrayTableStart" + case itemArrayTableEnd: + return "ArrayTableEnd" case itemKeyStart: return "KeyStart" case itemKeyEnd: return "KeyEnd" - case itemArray: - return "Array" - case itemArrayEnd: - return "ArrayEnd" case itemCommentStart: return "CommentStart" case itemInlineTableStart: @@ -1264,24 +1242,7 @@ func isDigit(r rune) bool { return r >= '0' && r <= '9' } func isBinary(r rune) bool { return r == '0' || r == '1' } func isOctal(r rune) bool { return r >= '0' && r <= '7' } func isHex(r rune) bool { return (r >= '0' && r <= '9') || (r|0x20 >= 'a' && r|0x20 <= 'f') } -func isBareKeyChar(r rune, tomlNext bool) bool { - if tomlNext { - return (r >= 'A' && r <= 'Z') || - (r >= 'a' && r <= 'z') || - (r >= '0' && r <= '9') || - r == '_' || r == '-' || - r == 0xb2 || r == 0xb3 || r == 0xb9 || (r >= 0xbc && r <= 0xbe) || - (r >= 0xc0 && r <= 0xd6) || (r >= 0xd8 && r <= 0xf6) || (r >= 0xf8 && r <= 0x037d) || - (r >= 0x037f && r <= 0x1fff) || - (r >= 0x200c && r <= 0x200d) || (r >= 0x203f && r <= 0x2040) || - (r >= 0x2070 && r <= 0x218f) || (r >= 0x2460 && r <= 0x24ff) || - (r >= 0x2c00 && r <= 0x2fef) || (r >= 0x3001 && r <= 0xd7ff) || - (r >= 0xf900 && r <= 0xfdcf) || (r >= 0xfdf0 && r <= 0xfffd) || - (r >= 0x10000 && r <= 0xeffff) - } - - return (r >= 'A' && r <= 'Z') || - (r >= 'a' && r <= 'z') || - (r >= '0' && r <= '9') || - r == '_' || r == '-' +func isBareKeyChar(r rune) bool { + return (r >= 'A' && r <= 'Z') || (r >= 'a' && r <= 'z') || + (r >= '0' && r <= '9') || r == '_' || r == '-' } diff --git a/vendor/github.com/BurntSushi/toml/meta.go b/vendor/github.com/BurntSushi/toml/meta.go index e6145373004..0d337026c19 100644 --- a/vendor/github.com/BurntSushi/toml/meta.go +++ b/vendor/github.com/BurntSushi/toml/meta.go @@ -135,9 +135,6 @@ func (k Key) maybeQuoted(i int) string { // Like append(), but only increase the cap by 1. func (k Key) add(piece string) Key { - if cap(k) > len(k) { - return append(k, piece) - } newKey := make(Key, len(k)+1) copy(newKey, k) newKey[len(k)] = piece diff --git a/vendor/github.com/BurntSushi/toml/parse.go b/vendor/github.com/BurntSushi/toml/parse.go index 3f2c090c86b..b474247ae2f 100644 --- a/vendor/github.com/BurntSushi/toml/parse.go +++ b/vendor/github.com/BurntSushi/toml/parse.go @@ -3,7 +3,6 @@ package toml import ( "fmt" "math" - "os" "strconv" "strings" "time" @@ -17,7 +16,6 @@ type parser struct { context Key // Full key for the current hash in scope. currentKey string // Base key name for everything except hashes. pos Position // Current position in the TOML file. - tomlNext bool ordered []Key // List of keys in the order that they appear in the TOML data. @@ -32,8 +30,6 @@ type keyInfo struct { } func parse(data string) (p *parser, err error) { - _, tomlNext := os.LookupEnv("BURNTSUSHI_TOML_110") - defer func() { if r := recover(); r != nil { if pErr, ok := r.(ParseError); ok { @@ -50,7 +46,6 @@ func parse(data string) (p *parser, err error) { // it anyway. if strings.HasPrefix(data, "\xff\xfe") || strings.HasPrefix(data, "\xfe\xff") { // UTF-16 data = data[2:] - //lint:ignore S1017 https://github.com/dominikh/go-tools/issues/1447 } else if strings.HasPrefix(data, "\xef\xbb\xbf") { // UTF-8 data = data[3:] } @@ -74,10 +69,9 @@ func parse(data string) (p *parser, err error) { p = &parser{ keyInfo: make(map[string]keyInfo), mapping: make(map[string]any), - lx: lex(data, tomlNext), + lx: lex(data), ordered: make([]Key, 0), implicits: make(map[string]struct{}), - tomlNext: tomlNext, } for { item := p.next() @@ -351,17 +345,14 @@ func (p *parser) valueFloat(it item) (any, tomlType) { var dtTypes = []struct { fmt string zone *time.Location - next bool }{ - {time.RFC3339Nano, time.Local, false}, - {"2006-01-02T15:04:05.999999999", internal.LocalDatetime, false}, - {"2006-01-02", internal.LocalDate, false}, - {"15:04:05.999999999", internal.LocalTime, false}, - - // tomlNext - {"2006-01-02T15:04Z07:00", time.Local, true}, - {"2006-01-02T15:04", internal.LocalDatetime, true}, - {"15:04", internal.LocalTime, true}, + {time.RFC3339Nano, time.Local}, + {"2006-01-02T15:04:05.999999999", internal.LocalDatetime}, + {"2006-01-02", internal.LocalDate}, + {"15:04:05.999999999", internal.LocalTime}, + {"2006-01-02T15:04Z07:00", time.Local}, + {"2006-01-02T15:04", internal.LocalDatetime}, + {"15:04", internal.LocalTime}, } func (p *parser) valueDatetime(it item) (any, tomlType) { @@ -372,9 +363,6 @@ func (p *parser) valueDatetime(it item) (any, tomlType) { err error ) for _, dt := range dtTypes { - if dt.next && !p.tomlNext { - continue - } t, err = time.ParseInLocation(dt.fmt, it.val, dt.zone) if err == nil { if missingLeadingZero(it.val, dt.fmt) { @@ -529,7 +517,7 @@ func numUnderscoresOK(s string) bool { } } - // isHexis a superset of all the permissable characters surrounding an + // isHex is a superset of all the permissible characters surrounding an // underscore. accept = isHex(r) } @@ -645,6 +633,11 @@ func (p *parser) setValue(key string, value any) { // Note that since it has already been defined (as a hash), we don't // want to overwrite it. So our business is done. if p.isArray(keyContext) { + if !p.isImplicit(keyContext) { + if _, ok := hash[key]; ok { + p.panicf("Key '%s' has already been defined.", keyContext) + } + } p.removeImplicit(keyContext) hash[key] = value return @@ -803,10 +796,8 @@ func (p *parser) replaceEscapes(it item, str string) string { b.WriteByte(0x0d) skip = 1 case 'e': - if p.tomlNext { - b.WriteByte(0x1b) - skip = 1 - } + b.WriteByte(0x1b) + skip = 1 case '"': b.WriteByte(0x22) skip = 1 @@ -816,11 +807,9 @@ func (p *parser) replaceEscapes(it item, str string) string { // The lexer guarantees the correct number of characters are present; // don't need to check here. case 'x': - if p.tomlNext { - escaped := p.asciiEscapeToUnicode(it, str[i+2:i+4]) - b.WriteRune(escaped) - skip = 3 - } + escaped := p.asciiEscapeToUnicode(it, str[i+2:i+4]) + b.WriteRune(escaped) + skip = 3 case 'u': escaped := p.asciiEscapeToUnicode(it, str[i+2:i+6]) b.WriteRune(escaped) diff --git a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/metric.go b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/metric.go index c69f43dbae9..6c4e8143eb4 100644 --- a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/metric.go +++ b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/metric.go @@ -595,10 +595,11 @@ func gaugeToTimeSeries[N int64 | float64](point metricdata.DataPoint[N], metrics return nil, err } return &monitoringpb.TimeSeries{ - Resource: mr, - Unit: string(metrics.Unit), - MetricKind: googlemetricpb.MetricDescriptor_GAUGE, - ValueType: valueType, + Resource: mr, + Unit: metrics.Unit, + Description: metrics.Description, + MetricKind: googlemetricpb.MetricDescriptor_GAUGE, + ValueType: valueType, Points: []*monitoringpb.Point{{ Interval: &monitoringpb.TimeInterval{ EndTime: timestamp, @@ -615,10 +616,11 @@ func sumToTimeSeries[N int64 | float64](point metricdata.DataPoint[N], metrics m } value, valueType := numberDataPointToValue[N](point) return &monitoringpb.TimeSeries{ - Resource: mr, - Unit: string(metrics.Unit), - MetricKind: googlemetricpb.MetricDescriptor_CUMULATIVE, - ValueType: valueType, + Resource: mr, + Unit: metrics.Unit, + Description: metrics.Description, + MetricKind: googlemetricpb.MetricDescriptor_CUMULATIVE, + ValueType: valueType, Points: []*monitoringpb.Point{{ Interval: interval, Value: value, @@ -639,10 +641,11 @@ func histogramToTimeSeries[N int64 | float64](point metricdata.HistogramDataPoin setSumOfSquaredDeviation(point, distributionValue) } return &monitoringpb.TimeSeries{ - Resource: mr, - Unit: string(metrics.Unit), - MetricKind: googlemetricpb.MetricDescriptor_CUMULATIVE, - ValueType: googlemetricpb.MetricDescriptor_DISTRIBUTION, + Resource: mr, + Unit: metrics.Unit, + Description: metrics.Description, + MetricKind: googlemetricpb.MetricDescriptor_CUMULATIVE, + ValueType: googlemetricpb.MetricDescriptor_DISTRIBUTION, Points: []*monitoringpb.Point{{ Interval: interval, Value: &monitoringpb.TypedValue{ @@ -662,10 +665,11 @@ func expHistogramToTimeSeries[N int64 | float64](point metricdata.ExponentialHis distributionValue := expHistToDistribution(point, projectID) // TODO: Implement "setSumOfSquaredDeviationExpHist" for parameter "enableSOSD" functionality. return &monitoringpb.TimeSeries{ - Resource: mr, - Unit: string(metrics.Unit), - MetricKind: googlemetricpb.MetricDescriptor_CUMULATIVE, - ValueType: googlemetricpb.MetricDescriptor_DISTRIBUTION, + Resource: mr, + Unit: metrics.Unit, + Description: metrics.Description, + MetricKind: googlemetricpb.MetricDescriptor_CUMULATIVE, + ValueType: googlemetricpb.MetricDescriptor_DISTRIBUTION, Points: []*monitoringpb.Point{{ Interval: interval, Value: &monitoringpb.TypedValue{ diff --git a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/option.go b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/option.go index 8f2927b110b..8aeb981c115 100644 --- a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/option.go +++ b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/option.go @@ -23,7 +23,7 @@ import ( "go.opentelemetry.io/otel/sdk/metric/metricdata" monitoring "cloud.google.com/go/monitoring/apiv3/v2" - semconv "go.opentelemetry.io/otel/semconv/v1.24.0" + semconv "go.opentelemetry.io/otel/semconv/v1.37.0" apioption "google.golang.org/api/option" ) diff --git a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/version.go b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/version.go index bee9d333286..4f525295ecc 100644 --- a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/version.go +++ b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/version.go @@ -17,5 +17,5 @@ package metric // Version is the current release version of the OpenTelemetry // Operations Metric Exporter in use. func Version() string { - return "0.53.0" + return "0.54.0" } diff --git a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping/resourcemapping.go b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping/resourcemapping.go index 510391b824a..65bd8f5545f 100644 --- a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping/resourcemapping.go +++ b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping/resourcemapping.go @@ -17,7 +17,7 @@ package resourcemapping import ( "strings" - semconv "go.opentelemetry.io/otel/semconv/v1.24.0" + semconv "go.opentelemetry.io/otel/semconv/v1.37.0" monitoredrespb "google.golang.org/genproto/googleapis/api/monitoredres" ) diff --git a/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-instance-networks.go b/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-instance-networks.go new file mode 100644 index 00000000000..f24834c41f8 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-instance-networks.go @@ -0,0 +1,57 @@ +package instance + +import ( + "context" + "fmt" + + "github.com/IBM-Cloud/power-go-client/helpers" + "github.com/IBM-Cloud/power-go-client/ibmpisession" + pvmclient "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances" + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// Instance-scoped networks under a PVM: +type IBMPIInstanceNetworksClient struct { + IBMPIClient +} + +func NewIBMPIInstanceNetworksClient(ctx context.Context, sess *ibmpisession.IBMPISession, cloudInstanceID string) *IBMPIInstanceNetworksClient { + return &IBMPIInstanceNetworksClient{*NewIBMPIClient(ctx, sess, cloudInstanceID)} +} + +// GetAll returns the wrapper that contains all networks on a PVM instance. +func (c *IBMPIInstanceNetworksClient) GetAll(pvmInstanceID string) (*models.PVMInstanceNetworks, error) { + params := pvmclient.NewPcloudPvminstancesNetworksGetallParams(). + WithContext(c.ctx). + WithTimeout(helpers.PIGetTimeOut). + WithCloudInstanceID(c.cloudInstanceID). + WithPvmInstanceID(pvmInstanceID) + + resp, err := c.session.Power.PCloudpVMInstances.PcloudPvminstancesNetworksGetall(params, c.session.AuthInfo(c.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to get networks for pvm instance %s: %w", pvmInstanceID, err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to get networks for pvm instance %s", pvmInstanceID) + } + return resp.Payload, nil +} + +// Get returns the wrapper for a specific network on a PVM instance. +func (c *IBMPIInstanceNetworksClient) Get(pvmInstanceID, networkID string) (*models.PVMInstanceNetworks, error) { + params := pvmclient.NewPcloudPvminstancesNetworksGetParams(). + WithContext(c.ctx). + WithTimeout(helpers.PIGetTimeOut). + WithCloudInstanceID(c.cloudInstanceID). + WithPvmInstanceID(pvmInstanceID). + WithNetworkID(networkID) + + resp, err := c.session.Power.PCloudpVMInstances.PcloudPvminstancesNetworksGet(params, c.session.AuthInfo(c.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to get network %s for pvm instance %s: %w", networkID, pvmInstanceID, err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to get network %s for pvm instance %s", networkID, pvmInstanceID) + } + return resp.Payload, nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-network-peers.go b/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-network-peers.go index a5593289e93..71fdc3670da 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-network-peers.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-network-peers.go @@ -27,14 +27,138 @@ func (f *IBMPINetworkPeerClient) GetNetworkPeers() (*models.NetworkPeers, error) if !f.session.IsOnPrem() { return nil, fmt.Errorf(helpers.NotOffPremSupported) } - params := network_peers.NewV1NetworkPeersListParams().WithContext(f.ctx). + params := network_peers.NewV1NetworkPeersGetallParams().WithContext(f.ctx). WithTimeout(helpers.PIGetTimeOut) - resp, err := f.session.Power.NetworkPeers.V1NetworkPeersList(params, f.session.AuthInfo(f.cloudInstanceID)) + resp, err := f.session.Power.NetworkPeers.V1NetworkPeersGetall(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { - return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Get Network Peers for cloud instance %s with error %w", f.cloudInstanceID, err)) + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Get network peers for cloud instance %s with error %w", f.cloudInstanceID, err)) } if resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("failed to Get Network Peers for cloud instance %s", f.cloudInstanceID) + return nil, fmt.Errorf("failed to Get network peers for cloud instance %s", f.cloudInstanceID) + } + return resp.Payload, nil +} + +// Delete a network peer +func (f *IBMPINetworkPeerClient) DeleteNetworkPeer(id string) error { + if !f.session.IsOnPrem() { + return fmt.Errorf(helpers.NotOffPremSupported) + } + params := network_peers.NewV1NetworkPeersIDDeleteParams().WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut).WithNetworkPeerID(id) + _, err := f.session.Power.NetworkPeers.V1NetworkPeersIDDelete(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Delete network peer %s for cloud instance %s with error %w", id, f.cloudInstanceID, err)) + } + return nil + +} + +// Get a network peer +func (f *IBMPINetworkPeerClient) GetNetworkPeer(id string) (*models.NetworkPeer, error) { + if !f.session.IsOnPrem() { + return nil, fmt.Errorf(helpers.NotOffPremSupported) + } + params := network_peers.NewV1NetworkPeersIDGetParams().WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut).WithNetworkPeerID(id) + resp, err := f.session.Power.NetworkPeers.V1NetworkPeersIDGet(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Get network peer %s for cloud instance %s with error %w", id, f.cloudInstanceID, err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to Get network peer %s for cloud instance %s", id, f.cloudInstanceID) + } + return resp.Payload, nil + +} + +// Update a network peer +func (f *IBMPINetworkPeerClient) UpdateNetworkPeer(id string, body *models.NetworkPeerUpdate) (*models.NetworkPeer, error) { + if !f.session.IsOnPrem() { + return nil, fmt.Errorf(helpers.NotOffPremSupported) + } + params := network_peers.NewV1NetworkPeersIDPutParams().WithContext(f.ctx).WithTimeout(helpers.PIUpdateTimeOut).WithNetworkPeerID(id).WithBody(body) + resp, err := f.session.Power.NetworkPeers.V1NetworkPeersIDPut(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Update network peer %s for cloud instance %s with error %w", id, f.cloudInstanceID, err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to Update network peer %s", id) + } + return resp.Payload, nil +} + +// Get all network peers interfaces +func (f *IBMPINetworkPeerClient) GetAllNetworkPeersInterfaces() (models.PeerInterfaces, error) { + if !f.session.IsOnPrem() { + return nil, fmt.Errorf(helpers.NotOffPremSupported) + } + params := network_peers.NewV1NetworkPeersInterfacesGetallParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut) + resp, err := f.session.Power.NetworkPeers.V1NetworkPeersInterfacesGetall(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Get network peers interfaces for cloud instance %s with error %w", f.cloudInstanceID, err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to Get network peers interfaces for cloud instance %s", f.cloudInstanceID) + } + return resp.Payload, nil +} + +// Create a network peer +func (f *IBMPINetworkPeerClient) CreateNetworkPeer(body *models.NetworkPeerCreate) (*models.NetworkPeer, error) { + if !f.session.IsOnPrem() { + return nil, fmt.Errorf(helpers.NotOffPremSupported) + } + params := network_peers.NewV1NetworkPeersPostParams().WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).WithBody(body) + resp, err := f.session.Power.NetworkPeers.V1NetworkPeersPost(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Create network peer for cloud instance %s with error %w", f.cloudInstanceID, err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to Create network peer for cloud instance %s", f.cloudInstanceID) + } + return resp.Payload, nil +} + +// Delete network peer's route filter +func (f *IBMPINetworkPeerClient) DeleteNetworkPeersRouteFilter(id, routeFilterID string) error { + if !f.session.IsOnPrem() { + return fmt.Errorf(helpers.NotOffPremSupported) + } + params := network_peers.NewV1NetworkPeersRouteFilterIDDeleteParams().WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut).WithNetworkPeerID(id).WithRouteFilterID(routeFilterID) + _, err := f.session.Power.NetworkPeers.V1NetworkPeersRouteFilterIDDelete(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Delete network peer's %s route filter %s for cloud instance %s with error %w", id, routeFilterID, f.cloudInstanceID, err)) + } + return nil +} + +// Get network peer's route filter +func (f *IBMPINetworkPeerClient) GetNetworkPeersRouteFilter(id, routeFilterID string) (*models.RouteFilter, error) { + if !f.session.IsOnPrem() { + return nil, fmt.Errorf(helpers.NotOffPremSupported) + } + params := network_peers.NewV1NetworkPeersRouteFilterIDGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithNetworkPeerID(id).WithRouteFilterID(routeFilterID) + resp, err := f.session.Power.NetworkPeers.V1NetworkPeersRouteFilterIDGet(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Get network peer's %s route filter %s for cloud instance %s with error %w", id, routeFilterID, f.cloudInstanceID, err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to Get network peer's %s route filter %s for cloud instance %s", id, routeFilterID, f.cloudInstanceID) + } + return resp.Payload, nil +} + +// Create network peer's route filter +func (f *IBMPINetworkPeerClient) CreateNetworkPeersRouteFilters(id string, body *models.RouteFilterCreate) (*models.RouteFilter, error) { + if !f.session.IsOnPrem() { + return nil, fmt.Errorf(helpers.NotOffPremSupported) + } + params := network_peers.NewV1NetworkPeersRouteFiltersPostParams().WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).WithNetworkPeerID(id).WithBody(body) + resp, err := f.session.Power.NetworkPeers.V1NetworkPeersRouteFiltersPost(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Create network peer's %s route filter for cloud instance %s with error %w", id, f.cloudInstanceID, err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to Create network peer's %s route filter for cloud instance %s", id, f.cloudInstanceID) } return resp.Payload, nil } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-vpmem.go b/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-vpmem.go new file mode 100644 index 00000000000..01d4c8c0bcf --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-vpmem.go @@ -0,0 +1,77 @@ +package instance + +import ( + "context" + "fmt" + + "github.com/IBM-Cloud/power-go-client/helpers" + "github.com/IBM-Cloud/power-go-client/ibmpisession" + "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_mem_volumes" + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// IBMPIVPMEMClient +type IBMPIVPMEMClient struct { + IBMPIClient +} + +// NewIBMPIVPMEMClient +func NewIBMPIVPMEMClient(ctx context.Context, sess *ibmpisession.IBMPISession, cloudInstanceID string) *IBMPIVPMEMClient { + return &IBMPIVPMEMClient{ + *NewIBMPIClient(ctx, sess, cloudInstanceID), + } +} + +// PvmInstance create VPMEM volumes +func (f *IBMPIVPMEMClient) CreatePvmVpmemVolumes(pvminstanceID string, body *models.VPMemVolumeAttach) (*models.VPMemVolumes, error) { + params := p_cloud_v_p_mem_volumes.NewPcloudPvminstancesVpmemVolumesPostParams().WithContext(f.ctx). + WithTimeout(helpers.PICreateTimeOut).WithCloudInstanceID(f.cloudInstanceID).WithPvmInstanceID(pvminstanceID). + WithBody(body) + resp, err := f.session.Power.PCloudvpMemVolumes.PcloudPvminstancesVpmemVolumesPost(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to create a VPMEM volumes for pvminstance %s in %s with %w", pvminstanceID, f.cloudInstanceID, err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to create a VPMEM volumes for pvminstance %s in %s", pvminstanceID, f.cloudInstanceID) + } + return resp.Payload, nil +} + +// PvmInstance get VPMEM volume +func (f *IBMPIVPMEMClient) GetPvmVpmemVolume(pvminstanceID, vpmemVolumeID string) (*models.VPMemVolumeReference, error) { + params := p_cloud_v_p_mem_volumes.NewPcloudPvminstancesVpmemVolumesGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). + WithCloudInstanceID(f.cloudInstanceID).WithPvmInstanceID(pvminstanceID).WithVpmemVolumeID(vpmemVolumeID) + resp, err := f.session.Power.PCloudvpMemVolumes.PcloudPvminstancesVpmemVolumesGet(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to get VPMEM volume %s for pvminstance %s in %s with %w", vpmemVolumeID, pvminstanceID, f.cloudInstanceID, err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to get VPMEM volume %s for pvminstance %s in %s", vpmemVolumeID, pvminstanceID, f.cloudInstanceID) + } + return resp.Payload, nil +} + +// PvmInstance delete VPMEM volume +func (f *IBMPIVPMEMClient) DeletePvmVpmemVolume(pvminstanceID, vpmemVolumeID string) error { + params := p_cloud_v_p_mem_volumes.NewPcloudPvminstancesVpmemVolumesDeleteParams().WithContext(f.ctx). + WithTimeout(helpers.PIDeleteTimeOut).WithCloudInstanceID(f.cloudInstanceID).WithPvmInstanceID(pvminstanceID).WithVpmemVolumeID(vpmemVolumeID) + _, err := f.session.Power.PCloudvpMemVolumes.PcloudPvminstancesVpmemVolumesDelete(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return fmt.Errorf("failed to delete VPMEM volume %s for pvminstance %s in %s :%w", vpmemVolumeID, pvminstanceID, f.cloudInstanceID, err) + } + return nil +} + +// PvmInstance get all VPMEM volumes +func (f *IBMPIVPMEMClient) GetAllPvmVpmemVolumes(pvminstanceID string) (*models.VPMemVolumes, error) { + params := p_cloud_v_p_mem_volumes.NewPcloudPvminstancesVpmemVolumesGetallParams().WithContext(f.ctx). + WithTimeout(helpers.PIGetTimeOut).WithCloudInstanceID(f.cloudInstanceID).WithPvmInstanceID(pvminstanceID) + resp, err := f.session.Power.PCloudvpMemVolumes.PcloudPvminstancesVpmemVolumesGetall(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to get VPMEM volumes for pvminstance %s in %s with %w", pvminstanceID, f.cloudInstanceID, err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to get VPMEM volumes for pvminstance %s in %s", pvminstanceID, f.cloudInstanceID) + } + return resp.Payload, nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-workspaces.go b/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-workspaces.go index 137911c23ba..7563fe44f7a 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-workspaces.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-workspaces.go @@ -45,7 +45,7 @@ func (f *IBMPIWorkspacesClient) Get(cloudInstanceID string) (*models.Workspace, return nil, fmt.Errorf(helpers.NotOnPremSupported) } params := workspaces.NewV1WorkspacesGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithWorkspaceID(cloudInstanceID) - resp, err := f.session.Power.Workspaces.V1WorkspacesGet(params, f.session.AuthInfo(f.cloudInstanceID)) + resp, err := f.session.Power.Workspaces.V1WorkspacesGet(params, f.session.AuthInfoV2()) if err != nil { return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf(errors.GetWorkspaceOperationFailed, f.cloudInstanceID, err)) } @@ -61,7 +61,7 @@ func (f *IBMPIWorkspacesClient) GetAll() (*models.Workspaces, error) { return nil, fmt.Errorf(helpers.NotOnPremSupported) } params := workspaces.NewV1WorkspacesGetallParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut) - resp, err := f.session.Power.Workspaces.V1WorkspacesGetall(params, f.session.AuthInfo(f.cloudInstanceID)) + resp, err := f.session.Power.Workspaces.V1WorkspacesGetall(params, f.session.AuthInfoV2()) if err != nil { return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Get all Workspaces: %w", err)) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/ibmpisession/session.go b/vendor/github.com/IBM-Cloud/power-go-client/ibmpisession/session.go index 5389d38bf42..8e1f3004255 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/ibmpisession/session.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/ibmpisession/session.go @@ -125,6 +125,17 @@ func (s *IBMPISession) AuthInfo(cloudInstanceID string) runtime.ClientAuthInfoWr }) } +// AuthInfoV2 only set Authorization since some apis do not require CRN in the header +func (s *IBMPISession) AuthInfoV2() runtime.ClientAuthInfoWriter { + return runtime.ClientAuthInfoWriterFunc(func(r runtime.ClientRequest, _ strfmt.Registry) error { + auth, err := fetchAuthorizationData(s.Options.Authenticator) + if err != nil { + return err + } + return r.SetHeaderParam("Authorization", auth) + }) +} + // IsOnPrem returns true if the operation is being done on premise (at a satellite region) func (s *IBMPISession) IsOnPrem() bool { return strings.Contains(s.Options.Zone, helpers.PIStratosRegionPrefix) diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/authentication_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/authentication_client.go index 175237cbc11..0884ce2a8bc 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/authentication_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/authentication_client.go @@ -83,7 +83,7 @@ type ClientService interface { ServiceBrokerAuthCallback returns an access token and set cookie */ func (a *Client) ServiceBrokerAuthCallback(params *ServiceBrokerAuthCallbackParams, opts ...ClientOption) (*ServiceBrokerAuthCallbackOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewServiceBrokerAuthCallbackParams() } @@ -102,17 +102,22 @@ func (a *Client) ServiceBrokerAuthCallback(params *ServiceBrokerAuthCallbackPara for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*ServiceBrokerAuthCallbackOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for serviceBroker.auth.callback: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -121,7 +126,7 @@ func (a *Client) ServiceBrokerAuthCallback(params *ServiceBrokerAuthCallbackPara ServiceBrokerAuthDeviceCodePost requests a authorization device code */ func (a *Client) ServiceBrokerAuthDeviceCodePost(params *ServiceBrokerAuthDeviceCodePostParams, opts ...ClientOption) (*ServiceBrokerAuthDeviceCodePostOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewServiceBrokerAuthDeviceCodePostParams() } @@ -140,17 +145,22 @@ func (a *Client) ServiceBrokerAuthDeviceCodePost(params *ServiceBrokerAuthDevice for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*ServiceBrokerAuthDeviceCodePostOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for serviceBroker.auth.device.code.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -159,7 +169,7 @@ func (a *Client) ServiceBrokerAuthDeviceCodePost(params *ServiceBrokerAuthDevice ServiceBrokerAuthDeviceTokenPost polls for authorization device token */ func (a *Client) ServiceBrokerAuthDeviceTokenPost(params *ServiceBrokerAuthDeviceTokenPostParams, opts ...ClientOption) (*ServiceBrokerAuthDeviceTokenPostOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewServiceBrokerAuthDeviceTokenPostParams() } @@ -178,17 +188,22 @@ func (a *Client) ServiceBrokerAuthDeviceTokenPost(params *ServiceBrokerAuthDevic for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*ServiceBrokerAuthDeviceTokenPostOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for serviceBroker.auth.device.token.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -197,7 +212,7 @@ func (a *Client) ServiceBrokerAuthDeviceTokenPost(params *ServiceBrokerAuthDevic ServiceBrokerAuthInfoToken information about current access token */ func (a *Client) ServiceBrokerAuthInfoToken(params *ServiceBrokerAuthInfoTokenParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerAuthInfoTokenOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewServiceBrokerAuthInfoTokenParams() } @@ -217,17 +232,22 @@ func (a *Client) ServiceBrokerAuthInfoToken(params *ServiceBrokerAuthInfoTokenPa for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*ServiceBrokerAuthInfoTokenOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for serviceBroker.auth.info.token: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -236,7 +256,7 @@ func (a *Client) ServiceBrokerAuthInfoToken(params *ServiceBrokerAuthInfoTokenPa ServiceBrokerAuthInfoUser information about current user */ func (a *Client) ServiceBrokerAuthInfoUser(params *ServiceBrokerAuthInfoUserParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerAuthInfoUserOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewServiceBrokerAuthInfoUserParams() } @@ -256,17 +276,22 @@ func (a *Client) ServiceBrokerAuthInfoUser(params *ServiceBrokerAuthInfoUserPara for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*ServiceBrokerAuthInfoUserOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for serviceBroker.auth.info.user: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -275,7 +300,7 @@ func (a *Client) ServiceBrokerAuthInfoUser(params *ServiceBrokerAuthInfoUserPara ServiceBrokerAuthLogin logins */ func (a *Client) ServiceBrokerAuthLogin(params *ServiceBrokerAuthLoginParams, opts ...ClientOption) (*ServiceBrokerAuthLoginOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewServiceBrokerAuthLoginParams() } @@ -294,17 +319,22 @@ func (a *Client) ServiceBrokerAuthLogin(params *ServiceBrokerAuthLoginParams, op for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*ServiceBrokerAuthLoginOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for serviceBroker.auth.login: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -313,7 +343,7 @@ func (a *Client) ServiceBrokerAuthLogin(params *ServiceBrokerAuthLoginParams, op ServiceBrokerAuthLogout logouts */ func (a *Client) ServiceBrokerAuthLogout(params *ServiceBrokerAuthLogoutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerAuthLogoutOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewServiceBrokerAuthLogoutParams() } @@ -333,17 +363,22 @@ func (a *Client) ServiceBrokerAuthLogout(params *ServiceBrokerAuthLogoutParams, for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*ServiceBrokerAuthLogoutOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for serviceBroker.auth.logout: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -352,7 +387,7 @@ func (a *Client) ServiceBrokerAuthLogout(params *ServiceBrokerAuthLogoutParams, ServiceBrokerAuthRegistration registrations of a new tenant and login */ func (a *Client) ServiceBrokerAuthRegistration(params *ServiceBrokerAuthRegistrationParams, opts ...ClientOption) (*ServiceBrokerAuthRegistrationOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewServiceBrokerAuthRegistrationParams() } @@ -371,17 +406,22 @@ func (a *Client) ServiceBrokerAuthRegistration(params *ServiceBrokerAuthRegistra for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*ServiceBrokerAuthRegistrationOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for serviceBroker.auth.registration: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -390,7 +430,7 @@ func (a *Client) ServiceBrokerAuthRegistration(params *ServiceBrokerAuthRegistra ServiceBrokerAuthRegistrationCallback associates the user with a tenant and returns an access token */ func (a *Client) ServiceBrokerAuthRegistrationCallback(params *ServiceBrokerAuthRegistrationCallbackParams, opts ...ClientOption) (*ServiceBrokerAuthRegistrationCallbackOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewServiceBrokerAuthRegistrationCallbackParams() } @@ -409,17 +449,22 @@ func (a *Client) ServiceBrokerAuthRegistrationCallback(params *ServiceBrokerAuth for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*ServiceBrokerAuthRegistrationCallbackOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for serviceBroker.auth.registration.callback: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -428,7 +473,7 @@ func (a *Client) ServiceBrokerAuthRegistrationCallback(params *ServiceBrokerAuth ServiceBrokerAuthTokenPost requests a new token from a refresh token */ func (a *Client) ServiceBrokerAuthTokenPost(params *ServiceBrokerAuthTokenPostParams, opts ...ClientOption) (*ServiceBrokerAuthTokenPostOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewServiceBrokerAuthTokenPostParams() } @@ -447,17 +492,22 @@ func (a *Client) ServiceBrokerAuthTokenPost(params *ServiceBrokerAuthTokenPostPa for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*ServiceBrokerAuthTokenPostOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for serviceBroker.auth.token.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_callback_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_callback_responses.go index cb6002eebda..1d46121a8e7 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_callback_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_callback_responses.go @@ -7,6 +7,7 @@ package authentication import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type ServiceBrokerAuthCallbackReader struct { } // ReadResponse reads a server response into the received o. -func (o *ServiceBrokerAuthCallbackReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ServiceBrokerAuthCallbackReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewServiceBrokerAuthCallbackOK() @@ -128,7 +129,7 @@ func (o *ServiceBrokerAuthCallbackOK) readResponse(response runtime.ClientRespon o.Payload = new(models.AccessToken) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *ServiceBrokerAuthCallbackBadRequest) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *ServiceBrokerAuthCallbackUnauthorized) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *ServiceBrokerAuthCallbackForbidden) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *ServiceBrokerAuthCallbackNotFound) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *ServiceBrokerAuthCallbackInternalServerError) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_device_code_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_device_code_post_responses.go index 273f5fcd3db..fd8b25086f2 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_device_code_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_device_code_post_responses.go @@ -7,6 +7,7 @@ package authentication import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type ServiceBrokerAuthDeviceCodePostReader struct { } // ReadResponse reads a server response into the received o. -func (o *ServiceBrokerAuthDeviceCodePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ServiceBrokerAuthDeviceCodePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewServiceBrokerAuthDeviceCodePostOK() @@ -128,7 +129,7 @@ func (o *ServiceBrokerAuthDeviceCodePostOK) readResponse(response runtime.Client o.Payload = new(models.DeviceCode) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *ServiceBrokerAuthDeviceCodePostBadRequest) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *ServiceBrokerAuthDeviceCodePostUnauthorized) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *ServiceBrokerAuthDeviceCodePostForbidden) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *ServiceBrokerAuthDeviceCodePostNotFound) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *ServiceBrokerAuthDeviceCodePostInternalServerError) readResponse(respon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_device_token_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_device_token_post_responses.go index 511eb84beb1..89c7e5da476 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_device_token_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_device_token_post_responses.go @@ -8,6 +8,7 @@ package authentication import ( "context" "encoding/json" + stderrors "errors" "fmt" "io" @@ -24,7 +25,7 @@ type ServiceBrokerAuthDeviceTokenPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *ServiceBrokerAuthDeviceTokenPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ServiceBrokerAuthDeviceTokenPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewServiceBrokerAuthDeviceTokenPostOK() @@ -136,7 +137,7 @@ func (o *ServiceBrokerAuthDeviceTokenPostOK) readResponse(response runtime.Clien o.Payload = new(models.Token) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -206,7 +207,7 @@ func (o *ServiceBrokerAuthDeviceTokenPostBadRequest) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -276,7 +277,7 @@ func (o *ServiceBrokerAuthDeviceTokenPostUnauthorized) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -346,7 +347,7 @@ func (o *ServiceBrokerAuthDeviceTokenPostForbidden) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -416,7 +417,7 @@ func (o *ServiceBrokerAuthDeviceTokenPostNotFound) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -486,7 +487,7 @@ func (o *ServiceBrokerAuthDeviceTokenPostTooManyRequests) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -556,7 +557,7 @@ func (o *ServiceBrokerAuthDeviceTokenPostInternalServerError) readResponse(respo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_info_token_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_info_token_responses.go index c9ad50f443f..9ea15536a72 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_info_token_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_info_token_responses.go @@ -7,6 +7,7 @@ package authentication import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type ServiceBrokerAuthInfoTokenReader struct { } // ReadResponse reads a server response into the received o. -func (o *ServiceBrokerAuthInfoTokenReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ServiceBrokerAuthInfoTokenReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewServiceBrokerAuthInfoTokenOK() @@ -128,7 +129,7 @@ func (o *ServiceBrokerAuthInfoTokenOK) readResponse(response runtime.ClientRespo o.Payload = new(models.TokenExtra) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *ServiceBrokerAuthInfoTokenBadRequest) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *ServiceBrokerAuthInfoTokenUnauthorized) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *ServiceBrokerAuthInfoTokenForbidden) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *ServiceBrokerAuthInfoTokenNotFound) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *ServiceBrokerAuthInfoTokenInternalServerError) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_info_user_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_info_user_responses.go index 672d5a3987a..c5a39d26d3f 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_info_user_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_info_user_responses.go @@ -7,6 +7,7 @@ package authentication import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type ServiceBrokerAuthInfoUserReader struct { } // ReadResponse reads a server response into the received o. -func (o *ServiceBrokerAuthInfoUserReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ServiceBrokerAuthInfoUserReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewServiceBrokerAuthInfoUserOK() @@ -128,7 +129,7 @@ func (o *ServiceBrokerAuthInfoUserOK) readResponse(response runtime.ClientRespon o.Payload = new(models.UserInfo) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *ServiceBrokerAuthInfoUserBadRequest) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *ServiceBrokerAuthInfoUserUnauthorized) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *ServiceBrokerAuthInfoUserForbidden) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *ServiceBrokerAuthInfoUserNotFound) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *ServiceBrokerAuthInfoUserInternalServerError) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_login_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_login_responses.go index 1836f4f969b..48f0ba14c89 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_login_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_login_responses.go @@ -7,6 +7,7 @@ package authentication import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type ServiceBrokerAuthLoginReader struct { } // ReadResponse reads a server response into the received o. -func (o *ServiceBrokerAuthLoginReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ServiceBrokerAuthLoginReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewServiceBrokerAuthLoginOK() @@ -128,7 +129,7 @@ func (o *ServiceBrokerAuthLoginOK) readResponse(response runtime.ClientResponse, o.Payload = new(models.AccessToken) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *ServiceBrokerAuthLoginBadRequest) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *ServiceBrokerAuthLoginUnauthorized) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *ServiceBrokerAuthLoginForbidden) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *ServiceBrokerAuthLoginNotFound) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *ServiceBrokerAuthLoginInternalServerError) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_logout_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_logout_responses.go index fabf4561f8d..46e41a57eb9 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_logout_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_logout_responses.go @@ -7,6 +7,7 @@ package authentication import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type ServiceBrokerAuthLogoutReader struct { } // ReadResponse reads a server response into the received o. -func (o *ServiceBrokerAuthLogoutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ServiceBrokerAuthLogoutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewServiceBrokerAuthLogoutOK() @@ -126,7 +127,7 @@ func (o *ServiceBrokerAuthLogoutOK) GetPayload() models.Object { func (o *ServiceBrokerAuthLogoutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -196,7 +197,7 @@ func (o *ServiceBrokerAuthLogoutBadRequest) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -266,7 +267,7 @@ func (o *ServiceBrokerAuthLogoutUnauthorized) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -336,7 +337,7 @@ func (o *ServiceBrokerAuthLogoutForbidden) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -406,7 +407,7 @@ func (o *ServiceBrokerAuthLogoutNotFound) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -476,7 +477,7 @@ func (o *ServiceBrokerAuthLogoutInternalServerError) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_registration_callback_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_registration_callback_responses.go index 85f55348864..01fa8bc41e7 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_registration_callback_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_registration_callback_responses.go @@ -7,6 +7,7 @@ package authentication import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type ServiceBrokerAuthRegistrationCallbackReader struct { } // ReadResponse reads a server response into the received o. -func (o *ServiceBrokerAuthRegistrationCallbackReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ServiceBrokerAuthRegistrationCallbackReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewServiceBrokerAuthRegistrationCallbackOK() @@ -128,7 +129,7 @@ func (o *ServiceBrokerAuthRegistrationCallbackOK) readResponse(response runtime. o.Payload = new(models.AccessToken) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *ServiceBrokerAuthRegistrationCallbackBadRequest) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *ServiceBrokerAuthRegistrationCallbackUnauthorized) readResponse(respons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *ServiceBrokerAuthRegistrationCallbackForbidden) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *ServiceBrokerAuthRegistrationCallbackNotFound) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *ServiceBrokerAuthRegistrationCallbackInternalServerError) readResponse( o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_registration_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_registration_responses.go index 3df3f3f525f..4be96dcc873 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_registration_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_registration_responses.go @@ -7,6 +7,7 @@ package authentication import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type ServiceBrokerAuthRegistrationReader struct { } // ReadResponse reads a server response into the received o. -func (o *ServiceBrokerAuthRegistrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ServiceBrokerAuthRegistrationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewServiceBrokerAuthRegistrationOK() @@ -128,7 +129,7 @@ func (o *ServiceBrokerAuthRegistrationOK) readResponse(response runtime.ClientRe o.Payload = new(models.AccessToken) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *ServiceBrokerAuthRegistrationBadRequest) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *ServiceBrokerAuthRegistrationUnauthorized) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *ServiceBrokerAuthRegistrationForbidden) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *ServiceBrokerAuthRegistrationNotFound) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *ServiceBrokerAuthRegistrationInternalServerError) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_token_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_token_post_responses.go index cc218ffb522..e17701fc72d 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_token_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/authentication/service_broker_auth_token_post_responses.go @@ -7,6 +7,7 @@ package authentication import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type ServiceBrokerAuthTokenPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *ServiceBrokerAuthTokenPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ServiceBrokerAuthTokenPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewServiceBrokerAuthTokenPostOK() @@ -134,7 +135,7 @@ func (o *ServiceBrokerAuthTokenPostOK) readResponse(response runtime.ClientRespo o.Payload = new(models.Token) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *ServiceBrokerAuthTokenPostBadRequest) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *ServiceBrokerAuthTokenPostUnauthorized) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *ServiceBrokerAuthTokenPostForbidden) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *ServiceBrokerAuthTokenPostNotFound) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *ServiceBrokerAuthTokenPostTooManyRequests) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *ServiceBrokerAuthTokenPostInternalServerError) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/bluemix_service_instances/bluemix_service_instance_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/bluemix_service_instances/bluemix_service_instance_get_responses.go index b77f3a34c59..923208056ad 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/bluemix_service_instances/bluemix_service_instance_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/bluemix_service_instances/bluemix_service_instance_get_responses.go @@ -7,6 +7,7 @@ package bluemix_service_instances import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type BluemixServiceInstanceGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *BluemixServiceInstanceGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *BluemixServiceInstanceGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewBluemixServiceInstanceGetOK() @@ -122,7 +123,7 @@ func (o *BluemixServiceInstanceGetOK) readResponse(response runtime.ClientRespon o.Payload = new(models.ServiceInstance) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -192,7 +193,7 @@ func (o *BluemixServiceInstanceGetBadRequest) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -262,7 +263,7 @@ func (o *BluemixServiceInstanceGetUnauthorized) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -332,7 +333,7 @@ func (o *BluemixServiceInstanceGetForbidden) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -402,7 +403,7 @@ func (o *BluemixServiceInstanceGetNotFound) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/bluemix_service_instances/bluemix_service_instance_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/bluemix_service_instances/bluemix_service_instance_put_responses.go index e930240a296..eadb9718170 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/bluemix_service_instances/bluemix_service_instance_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/bluemix_service_instances/bluemix_service_instance_put_responses.go @@ -7,6 +7,7 @@ package bluemix_service_instances import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type BluemixServiceInstancePutReader struct { } // ReadResponse reads a server response into the received o. -func (o *BluemixServiceInstancePutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *BluemixServiceInstancePutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewBluemixServiceInstancePutOK() @@ -122,7 +123,7 @@ func (o *BluemixServiceInstancePutOK) readResponse(response runtime.ClientRespon o.Payload = new(models.ServiceInstance) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -192,7 +193,7 @@ func (o *BluemixServiceInstancePutBadRequest) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -262,7 +263,7 @@ func (o *BluemixServiceInstancePutUnauthorized) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -332,7 +333,7 @@ func (o *BluemixServiceInstancePutForbidden) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -402,7 +403,7 @@ func (o *BluemixServiceInstancePutNotFound) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/bluemix_service_instances/bluemix_service_instances_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/bluemix_service_instances/bluemix_service_instances_client.go index e6ac7174e9f..2a7f2516717 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/bluemix_service_instances/bluemix_service_instances_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/bluemix_service_instances/bluemix_service_instances_client.go @@ -67,7 +67,7 @@ type ClientService interface { BluemixServiceInstanceGet gets the current state information associated with the service instance */ func (a *Client) BluemixServiceInstanceGet(params *BluemixServiceInstanceGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BluemixServiceInstanceGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewBluemixServiceInstanceGetParams() } @@ -87,17 +87,22 @@ func (a *Client) BluemixServiceInstanceGet(params *BluemixServiceInstanceGetPara for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*BluemixServiceInstanceGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for bluemix.serviceInstance.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -106,7 +111,7 @@ func (a *Client) BluemixServiceInstanceGet(params *BluemixServiceInstanceGetPara BluemixServiceInstancePut updates disable or enable the state of a provisioned service instance */ func (a *Client) BluemixServiceInstancePut(params *BluemixServiceInstancePutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*BluemixServiceInstancePutOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewBluemixServiceInstancePutParams() } @@ -126,17 +131,22 @@ func (a *Client) BluemixServiceInstancePut(params *BluemixServiceInstancePutPara for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*BluemixServiceInstancePutOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for bluemix.serviceInstance.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/catalog/catalog_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/catalog/catalog_client.go index dc74d0ae87c..1b8ac58d125 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/catalog/catalog_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/catalog/catalog_client.go @@ -65,7 +65,7 @@ type ClientService interface { CatalogGet gets the catalog of services that the service broker offers */ func (a *Client) CatalogGet(params *CatalogGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CatalogGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewCatalogGetParams() } @@ -85,17 +85,22 @@ func (a *Client) CatalogGet(params *CatalogGetParams, authInfo runtime.ClientAut for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*CatalogGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for catalog.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/catalog/catalog_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/catalog/catalog_get_responses.go index cb56dfa5f2f..db925bd7012 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/catalog/catalog_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/catalog/catalog_get_responses.go @@ -7,6 +7,7 @@ package catalog import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type CatalogGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *CatalogGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *CatalogGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewCatalogGetOK() @@ -122,7 +123,7 @@ func (o *CatalogGetOK) readResponse(response runtime.ClientResponse, consumer ru o.Payload = new(models.Catalog) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -192,7 +193,7 @@ func (o *CatalogGetBadRequest) readResponse(response runtime.ClientResponse, con o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -262,7 +263,7 @@ func (o *CatalogGetUnauthorized) readResponse(response runtime.ClientResponse, c o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -332,7 +333,7 @@ func (o *CatalogGetForbidden) readResponse(response runtime.ClientResponse, cons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -402,7 +403,7 @@ func (o *CatalogGetNotFound) readResponse(response runtime.ClientResponse, consu o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/datacenters/datacenters_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/datacenters/datacenters_client.go index 9ccf8b60c8f..13c8bb37b1d 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/datacenters/datacenters_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/datacenters/datacenters_client.go @@ -71,7 +71,7 @@ type ClientService interface { V1DatacentersGet gets a datacenter s information and capabilities */ func (a *Client) V1DatacentersGet(params *V1DatacentersGetParams, opts ...ClientOption) (*V1DatacentersGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1DatacentersGetParams() } @@ -90,17 +90,22 @@ func (a *Client) V1DatacentersGet(params *V1DatacentersGetParams, opts ...Client for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1DatacentersGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.datacenters.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -109,7 +114,7 @@ func (a *Client) V1DatacentersGet(params *V1DatacentersGetParams, opts ...Client V1DatacentersGetall gets all datacenters information and capabilities */ func (a *Client) V1DatacentersGetall(params *V1DatacentersGetallParams, opts ...ClientOption) (*V1DatacentersGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1DatacentersGetallParams() } @@ -128,17 +133,22 @@ func (a *Client) V1DatacentersGetall(params *V1DatacentersGetallParams, opts ... for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1DatacentersGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.datacenters.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -147,7 +157,7 @@ func (a *Client) V1DatacentersGetall(params *V1DatacentersGetallParams, opts ... V1DatacentersPrivateGet gets a private datacenter s information and capabilities */ func (a *Client) V1DatacentersPrivateGet(params *V1DatacentersPrivateGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1DatacentersPrivateGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1DatacentersPrivateGetParams() } @@ -167,17 +177,22 @@ func (a *Client) V1DatacentersPrivateGet(params *V1DatacentersPrivateGetParams, for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1DatacentersPrivateGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.datacentersPrivate.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -186,7 +201,7 @@ func (a *Client) V1DatacentersPrivateGet(params *V1DatacentersPrivateGetParams, V1DatacentersPrivateGetall gets private datacenter information and capabilities */ func (a *Client) V1DatacentersPrivateGetall(params *V1DatacentersPrivateGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1DatacentersPrivateGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1DatacentersPrivateGetallParams() } @@ -206,17 +221,22 @@ func (a *Client) V1DatacentersPrivateGetall(params *V1DatacentersPrivateGetallPa for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1DatacentersPrivateGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.datacentersPrivate.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/datacenters/v1_datacenters_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/datacenters/v1_datacenters_get_responses.go index 8ddd956d5c4..6892839690d 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/datacenters/v1_datacenters_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/datacenters/v1_datacenters_get_responses.go @@ -7,6 +7,7 @@ package datacenters import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1DatacentersGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1DatacentersGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1DatacentersGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1DatacentersGetOK() @@ -122,7 +123,7 @@ func (o *V1DatacentersGetOK) readResponse(response runtime.ClientResponse, consu o.Payload = new(models.Datacenter) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -192,7 +193,7 @@ func (o *V1DatacentersGetBadRequest) readResponse(response runtime.ClientRespons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -262,7 +263,7 @@ func (o *V1DatacentersGetUnauthorized) readResponse(response runtime.ClientRespo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -332,7 +333,7 @@ func (o *V1DatacentersGetForbidden) readResponse(response runtime.ClientResponse o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -402,7 +403,7 @@ func (o *V1DatacentersGetInternalServerError) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/datacenters/v1_datacenters_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/datacenters/v1_datacenters_getall_responses.go index a088af4d26d..142ee9f3c55 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/datacenters/v1_datacenters_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/datacenters/v1_datacenters_getall_responses.go @@ -7,6 +7,7 @@ package datacenters import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1DatacentersGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1DatacentersGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1DatacentersGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1DatacentersGetallOK() @@ -122,7 +123,7 @@ func (o *V1DatacentersGetallOK) readResponse(response runtime.ClientResponse, co o.Payload = new(models.Datacenters) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -192,7 +193,7 @@ func (o *V1DatacentersGetallBadRequest) readResponse(response runtime.ClientResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -262,7 +263,7 @@ func (o *V1DatacentersGetallUnauthorized) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -332,7 +333,7 @@ func (o *V1DatacentersGetallForbidden) readResponse(response runtime.ClientRespo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -402,7 +403,7 @@ func (o *V1DatacentersGetallInternalServerError) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/datacenters/v1_datacenters_private_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/datacenters/v1_datacenters_private_get_responses.go index f23ed3a16ed..9fcf2745e22 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/datacenters/v1_datacenters_private_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/datacenters/v1_datacenters_private_get_responses.go @@ -7,6 +7,7 @@ package datacenters import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1DatacentersPrivateGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1DatacentersPrivateGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1DatacentersPrivateGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1DatacentersPrivateGetOK() @@ -122,7 +123,7 @@ func (o *V1DatacentersPrivateGetOK) readResponse(response runtime.ClientResponse o.Payload = new(models.Datacenter) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -192,7 +193,7 @@ func (o *V1DatacentersPrivateGetBadRequest) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -262,7 +263,7 @@ func (o *V1DatacentersPrivateGetUnauthorized) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -332,7 +333,7 @@ func (o *V1DatacentersPrivateGetForbidden) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -402,7 +403,7 @@ func (o *V1DatacentersPrivateGetInternalServerError) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/datacenters/v1_datacenters_private_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/datacenters/v1_datacenters_private_getall_responses.go index f4ba186aa04..7c1b77e0bd4 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/datacenters/v1_datacenters_private_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/datacenters/v1_datacenters_private_getall_responses.go @@ -7,6 +7,7 @@ package datacenters import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1DatacentersPrivateGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1DatacentersPrivateGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1DatacentersPrivateGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1DatacentersPrivateGetallOK() @@ -122,7 +123,7 @@ func (o *V1DatacentersPrivateGetallOK) readResponse(response runtime.ClientRespo o.Payload = new(models.Datacenters) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -192,7 +193,7 @@ func (o *V1DatacentersPrivateGetallBadRequest) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -262,7 +263,7 @@ func (o *V1DatacentersPrivateGetallUnauthorized) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -332,7 +333,7 @@ func (o *V1DatacentersPrivateGetallForbidden) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -402,7 +403,7 @@ func (o *V1DatacentersPrivateGetallInternalServerError) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/hardware_platforms/hardware_platforms_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/hardware_platforms/hardware_platforms_client.go index 893c2aa4776..ad8aaf87e1f 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/hardware_platforms/hardware_platforms_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/hardware_platforms/hardware_platforms_client.go @@ -65,7 +65,7 @@ type ClientService interface { ServiceBrokerHardwareplatformsGet availables hardware statistics and limits */ func (a *Client) ServiceBrokerHardwareplatformsGet(params *ServiceBrokerHardwareplatformsGetParams, opts ...ClientOption) (*ServiceBrokerHardwareplatformsGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewServiceBrokerHardwareplatformsGetParams() } @@ -84,17 +84,22 @@ func (a *Client) ServiceBrokerHardwareplatformsGet(params *ServiceBrokerHardware for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*ServiceBrokerHardwareplatformsGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for serviceBroker.hardwareplatforms.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/hardware_platforms/service_broker_hardwareplatforms_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/hardware_platforms/service_broker_hardwareplatforms_get_responses.go index a269f65f04f..9fb60984e32 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/hardware_platforms/service_broker_hardwareplatforms_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/hardware_platforms/service_broker_hardwareplatforms_get_responses.go @@ -7,6 +7,7 @@ package hardware_platforms import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type ServiceBrokerHardwareplatformsGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *ServiceBrokerHardwareplatformsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ServiceBrokerHardwareplatformsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewServiceBrokerHardwareplatformsGetOK() @@ -126,7 +127,7 @@ func (o *ServiceBrokerHardwareplatformsGetOK) GetPayload() models.HardwarePlatfo func (o *ServiceBrokerHardwareplatformsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -196,7 +197,7 @@ func (o *ServiceBrokerHardwareplatformsGetBadRequest) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -266,7 +267,7 @@ func (o *ServiceBrokerHardwareplatformsGetUnauthorized) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -336,7 +337,7 @@ func (o *ServiceBrokerHardwareplatformsGetForbidden) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -406,7 +407,7 @@ func (o *ServiceBrokerHardwareplatformsGetNotFound) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -476,7 +477,7 @@ func (o *ServiceBrokerHardwareplatformsGetInternalServerError) readResponse(resp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/host_groups_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/host_groups_client.go index e7fd62b255b..6ee71ff1ea1 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/host_groups_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/host_groups_client.go @@ -83,7 +83,7 @@ type ClientService interface { V1AvailableHosts lists all the hosts that can be reserved */ func (a *Client) V1AvailableHosts(params *V1AvailableHostsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1AvailableHostsOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1AvailableHostsParams() } @@ -103,17 +103,22 @@ func (a *Client) V1AvailableHosts(params *V1AvailableHostsParams, authInfo runti for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1AvailableHostsOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.availableHosts: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -122,7 +127,7 @@ func (a *Client) V1AvailableHosts(params *V1AvailableHostsParams, authInfo runti V1HostGroupsGet gets the list of host groups for the workspace */ func (a *Client) V1HostGroupsGet(params *V1HostGroupsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1HostGroupsGetParams() } @@ -142,17 +147,22 @@ func (a *Client) V1HostGroupsGet(params *V1HostGroupsGetParams, authInfo runtime for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1HostGroupsGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.hostGroups.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -161,7 +171,7 @@ func (a *Client) V1HostGroupsGet(params *V1HostGroupsGetParams, authInfo runtime V1HostGroupsIDGet gets the details of a host group */ func (a *Client) V1HostGroupsIDGet(params *V1HostGroupsIDGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsIDGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1HostGroupsIDGetParams() } @@ -181,17 +191,22 @@ func (a *Client) V1HostGroupsIDGet(params *V1HostGroupsIDGetParams, authInfo run for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1HostGroupsIDGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.hostGroups.id.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -200,7 +215,7 @@ func (a *Client) V1HostGroupsIDGet(params *V1HostGroupsIDGetParams, authInfo run V1HostGroupsIDPut shares unshare a host group with another workspace */ func (a *Client) V1HostGroupsIDPut(params *V1HostGroupsIDPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsIDPutOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1HostGroupsIDPutParams() } @@ -220,17 +235,22 @@ func (a *Client) V1HostGroupsIDPut(params *V1HostGroupsIDPutParams, authInfo run for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1HostGroupsIDPutOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.hostGroups.id.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -239,7 +259,7 @@ func (a *Client) V1HostGroupsIDPut(params *V1HostGroupsIDPutParams, authInfo run V1HostGroupsPost creates a host group with one or more host */ func (a *Client) V1HostGroupsPost(params *V1HostGroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsPostCreated, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1HostGroupsPostParams() } @@ -259,17 +279,22 @@ func (a *Client) V1HostGroupsPost(params *V1HostGroupsPostParams, authInfo runti for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1HostGroupsPostCreated) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.hostGroups.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -278,7 +303,7 @@ func (a *Client) V1HostGroupsPost(params *V1HostGroupsPostParams, authInfo runti V1HostsGet gets the list of all the hosts the workspace has access to */ func (a *Client) V1HostsGet(params *V1HostsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostsGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1HostsGetParams() } @@ -298,17 +323,22 @@ func (a *Client) V1HostsGet(params *V1HostsGetParams, authInfo runtime.ClientAut for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1HostsGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.hosts.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -317,7 +347,7 @@ func (a *Client) V1HostsGet(params *V1HostsGetParams, authInfo runtime.ClientAut V1HostsIDDelete releases a host from its host group */ func (a *Client) V1HostsIDDelete(params *V1HostsIDDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostsIDDeleteAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1HostsIDDeleteParams() } @@ -337,17 +367,22 @@ func (a *Client) V1HostsIDDelete(params *V1HostsIDDeleteParams, authInfo runtime for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1HostsIDDeleteAccepted) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.hosts.id.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -356,7 +391,7 @@ func (a *Client) V1HostsIDDelete(params *V1HostsIDDeleteParams, authInfo runtime V1HostsIDGet gets the details about a host */ func (a *Client) V1HostsIDGet(params *V1HostsIDGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostsIDGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1HostsIDGetParams() } @@ -376,17 +411,22 @@ func (a *Client) V1HostsIDGet(params *V1HostsIDGetParams, authInfo runtime.Clien for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1HostsIDGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.hosts.id.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -395,7 +435,7 @@ func (a *Client) V1HostsIDGet(params *V1HostsIDGetParams, authInfo runtime.Clien V1HostsIDPut modifies the display name of a host */ func (a *Client) V1HostsIDPut(params *V1HostsIDPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostsIDPutOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1HostsIDPutParams() } @@ -415,17 +455,22 @@ func (a *Client) V1HostsIDPut(params *V1HostsIDPutParams, authInfo runtime.Clien for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1HostsIDPutOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.hosts.id.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -434,7 +479,7 @@ func (a *Client) V1HostsIDPut(params *V1HostsIDPutParams, authInfo runtime.Clien V1HostsPost adds new host s to an existing host group */ func (a *Client) V1HostsPost(params *V1HostsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostsPostCreated, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1HostsPostParams() } @@ -454,17 +499,22 @@ func (a *Client) V1HostsPost(params *V1HostsPostParams, authInfo runtime.ClientA for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1HostsPostCreated) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.hosts.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_available_hosts_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_available_hosts_responses.go index eee8389334b..56b1723f717 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_available_hosts_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_available_hosts_responses.go @@ -7,6 +7,7 @@ package host_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1AvailableHostsReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1AvailableHostsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1AvailableHostsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1AvailableHostsOK() @@ -126,7 +127,7 @@ func (o *V1AvailableHostsOK) GetPayload() models.AvailableHostList { func (o *V1AvailableHostsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -196,7 +197,7 @@ func (o *V1AvailableHostsBadRequest) readResponse(response runtime.ClientRespons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -266,7 +267,7 @@ func (o *V1AvailableHostsUnauthorized) readResponse(response runtime.ClientRespo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -336,7 +337,7 @@ func (o *V1AvailableHostsForbidden) readResponse(response runtime.ClientResponse o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -406,7 +407,7 @@ func (o *V1AvailableHostsInternalServerError) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -476,7 +477,7 @@ func (o *V1AvailableHostsGatewayTimeout) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_host_groups_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_host_groups_get_responses.go index e112020b058..1b93cce9127 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_host_groups_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_host_groups_get_responses.go @@ -7,6 +7,7 @@ package host_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1HostGroupsGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1HostGroupsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1HostGroupsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1HostGroupsGetOK() @@ -126,7 +127,7 @@ func (o *V1HostGroupsGetOK) GetPayload() models.HostGroupList { func (o *V1HostGroupsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -196,7 +197,7 @@ func (o *V1HostGroupsGetBadRequest) readResponse(response runtime.ClientResponse o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -266,7 +267,7 @@ func (o *V1HostGroupsGetUnauthorized) readResponse(response runtime.ClientRespon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -336,7 +337,7 @@ func (o *V1HostGroupsGetForbidden) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -406,7 +407,7 @@ func (o *V1HostGroupsGetInternalServerError) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -476,7 +477,7 @@ func (o *V1HostGroupsGetGatewayTimeout) readResponse(response runtime.ClientResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_host_groups_id_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_host_groups_id_get_responses.go index 0aa259da902..dd2002d1976 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_host_groups_id_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_host_groups_id_get_responses.go @@ -7,6 +7,7 @@ package host_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1HostGroupsIDGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1HostGroupsIDGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1HostGroupsIDGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1HostGroupsIDGetOK() @@ -134,7 +135,7 @@ func (o *V1HostGroupsIDGetOK) readResponse(response runtime.ClientResponse, cons o.Payload = new(models.HostGroup) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *V1HostGroupsIDGetBadRequest) readResponse(response runtime.ClientRespon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *V1HostGroupsIDGetUnauthorized) readResponse(response runtime.ClientResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *V1HostGroupsIDGetForbidden) readResponse(response runtime.ClientRespons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *V1HostGroupsIDGetNotFound) readResponse(response runtime.ClientResponse o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *V1HostGroupsIDGetInternalServerError) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *V1HostGroupsIDGetGatewayTimeout) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_host_groups_id_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_host_groups_id_put_responses.go index 0afb7f05e59..104fc66efbe 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_host_groups_id_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_host_groups_id_put_responses.go @@ -7,6 +7,7 @@ package host_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1HostGroupsIDPutReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1HostGroupsIDPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1HostGroupsIDPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1HostGroupsIDPutOK() @@ -140,7 +141,7 @@ func (o *V1HostGroupsIDPutOK) readResponse(response runtime.ClientResponse, cons o.Payload = new(models.HostGroup) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -210,7 +211,7 @@ func (o *V1HostGroupsIDPutBadRequest) readResponse(response runtime.ClientRespon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -280,7 +281,7 @@ func (o *V1HostGroupsIDPutUnauthorized) readResponse(response runtime.ClientResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -350,7 +351,7 @@ func (o *V1HostGroupsIDPutForbidden) readResponse(response runtime.ClientRespons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -420,7 +421,7 @@ func (o *V1HostGroupsIDPutNotFound) readResponse(response runtime.ClientResponse o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -490,7 +491,7 @@ func (o *V1HostGroupsIDPutConflict) readResponse(response runtime.ClientResponse o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -560,7 +561,7 @@ func (o *V1HostGroupsIDPutInternalServerError) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -630,7 +631,7 @@ func (o *V1HostGroupsIDPutGatewayTimeout) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_host_groups_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_host_groups_post_responses.go index f20ccba92de..7553595fede 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_host_groups_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_host_groups_post_responses.go @@ -7,6 +7,7 @@ package host_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1HostGroupsPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1HostGroupsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1HostGroupsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 201: result := NewV1HostGroupsPostCreated() @@ -140,7 +141,7 @@ func (o *V1HostGroupsPostCreated) readResponse(response runtime.ClientResponse, o.Payload = new(models.HostGroup) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -210,7 +211,7 @@ func (o *V1HostGroupsPostBadRequest) readResponse(response runtime.ClientRespons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -280,7 +281,7 @@ func (o *V1HostGroupsPostUnauthorized) readResponse(response runtime.ClientRespo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -350,7 +351,7 @@ func (o *V1HostGroupsPostForbidden) readResponse(response runtime.ClientResponse o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -420,7 +421,7 @@ func (o *V1HostGroupsPostConflict) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -490,7 +491,7 @@ func (o *V1HostGroupsPostUnprocessableEntity) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -560,7 +561,7 @@ func (o *V1HostGroupsPostInternalServerError) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -630,7 +631,7 @@ func (o *V1HostGroupsPostGatewayTimeout) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_hosts_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_hosts_get_responses.go index 632109b83ce..4306d098331 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_hosts_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_hosts_get_responses.go @@ -7,6 +7,7 @@ package host_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1HostsGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1HostsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1HostsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1HostsGetOK() @@ -126,7 +127,7 @@ func (o *V1HostsGetOK) GetPayload() models.HostList { func (o *V1HostsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -196,7 +197,7 @@ func (o *V1HostsGetBadRequest) readResponse(response runtime.ClientResponse, con o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -266,7 +267,7 @@ func (o *V1HostsGetUnauthorized) readResponse(response runtime.ClientResponse, c o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -336,7 +337,7 @@ func (o *V1HostsGetForbidden) readResponse(response runtime.ClientResponse, cons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -406,7 +407,7 @@ func (o *V1HostsGetInternalServerError) readResponse(response runtime.ClientResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -476,7 +477,7 @@ func (o *V1HostsGetGatewayTimeout) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_hosts_id_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_hosts_id_delete_responses.go index afda9239ba5..9ba7871914b 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_hosts_id_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_hosts_id_delete_responses.go @@ -7,6 +7,7 @@ package host_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1HostsIDDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1HostsIDDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1HostsIDDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 202: result := NewV1HostsIDDeleteAccepted() @@ -132,7 +133,7 @@ func (o *V1HostsIDDeleteAccepted) GetPayload() models.Object { func (o *V1HostsIDDeleteAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -202,7 +203,7 @@ func (o *V1HostsIDDeleteBadRequest) readResponse(response runtime.ClientResponse o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -272,7 +273,7 @@ func (o *V1HostsIDDeleteUnauthorized) readResponse(response runtime.ClientRespon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -342,7 +343,7 @@ func (o *V1HostsIDDeleteForbidden) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -412,7 +413,7 @@ func (o *V1HostsIDDeleteNotFound) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -482,7 +483,7 @@ func (o *V1HostsIDDeleteInternalServerError) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -552,7 +553,7 @@ func (o *V1HostsIDDeleteGatewayTimeout) readResponse(response runtime.ClientResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_hosts_id_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_hosts_id_get_responses.go index 3ea59092e8b..75a78e2f879 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_hosts_id_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_hosts_id_get_responses.go @@ -7,6 +7,7 @@ package host_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1HostsIDGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1HostsIDGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1HostsIDGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1HostsIDGetOK() @@ -134,7 +135,7 @@ func (o *V1HostsIDGetOK) readResponse(response runtime.ClientResponse, consumer o.Payload = new(models.Host) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *V1HostsIDGetBadRequest) readResponse(response runtime.ClientResponse, c o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *V1HostsIDGetUnauthorized) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *V1HostsIDGetForbidden) readResponse(response runtime.ClientResponse, co o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *V1HostsIDGetNotFound) readResponse(response runtime.ClientResponse, con o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *V1HostsIDGetInternalServerError) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *V1HostsIDGetGatewayTimeout) readResponse(response runtime.ClientRespons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_hosts_id_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_hosts_id_put_responses.go index d71402c9e58..3f089e0a5f4 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_hosts_id_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_hosts_id_put_responses.go @@ -7,6 +7,7 @@ package host_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1HostsIDPutReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1HostsIDPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1HostsIDPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1HostsIDPutOK() @@ -140,7 +141,7 @@ func (o *V1HostsIDPutOK) readResponse(response runtime.ClientResponse, consumer o.Payload = new(models.Host) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -210,7 +211,7 @@ func (o *V1HostsIDPutBadRequest) readResponse(response runtime.ClientResponse, c o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -280,7 +281,7 @@ func (o *V1HostsIDPutUnauthorized) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -350,7 +351,7 @@ func (o *V1HostsIDPutForbidden) readResponse(response runtime.ClientResponse, co o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -420,7 +421,7 @@ func (o *V1HostsIDPutNotFound) readResponse(response runtime.ClientResponse, con o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -490,7 +491,7 @@ func (o *V1HostsIDPutUnprocessableEntity) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -560,7 +561,7 @@ func (o *V1HostsIDPutInternalServerError) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -630,7 +631,7 @@ func (o *V1HostsIDPutGatewayTimeout) readResponse(response runtime.ClientRespons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_hosts_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_hosts_post_responses.go index 55d71133e4f..2c935319d63 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_hosts_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/host_groups/v1_hosts_post_responses.go @@ -7,6 +7,7 @@ package host_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1HostsPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1HostsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1HostsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 201: result := NewV1HostsPostCreated() @@ -132,7 +133,7 @@ func (o *V1HostsPostCreated) GetPayload() models.HostList { func (o *V1HostsPostCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -202,7 +203,7 @@ func (o *V1HostsPostBadRequest) readResponse(response runtime.ClientResponse, co o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -272,7 +273,7 @@ func (o *V1HostsPostUnauthorized) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -342,7 +343,7 @@ func (o *V1HostsPostForbidden) readResponse(response runtime.ClientResponse, con o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -412,7 +413,7 @@ func (o *V1HostsPostUnprocessableEntity) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -482,7 +483,7 @@ func (o *V1HostsPostInternalServerError) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -552,7 +553,7 @@ func (o *V1HostsPostGatewayTimeout) readResponse(response runtime.ClientResponse o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/iaas_service_broker_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/iaas_service_broker_client.go index cefa48c36c3..24339234474 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/iaas_service_broker_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/iaas_service_broker_client.go @@ -71,7 +71,7 @@ type ClientService interface { ServiceBrokerHealth gets current server health */ func (a *Client) ServiceBrokerHealth(params *ServiceBrokerHealthParams, opts ...ClientOption) (*ServiceBrokerHealthOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewServiceBrokerHealthParams() } @@ -90,17 +90,22 @@ func (a *Client) ServiceBrokerHealth(params *ServiceBrokerHealthParams, opts ... for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*ServiceBrokerHealthOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for serviceBroker.health: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -109,7 +114,7 @@ func (a *Client) ServiceBrokerHealth(params *ServiceBrokerHealthParams, opts ... ServiceBrokerHealthHead gets current server health */ func (a *Client) ServiceBrokerHealthHead(params *ServiceBrokerHealthHeadParams, opts ...ClientOption) (*ServiceBrokerHealthHeadOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewServiceBrokerHealthHeadParams() } @@ -128,17 +133,22 @@ func (a *Client) ServiceBrokerHealthHead(params *ServiceBrokerHealthHeadParams, for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*ServiceBrokerHealthHeadOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for serviceBroker.health.head: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -147,7 +157,7 @@ func (a *Client) ServiceBrokerHealthHead(params *ServiceBrokerHealthHeadParams, ServiceBrokerTestTimeout gets current server version */ func (a *Client) ServiceBrokerTestTimeout(params *ServiceBrokerTestTimeoutParams, opts ...ClientOption) (*ServiceBrokerTestTimeoutOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewServiceBrokerTestTimeoutParams() } @@ -166,17 +176,22 @@ func (a *Client) ServiceBrokerTestTimeout(params *ServiceBrokerTestTimeoutParams for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*ServiceBrokerTestTimeoutOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for serviceBroker.test.timeout: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -185,7 +200,7 @@ func (a *Client) ServiceBrokerTestTimeout(params *ServiceBrokerTestTimeoutParams ServiceBrokerVersion gets current server version */ func (a *Client) ServiceBrokerVersion(params *ServiceBrokerVersionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerVersionOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewServiceBrokerVersionParams() } @@ -205,17 +220,22 @@ func (a *Client) ServiceBrokerVersion(params *ServiceBrokerVersionParams, authIn for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*ServiceBrokerVersionOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for serviceBroker.version: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_health_head_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_health_head_responses.go index de2604f7aff..f379331f746 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_health_head_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_health_head_responses.go @@ -7,6 +7,7 @@ package iaas_service_broker import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type ServiceBrokerHealthHeadReader struct { } // ReadResponse reads a server response into the received o. -func (o *ServiceBrokerHealthHeadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ServiceBrokerHealthHeadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewServiceBrokerHealthHeadOK() @@ -122,7 +123,7 @@ func (o *ServiceBrokerHealthHeadOK) readResponse(response runtime.ClientResponse o.Payload = new(models.Health) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -192,7 +193,7 @@ func (o *ServiceBrokerHealthHeadBadRequest) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -262,7 +263,7 @@ func (o *ServiceBrokerHealthHeadUnauthorized) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -332,7 +333,7 @@ func (o *ServiceBrokerHealthHeadForbidden) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -402,7 +403,7 @@ func (o *ServiceBrokerHealthHeadNotFound) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_health_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_health_responses.go index e89666a858e..c989f8589eb 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_health_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_health_responses.go @@ -7,6 +7,7 @@ package iaas_service_broker import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type ServiceBrokerHealthReader struct { } // ReadResponse reads a server response into the received o. -func (o *ServiceBrokerHealthReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ServiceBrokerHealthReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewServiceBrokerHealthOK() @@ -122,7 +123,7 @@ func (o *ServiceBrokerHealthOK) readResponse(response runtime.ClientResponse, co o.Payload = new(models.Health) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -192,7 +193,7 @@ func (o *ServiceBrokerHealthBadRequest) readResponse(response runtime.ClientResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -262,7 +263,7 @@ func (o *ServiceBrokerHealthUnauthorized) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -332,7 +333,7 @@ func (o *ServiceBrokerHealthForbidden) readResponse(response runtime.ClientRespo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -402,7 +403,7 @@ func (o *ServiceBrokerHealthNotFound) readResponse(response runtime.ClientRespon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_test_timeout_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_test_timeout_responses.go index b2304c38bff..060b564401e 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_test_timeout_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_test_timeout_responses.go @@ -7,6 +7,7 @@ package iaas_service_broker import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type ServiceBrokerTestTimeoutReader struct { } // ReadResponse reads a server response into the received o. -func (o *ServiceBrokerTestTimeoutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ServiceBrokerTestTimeoutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewServiceBrokerTestTimeoutOK() @@ -120,7 +121,7 @@ func (o *ServiceBrokerTestTimeoutOK) GetPayload() models.Object { func (o *ServiceBrokerTestTimeoutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -190,7 +191,7 @@ func (o *ServiceBrokerTestTimeoutBadRequest) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -260,7 +261,7 @@ func (o *ServiceBrokerTestTimeoutUnauthorized) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -330,7 +331,7 @@ func (o *ServiceBrokerTestTimeoutForbidden) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -400,7 +401,7 @@ func (o *ServiceBrokerTestTimeoutNotFound) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_version_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_version_responses.go index 04859bcca5f..baa7ecddc02 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_version_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker/service_broker_version_responses.go @@ -7,6 +7,7 @@ package iaas_service_broker import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type ServiceBrokerVersionReader struct { } // ReadResponse reads a server response into the received o. -func (o *ServiceBrokerVersionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ServiceBrokerVersionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewServiceBrokerVersionOK() @@ -122,7 +123,7 @@ func (o *ServiceBrokerVersionOK) readResponse(response runtime.ClientResponse, c o.Payload = new(models.Version) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -192,7 +193,7 @@ func (o *ServiceBrokerVersionBadRequest) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -262,7 +263,7 @@ func (o *ServiceBrokerVersionUnauthorized) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -332,7 +333,7 @@ func (o *ServiceBrokerVersionForbidden) readResponse(response runtime.ClientResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -402,7 +403,7 @@ func (o *ServiceBrokerVersionNotFound) readResponse(response runtime.ClientRespo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_capacity_management/internal_capacity_management_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_capacity_management/internal_capacity_management_client.go new file mode 100644 index 00000000000..e78ded4b8b5 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_capacity_management/internal_capacity_management_client.go @@ -0,0 +1,111 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internal_capacity_management + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// New creates a new internal capacity management API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +// New creates a new internal capacity management API client with basic auth credentials. +// It takes the following parameters: +// - host: http host (github.com). +// - basePath: any base path for the API client ("/v1", "/v3"). +// - scheme: http scheme ("http", "https"). +// - user: user for basic authentication header. +// - password: password for basic authentication header. +func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { + transport := httptransport.New(host, basePath, []string{scheme}) + transport.DefaultAuthentication = httptransport.BasicAuth(user, password) + return &Client{transport: transport, formats: strfmt.Default} +} + +// New creates a new internal capacity management API client with a bearer token for authentication. +// It takes the following parameters: +// - host: http host (github.com). +// - basePath: any base path for the API client ("/v1", "/v3"). +// - scheme: http scheme ("http", "https"). +// - bearerToken: bearer token for Bearer authentication header. +func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { + transport := httptransport.New(host, basePath, []string{scheme}) + transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) + return &Client{transport: transport, formats: strfmt.Default} +} + +/* +Client for internal capacity management API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption may be used to customize the behavior of Client methods. +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + InternalV1CapacityManagementPut(params *InternalV1CapacityManagementPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1CapacityManagementPutOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +InternalV1CapacityManagementPut enables or disable capacity on a system type +*/ +func (a *Client) InternalV1CapacityManagementPut(params *InternalV1CapacityManagementPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1CapacityManagementPutOK, error) { + // NOTE: parameters are not validated before sending + if params == nil { + params = NewInternalV1CapacityManagementPutParams() + } + op := &runtime.ClientOperation{ + ID: "internal.v1.capacity-management.put", + Method: "PUT", + PathPattern: "/internal/v1/capacity-management", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &InternalV1CapacityManagementPutReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + + // only one success response has to be checked + success, ok := result.(*InternalV1CapacityManagementPutOK) + if ok { + return success, nil + } + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for internal.v1.capacity-management.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_capacity_management/internal_v1_capacity_management_put_parameters.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_capacity_management/internal_v1_capacity_management_put_parameters.go new file mode 100644 index 00000000000..8a3f0e04eff --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_capacity_management/internal_v1_capacity_management_put_parameters.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internal_capacity_management + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// NewInternalV1CapacityManagementPutParams creates a new InternalV1CapacityManagementPutParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewInternalV1CapacityManagementPutParams() *InternalV1CapacityManagementPutParams { + return &InternalV1CapacityManagementPutParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewInternalV1CapacityManagementPutParamsWithTimeout creates a new InternalV1CapacityManagementPutParams object +// with the ability to set a timeout on a request. +func NewInternalV1CapacityManagementPutParamsWithTimeout(timeout time.Duration) *InternalV1CapacityManagementPutParams { + return &InternalV1CapacityManagementPutParams{ + timeout: timeout, + } +} + +// NewInternalV1CapacityManagementPutParamsWithContext creates a new InternalV1CapacityManagementPutParams object +// with the ability to set a context for a request. +func NewInternalV1CapacityManagementPutParamsWithContext(ctx context.Context) *InternalV1CapacityManagementPutParams { + return &InternalV1CapacityManagementPutParams{ + Context: ctx, + } +} + +// NewInternalV1CapacityManagementPutParamsWithHTTPClient creates a new InternalV1CapacityManagementPutParams object +// with the ability to set a custom HTTPClient for a request. +func NewInternalV1CapacityManagementPutParamsWithHTTPClient(client *http.Client) *InternalV1CapacityManagementPutParams { + return &InternalV1CapacityManagementPutParams{ + HTTPClient: client, + } +} + +/* +InternalV1CapacityManagementPutParams contains all the parameters to send to the API endpoint + + for the internal v1 capacity management put operation. + + Typically these are written to a http.Request. +*/ +type InternalV1CapacityManagementPutParams struct { + + /* Body. + + Parameters for enabling and disabling capacity + */ + Body *models.InternalCapacityManagementRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the internal v1 capacity management put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *InternalV1CapacityManagementPutParams) WithDefaults() *InternalV1CapacityManagementPutParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the internal v1 capacity management put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *InternalV1CapacityManagementPutParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the internal v1 capacity management put params +func (o *InternalV1CapacityManagementPutParams) WithTimeout(timeout time.Duration) *InternalV1CapacityManagementPutParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the internal v1 capacity management put params +func (o *InternalV1CapacityManagementPutParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the internal v1 capacity management put params +func (o *InternalV1CapacityManagementPutParams) WithContext(ctx context.Context) *InternalV1CapacityManagementPutParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the internal v1 capacity management put params +func (o *InternalV1CapacityManagementPutParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the internal v1 capacity management put params +func (o *InternalV1CapacityManagementPutParams) WithHTTPClient(client *http.Client) *InternalV1CapacityManagementPutParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the internal v1 capacity management put params +func (o *InternalV1CapacityManagementPutParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the internal v1 capacity management put params +func (o *InternalV1CapacityManagementPutParams) WithBody(body *models.InternalCapacityManagementRequest) *InternalV1CapacityManagementPutParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the internal v1 capacity management put params +func (o *InternalV1CapacityManagementPutParams) SetBody(body *models.InternalCapacityManagementRequest) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *InternalV1CapacityManagementPutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_capacity_management/internal_v1_capacity_management_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_capacity_management/internal_v1_capacity_management_put_responses.go new file mode 100644 index 00000000000..74c5ec8a2c9 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_capacity_management/internal_v1_capacity_management_put_responses.go @@ -0,0 +1,411 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internal_capacity_management + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + stderrors "errors" + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// InternalV1CapacityManagementPutReader is a Reader for the InternalV1CapacityManagementPut structure. +type InternalV1CapacityManagementPutReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *InternalV1CapacityManagementPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { + switch response.Code() { + case 200: + result := NewInternalV1CapacityManagementPutOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewInternalV1CapacityManagementPutBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewInternalV1CapacityManagementPutUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewInternalV1CapacityManagementPutForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewInternalV1CapacityManagementPutInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[PUT /internal/v1/capacity-management] internal.v1.capacity-management.put", response, response.Code()) + } +} + +// NewInternalV1CapacityManagementPutOK creates a InternalV1CapacityManagementPutOK with default headers values +func NewInternalV1CapacityManagementPutOK() *InternalV1CapacityManagementPutOK { + return &InternalV1CapacityManagementPutOK{} +} + +/* +InternalV1CapacityManagementPutOK describes a response with status code 200, with default header values. + +OK +*/ +type InternalV1CapacityManagementPutOK struct { + Payload *models.InternalCapacityManagementResponse +} + +// IsSuccess returns true when this internal v1 capacity management put o k response has a 2xx status code +func (o *InternalV1CapacityManagementPutOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this internal v1 capacity management put o k response has a 3xx status code +func (o *InternalV1CapacityManagementPutOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this internal v1 capacity management put o k response has a 4xx status code +func (o *InternalV1CapacityManagementPutOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this internal v1 capacity management put o k response has a 5xx status code +func (o *InternalV1CapacityManagementPutOK) IsServerError() bool { + return false +} + +// IsCode returns true when this internal v1 capacity management put o k response a status code equal to that given +func (o *InternalV1CapacityManagementPutOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the internal v1 capacity management put o k response +func (o *InternalV1CapacityManagementPutOK) Code() int { + return 200 +} + +func (o *InternalV1CapacityManagementPutOK) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /internal/v1/capacity-management][%d] internalV1CapacityManagementPutOK %s", 200, payload) +} + +func (o *InternalV1CapacityManagementPutOK) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /internal/v1/capacity-management][%d] internalV1CapacityManagementPutOK %s", 200, payload) +} + +func (o *InternalV1CapacityManagementPutOK) GetPayload() *models.InternalCapacityManagementResponse { + return o.Payload +} + +func (o *InternalV1CapacityManagementPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.InternalCapacityManagementResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewInternalV1CapacityManagementPutBadRequest creates a InternalV1CapacityManagementPutBadRequest with default headers values +func NewInternalV1CapacityManagementPutBadRequest() *InternalV1CapacityManagementPutBadRequest { + return &InternalV1CapacityManagementPutBadRequest{} +} + +/* +InternalV1CapacityManagementPutBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type InternalV1CapacityManagementPutBadRequest struct { + Payload *models.Error +} + +// IsSuccess returns true when this internal v1 capacity management put bad request response has a 2xx status code +func (o *InternalV1CapacityManagementPutBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this internal v1 capacity management put bad request response has a 3xx status code +func (o *InternalV1CapacityManagementPutBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this internal v1 capacity management put bad request response has a 4xx status code +func (o *InternalV1CapacityManagementPutBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this internal v1 capacity management put bad request response has a 5xx status code +func (o *InternalV1CapacityManagementPutBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this internal v1 capacity management put bad request response a status code equal to that given +func (o *InternalV1CapacityManagementPutBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the internal v1 capacity management put bad request response +func (o *InternalV1CapacityManagementPutBadRequest) Code() int { + return 400 +} + +func (o *InternalV1CapacityManagementPutBadRequest) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /internal/v1/capacity-management][%d] internalV1CapacityManagementPutBadRequest %s", 400, payload) +} + +func (o *InternalV1CapacityManagementPutBadRequest) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /internal/v1/capacity-management][%d] internalV1CapacityManagementPutBadRequest %s", 400, payload) +} + +func (o *InternalV1CapacityManagementPutBadRequest) GetPayload() *models.Error { + return o.Payload +} + +func (o *InternalV1CapacityManagementPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewInternalV1CapacityManagementPutUnauthorized creates a InternalV1CapacityManagementPutUnauthorized with default headers values +func NewInternalV1CapacityManagementPutUnauthorized() *InternalV1CapacityManagementPutUnauthorized { + return &InternalV1CapacityManagementPutUnauthorized{} +} + +/* +InternalV1CapacityManagementPutUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type InternalV1CapacityManagementPutUnauthorized struct { + Payload *models.Error +} + +// IsSuccess returns true when this internal v1 capacity management put unauthorized response has a 2xx status code +func (o *InternalV1CapacityManagementPutUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this internal v1 capacity management put unauthorized response has a 3xx status code +func (o *InternalV1CapacityManagementPutUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this internal v1 capacity management put unauthorized response has a 4xx status code +func (o *InternalV1CapacityManagementPutUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this internal v1 capacity management put unauthorized response has a 5xx status code +func (o *InternalV1CapacityManagementPutUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this internal v1 capacity management put unauthorized response a status code equal to that given +func (o *InternalV1CapacityManagementPutUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the internal v1 capacity management put unauthorized response +func (o *InternalV1CapacityManagementPutUnauthorized) Code() int { + return 401 +} + +func (o *InternalV1CapacityManagementPutUnauthorized) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /internal/v1/capacity-management][%d] internalV1CapacityManagementPutUnauthorized %s", 401, payload) +} + +func (o *InternalV1CapacityManagementPutUnauthorized) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /internal/v1/capacity-management][%d] internalV1CapacityManagementPutUnauthorized %s", 401, payload) +} + +func (o *InternalV1CapacityManagementPutUnauthorized) GetPayload() *models.Error { + return o.Payload +} + +func (o *InternalV1CapacityManagementPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewInternalV1CapacityManagementPutForbidden creates a InternalV1CapacityManagementPutForbidden with default headers values +func NewInternalV1CapacityManagementPutForbidden() *InternalV1CapacityManagementPutForbidden { + return &InternalV1CapacityManagementPutForbidden{} +} + +/* +InternalV1CapacityManagementPutForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type InternalV1CapacityManagementPutForbidden struct { + Payload *models.Error +} + +// IsSuccess returns true when this internal v1 capacity management put forbidden response has a 2xx status code +func (o *InternalV1CapacityManagementPutForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this internal v1 capacity management put forbidden response has a 3xx status code +func (o *InternalV1CapacityManagementPutForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this internal v1 capacity management put forbidden response has a 4xx status code +func (o *InternalV1CapacityManagementPutForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this internal v1 capacity management put forbidden response has a 5xx status code +func (o *InternalV1CapacityManagementPutForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this internal v1 capacity management put forbidden response a status code equal to that given +func (o *InternalV1CapacityManagementPutForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the internal v1 capacity management put forbidden response +func (o *InternalV1CapacityManagementPutForbidden) Code() int { + return 403 +} + +func (o *InternalV1CapacityManagementPutForbidden) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /internal/v1/capacity-management][%d] internalV1CapacityManagementPutForbidden %s", 403, payload) +} + +func (o *InternalV1CapacityManagementPutForbidden) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /internal/v1/capacity-management][%d] internalV1CapacityManagementPutForbidden %s", 403, payload) +} + +func (o *InternalV1CapacityManagementPutForbidden) GetPayload() *models.Error { + return o.Payload +} + +func (o *InternalV1CapacityManagementPutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewInternalV1CapacityManagementPutInternalServerError creates a InternalV1CapacityManagementPutInternalServerError with default headers values +func NewInternalV1CapacityManagementPutInternalServerError() *InternalV1CapacityManagementPutInternalServerError { + return &InternalV1CapacityManagementPutInternalServerError{} +} + +/* +InternalV1CapacityManagementPutInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type InternalV1CapacityManagementPutInternalServerError struct { + Payload *models.Error +} + +// IsSuccess returns true when this internal v1 capacity management put internal server error response has a 2xx status code +func (o *InternalV1CapacityManagementPutInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this internal v1 capacity management put internal server error response has a 3xx status code +func (o *InternalV1CapacityManagementPutInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this internal v1 capacity management put internal server error response has a 4xx status code +func (o *InternalV1CapacityManagementPutInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this internal v1 capacity management put internal server error response has a 5xx status code +func (o *InternalV1CapacityManagementPutInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this internal v1 capacity management put internal server error response a status code equal to that given +func (o *InternalV1CapacityManagementPutInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the internal v1 capacity management put internal server error response +func (o *InternalV1CapacityManagementPutInternalServerError) Code() int { + return 500 +} + +func (o *InternalV1CapacityManagementPutInternalServerError) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /internal/v1/capacity-management][%d] internalV1CapacityManagementPutInternalServerError %s", 500, payload) +} + +func (o *InternalV1CapacityManagementPutInternalServerError) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /internal/v1/capacity-management][%d] internalV1CapacityManagementPutInternalServerError %s", 500, payload) +} + +func (o *InternalV1CapacityManagementPutInternalServerError) GetPayload() *models.Error { + return o.Payload +} + +func (o *InternalV1CapacityManagementPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_dedicated_hosts/internal_operations_dedicated_hosts_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_dedicated_hosts/internal_operations_dedicated_hosts_client.go index c1483185385..634e292cd66 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_dedicated_hosts/internal_operations_dedicated_hosts_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_dedicated_hosts/internal_operations_dedicated_hosts_client.go @@ -67,7 +67,7 @@ type ClientService interface { InternalV1OperationsDedicatedhostsDelete deletes a dedicated host c r n */ func (a *Client) InternalV1OperationsDedicatedhostsDelete(params *InternalV1OperationsDedicatedhostsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1OperationsDedicatedhostsDeleteNoContent, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewInternalV1OperationsDedicatedhostsDeleteParams() } @@ -87,17 +87,22 @@ func (a *Client) InternalV1OperationsDedicatedhostsDelete(params *InternalV1Oper for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*InternalV1OperationsDedicatedhostsDeleteNoContent) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for internal.v1.operations.dedicatedhosts.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -106,7 +111,7 @@ func (a *Client) InternalV1OperationsDedicatedhostsDelete(params *InternalV1Oper InternalV1OperationsDedicatedhostsPost creates a c r n for a dedicated host */ func (a *Client) InternalV1OperationsDedicatedhostsPost(params *InternalV1OperationsDedicatedhostsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1OperationsDedicatedhostsPostCreated, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewInternalV1OperationsDedicatedhostsPostParams() } @@ -126,17 +131,22 @@ func (a *Client) InternalV1OperationsDedicatedhostsPost(params *InternalV1Operat for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*InternalV1OperationsDedicatedhostsPostCreated) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for internal.v1.operations.dedicatedhosts.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_dedicated_hosts/internal_v1_operations_dedicatedhosts_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_dedicated_hosts/internal_v1_operations_dedicatedhosts_delete_responses.go index 07ce013b39d..b5ef01cb578 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_dedicated_hosts/internal_v1_operations_dedicatedhosts_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_dedicated_hosts/internal_v1_operations_dedicatedhosts_delete_responses.go @@ -7,6 +7,7 @@ package internal_operations_dedicated_hosts import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type InternalV1OperationsDedicatedhostsDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *InternalV1OperationsDedicatedhostsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *InternalV1OperationsDedicatedhostsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 204: result := NewInternalV1OperationsDedicatedhostsDeleteNoContent() @@ -196,7 +197,7 @@ func (o *InternalV1OperationsDedicatedhostsDeleteBadRequest) readResponse(respon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -266,7 +267,7 @@ func (o *InternalV1OperationsDedicatedhostsDeleteUnauthorized) readResponse(resp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -336,7 +337,7 @@ func (o *InternalV1OperationsDedicatedhostsDeleteForbidden) readResponse(respons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -406,7 +407,7 @@ func (o *InternalV1OperationsDedicatedhostsDeleteNotFound) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -476,7 +477,7 @@ func (o *InternalV1OperationsDedicatedhostsDeleteGone) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -546,7 +547,7 @@ func (o *InternalV1OperationsDedicatedhostsDeleteTooManyRequests) readResponse(r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -616,7 +617,7 @@ func (o *InternalV1OperationsDedicatedhostsDeleteInternalServerError) readRespon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_dedicated_hosts/internal_v1_operations_dedicatedhosts_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_dedicated_hosts/internal_v1_operations_dedicatedhosts_post_responses.go index bcf2fbb389b..c8510a44318 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_dedicated_hosts/internal_v1_operations_dedicatedhosts_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_dedicated_hosts/internal_v1_operations_dedicatedhosts_post_responses.go @@ -7,6 +7,7 @@ package internal_operations_dedicated_hosts import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type InternalV1OperationsDedicatedhostsPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *InternalV1OperationsDedicatedhostsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *InternalV1OperationsDedicatedhostsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 201: result := NewInternalV1OperationsDedicatedhostsPostCreated() @@ -128,7 +129,7 @@ func (o *InternalV1OperationsDedicatedhostsPostCreated) readResponse(response ru o.Payload = new(models.InternalOperationsResponse) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *InternalV1OperationsDedicatedhostsPostBadRequest) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *InternalV1OperationsDedicatedhostsPostUnauthorized) readResponse(respon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *InternalV1OperationsDedicatedhostsPostForbidden) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *InternalV1OperationsDedicatedhostsPostTooManyRequests) readResponse(res o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *InternalV1OperationsDedicatedhostsPostInternalServerError) readResponse o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_images/internal_operations_images_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_images/internal_operations_images_client.go index fbb725cd077..7426d5dfa24 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_images/internal_operations_images_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_images/internal_operations_images_client.go @@ -67,7 +67,7 @@ type ClientService interface { InternalV1OperationsImagesDelete deletes an image c r n */ func (a *Client) InternalV1OperationsImagesDelete(params *InternalV1OperationsImagesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1OperationsImagesDeleteNoContent, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewInternalV1OperationsImagesDeleteParams() } @@ -87,17 +87,22 @@ func (a *Client) InternalV1OperationsImagesDelete(params *InternalV1OperationsIm for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*InternalV1OperationsImagesDeleteNoContent) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for internal.v1.operations.images.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -106,7 +111,7 @@ func (a *Client) InternalV1OperationsImagesDelete(params *InternalV1OperationsIm InternalV1OperationsImagesPost creates a c r n for an image */ func (a *Client) InternalV1OperationsImagesPost(params *InternalV1OperationsImagesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1OperationsImagesPostCreated, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewInternalV1OperationsImagesPostParams() } @@ -126,17 +131,22 @@ func (a *Client) InternalV1OperationsImagesPost(params *InternalV1OperationsImag for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*InternalV1OperationsImagesPostCreated) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for internal.v1.operations.images.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_images/internal_v1_operations_images_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_images/internal_v1_operations_images_delete_responses.go index 20a8942f367..2ea0d0c1334 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_images/internal_v1_operations_images_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_images/internal_v1_operations_images_delete_responses.go @@ -7,6 +7,7 @@ package internal_operations_images import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type InternalV1OperationsImagesDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *InternalV1OperationsImagesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *InternalV1OperationsImagesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 204: result := NewInternalV1OperationsImagesDeleteNoContent() @@ -196,7 +197,7 @@ func (o *InternalV1OperationsImagesDeleteBadRequest) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -266,7 +267,7 @@ func (o *InternalV1OperationsImagesDeleteUnauthorized) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -336,7 +337,7 @@ func (o *InternalV1OperationsImagesDeleteForbidden) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -406,7 +407,7 @@ func (o *InternalV1OperationsImagesDeleteNotFound) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -476,7 +477,7 @@ func (o *InternalV1OperationsImagesDeleteGone) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -546,7 +547,7 @@ func (o *InternalV1OperationsImagesDeleteTooManyRequests) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -616,7 +617,7 @@ func (o *InternalV1OperationsImagesDeleteInternalServerError) readResponse(respo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_images/internal_v1_operations_images_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_images/internal_v1_operations_images_post_responses.go index ae899eba8ed..09086074668 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_images/internal_v1_operations_images_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_images/internal_v1_operations_images_post_responses.go @@ -7,6 +7,7 @@ package internal_operations_images import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type InternalV1OperationsImagesPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *InternalV1OperationsImagesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *InternalV1OperationsImagesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 201: result := NewInternalV1OperationsImagesPostCreated() @@ -128,7 +129,7 @@ func (o *InternalV1OperationsImagesPostCreated) readResponse(response runtime.Cl o.Payload = new(models.InternalOperationsResponse) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *InternalV1OperationsImagesPostBadRequest) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *InternalV1OperationsImagesPostUnauthorized) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *InternalV1OperationsImagesPostForbidden) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *InternalV1OperationsImagesPostTooManyRequests) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *InternalV1OperationsImagesPostInternalServerError) readResponse(respons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_network_address_groups/internal_operations_network_address_groups_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_network_address_groups/internal_operations_network_address_groups_client.go index 3151549caec..fdcedd75120 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_network_address_groups/internal_operations_network_address_groups_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_network_address_groups/internal_operations_network_address_groups_client.go @@ -67,7 +67,7 @@ type ClientService interface { InternalV1OperationsNetworkaddressgroupsDelete deletes a network address group c r n */ func (a *Client) InternalV1OperationsNetworkaddressgroupsDelete(params *InternalV1OperationsNetworkaddressgroupsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1OperationsNetworkaddressgroupsDeleteNoContent, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewInternalV1OperationsNetworkaddressgroupsDeleteParams() } @@ -87,17 +87,22 @@ func (a *Client) InternalV1OperationsNetworkaddressgroupsDelete(params *Internal for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*InternalV1OperationsNetworkaddressgroupsDeleteNoContent) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for internal.v1.operations.networkaddressgroups.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -106,7 +111,7 @@ func (a *Client) InternalV1OperationsNetworkaddressgroupsDelete(params *Internal InternalV1OperationsNetworkaddressgroupsPost creates a c r n for a network address group */ func (a *Client) InternalV1OperationsNetworkaddressgroupsPost(params *InternalV1OperationsNetworkaddressgroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1OperationsNetworkaddressgroupsPostCreated, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewInternalV1OperationsNetworkaddressgroupsPostParams() } @@ -126,17 +131,22 @@ func (a *Client) InternalV1OperationsNetworkaddressgroupsPost(params *InternalV1 for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*InternalV1OperationsNetworkaddressgroupsPostCreated) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for internal.v1.operations.networkaddressgroups.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_network_address_groups/internal_v1_operations_networkaddressgroups_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_network_address_groups/internal_v1_operations_networkaddressgroups_delete_responses.go index 2ef0bbe6771..07c04fa3e4e 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_network_address_groups/internal_v1_operations_networkaddressgroups_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_network_address_groups/internal_v1_operations_networkaddressgroups_delete_responses.go @@ -7,6 +7,7 @@ package internal_operations_network_address_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type InternalV1OperationsNetworkaddressgroupsDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *InternalV1OperationsNetworkaddressgroupsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *InternalV1OperationsNetworkaddressgroupsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 204: result := NewInternalV1OperationsNetworkaddressgroupsDeleteNoContent() @@ -196,7 +197,7 @@ func (o *InternalV1OperationsNetworkaddressgroupsDeleteBadRequest) readResponse( o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -266,7 +267,7 @@ func (o *InternalV1OperationsNetworkaddressgroupsDeleteUnauthorized) readRespons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -336,7 +337,7 @@ func (o *InternalV1OperationsNetworkaddressgroupsDeleteForbidden) readResponse(r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -406,7 +407,7 @@ func (o *InternalV1OperationsNetworkaddressgroupsDeleteNotFound) readResponse(re o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -476,7 +477,7 @@ func (o *InternalV1OperationsNetworkaddressgroupsDeleteGone) readResponse(respon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -546,7 +547,7 @@ func (o *InternalV1OperationsNetworkaddressgroupsDeleteTooManyRequests) readResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -616,7 +617,7 @@ func (o *InternalV1OperationsNetworkaddressgroupsDeleteInternalServerError) read o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_network_address_groups/internal_v1_operations_networkaddressgroups_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_network_address_groups/internal_v1_operations_networkaddressgroups_post_responses.go index d1bf11ca3be..a00ab984ea9 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_network_address_groups/internal_v1_operations_networkaddressgroups_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_network_address_groups/internal_v1_operations_networkaddressgroups_post_responses.go @@ -7,6 +7,7 @@ package internal_operations_network_address_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type InternalV1OperationsNetworkaddressgroupsPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *InternalV1OperationsNetworkaddressgroupsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *InternalV1OperationsNetworkaddressgroupsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 201: result := NewInternalV1OperationsNetworkaddressgroupsPostCreated() @@ -128,7 +129,7 @@ func (o *InternalV1OperationsNetworkaddressgroupsPostCreated) readResponse(respo o.Payload = new(models.InternalOperationsResponse) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *InternalV1OperationsNetworkaddressgroupsPostBadRequest) readResponse(re o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *InternalV1OperationsNetworkaddressgroupsPostUnauthorized) readResponse( o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *InternalV1OperationsNetworkaddressgroupsPostForbidden) readResponse(res o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *InternalV1OperationsNetworkaddressgroupsPostTooManyRequests) readRespon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *InternalV1OperationsNetworkaddressgroupsPostInternalServerError) readRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_network_interfaces/internal_operations_network_interfaces_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_network_interfaces/internal_operations_network_interfaces_client.go index ce01598036e..258e1e72e0e 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_network_interfaces/internal_operations_network_interfaces_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_network_interfaces/internal_operations_network_interfaces_client.go @@ -67,7 +67,7 @@ type ClientService interface { InternalV1OperationsNetworkinterfacesDelete deletes a network interfaces c r n */ func (a *Client) InternalV1OperationsNetworkinterfacesDelete(params *InternalV1OperationsNetworkinterfacesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1OperationsNetworkinterfacesDeleteNoContent, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewInternalV1OperationsNetworkinterfacesDeleteParams() } @@ -87,17 +87,22 @@ func (a *Client) InternalV1OperationsNetworkinterfacesDelete(params *InternalV1O for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*InternalV1OperationsNetworkinterfacesDeleteNoContent) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for internal.v1.operations.networkinterfaces.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -106,7 +111,7 @@ func (a *Client) InternalV1OperationsNetworkinterfacesDelete(params *InternalV1O InternalV1OperationsNetworkinterfacesPost creates a c r n for a network interface */ func (a *Client) InternalV1OperationsNetworkinterfacesPost(params *InternalV1OperationsNetworkinterfacesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1OperationsNetworkinterfacesPostCreated, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewInternalV1OperationsNetworkinterfacesPostParams() } @@ -126,17 +131,22 @@ func (a *Client) InternalV1OperationsNetworkinterfacesPost(params *InternalV1Ope for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*InternalV1OperationsNetworkinterfacesPostCreated) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for internal.v1.operations.networkinterfaces.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_network_interfaces/internal_v1_operations_networkinterfaces_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_network_interfaces/internal_v1_operations_networkinterfaces_delete_responses.go index de64aeb8000..3f48e17f654 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_network_interfaces/internal_v1_operations_networkinterfaces_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_network_interfaces/internal_v1_operations_networkinterfaces_delete_responses.go @@ -7,6 +7,7 @@ package internal_operations_network_interfaces import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type InternalV1OperationsNetworkinterfacesDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *InternalV1OperationsNetworkinterfacesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *InternalV1OperationsNetworkinterfacesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 204: result := NewInternalV1OperationsNetworkinterfacesDeleteNoContent() @@ -196,7 +197,7 @@ func (o *InternalV1OperationsNetworkinterfacesDeleteBadRequest) readResponse(res o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -266,7 +267,7 @@ func (o *InternalV1OperationsNetworkinterfacesDeleteUnauthorized) readResponse(r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -336,7 +337,7 @@ func (o *InternalV1OperationsNetworkinterfacesDeleteForbidden) readResponse(resp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -406,7 +407,7 @@ func (o *InternalV1OperationsNetworkinterfacesDeleteNotFound) readResponse(respo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -476,7 +477,7 @@ func (o *InternalV1OperationsNetworkinterfacesDeleteGone) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -546,7 +547,7 @@ func (o *InternalV1OperationsNetworkinterfacesDeleteTooManyRequests) readRespons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -616,7 +617,7 @@ func (o *InternalV1OperationsNetworkinterfacesDeleteInternalServerError) readRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_network_interfaces/internal_v1_operations_networkinterfaces_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_network_interfaces/internal_v1_operations_networkinterfaces_post_responses.go index d660a3b82c3..092b8c82c74 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_network_interfaces/internal_v1_operations_networkinterfaces_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_network_interfaces/internal_v1_operations_networkinterfaces_post_responses.go @@ -7,6 +7,7 @@ package internal_operations_network_interfaces import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type InternalV1OperationsNetworkinterfacesPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *InternalV1OperationsNetworkinterfacesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *InternalV1OperationsNetworkinterfacesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 201: result := NewInternalV1OperationsNetworkinterfacesPostCreated() @@ -128,7 +129,7 @@ func (o *InternalV1OperationsNetworkinterfacesPostCreated) readResponse(response o.Payload = new(models.InternalOperationsResponse) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *InternalV1OperationsNetworkinterfacesPostBadRequest) readResponse(respo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *InternalV1OperationsNetworkinterfacesPostUnauthorized) readResponse(res o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *InternalV1OperationsNetworkinterfacesPostForbidden) readResponse(respon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *InternalV1OperationsNetworkinterfacesPostTooManyRequests) readResponse( o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *InternalV1OperationsNetworkinterfacesPostInternalServerError) readRespo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_network_security_groups/internal_operations_network_security_groups_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_network_security_groups/internal_operations_network_security_groups_client.go index ea5918a1870..3aaa7f22f47 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_network_security_groups/internal_operations_network_security_groups_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_network_security_groups/internal_operations_network_security_groups_client.go @@ -67,7 +67,7 @@ type ClientService interface { InternalV1OperationsNetworksecuritygroupsDelete deletes a network security group c r n */ func (a *Client) InternalV1OperationsNetworksecuritygroupsDelete(params *InternalV1OperationsNetworksecuritygroupsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1OperationsNetworksecuritygroupsDeleteNoContent, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewInternalV1OperationsNetworksecuritygroupsDeleteParams() } @@ -87,17 +87,22 @@ func (a *Client) InternalV1OperationsNetworksecuritygroupsDelete(params *Interna for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*InternalV1OperationsNetworksecuritygroupsDeleteNoContent) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for internal.v1.operations.networksecuritygroups.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -106,7 +111,7 @@ func (a *Client) InternalV1OperationsNetworksecuritygroupsDelete(params *Interna InternalV1OperationsNetworksecuritygroupsPost creates a c r n for a network security group */ func (a *Client) InternalV1OperationsNetworksecuritygroupsPost(params *InternalV1OperationsNetworksecuritygroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1OperationsNetworksecuritygroupsPostCreated, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewInternalV1OperationsNetworksecuritygroupsPostParams() } @@ -126,17 +131,22 @@ func (a *Client) InternalV1OperationsNetworksecuritygroupsPost(params *InternalV for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*InternalV1OperationsNetworksecuritygroupsPostCreated) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for internal.v1.operations.networksecuritygroups.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_network_security_groups/internal_v1_operations_networksecuritygroups_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_network_security_groups/internal_v1_operations_networksecuritygroups_delete_responses.go index 3b6aa923f18..95296245825 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_network_security_groups/internal_v1_operations_networksecuritygroups_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_network_security_groups/internal_v1_operations_networksecuritygroups_delete_responses.go @@ -7,6 +7,7 @@ package internal_operations_network_security_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type InternalV1OperationsNetworksecuritygroupsDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *InternalV1OperationsNetworksecuritygroupsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *InternalV1OperationsNetworksecuritygroupsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 204: result := NewInternalV1OperationsNetworksecuritygroupsDeleteNoContent() @@ -196,7 +197,7 @@ func (o *InternalV1OperationsNetworksecuritygroupsDeleteBadRequest) readResponse o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -266,7 +267,7 @@ func (o *InternalV1OperationsNetworksecuritygroupsDeleteUnauthorized) readRespon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -336,7 +337,7 @@ func (o *InternalV1OperationsNetworksecuritygroupsDeleteForbidden) readResponse( o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -406,7 +407,7 @@ func (o *InternalV1OperationsNetworksecuritygroupsDeleteNotFound) readResponse(r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -476,7 +477,7 @@ func (o *InternalV1OperationsNetworksecuritygroupsDeleteGone) readResponse(respo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -546,7 +547,7 @@ func (o *InternalV1OperationsNetworksecuritygroupsDeleteTooManyRequests) readRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -616,7 +617,7 @@ func (o *InternalV1OperationsNetworksecuritygroupsDeleteInternalServerError) rea o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_network_security_groups/internal_v1_operations_networksecuritygroups_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_network_security_groups/internal_v1_operations_networksecuritygroups_post_responses.go index c9ffef42eac..bf86b6779b6 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_network_security_groups/internal_v1_operations_networksecuritygroups_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_network_security_groups/internal_v1_operations_networksecuritygroups_post_responses.go @@ -7,6 +7,7 @@ package internal_operations_network_security_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type InternalV1OperationsNetworksecuritygroupsPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *InternalV1OperationsNetworksecuritygroupsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *InternalV1OperationsNetworksecuritygroupsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 201: result := NewInternalV1OperationsNetworksecuritygroupsPostCreated() @@ -128,7 +129,7 @@ func (o *InternalV1OperationsNetworksecuritygroupsPostCreated) readResponse(resp o.Payload = new(models.InternalOperationsResponse) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *InternalV1OperationsNetworksecuritygroupsPostBadRequest) readResponse(r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *InternalV1OperationsNetworksecuritygroupsPostUnauthorized) readResponse o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *InternalV1OperationsNetworksecuritygroupsPostForbidden) readResponse(re o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *InternalV1OperationsNetworksecuritygroupsPostTooManyRequests) readRespo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *InternalV1OperationsNetworksecuritygroupsPostInternalServerError) readR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_networks/internal_operations_networks_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_networks/internal_operations_networks_client.go index ac8150365b7..d1c7690d76e 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_networks/internal_operations_networks_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_networks/internal_operations_networks_client.go @@ -67,7 +67,7 @@ type ClientService interface { InternalV1OperationsNetworksDelete deletes a network c r n */ func (a *Client) InternalV1OperationsNetworksDelete(params *InternalV1OperationsNetworksDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1OperationsNetworksDeleteNoContent, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewInternalV1OperationsNetworksDeleteParams() } @@ -87,17 +87,22 @@ func (a *Client) InternalV1OperationsNetworksDelete(params *InternalV1Operations for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*InternalV1OperationsNetworksDeleteNoContent) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for internal.v1.operations.networks.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -106,7 +111,7 @@ func (a *Client) InternalV1OperationsNetworksDelete(params *InternalV1Operations InternalV1OperationsNetworksPost creates a c r n for a network */ func (a *Client) InternalV1OperationsNetworksPost(params *InternalV1OperationsNetworksPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1OperationsNetworksPostCreated, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewInternalV1OperationsNetworksPostParams() } @@ -126,17 +131,22 @@ func (a *Client) InternalV1OperationsNetworksPost(params *InternalV1OperationsNe for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*InternalV1OperationsNetworksPostCreated) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for internal.v1.operations.networks.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_networks/internal_v1_operations_networks_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_networks/internal_v1_operations_networks_delete_responses.go index 2900213eded..730c14146c7 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_networks/internal_v1_operations_networks_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_networks/internal_v1_operations_networks_delete_responses.go @@ -7,6 +7,7 @@ package internal_operations_networks import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type InternalV1OperationsNetworksDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *InternalV1OperationsNetworksDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *InternalV1OperationsNetworksDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 204: result := NewInternalV1OperationsNetworksDeleteNoContent() @@ -196,7 +197,7 @@ func (o *InternalV1OperationsNetworksDeleteBadRequest) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -266,7 +267,7 @@ func (o *InternalV1OperationsNetworksDeleteUnauthorized) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -336,7 +337,7 @@ func (o *InternalV1OperationsNetworksDeleteForbidden) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -406,7 +407,7 @@ func (o *InternalV1OperationsNetworksDeleteNotFound) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -476,7 +477,7 @@ func (o *InternalV1OperationsNetworksDeleteGone) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -546,7 +547,7 @@ func (o *InternalV1OperationsNetworksDeleteTooManyRequests) readResponse(respons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -616,7 +617,7 @@ func (o *InternalV1OperationsNetworksDeleteInternalServerError) readResponse(res o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_networks/internal_v1_operations_networks_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_networks/internal_v1_operations_networks_post_responses.go index 0c2cf1de306..a951b55d2fb 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_networks/internal_v1_operations_networks_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_networks/internal_v1_operations_networks_post_responses.go @@ -7,6 +7,7 @@ package internal_operations_networks import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type InternalV1OperationsNetworksPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *InternalV1OperationsNetworksPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *InternalV1OperationsNetworksPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 201: result := NewInternalV1OperationsNetworksPostCreated() @@ -128,7 +129,7 @@ func (o *InternalV1OperationsNetworksPostCreated) readResponse(response runtime. o.Payload = new(models.InternalOperationsResponse) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *InternalV1OperationsNetworksPostBadRequest) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *InternalV1OperationsNetworksPostUnauthorized) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *InternalV1OperationsNetworksPostForbidden) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *InternalV1OperationsNetworksPostTooManyRequests) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *InternalV1OperationsNetworksPostInternalServerError) readResponse(respo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_pvm_instances/internal_operations_pvm_instances_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_pvm_instances/internal_operations_pvm_instances_client.go index 337a49bde06..6c5ba4a0aa9 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_pvm_instances/internal_operations_pvm_instances_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_pvm_instances/internal_operations_pvm_instances_client.go @@ -67,7 +67,7 @@ type ClientService interface { InternalV1OperationsPvminstancesDelete deletes a p VM instance c r n */ func (a *Client) InternalV1OperationsPvminstancesDelete(params *InternalV1OperationsPvminstancesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1OperationsPvminstancesDeleteNoContent, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewInternalV1OperationsPvminstancesDeleteParams() } @@ -87,17 +87,22 @@ func (a *Client) InternalV1OperationsPvminstancesDelete(params *InternalV1Operat for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*InternalV1OperationsPvminstancesDeleteNoContent) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for internal.v1.operations.pvminstances.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -106,7 +111,7 @@ func (a *Client) InternalV1OperationsPvminstancesDelete(params *InternalV1Operat InternalV1OperationsPvminstancesPost creates a c r n for a p VM instance */ func (a *Client) InternalV1OperationsPvminstancesPost(params *InternalV1OperationsPvminstancesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1OperationsPvminstancesPostCreated, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewInternalV1OperationsPvminstancesPostParams() } @@ -126,17 +131,22 @@ func (a *Client) InternalV1OperationsPvminstancesPost(params *InternalV1Operatio for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*InternalV1OperationsPvminstancesPostCreated) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for internal.v1.operations.pvminstances.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_pvm_instances/internal_v1_operations_pvminstances_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_pvm_instances/internal_v1_operations_pvminstances_delete_responses.go index 53e031bb02b..8b6ce40986b 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_pvm_instances/internal_v1_operations_pvminstances_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_pvm_instances/internal_v1_operations_pvminstances_delete_responses.go @@ -7,6 +7,7 @@ package internal_operations_pvm_instances import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type InternalV1OperationsPvminstancesDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *InternalV1OperationsPvminstancesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *InternalV1OperationsPvminstancesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 204: result := NewInternalV1OperationsPvminstancesDeleteNoContent() @@ -196,7 +197,7 @@ func (o *InternalV1OperationsPvminstancesDeleteBadRequest) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -266,7 +267,7 @@ func (o *InternalV1OperationsPvminstancesDeleteUnauthorized) readResponse(respon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -336,7 +337,7 @@ func (o *InternalV1OperationsPvminstancesDeleteForbidden) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -406,7 +407,7 @@ func (o *InternalV1OperationsPvminstancesDeleteNotFound) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -476,7 +477,7 @@ func (o *InternalV1OperationsPvminstancesDeleteGone) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -546,7 +547,7 @@ func (o *InternalV1OperationsPvminstancesDeleteTooManyRequests) readResponse(res o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -616,7 +617,7 @@ func (o *InternalV1OperationsPvminstancesDeleteInternalServerError) readResponse o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_pvm_instances/internal_v1_operations_pvminstances_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_pvm_instances/internal_v1_operations_pvminstances_post_responses.go index 4f8afe72f04..6345aafc101 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_pvm_instances/internal_v1_operations_pvminstances_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_pvm_instances/internal_v1_operations_pvminstances_post_responses.go @@ -7,6 +7,7 @@ package internal_operations_pvm_instances import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type InternalV1OperationsPvminstancesPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *InternalV1OperationsPvminstancesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *InternalV1OperationsPvminstancesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 201: result := NewInternalV1OperationsPvminstancesPostCreated() @@ -128,7 +129,7 @@ func (o *InternalV1OperationsPvminstancesPostCreated) readResponse(response runt o.Payload = new(models.InternalOperationsResponse) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *InternalV1OperationsPvminstancesPostBadRequest) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *InternalV1OperationsPvminstancesPostUnauthorized) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *InternalV1OperationsPvminstancesPostForbidden) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *InternalV1OperationsPvminstancesPostTooManyRequests) readResponse(respo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *InternalV1OperationsPvminstancesPostInternalServerError) readResponse(r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_shared_processor_pools/internal_operations_shared_processor_pools_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_shared_processor_pools/internal_operations_shared_processor_pools_client.go index 74541b168a1..5294fed2d8c 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_shared_processor_pools/internal_operations_shared_processor_pools_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_shared_processor_pools/internal_operations_shared_processor_pools_client.go @@ -67,7 +67,7 @@ type ClientService interface { InternalV1OperationsSharedprocessorpoolsDelete deletes a shared processor pool c r n */ func (a *Client) InternalV1OperationsSharedprocessorpoolsDelete(params *InternalV1OperationsSharedprocessorpoolsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1OperationsSharedprocessorpoolsDeleteNoContent, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewInternalV1OperationsSharedprocessorpoolsDeleteParams() } @@ -87,17 +87,22 @@ func (a *Client) InternalV1OperationsSharedprocessorpoolsDelete(params *Internal for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*InternalV1OperationsSharedprocessorpoolsDeleteNoContent) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for internal.v1.operations.sharedprocessorpools.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -106,7 +111,7 @@ func (a *Client) InternalV1OperationsSharedprocessorpoolsDelete(params *Internal InternalV1OperationsSharedprocessorpoolsPost creates a c r n for a shared processor pool */ func (a *Client) InternalV1OperationsSharedprocessorpoolsPost(params *InternalV1OperationsSharedprocessorpoolsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1OperationsSharedprocessorpoolsPostCreated, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewInternalV1OperationsSharedprocessorpoolsPostParams() } @@ -126,17 +131,22 @@ func (a *Client) InternalV1OperationsSharedprocessorpoolsPost(params *InternalV1 for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*InternalV1OperationsSharedprocessorpoolsPostCreated) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for internal.v1.operations.sharedprocessorpools.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_shared_processor_pools/internal_v1_operations_sharedprocessorpools_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_shared_processor_pools/internal_v1_operations_sharedprocessorpools_delete_responses.go index d9795554c20..251c82598c2 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_shared_processor_pools/internal_v1_operations_sharedprocessorpools_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_shared_processor_pools/internal_v1_operations_sharedprocessorpools_delete_responses.go @@ -7,6 +7,7 @@ package internal_operations_shared_processor_pools import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type InternalV1OperationsSharedprocessorpoolsDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *InternalV1OperationsSharedprocessorpoolsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *InternalV1OperationsSharedprocessorpoolsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 204: result := NewInternalV1OperationsSharedprocessorpoolsDeleteNoContent() @@ -196,7 +197,7 @@ func (o *InternalV1OperationsSharedprocessorpoolsDeleteBadRequest) readResponse( o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -266,7 +267,7 @@ func (o *InternalV1OperationsSharedprocessorpoolsDeleteUnauthorized) readRespons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -336,7 +337,7 @@ func (o *InternalV1OperationsSharedprocessorpoolsDeleteForbidden) readResponse(r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -406,7 +407,7 @@ func (o *InternalV1OperationsSharedprocessorpoolsDeleteNotFound) readResponse(re o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -476,7 +477,7 @@ func (o *InternalV1OperationsSharedprocessorpoolsDeleteGone) readResponse(respon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -546,7 +547,7 @@ func (o *InternalV1OperationsSharedprocessorpoolsDeleteTooManyRequests) readResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -616,7 +617,7 @@ func (o *InternalV1OperationsSharedprocessorpoolsDeleteInternalServerError) read o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_shared_processor_pools/internal_v1_operations_sharedprocessorpools_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_shared_processor_pools/internal_v1_operations_sharedprocessorpools_post_responses.go index 532c2c1b06e..8bef93c6879 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_shared_processor_pools/internal_v1_operations_sharedprocessorpools_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_shared_processor_pools/internal_v1_operations_sharedprocessorpools_post_responses.go @@ -7,6 +7,7 @@ package internal_operations_shared_processor_pools import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type InternalV1OperationsSharedprocessorpoolsPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *InternalV1OperationsSharedprocessorpoolsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *InternalV1OperationsSharedprocessorpoolsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 201: result := NewInternalV1OperationsSharedprocessorpoolsPostCreated() @@ -128,7 +129,7 @@ func (o *InternalV1OperationsSharedprocessorpoolsPostCreated) readResponse(respo o.Payload = new(models.InternalOperationsResponse) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *InternalV1OperationsSharedprocessorpoolsPostBadRequest) readResponse(re o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *InternalV1OperationsSharedprocessorpoolsPostUnauthorized) readResponse( o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *InternalV1OperationsSharedprocessorpoolsPostForbidden) readResponse(res o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *InternalV1OperationsSharedprocessorpoolsPostTooManyRequests) readRespon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *InternalV1OperationsSharedprocessorpoolsPostInternalServerError) readRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_snapshots/internal_operations_snapshots_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_snapshots/internal_operations_snapshots_client.go index 322a95856ec..cd4dc8c45e1 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_snapshots/internal_operations_snapshots_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_snapshots/internal_operations_snapshots_client.go @@ -67,7 +67,7 @@ type ClientService interface { InternalV1OperationsSnapshotsDelete deletes a snapshot c r n */ func (a *Client) InternalV1OperationsSnapshotsDelete(params *InternalV1OperationsSnapshotsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1OperationsSnapshotsDeleteNoContent, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewInternalV1OperationsSnapshotsDeleteParams() } @@ -87,17 +87,22 @@ func (a *Client) InternalV1OperationsSnapshotsDelete(params *InternalV1Operation for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*InternalV1OperationsSnapshotsDeleteNoContent) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for internal.v1.operations.snapshots.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -106,7 +111,7 @@ func (a *Client) InternalV1OperationsSnapshotsDelete(params *InternalV1Operation InternalV1OperationsSnapshotsPost creates a c r n for a snapshot */ func (a *Client) InternalV1OperationsSnapshotsPost(params *InternalV1OperationsSnapshotsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1OperationsSnapshotsPostCreated, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewInternalV1OperationsSnapshotsPostParams() } @@ -126,17 +131,22 @@ func (a *Client) InternalV1OperationsSnapshotsPost(params *InternalV1OperationsS for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*InternalV1OperationsSnapshotsPostCreated) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for internal.v1.operations.snapshots.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_snapshots/internal_v1_operations_snapshots_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_snapshots/internal_v1_operations_snapshots_delete_responses.go index bd7a7876e9b..e07bff00dda 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_snapshots/internal_v1_operations_snapshots_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_snapshots/internal_v1_operations_snapshots_delete_responses.go @@ -7,6 +7,7 @@ package internal_operations_snapshots import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type InternalV1OperationsSnapshotsDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *InternalV1OperationsSnapshotsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *InternalV1OperationsSnapshotsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 204: result := NewInternalV1OperationsSnapshotsDeleteNoContent() @@ -196,7 +197,7 @@ func (o *InternalV1OperationsSnapshotsDeleteBadRequest) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -266,7 +267,7 @@ func (o *InternalV1OperationsSnapshotsDeleteUnauthorized) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -336,7 +337,7 @@ func (o *InternalV1OperationsSnapshotsDeleteForbidden) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -406,7 +407,7 @@ func (o *InternalV1OperationsSnapshotsDeleteNotFound) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -476,7 +477,7 @@ func (o *InternalV1OperationsSnapshotsDeleteGone) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -546,7 +547,7 @@ func (o *InternalV1OperationsSnapshotsDeleteTooManyRequests) readResponse(respon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -616,7 +617,7 @@ func (o *InternalV1OperationsSnapshotsDeleteInternalServerError) readResponse(re o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_snapshots/internal_v1_operations_snapshots_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_snapshots/internal_v1_operations_snapshots_post_responses.go index 6caf7781e77..bff26c91fe6 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_snapshots/internal_v1_operations_snapshots_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_snapshots/internal_v1_operations_snapshots_post_responses.go @@ -7,6 +7,7 @@ package internal_operations_snapshots import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type InternalV1OperationsSnapshotsPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *InternalV1OperationsSnapshotsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *InternalV1OperationsSnapshotsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 201: result := NewInternalV1OperationsSnapshotsPostCreated() @@ -128,7 +129,7 @@ func (o *InternalV1OperationsSnapshotsPostCreated) readResponse(response runtime o.Payload = new(models.InternalOperationsResponse) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *InternalV1OperationsSnapshotsPostBadRequest) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *InternalV1OperationsSnapshotsPostUnauthorized) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *InternalV1OperationsSnapshotsPostForbidden) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *InternalV1OperationsSnapshotsPostTooManyRequests) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *InternalV1OperationsSnapshotsPostInternalServerError) readResponse(resp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_v_p_mem_volumes/internal_operationsvp_mem_volumes_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_v_p_mem_volumes/internal_operationsvp_mem_volumes_client.go new file mode 100644 index 00000000000..5f141221f8a --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_v_p_mem_volumes/internal_operationsvp_mem_volumes_client.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internal_operations_v_p_mem_volumes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// New creates a new internal operations v p mem volumes API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +// New creates a new internal operations v p mem volumes API client with basic auth credentials. +// It takes the following parameters: +// - host: http host (github.com). +// - basePath: any base path for the API client ("/v1", "/v3"). +// - scheme: http scheme ("http", "https"). +// - user: user for basic authentication header. +// - password: password for basic authentication header. +func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { + transport := httptransport.New(host, basePath, []string{scheme}) + transport.DefaultAuthentication = httptransport.BasicAuth(user, password) + return &Client{transport: transport, formats: strfmt.Default} +} + +// New creates a new internal operations v p mem volumes API client with a bearer token for authentication. +// It takes the following parameters: +// - host: http host (github.com). +// - basePath: any base path for the API client ("/v1", "/v3"). +// - scheme: http scheme ("http", "https"). +// - bearerToken: bearer token for Bearer authentication header. +func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { + transport := httptransport.New(host, basePath, []string{scheme}) + transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) + return &Client{transport: transport, formats: strfmt.Default} +} + +/* +Client for internal operations v p mem volumes API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption may be used to customize the behavior of Client methods. +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + InternalV1OperationsVpmemVolumesDelete(params *InternalV1OperationsVpmemVolumesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1OperationsVpmemVolumesDeleteNoContent, error) + + InternalV1OperationsVpmemVolumesPost(params *InternalV1OperationsVpmemVolumesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1OperationsVpmemVolumesPostCreated, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +InternalV1OperationsVpmemVolumesDelete deletes a v p m e m volume c r n +*/ +func (a *Client) InternalV1OperationsVpmemVolumesDelete(params *InternalV1OperationsVpmemVolumesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1OperationsVpmemVolumesDeleteNoContent, error) { + // NOTE: parameters are not validated before sending + if params == nil { + params = NewInternalV1OperationsVpmemVolumesDeleteParams() + } + op := &runtime.ClientOperation{ + ID: "internal.v1.operations.vpmem-volumes.delete", + Method: "DELETE", + PathPattern: "/internal/v1/operations/vpmem-volumes/{resource_crn}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &InternalV1OperationsVpmemVolumesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + + // only one success response has to be checked + success, ok := result.(*InternalV1OperationsVpmemVolumesDeleteNoContent) + if ok { + return success, nil + } + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for internal.v1.operations.vpmem-volumes.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +InternalV1OperationsVpmemVolumesPost creates a c r n for a v p m e m volume +*/ +func (a *Client) InternalV1OperationsVpmemVolumesPost(params *InternalV1OperationsVpmemVolumesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1OperationsVpmemVolumesPostCreated, error) { + // NOTE: parameters are not validated before sending + if params == nil { + params = NewInternalV1OperationsVpmemVolumesPostParams() + } + op := &runtime.ClientOperation{ + ID: "internal.v1.operations.vpmem-volumes.post", + Method: "POST", + PathPattern: "/internal/v1/operations/vpmem-volumes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &InternalV1OperationsVpmemVolumesPostReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + + // only one success response has to be checked + success, ok := result.(*InternalV1OperationsVpmemVolumesPostCreated) + if ok { + return success, nil + } + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for internal.v1.operations.vpmem-volumes.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_v_p_mem_volumes/internal_v1_operations_vpmem_volumes_delete_parameters.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_v_p_mem_volumes/internal_v1_operations_vpmem_volumes_delete_parameters.go new file mode 100644 index 00000000000..02abee0b35c --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_v_p_mem_volumes/internal_v1_operations_vpmem_volumes_delete_parameters.go @@ -0,0 +1,217 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internal_operations_v_p_mem_volumes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewInternalV1OperationsVpmemVolumesDeleteParams creates a new InternalV1OperationsVpmemVolumesDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewInternalV1OperationsVpmemVolumesDeleteParams() *InternalV1OperationsVpmemVolumesDeleteParams { + return &InternalV1OperationsVpmemVolumesDeleteParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewInternalV1OperationsVpmemVolumesDeleteParamsWithTimeout creates a new InternalV1OperationsVpmemVolumesDeleteParams object +// with the ability to set a timeout on a request. +func NewInternalV1OperationsVpmemVolumesDeleteParamsWithTimeout(timeout time.Duration) *InternalV1OperationsVpmemVolumesDeleteParams { + return &InternalV1OperationsVpmemVolumesDeleteParams{ + timeout: timeout, + } +} + +// NewInternalV1OperationsVpmemVolumesDeleteParamsWithContext creates a new InternalV1OperationsVpmemVolumesDeleteParams object +// with the ability to set a context for a request. +func NewInternalV1OperationsVpmemVolumesDeleteParamsWithContext(ctx context.Context) *InternalV1OperationsVpmemVolumesDeleteParams { + return &InternalV1OperationsVpmemVolumesDeleteParams{ + Context: ctx, + } +} + +// NewInternalV1OperationsVpmemVolumesDeleteParamsWithHTTPClient creates a new InternalV1OperationsVpmemVolumesDeleteParams object +// with the ability to set a custom HTTPClient for a request. +func NewInternalV1OperationsVpmemVolumesDeleteParamsWithHTTPClient(client *http.Client) *InternalV1OperationsVpmemVolumesDeleteParams { + return &InternalV1OperationsVpmemVolumesDeleteParams{ + HTTPClient: client, + } +} + +/* +InternalV1OperationsVpmemVolumesDeleteParams contains all the parameters to send to the API endpoint + + for the internal v1 operations vpmem volumes delete operation. + + Typically these are written to a http.Request. +*/ +type InternalV1OperationsVpmemVolumesDeleteParams struct { + + /* Authorization. + + Authentication of the service token + */ + Authorization string + + /* CRN. + + the CRN of the workspace + */ + CRN string + + /* IBMUserAuthorization. + + Authentication of the operation account user + */ + IBMUserAuthorization string + + /* ResourceCrn. + + Encoded resource CRN, "/" to be encoded into "%2F", example 'crn:v1:staging:public:power-iaas:satloc_dal_clp2joc20ppo19876n50:a%2Fc7e6bd2517ad44eabbd61fcc25cf68d5:79bffc73-0035-4e7b-b34a-15da38927424:network:d8d51d44-053b-4df3-90b6-31fbe72ba600' + */ + ResourceCrn string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the internal v1 operations vpmem volumes delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *InternalV1OperationsVpmemVolumesDeleteParams) WithDefaults() *InternalV1OperationsVpmemVolumesDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the internal v1 operations vpmem volumes delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *InternalV1OperationsVpmemVolumesDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the internal v1 operations vpmem volumes delete params +func (o *InternalV1OperationsVpmemVolumesDeleteParams) WithTimeout(timeout time.Duration) *InternalV1OperationsVpmemVolumesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the internal v1 operations vpmem volumes delete params +func (o *InternalV1OperationsVpmemVolumesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the internal v1 operations vpmem volumes delete params +func (o *InternalV1OperationsVpmemVolumesDeleteParams) WithContext(ctx context.Context) *InternalV1OperationsVpmemVolumesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the internal v1 operations vpmem volumes delete params +func (o *InternalV1OperationsVpmemVolumesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the internal v1 operations vpmem volumes delete params +func (o *InternalV1OperationsVpmemVolumesDeleteParams) WithHTTPClient(client *http.Client) *InternalV1OperationsVpmemVolumesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the internal v1 operations vpmem volumes delete params +func (o *InternalV1OperationsVpmemVolumesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAuthorization adds the authorization to the internal v1 operations vpmem volumes delete params +func (o *InternalV1OperationsVpmemVolumesDeleteParams) WithAuthorization(authorization string) *InternalV1OperationsVpmemVolumesDeleteParams { + o.SetAuthorization(authorization) + return o +} + +// SetAuthorization adds the authorization to the internal v1 operations vpmem volumes delete params +func (o *InternalV1OperationsVpmemVolumesDeleteParams) SetAuthorization(authorization string) { + o.Authorization = authorization +} + +// WithCRN adds the cRN to the internal v1 operations vpmem volumes delete params +func (o *InternalV1OperationsVpmemVolumesDeleteParams) WithCRN(cRN string) *InternalV1OperationsVpmemVolumesDeleteParams { + o.SetCRN(cRN) + return o +} + +// SetCRN adds the cRN to the internal v1 operations vpmem volumes delete params +func (o *InternalV1OperationsVpmemVolumesDeleteParams) SetCRN(cRN string) { + o.CRN = cRN +} + +// WithIBMUserAuthorization adds the iBMUserAuthorization to the internal v1 operations vpmem volumes delete params +func (o *InternalV1OperationsVpmemVolumesDeleteParams) WithIBMUserAuthorization(iBMUserAuthorization string) *InternalV1OperationsVpmemVolumesDeleteParams { + o.SetIBMUserAuthorization(iBMUserAuthorization) + return o +} + +// SetIBMUserAuthorization adds the iBMUserAuthorization to the internal v1 operations vpmem volumes delete params +func (o *InternalV1OperationsVpmemVolumesDeleteParams) SetIBMUserAuthorization(iBMUserAuthorization string) { + o.IBMUserAuthorization = iBMUserAuthorization +} + +// WithResourceCrn adds the resourceCrn to the internal v1 operations vpmem volumes delete params +func (o *InternalV1OperationsVpmemVolumesDeleteParams) WithResourceCrn(resourceCrn string) *InternalV1OperationsVpmemVolumesDeleteParams { + o.SetResourceCrn(resourceCrn) + return o +} + +// SetResourceCrn adds the resourceCrn to the internal v1 operations vpmem volumes delete params +func (o *InternalV1OperationsVpmemVolumesDeleteParams) SetResourceCrn(resourceCrn string) { + o.ResourceCrn = resourceCrn +} + +// WriteToRequest writes these params to a swagger request +func (o *InternalV1OperationsVpmemVolumesDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // header param Authorization + if err := r.SetHeaderParam("Authorization", o.Authorization); err != nil { + return err + } + + // header param CRN + if err := r.SetHeaderParam("CRN", o.CRN); err != nil { + return err + } + + // header param IBM-UserAuthorization + if err := r.SetHeaderParam("IBM-UserAuthorization", o.IBMUserAuthorization); err != nil { + return err + } + + // path param resource_crn + if err := r.SetPathParam("resource_crn", o.ResourceCrn); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_v_p_mem_volumes/internal_v1_operations_vpmem_volumes_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_v_p_mem_volumes/internal_v1_operations_vpmem_volumes_delete_responses.go new file mode 100644 index 00000000000..a33cc83df06 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_v_p_mem_volumes/internal_v1_operations_vpmem_volumes_delete_responses.go @@ -0,0 +1,625 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internal_operations_v_p_mem_volumes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + stderrors "errors" + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// InternalV1OperationsVpmemVolumesDeleteReader is a Reader for the InternalV1OperationsVpmemVolumesDelete structure. +type InternalV1OperationsVpmemVolumesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *InternalV1OperationsVpmemVolumesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { + switch response.Code() { + case 204: + result := NewInternalV1OperationsVpmemVolumesDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewInternalV1OperationsVpmemVolumesDeleteBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewInternalV1OperationsVpmemVolumesDeleteUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewInternalV1OperationsVpmemVolumesDeleteForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewInternalV1OperationsVpmemVolumesDeleteNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 410: + result := NewInternalV1OperationsVpmemVolumesDeleteGone() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewInternalV1OperationsVpmemVolumesDeleteTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewInternalV1OperationsVpmemVolumesDeleteInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[DELETE /internal/v1/operations/vpmem-volumes/{resource_crn}] internal.v1.operations.vpmem-volumes.delete", response, response.Code()) + } +} + +// NewInternalV1OperationsVpmemVolumesDeleteNoContent creates a InternalV1OperationsVpmemVolumesDeleteNoContent with default headers values +func NewInternalV1OperationsVpmemVolumesDeleteNoContent() *InternalV1OperationsVpmemVolumesDeleteNoContent { + return &InternalV1OperationsVpmemVolumesDeleteNoContent{} +} + +/* +InternalV1OperationsVpmemVolumesDeleteNoContent describes a response with status code 204, with default header values. + +Deleted +*/ +type InternalV1OperationsVpmemVolumesDeleteNoContent struct { +} + +// IsSuccess returns true when this internal v1 operations vpmem volumes delete no content response has a 2xx status code +func (o *InternalV1OperationsVpmemVolumesDeleteNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this internal v1 operations vpmem volumes delete no content response has a 3xx status code +func (o *InternalV1OperationsVpmemVolumesDeleteNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this internal v1 operations vpmem volumes delete no content response has a 4xx status code +func (o *InternalV1OperationsVpmemVolumesDeleteNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this internal v1 operations vpmem volumes delete no content response has a 5xx status code +func (o *InternalV1OperationsVpmemVolumesDeleteNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this internal v1 operations vpmem volumes delete no content response a status code equal to that given +func (o *InternalV1OperationsVpmemVolumesDeleteNoContent) IsCode(code int) bool { + return code == 204 +} + +// Code gets the status code for the internal v1 operations vpmem volumes delete no content response +func (o *InternalV1OperationsVpmemVolumesDeleteNoContent) Code() int { + return 204 +} + +func (o *InternalV1OperationsVpmemVolumesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /internal/v1/operations/vpmem-volumes/{resource_crn}][%d] internalV1OperationsVpmemVolumesDeleteNoContent", 204) +} + +func (o *InternalV1OperationsVpmemVolumesDeleteNoContent) String() string { + return fmt.Sprintf("[DELETE /internal/v1/operations/vpmem-volumes/{resource_crn}][%d] internalV1OperationsVpmemVolumesDeleteNoContent", 204) +} + +func (o *InternalV1OperationsVpmemVolumesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewInternalV1OperationsVpmemVolumesDeleteBadRequest creates a InternalV1OperationsVpmemVolumesDeleteBadRequest with default headers values +func NewInternalV1OperationsVpmemVolumesDeleteBadRequest() *InternalV1OperationsVpmemVolumesDeleteBadRequest { + return &InternalV1OperationsVpmemVolumesDeleteBadRequest{} +} + +/* +InternalV1OperationsVpmemVolumesDeleteBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type InternalV1OperationsVpmemVolumesDeleteBadRequest struct { + Payload *models.Error +} + +// IsSuccess returns true when this internal v1 operations vpmem volumes delete bad request response has a 2xx status code +func (o *InternalV1OperationsVpmemVolumesDeleteBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this internal v1 operations vpmem volumes delete bad request response has a 3xx status code +func (o *InternalV1OperationsVpmemVolumesDeleteBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this internal v1 operations vpmem volumes delete bad request response has a 4xx status code +func (o *InternalV1OperationsVpmemVolumesDeleteBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this internal v1 operations vpmem volumes delete bad request response has a 5xx status code +func (o *InternalV1OperationsVpmemVolumesDeleteBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this internal v1 operations vpmem volumes delete bad request response a status code equal to that given +func (o *InternalV1OperationsVpmemVolumesDeleteBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the internal v1 operations vpmem volumes delete bad request response +func (o *InternalV1OperationsVpmemVolumesDeleteBadRequest) Code() int { + return 400 +} + +func (o *InternalV1OperationsVpmemVolumesDeleteBadRequest) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /internal/v1/operations/vpmem-volumes/{resource_crn}][%d] internalV1OperationsVpmemVolumesDeleteBadRequest %s", 400, payload) +} + +func (o *InternalV1OperationsVpmemVolumesDeleteBadRequest) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /internal/v1/operations/vpmem-volumes/{resource_crn}][%d] internalV1OperationsVpmemVolumesDeleteBadRequest %s", 400, payload) +} + +func (o *InternalV1OperationsVpmemVolumesDeleteBadRequest) GetPayload() *models.Error { + return o.Payload +} + +func (o *InternalV1OperationsVpmemVolumesDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewInternalV1OperationsVpmemVolumesDeleteUnauthorized creates a InternalV1OperationsVpmemVolumesDeleteUnauthorized with default headers values +func NewInternalV1OperationsVpmemVolumesDeleteUnauthorized() *InternalV1OperationsVpmemVolumesDeleteUnauthorized { + return &InternalV1OperationsVpmemVolumesDeleteUnauthorized{} +} + +/* +InternalV1OperationsVpmemVolumesDeleteUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type InternalV1OperationsVpmemVolumesDeleteUnauthorized struct { + Payload *models.Error +} + +// IsSuccess returns true when this internal v1 operations vpmem volumes delete unauthorized response has a 2xx status code +func (o *InternalV1OperationsVpmemVolumesDeleteUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this internal v1 operations vpmem volumes delete unauthorized response has a 3xx status code +func (o *InternalV1OperationsVpmemVolumesDeleteUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this internal v1 operations vpmem volumes delete unauthorized response has a 4xx status code +func (o *InternalV1OperationsVpmemVolumesDeleteUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this internal v1 operations vpmem volumes delete unauthorized response has a 5xx status code +func (o *InternalV1OperationsVpmemVolumesDeleteUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this internal v1 operations vpmem volumes delete unauthorized response a status code equal to that given +func (o *InternalV1OperationsVpmemVolumesDeleteUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the internal v1 operations vpmem volumes delete unauthorized response +func (o *InternalV1OperationsVpmemVolumesDeleteUnauthorized) Code() int { + return 401 +} + +func (o *InternalV1OperationsVpmemVolumesDeleteUnauthorized) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /internal/v1/operations/vpmem-volumes/{resource_crn}][%d] internalV1OperationsVpmemVolumesDeleteUnauthorized %s", 401, payload) +} + +func (o *InternalV1OperationsVpmemVolumesDeleteUnauthorized) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /internal/v1/operations/vpmem-volumes/{resource_crn}][%d] internalV1OperationsVpmemVolumesDeleteUnauthorized %s", 401, payload) +} + +func (o *InternalV1OperationsVpmemVolumesDeleteUnauthorized) GetPayload() *models.Error { + return o.Payload +} + +func (o *InternalV1OperationsVpmemVolumesDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewInternalV1OperationsVpmemVolumesDeleteForbidden creates a InternalV1OperationsVpmemVolumesDeleteForbidden with default headers values +func NewInternalV1OperationsVpmemVolumesDeleteForbidden() *InternalV1OperationsVpmemVolumesDeleteForbidden { + return &InternalV1OperationsVpmemVolumesDeleteForbidden{} +} + +/* +InternalV1OperationsVpmemVolumesDeleteForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type InternalV1OperationsVpmemVolumesDeleteForbidden struct { + Payload *models.Error +} + +// IsSuccess returns true when this internal v1 operations vpmem volumes delete forbidden response has a 2xx status code +func (o *InternalV1OperationsVpmemVolumesDeleteForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this internal v1 operations vpmem volumes delete forbidden response has a 3xx status code +func (o *InternalV1OperationsVpmemVolumesDeleteForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this internal v1 operations vpmem volumes delete forbidden response has a 4xx status code +func (o *InternalV1OperationsVpmemVolumesDeleteForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this internal v1 operations vpmem volumes delete forbidden response has a 5xx status code +func (o *InternalV1OperationsVpmemVolumesDeleteForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this internal v1 operations vpmem volumes delete forbidden response a status code equal to that given +func (o *InternalV1OperationsVpmemVolumesDeleteForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the internal v1 operations vpmem volumes delete forbidden response +func (o *InternalV1OperationsVpmemVolumesDeleteForbidden) Code() int { + return 403 +} + +func (o *InternalV1OperationsVpmemVolumesDeleteForbidden) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /internal/v1/operations/vpmem-volumes/{resource_crn}][%d] internalV1OperationsVpmemVolumesDeleteForbidden %s", 403, payload) +} + +func (o *InternalV1OperationsVpmemVolumesDeleteForbidden) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /internal/v1/operations/vpmem-volumes/{resource_crn}][%d] internalV1OperationsVpmemVolumesDeleteForbidden %s", 403, payload) +} + +func (o *InternalV1OperationsVpmemVolumesDeleteForbidden) GetPayload() *models.Error { + return o.Payload +} + +func (o *InternalV1OperationsVpmemVolumesDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewInternalV1OperationsVpmemVolumesDeleteNotFound creates a InternalV1OperationsVpmemVolumesDeleteNotFound with default headers values +func NewInternalV1OperationsVpmemVolumesDeleteNotFound() *InternalV1OperationsVpmemVolumesDeleteNotFound { + return &InternalV1OperationsVpmemVolumesDeleteNotFound{} +} + +/* +InternalV1OperationsVpmemVolumesDeleteNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type InternalV1OperationsVpmemVolumesDeleteNotFound struct { + Payload *models.Error +} + +// IsSuccess returns true when this internal v1 operations vpmem volumes delete not found response has a 2xx status code +func (o *InternalV1OperationsVpmemVolumesDeleteNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this internal v1 operations vpmem volumes delete not found response has a 3xx status code +func (o *InternalV1OperationsVpmemVolumesDeleteNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this internal v1 operations vpmem volumes delete not found response has a 4xx status code +func (o *InternalV1OperationsVpmemVolumesDeleteNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this internal v1 operations vpmem volumes delete not found response has a 5xx status code +func (o *InternalV1OperationsVpmemVolumesDeleteNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this internal v1 operations vpmem volumes delete not found response a status code equal to that given +func (o *InternalV1OperationsVpmemVolumesDeleteNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the internal v1 operations vpmem volumes delete not found response +func (o *InternalV1OperationsVpmemVolumesDeleteNotFound) Code() int { + return 404 +} + +func (o *InternalV1OperationsVpmemVolumesDeleteNotFound) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /internal/v1/operations/vpmem-volumes/{resource_crn}][%d] internalV1OperationsVpmemVolumesDeleteNotFound %s", 404, payload) +} + +func (o *InternalV1OperationsVpmemVolumesDeleteNotFound) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /internal/v1/operations/vpmem-volumes/{resource_crn}][%d] internalV1OperationsVpmemVolumesDeleteNotFound %s", 404, payload) +} + +func (o *InternalV1OperationsVpmemVolumesDeleteNotFound) GetPayload() *models.Error { + return o.Payload +} + +func (o *InternalV1OperationsVpmemVolumesDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewInternalV1OperationsVpmemVolumesDeleteGone creates a InternalV1OperationsVpmemVolumesDeleteGone with default headers values +func NewInternalV1OperationsVpmemVolumesDeleteGone() *InternalV1OperationsVpmemVolumesDeleteGone { + return &InternalV1OperationsVpmemVolumesDeleteGone{} +} + +/* +InternalV1OperationsVpmemVolumesDeleteGone describes a response with status code 410, with default header values. + +Gone +*/ +type InternalV1OperationsVpmemVolumesDeleteGone struct { + Payload *models.Error +} + +// IsSuccess returns true when this internal v1 operations vpmem volumes delete gone response has a 2xx status code +func (o *InternalV1OperationsVpmemVolumesDeleteGone) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this internal v1 operations vpmem volumes delete gone response has a 3xx status code +func (o *InternalV1OperationsVpmemVolumesDeleteGone) IsRedirect() bool { + return false +} + +// IsClientError returns true when this internal v1 operations vpmem volumes delete gone response has a 4xx status code +func (o *InternalV1OperationsVpmemVolumesDeleteGone) IsClientError() bool { + return true +} + +// IsServerError returns true when this internal v1 operations vpmem volumes delete gone response has a 5xx status code +func (o *InternalV1OperationsVpmemVolumesDeleteGone) IsServerError() bool { + return false +} + +// IsCode returns true when this internal v1 operations vpmem volumes delete gone response a status code equal to that given +func (o *InternalV1OperationsVpmemVolumesDeleteGone) IsCode(code int) bool { + return code == 410 +} + +// Code gets the status code for the internal v1 operations vpmem volumes delete gone response +func (o *InternalV1OperationsVpmemVolumesDeleteGone) Code() int { + return 410 +} + +func (o *InternalV1OperationsVpmemVolumesDeleteGone) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /internal/v1/operations/vpmem-volumes/{resource_crn}][%d] internalV1OperationsVpmemVolumesDeleteGone %s", 410, payload) +} + +func (o *InternalV1OperationsVpmemVolumesDeleteGone) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /internal/v1/operations/vpmem-volumes/{resource_crn}][%d] internalV1OperationsVpmemVolumesDeleteGone %s", 410, payload) +} + +func (o *InternalV1OperationsVpmemVolumesDeleteGone) GetPayload() *models.Error { + return o.Payload +} + +func (o *InternalV1OperationsVpmemVolumesDeleteGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewInternalV1OperationsVpmemVolumesDeleteTooManyRequests creates a InternalV1OperationsVpmemVolumesDeleteTooManyRequests with default headers values +func NewInternalV1OperationsVpmemVolumesDeleteTooManyRequests() *InternalV1OperationsVpmemVolumesDeleteTooManyRequests { + return &InternalV1OperationsVpmemVolumesDeleteTooManyRequests{} +} + +/* +InternalV1OperationsVpmemVolumesDeleteTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type InternalV1OperationsVpmemVolumesDeleteTooManyRequests struct { + Payload *models.Error +} + +// IsSuccess returns true when this internal v1 operations vpmem volumes delete too many requests response has a 2xx status code +func (o *InternalV1OperationsVpmemVolumesDeleteTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this internal v1 operations vpmem volumes delete too many requests response has a 3xx status code +func (o *InternalV1OperationsVpmemVolumesDeleteTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this internal v1 operations vpmem volumes delete too many requests response has a 4xx status code +func (o *InternalV1OperationsVpmemVolumesDeleteTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this internal v1 operations vpmem volumes delete too many requests response has a 5xx status code +func (o *InternalV1OperationsVpmemVolumesDeleteTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this internal v1 operations vpmem volumes delete too many requests response a status code equal to that given +func (o *InternalV1OperationsVpmemVolumesDeleteTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the internal v1 operations vpmem volumes delete too many requests response +func (o *InternalV1OperationsVpmemVolumesDeleteTooManyRequests) Code() int { + return 429 +} + +func (o *InternalV1OperationsVpmemVolumesDeleteTooManyRequests) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /internal/v1/operations/vpmem-volumes/{resource_crn}][%d] internalV1OperationsVpmemVolumesDeleteTooManyRequests %s", 429, payload) +} + +func (o *InternalV1OperationsVpmemVolumesDeleteTooManyRequests) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /internal/v1/operations/vpmem-volumes/{resource_crn}][%d] internalV1OperationsVpmemVolumesDeleteTooManyRequests %s", 429, payload) +} + +func (o *InternalV1OperationsVpmemVolumesDeleteTooManyRequests) GetPayload() *models.Error { + return o.Payload +} + +func (o *InternalV1OperationsVpmemVolumesDeleteTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewInternalV1OperationsVpmemVolumesDeleteInternalServerError creates a InternalV1OperationsVpmemVolumesDeleteInternalServerError with default headers values +func NewInternalV1OperationsVpmemVolumesDeleteInternalServerError() *InternalV1OperationsVpmemVolumesDeleteInternalServerError { + return &InternalV1OperationsVpmemVolumesDeleteInternalServerError{} +} + +/* +InternalV1OperationsVpmemVolumesDeleteInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type InternalV1OperationsVpmemVolumesDeleteInternalServerError struct { + Payload *models.Error +} + +// IsSuccess returns true when this internal v1 operations vpmem volumes delete internal server error response has a 2xx status code +func (o *InternalV1OperationsVpmemVolumesDeleteInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this internal v1 operations vpmem volumes delete internal server error response has a 3xx status code +func (o *InternalV1OperationsVpmemVolumesDeleteInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this internal v1 operations vpmem volumes delete internal server error response has a 4xx status code +func (o *InternalV1OperationsVpmemVolumesDeleteInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this internal v1 operations vpmem volumes delete internal server error response has a 5xx status code +func (o *InternalV1OperationsVpmemVolumesDeleteInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this internal v1 operations vpmem volumes delete internal server error response a status code equal to that given +func (o *InternalV1OperationsVpmemVolumesDeleteInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the internal v1 operations vpmem volumes delete internal server error response +func (o *InternalV1OperationsVpmemVolumesDeleteInternalServerError) Code() int { + return 500 +} + +func (o *InternalV1OperationsVpmemVolumesDeleteInternalServerError) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /internal/v1/operations/vpmem-volumes/{resource_crn}][%d] internalV1OperationsVpmemVolumesDeleteInternalServerError %s", 500, payload) +} + +func (o *InternalV1OperationsVpmemVolumesDeleteInternalServerError) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /internal/v1/operations/vpmem-volumes/{resource_crn}][%d] internalV1OperationsVpmemVolumesDeleteInternalServerError %s", 500, payload) +} + +func (o *InternalV1OperationsVpmemVolumesDeleteInternalServerError) GetPayload() *models.Error { + return o.Payload +} + +func (o *InternalV1OperationsVpmemVolumesDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_v_p_mem_volumes/internal_v1_operations_vpmem_volumes_post_parameters.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_v_p_mem_volumes/internal_v1_operations_vpmem_volumes_post_parameters.go new file mode 100644 index 00000000000..41099e9118c --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_v_p_mem_volumes/internal_v1_operations_vpmem_volumes_post_parameters.go @@ -0,0 +1,219 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internal_operations_v_p_mem_volumes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// NewInternalV1OperationsVpmemVolumesPostParams creates a new InternalV1OperationsVpmemVolumesPostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewInternalV1OperationsVpmemVolumesPostParams() *InternalV1OperationsVpmemVolumesPostParams { + return &InternalV1OperationsVpmemVolumesPostParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewInternalV1OperationsVpmemVolumesPostParamsWithTimeout creates a new InternalV1OperationsVpmemVolumesPostParams object +// with the ability to set a timeout on a request. +func NewInternalV1OperationsVpmemVolumesPostParamsWithTimeout(timeout time.Duration) *InternalV1OperationsVpmemVolumesPostParams { + return &InternalV1OperationsVpmemVolumesPostParams{ + timeout: timeout, + } +} + +// NewInternalV1OperationsVpmemVolumesPostParamsWithContext creates a new InternalV1OperationsVpmemVolumesPostParams object +// with the ability to set a context for a request. +func NewInternalV1OperationsVpmemVolumesPostParamsWithContext(ctx context.Context) *InternalV1OperationsVpmemVolumesPostParams { + return &InternalV1OperationsVpmemVolumesPostParams{ + Context: ctx, + } +} + +// NewInternalV1OperationsVpmemVolumesPostParamsWithHTTPClient creates a new InternalV1OperationsVpmemVolumesPostParams object +// with the ability to set a custom HTTPClient for a request. +func NewInternalV1OperationsVpmemVolumesPostParamsWithHTTPClient(client *http.Client) *InternalV1OperationsVpmemVolumesPostParams { + return &InternalV1OperationsVpmemVolumesPostParams{ + HTTPClient: client, + } +} + +/* +InternalV1OperationsVpmemVolumesPostParams contains all the parameters to send to the API endpoint + + for the internal v1 operations vpmem volumes post operation. + + Typically these are written to a http.Request. +*/ +type InternalV1OperationsVpmemVolumesPostParams struct { + + /* Authorization. + + Authentication of the service token + */ + Authorization string + + /* CRN. + + the CRN of the workspace + */ + CRN string + + /* IBMUserAuthorization. + + Authentication of the operation account user + */ + IBMUserAuthorization string + + /* Body. + + Parameters for creating vPMEM volume CRN + */ + Body *models.InternalOperationsRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the internal v1 operations vpmem volumes post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *InternalV1OperationsVpmemVolumesPostParams) WithDefaults() *InternalV1OperationsVpmemVolumesPostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the internal v1 operations vpmem volumes post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *InternalV1OperationsVpmemVolumesPostParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the internal v1 operations vpmem volumes post params +func (o *InternalV1OperationsVpmemVolumesPostParams) WithTimeout(timeout time.Duration) *InternalV1OperationsVpmemVolumesPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the internal v1 operations vpmem volumes post params +func (o *InternalV1OperationsVpmemVolumesPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the internal v1 operations vpmem volumes post params +func (o *InternalV1OperationsVpmemVolumesPostParams) WithContext(ctx context.Context) *InternalV1OperationsVpmemVolumesPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the internal v1 operations vpmem volumes post params +func (o *InternalV1OperationsVpmemVolumesPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the internal v1 operations vpmem volumes post params +func (o *InternalV1OperationsVpmemVolumesPostParams) WithHTTPClient(client *http.Client) *InternalV1OperationsVpmemVolumesPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the internal v1 operations vpmem volumes post params +func (o *InternalV1OperationsVpmemVolumesPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAuthorization adds the authorization to the internal v1 operations vpmem volumes post params +func (o *InternalV1OperationsVpmemVolumesPostParams) WithAuthorization(authorization string) *InternalV1OperationsVpmemVolumesPostParams { + o.SetAuthorization(authorization) + return o +} + +// SetAuthorization adds the authorization to the internal v1 operations vpmem volumes post params +func (o *InternalV1OperationsVpmemVolumesPostParams) SetAuthorization(authorization string) { + o.Authorization = authorization +} + +// WithCRN adds the cRN to the internal v1 operations vpmem volumes post params +func (o *InternalV1OperationsVpmemVolumesPostParams) WithCRN(cRN string) *InternalV1OperationsVpmemVolumesPostParams { + o.SetCRN(cRN) + return o +} + +// SetCRN adds the cRN to the internal v1 operations vpmem volumes post params +func (o *InternalV1OperationsVpmemVolumesPostParams) SetCRN(cRN string) { + o.CRN = cRN +} + +// WithIBMUserAuthorization adds the iBMUserAuthorization to the internal v1 operations vpmem volumes post params +func (o *InternalV1OperationsVpmemVolumesPostParams) WithIBMUserAuthorization(iBMUserAuthorization string) *InternalV1OperationsVpmemVolumesPostParams { + o.SetIBMUserAuthorization(iBMUserAuthorization) + return o +} + +// SetIBMUserAuthorization adds the iBMUserAuthorization to the internal v1 operations vpmem volumes post params +func (o *InternalV1OperationsVpmemVolumesPostParams) SetIBMUserAuthorization(iBMUserAuthorization string) { + o.IBMUserAuthorization = iBMUserAuthorization +} + +// WithBody adds the body to the internal v1 operations vpmem volumes post params +func (o *InternalV1OperationsVpmemVolumesPostParams) WithBody(body *models.InternalOperationsRequest) *InternalV1OperationsVpmemVolumesPostParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the internal v1 operations vpmem volumes post params +func (o *InternalV1OperationsVpmemVolumesPostParams) SetBody(body *models.InternalOperationsRequest) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *InternalV1OperationsVpmemVolumesPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // header param Authorization + if err := r.SetHeaderParam("Authorization", o.Authorization); err != nil { + return err + } + + // header param CRN + if err := r.SetHeaderParam("CRN", o.CRN); err != nil { + return err + } + + // header param IBM-UserAuthorization + if err := r.SetHeaderParam("IBM-UserAuthorization", o.IBMUserAuthorization); err != nil { + return err + } + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_v_p_mem_volumes/internal_v1_operations_vpmem_volumes_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_v_p_mem_volumes/internal_v1_operations_vpmem_volumes_post_responses.go new file mode 100644 index 00000000000..f3ac683fd15 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_v_p_mem_volumes/internal_v1_operations_vpmem_volumes_post_responses.go @@ -0,0 +1,487 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internal_operations_v_p_mem_volumes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + stderrors "errors" + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// InternalV1OperationsVpmemVolumesPostReader is a Reader for the InternalV1OperationsVpmemVolumesPost structure. +type InternalV1OperationsVpmemVolumesPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *InternalV1OperationsVpmemVolumesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { + switch response.Code() { + case 201: + result := NewInternalV1OperationsVpmemVolumesPostCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewInternalV1OperationsVpmemVolumesPostBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewInternalV1OperationsVpmemVolumesPostUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewInternalV1OperationsVpmemVolumesPostForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewInternalV1OperationsVpmemVolumesPostTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewInternalV1OperationsVpmemVolumesPostInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /internal/v1/operations/vpmem-volumes] internal.v1.operations.vpmem-volumes.post", response, response.Code()) + } +} + +// NewInternalV1OperationsVpmemVolumesPostCreated creates a InternalV1OperationsVpmemVolumesPostCreated with default headers values +func NewInternalV1OperationsVpmemVolumesPostCreated() *InternalV1OperationsVpmemVolumesPostCreated { + return &InternalV1OperationsVpmemVolumesPostCreated{} +} + +/* +InternalV1OperationsVpmemVolumesPostCreated describes a response with status code 201, with default header values. + +Created +*/ +type InternalV1OperationsVpmemVolumesPostCreated struct { + Payload *models.InternalOperationsResponse +} + +// IsSuccess returns true when this internal v1 operations vpmem volumes post created response has a 2xx status code +func (o *InternalV1OperationsVpmemVolumesPostCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this internal v1 operations vpmem volumes post created response has a 3xx status code +func (o *InternalV1OperationsVpmemVolumesPostCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this internal v1 operations vpmem volumes post created response has a 4xx status code +func (o *InternalV1OperationsVpmemVolumesPostCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this internal v1 operations vpmem volumes post created response has a 5xx status code +func (o *InternalV1OperationsVpmemVolumesPostCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this internal v1 operations vpmem volumes post created response a status code equal to that given +func (o *InternalV1OperationsVpmemVolumesPostCreated) IsCode(code int) bool { + return code == 201 +} + +// Code gets the status code for the internal v1 operations vpmem volumes post created response +func (o *InternalV1OperationsVpmemVolumesPostCreated) Code() int { + return 201 +} + +func (o *InternalV1OperationsVpmemVolumesPostCreated) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /internal/v1/operations/vpmem-volumes][%d] internalV1OperationsVpmemVolumesPostCreated %s", 201, payload) +} + +func (o *InternalV1OperationsVpmemVolumesPostCreated) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /internal/v1/operations/vpmem-volumes][%d] internalV1OperationsVpmemVolumesPostCreated %s", 201, payload) +} + +func (o *InternalV1OperationsVpmemVolumesPostCreated) GetPayload() *models.InternalOperationsResponse { + return o.Payload +} + +func (o *InternalV1OperationsVpmemVolumesPostCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.InternalOperationsResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewInternalV1OperationsVpmemVolumesPostBadRequest creates a InternalV1OperationsVpmemVolumesPostBadRequest with default headers values +func NewInternalV1OperationsVpmemVolumesPostBadRequest() *InternalV1OperationsVpmemVolumesPostBadRequest { + return &InternalV1OperationsVpmemVolumesPostBadRequest{} +} + +/* +InternalV1OperationsVpmemVolumesPostBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type InternalV1OperationsVpmemVolumesPostBadRequest struct { + Payload *models.Error +} + +// IsSuccess returns true when this internal v1 operations vpmem volumes post bad request response has a 2xx status code +func (o *InternalV1OperationsVpmemVolumesPostBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this internal v1 operations vpmem volumes post bad request response has a 3xx status code +func (o *InternalV1OperationsVpmemVolumesPostBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this internal v1 operations vpmem volumes post bad request response has a 4xx status code +func (o *InternalV1OperationsVpmemVolumesPostBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this internal v1 operations vpmem volumes post bad request response has a 5xx status code +func (o *InternalV1OperationsVpmemVolumesPostBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this internal v1 operations vpmem volumes post bad request response a status code equal to that given +func (o *InternalV1OperationsVpmemVolumesPostBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the internal v1 operations vpmem volumes post bad request response +func (o *InternalV1OperationsVpmemVolumesPostBadRequest) Code() int { + return 400 +} + +func (o *InternalV1OperationsVpmemVolumesPostBadRequest) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /internal/v1/operations/vpmem-volumes][%d] internalV1OperationsVpmemVolumesPostBadRequest %s", 400, payload) +} + +func (o *InternalV1OperationsVpmemVolumesPostBadRequest) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /internal/v1/operations/vpmem-volumes][%d] internalV1OperationsVpmemVolumesPostBadRequest %s", 400, payload) +} + +func (o *InternalV1OperationsVpmemVolumesPostBadRequest) GetPayload() *models.Error { + return o.Payload +} + +func (o *InternalV1OperationsVpmemVolumesPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewInternalV1OperationsVpmemVolumesPostUnauthorized creates a InternalV1OperationsVpmemVolumesPostUnauthorized with default headers values +func NewInternalV1OperationsVpmemVolumesPostUnauthorized() *InternalV1OperationsVpmemVolumesPostUnauthorized { + return &InternalV1OperationsVpmemVolumesPostUnauthorized{} +} + +/* +InternalV1OperationsVpmemVolumesPostUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type InternalV1OperationsVpmemVolumesPostUnauthorized struct { + Payload *models.Error +} + +// IsSuccess returns true when this internal v1 operations vpmem volumes post unauthorized response has a 2xx status code +func (o *InternalV1OperationsVpmemVolumesPostUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this internal v1 operations vpmem volumes post unauthorized response has a 3xx status code +func (o *InternalV1OperationsVpmemVolumesPostUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this internal v1 operations vpmem volumes post unauthorized response has a 4xx status code +func (o *InternalV1OperationsVpmemVolumesPostUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this internal v1 operations vpmem volumes post unauthorized response has a 5xx status code +func (o *InternalV1OperationsVpmemVolumesPostUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this internal v1 operations vpmem volumes post unauthorized response a status code equal to that given +func (o *InternalV1OperationsVpmemVolumesPostUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the internal v1 operations vpmem volumes post unauthorized response +func (o *InternalV1OperationsVpmemVolumesPostUnauthorized) Code() int { + return 401 +} + +func (o *InternalV1OperationsVpmemVolumesPostUnauthorized) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /internal/v1/operations/vpmem-volumes][%d] internalV1OperationsVpmemVolumesPostUnauthorized %s", 401, payload) +} + +func (o *InternalV1OperationsVpmemVolumesPostUnauthorized) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /internal/v1/operations/vpmem-volumes][%d] internalV1OperationsVpmemVolumesPostUnauthorized %s", 401, payload) +} + +func (o *InternalV1OperationsVpmemVolumesPostUnauthorized) GetPayload() *models.Error { + return o.Payload +} + +func (o *InternalV1OperationsVpmemVolumesPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewInternalV1OperationsVpmemVolumesPostForbidden creates a InternalV1OperationsVpmemVolumesPostForbidden with default headers values +func NewInternalV1OperationsVpmemVolumesPostForbidden() *InternalV1OperationsVpmemVolumesPostForbidden { + return &InternalV1OperationsVpmemVolumesPostForbidden{} +} + +/* +InternalV1OperationsVpmemVolumesPostForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type InternalV1OperationsVpmemVolumesPostForbidden struct { + Payload *models.Error +} + +// IsSuccess returns true when this internal v1 operations vpmem volumes post forbidden response has a 2xx status code +func (o *InternalV1OperationsVpmemVolumesPostForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this internal v1 operations vpmem volumes post forbidden response has a 3xx status code +func (o *InternalV1OperationsVpmemVolumesPostForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this internal v1 operations vpmem volumes post forbidden response has a 4xx status code +func (o *InternalV1OperationsVpmemVolumesPostForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this internal v1 operations vpmem volumes post forbidden response has a 5xx status code +func (o *InternalV1OperationsVpmemVolumesPostForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this internal v1 operations vpmem volumes post forbidden response a status code equal to that given +func (o *InternalV1OperationsVpmemVolumesPostForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the internal v1 operations vpmem volumes post forbidden response +func (o *InternalV1OperationsVpmemVolumesPostForbidden) Code() int { + return 403 +} + +func (o *InternalV1OperationsVpmemVolumesPostForbidden) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /internal/v1/operations/vpmem-volumes][%d] internalV1OperationsVpmemVolumesPostForbidden %s", 403, payload) +} + +func (o *InternalV1OperationsVpmemVolumesPostForbidden) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /internal/v1/operations/vpmem-volumes][%d] internalV1OperationsVpmemVolumesPostForbidden %s", 403, payload) +} + +func (o *InternalV1OperationsVpmemVolumesPostForbidden) GetPayload() *models.Error { + return o.Payload +} + +func (o *InternalV1OperationsVpmemVolumesPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewInternalV1OperationsVpmemVolumesPostTooManyRequests creates a InternalV1OperationsVpmemVolumesPostTooManyRequests with default headers values +func NewInternalV1OperationsVpmemVolumesPostTooManyRequests() *InternalV1OperationsVpmemVolumesPostTooManyRequests { + return &InternalV1OperationsVpmemVolumesPostTooManyRequests{} +} + +/* +InternalV1OperationsVpmemVolumesPostTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type InternalV1OperationsVpmemVolumesPostTooManyRequests struct { + Payload *models.Error +} + +// IsSuccess returns true when this internal v1 operations vpmem volumes post too many requests response has a 2xx status code +func (o *InternalV1OperationsVpmemVolumesPostTooManyRequests) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this internal v1 operations vpmem volumes post too many requests response has a 3xx status code +func (o *InternalV1OperationsVpmemVolumesPostTooManyRequests) IsRedirect() bool { + return false +} + +// IsClientError returns true when this internal v1 operations vpmem volumes post too many requests response has a 4xx status code +func (o *InternalV1OperationsVpmemVolumesPostTooManyRequests) IsClientError() bool { + return true +} + +// IsServerError returns true when this internal v1 operations vpmem volumes post too many requests response has a 5xx status code +func (o *InternalV1OperationsVpmemVolumesPostTooManyRequests) IsServerError() bool { + return false +} + +// IsCode returns true when this internal v1 operations vpmem volumes post too many requests response a status code equal to that given +func (o *InternalV1OperationsVpmemVolumesPostTooManyRequests) IsCode(code int) bool { + return code == 429 +} + +// Code gets the status code for the internal v1 operations vpmem volumes post too many requests response +func (o *InternalV1OperationsVpmemVolumesPostTooManyRequests) Code() int { + return 429 +} + +func (o *InternalV1OperationsVpmemVolumesPostTooManyRequests) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /internal/v1/operations/vpmem-volumes][%d] internalV1OperationsVpmemVolumesPostTooManyRequests %s", 429, payload) +} + +func (o *InternalV1OperationsVpmemVolumesPostTooManyRequests) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /internal/v1/operations/vpmem-volumes][%d] internalV1OperationsVpmemVolumesPostTooManyRequests %s", 429, payload) +} + +func (o *InternalV1OperationsVpmemVolumesPostTooManyRequests) GetPayload() *models.Error { + return o.Payload +} + +func (o *InternalV1OperationsVpmemVolumesPostTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewInternalV1OperationsVpmemVolumesPostInternalServerError creates a InternalV1OperationsVpmemVolumesPostInternalServerError with default headers values +func NewInternalV1OperationsVpmemVolumesPostInternalServerError() *InternalV1OperationsVpmemVolumesPostInternalServerError { + return &InternalV1OperationsVpmemVolumesPostInternalServerError{} +} + +/* +InternalV1OperationsVpmemVolumesPostInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type InternalV1OperationsVpmemVolumesPostInternalServerError struct { + Payload *models.Error +} + +// IsSuccess returns true when this internal v1 operations vpmem volumes post internal server error response has a 2xx status code +func (o *InternalV1OperationsVpmemVolumesPostInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this internal v1 operations vpmem volumes post internal server error response has a 3xx status code +func (o *InternalV1OperationsVpmemVolumesPostInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this internal v1 operations vpmem volumes post internal server error response has a 4xx status code +func (o *InternalV1OperationsVpmemVolumesPostInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this internal v1 operations vpmem volumes post internal server error response has a 5xx status code +func (o *InternalV1OperationsVpmemVolumesPostInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this internal v1 operations vpmem volumes post internal server error response a status code equal to that given +func (o *InternalV1OperationsVpmemVolumesPostInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the internal v1 operations vpmem volumes post internal server error response +func (o *InternalV1OperationsVpmemVolumesPostInternalServerError) Code() int { + return 500 +} + +func (o *InternalV1OperationsVpmemVolumesPostInternalServerError) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /internal/v1/operations/vpmem-volumes][%d] internalV1OperationsVpmemVolumesPostInternalServerError %s", 500, payload) +} + +func (o *InternalV1OperationsVpmemVolumesPostInternalServerError) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /internal/v1/operations/vpmem-volumes][%d] internalV1OperationsVpmemVolumesPostInternalServerError %s", 500, payload) +} + +func (o *InternalV1OperationsVpmemVolumesPostInternalServerError) GetPayload() *models.Error { + return o.Payload +} + +func (o *InternalV1OperationsVpmemVolumesPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_volumes/internal_operations_volumes_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_volumes/internal_operations_volumes_client.go index b11bfeef4a3..4b4c0a4d409 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_volumes/internal_operations_volumes_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_volumes/internal_operations_volumes_client.go @@ -67,7 +67,7 @@ type ClientService interface { InternalV1OperationsVolumesDelete deletes a volume c r n */ func (a *Client) InternalV1OperationsVolumesDelete(params *InternalV1OperationsVolumesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1OperationsVolumesDeleteNoContent, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewInternalV1OperationsVolumesDeleteParams() } @@ -87,17 +87,22 @@ func (a *Client) InternalV1OperationsVolumesDelete(params *InternalV1OperationsV for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*InternalV1OperationsVolumesDeleteNoContent) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for internal.v1.operations.volumes.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -106,7 +111,7 @@ func (a *Client) InternalV1OperationsVolumesDelete(params *InternalV1OperationsV InternalV1OperationsVolumesPost creates a c r n for a volume */ func (a *Client) InternalV1OperationsVolumesPost(params *InternalV1OperationsVolumesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1OperationsVolumesPostCreated, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewInternalV1OperationsVolumesPostParams() } @@ -126,17 +131,22 @@ func (a *Client) InternalV1OperationsVolumesPost(params *InternalV1OperationsVol for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*InternalV1OperationsVolumesPostCreated) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for internal.v1.operations.volumes.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_volumes/internal_v1_operations_volumes_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_volumes/internal_v1_operations_volumes_delete_responses.go index 47da2908db8..0ea9317e1db 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_volumes/internal_v1_operations_volumes_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_volumes/internal_v1_operations_volumes_delete_responses.go @@ -7,6 +7,7 @@ package internal_operations_volumes import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type InternalV1OperationsVolumesDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *InternalV1OperationsVolumesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *InternalV1OperationsVolumesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 204: result := NewInternalV1OperationsVolumesDeleteNoContent() @@ -196,7 +197,7 @@ func (o *InternalV1OperationsVolumesDeleteBadRequest) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -266,7 +267,7 @@ func (o *InternalV1OperationsVolumesDeleteUnauthorized) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -336,7 +337,7 @@ func (o *InternalV1OperationsVolumesDeleteForbidden) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -406,7 +407,7 @@ func (o *InternalV1OperationsVolumesDeleteNotFound) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -476,7 +477,7 @@ func (o *InternalV1OperationsVolumesDeleteGone) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -546,7 +547,7 @@ func (o *InternalV1OperationsVolumesDeleteTooManyRequests) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -616,7 +617,7 @@ func (o *InternalV1OperationsVolumesDeleteInternalServerError) readResponse(resp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_volumes/internal_v1_operations_volumes_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_volumes/internal_v1_operations_volumes_post_responses.go index c21883d9296..04d0ee49d55 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_volumes/internal_v1_operations_volumes_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_operations_volumes/internal_v1_operations_volumes_post_responses.go @@ -7,6 +7,7 @@ package internal_operations_volumes import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type InternalV1OperationsVolumesPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *InternalV1OperationsVolumesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *InternalV1OperationsVolumesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 201: result := NewInternalV1OperationsVolumesPostCreated() @@ -128,7 +129,7 @@ func (o *InternalV1OperationsVolumesPostCreated) readResponse(response runtime.C o.Payload = new(models.InternalOperationsResponse) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *InternalV1OperationsVolumesPostBadRequest) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *InternalV1OperationsVolumesPostUnauthorized) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *InternalV1OperationsVolumesPostForbidden) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *InternalV1OperationsVolumesPostTooManyRequests) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *InternalV1OperationsVolumesPostInternalServerError) readResponse(respon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_power_v_s_instances/internal_powervs_instances_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_power_v_s_instances/internal_powervs_instances_client.go index 4cf2e6900d1..d4aaac55338 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_power_v_s_instances/internal_powervs_instances_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_power_v_s_instances/internal_powervs_instances_client.go @@ -65,7 +65,7 @@ type ClientService interface { InternalV1PowervsInstancesGet gets list of power v s cloud instances */ func (a *Client) InternalV1PowervsInstancesGet(params *InternalV1PowervsInstancesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1PowervsInstancesGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewInternalV1PowervsInstancesGetParams() } @@ -85,17 +85,22 @@ func (a *Client) InternalV1PowervsInstancesGet(params *InternalV1PowervsInstance for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*InternalV1PowervsInstancesGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for internal.v1.powervs.instances.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_power_v_s_instances/internal_v1_powervs_instances_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_power_v_s_instances/internal_v1_powervs_instances_get_responses.go index a7d7ff7443c..5730357c09f 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_power_v_s_instances/internal_v1_powervs_instances_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_power_v_s_instances/internal_v1_powervs_instances_get_responses.go @@ -7,6 +7,7 @@ package internal_power_v_s_instances import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type InternalV1PowervsInstancesGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *InternalV1PowervsInstancesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *InternalV1PowervsInstancesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewInternalV1PowervsInstancesGetOK() @@ -110,7 +111,7 @@ func (o *InternalV1PowervsInstancesGetOK) readResponse(response runtime.ClientRe o.Payload = new(models.PowerVSInstances) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -180,7 +181,7 @@ func (o *InternalV1PowervsInstancesGetForbidden) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -250,7 +251,7 @@ func (o *InternalV1PowervsInstancesGetInternalServerError) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_power_v_s_locations/internal_powervs_locations_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_power_v_s_locations/internal_powervs_locations_client.go index a5b26b2bb23..f60aee0ad44 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_power_v_s_locations/internal_powervs_locations_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_power_v_s_locations/internal_powervs_locations_client.go @@ -71,7 +71,7 @@ type ClientService interface { InternalV1PowervsLocationsActivatePut activates a power v s on prem location */ func (a *Client) InternalV1PowervsLocationsActivatePut(params *InternalV1PowervsLocationsActivatePutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1PowervsLocationsActivatePutOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewInternalV1PowervsLocationsActivatePutParams() } @@ -91,17 +91,22 @@ func (a *Client) InternalV1PowervsLocationsActivatePut(params *InternalV1Powervs for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*InternalV1PowervsLocationsActivatePutOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for internal.v1.powervs.locations.activate.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -110,7 +115,7 @@ func (a *Client) InternalV1PowervsLocationsActivatePut(params *InternalV1Powervs InternalV1PowervsLocationsTagDelete deletes a power satellite tag */ func (a *Client) InternalV1PowervsLocationsTagDelete(params *InternalV1PowervsLocationsTagDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1PowervsLocationsTagDeleteOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewInternalV1PowervsLocationsTagDeleteParams() } @@ -130,17 +135,22 @@ func (a *Client) InternalV1PowervsLocationsTagDelete(params *InternalV1PowervsLo for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*InternalV1PowervsLocationsTagDeleteOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for internal.v1.powervs.locations.tag.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -149,7 +159,7 @@ func (a *Client) InternalV1PowervsLocationsTagDelete(params *InternalV1PowervsLo InternalV1PowervsLocationsTagPost adds a power satellite tag */ func (a *Client) InternalV1PowervsLocationsTagPost(params *InternalV1PowervsLocationsTagPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1PowervsLocationsTagPostOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewInternalV1PowervsLocationsTagPostParams() } @@ -169,17 +179,22 @@ func (a *Client) InternalV1PowervsLocationsTagPost(params *InternalV1PowervsLoca for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*InternalV1PowervsLocationsTagPostOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for internal.v1.powervs.locations.tag.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -188,7 +203,7 @@ func (a *Client) InternalV1PowervsLocationsTagPost(params *InternalV1PowervsLoca InternalV1PowervsLocationsTransitgatewayGet gets list of p e r enabled power v s locations */ func (a *Client) InternalV1PowervsLocationsTransitgatewayGet(params *InternalV1PowervsLocationsTransitgatewayGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1PowervsLocationsTransitgatewayGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewInternalV1PowervsLocationsTransitgatewayGetParams() } @@ -208,17 +223,22 @@ func (a *Client) InternalV1PowervsLocationsTransitgatewayGet(params *InternalV1P for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*InternalV1PowervsLocationsTransitgatewayGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for internal.v1.powervs.locations.transitgateway.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_activate_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_activate_put_responses.go index a96743275cd..b067adf887e 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_activate_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_activate_put_responses.go @@ -7,6 +7,7 @@ package internal_power_v_s_locations import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type InternalV1PowervsLocationsActivatePutReader struct { } // ReadResponse reads a server response into the received o. -func (o *InternalV1PowervsLocationsActivatePutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *InternalV1PowervsLocationsActivatePutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewInternalV1PowervsLocationsActivatePutOK() @@ -122,7 +123,7 @@ func (o *InternalV1PowervsLocationsActivatePutOK) readResponse(response runtime. o.Payload = new(models.SatelliteOrder) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -192,7 +193,7 @@ func (o *InternalV1PowervsLocationsActivatePutBadRequest) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -262,7 +263,7 @@ func (o *InternalV1PowervsLocationsActivatePutUnauthorized) readResponse(respons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -332,7 +333,7 @@ func (o *InternalV1PowervsLocationsActivatePutUnprocessableEntity) readResponse( o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -402,7 +403,7 @@ func (o *InternalV1PowervsLocationsActivatePutInternalServerError) readResponse( o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_tag_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_tag_delete_responses.go index e9775fcfaf3..96a2f7039ff 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_tag_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_tag_delete_responses.go @@ -7,6 +7,7 @@ package internal_power_v_s_locations import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type InternalV1PowervsLocationsTagDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *InternalV1PowervsLocationsTagDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *InternalV1PowervsLocationsTagDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewInternalV1PowervsLocationsTagDeleteOK() @@ -178,7 +179,7 @@ func (o *InternalV1PowervsLocationsTagDeleteBadRequest) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -248,7 +249,7 @@ func (o *InternalV1PowervsLocationsTagDeleteUnauthorized) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -318,7 +319,7 @@ func (o *InternalV1PowervsLocationsTagDeleteUnprocessableEntity) readResponse(re o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -388,7 +389,7 @@ func (o *InternalV1PowervsLocationsTagDeleteInternalServerError) readResponse(re o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_tag_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_tag_post_responses.go index 7b1e8cb061b..40e717a2ccc 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_tag_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_tag_post_responses.go @@ -7,6 +7,7 @@ package internal_power_v_s_locations import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type InternalV1PowervsLocationsTagPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *InternalV1PowervsLocationsTagPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *InternalV1PowervsLocationsTagPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewInternalV1PowervsLocationsTagPostOK() @@ -178,7 +179,7 @@ func (o *InternalV1PowervsLocationsTagPostBadRequest) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -248,7 +249,7 @@ func (o *InternalV1PowervsLocationsTagPostUnauthorized) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -318,7 +319,7 @@ func (o *InternalV1PowervsLocationsTagPostUnprocessableEntity) readResponse(resp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -388,7 +389,7 @@ func (o *InternalV1PowervsLocationsTagPostInternalServerError) readResponse(resp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_transitgateway_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_transitgateway_get_responses.go index dca379c2806..e2a13cd7b01 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_transitgateway_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_transitgateway_get_responses.go @@ -7,6 +7,7 @@ package internal_power_v_s_locations import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type InternalV1PowervsLocationsTransitgatewayGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *InternalV1PowervsLocationsTransitgatewayGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *InternalV1PowervsLocationsTransitgatewayGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewInternalV1PowervsLocationsTransitgatewayGetOK() @@ -110,7 +111,7 @@ func (o *InternalV1PowervsLocationsTransitgatewayGetOK) readResponse(response ru o.Payload = new(models.TransitGatewayLocations) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -180,7 +181,7 @@ func (o *InternalV1PowervsLocationsTransitgatewayGetForbidden) readResponse(resp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -250,7 +251,7 @@ func (o *InternalV1PowervsLocationsTransitgatewayGetInternalServerError) readRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_storage_regions_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_storage_regions_client.go index 82b0960b0c8..35234de3ee4 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_storage_regions_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_storage_regions_client.go @@ -73,7 +73,7 @@ type ClientService interface { InternalV1StorageRegionsStoragePoolsGet gets the settings for given pool name */ func (a *Client) InternalV1StorageRegionsStoragePoolsGet(params *InternalV1StorageRegionsStoragePoolsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1StorageRegionsStoragePoolsGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewInternalV1StorageRegionsStoragePoolsGetParams() } @@ -93,17 +93,22 @@ func (a *Client) InternalV1StorageRegionsStoragePoolsGet(params *InternalV1Stora for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*InternalV1StorageRegionsStoragePoolsGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for internal.v1.storage.regions.storage-pools.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -112,7 +117,7 @@ func (a *Client) InternalV1StorageRegionsStoragePoolsGet(params *InternalV1Stora InternalV1StorageRegionsStoragePoolsGetall gets the current storage pools settings for a region zone */ func (a *Client) InternalV1StorageRegionsStoragePoolsGetall(params *InternalV1StorageRegionsStoragePoolsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1StorageRegionsStoragePoolsGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewInternalV1StorageRegionsStoragePoolsGetallParams() } @@ -132,17 +137,22 @@ func (a *Client) InternalV1StorageRegionsStoragePoolsGetall(params *InternalV1St for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*InternalV1StorageRegionsStoragePoolsGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for internal.v1.storage.regions.storage-pools.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -151,7 +161,7 @@ func (a *Client) InternalV1StorageRegionsStoragePoolsGetall(params *InternalV1St InternalV1StorageRegionsStoragePoolsPut updates the settings for given pool name */ func (a *Client) InternalV1StorageRegionsStoragePoolsPut(params *InternalV1StorageRegionsStoragePoolsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1StorageRegionsStoragePoolsPutOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewInternalV1StorageRegionsStoragePoolsPutParams() } @@ -171,17 +181,22 @@ func (a *Client) InternalV1StorageRegionsStoragePoolsPut(params *InternalV1Stora for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*InternalV1StorageRegionsStoragePoolsPutOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for internal.v1.storage.regions.storage-pools.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -190,7 +205,7 @@ func (a *Client) InternalV1StorageRegionsStoragePoolsPut(params *InternalV1Stora InternalV1StorageRegionsThresholdsGet gets the current default threshold settings for a region zone */ func (a *Client) InternalV1StorageRegionsThresholdsGet(params *InternalV1StorageRegionsThresholdsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1StorageRegionsThresholdsGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewInternalV1StorageRegionsThresholdsGetParams() } @@ -210,17 +225,22 @@ func (a *Client) InternalV1StorageRegionsThresholdsGet(params *InternalV1Storage for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*InternalV1StorageRegionsThresholdsGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for internal.v1.storage.regions.thresholds.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -229,7 +249,7 @@ func (a *Client) InternalV1StorageRegionsThresholdsGet(params *InternalV1Storage InternalV1StorageRegionsThresholdsPut updates a default threshold setting for a region zone */ func (a *Client) InternalV1StorageRegionsThresholdsPut(params *InternalV1StorageRegionsThresholdsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1StorageRegionsThresholdsPutAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewInternalV1StorageRegionsThresholdsPutParams() } @@ -249,17 +269,22 @@ func (a *Client) InternalV1StorageRegionsThresholdsPut(params *InternalV1Storage for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*InternalV1StorageRegionsThresholdsPutAccepted) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for internal.v1.storage.regions.thresholds.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_get_responses.go index 97315bc5cf6..14739ecfe80 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_get_responses.go @@ -7,6 +7,7 @@ package internal_storage_regions import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type InternalV1StorageRegionsStoragePoolsGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *InternalV1StorageRegionsStoragePoolsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *InternalV1StorageRegionsStoragePoolsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewInternalV1StorageRegionsStoragePoolsGetOK() @@ -120,7 +121,7 @@ func (o *InternalV1StorageRegionsStoragePoolsGetOK) GetPayload() models.StorageP func (o *InternalV1StorageRegionsStoragePoolsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -190,7 +191,7 @@ func (o *InternalV1StorageRegionsStoragePoolsGetUnauthorized) readResponse(respo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -260,7 +261,7 @@ func (o *InternalV1StorageRegionsStoragePoolsGetForbidden) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -330,7 +331,7 @@ func (o *InternalV1StorageRegionsStoragePoolsGetNotFound) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -400,7 +401,7 @@ func (o *InternalV1StorageRegionsStoragePoolsGetInternalServerError) readRespons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_getall_responses.go index ce6a4ac29f6..94fe0136200 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_getall_responses.go @@ -7,6 +7,7 @@ package internal_storage_regions import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type InternalV1StorageRegionsStoragePoolsGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *InternalV1StorageRegionsStoragePoolsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *InternalV1StorageRegionsStoragePoolsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewInternalV1StorageRegionsStoragePoolsGetallOK() @@ -120,7 +121,7 @@ func (o *InternalV1StorageRegionsStoragePoolsGetallOK) GetPayload() models.Stora func (o *InternalV1StorageRegionsStoragePoolsGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -190,7 +191,7 @@ func (o *InternalV1StorageRegionsStoragePoolsGetallUnauthorized) readResponse(re o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -260,7 +261,7 @@ func (o *InternalV1StorageRegionsStoragePoolsGetallForbidden) readResponse(respo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -330,7 +331,7 @@ func (o *InternalV1StorageRegionsStoragePoolsGetallNotFound) readResponse(respon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -400,7 +401,7 @@ func (o *InternalV1StorageRegionsStoragePoolsGetallInternalServerError) readResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_put_responses.go index f2957229b9c..f15dd329cbd 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_storage_pools_put_responses.go @@ -7,6 +7,7 @@ package internal_storage_regions import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type InternalV1StorageRegionsStoragePoolsPutReader struct { } // ReadResponse reads a server response into the received o. -func (o *InternalV1StorageRegionsStoragePoolsPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *InternalV1StorageRegionsStoragePoolsPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewInternalV1StorageRegionsStoragePoolsPutOK() @@ -128,7 +129,7 @@ func (o *InternalV1StorageRegionsStoragePoolsPutOK) readResponse(response runtim o.Payload = new(models.StoragePool) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *InternalV1StorageRegionsStoragePoolsPutBadRequest) readResponse(respons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *InternalV1StorageRegionsStoragePoolsPutUnauthorized) readResponse(respo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *InternalV1StorageRegionsStoragePoolsPutForbidden) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *InternalV1StorageRegionsStoragePoolsPutNotFound) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *InternalV1StorageRegionsStoragePoolsPutInternalServerError) readRespons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_thresholds_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_thresholds_get_responses.go index 84e6ef2f2da..cfd038ccf3e 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_thresholds_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_thresholds_get_responses.go @@ -7,6 +7,7 @@ package internal_storage_regions import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type InternalV1StorageRegionsThresholdsGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *InternalV1StorageRegionsThresholdsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *InternalV1StorageRegionsThresholdsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewInternalV1StorageRegionsThresholdsGetOK() @@ -122,7 +123,7 @@ func (o *InternalV1StorageRegionsThresholdsGetOK) readResponse(response runtime. o.Payload = new(models.Thresholds) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -192,7 +193,7 @@ func (o *InternalV1StorageRegionsThresholdsGetUnauthorized) readResponse(respons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -262,7 +263,7 @@ func (o *InternalV1StorageRegionsThresholdsGetForbidden) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -332,7 +333,7 @@ func (o *InternalV1StorageRegionsThresholdsGetNotFound) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -402,7 +403,7 @@ func (o *InternalV1StorageRegionsThresholdsGetInternalServerError) readResponse( o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_thresholds_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_thresholds_put_responses.go index bdb8682e334..bd76e891c24 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_thresholds_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_storage_regions/internal_v1_storage_regions_thresholds_put_responses.go @@ -7,6 +7,7 @@ package internal_storage_regions import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type InternalV1StorageRegionsThresholdsPutReader struct { } // ReadResponse reads a server response into the received o. -func (o *InternalV1StorageRegionsThresholdsPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *InternalV1StorageRegionsThresholdsPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 202: result := NewInternalV1StorageRegionsThresholdsPutAccepted() @@ -79,7 +80,7 @@ func NewInternalV1StorageRegionsThresholdsPutAccepted() *InternalV1StorageRegion /* InternalV1StorageRegionsThresholdsPutAccepted describes a response with status code 202, with default header values. -OK, region-zone default threshold settings update +Accepted, region-zone default threshold settings update */ type InternalV1StorageRegionsThresholdsPutAccepted struct { Payload *models.Thresholds @@ -134,7 +135,7 @@ func (o *InternalV1StorageRegionsThresholdsPutAccepted) readResponse(response ru o.Payload = new(models.Thresholds) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *InternalV1StorageRegionsThresholdsPutBadRequest) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *InternalV1StorageRegionsThresholdsPutUnauthorized) readResponse(respons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *InternalV1StorageRegionsThresholdsPutForbidden) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *InternalV1StorageRegionsThresholdsPutConflict) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *InternalV1StorageRegionsThresholdsPutUnprocessableEntity) readResponse( o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *InternalV1StorageRegionsThresholdsPutInternalServerError) readResponse( o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_transit_gateway/internal_transit_gateway_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_transit_gateway/internal_transit_gateway_client.go index 98f09bfb726..3115a39f84e 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_transit_gateway/internal_transit_gateway_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_transit_gateway/internal_transit_gateway_client.go @@ -65,7 +65,7 @@ type ClientService interface { InternalV1TransitgatewayGet gets the cloud instance transit gateway information */ func (a *Client) InternalV1TransitgatewayGet(params *InternalV1TransitgatewayGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InternalV1TransitgatewayGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewInternalV1TransitgatewayGetParams() } @@ -85,17 +85,22 @@ func (a *Client) InternalV1TransitgatewayGet(params *InternalV1TransitgatewayGet for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*InternalV1TransitgatewayGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for internal.v1.transitgateway.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_transit_gateway/internal_v1_transitgateway_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_transit_gateway/internal_v1_transitgateway_get_responses.go index bfb08462b75..94d1e0eafa4 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_transit_gateway/internal_v1_transitgateway_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/internal_transit_gateway/internal_v1_transitgateway_get_responses.go @@ -7,6 +7,7 @@ package internal_transit_gateway import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type InternalV1TransitgatewayGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *InternalV1TransitgatewayGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *InternalV1TransitgatewayGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewInternalV1TransitgatewayGetOK() @@ -104,7 +105,7 @@ func (o *InternalV1TransitgatewayGetOK) readResponse(response runtime.ClientResp o.Payload = new(models.TransitGatewayInstance) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -174,7 +175,7 @@ func (o *InternalV1TransitgatewayGetForbidden) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_address_groups/network_address_groups_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_address_groups/network_address_groups_client.go index e2e3af984e5..0d293a5815b 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_address_groups/network_address_groups_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_address_groups/network_address_groups_client.go @@ -77,7 +77,7 @@ type ClientService interface { V1NetworkAddressGroupsGet gets the list of network address groups for a workspace */ func (a *Client) V1NetworkAddressGroupsGet(params *V1NetworkAddressGroupsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkAddressGroupsGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1NetworkAddressGroupsGetParams() } @@ -97,17 +97,22 @@ func (a *Client) V1NetworkAddressGroupsGet(params *V1NetworkAddressGroupsGetPara for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1NetworkAddressGroupsGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.networkAddressGroups.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -116,7 +121,7 @@ func (a *Client) V1NetworkAddressGroupsGet(params *V1NetworkAddressGroupsGetPara V1NetworkAddressGroupsIDDelete deletes a network address group from a workspace */ func (a *Client) V1NetworkAddressGroupsIDDelete(params *V1NetworkAddressGroupsIDDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkAddressGroupsIDDeleteOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1NetworkAddressGroupsIDDeleteParams() } @@ -136,17 +141,22 @@ func (a *Client) V1NetworkAddressGroupsIDDelete(params *V1NetworkAddressGroupsID for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1NetworkAddressGroupsIDDeleteOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.networkAddressGroups.id.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -155,7 +165,7 @@ func (a *Client) V1NetworkAddressGroupsIDDelete(params *V1NetworkAddressGroupsID V1NetworkAddressGroupsIDGet gets the detail of a network address group */ func (a *Client) V1NetworkAddressGroupsIDGet(params *V1NetworkAddressGroupsIDGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkAddressGroupsIDGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1NetworkAddressGroupsIDGetParams() } @@ -175,17 +185,22 @@ func (a *Client) V1NetworkAddressGroupsIDGet(params *V1NetworkAddressGroupsIDGet for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1NetworkAddressGroupsIDGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.networkAddressGroups.id.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -194,7 +209,7 @@ func (a *Client) V1NetworkAddressGroupsIDGet(params *V1NetworkAddressGroupsIDGet V1NetworkAddressGroupsIDPut updates a network address group */ func (a *Client) V1NetworkAddressGroupsIDPut(params *V1NetworkAddressGroupsIDPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkAddressGroupsIDPutOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1NetworkAddressGroupsIDPutParams() } @@ -214,17 +229,22 @@ func (a *Client) V1NetworkAddressGroupsIDPut(params *V1NetworkAddressGroupsIDPut for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1NetworkAddressGroupsIDPutOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.networkAddressGroups.id.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -233,7 +253,7 @@ func (a *Client) V1NetworkAddressGroupsIDPut(params *V1NetworkAddressGroupsIDPut V1NetworkAddressGroupsMembersDelete deletes the member from a network address group */ func (a *Client) V1NetworkAddressGroupsMembersDelete(params *V1NetworkAddressGroupsMembersDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkAddressGroupsMembersDeleteOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1NetworkAddressGroupsMembersDeleteParams() } @@ -253,17 +273,22 @@ func (a *Client) V1NetworkAddressGroupsMembersDelete(params *V1NetworkAddressGro for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1NetworkAddressGroupsMembersDeleteOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.networkAddressGroups.members.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -272,7 +297,7 @@ func (a *Client) V1NetworkAddressGroupsMembersDelete(params *V1NetworkAddressGro V1NetworkAddressGroupsMembersPost adds a member to a network address group */ func (a *Client) V1NetworkAddressGroupsMembersPost(params *V1NetworkAddressGroupsMembersPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkAddressGroupsMembersPostOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1NetworkAddressGroupsMembersPostParams() } @@ -292,17 +317,22 @@ func (a *Client) V1NetworkAddressGroupsMembersPost(params *V1NetworkAddressGroup for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1NetworkAddressGroupsMembersPostOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.networkAddressGroups.members.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -311,7 +341,7 @@ func (a *Client) V1NetworkAddressGroupsMembersPost(params *V1NetworkAddressGroup V1NetworkAddressGroupsPost creates a new network address group */ func (a *Client) V1NetworkAddressGroupsPost(params *V1NetworkAddressGroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkAddressGroupsPostOK, *V1NetworkAddressGroupsPostCreated, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1NetworkAddressGroupsPostParams() } @@ -331,18 +361,22 @@ func (a *Client) V1NetworkAddressGroupsPost(params *V1NetworkAddressGroupsPostPa for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } + + // several success responses have to be checked switch value := result.(type) { case *V1NetworkAddressGroupsPostOK: return value, nil, nil case *V1NetworkAddressGroupsPostCreated: return nil, value, nil } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for network_address_groups: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_address_groups/v1_network_address_groups_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_address_groups/v1_network_address_groups_get_responses.go index 5716e64c51f..11b983210e5 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_address_groups/v1_network_address_groups_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_address_groups/v1_network_address_groups_get_responses.go @@ -7,6 +7,7 @@ package network_address_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1NetworkAddressGroupsGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1NetworkAddressGroupsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1NetworkAddressGroupsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1NetworkAddressGroupsGetOK() @@ -128,7 +129,7 @@ func (o *V1NetworkAddressGroupsGetOK) readResponse(response runtime.ClientRespon o.Payload = new(models.NetworkAddressGroups) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *V1NetworkAddressGroupsGetBadRequest) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *V1NetworkAddressGroupsGetUnauthorized) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *V1NetworkAddressGroupsGetForbidden) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *V1NetworkAddressGroupsGetNotFound) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *V1NetworkAddressGroupsGetInternalServerError) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_address_groups/v1_network_address_groups_id_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_address_groups/v1_network_address_groups_id_delete_responses.go index 9276881351c..e8c38c6cfaa 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_address_groups/v1_network_address_groups_id_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_address_groups/v1_network_address_groups_id_delete_responses.go @@ -7,6 +7,7 @@ package network_address_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1NetworkAddressGroupsIDDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1NetworkAddressGroupsIDDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1NetworkAddressGroupsIDDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1NetworkAddressGroupsIDDeleteOK() @@ -132,7 +133,7 @@ func (o *V1NetworkAddressGroupsIDDeleteOK) GetPayload() models.Object { func (o *V1NetworkAddressGroupsIDDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -202,7 +203,7 @@ func (o *V1NetworkAddressGroupsIDDeleteBadRequest) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -272,7 +273,7 @@ func (o *V1NetworkAddressGroupsIDDeleteUnauthorized) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -342,7 +343,7 @@ func (o *V1NetworkAddressGroupsIDDeleteForbidden) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -412,7 +413,7 @@ func (o *V1NetworkAddressGroupsIDDeleteNotFound) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -482,7 +483,7 @@ func (o *V1NetworkAddressGroupsIDDeleteConflict) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -552,7 +553,7 @@ func (o *V1NetworkAddressGroupsIDDeleteInternalServerError) readResponse(respons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_address_groups/v1_network_address_groups_id_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_address_groups/v1_network_address_groups_id_get_responses.go index fb0df93bb0c..20bfa0ebecd 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_address_groups/v1_network_address_groups_id_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_address_groups/v1_network_address_groups_id_get_responses.go @@ -7,6 +7,7 @@ package network_address_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1NetworkAddressGroupsIDGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1NetworkAddressGroupsIDGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1NetworkAddressGroupsIDGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1NetworkAddressGroupsIDGetOK() @@ -128,7 +129,7 @@ func (o *V1NetworkAddressGroupsIDGetOK) readResponse(response runtime.ClientResp o.Payload = new(models.NetworkAddressGroup) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *V1NetworkAddressGroupsIDGetBadRequest) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *V1NetworkAddressGroupsIDGetUnauthorized) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *V1NetworkAddressGroupsIDGetForbidden) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *V1NetworkAddressGroupsIDGetNotFound) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *V1NetworkAddressGroupsIDGetInternalServerError) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_address_groups/v1_network_address_groups_id_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_address_groups/v1_network_address_groups_id_put_responses.go index 0c86e3a0ff0..0443b8bedb3 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_address_groups/v1_network_address_groups_id_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_address_groups/v1_network_address_groups_id_put_responses.go @@ -7,6 +7,7 @@ package network_address_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1NetworkAddressGroupsIDPutReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1NetworkAddressGroupsIDPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1NetworkAddressGroupsIDPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1NetworkAddressGroupsIDPutOK() @@ -128,7 +129,7 @@ func (o *V1NetworkAddressGroupsIDPutOK) readResponse(response runtime.ClientResp o.Payload = new(models.NetworkAddressGroup) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *V1NetworkAddressGroupsIDPutBadRequest) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *V1NetworkAddressGroupsIDPutUnauthorized) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *V1NetworkAddressGroupsIDPutForbidden) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *V1NetworkAddressGroupsIDPutNotFound) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *V1NetworkAddressGroupsIDPutInternalServerError) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_address_groups/v1_network_address_groups_members_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_address_groups/v1_network_address_groups_members_delete_responses.go index 6105c1f68e6..e5a2df0daca 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_address_groups/v1_network_address_groups_members_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_address_groups/v1_network_address_groups_members_delete_responses.go @@ -7,6 +7,7 @@ package network_address_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1NetworkAddressGroupsMembersDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1NetworkAddressGroupsMembersDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1NetworkAddressGroupsMembersDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1NetworkAddressGroupsMembersDeleteOK() @@ -132,7 +133,7 @@ func (o *V1NetworkAddressGroupsMembersDeleteOK) GetPayload() models.Object { func (o *V1NetworkAddressGroupsMembersDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -202,7 +203,7 @@ func (o *V1NetworkAddressGroupsMembersDeleteBadRequest) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -272,7 +273,7 @@ func (o *V1NetworkAddressGroupsMembersDeleteUnauthorized) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -342,7 +343,7 @@ func (o *V1NetworkAddressGroupsMembersDeleteForbidden) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -412,7 +413,7 @@ func (o *V1NetworkAddressGroupsMembersDeleteNotFound) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -482,7 +483,7 @@ func (o *V1NetworkAddressGroupsMembersDeleteConflict) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -552,7 +553,7 @@ func (o *V1NetworkAddressGroupsMembersDeleteInternalServerError) readResponse(re o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_address_groups/v1_network_address_groups_members_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_address_groups/v1_network_address_groups_members_post_responses.go index ea8d2ce3451..adfa15d2d7f 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_address_groups/v1_network_address_groups_members_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_address_groups/v1_network_address_groups_members_post_responses.go @@ -7,6 +7,7 @@ package network_address_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1NetworkAddressGroupsMembersPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1NetworkAddressGroupsMembersPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1NetworkAddressGroupsMembersPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1NetworkAddressGroupsMembersPostOK() @@ -140,7 +141,7 @@ func (o *V1NetworkAddressGroupsMembersPostOK) readResponse(response runtime.Clie o.Payload = new(models.NetworkAddressGroupMember) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -210,7 +211,7 @@ func (o *V1NetworkAddressGroupsMembersPostBadRequest) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -280,7 +281,7 @@ func (o *V1NetworkAddressGroupsMembersPostUnauthorized) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -350,7 +351,7 @@ func (o *V1NetworkAddressGroupsMembersPostForbidden) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -420,7 +421,7 @@ func (o *V1NetworkAddressGroupsMembersPostNotFound) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -490,7 +491,7 @@ func (o *V1NetworkAddressGroupsMembersPostConflict) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -560,7 +561,7 @@ func (o *V1NetworkAddressGroupsMembersPostUnprocessableEntity) readResponse(resp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -630,7 +631,7 @@ func (o *V1NetworkAddressGroupsMembersPostInternalServerError) readResponse(resp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_address_groups/v1_network_address_groups_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_address_groups/v1_network_address_groups_post_responses.go index 2a7b9597ad3..5d041d879d5 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_address_groups/v1_network_address_groups_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_address_groups/v1_network_address_groups_post_responses.go @@ -7,6 +7,7 @@ package network_address_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1NetworkAddressGroupsPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1NetworkAddressGroupsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1NetworkAddressGroupsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1NetworkAddressGroupsPostOK() @@ -146,7 +147,7 @@ func (o *V1NetworkAddressGroupsPostOK) readResponse(response runtime.ClientRespo o.Payload = new(models.NetworkAddressGroup) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -216,7 +217,7 @@ func (o *V1NetworkAddressGroupsPostCreated) readResponse(response runtime.Client o.Payload = new(models.NetworkAddressGroup) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -286,7 +287,7 @@ func (o *V1NetworkAddressGroupsPostBadRequest) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -356,7 +357,7 @@ func (o *V1NetworkAddressGroupsPostUnauthorized) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -426,7 +427,7 @@ func (o *V1NetworkAddressGroupsPostForbidden) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -496,7 +497,7 @@ func (o *V1NetworkAddressGroupsPostNotFound) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -566,7 +567,7 @@ func (o *V1NetworkAddressGroupsPostConflict) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -636,7 +637,7 @@ func (o *V1NetworkAddressGroupsPostUnprocessableEntity) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -706,7 +707,7 @@ func (o *V1NetworkAddressGroupsPostInternalServerError) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/network_peers_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/network_peers_client.go index 9ee1ad1f0e3..35322e32b6c 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/network_peers_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/network_peers_client.go @@ -56,28 +56,264 @@ type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods type ClientService interface { - V1NetworkPeersList(params *V1NetworkPeersListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkPeersListOK, error) + V1NetworkPeersGetall(params *V1NetworkPeersGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkPeersGetallOK, error) + + V1NetworkPeersIDDelete(params *V1NetworkPeersIDDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkPeersIDDeleteOK, error) + + V1NetworkPeersIDGet(params *V1NetworkPeersIDGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkPeersIDGetOK, error) + + V1NetworkPeersIDPut(params *V1NetworkPeersIDPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkPeersIDPutOK, error) + + V1NetworkPeersInterfacesGetall(params *V1NetworkPeersInterfacesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkPeersInterfacesGetallOK, error) + + V1NetworkPeersPost(params *V1NetworkPeersPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkPeersPostOK, error) + + V1NetworkPeersRouteFilterIDDelete(params *V1NetworkPeersRouteFilterIDDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkPeersRouteFilterIDDeleteOK, error) + + V1NetworkPeersRouteFilterIDGet(params *V1NetworkPeersRouteFilterIDGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkPeersRouteFilterIDGetOK, error) + + V1NetworkPeersRouteFiltersPost(params *V1NetworkPeersRouteFiltersPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkPeersRouteFiltersPostOK, error) SetTransport(transport runtime.ClientTransport) } /* -V1NetworkPeersList lists all network peers available in the workspace +V1NetworkPeersGetall gets the list of network peers +*/ +func (a *Client) V1NetworkPeersGetall(params *V1NetworkPeersGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkPeersGetallOK, error) { + // NOTE: parameters are not validated before sending + if params == nil { + params = NewV1NetworkPeersGetallParams() + } + op := &runtime.ClientOperation{ + ID: "v1.networkPeers.getall", + Method: "GET", + PathPattern: "/v1/network-peers", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &V1NetworkPeersGetallReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + + // only one success response has to be checked + success, ok := result.(*V1NetworkPeersGetallOK) + if ok { + return success, nil + } + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for v1.networkPeers.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +V1NetworkPeersIDDelete deletes a network peer +*/ +func (a *Client) V1NetworkPeersIDDelete(params *V1NetworkPeersIDDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkPeersIDDeleteOK, error) { + // NOTE: parameters are not validated before sending + if params == nil { + params = NewV1NetworkPeersIDDeleteParams() + } + op := &runtime.ClientOperation{ + ID: "v1.networkPeers.id.delete", + Method: "DELETE", + PathPattern: "/v1/network-peers/{network_peer_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &V1NetworkPeersIDDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + + // only one success response has to be checked + success, ok := result.(*V1NetworkPeersIDDeleteOK) + if ok { + return success, nil + } + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for v1.networkPeers.id.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +V1NetworkPeersIDGet gets the details of a network peer +*/ +func (a *Client) V1NetworkPeersIDGet(params *V1NetworkPeersIDGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkPeersIDGetOK, error) { + // NOTE: parameters are not validated before sending + if params == nil { + params = NewV1NetworkPeersIDGetParams() + } + op := &runtime.ClientOperation{ + ID: "v1.networkPeers.id.get", + Method: "GET", + PathPattern: "/v1/network-peers/{network_peer_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &V1NetworkPeersIDGetReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + + // only one success response has to be checked + success, ok := result.(*V1NetworkPeersIDGetOK) + if ok { + return success, nil + } + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for v1.networkPeers.id.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +V1NetworkPeersIDPut updates a network peer +*/ +func (a *Client) V1NetworkPeersIDPut(params *V1NetworkPeersIDPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkPeersIDPutOK, error) { + // NOTE: parameters are not validated before sending + if params == nil { + params = NewV1NetworkPeersIDPutParams() + } + op := &runtime.ClientOperation{ + ID: "v1.networkPeers.id.put", + Method: "PUT", + PathPattern: "/v1/network-peers/{network_peer_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &V1NetworkPeersIDPutReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + + // only one success response has to be checked + success, ok := result.(*V1NetworkPeersIDPutOK) + if ok { + return success, nil + } + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for v1.networkPeers.id.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +V1NetworkPeersInterfacesGetall gets the list of interfaces for network peer */ -func (a *Client) V1NetworkPeersList(params *V1NetworkPeersListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkPeersListOK, error) { - // TODO: Validate the params before sending +func (a *Client) V1NetworkPeersInterfacesGetall(params *V1NetworkPeersInterfacesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkPeersInterfacesGetallOK, error) { + // NOTE: parameters are not validated before sending if params == nil { - params = NewV1NetworkPeersListParams() + params = NewV1NetworkPeersInterfacesGetallParams() } op := &runtime.ClientOperation{ - ID: "v1.networkPeers.list", + ID: "v1.networkPeers.interfaces.getall", Method: "GET", + PathPattern: "/v1/network-peers/interfaces", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &V1NetworkPeersInterfacesGetallReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + + // only one success response has to be checked + success, ok := result.(*V1NetworkPeersInterfacesGetallOK) + if ok { + return success, nil + } + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for v1.networkPeers.interfaces.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +V1NetworkPeersPost creates a new network peer +*/ +func (a *Client) V1NetworkPeersPost(params *V1NetworkPeersPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkPeersPostOK, error) { + // NOTE: parameters are not validated before sending + if params == nil { + params = NewV1NetworkPeersPostParams() + } + op := &runtime.ClientOperation{ + ID: "v1.networkPeers.post", + Method: "POST", PathPattern: "/v1/network-peers", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &V1NetworkPeersListReader{formats: a.formats}, + Reader: &V1NetworkPeersPostReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -85,18 +321,155 @@ func (a *Client) V1NetworkPeersList(params *V1NetworkPeersListParams, authInfo r for _, opt := range opts { opt(op) } + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + + // only one success response has to be checked + success, ok := result.(*V1NetworkPeersPostOK) + if ok { + return success, nil + } + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for v1.networkPeers.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} +/* +V1NetworkPeersRouteFilterIDDelete deletes a route filter +*/ +func (a *Client) V1NetworkPeersRouteFilterIDDelete(params *V1NetworkPeersRouteFilterIDDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkPeersRouteFilterIDDeleteOK, error) { + // NOTE: parameters are not validated before sending + if params == nil { + params = NewV1NetworkPeersRouteFilterIDDeleteParams() + } + op := &runtime.ClientOperation{ + ID: "v1.networkPeers.routeFilter.id.delete", + Method: "DELETE", + PathPattern: "/v1/network-peers/{network_peer_id}/route-filters/{route_filter_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &V1NetworkPeersRouteFilterIDDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } result, err := a.transport.Submit(op) if err != nil { return nil, err } - success, ok := result.(*V1NetworkPeersListOK) + + // only one success response has to be checked + success, ok := result.(*V1NetworkPeersRouteFilterIDDeleteOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.networkPeers.list: API contract not enforced by server. Client expected to get an error, but got: %T", result) + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for v1.networkPeers.routeFilter.id.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +V1NetworkPeersRouteFilterIDGet gets the details of a route filter +*/ +func (a *Client) V1NetworkPeersRouteFilterIDGet(params *V1NetworkPeersRouteFilterIDGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkPeersRouteFilterIDGetOK, error) { + // NOTE: parameters are not validated before sending + if params == nil { + params = NewV1NetworkPeersRouteFilterIDGetParams() + } + op := &runtime.ClientOperation{ + ID: "v1.networkPeers.routeFilter.id.get", + Method: "GET", + PathPattern: "/v1/network-peers/{network_peer_id}/route-filters/{route_filter_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &V1NetworkPeersRouteFilterIDGetReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + + // only one success response has to be checked + success, ok := result.(*V1NetworkPeersRouteFilterIDGetOK) + if ok { + return success, nil + } + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for v1.networkPeers.routeFilter.id.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +V1NetworkPeersRouteFiltersPost creates a new route filter +*/ +func (a *Client) V1NetworkPeersRouteFiltersPost(params *V1NetworkPeersRouteFiltersPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkPeersRouteFiltersPostOK, error) { + // NOTE: parameters are not validated before sending + if params == nil { + params = NewV1NetworkPeersRouteFiltersPostParams() + } + op := &runtime.ClientOperation{ + ID: "v1.networkPeers.routeFilters.post", + Method: "POST", + PathPattern: "/v1/network-peers/{network_peer_id}/route-filters", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &V1NetworkPeersRouteFiltersPostReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + + // only one success response has to be checked + success, ok := result.(*V1NetworkPeersRouteFiltersPostOK) + if ok { + return success, nil + } + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for v1.networkPeers.routeFilters.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_getall_parameters.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_getall_parameters.go new file mode 100644 index 00000000000..d8a589c636a --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_getall_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package network_peers + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewV1NetworkPeersGetallParams creates a new V1NetworkPeersGetallParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewV1NetworkPeersGetallParams() *V1NetworkPeersGetallParams { + return &V1NetworkPeersGetallParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewV1NetworkPeersGetallParamsWithTimeout creates a new V1NetworkPeersGetallParams object +// with the ability to set a timeout on a request. +func NewV1NetworkPeersGetallParamsWithTimeout(timeout time.Duration) *V1NetworkPeersGetallParams { + return &V1NetworkPeersGetallParams{ + timeout: timeout, + } +} + +// NewV1NetworkPeersGetallParamsWithContext creates a new V1NetworkPeersGetallParams object +// with the ability to set a context for a request. +func NewV1NetworkPeersGetallParamsWithContext(ctx context.Context) *V1NetworkPeersGetallParams { + return &V1NetworkPeersGetallParams{ + Context: ctx, + } +} + +// NewV1NetworkPeersGetallParamsWithHTTPClient creates a new V1NetworkPeersGetallParams object +// with the ability to set a custom HTTPClient for a request. +func NewV1NetworkPeersGetallParamsWithHTTPClient(client *http.Client) *V1NetworkPeersGetallParams { + return &V1NetworkPeersGetallParams{ + HTTPClient: client, + } +} + +/* +V1NetworkPeersGetallParams contains all the parameters to send to the API endpoint + + for the v1 network peers getall operation. + + Typically these are written to a http.Request. +*/ +type V1NetworkPeersGetallParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the v1 network peers getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *V1NetworkPeersGetallParams) WithDefaults() *V1NetworkPeersGetallParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the v1 network peers getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *V1NetworkPeersGetallParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the v1 network peers getall params +func (o *V1NetworkPeersGetallParams) WithTimeout(timeout time.Duration) *V1NetworkPeersGetallParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the v1 network peers getall params +func (o *V1NetworkPeersGetallParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the v1 network peers getall params +func (o *V1NetworkPeersGetallParams) WithContext(ctx context.Context) *V1NetworkPeersGetallParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the v1 network peers getall params +func (o *V1NetworkPeersGetallParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the v1 network peers getall params +func (o *V1NetworkPeersGetallParams) WithHTTPClient(client *http.Client) *V1NetworkPeersGetallParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the v1 network peers getall params +func (o *V1NetworkPeersGetallParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *V1NetworkPeersGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_getall_responses.go new file mode 100644 index 00000000000..2ac3cef68a5 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_getall_responses.go @@ -0,0 +1,563 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package network_peers + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + stderrors "errors" + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// V1NetworkPeersGetallReader is a Reader for the V1NetworkPeersGetall structure. +type V1NetworkPeersGetallReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *V1NetworkPeersGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { + switch response.Code() { + case 200: + result := NewV1NetworkPeersGetallOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewV1NetworkPeersGetallBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewV1NetworkPeersGetallUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewV1NetworkPeersGetallForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewV1NetworkPeersGetallNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewV1NetworkPeersGetallConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewV1NetworkPeersGetallInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /v1/network-peers] v1.networkPeers.getall", response, response.Code()) + } +} + +// NewV1NetworkPeersGetallOK creates a V1NetworkPeersGetallOK with default headers values +func NewV1NetworkPeersGetallOK() *V1NetworkPeersGetallOK { + return &V1NetworkPeersGetallOK{} +} + +/* +V1NetworkPeersGetallOK describes a response with status code 200, with default header values. + +OK +*/ +type V1NetworkPeersGetallOK struct { + Payload *models.NetworkPeers +} + +// IsSuccess returns true when this v1 network peers getall o k response has a 2xx status code +func (o *V1NetworkPeersGetallOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this v1 network peers getall o k response has a 3xx status code +func (o *V1NetworkPeersGetallOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers getall o k response has a 4xx status code +func (o *V1NetworkPeersGetallOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this v1 network peers getall o k response has a 5xx status code +func (o *V1NetworkPeersGetallOK) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers getall o k response a status code equal to that given +func (o *V1NetworkPeersGetallOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the v1 network peers getall o k response +func (o *V1NetworkPeersGetallOK) Code() int { + return 200 +} + +func (o *V1NetworkPeersGetallOK) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers][%d] v1NetworkPeersGetallOK %s", 200, payload) +} + +func (o *V1NetworkPeersGetallOK) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers][%d] v1NetworkPeersGetallOK %s", 200, payload) +} + +func (o *V1NetworkPeersGetallOK) GetPayload() *models.NetworkPeers { + return o.Payload +} + +func (o *V1NetworkPeersGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.NetworkPeers) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersGetallBadRequest creates a V1NetworkPeersGetallBadRequest with default headers values +func NewV1NetworkPeersGetallBadRequest() *V1NetworkPeersGetallBadRequest { + return &V1NetworkPeersGetallBadRequest{} +} + +/* +V1NetworkPeersGetallBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type V1NetworkPeersGetallBadRequest struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers getall bad request response has a 2xx status code +func (o *V1NetworkPeersGetallBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers getall bad request response has a 3xx status code +func (o *V1NetworkPeersGetallBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers getall bad request response has a 4xx status code +func (o *V1NetworkPeersGetallBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers getall bad request response has a 5xx status code +func (o *V1NetworkPeersGetallBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers getall bad request response a status code equal to that given +func (o *V1NetworkPeersGetallBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the v1 network peers getall bad request response +func (o *V1NetworkPeersGetallBadRequest) Code() int { + return 400 +} + +func (o *V1NetworkPeersGetallBadRequest) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers][%d] v1NetworkPeersGetallBadRequest %s", 400, payload) +} + +func (o *V1NetworkPeersGetallBadRequest) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers][%d] v1NetworkPeersGetallBadRequest %s", 400, payload) +} + +func (o *V1NetworkPeersGetallBadRequest) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersGetallUnauthorized creates a V1NetworkPeersGetallUnauthorized with default headers values +func NewV1NetworkPeersGetallUnauthorized() *V1NetworkPeersGetallUnauthorized { + return &V1NetworkPeersGetallUnauthorized{} +} + +/* +V1NetworkPeersGetallUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type V1NetworkPeersGetallUnauthorized struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers getall unauthorized response has a 2xx status code +func (o *V1NetworkPeersGetallUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers getall unauthorized response has a 3xx status code +func (o *V1NetworkPeersGetallUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers getall unauthorized response has a 4xx status code +func (o *V1NetworkPeersGetallUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers getall unauthorized response has a 5xx status code +func (o *V1NetworkPeersGetallUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers getall unauthorized response a status code equal to that given +func (o *V1NetworkPeersGetallUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the v1 network peers getall unauthorized response +func (o *V1NetworkPeersGetallUnauthorized) Code() int { + return 401 +} + +func (o *V1NetworkPeersGetallUnauthorized) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers][%d] v1NetworkPeersGetallUnauthorized %s", 401, payload) +} + +func (o *V1NetworkPeersGetallUnauthorized) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers][%d] v1NetworkPeersGetallUnauthorized %s", 401, payload) +} + +func (o *V1NetworkPeersGetallUnauthorized) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersGetallForbidden creates a V1NetworkPeersGetallForbidden with default headers values +func NewV1NetworkPeersGetallForbidden() *V1NetworkPeersGetallForbidden { + return &V1NetworkPeersGetallForbidden{} +} + +/* +V1NetworkPeersGetallForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type V1NetworkPeersGetallForbidden struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers getall forbidden response has a 2xx status code +func (o *V1NetworkPeersGetallForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers getall forbidden response has a 3xx status code +func (o *V1NetworkPeersGetallForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers getall forbidden response has a 4xx status code +func (o *V1NetworkPeersGetallForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers getall forbidden response has a 5xx status code +func (o *V1NetworkPeersGetallForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers getall forbidden response a status code equal to that given +func (o *V1NetworkPeersGetallForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the v1 network peers getall forbidden response +func (o *V1NetworkPeersGetallForbidden) Code() int { + return 403 +} + +func (o *V1NetworkPeersGetallForbidden) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers][%d] v1NetworkPeersGetallForbidden %s", 403, payload) +} + +func (o *V1NetworkPeersGetallForbidden) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers][%d] v1NetworkPeersGetallForbidden %s", 403, payload) +} + +func (o *V1NetworkPeersGetallForbidden) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersGetallNotFound creates a V1NetworkPeersGetallNotFound with default headers values +func NewV1NetworkPeersGetallNotFound() *V1NetworkPeersGetallNotFound { + return &V1NetworkPeersGetallNotFound{} +} + +/* +V1NetworkPeersGetallNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type V1NetworkPeersGetallNotFound struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers getall not found response has a 2xx status code +func (o *V1NetworkPeersGetallNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers getall not found response has a 3xx status code +func (o *V1NetworkPeersGetallNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers getall not found response has a 4xx status code +func (o *V1NetworkPeersGetallNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers getall not found response has a 5xx status code +func (o *V1NetworkPeersGetallNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers getall not found response a status code equal to that given +func (o *V1NetworkPeersGetallNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the v1 network peers getall not found response +func (o *V1NetworkPeersGetallNotFound) Code() int { + return 404 +} + +func (o *V1NetworkPeersGetallNotFound) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers][%d] v1NetworkPeersGetallNotFound %s", 404, payload) +} + +func (o *V1NetworkPeersGetallNotFound) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers][%d] v1NetworkPeersGetallNotFound %s", 404, payload) +} + +func (o *V1NetworkPeersGetallNotFound) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersGetallConflict creates a V1NetworkPeersGetallConflict with default headers values +func NewV1NetworkPeersGetallConflict() *V1NetworkPeersGetallConflict { + return &V1NetworkPeersGetallConflict{} +} + +/* +V1NetworkPeersGetallConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type V1NetworkPeersGetallConflict struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers getall conflict response has a 2xx status code +func (o *V1NetworkPeersGetallConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers getall conflict response has a 3xx status code +func (o *V1NetworkPeersGetallConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers getall conflict response has a 4xx status code +func (o *V1NetworkPeersGetallConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers getall conflict response has a 5xx status code +func (o *V1NetworkPeersGetallConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers getall conflict response a status code equal to that given +func (o *V1NetworkPeersGetallConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the v1 network peers getall conflict response +func (o *V1NetworkPeersGetallConflict) Code() int { + return 409 +} + +func (o *V1NetworkPeersGetallConflict) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers][%d] v1NetworkPeersGetallConflict %s", 409, payload) +} + +func (o *V1NetworkPeersGetallConflict) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers][%d] v1NetworkPeersGetallConflict %s", 409, payload) +} + +func (o *V1NetworkPeersGetallConflict) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersGetallConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersGetallInternalServerError creates a V1NetworkPeersGetallInternalServerError with default headers values +func NewV1NetworkPeersGetallInternalServerError() *V1NetworkPeersGetallInternalServerError { + return &V1NetworkPeersGetallInternalServerError{} +} + +/* +V1NetworkPeersGetallInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type V1NetworkPeersGetallInternalServerError struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers getall internal server error response has a 2xx status code +func (o *V1NetworkPeersGetallInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers getall internal server error response has a 3xx status code +func (o *V1NetworkPeersGetallInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers getall internal server error response has a 4xx status code +func (o *V1NetworkPeersGetallInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this v1 network peers getall internal server error response has a 5xx status code +func (o *V1NetworkPeersGetallInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this v1 network peers getall internal server error response a status code equal to that given +func (o *V1NetworkPeersGetallInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the v1 network peers getall internal server error response +func (o *V1NetworkPeersGetallInternalServerError) Code() int { + return 500 +} + +func (o *V1NetworkPeersGetallInternalServerError) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers][%d] v1NetworkPeersGetallInternalServerError %s", 500, payload) +} + +func (o *V1NetworkPeersGetallInternalServerError) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers][%d] v1NetworkPeersGetallInternalServerError %s", 500, payload) +} + +func (o *V1NetworkPeersGetallInternalServerError) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_id_delete_parameters.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_id_delete_parameters.go new file mode 100644 index 00000000000..cc61fd59c41 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_id_delete_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package network_peers + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewV1NetworkPeersIDDeleteParams creates a new V1NetworkPeersIDDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewV1NetworkPeersIDDeleteParams() *V1NetworkPeersIDDeleteParams { + return &V1NetworkPeersIDDeleteParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewV1NetworkPeersIDDeleteParamsWithTimeout creates a new V1NetworkPeersIDDeleteParams object +// with the ability to set a timeout on a request. +func NewV1NetworkPeersIDDeleteParamsWithTimeout(timeout time.Duration) *V1NetworkPeersIDDeleteParams { + return &V1NetworkPeersIDDeleteParams{ + timeout: timeout, + } +} + +// NewV1NetworkPeersIDDeleteParamsWithContext creates a new V1NetworkPeersIDDeleteParams object +// with the ability to set a context for a request. +func NewV1NetworkPeersIDDeleteParamsWithContext(ctx context.Context) *V1NetworkPeersIDDeleteParams { + return &V1NetworkPeersIDDeleteParams{ + Context: ctx, + } +} + +// NewV1NetworkPeersIDDeleteParamsWithHTTPClient creates a new V1NetworkPeersIDDeleteParams object +// with the ability to set a custom HTTPClient for a request. +func NewV1NetworkPeersIDDeleteParamsWithHTTPClient(client *http.Client) *V1NetworkPeersIDDeleteParams { + return &V1NetworkPeersIDDeleteParams{ + HTTPClient: client, + } +} + +/* +V1NetworkPeersIDDeleteParams contains all the parameters to send to the API endpoint + + for the v1 network peers id delete operation. + + Typically these are written to a http.Request. +*/ +type V1NetworkPeersIDDeleteParams struct { + + /* NetworkPeerID. + + network peer ID + */ + NetworkPeerID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the v1 network peers id delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *V1NetworkPeersIDDeleteParams) WithDefaults() *V1NetworkPeersIDDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the v1 network peers id delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *V1NetworkPeersIDDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the v1 network peers id delete params +func (o *V1NetworkPeersIDDeleteParams) WithTimeout(timeout time.Duration) *V1NetworkPeersIDDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the v1 network peers id delete params +func (o *V1NetworkPeersIDDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the v1 network peers id delete params +func (o *V1NetworkPeersIDDeleteParams) WithContext(ctx context.Context) *V1NetworkPeersIDDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the v1 network peers id delete params +func (o *V1NetworkPeersIDDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the v1 network peers id delete params +func (o *V1NetworkPeersIDDeleteParams) WithHTTPClient(client *http.Client) *V1NetworkPeersIDDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the v1 network peers id delete params +func (o *V1NetworkPeersIDDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithNetworkPeerID adds the networkPeerID to the v1 network peers id delete params +func (o *V1NetworkPeersIDDeleteParams) WithNetworkPeerID(networkPeerID string) *V1NetworkPeersIDDeleteParams { + o.SetNetworkPeerID(networkPeerID) + return o +} + +// SetNetworkPeerID adds the networkPeerId to the v1 network peers id delete params +func (o *V1NetworkPeersIDDeleteParams) SetNetworkPeerID(networkPeerID string) { + o.NetworkPeerID = networkPeerID +} + +// WriteToRequest writes these params to a swagger request +func (o *V1NetworkPeersIDDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param network_peer_id + if err := r.SetPathParam("network_peer_id", o.NetworkPeerID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_id_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_id_delete_responses.go new file mode 100644 index 00000000000..5a0c5f23d96 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_id_delete_responses.go @@ -0,0 +1,561 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package network_peers + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + stderrors "errors" + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// V1NetworkPeersIDDeleteReader is a Reader for the V1NetworkPeersIDDelete structure. +type V1NetworkPeersIDDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *V1NetworkPeersIDDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { + switch response.Code() { + case 200: + result := NewV1NetworkPeersIDDeleteOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewV1NetworkPeersIDDeleteBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewV1NetworkPeersIDDeleteUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewV1NetworkPeersIDDeleteForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewV1NetworkPeersIDDeleteNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewV1NetworkPeersIDDeleteConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewV1NetworkPeersIDDeleteInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[DELETE /v1/network-peers/{network_peer_id}] v1.networkPeers.id.delete", response, response.Code()) + } +} + +// NewV1NetworkPeersIDDeleteOK creates a V1NetworkPeersIDDeleteOK with default headers values +func NewV1NetworkPeersIDDeleteOK() *V1NetworkPeersIDDeleteOK { + return &V1NetworkPeersIDDeleteOK{} +} + +/* +V1NetworkPeersIDDeleteOK describes a response with status code 200, with default header values. + +OK +*/ +type V1NetworkPeersIDDeleteOK struct { + Payload models.Object +} + +// IsSuccess returns true when this v1 network peers Id delete o k response has a 2xx status code +func (o *V1NetworkPeersIDDeleteOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this v1 network peers Id delete o k response has a 3xx status code +func (o *V1NetworkPeersIDDeleteOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers Id delete o k response has a 4xx status code +func (o *V1NetworkPeersIDDeleteOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this v1 network peers Id delete o k response has a 5xx status code +func (o *V1NetworkPeersIDDeleteOK) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers Id delete o k response a status code equal to that given +func (o *V1NetworkPeersIDDeleteOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the v1 network peers Id delete o k response +func (o *V1NetworkPeersIDDeleteOK) Code() int { + return 200 +} + +func (o *V1NetworkPeersIDDeleteOK) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdDeleteOK %s", 200, payload) +} + +func (o *V1NetworkPeersIDDeleteOK) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdDeleteOK %s", 200, payload) +} + +func (o *V1NetworkPeersIDDeleteOK) GetPayload() models.Object { + return o.Payload +} + +func (o *V1NetworkPeersIDDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersIDDeleteBadRequest creates a V1NetworkPeersIDDeleteBadRequest with default headers values +func NewV1NetworkPeersIDDeleteBadRequest() *V1NetworkPeersIDDeleteBadRequest { + return &V1NetworkPeersIDDeleteBadRequest{} +} + +/* +V1NetworkPeersIDDeleteBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type V1NetworkPeersIDDeleteBadRequest struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers Id delete bad request response has a 2xx status code +func (o *V1NetworkPeersIDDeleteBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers Id delete bad request response has a 3xx status code +func (o *V1NetworkPeersIDDeleteBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers Id delete bad request response has a 4xx status code +func (o *V1NetworkPeersIDDeleteBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers Id delete bad request response has a 5xx status code +func (o *V1NetworkPeersIDDeleteBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers Id delete bad request response a status code equal to that given +func (o *V1NetworkPeersIDDeleteBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the v1 network peers Id delete bad request response +func (o *V1NetworkPeersIDDeleteBadRequest) Code() int { + return 400 +} + +func (o *V1NetworkPeersIDDeleteBadRequest) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdDeleteBadRequest %s", 400, payload) +} + +func (o *V1NetworkPeersIDDeleteBadRequest) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdDeleteBadRequest %s", 400, payload) +} + +func (o *V1NetworkPeersIDDeleteBadRequest) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersIDDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersIDDeleteUnauthorized creates a V1NetworkPeersIDDeleteUnauthorized with default headers values +func NewV1NetworkPeersIDDeleteUnauthorized() *V1NetworkPeersIDDeleteUnauthorized { + return &V1NetworkPeersIDDeleteUnauthorized{} +} + +/* +V1NetworkPeersIDDeleteUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type V1NetworkPeersIDDeleteUnauthorized struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers Id delete unauthorized response has a 2xx status code +func (o *V1NetworkPeersIDDeleteUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers Id delete unauthorized response has a 3xx status code +func (o *V1NetworkPeersIDDeleteUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers Id delete unauthorized response has a 4xx status code +func (o *V1NetworkPeersIDDeleteUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers Id delete unauthorized response has a 5xx status code +func (o *V1NetworkPeersIDDeleteUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers Id delete unauthorized response a status code equal to that given +func (o *V1NetworkPeersIDDeleteUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the v1 network peers Id delete unauthorized response +func (o *V1NetworkPeersIDDeleteUnauthorized) Code() int { + return 401 +} + +func (o *V1NetworkPeersIDDeleteUnauthorized) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdDeleteUnauthorized %s", 401, payload) +} + +func (o *V1NetworkPeersIDDeleteUnauthorized) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdDeleteUnauthorized %s", 401, payload) +} + +func (o *V1NetworkPeersIDDeleteUnauthorized) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersIDDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersIDDeleteForbidden creates a V1NetworkPeersIDDeleteForbidden with default headers values +func NewV1NetworkPeersIDDeleteForbidden() *V1NetworkPeersIDDeleteForbidden { + return &V1NetworkPeersIDDeleteForbidden{} +} + +/* +V1NetworkPeersIDDeleteForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type V1NetworkPeersIDDeleteForbidden struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers Id delete forbidden response has a 2xx status code +func (o *V1NetworkPeersIDDeleteForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers Id delete forbidden response has a 3xx status code +func (o *V1NetworkPeersIDDeleteForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers Id delete forbidden response has a 4xx status code +func (o *V1NetworkPeersIDDeleteForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers Id delete forbidden response has a 5xx status code +func (o *V1NetworkPeersIDDeleteForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers Id delete forbidden response a status code equal to that given +func (o *V1NetworkPeersIDDeleteForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the v1 network peers Id delete forbidden response +func (o *V1NetworkPeersIDDeleteForbidden) Code() int { + return 403 +} + +func (o *V1NetworkPeersIDDeleteForbidden) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdDeleteForbidden %s", 403, payload) +} + +func (o *V1NetworkPeersIDDeleteForbidden) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdDeleteForbidden %s", 403, payload) +} + +func (o *V1NetworkPeersIDDeleteForbidden) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersIDDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersIDDeleteNotFound creates a V1NetworkPeersIDDeleteNotFound with default headers values +func NewV1NetworkPeersIDDeleteNotFound() *V1NetworkPeersIDDeleteNotFound { + return &V1NetworkPeersIDDeleteNotFound{} +} + +/* +V1NetworkPeersIDDeleteNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type V1NetworkPeersIDDeleteNotFound struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers Id delete not found response has a 2xx status code +func (o *V1NetworkPeersIDDeleteNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers Id delete not found response has a 3xx status code +func (o *V1NetworkPeersIDDeleteNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers Id delete not found response has a 4xx status code +func (o *V1NetworkPeersIDDeleteNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers Id delete not found response has a 5xx status code +func (o *V1NetworkPeersIDDeleteNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers Id delete not found response a status code equal to that given +func (o *V1NetworkPeersIDDeleteNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the v1 network peers Id delete not found response +func (o *V1NetworkPeersIDDeleteNotFound) Code() int { + return 404 +} + +func (o *V1NetworkPeersIDDeleteNotFound) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdDeleteNotFound %s", 404, payload) +} + +func (o *V1NetworkPeersIDDeleteNotFound) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdDeleteNotFound %s", 404, payload) +} + +func (o *V1NetworkPeersIDDeleteNotFound) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersIDDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersIDDeleteConflict creates a V1NetworkPeersIDDeleteConflict with default headers values +func NewV1NetworkPeersIDDeleteConflict() *V1NetworkPeersIDDeleteConflict { + return &V1NetworkPeersIDDeleteConflict{} +} + +/* +V1NetworkPeersIDDeleteConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type V1NetworkPeersIDDeleteConflict struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers Id delete conflict response has a 2xx status code +func (o *V1NetworkPeersIDDeleteConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers Id delete conflict response has a 3xx status code +func (o *V1NetworkPeersIDDeleteConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers Id delete conflict response has a 4xx status code +func (o *V1NetworkPeersIDDeleteConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers Id delete conflict response has a 5xx status code +func (o *V1NetworkPeersIDDeleteConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers Id delete conflict response a status code equal to that given +func (o *V1NetworkPeersIDDeleteConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the v1 network peers Id delete conflict response +func (o *V1NetworkPeersIDDeleteConflict) Code() int { + return 409 +} + +func (o *V1NetworkPeersIDDeleteConflict) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdDeleteConflict %s", 409, payload) +} + +func (o *V1NetworkPeersIDDeleteConflict) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdDeleteConflict %s", 409, payload) +} + +func (o *V1NetworkPeersIDDeleteConflict) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersIDDeleteConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersIDDeleteInternalServerError creates a V1NetworkPeersIDDeleteInternalServerError with default headers values +func NewV1NetworkPeersIDDeleteInternalServerError() *V1NetworkPeersIDDeleteInternalServerError { + return &V1NetworkPeersIDDeleteInternalServerError{} +} + +/* +V1NetworkPeersIDDeleteInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type V1NetworkPeersIDDeleteInternalServerError struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers Id delete internal server error response has a 2xx status code +func (o *V1NetworkPeersIDDeleteInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers Id delete internal server error response has a 3xx status code +func (o *V1NetworkPeersIDDeleteInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers Id delete internal server error response has a 4xx status code +func (o *V1NetworkPeersIDDeleteInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this v1 network peers Id delete internal server error response has a 5xx status code +func (o *V1NetworkPeersIDDeleteInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this v1 network peers Id delete internal server error response a status code equal to that given +func (o *V1NetworkPeersIDDeleteInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the v1 network peers Id delete internal server error response +func (o *V1NetworkPeersIDDeleteInternalServerError) Code() int { + return 500 +} + +func (o *V1NetworkPeersIDDeleteInternalServerError) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdDeleteInternalServerError %s", 500, payload) +} + +func (o *V1NetworkPeersIDDeleteInternalServerError) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdDeleteInternalServerError %s", 500, payload) +} + +func (o *V1NetworkPeersIDDeleteInternalServerError) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersIDDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_id_get_parameters.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_id_get_parameters.go new file mode 100644 index 00000000000..c81b40cad93 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_id_get_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package network_peers + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewV1NetworkPeersIDGetParams creates a new V1NetworkPeersIDGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewV1NetworkPeersIDGetParams() *V1NetworkPeersIDGetParams { + return &V1NetworkPeersIDGetParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewV1NetworkPeersIDGetParamsWithTimeout creates a new V1NetworkPeersIDGetParams object +// with the ability to set a timeout on a request. +func NewV1NetworkPeersIDGetParamsWithTimeout(timeout time.Duration) *V1NetworkPeersIDGetParams { + return &V1NetworkPeersIDGetParams{ + timeout: timeout, + } +} + +// NewV1NetworkPeersIDGetParamsWithContext creates a new V1NetworkPeersIDGetParams object +// with the ability to set a context for a request. +func NewV1NetworkPeersIDGetParamsWithContext(ctx context.Context) *V1NetworkPeersIDGetParams { + return &V1NetworkPeersIDGetParams{ + Context: ctx, + } +} + +// NewV1NetworkPeersIDGetParamsWithHTTPClient creates a new V1NetworkPeersIDGetParams object +// with the ability to set a custom HTTPClient for a request. +func NewV1NetworkPeersIDGetParamsWithHTTPClient(client *http.Client) *V1NetworkPeersIDGetParams { + return &V1NetworkPeersIDGetParams{ + HTTPClient: client, + } +} + +/* +V1NetworkPeersIDGetParams contains all the parameters to send to the API endpoint + + for the v1 network peers id get operation. + + Typically these are written to a http.Request. +*/ +type V1NetworkPeersIDGetParams struct { + + /* NetworkPeerID. + + network peer ID + */ + NetworkPeerID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the v1 network peers id get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *V1NetworkPeersIDGetParams) WithDefaults() *V1NetworkPeersIDGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the v1 network peers id get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *V1NetworkPeersIDGetParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the v1 network peers id get params +func (o *V1NetworkPeersIDGetParams) WithTimeout(timeout time.Duration) *V1NetworkPeersIDGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the v1 network peers id get params +func (o *V1NetworkPeersIDGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the v1 network peers id get params +func (o *V1NetworkPeersIDGetParams) WithContext(ctx context.Context) *V1NetworkPeersIDGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the v1 network peers id get params +func (o *V1NetworkPeersIDGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the v1 network peers id get params +func (o *V1NetworkPeersIDGetParams) WithHTTPClient(client *http.Client) *V1NetworkPeersIDGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the v1 network peers id get params +func (o *V1NetworkPeersIDGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithNetworkPeerID adds the networkPeerID to the v1 network peers id get params +func (o *V1NetworkPeersIDGetParams) WithNetworkPeerID(networkPeerID string) *V1NetworkPeersIDGetParams { + o.SetNetworkPeerID(networkPeerID) + return o +} + +// SetNetworkPeerID adds the networkPeerId to the v1 network peers id get params +func (o *V1NetworkPeersIDGetParams) SetNetworkPeerID(networkPeerID string) { + o.NetworkPeerID = networkPeerID +} + +// WriteToRequest writes these params to a swagger request +func (o *V1NetworkPeersIDGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param network_peer_id + if err := r.SetPathParam("network_peer_id", o.NetworkPeerID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_id_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_id_get_responses.go new file mode 100644 index 00000000000..22f3ee0e38f --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_id_get_responses.go @@ -0,0 +1,563 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package network_peers + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + stderrors "errors" + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// V1NetworkPeersIDGetReader is a Reader for the V1NetworkPeersIDGet structure. +type V1NetworkPeersIDGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *V1NetworkPeersIDGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { + switch response.Code() { + case 200: + result := NewV1NetworkPeersIDGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewV1NetworkPeersIDGetBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewV1NetworkPeersIDGetUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewV1NetworkPeersIDGetForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewV1NetworkPeersIDGetNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewV1NetworkPeersIDGetConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewV1NetworkPeersIDGetInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /v1/network-peers/{network_peer_id}] v1.networkPeers.id.get", response, response.Code()) + } +} + +// NewV1NetworkPeersIDGetOK creates a V1NetworkPeersIDGetOK with default headers values +func NewV1NetworkPeersIDGetOK() *V1NetworkPeersIDGetOK { + return &V1NetworkPeersIDGetOK{} +} + +/* +V1NetworkPeersIDGetOK describes a response with status code 200, with default header values. + +OK +*/ +type V1NetworkPeersIDGetOK struct { + Payload *models.NetworkPeer +} + +// IsSuccess returns true when this v1 network peers Id get o k response has a 2xx status code +func (o *V1NetworkPeersIDGetOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this v1 network peers Id get o k response has a 3xx status code +func (o *V1NetworkPeersIDGetOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers Id get o k response has a 4xx status code +func (o *V1NetworkPeersIDGetOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this v1 network peers Id get o k response has a 5xx status code +func (o *V1NetworkPeersIDGetOK) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers Id get o k response a status code equal to that given +func (o *V1NetworkPeersIDGetOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the v1 network peers Id get o k response +func (o *V1NetworkPeersIDGetOK) Code() int { + return 200 +} + +func (o *V1NetworkPeersIDGetOK) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdGetOK %s", 200, payload) +} + +func (o *V1NetworkPeersIDGetOK) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdGetOK %s", 200, payload) +} + +func (o *V1NetworkPeersIDGetOK) GetPayload() *models.NetworkPeer { + return o.Payload +} + +func (o *V1NetworkPeersIDGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.NetworkPeer) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersIDGetBadRequest creates a V1NetworkPeersIDGetBadRequest with default headers values +func NewV1NetworkPeersIDGetBadRequest() *V1NetworkPeersIDGetBadRequest { + return &V1NetworkPeersIDGetBadRequest{} +} + +/* +V1NetworkPeersIDGetBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type V1NetworkPeersIDGetBadRequest struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers Id get bad request response has a 2xx status code +func (o *V1NetworkPeersIDGetBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers Id get bad request response has a 3xx status code +func (o *V1NetworkPeersIDGetBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers Id get bad request response has a 4xx status code +func (o *V1NetworkPeersIDGetBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers Id get bad request response has a 5xx status code +func (o *V1NetworkPeersIDGetBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers Id get bad request response a status code equal to that given +func (o *V1NetworkPeersIDGetBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the v1 network peers Id get bad request response +func (o *V1NetworkPeersIDGetBadRequest) Code() int { + return 400 +} + +func (o *V1NetworkPeersIDGetBadRequest) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdGetBadRequest %s", 400, payload) +} + +func (o *V1NetworkPeersIDGetBadRequest) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdGetBadRequest %s", 400, payload) +} + +func (o *V1NetworkPeersIDGetBadRequest) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersIDGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersIDGetUnauthorized creates a V1NetworkPeersIDGetUnauthorized with default headers values +func NewV1NetworkPeersIDGetUnauthorized() *V1NetworkPeersIDGetUnauthorized { + return &V1NetworkPeersIDGetUnauthorized{} +} + +/* +V1NetworkPeersIDGetUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type V1NetworkPeersIDGetUnauthorized struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers Id get unauthorized response has a 2xx status code +func (o *V1NetworkPeersIDGetUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers Id get unauthorized response has a 3xx status code +func (o *V1NetworkPeersIDGetUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers Id get unauthorized response has a 4xx status code +func (o *V1NetworkPeersIDGetUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers Id get unauthorized response has a 5xx status code +func (o *V1NetworkPeersIDGetUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers Id get unauthorized response a status code equal to that given +func (o *V1NetworkPeersIDGetUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the v1 network peers Id get unauthorized response +func (o *V1NetworkPeersIDGetUnauthorized) Code() int { + return 401 +} + +func (o *V1NetworkPeersIDGetUnauthorized) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdGetUnauthorized %s", 401, payload) +} + +func (o *V1NetworkPeersIDGetUnauthorized) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdGetUnauthorized %s", 401, payload) +} + +func (o *V1NetworkPeersIDGetUnauthorized) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersIDGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersIDGetForbidden creates a V1NetworkPeersIDGetForbidden with default headers values +func NewV1NetworkPeersIDGetForbidden() *V1NetworkPeersIDGetForbidden { + return &V1NetworkPeersIDGetForbidden{} +} + +/* +V1NetworkPeersIDGetForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type V1NetworkPeersIDGetForbidden struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers Id get forbidden response has a 2xx status code +func (o *V1NetworkPeersIDGetForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers Id get forbidden response has a 3xx status code +func (o *V1NetworkPeersIDGetForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers Id get forbidden response has a 4xx status code +func (o *V1NetworkPeersIDGetForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers Id get forbidden response has a 5xx status code +func (o *V1NetworkPeersIDGetForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers Id get forbidden response a status code equal to that given +func (o *V1NetworkPeersIDGetForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the v1 network peers Id get forbidden response +func (o *V1NetworkPeersIDGetForbidden) Code() int { + return 403 +} + +func (o *V1NetworkPeersIDGetForbidden) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdGetForbidden %s", 403, payload) +} + +func (o *V1NetworkPeersIDGetForbidden) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdGetForbidden %s", 403, payload) +} + +func (o *V1NetworkPeersIDGetForbidden) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersIDGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersIDGetNotFound creates a V1NetworkPeersIDGetNotFound with default headers values +func NewV1NetworkPeersIDGetNotFound() *V1NetworkPeersIDGetNotFound { + return &V1NetworkPeersIDGetNotFound{} +} + +/* +V1NetworkPeersIDGetNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type V1NetworkPeersIDGetNotFound struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers Id get not found response has a 2xx status code +func (o *V1NetworkPeersIDGetNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers Id get not found response has a 3xx status code +func (o *V1NetworkPeersIDGetNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers Id get not found response has a 4xx status code +func (o *V1NetworkPeersIDGetNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers Id get not found response has a 5xx status code +func (o *V1NetworkPeersIDGetNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers Id get not found response a status code equal to that given +func (o *V1NetworkPeersIDGetNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the v1 network peers Id get not found response +func (o *V1NetworkPeersIDGetNotFound) Code() int { + return 404 +} + +func (o *V1NetworkPeersIDGetNotFound) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdGetNotFound %s", 404, payload) +} + +func (o *V1NetworkPeersIDGetNotFound) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdGetNotFound %s", 404, payload) +} + +func (o *V1NetworkPeersIDGetNotFound) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersIDGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersIDGetConflict creates a V1NetworkPeersIDGetConflict with default headers values +func NewV1NetworkPeersIDGetConflict() *V1NetworkPeersIDGetConflict { + return &V1NetworkPeersIDGetConflict{} +} + +/* +V1NetworkPeersIDGetConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type V1NetworkPeersIDGetConflict struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers Id get conflict response has a 2xx status code +func (o *V1NetworkPeersIDGetConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers Id get conflict response has a 3xx status code +func (o *V1NetworkPeersIDGetConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers Id get conflict response has a 4xx status code +func (o *V1NetworkPeersIDGetConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers Id get conflict response has a 5xx status code +func (o *V1NetworkPeersIDGetConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers Id get conflict response a status code equal to that given +func (o *V1NetworkPeersIDGetConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the v1 network peers Id get conflict response +func (o *V1NetworkPeersIDGetConflict) Code() int { + return 409 +} + +func (o *V1NetworkPeersIDGetConflict) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdGetConflict %s", 409, payload) +} + +func (o *V1NetworkPeersIDGetConflict) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdGetConflict %s", 409, payload) +} + +func (o *V1NetworkPeersIDGetConflict) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersIDGetConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersIDGetInternalServerError creates a V1NetworkPeersIDGetInternalServerError with default headers values +func NewV1NetworkPeersIDGetInternalServerError() *V1NetworkPeersIDGetInternalServerError { + return &V1NetworkPeersIDGetInternalServerError{} +} + +/* +V1NetworkPeersIDGetInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type V1NetworkPeersIDGetInternalServerError struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers Id get internal server error response has a 2xx status code +func (o *V1NetworkPeersIDGetInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers Id get internal server error response has a 3xx status code +func (o *V1NetworkPeersIDGetInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers Id get internal server error response has a 4xx status code +func (o *V1NetworkPeersIDGetInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this v1 network peers Id get internal server error response has a 5xx status code +func (o *V1NetworkPeersIDGetInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this v1 network peers Id get internal server error response a status code equal to that given +func (o *V1NetworkPeersIDGetInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the v1 network peers Id get internal server error response +func (o *V1NetworkPeersIDGetInternalServerError) Code() int { + return 500 +} + +func (o *V1NetworkPeersIDGetInternalServerError) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdGetInternalServerError %s", 500, payload) +} + +func (o *V1NetworkPeersIDGetInternalServerError) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdGetInternalServerError %s", 500, payload) +} + +func (o *V1NetworkPeersIDGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersIDGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_id_put_parameters.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_id_put_parameters.go new file mode 100644 index 00000000000..34ee818d28c --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_id_put_parameters.go @@ -0,0 +1,175 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package network_peers + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// NewV1NetworkPeersIDPutParams creates a new V1NetworkPeersIDPutParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewV1NetworkPeersIDPutParams() *V1NetworkPeersIDPutParams { + return &V1NetworkPeersIDPutParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewV1NetworkPeersIDPutParamsWithTimeout creates a new V1NetworkPeersIDPutParams object +// with the ability to set a timeout on a request. +func NewV1NetworkPeersIDPutParamsWithTimeout(timeout time.Duration) *V1NetworkPeersIDPutParams { + return &V1NetworkPeersIDPutParams{ + timeout: timeout, + } +} + +// NewV1NetworkPeersIDPutParamsWithContext creates a new V1NetworkPeersIDPutParams object +// with the ability to set a context for a request. +func NewV1NetworkPeersIDPutParamsWithContext(ctx context.Context) *V1NetworkPeersIDPutParams { + return &V1NetworkPeersIDPutParams{ + Context: ctx, + } +} + +// NewV1NetworkPeersIDPutParamsWithHTTPClient creates a new V1NetworkPeersIDPutParams object +// with the ability to set a custom HTTPClient for a request. +func NewV1NetworkPeersIDPutParamsWithHTTPClient(client *http.Client) *V1NetworkPeersIDPutParams { + return &V1NetworkPeersIDPutParams{ + HTTPClient: client, + } +} + +/* +V1NetworkPeersIDPutParams contains all the parameters to send to the API endpoint + + for the v1 network peers id put operation. + + Typically these are written to a http.Request. +*/ +type V1NetworkPeersIDPutParams struct { + + /* Body. + + network peer update parameters + */ + Body *models.NetworkPeerUpdate + + /* NetworkPeerID. + + network peer ID + */ + NetworkPeerID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the v1 network peers id put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *V1NetworkPeersIDPutParams) WithDefaults() *V1NetworkPeersIDPutParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the v1 network peers id put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *V1NetworkPeersIDPutParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the v1 network peers id put params +func (o *V1NetworkPeersIDPutParams) WithTimeout(timeout time.Duration) *V1NetworkPeersIDPutParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the v1 network peers id put params +func (o *V1NetworkPeersIDPutParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the v1 network peers id put params +func (o *V1NetworkPeersIDPutParams) WithContext(ctx context.Context) *V1NetworkPeersIDPutParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the v1 network peers id put params +func (o *V1NetworkPeersIDPutParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the v1 network peers id put params +func (o *V1NetworkPeersIDPutParams) WithHTTPClient(client *http.Client) *V1NetworkPeersIDPutParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the v1 network peers id put params +func (o *V1NetworkPeersIDPutParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the v1 network peers id put params +func (o *V1NetworkPeersIDPutParams) WithBody(body *models.NetworkPeerUpdate) *V1NetworkPeersIDPutParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the v1 network peers id put params +func (o *V1NetworkPeersIDPutParams) SetBody(body *models.NetworkPeerUpdate) { + o.Body = body +} + +// WithNetworkPeerID adds the networkPeerID to the v1 network peers id put params +func (o *V1NetworkPeersIDPutParams) WithNetworkPeerID(networkPeerID string) *V1NetworkPeersIDPutParams { + o.SetNetworkPeerID(networkPeerID) + return o +} + +// SetNetworkPeerID adds the networkPeerId to the v1 network peers id put params +func (o *V1NetworkPeersIDPutParams) SetNetworkPeerID(networkPeerID string) { + o.NetworkPeerID = networkPeerID +} + +// WriteToRequest writes these params to a swagger request +func (o *V1NetworkPeersIDPutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param network_peer_id + if err := r.SetPathParam("network_peer_id", o.NetworkPeerID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_id_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_id_put_responses.go new file mode 100644 index 00000000000..f0066a9d5cf --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_id_put_responses.go @@ -0,0 +1,563 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package network_peers + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + stderrors "errors" + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// V1NetworkPeersIDPutReader is a Reader for the V1NetworkPeersIDPut structure. +type V1NetworkPeersIDPutReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *V1NetworkPeersIDPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { + switch response.Code() { + case 200: + result := NewV1NetworkPeersIDPutOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewV1NetworkPeersIDPutBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewV1NetworkPeersIDPutUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewV1NetworkPeersIDPutForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewV1NetworkPeersIDPutNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewV1NetworkPeersIDPutConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewV1NetworkPeersIDPutInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[PUT /v1/network-peers/{network_peer_id}] v1.networkPeers.id.put", response, response.Code()) + } +} + +// NewV1NetworkPeersIDPutOK creates a V1NetworkPeersIDPutOK with default headers values +func NewV1NetworkPeersIDPutOK() *V1NetworkPeersIDPutOK { + return &V1NetworkPeersIDPutOK{} +} + +/* +V1NetworkPeersIDPutOK describes a response with status code 200, with default header values. + +OK +*/ +type V1NetworkPeersIDPutOK struct { + Payload *models.NetworkPeer +} + +// IsSuccess returns true when this v1 network peers Id put o k response has a 2xx status code +func (o *V1NetworkPeersIDPutOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this v1 network peers Id put o k response has a 3xx status code +func (o *V1NetworkPeersIDPutOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers Id put o k response has a 4xx status code +func (o *V1NetworkPeersIDPutOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this v1 network peers Id put o k response has a 5xx status code +func (o *V1NetworkPeersIDPutOK) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers Id put o k response a status code equal to that given +func (o *V1NetworkPeersIDPutOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the v1 network peers Id put o k response +func (o *V1NetworkPeersIDPutOK) Code() int { + return 200 +} + +func (o *V1NetworkPeersIDPutOK) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdPutOK %s", 200, payload) +} + +func (o *V1NetworkPeersIDPutOK) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdPutOK %s", 200, payload) +} + +func (o *V1NetworkPeersIDPutOK) GetPayload() *models.NetworkPeer { + return o.Payload +} + +func (o *V1NetworkPeersIDPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.NetworkPeer) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersIDPutBadRequest creates a V1NetworkPeersIDPutBadRequest with default headers values +func NewV1NetworkPeersIDPutBadRequest() *V1NetworkPeersIDPutBadRequest { + return &V1NetworkPeersIDPutBadRequest{} +} + +/* +V1NetworkPeersIDPutBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type V1NetworkPeersIDPutBadRequest struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers Id put bad request response has a 2xx status code +func (o *V1NetworkPeersIDPutBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers Id put bad request response has a 3xx status code +func (o *V1NetworkPeersIDPutBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers Id put bad request response has a 4xx status code +func (o *V1NetworkPeersIDPutBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers Id put bad request response has a 5xx status code +func (o *V1NetworkPeersIDPutBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers Id put bad request response a status code equal to that given +func (o *V1NetworkPeersIDPutBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the v1 network peers Id put bad request response +func (o *V1NetworkPeersIDPutBadRequest) Code() int { + return 400 +} + +func (o *V1NetworkPeersIDPutBadRequest) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdPutBadRequest %s", 400, payload) +} + +func (o *V1NetworkPeersIDPutBadRequest) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdPutBadRequest %s", 400, payload) +} + +func (o *V1NetworkPeersIDPutBadRequest) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersIDPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersIDPutUnauthorized creates a V1NetworkPeersIDPutUnauthorized with default headers values +func NewV1NetworkPeersIDPutUnauthorized() *V1NetworkPeersIDPutUnauthorized { + return &V1NetworkPeersIDPutUnauthorized{} +} + +/* +V1NetworkPeersIDPutUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type V1NetworkPeersIDPutUnauthorized struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers Id put unauthorized response has a 2xx status code +func (o *V1NetworkPeersIDPutUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers Id put unauthorized response has a 3xx status code +func (o *V1NetworkPeersIDPutUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers Id put unauthorized response has a 4xx status code +func (o *V1NetworkPeersIDPutUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers Id put unauthorized response has a 5xx status code +func (o *V1NetworkPeersIDPutUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers Id put unauthorized response a status code equal to that given +func (o *V1NetworkPeersIDPutUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the v1 network peers Id put unauthorized response +func (o *V1NetworkPeersIDPutUnauthorized) Code() int { + return 401 +} + +func (o *V1NetworkPeersIDPutUnauthorized) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdPutUnauthorized %s", 401, payload) +} + +func (o *V1NetworkPeersIDPutUnauthorized) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdPutUnauthorized %s", 401, payload) +} + +func (o *V1NetworkPeersIDPutUnauthorized) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersIDPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersIDPutForbidden creates a V1NetworkPeersIDPutForbidden with default headers values +func NewV1NetworkPeersIDPutForbidden() *V1NetworkPeersIDPutForbidden { + return &V1NetworkPeersIDPutForbidden{} +} + +/* +V1NetworkPeersIDPutForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type V1NetworkPeersIDPutForbidden struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers Id put forbidden response has a 2xx status code +func (o *V1NetworkPeersIDPutForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers Id put forbidden response has a 3xx status code +func (o *V1NetworkPeersIDPutForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers Id put forbidden response has a 4xx status code +func (o *V1NetworkPeersIDPutForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers Id put forbidden response has a 5xx status code +func (o *V1NetworkPeersIDPutForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers Id put forbidden response a status code equal to that given +func (o *V1NetworkPeersIDPutForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the v1 network peers Id put forbidden response +func (o *V1NetworkPeersIDPutForbidden) Code() int { + return 403 +} + +func (o *V1NetworkPeersIDPutForbidden) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdPutForbidden %s", 403, payload) +} + +func (o *V1NetworkPeersIDPutForbidden) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdPutForbidden %s", 403, payload) +} + +func (o *V1NetworkPeersIDPutForbidden) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersIDPutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersIDPutNotFound creates a V1NetworkPeersIDPutNotFound with default headers values +func NewV1NetworkPeersIDPutNotFound() *V1NetworkPeersIDPutNotFound { + return &V1NetworkPeersIDPutNotFound{} +} + +/* +V1NetworkPeersIDPutNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type V1NetworkPeersIDPutNotFound struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers Id put not found response has a 2xx status code +func (o *V1NetworkPeersIDPutNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers Id put not found response has a 3xx status code +func (o *V1NetworkPeersIDPutNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers Id put not found response has a 4xx status code +func (o *V1NetworkPeersIDPutNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers Id put not found response has a 5xx status code +func (o *V1NetworkPeersIDPutNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers Id put not found response a status code equal to that given +func (o *V1NetworkPeersIDPutNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the v1 network peers Id put not found response +func (o *V1NetworkPeersIDPutNotFound) Code() int { + return 404 +} + +func (o *V1NetworkPeersIDPutNotFound) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdPutNotFound %s", 404, payload) +} + +func (o *V1NetworkPeersIDPutNotFound) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdPutNotFound %s", 404, payload) +} + +func (o *V1NetworkPeersIDPutNotFound) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersIDPutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersIDPutConflict creates a V1NetworkPeersIDPutConflict with default headers values +func NewV1NetworkPeersIDPutConflict() *V1NetworkPeersIDPutConflict { + return &V1NetworkPeersIDPutConflict{} +} + +/* +V1NetworkPeersIDPutConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type V1NetworkPeersIDPutConflict struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers Id put conflict response has a 2xx status code +func (o *V1NetworkPeersIDPutConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers Id put conflict response has a 3xx status code +func (o *V1NetworkPeersIDPutConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers Id put conflict response has a 4xx status code +func (o *V1NetworkPeersIDPutConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers Id put conflict response has a 5xx status code +func (o *V1NetworkPeersIDPutConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers Id put conflict response a status code equal to that given +func (o *V1NetworkPeersIDPutConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the v1 network peers Id put conflict response +func (o *V1NetworkPeersIDPutConflict) Code() int { + return 409 +} + +func (o *V1NetworkPeersIDPutConflict) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdPutConflict %s", 409, payload) +} + +func (o *V1NetworkPeersIDPutConflict) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdPutConflict %s", 409, payload) +} + +func (o *V1NetworkPeersIDPutConflict) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersIDPutConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersIDPutInternalServerError creates a V1NetworkPeersIDPutInternalServerError with default headers values +func NewV1NetworkPeersIDPutInternalServerError() *V1NetworkPeersIDPutInternalServerError { + return &V1NetworkPeersIDPutInternalServerError{} +} + +/* +V1NetworkPeersIDPutInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type V1NetworkPeersIDPutInternalServerError struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers Id put internal server error response has a 2xx status code +func (o *V1NetworkPeersIDPutInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers Id put internal server error response has a 3xx status code +func (o *V1NetworkPeersIDPutInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers Id put internal server error response has a 4xx status code +func (o *V1NetworkPeersIDPutInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this v1 network peers Id put internal server error response has a 5xx status code +func (o *V1NetworkPeersIDPutInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this v1 network peers Id put internal server error response a status code equal to that given +func (o *V1NetworkPeersIDPutInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the v1 network peers Id put internal server error response +func (o *V1NetworkPeersIDPutInternalServerError) Code() int { + return 500 +} + +func (o *V1NetworkPeersIDPutInternalServerError) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdPutInternalServerError %s", 500, payload) +} + +func (o *V1NetworkPeersIDPutInternalServerError) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /v1/network-peers/{network_peer_id}][%d] v1NetworkPeersIdPutInternalServerError %s", 500, payload) +} + +func (o *V1NetworkPeersIDPutInternalServerError) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersIDPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_interfaces_getall_parameters.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_interfaces_getall_parameters.go new file mode 100644 index 00000000000..8b052c10aa3 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_interfaces_getall_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package network_peers + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewV1NetworkPeersInterfacesGetallParams creates a new V1NetworkPeersInterfacesGetallParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewV1NetworkPeersInterfacesGetallParams() *V1NetworkPeersInterfacesGetallParams { + return &V1NetworkPeersInterfacesGetallParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewV1NetworkPeersInterfacesGetallParamsWithTimeout creates a new V1NetworkPeersInterfacesGetallParams object +// with the ability to set a timeout on a request. +func NewV1NetworkPeersInterfacesGetallParamsWithTimeout(timeout time.Duration) *V1NetworkPeersInterfacesGetallParams { + return &V1NetworkPeersInterfacesGetallParams{ + timeout: timeout, + } +} + +// NewV1NetworkPeersInterfacesGetallParamsWithContext creates a new V1NetworkPeersInterfacesGetallParams object +// with the ability to set a context for a request. +func NewV1NetworkPeersInterfacesGetallParamsWithContext(ctx context.Context) *V1NetworkPeersInterfacesGetallParams { + return &V1NetworkPeersInterfacesGetallParams{ + Context: ctx, + } +} + +// NewV1NetworkPeersInterfacesGetallParamsWithHTTPClient creates a new V1NetworkPeersInterfacesGetallParams object +// with the ability to set a custom HTTPClient for a request. +func NewV1NetworkPeersInterfacesGetallParamsWithHTTPClient(client *http.Client) *V1NetworkPeersInterfacesGetallParams { + return &V1NetworkPeersInterfacesGetallParams{ + HTTPClient: client, + } +} + +/* +V1NetworkPeersInterfacesGetallParams contains all the parameters to send to the API endpoint + + for the v1 network peers interfaces getall operation. + + Typically these are written to a http.Request. +*/ +type V1NetworkPeersInterfacesGetallParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the v1 network peers interfaces getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *V1NetworkPeersInterfacesGetallParams) WithDefaults() *V1NetworkPeersInterfacesGetallParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the v1 network peers interfaces getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *V1NetworkPeersInterfacesGetallParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the v1 network peers interfaces getall params +func (o *V1NetworkPeersInterfacesGetallParams) WithTimeout(timeout time.Duration) *V1NetworkPeersInterfacesGetallParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the v1 network peers interfaces getall params +func (o *V1NetworkPeersInterfacesGetallParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the v1 network peers interfaces getall params +func (o *V1NetworkPeersInterfacesGetallParams) WithContext(ctx context.Context) *V1NetworkPeersInterfacesGetallParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the v1 network peers interfaces getall params +func (o *V1NetworkPeersInterfacesGetallParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the v1 network peers interfaces getall params +func (o *V1NetworkPeersInterfacesGetallParams) WithHTTPClient(client *http.Client) *V1NetworkPeersInterfacesGetallParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the v1 network peers interfaces getall params +func (o *V1NetworkPeersInterfacesGetallParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *V1NetworkPeersInterfacesGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_interfaces_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_interfaces_getall_responses.go new file mode 100644 index 00000000000..7b2a0f4b278 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_interfaces_getall_responses.go @@ -0,0 +1,561 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package network_peers + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + stderrors "errors" + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// V1NetworkPeersInterfacesGetallReader is a Reader for the V1NetworkPeersInterfacesGetall structure. +type V1NetworkPeersInterfacesGetallReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *V1NetworkPeersInterfacesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { + switch response.Code() { + case 200: + result := NewV1NetworkPeersInterfacesGetallOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewV1NetworkPeersInterfacesGetallBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewV1NetworkPeersInterfacesGetallUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewV1NetworkPeersInterfacesGetallForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewV1NetworkPeersInterfacesGetallNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewV1NetworkPeersInterfacesGetallConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewV1NetworkPeersInterfacesGetallInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /v1/network-peers/interfaces] v1.networkPeers.interfaces.getall", response, response.Code()) + } +} + +// NewV1NetworkPeersInterfacesGetallOK creates a V1NetworkPeersInterfacesGetallOK with default headers values +func NewV1NetworkPeersInterfacesGetallOK() *V1NetworkPeersInterfacesGetallOK { + return &V1NetworkPeersInterfacesGetallOK{} +} + +/* +V1NetworkPeersInterfacesGetallOK describes a response with status code 200, with default header values. + +OK +*/ +type V1NetworkPeersInterfacesGetallOK struct { + Payload models.PeerInterfaces +} + +// IsSuccess returns true when this v1 network peers interfaces getall o k response has a 2xx status code +func (o *V1NetworkPeersInterfacesGetallOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this v1 network peers interfaces getall o k response has a 3xx status code +func (o *V1NetworkPeersInterfacesGetallOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers interfaces getall o k response has a 4xx status code +func (o *V1NetworkPeersInterfacesGetallOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this v1 network peers interfaces getall o k response has a 5xx status code +func (o *V1NetworkPeersInterfacesGetallOK) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers interfaces getall o k response a status code equal to that given +func (o *V1NetworkPeersInterfacesGetallOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the v1 network peers interfaces getall o k response +func (o *V1NetworkPeersInterfacesGetallOK) Code() int { + return 200 +} + +func (o *V1NetworkPeersInterfacesGetallOK) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/interfaces][%d] v1NetworkPeersInterfacesGetallOK %s", 200, payload) +} + +func (o *V1NetworkPeersInterfacesGetallOK) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/interfaces][%d] v1NetworkPeersInterfacesGetallOK %s", 200, payload) +} + +func (o *V1NetworkPeersInterfacesGetallOK) GetPayload() models.PeerInterfaces { + return o.Payload +} + +func (o *V1NetworkPeersInterfacesGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersInterfacesGetallBadRequest creates a V1NetworkPeersInterfacesGetallBadRequest with default headers values +func NewV1NetworkPeersInterfacesGetallBadRequest() *V1NetworkPeersInterfacesGetallBadRequest { + return &V1NetworkPeersInterfacesGetallBadRequest{} +} + +/* +V1NetworkPeersInterfacesGetallBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type V1NetworkPeersInterfacesGetallBadRequest struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers interfaces getall bad request response has a 2xx status code +func (o *V1NetworkPeersInterfacesGetallBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers interfaces getall bad request response has a 3xx status code +func (o *V1NetworkPeersInterfacesGetallBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers interfaces getall bad request response has a 4xx status code +func (o *V1NetworkPeersInterfacesGetallBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers interfaces getall bad request response has a 5xx status code +func (o *V1NetworkPeersInterfacesGetallBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers interfaces getall bad request response a status code equal to that given +func (o *V1NetworkPeersInterfacesGetallBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the v1 network peers interfaces getall bad request response +func (o *V1NetworkPeersInterfacesGetallBadRequest) Code() int { + return 400 +} + +func (o *V1NetworkPeersInterfacesGetallBadRequest) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/interfaces][%d] v1NetworkPeersInterfacesGetallBadRequest %s", 400, payload) +} + +func (o *V1NetworkPeersInterfacesGetallBadRequest) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/interfaces][%d] v1NetworkPeersInterfacesGetallBadRequest %s", 400, payload) +} + +func (o *V1NetworkPeersInterfacesGetallBadRequest) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersInterfacesGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersInterfacesGetallUnauthorized creates a V1NetworkPeersInterfacesGetallUnauthorized with default headers values +func NewV1NetworkPeersInterfacesGetallUnauthorized() *V1NetworkPeersInterfacesGetallUnauthorized { + return &V1NetworkPeersInterfacesGetallUnauthorized{} +} + +/* +V1NetworkPeersInterfacesGetallUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type V1NetworkPeersInterfacesGetallUnauthorized struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers interfaces getall unauthorized response has a 2xx status code +func (o *V1NetworkPeersInterfacesGetallUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers interfaces getall unauthorized response has a 3xx status code +func (o *V1NetworkPeersInterfacesGetallUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers interfaces getall unauthorized response has a 4xx status code +func (o *V1NetworkPeersInterfacesGetallUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers interfaces getall unauthorized response has a 5xx status code +func (o *V1NetworkPeersInterfacesGetallUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers interfaces getall unauthorized response a status code equal to that given +func (o *V1NetworkPeersInterfacesGetallUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the v1 network peers interfaces getall unauthorized response +func (o *V1NetworkPeersInterfacesGetallUnauthorized) Code() int { + return 401 +} + +func (o *V1NetworkPeersInterfacesGetallUnauthorized) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/interfaces][%d] v1NetworkPeersInterfacesGetallUnauthorized %s", 401, payload) +} + +func (o *V1NetworkPeersInterfacesGetallUnauthorized) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/interfaces][%d] v1NetworkPeersInterfacesGetallUnauthorized %s", 401, payload) +} + +func (o *V1NetworkPeersInterfacesGetallUnauthorized) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersInterfacesGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersInterfacesGetallForbidden creates a V1NetworkPeersInterfacesGetallForbidden with default headers values +func NewV1NetworkPeersInterfacesGetallForbidden() *V1NetworkPeersInterfacesGetallForbidden { + return &V1NetworkPeersInterfacesGetallForbidden{} +} + +/* +V1NetworkPeersInterfacesGetallForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type V1NetworkPeersInterfacesGetallForbidden struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers interfaces getall forbidden response has a 2xx status code +func (o *V1NetworkPeersInterfacesGetallForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers interfaces getall forbidden response has a 3xx status code +func (o *V1NetworkPeersInterfacesGetallForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers interfaces getall forbidden response has a 4xx status code +func (o *V1NetworkPeersInterfacesGetallForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers interfaces getall forbidden response has a 5xx status code +func (o *V1NetworkPeersInterfacesGetallForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers interfaces getall forbidden response a status code equal to that given +func (o *V1NetworkPeersInterfacesGetallForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the v1 network peers interfaces getall forbidden response +func (o *V1NetworkPeersInterfacesGetallForbidden) Code() int { + return 403 +} + +func (o *V1NetworkPeersInterfacesGetallForbidden) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/interfaces][%d] v1NetworkPeersInterfacesGetallForbidden %s", 403, payload) +} + +func (o *V1NetworkPeersInterfacesGetallForbidden) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/interfaces][%d] v1NetworkPeersInterfacesGetallForbidden %s", 403, payload) +} + +func (o *V1NetworkPeersInterfacesGetallForbidden) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersInterfacesGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersInterfacesGetallNotFound creates a V1NetworkPeersInterfacesGetallNotFound with default headers values +func NewV1NetworkPeersInterfacesGetallNotFound() *V1NetworkPeersInterfacesGetallNotFound { + return &V1NetworkPeersInterfacesGetallNotFound{} +} + +/* +V1NetworkPeersInterfacesGetallNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type V1NetworkPeersInterfacesGetallNotFound struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers interfaces getall not found response has a 2xx status code +func (o *V1NetworkPeersInterfacesGetallNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers interfaces getall not found response has a 3xx status code +func (o *V1NetworkPeersInterfacesGetallNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers interfaces getall not found response has a 4xx status code +func (o *V1NetworkPeersInterfacesGetallNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers interfaces getall not found response has a 5xx status code +func (o *V1NetworkPeersInterfacesGetallNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers interfaces getall not found response a status code equal to that given +func (o *V1NetworkPeersInterfacesGetallNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the v1 network peers interfaces getall not found response +func (o *V1NetworkPeersInterfacesGetallNotFound) Code() int { + return 404 +} + +func (o *V1NetworkPeersInterfacesGetallNotFound) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/interfaces][%d] v1NetworkPeersInterfacesGetallNotFound %s", 404, payload) +} + +func (o *V1NetworkPeersInterfacesGetallNotFound) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/interfaces][%d] v1NetworkPeersInterfacesGetallNotFound %s", 404, payload) +} + +func (o *V1NetworkPeersInterfacesGetallNotFound) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersInterfacesGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersInterfacesGetallConflict creates a V1NetworkPeersInterfacesGetallConflict with default headers values +func NewV1NetworkPeersInterfacesGetallConflict() *V1NetworkPeersInterfacesGetallConflict { + return &V1NetworkPeersInterfacesGetallConflict{} +} + +/* +V1NetworkPeersInterfacesGetallConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type V1NetworkPeersInterfacesGetallConflict struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers interfaces getall conflict response has a 2xx status code +func (o *V1NetworkPeersInterfacesGetallConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers interfaces getall conflict response has a 3xx status code +func (o *V1NetworkPeersInterfacesGetallConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers interfaces getall conflict response has a 4xx status code +func (o *V1NetworkPeersInterfacesGetallConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers interfaces getall conflict response has a 5xx status code +func (o *V1NetworkPeersInterfacesGetallConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers interfaces getall conflict response a status code equal to that given +func (o *V1NetworkPeersInterfacesGetallConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the v1 network peers interfaces getall conflict response +func (o *V1NetworkPeersInterfacesGetallConflict) Code() int { + return 409 +} + +func (o *V1NetworkPeersInterfacesGetallConflict) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/interfaces][%d] v1NetworkPeersInterfacesGetallConflict %s", 409, payload) +} + +func (o *V1NetworkPeersInterfacesGetallConflict) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/interfaces][%d] v1NetworkPeersInterfacesGetallConflict %s", 409, payload) +} + +func (o *V1NetworkPeersInterfacesGetallConflict) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersInterfacesGetallConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersInterfacesGetallInternalServerError creates a V1NetworkPeersInterfacesGetallInternalServerError with default headers values +func NewV1NetworkPeersInterfacesGetallInternalServerError() *V1NetworkPeersInterfacesGetallInternalServerError { + return &V1NetworkPeersInterfacesGetallInternalServerError{} +} + +/* +V1NetworkPeersInterfacesGetallInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type V1NetworkPeersInterfacesGetallInternalServerError struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers interfaces getall internal server error response has a 2xx status code +func (o *V1NetworkPeersInterfacesGetallInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers interfaces getall internal server error response has a 3xx status code +func (o *V1NetworkPeersInterfacesGetallInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers interfaces getall internal server error response has a 4xx status code +func (o *V1NetworkPeersInterfacesGetallInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this v1 network peers interfaces getall internal server error response has a 5xx status code +func (o *V1NetworkPeersInterfacesGetallInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this v1 network peers interfaces getall internal server error response a status code equal to that given +func (o *V1NetworkPeersInterfacesGetallInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the v1 network peers interfaces getall internal server error response +func (o *V1NetworkPeersInterfacesGetallInternalServerError) Code() int { + return 500 +} + +func (o *V1NetworkPeersInterfacesGetallInternalServerError) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/interfaces][%d] v1NetworkPeersInterfacesGetallInternalServerError %s", 500, payload) +} + +func (o *V1NetworkPeersInterfacesGetallInternalServerError) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/interfaces][%d] v1NetworkPeersInterfacesGetallInternalServerError %s", 500, payload) +} + +func (o *V1NetworkPeersInterfacesGetallInternalServerError) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersInterfacesGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_list_parameters.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_list_parameters.go deleted file mode 100644 index d1f16af6211..00000000000 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_list_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package network_peers - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewV1NetworkPeersListParams creates a new V1NetworkPeersListParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1NetworkPeersListParams() *V1NetworkPeersListParams { - return &V1NetworkPeersListParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1NetworkPeersListParamsWithTimeout creates a new V1NetworkPeersListParams object -// with the ability to set a timeout on a request. -func NewV1NetworkPeersListParamsWithTimeout(timeout time.Duration) *V1NetworkPeersListParams { - return &V1NetworkPeersListParams{ - timeout: timeout, - } -} - -// NewV1NetworkPeersListParamsWithContext creates a new V1NetworkPeersListParams object -// with the ability to set a context for a request. -func NewV1NetworkPeersListParamsWithContext(ctx context.Context) *V1NetworkPeersListParams { - return &V1NetworkPeersListParams{ - Context: ctx, - } -} - -// NewV1NetworkPeersListParamsWithHTTPClient creates a new V1NetworkPeersListParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1NetworkPeersListParamsWithHTTPClient(client *http.Client) *V1NetworkPeersListParams { - return &V1NetworkPeersListParams{ - HTTPClient: client, - } -} - -/* -V1NetworkPeersListParams contains all the parameters to send to the API endpoint - - for the v1 network peers list operation. - - Typically these are written to a http.Request. -*/ -type V1NetworkPeersListParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 network peers list params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworkPeersListParams) WithDefaults() *V1NetworkPeersListParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 network peers list params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1NetworkPeersListParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 network peers list params -func (o *V1NetworkPeersListParams) WithTimeout(timeout time.Duration) *V1NetworkPeersListParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 network peers list params -func (o *V1NetworkPeersListParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 network peers list params -func (o *V1NetworkPeersListParams) WithContext(ctx context.Context) *V1NetworkPeersListParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 network peers list params -func (o *V1NetworkPeersListParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 network peers list params -func (o *V1NetworkPeersListParams) WithHTTPClient(client *http.Client) *V1NetworkPeersListParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 network peers list params -func (o *V1NetworkPeersListParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *V1NetworkPeersListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_list_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_list_responses.go deleted file mode 100644 index 63349c87769..00000000000 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_list_responses.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package network_peers - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1NetworkPeersListReader is a Reader for the V1NetworkPeersList structure. -type V1NetworkPeersListReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1NetworkPeersListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1NetworkPeersListOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1NetworkPeersListBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1NetworkPeersListUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1NetworkPeersListForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewV1NetworkPeersListNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1NetworkPeersListInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /v1/network-peers] v1.networkPeers.list", response, response.Code()) - } -} - -// NewV1NetworkPeersListOK creates a V1NetworkPeersListOK with default headers values -func NewV1NetworkPeersListOK() *V1NetworkPeersListOK { - return &V1NetworkPeersListOK{} -} - -/* -V1NetworkPeersListOK describes a response with status code 200, with default header values. - -OK -*/ -type V1NetworkPeersListOK struct { - Payload *models.NetworkPeers -} - -// IsSuccess returns true when this v1 network peers list o k response has a 2xx status code -func (o *V1NetworkPeersListOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 network peers list o k response has a 3xx status code -func (o *V1NetworkPeersListOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network peers list o k response has a 4xx status code -func (o *V1NetworkPeersListOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network peers list o k response has a 5xx status code -func (o *V1NetworkPeersListOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network peers list o k response a status code equal to that given -func (o *V1NetworkPeersListOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 network peers list o k response -func (o *V1NetworkPeersListOK) Code() int { - return 200 -} - -func (o *V1NetworkPeersListOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-peers][%d] v1NetworkPeersListOK %s", 200, payload) -} - -func (o *V1NetworkPeersListOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-peers][%d] v1NetworkPeersListOK %s", 200, payload) -} - -func (o *V1NetworkPeersListOK) GetPayload() *models.NetworkPeers { - return o.Payload -} - -func (o *V1NetworkPeersListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.NetworkPeers) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkPeersListBadRequest creates a V1NetworkPeersListBadRequest with default headers values -func NewV1NetworkPeersListBadRequest() *V1NetworkPeersListBadRequest { - return &V1NetworkPeersListBadRequest{} -} - -/* -V1NetworkPeersListBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1NetworkPeersListBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network peers list bad request response has a 2xx status code -func (o *V1NetworkPeersListBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network peers list bad request response has a 3xx status code -func (o *V1NetworkPeersListBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network peers list bad request response has a 4xx status code -func (o *V1NetworkPeersListBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network peers list bad request response has a 5xx status code -func (o *V1NetworkPeersListBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network peers list bad request response a status code equal to that given -func (o *V1NetworkPeersListBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 network peers list bad request response -func (o *V1NetworkPeersListBadRequest) Code() int { - return 400 -} - -func (o *V1NetworkPeersListBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-peers][%d] v1NetworkPeersListBadRequest %s", 400, payload) -} - -func (o *V1NetworkPeersListBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-peers][%d] v1NetworkPeersListBadRequest %s", 400, payload) -} - -func (o *V1NetworkPeersListBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkPeersListBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkPeersListUnauthorized creates a V1NetworkPeersListUnauthorized with default headers values -func NewV1NetworkPeersListUnauthorized() *V1NetworkPeersListUnauthorized { - return &V1NetworkPeersListUnauthorized{} -} - -/* -V1NetworkPeersListUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1NetworkPeersListUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network peers list unauthorized response has a 2xx status code -func (o *V1NetworkPeersListUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network peers list unauthorized response has a 3xx status code -func (o *V1NetworkPeersListUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network peers list unauthorized response has a 4xx status code -func (o *V1NetworkPeersListUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network peers list unauthorized response has a 5xx status code -func (o *V1NetworkPeersListUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network peers list unauthorized response a status code equal to that given -func (o *V1NetworkPeersListUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 network peers list unauthorized response -func (o *V1NetworkPeersListUnauthorized) Code() int { - return 401 -} - -func (o *V1NetworkPeersListUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-peers][%d] v1NetworkPeersListUnauthorized %s", 401, payload) -} - -func (o *V1NetworkPeersListUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-peers][%d] v1NetworkPeersListUnauthorized %s", 401, payload) -} - -func (o *V1NetworkPeersListUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkPeersListUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkPeersListForbidden creates a V1NetworkPeersListForbidden with default headers values -func NewV1NetworkPeersListForbidden() *V1NetworkPeersListForbidden { - return &V1NetworkPeersListForbidden{} -} - -/* -V1NetworkPeersListForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1NetworkPeersListForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network peers list forbidden response has a 2xx status code -func (o *V1NetworkPeersListForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network peers list forbidden response has a 3xx status code -func (o *V1NetworkPeersListForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network peers list forbidden response has a 4xx status code -func (o *V1NetworkPeersListForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network peers list forbidden response has a 5xx status code -func (o *V1NetworkPeersListForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network peers list forbidden response a status code equal to that given -func (o *V1NetworkPeersListForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 network peers list forbidden response -func (o *V1NetworkPeersListForbidden) Code() int { - return 403 -} - -func (o *V1NetworkPeersListForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-peers][%d] v1NetworkPeersListForbidden %s", 403, payload) -} - -func (o *V1NetworkPeersListForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-peers][%d] v1NetworkPeersListForbidden %s", 403, payload) -} - -func (o *V1NetworkPeersListForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkPeersListForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkPeersListNotFound creates a V1NetworkPeersListNotFound with default headers values -func NewV1NetworkPeersListNotFound() *V1NetworkPeersListNotFound { - return &V1NetworkPeersListNotFound{} -} - -/* -V1NetworkPeersListNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type V1NetworkPeersListNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network peers list not found response has a 2xx status code -func (o *V1NetworkPeersListNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network peers list not found response has a 3xx status code -func (o *V1NetworkPeersListNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network peers list not found response has a 4xx status code -func (o *V1NetworkPeersListNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 network peers list not found response has a 5xx status code -func (o *V1NetworkPeersListNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 network peers list not found response a status code equal to that given -func (o *V1NetworkPeersListNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the v1 network peers list not found response -func (o *V1NetworkPeersListNotFound) Code() int { - return 404 -} - -func (o *V1NetworkPeersListNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-peers][%d] v1NetworkPeersListNotFound %s", 404, payload) -} - -func (o *V1NetworkPeersListNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-peers][%d] v1NetworkPeersListNotFound %s", 404, payload) -} - -func (o *V1NetworkPeersListNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkPeersListNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1NetworkPeersListInternalServerError creates a V1NetworkPeersListInternalServerError with default headers values -func NewV1NetworkPeersListInternalServerError() *V1NetworkPeersListInternalServerError { - return &V1NetworkPeersListInternalServerError{} -} - -/* -V1NetworkPeersListInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1NetworkPeersListInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 network peers list internal server error response has a 2xx status code -func (o *V1NetworkPeersListInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 network peers list internal server error response has a 3xx status code -func (o *V1NetworkPeersListInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 network peers list internal server error response has a 4xx status code -func (o *V1NetworkPeersListInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 network peers list internal server error response has a 5xx status code -func (o *V1NetworkPeersListInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 network peers list internal server error response a status code equal to that given -func (o *V1NetworkPeersListInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 network peers list internal server error response -func (o *V1NetworkPeersListInternalServerError) Code() int { - return 500 -} - -func (o *V1NetworkPeersListInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-peers][%d] v1NetworkPeersListInternalServerError %s", 500, payload) -} - -func (o *V1NetworkPeersListInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /v1/network-peers][%d] v1NetworkPeersListInternalServerError %s", 500, payload) -} - -func (o *V1NetworkPeersListInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1NetworkPeersListInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_post_parameters.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_post_parameters.go new file mode 100644 index 00000000000..62591716baa --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_post_parameters.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package network_peers + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// NewV1NetworkPeersPostParams creates a new V1NetworkPeersPostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewV1NetworkPeersPostParams() *V1NetworkPeersPostParams { + return &V1NetworkPeersPostParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewV1NetworkPeersPostParamsWithTimeout creates a new V1NetworkPeersPostParams object +// with the ability to set a timeout on a request. +func NewV1NetworkPeersPostParamsWithTimeout(timeout time.Duration) *V1NetworkPeersPostParams { + return &V1NetworkPeersPostParams{ + timeout: timeout, + } +} + +// NewV1NetworkPeersPostParamsWithContext creates a new V1NetworkPeersPostParams object +// with the ability to set a context for a request. +func NewV1NetworkPeersPostParamsWithContext(ctx context.Context) *V1NetworkPeersPostParams { + return &V1NetworkPeersPostParams{ + Context: ctx, + } +} + +// NewV1NetworkPeersPostParamsWithHTTPClient creates a new V1NetworkPeersPostParams object +// with the ability to set a custom HTTPClient for a request. +func NewV1NetworkPeersPostParamsWithHTTPClient(client *http.Client) *V1NetworkPeersPostParams { + return &V1NetworkPeersPostParams{ + HTTPClient: client, + } +} + +/* +V1NetworkPeersPostParams contains all the parameters to send to the API endpoint + + for the v1 network peers post operation. + + Typically these are written to a http.Request. +*/ +type V1NetworkPeersPostParams struct { + + /* Body. + + network peer create parameters + */ + Body *models.NetworkPeerCreate + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the v1 network peers post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *V1NetworkPeersPostParams) WithDefaults() *V1NetworkPeersPostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the v1 network peers post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *V1NetworkPeersPostParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the v1 network peers post params +func (o *V1NetworkPeersPostParams) WithTimeout(timeout time.Duration) *V1NetworkPeersPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the v1 network peers post params +func (o *V1NetworkPeersPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the v1 network peers post params +func (o *V1NetworkPeersPostParams) WithContext(ctx context.Context) *V1NetworkPeersPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the v1 network peers post params +func (o *V1NetworkPeersPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the v1 network peers post params +func (o *V1NetworkPeersPostParams) WithHTTPClient(client *http.Client) *V1NetworkPeersPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the v1 network peers post params +func (o *V1NetworkPeersPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the v1 network peers post params +func (o *V1NetworkPeersPostParams) WithBody(body *models.NetworkPeerCreate) *V1NetworkPeersPostParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the v1 network peers post params +func (o *V1NetworkPeersPostParams) SetBody(body *models.NetworkPeerCreate) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *V1NetworkPeersPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_post_responses.go new file mode 100644 index 00000000000..4e4d6a576a1 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_post_responses.go @@ -0,0 +1,563 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package network_peers + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + stderrors "errors" + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// V1NetworkPeersPostReader is a Reader for the V1NetworkPeersPost structure. +type V1NetworkPeersPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *V1NetworkPeersPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { + switch response.Code() { + case 200: + result := NewV1NetworkPeersPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewV1NetworkPeersPostBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewV1NetworkPeersPostUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewV1NetworkPeersPostForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewV1NetworkPeersPostNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewV1NetworkPeersPostConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewV1NetworkPeersPostInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /v1/network-peers] v1.networkPeers.post", response, response.Code()) + } +} + +// NewV1NetworkPeersPostOK creates a V1NetworkPeersPostOK with default headers values +func NewV1NetworkPeersPostOK() *V1NetworkPeersPostOK { + return &V1NetworkPeersPostOK{} +} + +/* +V1NetworkPeersPostOK describes a response with status code 200, with default header values. + +OK +*/ +type V1NetworkPeersPostOK struct { + Payload *models.NetworkPeer +} + +// IsSuccess returns true when this v1 network peers post o k response has a 2xx status code +func (o *V1NetworkPeersPostOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this v1 network peers post o k response has a 3xx status code +func (o *V1NetworkPeersPostOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers post o k response has a 4xx status code +func (o *V1NetworkPeersPostOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this v1 network peers post o k response has a 5xx status code +func (o *V1NetworkPeersPostOK) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers post o k response a status code equal to that given +func (o *V1NetworkPeersPostOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the v1 network peers post o k response +func (o *V1NetworkPeersPostOK) Code() int { + return 200 +} + +func (o *V1NetworkPeersPostOK) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/network-peers][%d] v1NetworkPeersPostOK %s", 200, payload) +} + +func (o *V1NetworkPeersPostOK) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/network-peers][%d] v1NetworkPeersPostOK %s", 200, payload) +} + +func (o *V1NetworkPeersPostOK) GetPayload() *models.NetworkPeer { + return o.Payload +} + +func (o *V1NetworkPeersPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.NetworkPeer) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersPostBadRequest creates a V1NetworkPeersPostBadRequest with default headers values +func NewV1NetworkPeersPostBadRequest() *V1NetworkPeersPostBadRequest { + return &V1NetworkPeersPostBadRequest{} +} + +/* +V1NetworkPeersPostBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type V1NetworkPeersPostBadRequest struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers post bad request response has a 2xx status code +func (o *V1NetworkPeersPostBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers post bad request response has a 3xx status code +func (o *V1NetworkPeersPostBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers post bad request response has a 4xx status code +func (o *V1NetworkPeersPostBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers post bad request response has a 5xx status code +func (o *V1NetworkPeersPostBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers post bad request response a status code equal to that given +func (o *V1NetworkPeersPostBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the v1 network peers post bad request response +func (o *V1NetworkPeersPostBadRequest) Code() int { + return 400 +} + +func (o *V1NetworkPeersPostBadRequest) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/network-peers][%d] v1NetworkPeersPostBadRequest %s", 400, payload) +} + +func (o *V1NetworkPeersPostBadRequest) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/network-peers][%d] v1NetworkPeersPostBadRequest %s", 400, payload) +} + +func (o *V1NetworkPeersPostBadRequest) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersPostUnauthorized creates a V1NetworkPeersPostUnauthorized with default headers values +func NewV1NetworkPeersPostUnauthorized() *V1NetworkPeersPostUnauthorized { + return &V1NetworkPeersPostUnauthorized{} +} + +/* +V1NetworkPeersPostUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type V1NetworkPeersPostUnauthorized struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers post unauthorized response has a 2xx status code +func (o *V1NetworkPeersPostUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers post unauthorized response has a 3xx status code +func (o *V1NetworkPeersPostUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers post unauthorized response has a 4xx status code +func (o *V1NetworkPeersPostUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers post unauthorized response has a 5xx status code +func (o *V1NetworkPeersPostUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers post unauthorized response a status code equal to that given +func (o *V1NetworkPeersPostUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the v1 network peers post unauthorized response +func (o *V1NetworkPeersPostUnauthorized) Code() int { + return 401 +} + +func (o *V1NetworkPeersPostUnauthorized) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/network-peers][%d] v1NetworkPeersPostUnauthorized %s", 401, payload) +} + +func (o *V1NetworkPeersPostUnauthorized) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/network-peers][%d] v1NetworkPeersPostUnauthorized %s", 401, payload) +} + +func (o *V1NetworkPeersPostUnauthorized) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersPostForbidden creates a V1NetworkPeersPostForbidden with default headers values +func NewV1NetworkPeersPostForbidden() *V1NetworkPeersPostForbidden { + return &V1NetworkPeersPostForbidden{} +} + +/* +V1NetworkPeersPostForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type V1NetworkPeersPostForbidden struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers post forbidden response has a 2xx status code +func (o *V1NetworkPeersPostForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers post forbidden response has a 3xx status code +func (o *V1NetworkPeersPostForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers post forbidden response has a 4xx status code +func (o *V1NetworkPeersPostForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers post forbidden response has a 5xx status code +func (o *V1NetworkPeersPostForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers post forbidden response a status code equal to that given +func (o *V1NetworkPeersPostForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the v1 network peers post forbidden response +func (o *V1NetworkPeersPostForbidden) Code() int { + return 403 +} + +func (o *V1NetworkPeersPostForbidden) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/network-peers][%d] v1NetworkPeersPostForbidden %s", 403, payload) +} + +func (o *V1NetworkPeersPostForbidden) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/network-peers][%d] v1NetworkPeersPostForbidden %s", 403, payload) +} + +func (o *V1NetworkPeersPostForbidden) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersPostNotFound creates a V1NetworkPeersPostNotFound with default headers values +func NewV1NetworkPeersPostNotFound() *V1NetworkPeersPostNotFound { + return &V1NetworkPeersPostNotFound{} +} + +/* +V1NetworkPeersPostNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type V1NetworkPeersPostNotFound struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers post not found response has a 2xx status code +func (o *V1NetworkPeersPostNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers post not found response has a 3xx status code +func (o *V1NetworkPeersPostNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers post not found response has a 4xx status code +func (o *V1NetworkPeersPostNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers post not found response has a 5xx status code +func (o *V1NetworkPeersPostNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers post not found response a status code equal to that given +func (o *V1NetworkPeersPostNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the v1 network peers post not found response +func (o *V1NetworkPeersPostNotFound) Code() int { + return 404 +} + +func (o *V1NetworkPeersPostNotFound) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/network-peers][%d] v1NetworkPeersPostNotFound %s", 404, payload) +} + +func (o *V1NetworkPeersPostNotFound) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/network-peers][%d] v1NetworkPeersPostNotFound %s", 404, payload) +} + +func (o *V1NetworkPeersPostNotFound) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersPostConflict creates a V1NetworkPeersPostConflict with default headers values +func NewV1NetworkPeersPostConflict() *V1NetworkPeersPostConflict { + return &V1NetworkPeersPostConflict{} +} + +/* +V1NetworkPeersPostConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type V1NetworkPeersPostConflict struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers post conflict response has a 2xx status code +func (o *V1NetworkPeersPostConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers post conflict response has a 3xx status code +func (o *V1NetworkPeersPostConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers post conflict response has a 4xx status code +func (o *V1NetworkPeersPostConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers post conflict response has a 5xx status code +func (o *V1NetworkPeersPostConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers post conflict response a status code equal to that given +func (o *V1NetworkPeersPostConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the v1 network peers post conflict response +func (o *V1NetworkPeersPostConflict) Code() int { + return 409 +} + +func (o *V1NetworkPeersPostConflict) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/network-peers][%d] v1NetworkPeersPostConflict %s", 409, payload) +} + +func (o *V1NetworkPeersPostConflict) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/network-peers][%d] v1NetworkPeersPostConflict %s", 409, payload) +} + +func (o *V1NetworkPeersPostConflict) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersPostInternalServerError creates a V1NetworkPeersPostInternalServerError with default headers values +func NewV1NetworkPeersPostInternalServerError() *V1NetworkPeersPostInternalServerError { + return &V1NetworkPeersPostInternalServerError{} +} + +/* +V1NetworkPeersPostInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type V1NetworkPeersPostInternalServerError struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers post internal server error response has a 2xx status code +func (o *V1NetworkPeersPostInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers post internal server error response has a 3xx status code +func (o *V1NetworkPeersPostInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers post internal server error response has a 4xx status code +func (o *V1NetworkPeersPostInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this v1 network peers post internal server error response has a 5xx status code +func (o *V1NetworkPeersPostInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this v1 network peers post internal server error response a status code equal to that given +func (o *V1NetworkPeersPostInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the v1 network peers post internal server error response +func (o *V1NetworkPeersPostInternalServerError) Code() int { + return 500 +} + +func (o *V1NetworkPeersPostInternalServerError) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/network-peers][%d] v1NetworkPeersPostInternalServerError %s", 500, payload) +} + +func (o *V1NetworkPeersPostInternalServerError) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/network-peers][%d] v1NetworkPeersPostInternalServerError %s", 500, payload) +} + +func (o *V1NetworkPeersPostInternalServerError) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_route_filter_id_delete_parameters.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_route_filter_id_delete_parameters.go new file mode 100644 index 00000000000..91b14d23c6a --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_route_filter_id_delete_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package network_peers + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewV1NetworkPeersRouteFilterIDDeleteParams creates a new V1NetworkPeersRouteFilterIDDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewV1NetworkPeersRouteFilterIDDeleteParams() *V1NetworkPeersRouteFilterIDDeleteParams { + return &V1NetworkPeersRouteFilterIDDeleteParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewV1NetworkPeersRouteFilterIDDeleteParamsWithTimeout creates a new V1NetworkPeersRouteFilterIDDeleteParams object +// with the ability to set a timeout on a request. +func NewV1NetworkPeersRouteFilterIDDeleteParamsWithTimeout(timeout time.Duration) *V1NetworkPeersRouteFilterIDDeleteParams { + return &V1NetworkPeersRouteFilterIDDeleteParams{ + timeout: timeout, + } +} + +// NewV1NetworkPeersRouteFilterIDDeleteParamsWithContext creates a new V1NetworkPeersRouteFilterIDDeleteParams object +// with the ability to set a context for a request. +func NewV1NetworkPeersRouteFilterIDDeleteParamsWithContext(ctx context.Context) *V1NetworkPeersRouteFilterIDDeleteParams { + return &V1NetworkPeersRouteFilterIDDeleteParams{ + Context: ctx, + } +} + +// NewV1NetworkPeersRouteFilterIDDeleteParamsWithHTTPClient creates a new V1NetworkPeersRouteFilterIDDeleteParams object +// with the ability to set a custom HTTPClient for a request. +func NewV1NetworkPeersRouteFilterIDDeleteParamsWithHTTPClient(client *http.Client) *V1NetworkPeersRouteFilterIDDeleteParams { + return &V1NetworkPeersRouteFilterIDDeleteParams{ + HTTPClient: client, + } +} + +/* +V1NetworkPeersRouteFilterIDDeleteParams contains all the parameters to send to the API endpoint + + for the v1 network peers route filter id delete operation. + + Typically these are written to a http.Request. +*/ +type V1NetworkPeersRouteFilterIDDeleteParams struct { + + /* NetworkPeerID. + + network peer ID + */ + NetworkPeerID string + + /* RouteFilterID. + + route filter ID + */ + RouteFilterID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the v1 network peers route filter id delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *V1NetworkPeersRouteFilterIDDeleteParams) WithDefaults() *V1NetworkPeersRouteFilterIDDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the v1 network peers route filter id delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *V1NetworkPeersRouteFilterIDDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the v1 network peers route filter id delete params +func (o *V1NetworkPeersRouteFilterIDDeleteParams) WithTimeout(timeout time.Duration) *V1NetworkPeersRouteFilterIDDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the v1 network peers route filter id delete params +func (o *V1NetworkPeersRouteFilterIDDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the v1 network peers route filter id delete params +func (o *V1NetworkPeersRouteFilterIDDeleteParams) WithContext(ctx context.Context) *V1NetworkPeersRouteFilterIDDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the v1 network peers route filter id delete params +func (o *V1NetworkPeersRouteFilterIDDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the v1 network peers route filter id delete params +func (o *V1NetworkPeersRouteFilterIDDeleteParams) WithHTTPClient(client *http.Client) *V1NetworkPeersRouteFilterIDDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the v1 network peers route filter id delete params +func (o *V1NetworkPeersRouteFilterIDDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithNetworkPeerID adds the networkPeerID to the v1 network peers route filter id delete params +func (o *V1NetworkPeersRouteFilterIDDeleteParams) WithNetworkPeerID(networkPeerID string) *V1NetworkPeersRouteFilterIDDeleteParams { + o.SetNetworkPeerID(networkPeerID) + return o +} + +// SetNetworkPeerID adds the networkPeerId to the v1 network peers route filter id delete params +func (o *V1NetworkPeersRouteFilterIDDeleteParams) SetNetworkPeerID(networkPeerID string) { + o.NetworkPeerID = networkPeerID +} + +// WithRouteFilterID adds the routeFilterID to the v1 network peers route filter id delete params +func (o *V1NetworkPeersRouteFilterIDDeleteParams) WithRouteFilterID(routeFilterID string) *V1NetworkPeersRouteFilterIDDeleteParams { + o.SetRouteFilterID(routeFilterID) + return o +} + +// SetRouteFilterID adds the routeFilterId to the v1 network peers route filter id delete params +func (o *V1NetworkPeersRouteFilterIDDeleteParams) SetRouteFilterID(routeFilterID string) { + o.RouteFilterID = routeFilterID +} + +// WriteToRequest writes these params to a swagger request +func (o *V1NetworkPeersRouteFilterIDDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param network_peer_id + if err := r.SetPathParam("network_peer_id", o.NetworkPeerID); err != nil { + return err + } + + // path param route_filter_id + if err := r.SetPathParam("route_filter_id", o.RouteFilterID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_route_filter_id_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_route_filter_id_delete_responses.go new file mode 100644 index 00000000000..b1798054fb8 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_route_filter_id_delete_responses.go @@ -0,0 +1,561 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package network_peers + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + stderrors "errors" + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// V1NetworkPeersRouteFilterIDDeleteReader is a Reader for the V1NetworkPeersRouteFilterIDDelete structure. +type V1NetworkPeersRouteFilterIDDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *V1NetworkPeersRouteFilterIDDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { + switch response.Code() { + case 200: + result := NewV1NetworkPeersRouteFilterIDDeleteOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewV1NetworkPeersRouteFilterIDDeleteBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewV1NetworkPeersRouteFilterIDDeleteUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewV1NetworkPeersRouteFilterIDDeleteForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewV1NetworkPeersRouteFilterIDDeleteNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewV1NetworkPeersRouteFilterIDDeleteConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewV1NetworkPeersRouteFilterIDDeleteInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[DELETE /v1/network-peers/{network_peer_id}/route-filters/{route_filter_id}] v1.networkPeers.routeFilter.id.delete", response, response.Code()) + } +} + +// NewV1NetworkPeersRouteFilterIDDeleteOK creates a V1NetworkPeersRouteFilterIDDeleteOK with default headers values +func NewV1NetworkPeersRouteFilterIDDeleteOK() *V1NetworkPeersRouteFilterIDDeleteOK { + return &V1NetworkPeersRouteFilterIDDeleteOK{} +} + +/* +V1NetworkPeersRouteFilterIDDeleteOK describes a response with status code 200, with default header values. + +OK +*/ +type V1NetworkPeersRouteFilterIDDeleteOK struct { + Payload models.Object +} + +// IsSuccess returns true when this v1 network peers route filter Id delete o k response has a 2xx status code +func (o *V1NetworkPeersRouteFilterIDDeleteOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this v1 network peers route filter Id delete o k response has a 3xx status code +func (o *V1NetworkPeersRouteFilterIDDeleteOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers route filter Id delete o k response has a 4xx status code +func (o *V1NetworkPeersRouteFilterIDDeleteOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this v1 network peers route filter Id delete o k response has a 5xx status code +func (o *V1NetworkPeersRouteFilterIDDeleteOK) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers route filter Id delete o k response a status code equal to that given +func (o *V1NetworkPeersRouteFilterIDDeleteOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the v1 network peers route filter Id delete o k response +func (o *V1NetworkPeersRouteFilterIDDeleteOK) Code() int { + return 200 +} + +func (o *V1NetworkPeersRouteFilterIDDeleteOK) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/network-peers/{network_peer_id}/route-filters/{route_filter_id}][%d] v1NetworkPeersRouteFilterIdDeleteOK %s", 200, payload) +} + +func (o *V1NetworkPeersRouteFilterIDDeleteOK) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/network-peers/{network_peer_id}/route-filters/{route_filter_id}][%d] v1NetworkPeersRouteFilterIdDeleteOK %s", 200, payload) +} + +func (o *V1NetworkPeersRouteFilterIDDeleteOK) GetPayload() models.Object { + return o.Payload +} + +func (o *V1NetworkPeersRouteFilterIDDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersRouteFilterIDDeleteBadRequest creates a V1NetworkPeersRouteFilterIDDeleteBadRequest with default headers values +func NewV1NetworkPeersRouteFilterIDDeleteBadRequest() *V1NetworkPeersRouteFilterIDDeleteBadRequest { + return &V1NetworkPeersRouteFilterIDDeleteBadRequest{} +} + +/* +V1NetworkPeersRouteFilterIDDeleteBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type V1NetworkPeersRouteFilterIDDeleteBadRequest struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers route filter Id delete bad request response has a 2xx status code +func (o *V1NetworkPeersRouteFilterIDDeleteBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers route filter Id delete bad request response has a 3xx status code +func (o *V1NetworkPeersRouteFilterIDDeleteBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers route filter Id delete bad request response has a 4xx status code +func (o *V1NetworkPeersRouteFilterIDDeleteBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers route filter Id delete bad request response has a 5xx status code +func (o *V1NetworkPeersRouteFilterIDDeleteBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers route filter Id delete bad request response a status code equal to that given +func (o *V1NetworkPeersRouteFilterIDDeleteBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the v1 network peers route filter Id delete bad request response +func (o *V1NetworkPeersRouteFilterIDDeleteBadRequest) Code() int { + return 400 +} + +func (o *V1NetworkPeersRouteFilterIDDeleteBadRequest) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/network-peers/{network_peer_id}/route-filters/{route_filter_id}][%d] v1NetworkPeersRouteFilterIdDeleteBadRequest %s", 400, payload) +} + +func (o *V1NetworkPeersRouteFilterIDDeleteBadRequest) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/network-peers/{network_peer_id}/route-filters/{route_filter_id}][%d] v1NetworkPeersRouteFilterIdDeleteBadRequest %s", 400, payload) +} + +func (o *V1NetworkPeersRouteFilterIDDeleteBadRequest) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersRouteFilterIDDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersRouteFilterIDDeleteUnauthorized creates a V1NetworkPeersRouteFilterIDDeleteUnauthorized with default headers values +func NewV1NetworkPeersRouteFilterIDDeleteUnauthorized() *V1NetworkPeersRouteFilterIDDeleteUnauthorized { + return &V1NetworkPeersRouteFilterIDDeleteUnauthorized{} +} + +/* +V1NetworkPeersRouteFilterIDDeleteUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type V1NetworkPeersRouteFilterIDDeleteUnauthorized struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers route filter Id delete unauthorized response has a 2xx status code +func (o *V1NetworkPeersRouteFilterIDDeleteUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers route filter Id delete unauthorized response has a 3xx status code +func (o *V1NetworkPeersRouteFilterIDDeleteUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers route filter Id delete unauthorized response has a 4xx status code +func (o *V1NetworkPeersRouteFilterIDDeleteUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers route filter Id delete unauthorized response has a 5xx status code +func (o *V1NetworkPeersRouteFilterIDDeleteUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers route filter Id delete unauthorized response a status code equal to that given +func (o *V1NetworkPeersRouteFilterIDDeleteUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the v1 network peers route filter Id delete unauthorized response +func (o *V1NetworkPeersRouteFilterIDDeleteUnauthorized) Code() int { + return 401 +} + +func (o *V1NetworkPeersRouteFilterIDDeleteUnauthorized) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/network-peers/{network_peer_id}/route-filters/{route_filter_id}][%d] v1NetworkPeersRouteFilterIdDeleteUnauthorized %s", 401, payload) +} + +func (o *V1NetworkPeersRouteFilterIDDeleteUnauthorized) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/network-peers/{network_peer_id}/route-filters/{route_filter_id}][%d] v1NetworkPeersRouteFilterIdDeleteUnauthorized %s", 401, payload) +} + +func (o *V1NetworkPeersRouteFilterIDDeleteUnauthorized) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersRouteFilterIDDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersRouteFilterIDDeleteForbidden creates a V1NetworkPeersRouteFilterIDDeleteForbidden with default headers values +func NewV1NetworkPeersRouteFilterIDDeleteForbidden() *V1NetworkPeersRouteFilterIDDeleteForbidden { + return &V1NetworkPeersRouteFilterIDDeleteForbidden{} +} + +/* +V1NetworkPeersRouteFilterIDDeleteForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type V1NetworkPeersRouteFilterIDDeleteForbidden struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers route filter Id delete forbidden response has a 2xx status code +func (o *V1NetworkPeersRouteFilterIDDeleteForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers route filter Id delete forbidden response has a 3xx status code +func (o *V1NetworkPeersRouteFilterIDDeleteForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers route filter Id delete forbidden response has a 4xx status code +func (o *V1NetworkPeersRouteFilterIDDeleteForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers route filter Id delete forbidden response has a 5xx status code +func (o *V1NetworkPeersRouteFilterIDDeleteForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers route filter Id delete forbidden response a status code equal to that given +func (o *V1NetworkPeersRouteFilterIDDeleteForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the v1 network peers route filter Id delete forbidden response +func (o *V1NetworkPeersRouteFilterIDDeleteForbidden) Code() int { + return 403 +} + +func (o *V1NetworkPeersRouteFilterIDDeleteForbidden) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/network-peers/{network_peer_id}/route-filters/{route_filter_id}][%d] v1NetworkPeersRouteFilterIdDeleteForbidden %s", 403, payload) +} + +func (o *V1NetworkPeersRouteFilterIDDeleteForbidden) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/network-peers/{network_peer_id}/route-filters/{route_filter_id}][%d] v1NetworkPeersRouteFilterIdDeleteForbidden %s", 403, payload) +} + +func (o *V1NetworkPeersRouteFilterIDDeleteForbidden) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersRouteFilterIDDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersRouteFilterIDDeleteNotFound creates a V1NetworkPeersRouteFilterIDDeleteNotFound with default headers values +func NewV1NetworkPeersRouteFilterIDDeleteNotFound() *V1NetworkPeersRouteFilterIDDeleteNotFound { + return &V1NetworkPeersRouteFilterIDDeleteNotFound{} +} + +/* +V1NetworkPeersRouteFilterIDDeleteNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type V1NetworkPeersRouteFilterIDDeleteNotFound struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers route filter Id delete not found response has a 2xx status code +func (o *V1NetworkPeersRouteFilterIDDeleteNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers route filter Id delete not found response has a 3xx status code +func (o *V1NetworkPeersRouteFilterIDDeleteNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers route filter Id delete not found response has a 4xx status code +func (o *V1NetworkPeersRouteFilterIDDeleteNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers route filter Id delete not found response has a 5xx status code +func (o *V1NetworkPeersRouteFilterIDDeleteNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers route filter Id delete not found response a status code equal to that given +func (o *V1NetworkPeersRouteFilterIDDeleteNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the v1 network peers route filter Id delete not found response +func (o *V1NetworkPeersRouteFilterIDDeleteNotFound) Code() int { + return 404 +} + +func (o *V1NetworkPeersRouteFilterIDDeleteNotFound) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/network-peers/{network_peer_id}/route-filters/{route_filter_id}][%d] v1NetworkPeersRouteFilterIdDeleteNotFound %s", 404, payload) +} + +func (o *V1NetworkPeersRouteFilterIDDeleteNotFound) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/network-peers/{network_peer_id}/route-filters/{route_filter_id}][%d] v1NetworkPeersRouteFilterIdDeleteNotFound %s", 404, payload) +} + +func (o *V1NetworkPeersRouteFilterIDDeleteNotFound) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersRouteFilterIDDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersRouteFilterIDDeleteConflict creates a V1NetworkPeersRouteFilterIDDeleteConflict with default headers values +func NewV1NetworkPeersRouteFilterIDDeleteConflict() *V1NetworkPeersRouteFilterIDDeleteConflict { + return &V1NetworkPeersRouteFilterIDDeleteConflict{} +} + +/* +V1NetworkPeersRouteFilterIDDeleteConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type V1NetworkPeersRouteFilterIDDeleteConflict struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers route filter Id delete conflict response has a 2xx status code +func (o *V1NetworkPeersRouteFilterIDDeleteConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers route filter Id delete conflict response has a 3xx status code +func (o *V1NetworkPeersRouteFilterIDDeleteConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers route filter Id delete conflict response has a 4xx status code +func (o *V1NetworkPeersRouteFilterIDDeleteConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers route filter Id delete conflict response has a 5xx status code +func (o *V1NetworkPeersRouteFilterIDDeleteConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers route filter Id delete conflict response a status code equal to that given +func (o *V1NetworkPeersRouteFilterIDDeleteConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the v1 network peers route filter Id delete conflict response +func (o *V1NetworkPeersRouteFilterIDDeleteConflict) Code() int { + return 409 +} + +func (o *V1NetworkPeersRouteFilterIDDeleteConflict) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/network-peers/{network_peer_id}/route-filters/{route_filter_id}][%d] v1NetworkPeersRouteFilterIdDeleteConflict %s", 409, payload) +} + +func (o *V1NetworkPeersRouteFilterIDDeleteConflict) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/network-peers/{network_peer_id}/route-filters/{route_filter_id}][%d] v1NetworkPeersRouteFilterIdDeleteConflict %s", 409, payload) +} + +func (o *V1NetworkPeersRouteFilterIDDeleteConflict) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersRouteFilterIDDeleteConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersRouteFilterIDDeleteInternalServerError creates a V1NetworkPeersRouteFilterIDDeleteInternalServerError with default headers values +func NewV1NetworkPeersRouteFilterIDDeleteInternalServerError() *V1NetworkPeersRouteFilterIDDeleteInternalServerError { + return &V1NetworkPeersRouteFilterIDDeleteInternalServerError{} +} + +/* +V1NetworkPeersRouteFilterIDDeleteInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type V1NetworkPeersRouteFilterIDDeleteInternalServerError struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers route filter Id delete internal server error response has a 2xx status code +func (o *V1NetworkPeersRouteFilterIDDeleteInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers route filter Id delete internal server error response has a 3xx status code +func (o *V1NetworkPeersRouteFilterIDDeleteInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers route filter Id delete internal server error response has a 4xx status code +func (o *V1NetworkPeersRouteFilterIDDeleteInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this v1 network peers route filter Id delete internal server error response has a 5xx status code +func (o *V1NetworkPeersRouteFilterIDDeleteInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this v1 network peers route filter Id delete internal server error response a status code equal to that given +func (o *V1NetworkPeersRouteFilterIDDeleteInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the v1 network peers route filter Id delete internal server error response +func (o *V1NetworkPeersRouteFilterIDDeleteInternalServerError) Code() int { + return 500 +} + +func (o *V1NetworkPeersRouteFilterIDDeleteInternalServerError) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/network-peers/{network_peer_id}/route-filters/{route_filter_id}][%d] v1NetworkPeersRouteFilterIdDeleteInternalServerError %s", 500, payload) +} + +func (o *V1NetworkPeersRouteFilterIDDeleteInternalServerError) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/network-peers/{network_peer_id}/route-filters/{route_filter_id}][%d] v1NetworkPeersRouteFilterIdDeleteInternalServerError %s", 500, payload) +} + +func (o *V1NetworkPeersRouteFilterIDDeleteInternalServerError) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersRouteFilterIDDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_route_filter_id_get_parameters.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_route_filter_id_get_parameters.go new file mode 100644 index 00000000000..3f65fff913e --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_route_filter_id_get_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package network_peers + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewV1NetworkPeersRouteFilterIDGetParams creates a new V1NetworkPeersRouteFilterIDGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewV1NetworkPeersRouteFilterIDGetParams() *V1NetworkPeersRouteFilterIDGetParams { + return &V1NetworkPeersRouteFilterIDGetParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewV1NetworkPeersRouteFilterIDGetParamsWithTimeout creates a new V1NetworkPeersRouteFilterIDGetParams object +// with the ability to set a timeout on a request. +func NewV1NetworkPeersRouteFilterIDGetParamsWithTimeout(timeout time.Duration) *V1NetworkPeersRouteFilterIDGetParams { + return &V1NetworkPeersRouteFilterIDGetParams{ + timeout: timeout, + } +} + +// NewV1NetworkPeersRouteFilterIDGetParamsWithContext creates a new V1NetworkPeersRouteFilterIDGetParams object +// with the ability to set a context for a request. +func NewV1NetworkPeersRouteFilterIDGetParamsWithContext(ctx context.Context) *V1NetworkPeersRouteFilterIDGetParams { + return &V1NetworkPeersRouteFilterIDGetParams{ + Context: ctx, + } +} + +// NewV1NetworkPeersRouteFilterIDGetParamsWithHTTPClient creates a new V1NetworkPeersRouteFilterIDGetParams object +// with the ability to set a custom HTTPClient for a request. +func NewV1NetworkPeersRouteFilterIDGetParamsWithHTTPClient(client *http.Client) *V1NetworkPeersRouteFilterIDGetParams { + return &V1NetworkPeersRouteFilterIDGetParams{ + HTTPClient: client, + } +} + +/* +V1NetworkPeersRouteFilterIDGetParams contains all the parameters to send to the API endpoint + + for the v1 network peers route filter id get operation. + + Typically these are written to a http.Request. +*/ +type V1NetworkPeersRouteFilterIDGetParams struct { + + /* NetworkPeerID. + + network peer ID + */ + NetworkPeerID string + + /* RouteFilterID. + + route filter ID + */ + RouteFilterID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the v1 network peers route filter id get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *V1NetworkPeersRouteFilterIDGetParams) WithDefaults() *V1NetworkPeersRouteFilterIDGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the v1 network peers route filter id get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *V1NetworkPeersRouteFilterIDGetParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the v1 network peers route filter id get params +func (o *V1NetworkPeersRouteFilterIDGetParams) WithTimeout(timeout time.Duration) *V1NetworkPeersRouteFilterIDGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the v1 network peers route filter id get params +func (o *V1NetworkPeersRouteFilterIDGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the v1 network peers route filter id get params +func (o *V1NetworkPeersRouteFilterIDGetParams) WithContext(ctx context.Context) *V1NetworkPeersRouteFilterIDGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the v1 network peers route filter id get params +func (o *V1NetworkPeersRouteFilterIDGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the v1 network peers route filter id get params +func (o *V1NetworkPeersRouteFilterIDGetParams) WithHTTPClient(client *http.Client) *V1NetworkPeersRouteFilterIDGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the v1 network peers route filter id get params +func (o *V1NetworkPeersRouteFilterIDGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithNetworkPeerID adds the networkPeerID to the v1 network peers route filter id get params +func (o *V1NetworkPeersRouteFilterIDGetParams) WithNetworkPeerID(networkPeerID string) *V1NetworkPeersRouteFilterIDGetParams { + o.SetNetworkPeerID(networkPeerID) + return o +} + +// SetNetworkPeerID adds the networkPeerId to the v1 network peers route filter id get params +func (o *V1NetworkPeersRouteFilterIDGetParams) SetNetworkPeerID(networkPeerID string) { + o.NetworkPeerID = networkPeerID +} + +// WithRouteFilterID adds the routeFilterID to the v1 network peers route filter id get params +func (o *V1NetworkPeersRouteFilterIDGetParams) WithRouteFilterID(routeFilterID string) *V1NetworkPeersRouteFilterIDGetParams { + o.SetRouteFilterID(routeFilterID) + return o +} + +// SetRouteFilterID adds the routeFilterId to the v1 network peers route filter id get params +func (o *V1NetworkPeersRouteFilterIDGetParams) SetRouteFilterID(routeFilterID string) { + o.RouteFilterID = routeFilterID +} + +// WriteToRequest writes these params to a swagger request +func (o *V1NetworkPeersRouteFilterIDGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param network_peer_id + if err := r.SetPathParam("network_peer_id", o.NetworkPeerID); err != nil { + return err + } + + // path param route_filter_id + if err := r.SetPathParam("route_filter_id", o.RouteFilterID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_route_filter_id_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_route_filter_id_get_responses.go new file mode 100644 index 00000000000..6bc83965361 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_route_filter_id_get_responses.go @@ -0,0 +1,563 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package network_peers + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + stderrors "errors" + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// V1NetworkPeersRouteFilterIDGetReader is a Reader for the V1NetworkPeersRouteFilterIDGet structure. +type V1NetworkPeersRouteFilterIDGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *V1NetworkPeersRouteFilterIDGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { + switch response.Code() { + case 200: + result := NewV1NetworkPeersRouteFilterIDGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewV1NetworkPeersRouteFilterIDGetBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewV1NetworkPeersRouteFilterIDGetUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewV1NetworkPeersRouteFilterIDGetForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewV1NetworkPeersRouteFilterIDGetNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewV1NetworkPeersRouteFilterIDGetConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewV1NetworkPeersRouteFilterIDGetInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /v1/network-peers/{network_peer_id}/route-filters/{route_filter_id}] v1.networkPeers.routeFilter.id.get", response, response.Code()) + } +} + +// NewV1NetworkPeersRouteFilterIDGetOK creates a V1NetworkPeersRouteFilterIDGetOK with default headers values +func NewV1NetworkPeersRouteFilterIDGetOK() *V1NetworkPeersRouteFilterIDGetOK { + return &V1NetworkPeersRouteFilterIDGetOK{} +} + +/* +V1NetworkPeersRouteFilterIDGetOK describes a response with status code 200, with default header values. + +OK +*/ +type V1NetworkPeersRouteFilterIDGetOK struct { + Payload *models.RouteFilter +} + +// IsSuccess returns true when this v1 network peers route filter Id get o k response has a 2xx status code +func (o *V1NetworkPeersRouteFilterIDGetOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this v1 network peers route filter Id get o k response has a 3xx status code +func (o *V1NetworkPeersRouteFilterIDGetOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers route filter Id get o k response has a 4xx status code +func (o *V1NetworkPeersRouteFilterIDGetOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this v1 network peers route filter Id get o k response has a 5xx status code +func (o *V1NetworkPeersRouteFilterIDGetOK) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers route filter Id get o k response a status code equal to that given +func (o *V1NetworkPeersRouteFilterIDGetOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the v1 network peers route filter Id get o k response +func (o *V1NetworkPeersRouteFilterIDGetOK) Code() int { + return 200 +} + +func (o *V1NetworkPeersRouteFilterIDGetOK) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/{network_peer_id}/route-filters/{route_filter_id}][%d] v1NetworkPeersRouteFilterIdGetOK %s", 200, payload) +} + +func (o *V1NetworkPeersRouteFilterIDGetOK) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/{network_peer_id}/route-filters/{route_filter_id}][%d] v1NetworkPeersRouteFilterIdGetOK %s", 200, payload) +} + +func (o *V1NetworkPeersRouteFilterIDGetOK) GetPayload() *models.RouteFilter { + return o.Payload +} + +func (o *V1NetworkPeersRouteFilterIDGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RouteFilter) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersRouteFilterIDGetBadRequest creates a V1NetworkPeersRouteFilterIDGetBadRequest with default headers values +func NewV1NetworkPeersRouteFilterIDGetBadRequest() *V1NetworkPeersRouteFilterIDGetBadRequest { + return &V1NetworkPeersRouteFilterIDGetBadRequest{} +} + +/* +V1NetworkPeersRouteFilterIDGetBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type V1NetworkPeersRouteFilterIDGetBadRequest struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers route filter Id get bad request response has a 2xx status code +func (o *V1NetworkPeersRouteFilterIDGetBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers route filter Id get bad request response has a 3xx status code +func (o *V1NetworkPeersRouteFilterIDGetBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers route filter Id get bad request response has a 4xx status code +func (o *V1NetworkPeersRouteFilterIDGetBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers route filter Id get bad request response has a 5xx status code +func (o *V1NetworkPeersRouteFilterIDGetBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers route filter Id get bad request response a status code equal to that given +func (o *V1NetworkPeersRouteFilterIDGetBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the v1 network peers route filter Id get bad request response +func (o *V1NetworkPeersRouteFilterIDGetBadRequest) Code() int { + return 400 +} + +func (o *V1NetworkPeersRouteFilterIDGetBadRequest) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/{network_peer_id}/route-filters/{route_filter_id}][%d] v1NetworkPeersRouteFilterIdGetBadRequest %s", 400, payload) +} + +func (o *V1NetworkPeersRouteFilterIDGetBadRequest) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/{network_peer_id}/route-filters/{route_filter_id}][%d] v1NetworkPeersRouteFilterIdGetBadRequest %s", 400, payload) +} + +func (o *V1NetworkPeersRouteFilterIDGetBadRequest) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersRouteFilterIDGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersRouteFilterIDGetUnauthorized creates a V1NetworkPeersRouteFilterIDGetUnauthorized with default headers values +func NewV1NetworkPeersRouteFilterIDGetUnauthorized() *V1NetworkPeersRouteFilterIDGetUnauthorized { + return &V1NetworkPeersRouteFilterIDGetUnauthorized{} +} + +/* +V1NetworkPeersRouteFilterIDGetUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type V1NetworkPeersRouteFilterIDGetUnauthorized struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers route filter Id get unauthorized response has a 2xx status code +func (o *V1NetworkPeersRouteFilterIDGetUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers route filter Id get unauthorized response has a 3xx status code +func (o *V1NetworkPeersRouteFilterIDGetUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers route filter Id get unauthorized response has a 4xx status code +func (o *V1NetworkPeersRouteFilterIDGetUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers route filter Id get unauthorized response has a 5xx status code +func (o *V1NetworkPeersRouteFilterIDGetUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers route filter Id get unauthorized response a status code equal to that given +func (o *V1NetworkPeersRouteFilterIDGetUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the v1 network peers route filter Id get unauthorized response +func (o *V1NetworkPeersRouteFilterIDGetUnauthorized) Code() int { + return 401 +} + +func (o *V1NetworkPeersRouteFilterIDGetUnauthorized) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/{network_peer_id}/route-filters/{route_filter_id}][%d] v1NetworkPeersRouteFilterIdGetUnauthorized %s", 401, payload) +} + +func (o *V1NetworkPeersRouteFilterIDGetUnauthorized) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/{network_peer_id}/route-filters/{route_filter_id}][%d] v1NetworkPeersRouteFilterIdGetUnauthorized %s", 401, payload) +} + +func (o *V1NetworkPeersRouteFilterIDGetUnauthorized) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersRouteFilterIDGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersRouteFilterIDGetForbidden creates a V1NetworkPeersRouteFilterIDGetForbidden with default headers values +func NewV1NetworkPeersRouteFilterIDGetForbidden() *V1NetworkPeersRouteFilterIDGetForbidden { + return &V1NetworkPeersRouteFilterIDGetForbidden{} +} + +/* +V1NetworkPeersRouteFilterIDGetForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type V1NetworkPeersRouteFilterIDGetForbidden struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers route filter Id get forbidden response has a 2xx status code +func (o *V1NetworkPeersRouteFilterIDGetForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers route filter Id get forbidden response has a 3xx status code +func (o *V1NetworkPeersRouteFilterIDGetForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers route filter Id get forbidden response has a 4xx status code +func (o *V1NetworkPeersRouteFilterIDGetForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers route filter Id get forbidden response has a 5xx status code +func (o *V1NetworkPeersRouteFilterIDGetForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers route filter Id get forbidden response a status code equal to that given +func (o *V1NetworkPeersRouteFilterIDGetForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the v1 network peers route filter Id get forbidden response +func (o *V1NetworkPeersRouteFilterIDGetForbidden) Code() int { + return 403 +} + +func (o *V1NetworkPeersRouteFilterIDGetForbidden) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/{network_peer_id}/route-filters/{route_filter_id}][%d] v1NetworkPeersRouteFilterIdGetForbidden %s", 403, payload) +} + +func (o *V1NetworkPeersRouteFilterIDGetForbidden) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/{network_peer_id}/route-filters/{route_filter_id}][%d] v1NetworkPeersRouteFilterIdGetForbidden %s", 403, payload) +} + +func (o *V1NetworkPeersRouteFilterIDGetForbidden) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersRouteFilterIDGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersRouteFilterIDGetNotFound creates a V1NetworkPeersRouteFilterIDGetNotFound with default headers values +func NewV1NetworkPeersRouteFilterIDGetNotFound() *V1NetworkPeersRouteFilterIDGetNotFound { + return &V1NetworkPeersRouteFilterIDGetNotFound{} +} + +/* +V1NetworkPeersRouteFilterIDGetNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type V1NetworkPeersRouteFilterIDGetNotFound struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers route filter Id get not found response has a 2xx status code +func (o *V1NetworkPeersRouteFilterIDGetNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers route filter Id get not found response has a 3xx status code +func (o *V1NetworkPeersRouteFilterIDGetNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers route filter Id get not found response has a 4xx status code +func (o *V1NetworkPeersRouteFilterIDGetNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers route filter Id get not found response has a 5xx status code +func (o *V1NetworkPeersRouteFilterIDGetNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers route filter Id get not found response a status code equal to that given +func (o *V1NetworkPeersRouteFilterIDGetNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the v1 network peers route filter Id get not found response +func (o *V1NetworkPeersRouteFilterIDGetNotFound) Code() int { + return 404 +} + +func (o *V1NetworkPeersRouteFilterIDGetNotFound) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/{network_peer_id}/route-filters/{route_filter_id}][%d] v1NetworkPeersRouteFilterIdGetNotFound %s", 404, payload) +} + +func (o *V1NetworkPeersRouteFilterIDGetNotFound) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/{network_peer_id}/route-filters/{route_filter_id}][%d] v1NetworkPeersRouteFilterIdGetNotFound %s", 404, payload) +} + +func (o *V1NetworkPeersRouteFilterIDGetNotFound) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersRouteFilterIDGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersRouteFilterIDGetConflict creates a V1NetworkPeersRouteFilterIDGetConflict with default headers values +func NewV1NetworkPeersRouteFilterIDGetConflict() *V1NetworkPeersRouteFilterIDGetConflict { + return &V1NetworkPeersRouteFilterIDGetConflict{} +} + +/* +V1NetworkPeersRouteFilterIDGetConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type V1NetworkPeersRouteFilterIDGetConflict struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers route filter Id get conflict response has a 2xx status code +func (o *V1NetworkPeersRouteFilterIDGetConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers route filter Id get conflict response has a 3xx status code +func (o *V1NetworkPeersRouteFilterIDGetConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers route filter Id get conflict response has a 4xx status code +func (o *V1NetworkPeersRouteFilterIDGetConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers route filter Id get conflict response has a 5xx status code +func (o *V1NetworkPeersRouteFilterIDGetConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers route filter Id get conflict response a status code equal to that given +func (o *V1NetworkPeersRouteFilterIDGetConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the v1 network peers route filter Id get conflict response +func (o *V1NetworkPeersRouteFilterIDGetConflict) Code() int { + return 409 +} + +func (o *V1NetworkPeersRouteFilterIDGetConflict) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/{network_peer_id}/route-filters/{route_filter_id}][%d] v1NetworkPeersRouteFilterIdGetConflict %s", 409, payload) +} + +func (o *V1NetworkPeersRouteFilterIDGetConflict) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/{network_peer_id}/route-filters/{route_filter_id}][%d] v1NetworkPeersRouteFilterIdGetConflict %s", 409, payload) +} + +func (o *V1NetworkPeersRouteFilterIDGetConflict) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersRouteFilterIDGetConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersRouteFilterIDGetInternalServerError creates a V1NetworkPeersRouteFilterIDGetInternalServerError with default headers values +func NewV1NetworkPeersRouteFilterIDGetInternalServerError() *V1NetworkPeersRouteFilterIDGetInternalServerError { + return &V1NetworkPeersRouteFilterIDGetInternalServerError{} +} + +/* +V1NetworkPeersRouteFilterIDGetInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type V1NetworkPeersRouteFilterIDGetInternalServerError struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers route filter Id get internal server error response has a 2xx status code +func (o *V1NetworkPeersRouteFilterIDGetInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers route filter Id get internal server error response has a 3xx status code +func (o *V1NetworkPeersRouteFilterIDGetInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers route filter Id get internal server error response has a 4xx status code +func (o *V1NetworkPeersRouteFilterIDGetInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this v1 network peers route filter Id get internal server error response has a 5xx status code +func (o *V1NetworkPeersRouteFilterIDGetInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this v1 network peers route filter Id get internal server error response a status code equal to that given +func (o *V1NetworkPeersRouteFilterIDGetInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the v1 network peers route filter Id get internal server error response +func (o *V1NetworkPeersRouteFilterIDGetInternalServerError) Code() int { + return 500 +} + +func (o *V1NetworkPeersRouteFilterIDGetInternalServerError) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/{network_peer_id}/route-filters/{route_filter_id}][%d] v1NetworkPeersRouteFilterIdGetInternalServerError %s", 500, payload) +} + +func (o *V1NetworkPeersRouteFilterIDGetInternalServerError) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/network-peers/{network_peer_id}/route-filters/{route_filter_id}][%d] v1NetworkPeersRouteFilterIdGetInternalServerError %s", 500, payload) +} + +func (o *V1NetworkPeersRouteFilterIDGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersRouteFilterIDGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_route_filters_post_parameters.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_route_filters_post_parameters.go new file mode 100644 index 00000000000..011440a267c --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_route_filters_post_parameters.go @@ -0,0 +1,175 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package network_peers + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// NewV1NetworkPeersRouteFiltersPostParams creates a new V1NetworkPeersRouteFiltersPostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewV1NetworkPeersRouteFiltersPostParams() *V1NetworkPeersRouteFiltersPostParams { + return &V1NetworkPeersRouteFiltersPostParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewV1NetworkPeersRouteFiltersPostParamsWithTimeout creates a new V1NetworkPeersRouteFiltersPostParams object +// with the ability to set a timeout on a request. +func NewV1NetworkPeersRouteFiltersPostParamsWithTimeout(timeout time.Duration) *V1NetworkPeersRouteFiltersPostParams { + return &V1NetworkPeersRouteFiltersPostParams{ + timeout: timeout, + } +} + +// NewV1NetworkPeersRouteFiltersPostParamsWithContext creates a new V1NetworkPeersRouteFiltersPostParams object +// with the ability to set a context for a request. +func NewV1NetworkPeersRouteFiltersPostParamsWithContext(ctx context.Context) *V1NetworkPeersRouteFiltersPostParams { + return &V1NetworkPeersRouteFiltersPostParams{ + Context: ctx, + } +} + +// NewV1NetworkPeersRouteFiltersPostParamsWithHTTPClient creates a new V1NetworkPeersRouteFiltersPostParams object +// with the ability to set a custom HTTPClient for a request. +func NewV1NetworkPeersRouteFiltersPostParamsWithHTTPClient(client *http.Client) *V1NetworkPeersRouteFiltersPostParams { + return &V1NetworkPeersRouteFiltersPostParams{ + HTTPClient: client, + } +} + +/* +V1NetworkPeersRouteFiltersPostParams contains all the parameters to send to the API endpoint + + for the v1 network peers route filters post operation. + + Typically these are written to a http.Request. +*/ +type V1NetworkPeersRouteFiltersPostParams struct { + + /* Body. + + route filter create parameters. + */ + Body *models.RouteFilterCreate + + /* NetworkPeerID. + + network peer ID + */ + NetworkPeerID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the v1 network peers route filters post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *V1NetworkPeersRouteFiltersPostParams) WithDefaults() *V1NetworkPeersRouteFiltersPostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the v1 network peers route filters post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *V1NetworkPeersRouteFiltersPostParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the v1 network peers route filters post params +func (o *V1NetworkPeersRouteFiltersPostParams) WithTimeout(timeout time.Duration) *V1NetworkPeersRouteFiltersPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the v1 network peers route filters post params +func (o *V1NetworkPeersRouteFiltersPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the v1 network peers route filters post params +func (o *V1NetworkPeersRouteFiltersPostParams) WithContext(ctx context.Context) *V1NetworkPeersRouteFiltersPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the v1 network peers route filters post params +func (o *V1NetworkPeersRouteFiltersPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the v1 network peers route filters post params +func (o *V1NetworkPeersRouteFiltersPostParams) WithHTTPClient(client *http.Client) *V1NetworkPeersRouteFiltersPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the v1 network peers route filters post params +func (o *V1NetworkPeersRouteFiltersPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the v1 network peers route filters post params +func (o *V1NetworkPeersRouteFiltersPostParams) WithBody(body *models.RouteFilterCreate) *V1NetworkPeersRouteFiltersPostParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the v1 network peers route filters post params +func (o *V1NetworkPeersRouteFiltersPostParams) SetBody(body *models.RouteFilterCreate) { + o.Body = body +} + +// WithNetworkPeerID adds the networkPeerID to the v1 network peers route filters post params +func (o *V1NetworkPeersRouteFiltersPostParams) WithNetworkPeerID(networkPeerID string) *V1NetworkPeersRouteFiltersPostParams { + o.SetNetworkPeerID(networkPeerID) + return o +} + +// SetNetworkPeerID adds the networkPeerId to the v1 network peers route filters post params +func (o *V1NetworkPeersRouteFiltersPostParams) SetNetworkPeerID(networkPeerID string) { + o.NetworkPeerID = networkPeerID +} + +// WriteToRequest writes these params to a swagger request +func (o *V1NetworkPeersRouteFiltersPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param network_peer_id + if err := r.SetPathParam("network_peer_id", o.NetworkPeerID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_route_filters_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_route_filters_post_responses.go new file mode 100644 index 00000000000..db282303f97 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_peers/v1_network_peers_route_filters_post_responses.go @@ -0,0 +1,563 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package network_peers + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + stderrors "errors" + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// V1NetworkPeersRouteFiltersPostReader is a Reader for the V1NetworkPeersRouteFiltersPost structure. +type V1NetworkPeersRouteFiltersPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *V1NetworkPeersRouteFiltersPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { + switch response.Code() { + case 200: + result := NewV1NetworkPeersRouteFiltersPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewV1NetworkPeersRouteFiltersPostBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewV1NetworkPeersRouteFiltersPostUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewV1NetworkPeersRouteFiltersPostForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewV1NetworkPeersRouteFiltersPostNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewV1NetworkPeersRouteFiltersPostConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewV1NetworkPeersRouteFiltersPostInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /v1/network-peers/{network_peer_id}/route-filters] v1.networkPeers.routeFilters.post", response, response.Code()) + } +} + +// NewV1NetworkPeersRouteFiltersPostOK creates a V1NetworkPeersRouteFiltersPostOK with default headers values +func NewV1NetworkPeersRouteFiltersPostOK() *V1NetworkPeersRouteFiltersPostOK { + return &V1NetworkPeersRouteFiltersPostOK{} +} + +/* +V1NetworkPeersRouteFiltersPostOK describes a response with status code 200, with default header values. + +OK +*/ +type V1NetworkPeersRouteFiltersPostOK struct { + Payload *models.RouteFilter +} + +// IsSuccess returns true when this v1 network peers route filters post o k response has a 2xx status code +func (o *V1NetworkPeersRouteFiltersPostOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this v1 network peers route filters post o k response has a 3xx status code +func (o *V1NetworkPeersRouteFiltersPostOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers route filters post o k response has a 4xx status code +func (o *V1NetworkPeersRouteFiltersPostOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this v1 network peers route filters post o k response has a 5xx status code +func (o *V1NetworkPeersRouteFiltersPostOK) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers route filters post o k response a status code equal to that given +func (o *V1NetworkPeersRouteFiltersPostOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the v1 network peers route filters post o k response +func (o *V1NetworkPeersRouteFiltersPostOK) Code() int { + return 200 +} + +func (o *V1NetworkPeersRouteFiltersPostOK) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/network-peers/{network_peer_id}/route-filters][%d] v1NetworkPeersRouteFiltersPostOK %s", 200, payload) +} + +func (o *V1NetworkPeersRouteFiltersPostOK) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/network-peers/{network_peer_id}/route-filters][%d] v1NetworkPeersRouteFiltersPostOK %s", 200, payload) +} + +func (o *V1NetworkPeersRouteFiltersPostOK) GetPayload() *models.RouteFilter { + return o.Payload +} + +func (o *V1NetworkPeersRouteFiltersPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RouteFilter) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersRouteFiltersPostBadRequest creates a V1NetworkPeersRouteFiltersPostBadRequest with default headers values +func NewV1NetworkPeersRouteFiltersPostBadRequest() *V1NetworkPeersRouteFiltersPostBadRequest { + return &V1NetworkPeersRouteFiltersPostBadRequest{} +} + +/* +V1NetworkPeersRouteFiltersPostBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type V1NetworkPeersRouteFiltersPostBadRequest struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers route filters post bad request response has a 2xx status code +func (o *V1NetworkPeersRouteFiltersPostBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers route filters post bad request response has a 3xx status code +func (o *V1NetworkPeersRouteFiltersPostBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers route filters post bad request response has a 4xx status code +func (o *V1NetworkPeersRouteFiltersPostBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers route filters post bad request response has a 5xx status code +func (o *V1NetworkPeersRouteFiltersPostBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers route filters post bad request response a status code equal to that given +func (o *V1NetworkPeersRouteFiltersPostBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the v1 network peers route filters post bad request response +func (o *V1NetworkPeersRouteFiltersPostBadRequest) Code() int { + return 400 +} + +func (o *V1NetworkPeersRouteFiltersPostBadRequest) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/network-peers/{network_peer_id}/route-filters][%d] v1NetworkPeersRouteFiltersPostBadRequest %s", 400, payload) +} + +func (o *V1NetworkPeersRouteFiltersPostBadRequest) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/network-peers/{network_peer_id}/route-filters][%d] v1NetworkPeersRouteFiltersPostBadRequest %s", 400, payload) +} + +func (o *V1NetworkPeersRouteFiltersPostBadRequest) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersRouteFiltersPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersRouteFiltersPostUnauthorized creates a V1NetworkPeersRouteFiltersPostUnauthorized with default headers values +func NewV1NetworkPeersRouteFiltersPostUnauthorized() *V1NetworkPeersRouteFiltersPostUnauthorized { + return &V1NetworkPeersRouteFiltersPostUnauthorized{} +} + +/* +V1NetworkPeersRouteFiltersPostUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type V1NetworkPeersRouteFiltersPostUnauthorized struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers route filters post unauthorized response has a 2xx status code +func (o *V1NetworkPeersRouteFiltersPostUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers route filters post unauthorized response has a 3xx status code +func (o *V1NetworkPeersRouteFiltersPostUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers route filters post unauthorized response has a 4xx status code +func (o *V1NetworkPeersRouteFiltersPostUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers route filters post unauthorized response has a 5xx status code +func (o *V1NetworkPeersRouteFiltersPostUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers route filters post unauthorized response a status code equal to that given +func (o *V1NetworkPeersRouteFiltersPostUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the v1 network peers route filters post unauthorized response +func (o *V1NetworkPeersRouteFiltersPostUnauthorized) Code() int { + return 401 +} + +func (o *V1NetworkPeersRouteFiltersPostUnauthorized) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/network-peers/{network_peer_id}/route-filters][%d] v1NetworkPeersRouteFiltersPostUnauthorized %s", 401, payload) +} + +func (o *V1NetworkPeersRouteFiltersPostUnauthorized) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/network-peers/{network_peer_id}/route-filters][%d] v1NetworkPeersRouteFiltersPostUnauthorized %s", 401, payload) +} + +func (o *V1NetworkPeersRouteFiltersPostUnauthorized) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersRouteFiltersPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersRouteFiltersPostForbidden creates a V1NetworkPeersRouteFiltersPostForbidden with default headers values +func NewV1NetworkPeersRouteFiltersPostForbidden() *V1NetworkPeersRouteFiltersPostForbidden { + return &V1NetworkPeersRouteFiltersPostForbidden{} +} + +/* +V1NetworkPeersRouteFiltersPostForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type V1NetworkPeersRouteFiltersPostForbidden struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers route filters post forbidden response has a 2xx status code +func (o *V1NetworkPeersRouteFiltersPostForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers route filters post forbidden response has a 3xx status code +func (o *V1NetworkPeersRouteFiltersPostForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers route filters post forbidden response has a 4xx status code +func (o *V1NetworkPeersRouteFiltersPostForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers route filters post forbidden response has a 5xx status code +func (o *V1NetworkPeersRouteFiltersPostForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers route filters post forbidden response a status code equal to that given +func (o *V1NetworkPeersRouteFiltersPostForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the v1 network peers route filters post forbidden response +func (o *V1NetworkPeersRouteFiltersPostForbidden) Code() int { + return 403 +} + +func (o *V1NetworkPeersRouteFiltersPostForbidden) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/network-peers/{network_peer_id}/route-filters][%d] v1NetworkPeersRouteFiltersPostForbidden %s", 403, payload) +} + +func (o *V1NetworkPeersRouteFiltersPostForbidden) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/network-peers/{network_peer_id}/route-filters][%d] v1NetworkPeersRouteFiltersPostForbidden %s", 403, payload) +} + +func (o *V1NetworkPeersRouteFiltersPostForbidden) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersRouteFiltersPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersRouteFiltersPostNotFound creates a V1NetworkPeersRouteFiltersPostNotFound with default headers values +func NewV1NetworkPeersRouteFiltersPostNotFound() *V1NetworkPeersRouteFiltersPostNotFound { + return &V1NetworkPeersRouteFiltersPostNotFound{} +} + +/* +V1NetworkPeersRouteFiltersPostNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type V1NetworkPeersRouteFiltersPostNotFound struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers route filters post not found response has a 2xx status code +func (o *V1NetworkPeersRouteFiltersPostNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers route filters post not found response has a 3xx status code +func (o *V1NetworkPeersRouteFiltersPostNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers route filters post not found response has a 4xx status code +func (o *V1NetworkPeersRouteFiltersPostNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers route filters post not found response has a 5xx status code +func (o *V1NetworkPeersRouteFiltersPostNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers route filters post not found response a status code equal to that given +func (o *V1NetworkPeersRouteFiltersPostNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the v1 network peers route filters post not found response +func (o *V1NetworkPeersRouteFiltersPostNotFound) Code() int { + return 404 +} + +func (o *V1NetworkPeersRouteFiltersPostNotFound) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/network-peers/{network_peer_id}/route-filters][%d] v1NetworkPeersRouteFiltersPostNotFound %s", 404, payload) +} + +func (o *V1NetworkPeersRouteFiltersPostNotFound) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/network-peers/{network_peer_id}/route-filters][%d] v1NetworkPeersRouteFiltersPostNotFound %s", 404, payload) +} + +func (o *V1NetworkPeersRouteFiltersPostNotFound) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersRouteFiltersPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersRouteFiltersPostConflict creates a V1NetworkPeersRouteFiltersPostConflict with default headers values +func NewV1NetworkPeersRouteFiltersPostConflict() *V1NetworkPeersRouteFiltersPostConflict { + return &V1NetworkPeersRouteFiltersPostConflict{} +} + +/* +V1NetworkPeersRouteFiltersPostConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type V1NetworkPeersRouteFiltersPostConflict struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers route filters post conflict response has a 2xx status code +func (o *V1NetworkPeersRouteFiltersPostConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers route filters post conflict response has a 3xx status code +func (o *V1NetworkPeersRouteFiltersPostConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers route filters post conflict response has a 4xx status code +func (o *V1NetworkPeersRouteFiltersPostConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 network peers route filters post conflict response has a 5xx status code +func (o *V1NetworkPeersRouteFiltersPostConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 network peers route filters post conflict response a status code equal to that given +func (o *V1NetworkPeersRouteFiltersPostConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the v1 network peers route filters post conflict response +func (o *V1NetworkPeersRouteFiltersPostConflict) Code() int { + return 409 +} + +func (o *V1NetworkPeersRouteFiltersPostConflict) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/network-peers/{network_peer_id}/route-filters][%d] v1NetworkPeersRouteFiltersPostConflict %s", 409, payload) +} + +func (o *V1NetworkPeersRouteFiltersPostConflict) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/network-peers/{network_peer_id}/route-filters][%d] v1NetworkPeersRouteFiltersPostConflict %s", 409, payload) +} + +func (o *V1NetworkPeersRouteFiltersPostConflict) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersRouteFiltersPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewV1NetworkPeersRouteFiltersPostInternalServerError creates a V1NetworkPeersRouteFiltersPostInternalServerError with default headers values +func NewV1NetworkPeersRouteFiltersPostInternalServerError() *V1NetworkPeersRouteFiltersPostInternalServerError { + return &V1NetworkPeersRouteFiltersPostInternalServerError{} +} + +/* +V1NetworkPeersRouteFiltersPostInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type V1NetworkPeersRouteFiltersPostInternalServerError struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 network peers route filters post internal server error response has a 2xx status code +func (o *V1NetworkPeersRouteFiltersPostInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 network peers route filters post internal server error response has a 3xx status code +func (o *V1NetworkPeersRouteFiltersPostInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 network peers route filters post internal server error response has a 4xx status code +func (o *V1NetworkPeersRouteFiltersPostInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this v1 network peers route filters post internal server error response has a 5xx status code +func (o *V1NetworkPeersRouteFiltersPostInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this v1 network peers route filters post internal server error response a status code equal to that given +func (o *V1NetworkPeersRouteFiltersPostInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the v1 network peers route filters post internal server error response +func (o *V1NetworkPeersRouteFiltersPostInternalServerError) Code() int { + return 500 +} + +func (o *V1NetworkPeersRouteFiltersPostInternalServerError) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/network-peers/{network_peer_id}/route-filters][%d] v1NetworkPeersRouteFiltersPostInternalServerError %s", 500, payload) +} + +func (o *V1NetworkPeersRouteFiltersPostInternalServerError) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/network-peers/{network_peer_id}/route-filters][%d] v1NetworkPeersRouteFiltersPostInternalServerError %s", 500, payload) +} + +func (o *V1NetworkPeersRouteFiltersPostInternalServerError) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1NetworkPeersRouteFiltersPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/network_security_groups_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/network_security_groups_client.go index 258d508536b..865e10ffd56 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/network_security_groups_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/network_security_groups_client.go @@ -87,7 +87,7 @@ type ClientService interface { V1NetworkSecurityGroupsActionPost performs a network security groups action enable disable on a workspace on enablement a default network security group is created to allow all traffic for all active network iterfaces */ func (a *Client) V1NetworkSecurityGroupsActionPost(params *V1NetworkSecurityGroupsActionPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkSecurityGroupsActionPostOK, *V1NetworkSecurityGroupsActionPostAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1NetworkSecurityGroupsActionPostParams() } @@ -107,18 +107,22 @@ func (a *Client) V1NetworkSecurityGroupsActionPost(params *V1NetworkSecurityGrou for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } + + // several success responses have to be checked switch value := result.(type) { case *V1NetworkSecurityGroupsActionPostOK: return value, nil, nil case *V1NetworkSecurityGroupsActionPostAccepted: return nil, value, nil } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for network_security_groups: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -127,7 +131,7 @@ func (a *Client) V1NetworkSecurityGroupsActionPost(params *V1NetworkSecurityGrou V1NetworkSecurityGroupsIDDelete deletes a network security group from a workspace */ func (a *Client) V1NetworkSecurityGroupsIDDelete(params *V1NetworkSecurityGroupsIDDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkSecurityGroupsIDDeleteOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1NetworkSecurityGroupsIDDeleteParams() } @@ -147,17 +151,22 @@ func (a *Client) V1NetworkSecurityGroupsIDDelete(params *V1NetworkSecurityGroups for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1NetworkSecurityGroupsIDDeleteOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.networkSecurityGroups.id.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -166,7 +175,7 @@ func (a *Client) V1NetworkSecurityGroupsIDDelete(params *V1NetworkSecurityGroups V1NetworkSecurityGroupsIDGet gets the detail of a network security group */ func (a *Client) V1NetworkSecurityGroupsIDGet(params *V1NetworkSecurityGroupsIDGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkSecurityGroupsIDGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1NetworkSecurityGroupsIDGetParams() } @@ -186,17 +195,22 @@ func (a *Client) V1NetworkSecurityGroupsIDGet(params *V1NetworkSecurityGroupsIDG for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1NetworkSecurityGroupsIDGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.networkSecurityGroups.id.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -205,7 +219,7 @@ func (a *Client) V1NetworkSecurityGroupsIDGet(params *V1NetworkSecurityGroupsIDG V1NetworkSecurityGroupsIDPost clones a network security group */ func (a *Client) V1NetworkSecurityGroupsIDPost(params *V1NetworkSecurityGroupsIDPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkSecurityGroupsIDPostCreated, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1NetworkSecurityGroupsIDPostParams() } @@ -225,17 +239,22 @@ func (a *Client) V1NetworkSecurityGroupsIDPost(params *V1NetworkSecurityGroupsID for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1NetworkSecurityGroupsIDPostCreated) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.networkSecurityGroups.id.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -244,7 +263,7 @@ func (a *Client) V1NetworkSecurityGroupsIDPost(params *V1NetworkSecurityGroupsID V1NetworkSecurityGroupsIDPut updates a network security group */ func (a *Client) V1NetworkSecurityGroupsIDPut(params *V1NetworkSecurityGroupsIDPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkSecurityGroupsIDPutOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1NetworkSecurityGroupsIDPutParams() } @@ -264,17 +283,22 @@ func (a *Client) V1NetworkSecurityGroupsIDPut(params *V1NetworkSecurityGroupsIDP for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1NetworkSecurityGroupsIDPutOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.networkSecurityGroups.id.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -283,7 +307,7 @@ func (a *Client) V1NetworkSecurityGroupsIDPut(params *V1NetworkSecurityGroupsIDP V1NetworkSecurityGroupsList gets the list of network security groups for a workspace */ func (a *Client) V1NetworkSecurityGroupsList(params *V1NetworkSecurityGroupsListParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkSecurityGroupsListOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1NetworkSecurityGroupsListParams() } @@ -303,17 +327,22 @@ func (a *Client) V1NetworkSecurityGroupsList(params *V1NetworkSecurityGroupsList for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1NetworkSecurityGroupsListOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.networkSecurityGroups.list: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -322,7 +351,7 @@ func (a *Client) V1NetworkSecurityGroupsList(params *V1NetworkSecurityGroupsList V1NetworkSecurityGroupsMembersDelete deletes the member from a network security group */ func (a *Client) V1NetworkSecurityGroupsMembersDelete(params *V1NetworkSecurityGroupsMembersDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkSecurityGroupsMembersDeleteOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1NetworkSecurityGroupsMembersDeleteParams() } @@ -342,17 +371,22 @@ func (a *Client) V1NetworkSecurityGroupsMembersDelete(params *V1NetworkSecurityG for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1NetworkSecurityGroupsMembersDeleteOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.networkSecurityGroups.members.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -361,7 +395,7 @@ func (a *Client) V1NetworkSecurityGroupsMembersDelete(params *V1NetworkSecurityG V1NetworkSecurityGroupsMembersPost adds a member to a network security group */ func (a *Client) V1NetworkSecurityGroupsMembersPost(params *V1NetworkSecurityGroupsMembersPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkSecurityGroupsMembersPostOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1NetworkSecurityGroupsMembersPostParams() } @@ -381,17 +415,22 @@ func (a *Client) V1NetworkSecurityGroupsMembersPost(params *V1NetworkSecurityGro for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1NetworkSecurityGroupsMembersPostOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.networkSecurityGroups.members.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -400,7 +439,7 @@ func (a *Client) V1NetworkSecurityGroupsMembersPost(params *V1NetworkSecurityGro V1NetworkSecurityGroupsMoveMemberPost moves a network security group member to another network security group */ func (a *Client) V1NetworkSecurityGroupsMoveMemberPost(params *V1NetworkSecurityGroupsMoveMemberPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkSecurityGroupsMoveMemberPostOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1NetworkSecurityGroupsMoveMemberPostParams() } @@ -420,17 +459,22 @@ func (a *Client) V1NetworkSecurityGroupsMoveMemberPost(params *V1NetworkSecurity for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1NetworkSecurityGroupsMoveMemberPostOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.networkSecurityGroups.move_member.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -439,7 +483,7 @@ func (a *Client) V1NetworkSecurityGroupsMoveMemberPost(params *V1NetworkSecurity V1NetworkSecurityGroupsPost creates a new network security group */ func (a *Client) V1NetworkSecurityGroupsPost(params *V1NetworkSecurityGroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkSecurityGroupsPostOK, *V1NetworkSecurityGroupsPostCreated, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1NetworkSecurityGroupsPostParams() } @@ -459,18 +503,22 @@ func (a *Client) V1NetworkSecurityGroupsPost(params *V1NetworkSecurityGroupsPost for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } + + // several success responses have to be checked switch value := result.(type) { case *V1NetworkSecurityGroupsPostOK: return value, nil, nil case *V1NetworkSecurityGroupsPostCreated: return nil, value, nil } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for network_security_groups: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -479,7 +527,7 @@ func (a *Client) V1NetworkSecurityGroupsPost(params *V1NetworkSecurityGroupsPost V1NetworkSecurityGroupsRulesDelete deletes the rule from a network security group */ func (a *Client) V1NetworkSecurityGroupsRulesDelete(params *V1NetworkSecurityGroupsRulesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkSecurityGroupsRulesDeleteOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1NetworkSecurityGroupsRulesDeleteParams() } @@ -499,17 +547,22 @@ func (a *Client) V1NetworkSecurityGroupsRulesDelete(params *V1NetworkSecurityGro for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1NetworkSecurityGroupsRulesDeleteOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.networkSecurityGroups.rules.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -518,7 +571,7 @@ func (a *Client) V1NetworkSecurityGroupsRulesDelete(params *V1NetworkSecurityGro V1NetworkSecurityGroupsRulesPost adds a rule to a network security group */ func (a *Client) V1NetworkSecurityGroupsRulesPost(params *V1NetworkSecurityGroupsRulesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworkSecurityGroupsRulesPostOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1NetworkSecurityGroupsRulesPostParams() } @@ -538,17 +591,22 @@ func (a *Client) V1NetworkSecurityGroupsRulesPost(params *V1NetworkSecurityGroup for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1NetworkSecurityGroupsRulesPostOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.networkSecurityGroups.rules.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_action_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_action_post_responses.go index b1536f9f528..01b6afa27a5 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_action_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_action_post_responses.go @@ -7,6 +7,7 @@ package network_security_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1NetworkSecurityGroupsActionPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1NetworkSecurityGroupsActionPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1NetworkSecurityGroupsActionPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1NetworkSecurityGroupsActionPostOK() @@ -144,7 +145,7 @@ func (o *V1NetworkSecurityGroupsActionPostOK) GetPayload() models.Object { func (o *V1NetworkSecurityGroupsActionPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -212,7 +213,7 @@ func (o *V1NetworkSecurityGroupsActionPostAccepted) GetPayload() models.Object { func (o *V1NetworkSecurityGroupsActionPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -282,7 +283,7 @@ func (o *V1NetworkSecurityGroupsActionPostBadRequest) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -352,7 +353,7 @@ func (o *V1NetworkSecurityGroupsActionPostUnauthorized) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -422,7 +423,7 @@ func (o *V1NetworkSecurityGroupsActionPostForbidden) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -492,7 +493,7 @@ func (o *V1NetworkSecurityGroupsActionPostNotFound) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -562,7 +563,7 @@ func (o *V1NetworkSecurityGroupsActionPostConflict) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -632,7 +633,7 @@ func (o *V1NetworkSecurityGroupsActionPostInternalServerError) readResponse(resp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -702,7 +703,7 @@ func (o *V1NetworkSecurityGroupsActionPostStatus550) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_id_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_id_delete_responses.go index dcffcfb4ebc..e3d1e201e82 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_id_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_id_delete_responses.go @@ -7,6 +7,7 @@ package network_security_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1NetworkSecurityGroupsIDDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1NetworkSecurityGroupsIDDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1NetworkSecurityGroupsIDDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1NetworkSecurityGroupsIDDeleteOK() @@ -132,7 +133,7 @@ func (o *V1NetworkSecurityGroupsIDDeleteOK) GetPayload() models.Object { func (o *V1NetworkSecurityGroupsIDDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -202,7 +203,7 @@ func (o *V1NetworkSecurityGroupsIDDeleteBadRequest) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -272,7 +273,7 @@ func (o *V1NetworkSecurityGroupsIDDeleteUnauthorized) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -342,7 +343,7 @@ func (o *V1NetworkSecurityGroupsIDDeleteForbidden) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -412,7 +413,7 @@ func (o *V1NetworkSecurityGroupsIDDeleteNotFound) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -482,7 +483,7 @@ func (o *V1NetworkSecurityGroupsIDDeleteConflict) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -552,7 +553,7 @@ func (o *V1NetworkSecurityGroupsIDDeleteInternalServerError) readResponse(respon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_id_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_id_get_responses.go index 9f2baad3bf1..76e92f2fc00 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_id_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_id_get_responses.go @@ -7,6 +7,7 @@ package network_security_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1NetworkSecurityGroupsIDGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1NetworkSecurityGroupsIDGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1NetworkSecurityGroupsIDGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1NetworkSecurityGroupsIDGetOK() @@ -128,7 +129,7 @@ func (o *V1NetworkSecurityGroupsIDGetOK) readResponse(response runtime.ClientRes o.Payload = new(models.NetworkSecurityGroup) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *V1NetworkSecurityGroupsIDGetBadRequest) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *V1NetworkSecurityGroupsIDGetUnauthorized) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *V1NetworkSecurityGroupsIDGetForbidden) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *V1NetworkSecurityGroupsIDGetNotFound) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *V1NetworkSecurityGroupsIDGetInternalServerError) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_id_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_id_post_responses.go index d14611bc488..09c6011fbbf 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_id_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_id_post_responses.go @@ -7,6 +7,7 @@ package network_security_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1NetworkSecurityGroupsIDPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1NetworkSecurityGroupsIDPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1NetworkSecurityGroupsIDPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 201: result := NewV1NetworkSecurityGroupsIDPostCreated() @@ -128,7 +129,7 @@ func (o *V1NetworkSecurityGroupsIDPostCreated) readResponse(response runtime.Cli o.Payload = new(models.NetworkSecurityGroup) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *V1NetworkSecurityGroupsIDPostBadRequest) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *V1NetworkSecurityGroupsIDPostUnauthorized) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *V1NetworkSecurityGroupsIDPostForbidden) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *V1NetworkSecurityGroupsIDPostNotFound) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *V1NetworkSecurityGroupsIDPostInternalServerError) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_id_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_id_put_responses.go index 2910a39577f..6e7529db627 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_id_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_id_put_responses.go @@ -7,6 +7,7 @@ package network_security_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1NetworkSecurityGroupsIDPutReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1NetworkSecurityGroupsIDPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1NetworkSecurityGroupsIDPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1NetworkSecurityGroupsIDPutOK() @@ -128,7 +129,7 @@ func (o *V1NetworkSecurityGroupsIDPutOK) readResponse(response runtime.ClientRes o.Payload = new(models.NetworkSecurityGroup) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *V1NetworkSecurityGroupsIDPutBadRequest) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *V1NetworkSecurityGroupsIDPutUnauthorized) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *V1NetworkSecurityGroupsIDPutForbidden) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *V1NetworkSecurityGroupsIDPutNotFound) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *V1NetworkSecurityGroupsIDPutInternalServerError) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_list_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_list_responses.go index 4b71837df3b..29cacf1f99d 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_list_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_list_responses.go @@ -7,6 +7,7 @@ package network_security_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1NetworkSecurityGroupsListReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1NetworkSecurityGroupsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1NetworkSecurityGroupsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1NetworkSecurityGroupsListOK() @@ -128,7 +129,7 @@ func (o *V1NetworkSecurityGroupsListOK) readResponse(response runtime.ClientResp o.Payload = new(models.NetworkSecurityGroups) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *V1NetworkSecurityGroupsListBadRequest) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *V1NetworkSecurityGroupsListUnauthorized) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *V1NetworkSecurityGroupsListForbidden) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *V1NetworkSecurityGroupsListNotFound) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *V1NetworkSecurityGroupsListInternalServerError) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_members_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_members_delete_responses.go index da71f1b2d93..a82c0c35be7 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_members_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_members_delete_responses.go @@ -7,6 +7,7 @@ package network_security_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1NetworkSecurityGroupsMembersDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1NetworkSecurityGroupsMembersDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1NetworkSecurityGroupsMembersDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1NetworkSecurityGroupsMembersDeleteOK() @@ -132,7 +133,7 @@ func (o *V1NetworkSecurityGroupsMembersDeleteOK) GetPayload() models.Object { func (o *V1NetworkSecurityGroupsMembersDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -202,7 +203,7 @@ func (o *V1NetworkSecurityGroupsMembersDeleteBadRequest) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -272,7 +273,7 @@ func (o *V1NetworkSecurityGroupsMembersDeleteUnauthorized) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -342,7 +343,7 @@ func (o *V1NetworkSecurityGroupsMembersDeleteForbidden) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -412,7 +413,7 @@ func (o *V1NetworkSecurityGroupsMembersDeleteNotFound) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -482,7 +483,7 @@ func (o *V1NetworkSecurityGroupsMembersDeleteConflict) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -552,7 +553,7 @@ func (o *V1NetworkSecurityGroupsMembersDeleteInternalServerError) readResponse(r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_members_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_members_post_responses.go index c273addc1f1..b1139afd366 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_members_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_members_post_responses.go @@ -7,6 +7,7 @@ package network_security_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1NetworkSecurityGroupsMembersPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1NetworkSecurityGroupsMembersPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1NetworkSecurityGroupsMembersPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1NetworkSecurityGroupsMembersPostOK() @@ -140,7 +141,7 @@ func (o *V1NetworkSecurityGroupsMembersPostOK) readResponse(response runtime.Cli o.Payload = new(models.NetworkSecurityGroupMember) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -210,7 +211,7 @@ func (o *V1NetworkSecurityGroupsMembersPostBadRequest) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -280,7 +281,7 @@ func (o *V1NetworkSecurityGroupsMembersPostUnauthorized) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -350,7 +351,7 @@ func (o *V1NetworkSecurityGroupsMembersPostForbidden) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -420,7 +421,7 @@ func (o *V1NetworkSecurityGroupsMembersPostNotFound) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -490,7 +491,7 @@ func (o *V1NetworkSecurityGroupsMembersPostConflict) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -560,7 +561,7 @@ func (o *V1NetworkSecurityGroupsMembersPostUnprocessableEntity) readResponse(res o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -630,7 +631,7 @@ func (o *V1NetworkSecurityGroupsMembersPostInternalServerError) readResponse(res o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_move_member_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_move_member_post_responses.go index 4efd573de7c..c79cba32591 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_move_member_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_move_member_post_responses.go @@ -7,6 +7,7 @@ package network_security_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1NetworkSecurityGroupsMoveMemberPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1NetworkSecurityGroupsMoveMemberPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1NetworkSecurityGroupsMoveMemberPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1NetworkSecurityGroupsMoveMemberPostOK() @@ -128,7 +129,7 @@ func (o *V1NetworkSecurityGroupsMoveMemberPostOK) readResponse(response runtime. o.Payload = new(models.NetworkSecurityGroupMember) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *V1NetworkSecurityGroupsMoveMemberPostBadRequest) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *V1NetworkSecurityGroupsMoveMemberPostUnauthorized) readResponse(respons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *V1NetworkSecurityGroupsMoveMemberPostForbidden) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *V1NetworkSecurityGroupsMoveMemberPostNotFound) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *V1NetworkSecurityGroupsMoveMemberPostInternalServerError) readResponse( o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_post_responses.go index a384c457b01..6154fca69b3 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_post_responses.go @@ -7,6 +7,7 @@ package network_security_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1NetworkSecurityGroupsPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1NetworkSecurityGroupsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1NetworkSecurityGroupsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1NetworkSecurityGroupsPostOK() @@ -146,7 +147,7 @@ func (o *V1NetworkSecurityGroupsPostOK) readResponse(response runtime.ClientResp o.Payload = new(models.NetworkSecurityGroup) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -216,7 +217,7 @@ func (o *V1NetworkSecurityGroupsPostCreated) readResponse(response runtime.Clien o.Payload = new(models.NetworkSecurityGroup) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -286,7 +287,7 @@ func (o *V1NetworkSecurityGroupsPostBadRequest) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -356,7 +357,7 @@ func (o *V1NetworkSecurityGroupsPostUnauthorized) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -426,7 +427,7 @@ func (o *V1NetworkSecurityGroupsPostForbidden) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -496,7 +497,7 @@ func (o *V1NetworkSecurityGroupsPostNotFound) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -566,7 +567,7 @@ func (o *V1NetworkSecurityGroupsPostConflict) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -636,7 +637,7 @@ func (o *V1NetworkSecurityGroupsPostUnprocessableEntity) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -706,7 +707,7 @@ func (o *V1NetworkSecurityGroupsPostInternalServerError) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_rules_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_rules_delete_responses.go index e318eb64bc8..f48102a1fed 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_rules_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_rules_delete_responses.go @@ -7,6 +7,7 @@ package network_security_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1NetworkSecurityGroupsRulesDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1NetworkSecurityGroupsRulesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1NetworkSecurityGroupsRulesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1NetworkSecurityGroupsRulesDeleteOK() @@ -132,7 +133,7 @@ func (o *V1NetworkSecurityGroupsRulesDeleteOK) GetPayload() models.Object { func (o *V1NetworkSecurityGroupsRulesDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -202,7 +203,7 @@ func (o *V1NetworkSecurityGroupsRulesDeleteBadRequest) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -272,7 +273,7 @@ func (o *V1NetworkSecurityGroupsRulesDeleteUnauthorized) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -342,7 +343,7 @@ func (o *V1NetworkSecurityGroupsRulesDeleteForbidden) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -412,7 +413,7 @@ func (o *V1NetworkSecurityGroupsRulesDeleteNotFound) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -482,7 +483,7 @@ func (o *V1NetworkSecurityGroupsRulesDeleteConflict) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -552,7 +553,7 @@ func (o *V1NetworkSecurityGroupsRulesDeleteInternalServerError) readResponse(res o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_rules_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_rules_post_responses.go index 5d519da4c9c..1fbc17a8bec 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_rules_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/network_security_groups/v1_network_security_groups_rules_post_responses.go @@ -7,6 +7,7 @@ package network_security_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1NetworkSecurityGroupsRulesPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1NetworkSecurityGroupsRulesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1NetworkSecurityGroupsRulesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1NetworkSecurityGroupsRulesPostOK() @@ -140,7 +141,7 @@ func (o *V1NetworkSecurityGroupsRulesPostOK) readResponse(response runtime.Clien o.Payload = new(models.NetworkSecurityGroupRule) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -210,7 +211,7 @@ func (o *V1NetworkSecurityGroupsRulesPostBadRequest) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -280,7 +281,7 @@ func (o *V1NetworkSecurityGroupsRulesPostUnauthorized) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -350,7 +351,7 @@ func (o *V1NetworkSecurityGroupsRulesPostForbidden) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -420,7 +421,7 @@ func (o *V1NetworkSecurityGroupsRulesPostNotFound) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -490,7 +491,7 @@ func (o *V1NetworkSecurityGroupsRulesPostConflict) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -560,7 +561,7 @@ func (o *V1NetworkSecurityGroupsRulesPostUnprocessableEntity) readResponse(respo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -630,7 +631,7 @@ func (o *V1NetworkSecurityGroupsRulesPostInternalServerError) readResponse(respo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/networks/networks_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/networks/networks_client.go index 3358bc960c9..b1291ca1f8c 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/networks/networks_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/networks/networks_client.go @@ -73,7 +73,7 @@ type ClientService interface { V1NetworksNetworkInterfacesDelete deletes a network interface */ func (a *Client) V1NetworksNetworkInterfacesDelete(params *V1NetworksNetworkInterfacesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworksNetworkInterfacesDeleteOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1NetworksNetworkInterfacesDeleteParams() } @@ -93,17 +93,22 @@ func (a *Client) V1NetworksNetworkInterfacesDelete(params *V1NetworksNetworkInte for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1NetworksNetworkInterfacesDeleteOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.networks.network-interfaces.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -112,7 +117,7 @@ func (a *Client) V1NetworksNetworkInterfacesDelete(params *V1NetworksNetworkInte V1NetworksNetworkInterfacesGet gets a network interface s information */ func (a *Client) V1NetworksNetworkInterfacesGet(params *V1NetworksNetworkInterfacesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworksNetworkInterfacesGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1NetworksNetworkInterfacesGetParams() } @@ -132,17 +137,22 @@ func (a *Client) V1NetworksNetworkInterfacesGet(params *V1NetworksNetworkInterfa for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1NetworksNetworkInterfacesGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.networks.network-interfaces.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -151,7 +161,7 @@ func (a *Client) V1NetworksNetworkInterfacesGet(params *V1NetworksNetworkInterfa V1NetworksNetworkInterfacesGetall gets all network interfaces for this network */ func (a *Client) V1NetworksNetworkInterfacesGetall(params *V1NetworksNetworkInterfacesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworksNetworkInterfacesGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1NetworksNetworkInterfacesGetallParams() } @@ -171,26 +181,31 @@ func (a *Client) V1NetworksNetworkInterfacesGetall(params *V1NetworksNetworkInte for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1NetworksNetworkInterfacesGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.networks.network-interfaces.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -V1NetworksNetworkInterfacesPost performs network interface addition deletion and listing +V1NetworksNetworkInterfacesPost creates a network interface */ func (a *Client) V1NetworksNetworkInterfacesPost(params *V1NetworksNetworkInterfacesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworksNetworkInterfacesPostCreated, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1NetworksNetworkInterfacesPostParams() } @@ -210,17 +225,22 @@ func (a *Client) V1NetworksNetworkInterfacesPost(params *V1NetworksNetworkInterf for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1NetworksNetworkInterfacesPostCreated) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.networks.network-interfaces.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -229,7 +249,7 @@ func (a *Client) V1NetworksNetworkInterfacesPost(params *V1NetworksNetworkInterf V1NetworksNetworkInterfacesPut updates a network interface s information */ func (a *Client) V1NetworksNetworkInterfacesPut(params *V1NetworksNetworkInterfacesPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1NetworksNetworkInterfacesPutOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1NetworksNetworkInterfacesPutParams() } @@ -249,17 +269,22 @@ func (a *Client) V1NetworksNetworkInterfacesPut(params *V1NetworksNetworkInterfa for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1NetworksNetworkInterfacesPutOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.networks.network-interfaces.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/networks/v1_networks_network_interfaces_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/networks/v1_networks_network_interfaces_delete_responses.go index 8c525d4a35a..0ab2e7fba48 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/networks/v1_networks_network_interfaces_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/networks/v1_networks_network_interfaces_delete_responses.go @@ -7,6 +7,7 @@ package networks import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1NetworksNetworkInterfacesDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1NetworksNetworkInterfacesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1NetworksNetworkInterfacesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1NetworksNetworkInterfacesDeleteOK() @@ -132,7 +133,7 @@ func (o *V1NetworksNetworkInterfacesDeleteOK) GetPayload() models.Object { func (o *V1NetworksNetworkInterfacesDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -202,7 +203,7 @@ func (o *V1NetworksNetworkInterfacesDeleteBadRequest) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -272,7 +273,7 @@ func (o *V1NetworksNetworkInterfacesDeleteUnauthorized) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -342,7 +343,7 @@ func (o *V1NetworksNetworkInterfacesDeleteForbidden) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -412,7 +413,7 @@ func (o *V1NetworksNetworkInterfacesDeleteNotFound) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -482,7 +483,7 @@ func (o *V1NetworksNetworkInterfacesDeleteGone) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -552,7 +553,7 @@ func (o *V1NetworksNetworkInterfacesDeleteInternalServerError) readResponse(resp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/networks/v1_networks_network_interfaces_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/networks/v1_networks_network_interfaces_get_responses.go index 8efe1ce3e69..9c9a16c523d 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/networks/v1_networks_network_interfaces_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/networks/v1_networks_network_interfaces_get_responses.go @@ -7,6 +7,7 @@ package networks import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1NetworksNetworkInterfacesGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1NetworksNetworkInterfacesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1NetworksNetworkInterfacesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1NetworksNetworkInterfacesGetOK() @@ -128,7 +129,7 @@ func (o *V1NetworksNetworkInterfacesGetOK) readResponse(response runtime.ClientR o.Payload = new(models.NetworkInterface) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *V1NetworksNetworkInterfacesGetBadRequest) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *V1NetworksNetworkInterfacesGetUnauthorized) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *V1NetworksNetworkInterfacesGetForbidden) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *V1NetworksNetworkInterfacesGetNotFound) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *V1NetworksNetworkInterfacesGetInternalServerError) readResponse(respons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/networks/v1_networks_network_interfaces_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/networks/v1_networks_network_interfaces_getall_responses.go index 753cc0a92fb..0140c776b4b 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/networks/v1_networks_network_interfaces_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/networks/v1_networks_network_interfaces_getall_responses.go @@ -7,6 +7,7 @@ package networks import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1NetworksNetworkInterfacesGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1NetworksNetworkInterfacesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1NetworksNetworkInterfacesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1NetworksNetworkInterfacesGetallOK() @@ -128,7 +129,7 @@ func (o *V1NetworksNetworkInterfacesGetallOK) readResponse(response runtime.Clie o.Payload = new(models.NetworkInterfaces) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *V1NetworksNetworkInterfacesGetallBadRequest) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *V1NetworksNetworkInterfacesGetallUnauthorized) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *V1NetworksNetworkInterfacesGetallForbidden) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *V1NetworksNetworkInterfacesGetallNotFound) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *V1NetworksNetworkInterfacesGetallInternalServerError) readResponse(resp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/networks/v1_networks_network_interfaces_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/networks/v1_networks_network_interfaces_post_responses.go index c071669ccc2..79822a42c9c 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/networks/v1_networks_network_interfaces_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/networks/v1_networks_network_interfaces_post_responses.go @@ -7,6 +7,7 @@ package networks import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1NetworksNetworkInterfacesPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1NetworksNetworkInterfacesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1NetworksNetworkInterfacesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 201: result := NewV1NetworksNetworkInterfacesPostCreated() @@ -140,7 +141,7 @@ func (o *V1NetworksNetworkInterfacesPostCreated) readResponse(response runtime.C o.Payload = new(models.NetworkInterface) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -210,7 +211,7 @@ func (o *V1NetworksNetworkInterfacesPostBadRequest) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -280,7 +281,7 @@ func (o *V1NetworksNetworkInterfacesPostUnauthorized) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -350,7 +351,7 @@ func (o *V1NetworksNetworkInterfacesPostForbidden) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -420,7 +421,7 @@ func (o *V1NetworksNetworkInterfacesPostNotFound) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -490,7 +491,7 @@ func (o *V1NetworksNetworkInterfacesPostConflict) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -560,7 +561,7 @@ func (o *V1NetworksNetworkInterfacesPostUnprocessableEntity) readResponse(respon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -630,7 +631,7 @@ func (o *V1NetworksNetworkInterfacesPostInternalServerError) readResponse(respon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/networks/v1_networks_network_interfaces_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/networks/v1_networks_network_interfaces_put_responses.go index 818984788f8..55d724fa55a 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/networks/v1_networks_network_interfaces_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/networks/v1_networks_network_interfaces_put_responses.go @@ -7,6 +7,7 @@ package networks import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1NetworksNetworkInterfacesPutReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1NetworksNetworkInterfacesPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1NetworksNetworkInterfacesPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1NetworksNetworkInterfacesPutOK() @@ -134,7 +135,7 @@ func (o *V1NetworksNetworkInterfacesPutOK) readResponse(response runtime.ClientR o.Payload = new(models.NetworkInterface) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *V1NetworksNetworkInterfacesPutBadRequest) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *V1NetworksNetworkInterfacesPutUnauthorized) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *V1NetworksNetworkInterfacesPutForbidden) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *V1NetworksNetworkInterfacesPutNotFound) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *V1NetworksNetworkInterfacesPutUnprocessableEntity) readResponse(respons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *V1NetworksNetworkInterfacesPutInternalServerError) readResponse(respons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/open_stacks_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/open_stacks_client.go index 2d2f3f66d0c..96e612046fd 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/open_stacks_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/open_stacks_client.go @@ -73,7 +73,7 @@ type ClientService interface { ServiceBrokerOpenstacksGet lists all open stack instances being managed */ func (a *Client) ServiceBrokerOpenstacksGet(params *ServiceBrokerOpenstacksGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerOpenstacksGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewServiceBrokerOpenstacksGetParams() } @@ -93,17 +93,22 @@ func (a *Client) ServiceBrokerOpenstacksGet(params *ServiceBrokerOpenstacksGetPa for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*ServiceBrokerOpenstacksGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for serviceBroker.openstacks.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -112,7 +117,7 @@ func (a *Client) ServiceBrokerOpenstacksGet(params *ServiceBrokerOpenstacksGetPa ServiceBrokerOpenstacksHostsGet lists account information for all pvm instances on hostname */ func (a *Client) ServiceBrokerOpenstacksHostsGet(params *ServiceBrokerOpenstacksHostsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerOpenstacksHostsGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewServiceBrokerOpenstacksHostsGetParams() } @@ -132,17 +137,22 @@ func (a *Client) ServiceBrokerOpenstacksHostsGet(params *ServiceBrokerOpenstacks for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*ServiceBrokerOpenstacksHostsGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for serviceBroker.openstacks.hosts.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -151,7 +161,7 @@ func (a *Client) ServiceBrokerOpenstacksHostsGet(params *ServiceBrokerOpenstacks ServiceBrokerOpenstacksOpenstackGet lists account information for all pvm instances on hostname */ func (a *Client) ServiceBrokerOpenstacksOpenstackGet(params *ServiceBrokerOpenstacksOpenstackGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerOpenstacksOpenstackGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewServiceBrokerOpenstacksOpenstackGetParams() } @@ -171,17 +181,22 @@ func (a *Client) ServiceBrokerOpenstacksOpenstackGet(params *ServiceBrokerOpenst for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*ServiceBrokerOpenstacksOpenstackGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for serviceBroker.openstacks.openstack.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -190,7 +205,7 @@ func (a *Client) ServiceBrokerOpenstacksOpenstackGet(params *ServiceBrokerOpenst ServiceBrokerOpenstacksPost creates a new open stack instance to be managed */ func (a *Client) ServiceBrokerOpenstacksPost(params *ServiceBrokerOpenstacksPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerOpenstacksPostOK, *ServiceBrokerOpenstacksPostCreated, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewServiceBrokerOpenstacksPostParams() } @@ -210,18 +225,22 @@ func (a *Client) ServiceBrokerOpenstacksPost(params *ServiceBrokerOpenstacksPost for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } + + // several success responses have to be checked switch value := result.(type) { case *ServiceBrokerOpenstacksPostOK: return value, nil, nil case *ServiceBrokerOpenstacksPostCreated: return nil, value, nil } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for open_stacks: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -230,7 +249,7 @@ func (a *Client) ServiceBrokerOpenstacksPost(params *ServiceBrokerOpenstacksPost ServiceBrokerOpenstacksServersGet lists account information for a pvm instance */ func (a *Client) ServiceBrokerOpenstacksServersGet(params *ServiceBrokerOpenstacksServersGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBrokerOpenstacksServersGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewServiceBrokerOpenstacksServersGetParams() } @@ -250,17 +269,22 @@ func (a *Client) ServiceBrokerOpenstacksServersGet(params *ServiceBrokerOpenstac for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*ServiceBrokerOpenstacksServersGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for serviceBroker.openstacks.servers.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_get_responses.go index f60ec26e36b..2752eddee9d 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_get_responses.go @@ -7,6 +7,7 @@ package open_stacks import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type ServiceBrokerOpenstacksGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *ServiceBrokerOpenstacksGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ServiceBrokerOpenstacksGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewServiceBrokerOpenstacksGetOK() @@ -128,7 +129,7 @@ func (o *ServiceBrokerOpenstacksGetOK) readResponse(response runtime.ClientRespo o.Payload = new(models.OpenStacks) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *ServiceBrokerOpenstacksGetBadRequest) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *ServiceBrokerOpenstacksGetUnauthorized) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *ServiceBrokerOpenstacksGetForbidden) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *ServiceBrokerOpenstacksGetNotFound) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *ServiceBrokerOpenstacksGetInternalServerError) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_hosts_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_hosts_get_responses.go index fa1ef4d3edd..468da71dc11 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_hosts_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_hosts_get_responses.go @@ -7,6 +7,7 @@ package open_stacks import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type ServiceBrokerOpenstacksHostsGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *ServiceBrokerOpenstacksHostsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ServiceBrokerOpenstacksHostsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewServiceBrokerOpenstacksHostsGetOK() @@ -116,7 +117,7 @@ func (o *ServiceBrokerOpenstacksHostsGetOK) readResponse(response runtime.Client o.Payload = new(models.HostInfo) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -186,7 +187,7 @@ func (o *ServiceBrokerOpenstacksHostsGetBadRequest) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -256,7 +257,7 @@ func (o *ServiceBrokerOpenstacksHostsGetNotFound) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -326,7 +327,7 @@ func (o *ServiceBrokerOpenstacksHostsGetInternalServerError) readResponse(respon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_openstack_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_openstack_get_responses.go index 1586beb542f..0aa97f3c051 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_openstack_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_openstack_get_responses.go @@ -7,6 +7,7 @@ package open_stacks import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type ServiceBrokerOpenstacksOpenstackGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *ServiceBrokerOpenstacksOpenstackGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ServiceBrokerOpenstacksOpenstackGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewServiceBrokerOpenstacksOpenstackGetOK() @@ -128,7 +129,7 @@ func (o *ServiceBrokerOpenstacksOpenstackGetOK) readResponse(response runtime.Cl o.Payload = new(models.OpenStackInfo) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *ServiceBrokerOpenstacksOpenstackGetBadRequest) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *ServiceBrokerOpenstacksOpenstackGetUnauthorized) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *ServiceBrokerOpenstacksOpenstackGetForbidden) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *ServiceBrokerOpenstacksOpenstackGetNotFound) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *ServiceBrokerOpenstacksOpenstackGetInternalServerError) readResponse(re o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_post_responses.go index 5ad6d9ead1b..f7d8c51fdc2 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_post_responses.go @@ -7,6 +7,7 @@ package open_stacks import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type ServiceBrokerOpenstacksPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *ServiceBrokerOpenstacksPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ServiceBrokerOpenstacksPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewServiceBrokerOpenstacksPostOK() @@ -146,7 +147,7 @@ func (o *ServiceBrokerOpenstacksPostOK) readResponse(response runtime.ClientResp o.Payload = new(models.OpenStack) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -216,7 +217,7 @@ func (o *ServiceBrokerOpenstacksPostCreated) readResponse(response runtime.Clien o.Payload = new(models.OpenStack) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -286,7 +287,7 @@ func (o *ServiceBrokerOpenstacksPostBadRequest) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -356,7 +357,7 @@ func (o *ServiceBrokerOpenstacksPostUnauthorized) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -426,7 +427,7 @@ func (o *ServiceBrokerOpenstacksPostForbidden) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -496,7 +497,7 @@ func (o *ServiceBrokerOpenstacksPostNotFound) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -566,7 +567,7 @@ func (o *ServiceBrokerOpenstacksPostConflict) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -636,7 +637,7 @@ func (o *ServiceBrokerOpenstacksPostUnprocessableEntity) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -706,7 +707,7 @@ func (o *ServiceBrokerOpenstacksPostInternalServerError) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_servers_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_servers_get_responses.go index 46465a5de58..ea38fd04901 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_servers_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/open_stacks/service_broker_openstacks_servers_get_responses.go @@ -7,6 +7,7 @@ package open_stacks import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type ServiceBrokerOpenstacksServersGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *ServiceBrokerOpenstacksServersGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ServiceBrokerOpenstacksServersGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewServiceBrokerOpenstacksServersGetOK() @@ -128,7 +129,7 @@ func (o *ServiceBrokerOpenstacksServersGetOK) readResponse(response runtime.Clie o.Payload = new(models.HostPVMInstance) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *ServiceBrokerOpenstacksServersGetBadRequest) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *ServiceBrokerOpenstacksServersGetUnauthorized) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *ServiceBrokerOpenstacksServersGetForbidden) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *ServiceBrokerOpenstacksServersGetNotFound) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *ServiceBrokerOpenstacksServersGetInternalServerError) readResponse(resp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/p_cloud_cloud_connections_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/p_cloud_cloud_connections_client.go index d89d215e1ed..278dc5f7661 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/p_cloud_cloud_connections_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/p_cloud_cloud_connections_client.go @@ -79,7 +79,7 @@ type ClientService interface { PcloudCloudconnectionsDelete deletes a cloud connection */ func (a *Client) PcloudCloudconnectionsDelete(params *PcloudCloudconnectionsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsDeleteOK, *PcloudCloudconnectionsDeleteAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudCloudconnectionsDeleteParams() } @@ -99,18 +99,22 @@ func (a *Client) PcloudCloudconnectionsDelete(params *PcloudCloudconnectionsDele for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } + + // several success responses have to be checked switch value := result.(type) { case *PcloudCloudconnectionsDeleteOK: return value, nil, nil case *PcloudCloudconnectionsDeleteAccepted: return nil, value, nil } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for p_cloud_cloud_connections: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -119,7 +123,7 @@ func (a *Client) PcloudCloudconnectionsDelete(params *PcloudCloudconnectionsDele PcloudCloudconnectionsGet gets a cloud connection s state information */ func (a *Client) PcloudCloudconnectionsGet(params *PcloudCloudconnectionsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudCloudconnectionsGetParams() } @@ -139,17 +143,22 @@ func (a *Client) PcloudCloudconnectionsGet(params *PcloudCloudconnectionsGetPara for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudCloudconnectionsGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.cloudconnections.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -158,7 +167,7 @@ func (a *Client) PcloudCloudconnectionsGet(params *PcloudCloudconnectionsGetPara PcloudCloudconnectionsGetall gets all cloud connections in this cloud instance */ func (a *Client) PcloudCloudconnectionsGetall(params *PcloudCloudconnectionsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudCloudconnectionsGetallParams() } @@ -178,17 +187,22 @@ func (a *Client) PcloudCloudconnectionsGetall(params *PcloudCloudconnectionsGeta for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudCloudconnectionsGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.cloudconnections.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -197,7 +211,7 @@ func (a *Client) PcloudCloudconnectionsGetall(params *PcloudCloudconnectionsGeta PcloudCloudconnectionsNetworksDelete detaches a network from a cloud connection */ func (a *Client) PcloudCloudconnectionsNetworksDelete(params *PcloudCloudconnectionsNetworksDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsNetworksDeleteOK, *PcloudCloudconnectionsNetworksDeleteAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudCloudconnectionsNetworksDeleteParams() } @@ -217,18 +231,22 @@ func (a *Client) PcloudCloudconnectionsNetworksDelete(params *PcloudCloudconnect for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } + + // several success responses have to be checked switch value := result.(type) { case *PcloudCloudconnectionsNetworksDeleteOK: return value, nil, nil case *PcloudCloudconnectionsNetworksDeleteAccepted: return nil, value, nil } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for p_cloud_cloud_connections: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -237,7 +255,7 @@ func (a *Client) PcloudCloudconnectionsNetworksDelete(params *PcloudCloudconnect PcloudCloudconnectionsNetworksPut attaches a network to the cloud connection */ func (a *Client) PcloudCloudconnectionsNetworksPut(params *PcloudCloudconnectionsNetworksPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsNetworksPutOK, *PcloudCloudconnectionsNetworksPutAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudCloudconnectionsNetworksPutParams() } @@ -257,18 +275,22 @@ func (a *Client) PcloudCloudconnectionsNetworksPut(params *PcloudCloudconnection for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } + + // several success responses have to be checked switch value := result.(type) { case *PcloudCloudconnectionsNetworksPutOK: return value, nil, nil case *PcloudCloudconnectionsNetworksPutAccepted: return nil, value, nil } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for p_cloud_cloud_connections: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -277,7 +299,7 @@ func (a *Client) PcloudCloudconnectionsNetworksPut(params *PcloudCloudconnection PcloudCloudconnectionsPost creates a new cloud connection */ func (a *Client) PcloudCloudconnectionsPost(params *PcloudCloudconnectionsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsPostOK, *PcloudCloudconnectionsPostCreated, *PcloudCloudconnectionsPostAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudCloudconnectionsPostParams() } @@ -297,11 +319,12 @@ func (a *Client) PcloudCloudconnectionsPost(params *PcloudCloudconnectionsPostPa for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, nil, nil, err } + + // several success responses have to be checked switch value := result.(type) { case *PcloudCloudconnectionsPostOK: return value, nil, nil, nil @@ -310,7 +333,10 @@ func (a *Client) PcloudCloudconnectionsPost(params *PcloudCloudconnectionsPostPa case *PcloudCloudconnectionsPostAccepted: return nil, nil, value, nil } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for p_cloud_cloud_connections: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -319,7 +345,7 @@ func (a *Client) PcloudCloudconnectionsPost(params *PcloudCloudconnectionsPostPa PcloudCloudconnectionsPut updates a cloud connection */ func (a *Client) PcloudCloudconnectionsPut(params *PcloudCloudconnectionsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsPutOK, *PcloudCloudconnectionsPutAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudCloudconnectionsPutParams() } @@ -339,18 +365,22 @@ func (a *Client) PcloudCloudconnectionsPut(params *PcloudCloudconnectionsPutPara for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } + + // several success responses have to be checked switch value := result.(type) { case *PcloudCloudconnectionsPutOK: return value, nil, nil case *PcloudCloudconnectionsPutAccepted: return nil, value, nil } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for p_cloud_cloud_connections: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -359,7 +389,7 @@ func (a *Client) PcloudCloudconnectionsPut(params *PcloudCloudconnectionsPutPara PcloudCloudconnectionsVirtualprivatecloudsGetall gets all virtual private cloud connections in this cloud instance */ func (a *Client) PcloudCloudconnectionsVirtualprivatecloudsGetall(params *PcloudCloudconnectionsVirtualprivatecloudsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudconnectionsVirtualprivatecloudsGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudCloudconnectionsVirtualprivatecloudsGetallParams() } @@ -379,17 +409,22 @@ func (a *Client) PcloudCloudconnectionsVirtualprivatecloudsGetall(params *Pcloud for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudCloudconnectionsVirtualprivatecloudsGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.cloudconnections.virtualprivateclouds.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_delete_responses.go index bd961338035..399f34eb17a 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_delete_responses.go @@ -7,6 +7,7 @@ package p_cloud_cloud_connections import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudCloudconnectionsDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudCloudconnectionsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudCloudconnectionsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudCloudconnectionsDeleteOK() @@ -144,7 +145,7 @@ func (o *PcloudCloudconnectionsDeleteOK) GetPayload() models.Object { func (o *PcloudCloudconnectionsDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -214,7 +215,7 @@ func (o *PcloudCloudconnectionsDeleteAccepted) readResponse(response runtime.Cli o.Payload = new(models.JobReference) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -284,7 +285,7 @@ func (o *PcloudCloudconnectionsDeleteBadRequest) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -354,7 +355,7 @@ func (o *PcloudCloudconnectionsDeleteUnauthorized) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -424,7 +425,7 @@ func (o *PcloudCloudconnectionsDeleteForbidden) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -494,7 +495,7 @@ func (o *PcloudCloudconnectionsDeleteNotFound) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -564,7 +565,7 @@ func (o *PcloudCloudconnectionsDeleteRequestTimeout) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -634,7 +635,7 @@ func (o *PcloudCloudconnectionsDeleteGone) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -704,7 +705,7 @@ func (o *PcloudCloudconnectionsDeleteInternalServerError) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_get_responses.go index cd751b72b7e..0fd3cdb67fd 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_cloud_connections import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudCloudconnectionsGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudCloudconnectionsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudCloudconnectionsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudCloudconnectionsGetOK() @@ -134,7 +135,7 @@ func (o *PcloudCloudconnectionsGetOK) readResponse(response runtime.ClientRespon o.Payload = new(models.CloudConnection) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *PcloudCloudconnectionsGetBadRequest) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *PcloudCloudconnectionsGetUnauthorized) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *PcloudCloudconnectionsGetForbidden) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *PcloudCloudconnectionsGetNotFound) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *PcloudCloudconnectionsGetRequestTimeout) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *PcloudCloudconnectionsGetInternalServerError) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_getall_responses.go index e28902dd5b3..6cfa8aac509 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_getall_responses.go @@ -7,6 +7,7 @@ package p_cloud_cloud_connections import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudCloudconnectionsGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudCloudconnectionsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudCloudconnectionsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudCloudconnectionsGetallOK() @@ -134,7 +135,7 @@ func (o *PcloudCloudconnectionsGetallOK) readResponse(response runtime.ClientRes o.Payload = new(models.CloudConnections) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *PcloudCloudconnectionsGetallBadRequest) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *PcloudCloudconnectionsGetallUnauthorized) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *PcloudCloudconnectionsGetallForbidden) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *PcloudCloudconnectionsGetallNotFound) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *PcloudCloudconnectionsGetallRequestTimeout) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *PcloudCloudconnectionsGetallInternalServerError) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_delete_responses.go index 1a632f6b3e8..936b0ec6fec 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_delete_responses.go @@ -7,6 +7,7 @@ package p_cloud_cloud_connections import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudCloudconnectionsNetworksDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudCloudconnectionsNetworksDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudCloudconnectionsNetworksDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudCloudconnectionsNetworksDeleteOK() @@ -144,7 +145,7 @@ func (o *PcloudCloudconnectionsNetworksDeleteOK) GetPayload() models.Object { func (o *PcloudCloudconnectionsNetworksDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -214,7 +215,7 @@ func (o *PcloudCloudconnectionsNetworksDeleteAccepted) readResponse(response run o.Payload = new(models.JobReference) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -284,7 +285,7 @@ func (o *PcloudCloudconnectionsNetworksDeleteBadRequest) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -354,7 +355,7 @@ func (o *PcloudCloudconnectionsNetworksDeleteUnauthorized) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -424,7 +425,7 @@ func (o *PcloudCloudconnectionsNetworksDeleteForbidden) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -494,7 +495,7 @@ func (o *PcloudCloudconnectionsNetworksDeleteNotFound) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -564,7 +565,7 @@ func (o *PcloudCloudconnectionsNetworksDeleteRequestTimeout) readResponse(respon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -634,7 +635,7 @@ func (o *PcloudCloudconnectionsNetworksDeleteGone) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -704,7 +705,7 @@ func (o *PcloudCloudconnectionsNetworksDeleteInternalServerError) readResponse(r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_put_responses.go index 7e35af74e1b..c29f7751d24 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_networks_put_responses.go @@ -7,6 +7,7 @@ package p_cloud_cloud_connections import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudCloudconnectionsNetworksPutReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudCloudconnectionsNetworksPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudCloudconnectionsNetworksPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudCloudconnectionsNetworksPutOK() @@ -144,7 +145,7 @@ func (o *PcloudCloudconnectionsNetworksPutOK) GetPayload() models.Object { func (o *PcloudCloudconnectionsNetworksPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -214,7 +215,7 @@ func (o *PcloudCloudconnectionsNetworksPutAccepted) readResponse(response runtim o.Payload = new(models.JobReference) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -284,7 +285,7 @@ func (o *PcloudCloudconnectionsNetworksPutBadRequest) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -354,7 +355,7 @@ func (o *PcloudCloudconnectionsNetworksPutUnauthorized) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -424,7 +425,7 @@ func (o *PcloudCloudconnectionsNetworksPutForbidden) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -494,7 +495,7 @@ func (o *PcloudCloudconnectionsNetworksPutNotFound) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -564,7 +565,7 @@ func (o *PcloudCloudconnectionsNetworksPutRequestTimeout) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -634,7 +635,7 @@ func (o *PcloudCloudconnectionsNetworksPutUnprocessableEntity) readResponse(resp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -704,7 +705,7 @@ func (o *PcloudCloudconnectionsNetworksPutInternalServerError) readResponse(resp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_post_responses.go index edd642b6bb7..19bb749037b 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_cloud_connections import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudCloudconnectionsPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudCloudconnectionsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudCloudconnectionsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudCloudconnectionsPostOK() @@ -176,7 +177,7 @@ func (o *PcloudCloudconnectionsPostOK) readResponse(response runtime.ClientRespo o.Payload = new(models.CloudConnection) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -246,7 +247,7 @@ func (o *PcloudCloudconnectionsPostCreated) readResponse(response runtime.Client o.Payload = new(models.CloudConnection) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -316,7 +317,7 @@ func (o *PcloudCloudconnectionsPostAccepted) readResponse(response runtime.Clien o.Payload = new(models.CloudConnectionCreateResponse) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -386,7 +387,7 @@ func (o *PcloudCloudconnectionsPostBadRequest) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -456,7 +457,7 @@ func (o *PcloudCloudconnectionsPostUnauthorized) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -526,7 +527,7 @@ func (o *PcloudCloudconnectionsPostForbidden) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -596,7 +597,7 @@ func (o *PcloudCloudconnectionsPostNotFound) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -666,7 +667,7 @@ func (o *PcloudCloudconnectionsPostMethodNotAllowed) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -736,7 +737,7 @@ func (o *PcloudCloudconnectionsPostRequestTimeout) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -806,7 +807,7 @@ func (o *PcloudCloudconnectionsPostConflict) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -876,7 +877,7 @@ func (o *PcloudCloudconnectionsPostUnprocessableEntity) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -946,7 +947,7 @@ func (o *PcloudCloudconnectionsPostInternalServerError) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -1016,7 +1017,7 @@ func (o *PcloudCloudconnectionsPostServiceUnavailable) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -1086,7 +1087,7 @@ func (o *PcloudCloudconnectionsPostGatewayTimeout) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_put_responses.go index e2ba3d9128a..410933c6c20 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_put_responses.go @@ -7,6 +7,7 @@ package p_cloud_cloud_connections import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudCloudconnectionsPutReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudCloudconnectionsPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudCloudconnectionsPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudCloudconnectionsPutOK() @@ -164,7 +165,7 @@ func (o *PcloudCloudconnectionsPutOK) readResponse(response runtime.ClientRespon o.Payload = new(models.CloudConnection) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -234,7 +235,7 @@ func (o *PcloudCloudconnectionsPutAccepted) readResponse(response runtime.Client o.Payload = new(models.JobReference) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -304,7 +305,7 @@ func (o *PcloudCloudconnectionsPutBadRequest) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -374,7 +375,7 @@ func (o *PcloudCloudconnectionsPutUnauthorized) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -444,7 +445,7 @@ func (o *PcloudCloudconnectionsPutForbidden) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -514,7 +515,7 @@ func (o *PcloudCloudconnectionsPutNotFound) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -584,7 +585,7 @@ func (o *PcloudCloudconnectionsPutMethodNotAllowed) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -654,7 +655,7 @@ func (o *PcloudCloudconnectionsPutRequestTimeout) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -724,7 +725,7 @@ func (o *PcloudCloudconnectionsPutConflict) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -794,7 +795,7 @@ func (o *PcloudCloudconnectionsPutUnprocessableEntity) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -864,7 +865,7 @@ func (o *PcloudCloudconnectionsPutInternalServerError) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -934,7 +935,7 @@ func (o *PcloudCloudconnectionsPutServiceUnavailable) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_virtualprivateclouds_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_virtualprivateclouds_getall_responses.go index f106b3e80c0..b85e713d53e 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_virtualprivateclouds_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_virtualprivateclouds_getall_responses.go @@ -7,6 +7,7 @@ package p_cloud_cloud_connections import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudCloudconnectionsVirtualprivatecloudsGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudCloudconnectionsVirtualprivatecloudsGetallOK() @@ -146,7 +147,7 @@ func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallOK) readResponse(respon o.Payload = new(models.CloudConnectionVirtualPrivateClouds) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -216,7 +217,7 @@ func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallBadRequest) readRespons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -286,7 +287,7 @@ func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized) readRespo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -356,7 +357,7 @@ func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallForbidden) readResponse o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -426,7 +427,7 @@ func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallNotFound) readResponse( o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -496,7 +497,7 @@ func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallRequestTimeout) readRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -566,7 +567,7 @@ func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError) re o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -636,7 +637,7 @@ func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallServiceUnavailable) rea o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -706,7 +707,7 @@ func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallGatewayTimeout) readRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_disaster_recovery/p_cloud_disaster_recovery_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_disaster_recovery/p_cloud_disaster_recovery_client.go index c3a51368596..f3e9a0fe026 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_disaster_recovery/p_cloud_disaster_recovery_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_disaster_recovery/p_cloud_disaster_recovery_client.go @@ -67,7 +67,7 @@ type ClientService interface { PcloudLocationsDisasterrecoveryGet gets the disaster recovery site details for the current location */ func (a *Client) PcloudLocationsDisasterrecoveryGet(params *PcloudLocationsDisasterrecoveryGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudLocationsDisasterrecoveryGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudLocationsDisasterrecoveryGetParams() } @@ -87,17 +87,22 @@ func (a *Client) PcloudLocationsDisasterrecoveryGet(params *PcloudLocationsDisas for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudLocationsDisasterrecoveryGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.locations.disasterrecovery.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -106,7 +111,7 @@ func (a *Client) PcloudLocationsDisasterrecoveryGet(params *PcloudLocationsDisas PcloudLocationsDisasterrecoveryGetall gets all disaster recovery locations supported by power virtual server */ func (a *Client) PcloudLocationsDisasterrecoveryGetall(params *PcloudLocationsDisasterrecoveryGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudLocationsDisasterrecoveryGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudLocationsDisasterrecoveryGetallParams() } @@ -126,17 +131,22 @@ func (a *Client) PcloudLocationsDisasterrecoveryGetall(params *PcloudLocationsDi for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudLocationsDisasterrecoveryGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.locations.disasterrecovery.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_disaster_recovery/pcloud_locations_disasterrecovery_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_disaster_recovery/pcloud_locations_disasterrecovery_get_responses.go index b66efb7ad8d..6b0733507db 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_disaster_recovery/pcloud_locations_disasterrecovery_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_disaster_recovery/pcloud_locations_disasterrecovery_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_disaster_recovery import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudLocationsDisasterrecoveryGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudLocationsDisasterrecoveryGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudLocationsDisasterrecoveryGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudLocationsDisasterrecoveryGetOK() @@ -128,7 +129,7 @@ func (o *PcloudLocationsDisasterrecoveryGetOK) readResponse(response runtime.Cli o.Payload = new(models.DisasterRecoveryLocation) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudLocationsDisasterrecoveryGetBadRequest) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudLocationsDisasterrecoveryGetUnauthorized) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudLocationsDisasterrecoveryGetForbidden) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudLocationsDisasterrecoveryGetNotFound) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudLocationsDisasterrecoveryGetInternalServerError) readResponse(res o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_disaster_recovery/pcloud_locations_disasterrecovery_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_disaster_recovery/pcloud_locations_disasterrecovery_getall_responses.go index 92ef95892c1..44459f78aa0 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_disaster_recovery/pcloud_locations_disasterrecovery_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_disaster_recovery/pcloud_locations_disasterrecovery_getall_responses.go @@ -7,6 +7,7 @@ package p_cloud_disaster_recovery import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudLocationsDisasterrecoveryGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudLocationsDisasterrecoveryGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudLocationsDisasterrecoveryGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudLocationsDisasterrecoveryGetallOK() @@ -128,7 +129,7 @@ func (o *PcloudLocationsDisasterrecoveryGetallOK) readResponse(response runtime. o.Payload = new(models.DisasterRecoveryLocations) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudLocationsDisasterrecoveryGetallBadRequest) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudLocationsDisasterrecoveryGetallUnauthorized) readResponse(respons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudLocationsDisasterrecoveryGetallForbidden) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudLocationsDisasterrecoveryGetallNotFound) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudLocationsDisasterrecoveryGetallInternalServerError) readResponse( o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/p_cloud_events_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/p_cloud_events_client.go index 62289661235..41fe971fd88 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/p_cloud_events_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/p_cloud_events_client.go @@ -67,7 +67,7 @@ type ClientService interface { PcloudEventsGet gets a single event */ func (a *Client) PcloudEventsGet(params *PcloudEventsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudEventsGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudEventsGetParams() } @@ -87,17 +87,22 @@ func (a *Client) PcloudEventsGet(params *PcloudEventsGetParams, authInfo runtime for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudEventsGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.events.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -106,7 +111,7 @@ func (a *Client) PcloudEventsGet(params *PcloudEventsGetParams, authInfo runtime PcloudEventsGetquery gets events from this cloud instance since a specific timestamp */ func (a *Client) PcloudEventsGetquery(params *PcloudEventsGetqueryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudEventsGetqueryOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudEventsGetqueryParams() } @@ -126,17 +131,22 @@ func (a *Client) PcloudEventsGetquery(params *PcloudEventsGetqueryParams, authIn for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudEventsGetqueryOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.events.getquery: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/pcloud_events_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/pcloud_events_get_responses.go index 5e7e5971942..dff73e8d6f5 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/pcloud_events_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/pcloud_events_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_events import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudEventsGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudEventsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudEventsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudEventsGetOK() @@ -128,7 +129,7 @@ func (o *PcloudEventsGetOK) readResponse(response runtime.ClientResponse, consum o.Payload = new(models.Event) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudEventsGetBadRequest) readResponse(response runtime.ClientResponse o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudEventsGetUnauthorized) readResponse(response runtime.ClientRespon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudEventsGetForbidden) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudEventsGetNotFound) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudEventsGetInternalServerError) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/pcloud_events_getquery_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/pcloud_events_getquery_responses.go index 8140ed866ac..8deeed27b9a 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/pcloud_events_getquery_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/pcloud_events_getquery_responses.go @@ -7,6 +7,7 @@ package p_cloud_events import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudEventsGetqueryReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudEventsGetqueryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudEventsGetqueryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudEventsGetqueryOK() @@ -128,7 +129,7 @@ func (o *PcloudEventsGetqueryOK) readResponse(response runtime.ClientResponse, c o.Payload = new(models.Events) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudEventsGetqueryBadRequest) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudEventsGetqueryUnauthorized) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudEventsGetqueryForbidden) readResponse(response runtime.ClientResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudEventsGetqueryNotFound) readResponse(response runtime.ClientRespo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudEventsGetqueryInternalServerError) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/p_cloud_images_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/p_cloud_images_client.go index 4fbd54d5a8d..61ee5e5c019 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/p_cloud_images_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/p_cloud_images_client.go @@ -89,7 +89,7 @@ type ClientService interface { PcloudCloudinstancesImagesDelete deletes an image from a cloud instance */ func (a *Client) PcloudCloudinstancesImagesDelete(params *PcloudCloudinstancesImagesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesImagesDeleteOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudCloudinstancesImagesDeleteParams() } @@ -109,17 +109,22 @@ func (a *Client) PcloudCloudinstancesImagesDelete(params *PcloudCloudinstancesIm for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudCloudinstancesImagesDeleteOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.images.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -132,7 +137,7 @@ func (a *Client) PcloudCloudinstancesImagesDelete(params *PcloudCloudinstancesIm >*Note*: Support for this API is available till Oct 2022. */ func (a *Client) PcloudCloudinstancesImagesExportPost(params *PcloudCloudinstancesImagesExportPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesImagesExportPostAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudCloudinstancesImagesExportPostParams() } @@ -152,17 +157,22 @@ func (a *Client) PcloudCloudinstancesImagesExportPost(params *PcloudCloudinstanc for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudCloudinstancesImagesExportPostAccepted) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.images.export.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -171,7 +181,7 @@ func (a *Client) PcloudCloudinstancesImagesExportPost(params *PcloudCloudinstanc PcloudCloudinstancesImagesGet detaileds info of an image */ func (a *Client) PcloudCloudinstancesImagesGet(params *PcloudCloudinstancesImagesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesImagesGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudCloudinstancesImagesGetParams() } @@ -191,17 +201,22 @@ func (a *Client) PcloudCloudinstancesImagesGet(params *PcloudCloudinstancesImage for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudCloudinstancesImagesGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.images.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -210,7 +225,7 @@ func (a *Client) PcloudCloudinstancesImagesGet(params *PcloudCloudinstancesImage PcloudCloudinstancesImagesGetall lists all images for this cloud instance */ func (a *Client) PcloudCloudinstancesImagesGetall(params *PcloudCloudinstancesImagesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesImagesGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudCloudinstancesImagesGetallParams() } @@ -230,17 +245,22 @@ func (a *Client) PcloudCloudinstancesImagesGetall(params *PcloudCloudinstancesIm for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudCloudinstancesImagesGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.images.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -249,7 +269,7 @@ func (a *Client) PcloudCloudinstancesImagesGetall(params *PcloudCloudinstancesIm PcloudCloudinstancesImagesPost creates a new image from available images */ func (a *Client) PcloudCloudinstancesImagesPost(params *PcloudCloudinstancesImagesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesImagesPostOK, *PcloudCloudinstancesImagesPostCreated, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudCloudinstancesImagesPostParams() } @@ -269,18 +289,22 @@ func (a *Client) PcloudCloudinstancesImagesPost(params *PcloudCloudinstancesImag for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } + + // several success responses have to be checked switch value := result.(type) { case *PcloudCloudinstancesImagesPostOK: return value, nil, nil case *PcloudCloudinstancesImagesPostCreated: return nil, value, nil } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for p_cloud_images: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -289,7 +313,7 @@ func (a *Client) PcloudCloudinstancesImagesPost(params *PcloudCloudinstancesImag PcloudCloudinstancesStockimagesGet detaileds info of an available stock image */ func (a *Client) PcloudCloudinstancesStockimagesGet(params *PcloudCloudinstancesStockimagesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesStockimagesGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudCloudinstancesStockimagesGetParams() } @@ -309,17 +333,22 @@ func (a *Client) PcloudCloudinstancesStockimagesGet(params *PcloudCloudinstances for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudCloudinstancesStockimagesGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.stockimages.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -328,7 +357,7 @@ func (a *Client) PcloudCloudinstancesStockimagesGet(params *PcloudCloudinstances PcloudCloudinstancesStockimagesGetall lists all available stock images */ func (a *Client) PcloudCloudinstancesStockimagesGetall(params *PcloudCloudinstancesStockimagesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesStockimagesGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudCloudinstancesStockimagesGetallParams() } @@ -348,17 +377,22 @@ func (a *Client) PcloudCloudinstancesStockimagesGetall(params *PcloudCloudinstan for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudCloudinstancesStockimagesGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.stockimages.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -371,7 +405,7 @@ func (a *Client) PcloudCloudinstancesStockimagesGetall(params *PcloudCloudinstan >*Note*: Support for this API will be available till 31st March 2023. */ func (a *Client) PcloudImagesGet(params *PcloudImagesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudImagesGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudImagesGetParams() } @@ -391,17 +425,22 @@ func (a *Client) PcloudImagesGet(params *PcloudImagesGetParams, authInfo runtime for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudImagesGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.images.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -414,7 +453,7 @@ func (a *Client) PcloudImagesGet(params *PcloudImagesGetParams, authInfo runtime >*Note*: Support for this API will be available till 31st March 2023. */ func (a *Client) PcloudImagesGetall(params *PcloudImagesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudImagesGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudImagesGetallParams() } @@ -434,17 +473,22 @@ func (a *Client) PcloudImagesGetall(params *PcloudImagesGetallParams, authInfo r for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudImagesGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.images.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -453,7 +497,7 @@ func (a *Client) PcloudImagesGetall(params *PcloudImagesGetallParams, authInfo r PcloudV1CloudinstancesCosimagesGet gets detail of last cos image import job */ func (a *Client) PcloudV1CloudinstancesCosimagesGet(params *PcloudV1CloudinstancesCosimagesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV1CloudinstancesCosimagesGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudV1CloudinstancesCosimagesGetParams() } @@ -473,17 +517,22 @@ func (a *Client) PcloudV1CloudinstancesCosimagesGet(params *PcloudV1Cloudinstanc for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudV1CloudinstancesCosimagesGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.v1.cloudinstances.cosimages.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -492,7 +541,7 @@ func (a *Client) PcloudV1CloudinstancesCosimagesGet(params *PcloudV1Cloudinstanc PcloudV1CloudinstancesCosimagesPost creates an cos image import job */ func (a *Client) PcloudV1CloudinstancesCosimagesPost(params *PcloudV1CloudinstancesCosimagesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV1CloudinstancesCosimagesPostAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudV1CloudinstancesCosimagesPostParams() } @@ -512,17 +561,22 @@ func (a *Client) PcloudV1CloudinstancesCosimagesPost(params *PcloudV1Cloudinstan for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudV1CloudinstancesCosimagesPostAccepted) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.v1.cloudinstances.cosimages.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -531,7 +585,7 @@ func (a *Client) PcloudV1CloudinstancesCosimagesPost(params *PcloudV1Cloudinstan PcloudV2ImagesExportGet gets detail of last image export job */ func (a *Client) PcloudV2ImagesExportGet(params *PcloudV2ImagesExportGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2ImagesExportGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudV2ImagesExportGetParams() } @@ -551,17 +605,22 @@ func (a *Client) PcloudV2ImagesExportGet(params *PcloudV2ImagesExportGetParams, for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudV2ImagesExportGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.v2.images.export.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -570,7 +629,7 @@ func (a *Client) PcloudV2ImagesExportGet(params *PcloudV2ImagesExportGetParams, PcloudV2ImagesExportPost adds image export job to the jobs queue */ func (a *Client) PcloudV2ImagesExportPost(params *PcloudV2ImagesExportPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2ImagesExportPostAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudV2ImagesExportPostParams() } @@ -590,17 +649,22 @@ func (a *Client) PcloudV2ImagesExportPost(params *PcloudV2ImagesExportPostParams for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudV2ImagesExportPostAccepted) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.v2.images.export.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_delete_responses.go index d7ad65acc2e..c5223e3ce01 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_delete_responses.go @@ -7,6 +7,7 @@ package p_cloud_images import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudCloudinstancesImagesDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesImagesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudCloudinstancesImagesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudCloudinstancesImagesDeleteOK() @@ -132,7 +133,7 @@ func (o *PcloudCloudinstancesImagesDeleteOK) GetPayload() models.Object { func (o *PcloudCloudinstancesImagesDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -202,7 +203,7 @@ func (o *PcloudCloudinstancesImagesDeleteBadRequest) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -272,7 +273,7 @@ func (o *PcloudCloudinstancesImagesDeleteUnauthorized) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -342,7 +343,7 @@ func (o *PcloudCloudinstancesImagesDeleteForbidden) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -412,7 +413,7 @@ func (o *PcloudCloudinstancesImagesDeleteNotFound) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -482,7 +483,7 @@ func (o *PcloudCloudinstancesImagesDeleteGone) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -552,7 +553,7 @@ func (o *PcloudCloudinstancesImagesDeleteInternalServerError) readResponse(respo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_export_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_export_post_responses.go index 713448c3a43..520e56c9055 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_export_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_export_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_images import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudCloudinstancesImagesExportPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesImagesExportPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudCloudinstancesImagesExportPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 202: result := NewPcloudCloudinstancesImagesExportPostAccepted() @@ -132,7 +133,7 @@ func (o *PcloudCloudinstancesImagesExportPostAccepted) GetPayload() models.Objec func (o *PcloudCloudinstancesImagesExportPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -202,7 +203,7 @@ func (o *PcloudCloudinstancesImagesExportPostBadRequest) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -272,7 +273,7 @@ func (o *PcloudCloudinstancesImagesExportPostUnauthorized) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -342,7 +343,7 @@ func (o *PcloudCloudinstancesImagesExportPostForbidden) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -412,7 +413,7 @@ func (o *PcloudCloudinstancesImagesExportPostNotFound) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -482,7 +483,7 @@ func (o *PcloudCloudinstancesImagesExportPostUnprocessableEntity) readResponse(r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -552,7 +553,7 @@ func (o *PcloudCloudinstancesImagesExportPostInternalServerError) readResponse(r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_get_responses.go index 386dd1db6fc..64917b3a5f7 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_images import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudCloudinstancesImagesGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesImagesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudCloudinstancesImagesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudCloudinstancesImagesGetOK() @@ -128,7 +129,7 @@ func (o *PcloudCloudinstancesImagesGetOK) readResponse(response runtime.ClientRe o.Payload = new(models.Image) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudCloudinstancesImagesGetBadRequest) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudCloudinstancesImagesGetUnauthorized) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudCloudinstancesImagesGetForbidden) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudCloudinstancesImagesGetNotFound) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudCloudinstancesImagesGetInternalServerError) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_getall_responses.go index 2d7b4d17289..c41bbde8159 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_getall_responses.go @@ -7,6 +7,7 @@ package p_cloud_images import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudCloudinstancesImagesGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesImagesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudCloudinstancesImagesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudCloudinstancesImagesGetallOK() @@ -128,7 +129,7 @@ func (o *PcloudCloudinstancesImagesGetallOK) readResponse(response runtime.Clien o.Payload = new(models.Images) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudCloudinstancesImagesGetallBadRequest) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudCloudinstancesImagesGetallUnauthorized) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudCloudinstancesImagesGetallForbidden) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudCloudinstancesImagesGetallNotFound) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudCloudinstancesImagesGetallInternalServerError) readResponse(respo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_post_responses.go index 86cc15e7ac0..066989c0c67 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_images_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_images import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudCloudinstancesImagesPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesImagesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudCloudinstancesImagesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudCloudinstancesImagesPostOK() @@ -146,7 +147,7 @@ func (o *PcloudCloudinstancesImagesPostOK) readResponse(response runtime.ClientR o.Payload = new(models.Image) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -216,7 +217,7 @@ func (o *PcloudCloudinstancesImagesPostCreated) readResponse(response runtime.Cl o.Payload = new(models.Image) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -286,7 +287,7 @@ func (o *PcloudCloudinstancesImagesPostBadRequest) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -356,7 +357,7 @@ func (o *PcloudCloudinstancesImagesPostUnauthorized) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -426,7 +427,7 @@ func (o *PcloudCloudinstancesImagesPostForbidden) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -496,7 +497,7 @@ func (o *PcloudCloudinstancesImagesPostNotFound) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -566,7 +567,7 @@ func (o *PcloudCloudinstancesImagesPostConflict) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -636,7 +637,7 @@ func (o *PcloudCloudinstancesImagesPostUnprocessableEntity) readResponse(respons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -706,7 +707,7 @@ func (o *PcloudCloudinstancesImagesPostInternalServerError) readResponse(respons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_get_responses.go index 23c3616ffbb..3a2630c8f39 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_images import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudCloudinstancesStockimagesGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesStockimagesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudCloudinstancesStockimagesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudCloudinstancesStockimagesGetOK() @@ -128,7 +129,7 @@ func (o *PcloudCloudinstancesStockimagesGetOK) readResponse(response runtime.Cli o.Payload = new(models.Image) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudCloudinstancesStockimagesGetBadRequest) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudCloudinstancesStockimagesGetUnauthorized) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudCloudinstancesStockimagesGetForbidden) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudCloudinstancesStockimagesGetNotFound) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudCloudinstancesStockimagesGetInternalServerError) readResponse(res o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_getall_responses.go index 793017a33ed..994dd106964 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_getall_responses.go @@ -7,6 +7,7 @@ package p_cloud_images import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudCloudinstancesStockimagesGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesStockimagesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudCloudinstancesStockimagesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudCloudinstancesStockimagesGetallOK() @@ -128,7 +129,7 @@ func (o *PcloudCloudinstancesStockimagesGetallOK) readResponse(response runtime. o.Payload = new(models.Images) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudCloudinstancesStockimagesGetallBadRequest) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudCloudinstancesStockimagesGetallUnauthorized) readResponse(respons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudCloudinstancesStockimagesGetallForbidden) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudCloudinstancesStockimagesGetallNotFound) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudCloudinstancesStockimagesGetallInternalServerError) readResponse( o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_images_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_images_get_responses.go index a502fc2ff9a..6a965e574c6 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_images_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_images_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_images import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudImagesGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudImagesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudImagesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudImagesGetOK() @@ -128,7 +129,7 @@ func (o *PcloudImagesGetOK) readResponse(response runtime.ClientResponse, consum o.Payload = new(models.Image) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudImagesGetBadRequest) readResponse(response runtime.ClientResponse o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudImagesGetUnauthorized) readResponse(response runtime.ClientRespon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudImagesGetForbidden) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudImagesGetNotFound) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudImagesGetInternalServerError) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_images_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_images_getall_responses.go index 2b50824cbe5..04c50554526 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_images_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_images_getall_responses.go @@ -7,6 +7,7 @@ package p_cloud_images import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudImagesGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudImagesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudImagesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudImagesGetallOK() @@ -128,7 +129,7 @@ func (o *PcloudImagesGetallOK) readResponse(response runtime.ClientResponse, con o.Payload = new(models.Images) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudImagesGetallBadRequest) readResponse(response runtime.ClientRespo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudImagesGetallUnauthorized) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudImagesGetallForbidden) readResponse(response runtime.ClientRespon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudImagesGetallNotFound) readResponse(response runtime.ClientRespons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudImagesGetallInternalServerError) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v1_cloudinstances_cosimages_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v1_cloudinstances_cosimages_get_responses.go index b8da793bd93..690b4505acf 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v1_cloudinstances_cosimages_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v1_cloudinstances_cosimages_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_images import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudV1CloudinstancesCosimagesGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudV1CloudinstancesCosimagesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudV1CloudinstancesCosimagesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudV1CloudinstancesCosimagesGetOK() @@ -128,7 +129,7 @@ func (o *PcloudV1CloudinstancesCosimagesGetOK) readResponse(response runtime.Cli o.Payload = new(models.Job) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudV1CloudinstancesCosimagesGetBadRequest) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudV1CloudinstancesCosimagesGetUnauthorized) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudV1CloudinstancesCosimagesGetForbidden) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudV1CloudinstancesCosimagesGetNotFound) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudV1CloudinstancesCosimagesGetInternalServerError) readResponse(res o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v1_cloudinstances_cosimages_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v1_cloudinstances_cosimages_post_responses.go index 036bbb66084..bf70f84f42c 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v1_cloudinstances_cosimages_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v1_cloudinstances_cosimages_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_images import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudV1CloudinstancesCosimagesPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudV1CloudinstancesCosimagesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudV1CloudinstancesCosimagesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 202: result := NewPcloudV1CloudinstancesCosimagesPostAccepted() @@ -140,7 +141,7 @@ func (o *PcloudV1CloudinstancesCosimagesPostAccepted) readResponse(response runt o.Payload = new(models.JobReference) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -210,7 +211,7 @@ func (o *PcloudV1CloudinstancesCosimagesPostBadRequest) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -280,7 +281,7 @@ func (o *PcloudV1CloudinstancesCosimagesPostUnauthorized) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -350,7 +351,7 @@ func (o *PcloudV1CloudinstancesCosimagesPostForbidden) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -420,7 +421,7 @@ func (o *PcloudV1CloudinstancesCosimagesPostNotFound) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -490,7 +491,7 @@ func (o *PcloudV1CloudinstancesCosimagesPostConflict) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -560,7 +561,7 @@ func (o *PcloudV1CloudinstancesCosimagesPostUnprocessableEntity) readResponse(re o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -630,7 +631,7 @@ func (o *PcloudV1CloudinstancesCosimagesPostInternalServerError) readResponse(re o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v2_images_export_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v2_images_export_get_responses.go index 27e8d1e4f54..d473e86b905 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v2_images_export_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v2_images_export_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_images import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudV2ImagesExportGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudV2ImagesExportGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudV2ImagesExportGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudV2ImagesExportGetOK() @@ -128,7 +129,7 @@ func (o *PcloudV2ImagesExportGetOK) readResponse(response runtime.ClientResponse o.Payload = new(models.Job) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudV2ImagesExportGetBadRequest) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudV2ImagesExportGetUnauthorized) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudV2ImagesExportGetForbidden) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudV2ImagesExportGetNotFound) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudV2ImagesExportGetInternalServerError) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v2_images_export_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v2_images_export_post_responses.go index 6abf005840b..2762711bc61 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v2_images_export_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/pcloud_v2_images_export_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_images import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudV2ImagesExportPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudV2ImagesExportPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudV2ImagesExportPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 202: result := NewPcloudV2ImagesExportPostAccepted() @@ -140,7 +141,7 @@ func (o *PcloudV2ImagesExportPostAccepted) readResponse(response runtime.ClientR o.Payload = new(models.JobReference) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -210,7 +211,7 @@ func (o *PcloudV2ImagesExportPostBadRequest) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -280,7 +281,7 @@ func (o *PcloudV2ImagesExportPostUnauthorized) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -350,7 +351,7 @@ func (o *PcloudV2ImagesExportPostForbidden) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -420,7 +421,7 @@ func (o *PcloudV2ImagesExportPostNotFound) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -490,7 +491,7 @@ func (o *PcloudV2ImagesExportPostConflict) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -560,7 +561,7 @@ func (o *PcloudV2ImagesExportPostUnprocessableEntity) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -630,7 +631,7 @@ func (o *PcloudV2ImagesExportPostInternalServerError) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/p_cloud_instances_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/p_cloud_instances_client.go index 8f7720ee736..3ba8e7d837c 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/p_cloud_instances_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/p_cloud_instances_client.go @@ -62,6 +62,8 @@ type ClientService interface { PcloudCloudinstancesPut(params *PcloudCloudinstancesPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesPutOK, error) + PcloudCloudinstancesSharedImagesPut(params *PcloudCloudinstancesSharedImagesPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesSharedImagesPutOK, error) + SetTransport(transport runtime.ClientTransport) } @@ -69,7 +71,7 @@ type ClientService interface { PcloudCloudinstancesDelete deletes a power cloud instance */ func (a *Client) PcloudCloudinstancesDelete(params *PcloudCloudinstancesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesDeleteOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudCloudinstancesDeleteParams() } @@ -89,17 +91,22 @@ func (a *Client) PcloudCloudinstancesDelete(params *PcloudCloudinstancesDeletePa for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudCloudinstancesDeleteOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -108,7 +115,7 @@ func (a *Client) PcloudCloudinstancesDelete(params *PcloudCloudinstancesDeletePa PcloudCloudinstancesGet gets a cloud instance s current state information */ func (a *Client) PcloudCloudinstancesGet(params *PcloudCloudinstancesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudCloudinstancesGetParams() } @@ -128,17 +135,22 @@ func (a *Client) PcloudCloudinstancesGet(params *PcloudCloudinstancesGetParams, for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudCloudinstancesGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -147,7 +159,7 @@ func (a *Client) PcloudCloudinstancesGet(params *PcloudCloudinstancesGetParams, PcloudCloudinstancesPut updates upgrade a cloud instance */ func (a *Client) PcloudCloudinstancesPut(params *PcloudCloudinstancesPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesPutOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudCloudinstancesPutParams() } @@ -167,21 +179,70 @@ func (a *Client) PcloudCloudinstancesPut(params *PcloudCloudinstancesPutParams, for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudCloudinstancesPutOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } +/* +PcloudCloudinstancesSharedImagesPut updates shared image settings for a cloud instance +*/ +func (a *Client) PcloudCloudinstancesSharedImagesPut(params *PcloudCloudinstancesSharedImagesPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesSharedImagesPutOK, error) { + // NOTE: parameters are not validated before sending + if params == nil { + params = NewPcloudCloudinstancesSharedImagesPutParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.cloudinstances.shared-images.put", + Method: "PUT", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/shared-images", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudCloudinstancesSharedImagesPutReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + + // only one success response has to be checked + success, ok := result.(*PcloudCloudinstancesSharedImagesPutOK) + if ok { + return success, nil + } + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.shared-images.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + // SetTransport changes the transport on the client func (a *Client) SetTransport(transport runtime.ClientTransport) { a.transport = transport diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_delete_responses.go index 380e0d18114..59971e251bc 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_delete_responses.go @@ -7,6 +7,7 @@ package p_cloud_instances import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudCloudinstancesDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudCloudinstancesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudCloudinstancesDeleteOK() @@ -132,7 +133,7 @@ func (o *PcloudCloudinstancesDeleteOK) GetPayload() models.Object { func (o *PcloudCloudinstancesDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -202,7 +203,7 @@ func (o *PcloudCloudinstancesDeleteBadRequest) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -272,7 +273,7 @@ func (o *PcloudCloudinstancesDeleteUnauthorized) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -342,7 +343,7 @@ func (o *PcloudCloudinstancesDeleteForbidden) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -412,7 +413,7 @@ func (o *PcloudCloudinstancesDeleteNotFound) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -482,7 +483,7 @@ func (o *PcloudCloudinstancesDeleteGone) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -552,7 +553,7 @@ func (o *PcloudCloudinstancesDeleteInternalServerError) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_get_responses.go index 0c968e37676..3074b0f6216 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_instances import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudCloudinstancesGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudCloudinstancesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudCloudinstancesGetOK() @@ -128,7 +129,7 @@ func (o *PcloudCloudinstancesGetOK) readResponse(response runtime.ClientResponse o.Payload = new(models.CloudInstance) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudCloudinstancesGetBadRequest) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudCloudinstancesGetUnauthorized) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudCloudinstancesGetForbidden) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudCloudinstancesGetNotFound) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudCloudinstancesGetInternalServerError) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_put_responses.go index 98f67611341..dadc4760a66 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_put_responses.go @@ -7,6 +7,7 @@ package p_cloud_instances import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudCloudinstancesPutReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudCloudinstancesPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudCloudinstancesPutOK() @@ -134,7 +135,7 @@ func (o *PcloudCloudinstancesPutOK) readResponse(response runtime.ClientResponse o.Payload = new(models.CloudInstance) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *PcloudCloudinstancesPutBadRequest) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *PcloudCloudinstancesPutUnauthorized) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *PcloudCloudinstancesPutForbidden) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *PcloudCloudinstancesPutNotFound) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *PcloudCloudinstancesPutUnprocessableEntity) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *PcloudCloudinstancesPutInternalServerError) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_shared_images_put_parameters.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_shared_images_put_parameters.go new file mode 100644 index 00000000000..0a8c6b3502c --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_shared_images_put_parameters.go @@ -0,0 +1,175 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_instances + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// NewPcloudCloudinstancesSharedImagesPutParams creates a new PcloudCloudinstancesSharedImagesPutParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewPcloudCloudinstancesSharedImagesPutParams() *PcloudCloudinstancesSharedImagesPutParams { + return &PcloudCloudinstancesSharedImagesPutParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPcloudCloudinstancesSharedImagesPutParamsWithTimeout creates a new PcloudCloudinstancesSharedImagesPutParams object +// with the ability to set a timeout on a request. +func NewPcloudCloudinstancesSharedImagesPutParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesSharedImagesPutParams { + return &PcloudCloudinstancesSharedImagesPutParams{ + timeout: timeout, + } +} + +// NewPcloudCloudinstancesSharedImagesPutParamsWithContext creates a new PcloudCloudinstancesSharedImagesPutParams object +// with the ability to set a context for a request. +func NewPcloudCloudinstancesSharedImagesPutParamsWithContext(ctx context.Context) *PcloudCloudinstancesSharedImagesPutParams { + return &PcloudCloudinstancesSharedImagesPutParams{ + Context: ctx, + } +} + +// NewPcloudCloudinstancesSharedImagesPutParamsWithHTTPClient creates a new PcloudCloudinstancesSharedImagesPutParams object +// with the ability to set a custom HTTPClient for a request. +func NewPcloudCloudinstancesSharedImagesPutParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesSharedImagesPutParams { + return &PcloudCloudinstancesSharedImagesPutParams{ + HTTPClient: client, + } +} + +/* +PcloudCloudinstancesSharedImagesPutParams contains all the parameters to send to the API endpoint + + for the pcloud cloudinstances shared images put operation. + + Typically these are written to a http.Request. +*/ +type PcloudCloudinstancesSharedImagesPutParams struct { + + /* Body. + + Shared images settings for a Cloud Instance + */ + Body *models.CloudInstanceSharedImages + + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance + */ + CloudInstanceID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the pcloud cloudinstances shared images put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesSharedImagesPutParams) WithDefaults() *PcloudCloudinstancesSharedImagesPutParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud cloudinstances shared images put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesSharedImagesPutParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the pcloud cloudinstances shared images put params +func (o *PcloudCloudinstancesSharedImagesPutParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesSharedImagesPutParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the pcloud cloudinstances shared images put params +func (o *PcloudCloudinstancesSharedImagesPutParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the pcloud cloudinstances shared images put params +func (o *PcloudCloudinstancesSharedImagesPutParams) WithContext(ctx context.Context) *PcloudCloudinstancesSharedImagesPutParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the pcloud cloudinstances shared images put params +func (o *PcloudCloudinstancesSharedImagesPutParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the pcloud cloudinstances shared images put params +func (o *PcloudCloudinstancesSharedImagesPutParams) WithHTTPClient(client *http.Client) *PcloudCloudinstancesSharedImagesPutParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the pcloud cloudinstances shared images put params +func (o *PcloudCloudinstancesSharedImagesPutParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the pcloud cloudinstances shared images put params +func (o *PcloudCloudinstancesSharedImagesPutParams) WithBody(body *models.CloudInstanceSharedImages) *PcloudCloudinstancesSharedImagesPutParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the pcloud cloudinstances shared images put params +func (o *PcloudCloudinstancesSharedImagesPutParams) SetBody(body *models.CloudInstanceSharedImages) { + o.Body = body +} + +// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudinstances shared images put params +func (o *PcloudCloudinstancesSharedImagesPutParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudinstancesSharedImagesPutParams { + o.SetCloudInstanceID(cloudInstanceID) + return o +} + +// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudinstances shared images put params +func (o *PcloudCloudinstancesSharedImagesPutParams) SetCloudInstanceID(cloudInstanceID string) { + o.CloudInstanceID = cloudInstanceID +} + +// WriteToRequest writes these params to a swagger request +func (o *PcloudCloudinstancesSharedImagesPutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param cloud_instance_id + if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_shared_images_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_shared_images_put_responses.go new file mode 100644 index 00000000000..f571df2284a --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_instances/pcloud_cloudinstances_shared_images_put_responses.go @@ -0,0 +1,639 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_instances + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + stderrors "errors" + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// PcloudCloudinstancesSharedImagesPutReader is a Reader for the PcloudCloudinstancesSharedImagesPut structure. +type PcloudCloudinstancesSharedImagesPutReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PcloudCloudinstancesSharedImagesPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { + switch response.Code() { + case 200: + result := NewPcloudCloudinstancesSharedImagesPutOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewPcloudCloudinstancesSharedImagesPutBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewPcloudCloudinstancesSharedImagesPutUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPcloudCloudinstancesSharedImagesPutForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPcloudCloudinstancesSharedImagesPutNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewPcloudCloudinstancesSharedImagesPutConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPcloudCloudinstancesSharedImagesPutUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPcloudCloudinstancesSharedImagesPutInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-images] pcloud.cloudinstances.shared-images.put", response, response.Code()) + } +} + +// NewPcloudCloudinstancesSharedImagesPutOK creates a PcloudCloudinstancesSharedImagesPutOK with default headers values +func NewPcloudCloudinstancesSharedImagesPutOK() *PcloudCloudinstancesSharedImagesPutOK { + return &PcloudCloudinstancesSharedImagesPutOK{} +} + +/* +PcloudCloudinstancesSharedImagesPutOK describes a response with status code 200, with default header values. + +OK +*/ +type PcloudCloudinstancesSharedImagesPutOK struct { + Payload *models.CloudInstanceSharedImages +} + +// IsSuccess returns true when this pcloud cloudinstances shared images put o k response has a 2xx status code +func (o *PcloudCloudinstancesSharedImagesPutOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this pcloud cloudinstances shared images put o k response has a 3xx status code +func (o *PcloudCloudinstancesSharedImagesPutOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud cloudinstances shared images put o k response has a 4xx status code +func (o *PcloudCloudinstancesSharedImagesPutOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this pcloud cloudinstances shared images put o k response has a 5xx status code +func (o *PcloudCloudinstancesSharedImagesPutOK) IsServerError() bool { + return false +} + +// IsCode returns true when this pcloud cloudinstances shared images put o k response a status code equal to that given +func (o *PcloudCloudinstancesSharedImagesPutOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the pcloud cloudinstances shared images put o k response +func (o *PcloudCloudinstancesSharedImagesPutOK) Code() int { + return 200 +} + +func (o *PcloudCloudinstancesSharedImagesPutOK) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-images][%d] pcloudCloudinstancesSharedImagesPutOK %s", 200, payload) +} + +func (o *PcloudCloudinstancesSharedImagesPutOK) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-images][%d] pcloudCloudinstancesSharedImagesPutOK %s", 200, payload) +} + +func (o *PcloudCloudinstancesSharedImagesPutOK) GetPayload() *models.CloudInstanceSharedImages { + return o.Payload +} + +func (o *PcloudCloudinstancesSharedImagesPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.CloudInstanceSharedImages) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPcloudCloudinstancesSharedImagesPutBadRequest creates a PcloudCloudinstancesSharedImagesPutBadRequest with default headers values +func NewPcloudCloudinstancesSharedImagesPutBadRequest() *PcloudCloudinstancesSharedImagesPutBadRequest { + return &PcloudCloudinstancesSharedImagesPutBadRequest{} +} + +/* +PcloudCloudinstancesSharedImagesPutBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type PcloudCloudinstancesSharedImagesPutBadRequest struct { + Payload *models.Error +} + +// IsSuccess returns true when this pcloud cloudinstances shared images put bad request response has a 2xx status code +func (o *PcloudCloudinstancesSharedImagesPutBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this pcloud cloudinstances shared images put bad request response has a 3xx status code +func (o *PcloudCloudinstancesSharedImagesPutBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud cloudinstances shared images put bad request response has a 4xx status code +func (o *PcloudCloudinstancesSharedImagesPutBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this pcloud cloudinstances shared images put bad request response has a 5xx status code +func (o *PcloudCloudinstancesSharedImagesPutBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this pcloud cloudinstances shared images put bad request response a status code equal to that given +func (o *PcloudCloudinstancesSharedImagesPutBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the pcloud cloudinstances shared images put bad request response +func (o *PcloudCloudinstancesSharedImagesPutBadRequest) Code() int { + return 400 +} + +func (o *PcloudCloudinstancesSharedImagesPutBadRequest) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-images][%d] pcloudCloudinstancesSharedImagesPutBadRequest %s", 400, payload) +} + +func (o *PcloudCloudinstancesSharedImagesPutBadRequest) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-images][%d] pcloudCloudinstancesSharedImagesPutBadRequest %s", 400, payload) +} + +func (o *PcloudCloudinstancesSharedImagesPutBadRequest) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudCloudinstancesSharedImagesPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPcloudCloudinstancesSharedImagesPutUnauthorized creates a PcloudCloudinstancesSharedImagesPutUnauthorized with default headers values +func NewPcloudCloudinstancesSharedImagesPutUnauthorized() *PcloudCloudinstancesSharedImagesPutUnauthorized { + return &PcloudCloudinstancesSharedImagesPutUnauthorized{} +} + +/* +PcloudCloudinstancesSharedImagesPutUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type PcloudCloudinstancesSharedImagesPutUnauthorized struct { + Payload *models.Error +} + +// IsSuccess returns true when this pcloud cloudinstances shared images put unauthorized response has a 2xx status code +func (o *PcloudCloudinstancesSharedImagesPutUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this pcloud cloudinstances shared images put unauthorized response has a 3xx status code +func (o *PcloudCloudinstancesSharedImagesPutUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud cloudinstances shared images put unauthorized response has a 4xx status code +func (o *PcloudCloudinstancesSharedImagesPutUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this pcloud cloudinstances shared images put unauthorized response has a 5xx status code +func (o *PcloudCloudinstancesSharedImagesPutUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this pcloud cloudinstances shared images put unauthorized response a status code equal to that given +func (o *PcloudCloudinstancesSharedImagesPutUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the pcloud cloudinstances shared images put unauthorized response +func (o *PcloudCloudinstancesSharedImagesPutUnauthorized) Code() int { + return 401 +} + +func (o *PcloudCloudinstancesSharedImagesPutUnauthorized) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-images][%d] pcloudCloudinstancesSharedImagesPutUnauthorized %s", 401, payload) +} + +func (o *PcloudCloudinstancesSharedImagesPutUnauthorized) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-images][%d] pcloudCloudinstancesSharedImagesPutUnauthorized %s", 401, payload) +} + +func (o *PcloudCloudinstancesSharedImagesPutUnauthorized) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudCloudinstancesSharedImagesPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPcloudCloudinstancesSharedImagesPutForbidden creates a PcloudCloudinstancesSharedImagesPutForbidden with default headers values +func NewPcloudCloudinstancesSharedImagesPutForbidden() *PcloudCloudinstancesSharedImagesPutForbidden { + return &PcloudCloudinstancesSharedImagesPutForbidden{} +} + +/* +PcloudCloudinstancesSharedImagesPutForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type PcloudCloudinstancesSharedImagesPutForbidden struct { + Payload *models.Error +} + +// IsSuccess returns true when this pcloud cloudinstances shared images put forbidden response has a 2xx status code +func (o *PcloudCloudinstancesSharedImagesPutForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this pcloud cloudinstances shared images put forbidden response has a 3xx status code +func (o *PcloudCloudinstancesSharedImagesPutForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud cloudinstances shared images put forbidden response has a 4xx status code +func (o *PcloudCloudinstancesSharedImagesPutForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this pcloud cloudinstances shared images put forbidden response has a 5xx status code +func (o *PcloudCloudinstancesSharedImagesPutForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this pcloud cloudinstances shared images put forbidden response a status code equal to that given +func (o *PcloudCloudinstancesSharedImagesPutForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the pcloud cloudinstances shared images put forbidden response +func (o *PcloudCloudinstancesSharedImagesPutForbidden) Code() int { + return 403 +} + +func (o *PcloudCloudinstancesSharedImagesPutForbidden) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-images][%d] pcloudCloudinstancesSharedImagesPutForbidden %s", 403, payload) +} + +func (o *PcloudCloudinstancesSharedImagesPutForbidden) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-images][%d] pcloudCloudinstancesSharedImagesPutForbidden %s", 403, payload) +} + +func (o *PcloudCloudinstancesSharedImagesPutForbidden) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudCloudinstancesSharedImagesPutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPcloudCloudinstancesSharedImagesPutNotFound creates a PcloudCloudinstancesSharedImagesPutNotFound with default headers values +func NewPcloudCloudinstancesSharedImagesPutNotFound() *PcloudCloudinstancesSharedImagesPutNotFound { + return &PcloudCloudinstancesSharedImagesPutNotFound{} +} + +/* +PcloudCloudinstancesSharedImagesPutNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type PcloudCloudinstancesSharedImagesPutNotFound struct { + Payload *models.Error +} + +// IsSuccess returns true when this pcloud cloudinstances shared images put not found response has a 2xx status code +func (o *PcloudCloudinstancesSharedImagesPutNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this pcloud cloudinstances shared images put not found response has a 3xx status code +func (o *PcloudCloudinstancesSharedImagesPutNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud cloudinstances shared images put not found response has a 4xx status code +func (o *PcloudCloudinstancesSharedImagesPutNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this pcloud cloudinstances shared images put not found response has a 5xx status code +func (o *PcloudCloudinstancesSharedImagesPutNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this pcloud cloudinstances shared images put not found response a status code equal to that given +func (o *PcloudCloudinstancesSharedImagesPutNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the pcloud cloudinstances shared images put not found response +func (o *PcloudCloudinstancesSharedImagesPutNotFound) Code() int { + return 404 +} + +func (o *PcloudCloudinstancesSharedImagesPutNotFound) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-images][%d] pcloudCloudinstancesSharedImagesPutNotFound %s", 404, payload) +} + +func (o *PcloudCloudinstancesSharedImagesPutNotFound) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-images][%d] pcloudCloudinstancesSharedImagesPutNotFound %s", 404, payload) +} + +func (o *PcloudCloudinstancesSharedImagesPutNotFound) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudCloudinstancesSharedImagesPutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPcloudCloudinstancesSharedImagesPutConflict creates a PcloudCloudinstancesSharedImagesPutConflict with default headers values +func NewPcloudCloudinstancesSharedImagesPutConflict() *PcloudCloudinstancesSharedImagesPutConflict { + return &PcloudCloudinstancesSharedImagesPutConflict{} +} + +/* +PcloudCloudinstancesSharedImagesPutConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type PcloudCloudinstancesSharedImagesPutConflict struct { + Payload *models.Error +} + +// IsSuccess returns true when this pcloud cloudinstances shared images put conflict response has a 2xx status code +func (o *PcloudCloudinstancesSharedImagesPutConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this pcloud cloudinstances shared images put conflict response has a 3xx status code +func (o *PcloudCloudinstancesSharedImagesPutConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud cloudinstances shared images put conflict response has a 4xx status code +func (o *PcloudCloudinstancesSharedImagesPutConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this pcloud cloudinstances shared images put conflict response has a 5xx status code +func (o *PcloudCloudinstancesSharedImagesPutConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this pcloud cloudinstances shared images put conflict response a status code equal to that given +func (o *PcloudCloudinstancesSharedImagesPutConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the pcloud cloudinstances shared images put conflict response +func (o *PcloudCloudinstancesSharedImagesPutConflict) Code() int { + return 409 +} + +func (o *PcloudCloudinstancesSharedImagesPutConflict) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-images][%d] pcloudCloudinstancesSharedImagesPutConflict %s", 409, payload) +} + +func (o *PcloudCloudinstancesSharedImagesPutConflict) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-images][%d] pcloudCloudinstancesSharedImagesPutConflict %s", 409, payload) +} + +func (o *PcloudCloudinstancesSharedImagesPutConflict) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudCloudinstancesSharedImagesPutConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPcloudCloudinstancesSharedImagesPutUnprocessableEntity creates a PcloudCloudinstancesSharedImagesPutUnprocessableEntity with default headers values +func NewPcloudCloudinstancesSharedImagesPutUnprocessableEntity() *PcloudCloudinstancesSharedImagesPutUnprocessableEntity { + return &PcloudCloudinstancesSharedImagesPutUnprocessableEntity{} +} + +/* +PcloudCloudinstancesSharedImagesPutUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity +*/ +type PcloudCloudinstancesSharedImagesPutUnprocessableEntity struct { + Payload *models.Error +} + +// IsSuccess returns true when this pcloud cloudinstances shared images put unprocessable entity response has a 2xx status code +func (o *PcloudCloudinstancesSharedImagesPutUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this pcloud cloudinstances shared images put unprocessable entity response has a 3xx status code +func (o *PcloudCloudinstancesSharedImagesPutUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud cloudinstances shared images put unprocessable entity response has a 4xx status code +func (o *PcloudCloudinstancesSharedImagesPutUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this pcloud cloudinstances shared images put unprocessable entity response has a 5xx status code +func (o *PcloudCloudinstancesSharedImagesPutUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this pcloud cloudinstances shared images put unprocessable entity response a status code equal to that given +func (o *PcloudCloudinstancesSharedImagesPutUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the pcloud cloudinstances shared images put unprocessable entity response +func (o *PcloudCloudinstancesSharedImagesPutUnprocessableEntity) Code() int { + return 422 +} + +func (o *PcloudCloudinstancesSharedImagesPutUnprocessableEntity) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-images][%d] pcloudCloudinstancesSharedImagesPutUnprocessableEntity %s", 422, payload) +} + +func (o *PcloudCloudinstancesSharedImagesPutUnprocessableEntity) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-images][%d] pcloudCloudinstancesSharedImagesPutUnprocessableEntity %s", 422, payload) +} + +func (o *PcloudCloudinstancesSharedImagesPutUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudCloudinstancesSharedImagesPutUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPcloudCloudinstancesSharedImagesPutInternalServerError creates a PcloudCloudinstancesSharedImagesPutInternalServerError with default headers values +func NewPcloudCloudinstancesSharedImagesPutInternalServerError() *PcloudCloudinstancesSharedImagesPutInternalServerError { + return &PcloudCloudinstancesSharedImagesPutInternalServerError{} +} + +/* +PcloudCloudinstancesSharedImagesPutInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type PcloudCloudinstancesSharedImagesPutInternalServerError struct { + Payload *models.Error +} + +// IsSuccess returns true when this pcloud cloudinstances shared images put internal server error response has a 2xx status code +func (o *PcloudCloudinstancesSharedImagesPutInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this pcloud cloudinstances shared images put internal server error response has a 3xx status code +func (o *PcloudCloudinstancesSharedImagesPutInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud cloudinstances shared images put internal server error response has a 4xx status code +func (o *PcloudCloudinstancesSharedImagesPutInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this pcloud cloudinstances shared images put internal server error response has a 5xx status code +func (o *PcloudCloudinstancesSharedImagesPutInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this pcloud cloudinstances shared images put internal server error response a status code equal to that given +func (o *PcloudCloudinstancesSharedImagesPutInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the pcloud cloudinstances shared images put internal server error response +func (o *PcloudCloudinstancesSharedImagesPutInternalServerError) Code() int { + return 500 +} + +func (o *PcloudCloudinstancesSharedImagesPutInternalServerError) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-images][%d] pcloudCloudinstancesSharedImagesPutInternalServerError %s", 500, payload) +} + +func (o *PcloudCloudinstancesSharedImagesPutInternalServerError) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-images][%d] pcloudCloudinstancesSharedImagesPutInternalServerError %s", 500, payload) +} + +func (o *PcloudCloudinstancesSharedImagesPutInternalServerError) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudCloudinstancesSharedImagesPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/p_cloud_jobs_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/p_cloud_jobs_client.go index d0231988323..d2c320b1788 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/p_cloud_jobs_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/p_cloud_jobs_client.go @@ -69,7 +69,7 @@ type ClientService interface { PcloudCloudinstancesJobsDelete deletes a cloud instance job */ func (a *Client) PcloudCloudinstancesJobsDelete(params *PcloudCloudinstancesJobsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesJobsDeleteOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudCloudinstancesJobsDeleteParams() } @@ -89,17 +89,22 @@ func (a *Client) PcloudCloudinstancesJobsDelete(params *PcloudCloudinstancesJobs for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudCloudinstancesJobsDeleteOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.jobs.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -108,7 +113,7 @@ func (a *Client) PcloudCloudinstancesJobsDelete(params *PcloudCloudinstancesJobs PcloudCloudinstancesJobsGet lists the detail of a job */ func (a *Client) PcloudCloudinstancesJobsGet(params *PcloudCloudinstancesJobsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesJobsGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudCloudinstancesJobsGetParams() } @@ -128,17 +133,22 @@ func (a *Client) PcloudCloudinstancesJobsGet(params *PcloudCloudinstancesJobsGet for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudCloudinstancesJobsGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.jobs.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -147,7 +157,7 @@ func (a *Client) PcloudCloudinstancesJobsGet(params *PcloudCloudinstancesJobsGet PcloudCloudinstancesJobsGetall lists up to the last 5 jobs initiated by the cloud instance */ func (a *Client) PcloudCloudinstancesJobsGetall(params *PcloudCloudinstancesJobsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesJobsGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudCloudinstancesJobsGetallParams() } @@ -167,17 +177,22 @@ func (a *Client) PcloudCloudinstancesJobsGetall(params *PcloudCloudinstancesJobs for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudCloudinstancesJobsGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.jobs.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_delete_responses.go index 615f8e8636a..c8f8b3995cd 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_delete_responses.go @@ -7,6 +7,7 @@ package p_cloud_jobs import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudCloudinstancesJobsDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesJobsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudCloudinstancesJobsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudCloudinstancesJobsDeleteOK() @@ -132,7 +133,7 @@ func (o *PcloudCloudinstancesJobsDeleteOK) GetPayload() models.Object { func (o *PcloudCloudinstancesJobsDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -202,7 +203,7 @@ func (o *PcloudCloudinstancesJobsDeleteBadRequest) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -272,7 +273,7 @@ func (o *PcloudCloudinstancesJobsDeleteUnauthorized) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -342,7 +343,7 @@ func (o *PcloudCloudinstancesJobsDeleteForbidden) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -412,7 +413,7 @@ func (o *PcloudCloudinstancesJobsDeleteNotFound) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -482,7 +483,7 @@ func (o *PcloudCloudinstancesJobsDeleteConflict) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -552,7 +553,7 @@ func (o *PcloudCloudinstancesJobsDeleteInternalServerError) readResponse(respons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_get_responses.go index 21e1563b355..c48ae107e77 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_jobs import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudCloudinstancesJobsGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesJobsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudCloudinstancesJobsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudCloudinstancesJobsGetOK() @@ -128,7 +129,7 @@ func (o *PcloudCloudinstancesJobsGetOK) readResponse(response runtime.ClientResp o.Payload = new(models.Job) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudCloudinstancesJobsGetBadRequest) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudCloudinstancesJobsGetUnauthorized) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudCloudinstancesJobsGetForbidden) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudCloudinstancesJobsGetNotFound) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudCloudinstancesJobsGetInternalServerError) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_getall_responses.go index c5dfea04506..dd08eb0b072 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_getall_responses.go @@ -7,6 +7,7 @@ package p_cloud_jobs import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudCloudinstancesJobsGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesJobsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudCloudinstancesJobsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudCloudinstancesJobsGetallOK() @@ -128,7 +129,7 @@ func (o *PcloudCloudinstancesJobsGetallOK) readResponse(response runtime.ClientR o.Payload = new(models.Jobs) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudCloudinstancesJobsGetallBadRequest) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudCloudinstancesJobsGetallUnauthorized) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudCloudinstancesJobsGetallForbidden) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudCloudinstancesJobsGetallNotFound) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudCloudinstancesJobsGetallInternalServerError) readResponse(respons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/p_cloud_networks_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/p_cloud_networks_client.go index 5f97d7f292f..813a3da98b4 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/p_cloud_networks_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/p_cloud_networks_client.go @@ -83,7 +83,7 @@ type ClientService interface { PcloudNetworksDelete deletes a network */ func (a *Client) PcloudNetworksDelete(params *PcloudNetworksDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksDeleteOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudNetworksDeleteParams() } @@ -103,17 +103,22 @@ func (a *Client) PcloudNetworksDelete(params *PcloudNetworksDeleteParams, authIn for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudNetworksDeleteOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.networks.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -122,7 +127,7 @@ func (a *Client) PcloudNetworksDelete(params *PcloudNetworksDeleteParams, authIn PcloudNetworksGet gets a network s current state information */ func (a *Client) PcloudNetworksGet(params *PcloudNetworksGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudNetworksGetParams() } @@ -142,17 +147,22 @@ func (a *Client) PcloudNetworksGet(params *PcloudNetworksGetParams, authInfo run for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudNetworksGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.networks.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -161,7 +171,7 @@ func (a *Client) PcloudNetworksGet(params *PcloudNetworksGetParams, authInfo run PcloudNetworksGetall gets all networks in this cloud instance */ func (a *Client) PcloudNetworksGetall(params *PcloudNetworksGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudNetworksGetallParams() } @@ -181,17 +191,22 @@ func (a *Client) PcloudNetworksGetall(params *PcloudNetworksGetallParams, authIn for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudNetworksGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.networks.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -202,7 +217,7 @@ PcloudNetworksPortsDelete deletes a network port This API is deprecated for /v1/networks/{network_id}/network-interfaces/{network_interface_id}. */ func (a *Client) PcloudNetworksPortsDelete(params *PcloudNetworksPortsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksPortsDeleteOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudNetworksPortsDeleteParams() } @@ -222,17 +237,22 @@ func (a *Client) PcloudNetworksPortsDelete(params *PcloudNetworksPortsDeletePara for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudNetworksPortsDeleteOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.networks.ports.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -243,7 +263,7 @@ PcloudNetworksPortsGet gets a port s information This API is deprecated for /v1/networks/{network_id}/network-interfaces/{network_interface_id}. */ func (a *Client) PcloudNetworksPortsGet(params *PcloudNetworksPortsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksPortsGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudNetworksPortsGetParams() } @@ -263,17 +283,22 @@ func (a *Client) PcloudNetworksPortsGet(params *PcloudNetworksPortsGetParams, au for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudNetworksPortsGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.networks.ports.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -284,7 +309,7 @@ PcloudNetworksPortsGetall gets all ports for this network This API is deprecated for /v1/networks/{network_id}/network-interfaces. */ func (a *Client) PcloudNetworksPortsGetall(params *PcloudNetworksPortsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksPortsGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudNetworksPortsGetallParams() } @@ -304,17 +329,22 @@ func (a *Client) PcloudNetworksPortsGetall(params *PcloudNetworksPortsGetallPara for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudNetworksPortsGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.networks.ports.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -325,7 +355,7 @@ PcloudNetworksPortsPost performs port addition deletion and listing This API is deprecated for /v1/networks/{network_id}/network-interfaces. */ func (a *Client) PcloudNetworksPortsPost(params *PcloudNetworksPortsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksPortsPostCreated, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudNetworksPortsPostParams() } @@ -345,17 +375,22 @@ func (a *Client) PcloudNetworksPortsPost(params *PcloudNetworksPortsPostParams, for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudNetworksPortsPostCreated) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.networks.ports.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -366,7 +401,7 @@ PcloudNetworksPortsPut updates a port s information This API is deprecated for /v1/networks/{network_id}/network-interfaces/{network_interface_id}. */ func (a *Client) PcloudNetworksPortsPut(params *PcloudNetworksPortsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksPortsPutOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudNetworksPortsPutParams() } @@ -386,17 +421,22 @@ func (a *Client) PcloudNetworksPortsPut(params *PcloudNetworksPortsPutParams, au for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudNetworksPortsPutOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.networks.ports.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -405,7 +445,7 @@ func (a *Client) PcloudNetworksPortsPut(params *PcloudNetworksPortsPutParams, au PcloudNetworksPost creates a new network */ func (a *Client) PcloudNetworksPost(params *PcloudNetworksPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksPostOK, *PcloudNetworksPostCreated, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudNetworksPostParams() } @@ -425,18 +465,22 @@ func (a *Client) PcloudNetworksPost(params *PcloudNetworksPostParams, authInfo r for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } + + // several success responses have to be checked switch value := result.(type) { case *PcloudNetworksPostOK: return value, nil, nil case *PcloudNetworksPostCreated: return nil, value, nil } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for p_cloud_networks: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -445,7 +489,7 @@ func (a *Client) PcloudNetworksPost(params *PcloudNetworksPostParams, authInfo r PcloudNetworksPut updates a network */ func (a *Client) PcloudNetworksPut(params *PcloudNetworksPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudNetworksPutOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudNetworksPutParams() } @@ -465,17 +509,22 @@ func (a *Client) PcloudNetworksPut(params *PcloudNetworksPutParams, authInfo run for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudNetworksPutOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.networks.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_delete_responses.go index e16ec77985a..698d19fb955 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_delete_responses.go @@ -7,6 +7,7 @@ package p_cloud_networks import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudNetworksDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudNetworksDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudNetworksDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudNetworksDeleteOK() @@ -54,6 +55,12 @@ func (o *PcloudNetworksDeleteReader) ReadResponse(response runtime.ClientRespons return nil, err } return nil, result + case 409: + result := NewPcloudNetworksDeleteConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result case 410: result := NewPcloudNetworksDeleteGone() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -132,7 +139,7 @@ func (o *PcloudNetworksDeleteOK) GetPayload() models.Object { func (o *PcloudNetworksDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -202,7 +209,7 @@ func (o *PcloudNetworksDeleteBadRequest) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -272,7 +279,7 @@ func (o *PcloudNetworksDeleteUnauthorized) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -342,7 +349,7 @@ func (o *PcloudNetworksDeleteForbidden) readResponse(response runtime.ClientResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -412,7 +419,77 @@ func (o *PcloudNetworksDeleteNotFound) readResponse(response runtime.ClientRespo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPcloudNetworksDeleteConflict creates a PcloudNetworksDeleteConflict with default headers values +func NewPcloudNetworksDeleteConflict() *PcloudNetworksDeleteConflict { + return &PcloudNetworksDeleteConflict{} +} + +/* +PcloudNetworksDeleteConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type PcloudNetworksDeleteConflict struct { + Payload *models.Error +} + +// IsSuccess returns true when this pcloud networks delete conflict response has a 2xx status code +func (o *PcloudNetworksDeleteConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this pcloud networks delete conflict response has a 3xx status code +func (o *PcloudNetworksDeleteConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud networks delete conflict response has a 4xx status code +func (o *PcloudNetworksDeleteConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this pcloud networks delete conflict response has a 5xx status code +func (o *PcloudNetworksDeleteConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this pcloud networks delete conflict response a status code equal to that given +func (o *PcloudNetworksDeleteConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the pcloud networks delete conflict response +func (o *PcloudNetworksDeleteConflict) Code() int { + return 409 +} + +func (o *PcloudNetworksDeleteConflict) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksDeleteConflict %s", 409, payload) +} + +func (o *PcloudNetworksDeleteConflict) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksDeleteConflict %s", 409, payload) +} + +func (o *PcloudNetworksDeleteConflict) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudNetworksDeleteConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -482,7 +559,7 @@ func (o *PcloudNetworksDeleteGone) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -552,7 +629,7 @@ func (o *PcloudNetworksDeleteInternalServerError) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_get_responses.go index ab247e2e988..ee328cce7a8 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_networks import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudNetworksGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudNetworksGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudNetworksGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudNetworksGetOK() @@ -128,7 +129,7 @@ func (o *PcloudNetworksGetOK) readResponse(response runtime.ClientResponse, cons o.Payload = new(models.Network) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudNetworksGetBadRequest) readResponse(response runtime.ClientRespon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudNetworksGetUnauthorized) readResponse(response runtime.ClientResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudNetworksGetForbidden) readResponse(response runtime.ClientRespons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudNetworksGetNotFound) readResponse(response runtime.ClientResponse o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudNetworksGetInternalServerError) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_getall_responses.go index fbb2e47c06c..3cc9cfd8c0c 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_getall_responses.go @@ -7,6 +7,7 @@ package p_cloud_networks import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudNetworksGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudNetworksGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudNetworksGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudNetworksGetallOK() @@ -128,7 +129,7 @@ func (o *PcloudNetworksGetallOK) readResponse(response runtime.ClientResponse, c o.Payload = new(models.Networks) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudNetworksGetallBadRequest) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudNetworksGetallUnauthorized) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudNetworksGetallForbidden) readResponse(response runtime.ClientResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudNetworksGetallNotFound) readResponse(response runtime.ClientRespo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudNetworksGetallInternalServerError) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_delete_responses.go index dad8ee6a6c4..cca8a3fae12 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_delete_responses.go @@ -7,6 +7,7 @@ package p_cloud_networks import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudNetworksPortsDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudNetworksPortsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudNetworksPortsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudNetworksPortsDeleteOK() @@ -132,7 +133,7 @@ func (o *PcloudNetworksPortsDeleteOK) GetPayload() models.Object { func (o *PcloudNetworksPortsDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -202,7 +203,7 @@ func (o *PcloudNetworksPortsDeleteBadRequest) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -272,7 +273,7 @@ func (o *PcloudNetworksPortsDeleteUnauthorized) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -342,7 +343,7 @@ func (o *PcloudNetworksPortsDeleteForbidden) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -412,7 +413,7 @@ func (o *PcloudNetworksPortsDeleteNotFound) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -482,7 +483,7 @@ func (o *PcloudNetworksPortsDeleteGone) readResponse(response runtime.ClientResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -552,7 +553,7 @@ func (o *PcloudNetworksPortsDeleteInternalServerError) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_get_responses.go index f9591f57f8a..7f5d16553b9 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_networks import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudNetworksPortsGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudNetworksPortsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudNetworksPortsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudNetworksPortsGetOK() @@ -128,7 +129,7 @@ func (o *PcloudNetworksPortsGetOK) readResponse(response runtime.ClientResponse, o.Payload = new(models.NetworkPort) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudNetworksPortsGetBadRequest) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudNetworksPortsGetUnauthorized) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudNetworksPortsGetForbidden) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudNetworksPortsGetNotFound) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudNetworksPortsGetInternalServerError) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_getall_responses.go index 0c8c61652d2..e92d4e1eabe 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_getall_responses.go @@ -7,6 +7,7 @@ package p_cloud_networks import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudNetworksPortsGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudNetworksPortsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudNetworksPortsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudNetworksPortsGetallOK() @@ -128,7 +129,7 @@ func (o *PcloudNetworksPortsGetallOK) readResponse(response runtime.ClientRespon o.Payload = new(models.NetworkPorts) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudNetworksPortsGetallBadRequest) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudNetworksPortsGetallUnauthorized) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudNetworksPortsGetallForbidden) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudNetworksPortsGetallNotFound) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudNetworksPortsGetallInternalServerError) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_post_responses.go index b596576980d..acb70ec2760 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_networks import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudNetworksPortsPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudNetworksPortsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudNetworksPortsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 201: result := NewPcloudNetworksPortsPostCreated() @@ -140,7 +141,7 @@ func (o *PcloudNetworksPortsPostCreated) readResponse(response runtime.ClientRes o.Payload = new(models.NetworkPort) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -210,7 +211,7 @@ func (o *PcloudNetworksPortsPostBadRequest) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -280,7 +281,7 @@ func (o *PcloudNetworksPortsPostUnauthorized) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -350,7 +351,7 @@ func (o *PcloudNetworksPortsPostForbidden) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -420,7 +421,7 @@ func (o *PcloudNetworksPortsPostNotFound) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -490,7 +491,7 @@ func (o *PcloudNetworksPortsPostConflict) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -560,7 +561,7 @@ func (o *PcloudNetworksPortsPostUnprocessableEntity) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -630,7 +631,7 @@ func (o *PcloudNetworksPortsPostInternalServerError) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_put_responses.go index 28ef8ea09ed..24e24248616 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_ports_put_responses.go @@ -7,6 +7,7 @@ package p_cloud_networks import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudNetworksPortsPutReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudNetworksPortsPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudNetworksPortsPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudNetworksPortsPutOK() @@ -134,7 +135,7 @@ func (o *PcloudNetworksPortsPutOK) readResponse(response runtime.ClientResponse, o.Payload = new(models.NetworkPort) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *PcloudNetworksPortsPutBadRequest) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *PcloudNetworksPortsPutUnauthorized) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *PcloudNetworksPortsPutForbidden) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *PcloudNetworksPortsPutNotFound) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *PcloudNetworksPortsPutUnprocessableEntity) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *PcloudNetworksPortsPutInternalServerError) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_post_responses.go index 982c363ef9e..cf8f139c3a4 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_networks import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudNetworksPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudNetworksPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudNetworksPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudNetworksPostOK() @@ -152,7 +153,7 @@ func (o *PcloudNetworksPostOK) readResponse(response runtime.ClientResponse, con o.Payload = new(models.Network) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -222,7 +223,7 @@ func (o *PcloudNetworksPostCreated) readResponse(response runtime.ClientResponse o.Payload = new(models.Network) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -292,7 +293,7 @@ func (o *PcloudNetworksPostBadRequest) readResponse(response runtime.ClientRespo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -362,7 +363,7 @@ func (o *PcloudNetworksPostUnauthorized) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -432,7 +433,7 @@ func (o *PcloudNetworksPostForbidden) readResponse(response runtime.ClientRespon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -502,7 +503,7 @@ func (o *PcloudNetworksPostNotFound) readResponse(response runtime.ClientRespons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -572,7 +573,7 @@ func (o *PcloudNetworksPostConflict) readResponse(response runtime.ClientRespons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -642,7 +643,7 @@ func (o *PcloudNetworksPostUnprocessableEntity) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -712,7 +713,7 @@ func (o *PcloudNetworksPostInternalServerError) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -782,7 +783,7 @@ func (o *PcloudNetworksPostStatus550) readResponse(response runtime.ClientRespon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_put_responses.go index 406d09f8aed..bae9405a259 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks/pcloud_networks_put_responses.go @@ -7,6 +7,7 @@ package p_cloud_networks import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudNetworksPutReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudNetworksPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudNetworksPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudNetworksPutOK() @@ -134,7 +135,7 @@ func (o *PcloudNetworksPutOK) readResponse(response runtime.ClientResponse, cons o.Payload = new(models.Network) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *PcloudNetworksPutBadRequest) readResponse(response runtime.ClientRespon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *PcloudNetworksPutUnauthorized) readResponse(response runtime.ClientResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *PcloudNetworksPutForbidden) readResponse(response runtime.ClientRespons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *PcloudNetworksPutNotFound) readResponse(response runtime.ClientResponse o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *PcloudNetworksPutUnprocessableEntity) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *PcloudNetworksPutInternalServerError) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/p_cloudp_vm_instances_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/p_cloudp_vm_instances_client.go index 372270f55dc..11dbd38e4c2 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/p_cloudp_vm_instances_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/p_cloudp_vm_instances_client.go @@ -109,7 +109,7 @@ PcloudPvminstancesActionPost performs an action on a p VM instance Corresponding actions are 'start', 'stop', 'reboot', 'immediate-shutdown', 'reset' */ func (a *Client) PcloudPvminstancesActionPost(params *PcloudPvminstancesActionPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesActionPostOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudPvminstancesActionPostParams() } @@ -129,17 +129,22 @@ func (a *Client) PcloudPvminstancesActionPost(params *PcloudPvminstancesActionPo for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudPvminstancesActionPostOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.action.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -152,7 +157,7 @@ func (a *Client) PcloudPvminstancesActionPost(params *PcloudPvminstancesActionPo >*Note*: Support for this API is available till Oct 2022. */ func (a *Client) PcloudPvminstancesCapturePost(params *PcloudPvminstancesCapturePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesCapturePostOK, *PcloudPvminstancesCapturePostAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudPvminstancesCapturePostParams() } @@ -172,18 +177,22 @@ func (a *Client) PcloudPvminstancesCapturePost(params *PcloudPvminstancesCapture for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } + + // several success responses have to be checked switch value := result.(type) { case *PcloudPvminstancesCapturePostOK: return value, nil, nil case *PcloudPvminstancesCapturePostAccepted: return nil, value, nil } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for p_cloud_p_vm_instances: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -192,7 +201,7 @@ func (a *Client) PcloudPvminstancesCapturePost(params *PcloudPvminstancesCapture PcloudPvminstancesClonePost clones a p VM instance */ func (a *Client) PcloudPvminstancesClonePost(params *PcloudPvminstancesClonePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesClonePostAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudPvminstancesClonePostParams() } @@ -212,17 +221,22 @@ func (a *Client) PcloudPvminstancesClonePost(params *PcloudPvminstancesClonePost for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudPvminstancesClonePostAccepted) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.clone.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -231,7 +245,7 @@ func (a *Client) PcloudPvminstancesClonePost(params *PcloudPvminstancesClonePost PcloudPvminstancesConsoleGet lists all console languages */ func (a *Client) PcloudPvminstancesConsoleGet(params *PcloudPvminstancesConsoleGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesConsoleGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudPvminstancesConsoleGetParams() } @@ -251,17 +265,22 @@ func (a *Client) PcloudPvminstancesConsoleGet(params *PcloudPvminstancesConsoleG for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudPvminstancesConsoleGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.console.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -270,7 +289,7 @@ func (a *Client) PcloudPvminstancesConsoleGet(params *PcloudPvminstancesConsoleG PcloudPvminstancesConsolePost generates the no v n c console URL */ func (a *Client) PcloudPvminstancesConsolePost(params *PcloudPvminstancesConsolePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesConsolePostCreated, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudPvminstancesConsolePostParams() } @@ -290,17 +309,22 @@ func (a *Client) PcloudPvminstancesConsolePost(params *PcloudPvminstancesConsole for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudPvminstancesConsolePostCreated) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.console.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -309,7 +333,7 @@ func (a *Client) PcloudPvminstancesConsolePost(params *PcloudPvminstancesConsole PcloudPvminstancesConsolePut updates p VM instance console language code */ func (a *Client) PcloudPvminstancesConsolePut(params *PcloudPvminstancesConsolePutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesConsolePutOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudPvminstancesConsolePutParams() } @@ -329,17 +353,22 @@ func (a *Client) PcloudPvminstancesConsolePut(params *PcloudPvminstancesConsoleP for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudPvminstancesConsolePutOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.console.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -348,7 +377,7 @@ func (a *Client) PcloudPvminstancesConsolePut(params *PcloudPvminstancesConsoleP PcloudPvminstancesDelete deletes a p cloud p VM instance */ func (a *Client) PcloudPvminstancesDelete(params *PcloudPvminstancesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesDeleteOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudPvminstancesDeleteParams() } @@ -368,17 +397,22 @@ func (a *Client) PcloudPvminstancesDelete(params *PcloudPvminstancesDeleteParams for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudPvminstancesDeleteOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -387,7 +421,7 @@ func (a *Client) PcloudPvminstancesDelete(params *PcloudPvminstancesDeleteParams PcloudPvminstancesGet gets a p VM instance s current state or information */ func (a *Client) PcloudPvminstancesGet(params *PcloudPvminstancesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudPvminstancesGetParams() } @@ -407,17 +441,22 @@ func (a *Client) PcloudPvminstancesGet(params *PcloudPvminstancesGetParams, auth for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudPvminstancesGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -426,7 +465,7 @@ func (a *Client) PcloudPvminstancesGet(params *PcloudPvminstancesGetParams, auth PcloudPvminstancesGetall gets all the pvm instances for this cloud instance */ func (a *Client) PcloudPvminstancesGetall(params *PcloudPvminstancesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudPvminstancesGetallParams() } @@ -446,17 +485,22 @@ func (a *Client) PcloudPvminstancesGetall(params *PcloudPvminstancesGetallParams for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudPvminstancesGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -465,7 +509,7 @@ func (a *Client) PcloudPvminstancesGetall(params *PcloudPvminstancesGetallParams PcloudPvminstancesNetworksDelete removes all address of network from a p VM instance */ func (a *Client) PcloudPvminstancesNetworksDelete(params *PcloudPvminstancesNetworksDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesNetworksDeleteOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudPvminstancesNetworksDeleteParams() } @@ -485,17 +529,22 @@ func (a *Client) PcloudPvminstancesNetworksDelete(params *PcloudPvminstancesNetw for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudPvminstancesNetworksDeleteOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.networks.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -504,7 +553,7 @@ func (a *Client) PcloudPvminstancesNetworksDelete(params *PcloudPvminstancesNetw PcloudPvminstancesNetworksGet gets a p VM instance s network information */ func (a *Client) PcloudPvminstancesNetworksGet(params *PcloudPvminstancesNetworksGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesNetworksGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudPvminstancesNetworksGetParams() } @@ -524,17 +573,22 @@ func (a *Client) PcloudPvminstancesNetworksGet(params *PcloudPvminstancesNetwork for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudPvminstancesNetworksGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.networks.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -543,7 +597,7 @@ func (a *Client) PcloudPvminstancesNetworksGet(params *PcloudPvminstancesNetwork PcloudPvminstancesNetworksGetall gets all networks for this p VM instance */ func (a *Client) PcloudPvminstancesNetworksGetall(params *PcloudPvminstancesNetworksGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesNetworksGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudPvminstancesNetworksGetallParams() } @@ -563,17 +617,22 @@ func (a *Client) PcloudPvminstancesNetworksGetall(params *PcloudPvminstancesNetw for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudPvminstancesNetworksGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.networks.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -582,7 +641,7 @@ func (a *Client) PcloudPvminstancesNetworksGetall(params *PcloudPvminstancesNetw PcloudPvminstancesNetworksPost performs network addition */ func (a *Client) PcloudPvminstancesNetworksPost(params *PcloudPvminstancesNetworksPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesNetworksPostCreated, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudPvminstancesNetworksPostParams() } @@ -602,17 +661,22 @@ func (a *Client) PcloudPvminstancesNetworksPost(params *PcloudPvminstancesNetwor for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudPvminstancesNetworksPostCreated) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.networks.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -621,7 +685,7 @@ func (a *Client) PcloudPvminstancesNetworksPost(params *PcloudPvminstancesNetwor PcloudPvminstancesOperationsPost performs an operation on a p VM instance */ func (a *Client) PcloudPvminstancesOperationsPost(params *PcloudPvminstancesOperationsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesOperationsPostOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudPvminstancesOperationsPostParams() } @@ -641,17 +705,22 @@ func (a *Client) PcloudPvminstancesOperationsPost(params *PcloudPvminstancesOper for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudPvminstancesOperationsPostOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.operations.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -660,7 +729,7 @@ func (a *Client) PcloudPvminstancesOperationsPost(params *PcloudPvminstancesOper PcloudPvminstancesPost creates a new power VM instance */ func (a *Client) PcloudPvminstancesPost(params *PcloudPvminstancesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesPostOK, *PcloudPvminstancesPostCreated, *PcloudPvminstancesPostAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudPvminstancesPostParams() } @@ -680,11 +749,12 @@ func (a *Client) PcloudPvminstancesPost(params *PcloudPvminstancesPostParams, au for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, nil, nil, err } + + // several success responses have to be checked switch value := result.(type) { case *PcloudPvminstancesPostOK: return value, nil, nil, nil @@ -693,7 +763,10 @@ func (a *Client) PcloudPvminstancesPost(params *PcloudPvminstancesPostParams, au case *PcloudPvminstancesPostAccepted: return nil, nil, value, nil } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for p_cloud_p_vm_instances: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -702,7 +775,7 @@ func (a *Client) PcloudPvminstancesPost(params *PcloudPvminstancesPostParams, au PcloudPvminstancesPut updates a p cloud p VM instance */ func (a *Client) PcloudPvminstancesPut(params *PcloudPvminstancesPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesPutAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudPvminstancesPutParams() } @@ -722,17 +795,22 @@ func (a *Client) PcloudPvminstancesPut(params *PcloudPvminstancesPutParams, auth for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudPvminstancesPutAccepted) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -741,7 +819,7 @@ func (a *Client) PcloudPvminstancesPut(params *PcloudPvminstancesPutParams, auth PcloudPvminstancesSnapshotsGetall gets all snapshots for this p VM instance */ func (a *Client) PcloudPvminstancesSnapshotsGetall(params *PcloudPvminstancesSnapshotsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesSnapshotsGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudPvminstancesSnapshotsGetallParams() } @@ -761,17 +839,22 @@ func (a *Client) PcloudPvminstancesSnapshotsGetall(params *PcloudPvminstancesSna for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudPvminstancesSnapshotsGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.snapshots.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -780,7 +863,7 @@ func (a *Client) PcloudPvminstancesSnapshotsGetall(params *PcloudPvminstancesSna PcloudPvminstancesSnapshotsPost creates a p VM instance snapshot */ func (a *Client) PcloudPvminstancesSnapshotsPost(params *PcloudPvminstancesSnapshotsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesSnapshotsPostAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudPvminstancesSnapshotsPostParams() } @@ -800,17 +883,22 @@ func (a *Client) PcloudPvminstancesSnapshotsPost(params *PcloudPvminstancesSnaps for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudPvminstancesSnapshotsPostAccepted) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.snapshots.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -819,7 +907,7 @@ func (a *Client) PcloudPvminstancesSnapshotsPost(params *PcloudPvminstancesSnaps PcloudPvminstancesSnapshotsRestorePost restores a p VM instance snapshot */ func (a *Client) PcloudPvminstancesSnapshotsRestorePost(params *PcloudPvminstancesSnapshotsRestorePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesSnapshotsRestorePostAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudPvminstancesSnapshotsRestorePostParams() } @@ -839,17 +927,22 @@ func (a *Client) PcloudPvminstancesSnapshotsRestorePost(params *PcloudPvminstanc for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudPvminstancesSnapshotsRestorePostAccepted) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.snapshots.restore.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -858,7 +951,7 @@ func (a *Client) PcloudPvminstancesSnapshotsRestorePost(params *PcloudPvminstanc PcloudV2PvminstancesCaptureGet gets detail of last capture job */ func (a *Client) PcloudV2PvminstancesCaptureGet(params *PcloudV2PvminstancesCaptureGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2PvminstancesCaptureGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudV2PvminstancesCaptureGetParams() } @@ -878,17 +971,22 @@ func (a *Client) PcloudV2PvminstancesCaptureGet(params *PcloudV2PvminstancesCapt for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudV2PvminstancesCaptureGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.v2.pvminstances.capture.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -897,7 +995,7 @@ func (a *Client) PcloudV2PvminstancesCaptureGet(params *PcloudV2PvminstancesCapt PcloudV2PvminstancesCapturePost adds a capture pvm instance to the jobs queue */ func (a *Client) PcloudV2PvminstancesCapturePost(params *PcloudV2PvminstancesCapturePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2PvminstancesCapturePostAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudV2PvminstancesCapturePostParams() } @@ -917,17 +1015,22 @@ func (a *Client) PcloudV2PvminstancesCapturePost(params *PcloudV2PvminstancesCap for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudV2PvminstancesCapturePostAccepted) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.v2.pvminstances.capture.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -936,7 +1039,7 @@ func (a *Client) PcloudV2PvminstancesCapturePost(params *PcloudV2PvminstancesCap PcloudV2PvminstancesGetall gets all the pvm instances for this cloud instance */ func (a *Client) PcloudV2PvminstancesGetall(params *PcloudV2PvminstancesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2PvminstancesGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudV2PvminstancesGetallParams() } @@ -956,17 +1059,22 @@ func (a *Client) PcloudV2PvminstancesGetall(params *PcloudV2PvminstancesGetallPa for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudV2PvminstancesGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.v2.pvminstances.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_action_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_action_post_responses.go index e97e8aed16a..64bd276f4e3 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_action_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_action_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_p_vm_instances import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudPvminstancesActionPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesActionPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudPvminstancesActionPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudPvminstancesActionPostOK() @@ -132,7 +133,7 @@ func (o *PcloudPvminstancesActionPostOK) GetPayload() models.Object { func (o *PcloudPvminstancesActionPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -202,7 +203,7 @@ func (o *PcloudPvminstancesActionPostBadRequest) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -272,7 +273,7 @@ func (o *PcloudPvminstancesActionPostUnauthorized) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -342,7 +343,7 @@ func (o *PcloudPvminstancesActionPostForbidden) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -412,7 +413,7 @@ func (o *PcloudPvminstancesActionPostNotFound) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -482,7 +483,7 @@ func (o *PcloudPvminstancesActionPostConflict) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -552,7 +553,7 @@ func (o *PcloudPvminstancesActionPostInternalServerError) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_capture_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_capture_post_responses.go index 277a94d13bf..b5029ab08f9 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_capture_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_capture_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_p_vm_instances import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudPvminstancesCapturePostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesCapturePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudPvminstancesCapturePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudPvminstancesCapturePostOK() @@ -144,7 +145,7 @@ func (o *PcloudPvminstancesCapturePostOK) GetPayload() models.Object { func (o *PcloudPvminstancesCapturePostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -212,7 +213,7 @@ func (o *PcloudPvminstancesCapturePostAccepted) GetPayload() models.Object { func (o *PcloudPvminstancesCapturePostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -282,7 +283,7 @@ func (o *PcloudPvminstancesCapturePostBadRequest) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -352,7 +353,7 @@ func (o *PcloudPvminstancesCapturePostUnauthorized) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -422,7 +423,7 @@ func (o *PcloudPvminstancesCapturePostForbidden) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -492,7 +493,7 @@ func (o *PcloudPvminstancesCapturePostNotFound) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -562,7 +563,7 @@ func (o *PcloudPvminstancesCapturePostConflict) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -632,7 +633,7 @@ func (o *PcloudPvminstancesCapturePostUnprocessableEntity) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -702,7 +703,7 @@ func (o *PcloudPvminstancesCapturePostInternalServerError) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_clone_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_clone_post_responses.go index 60397da2b3d..ffd895e4e14 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_clone_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_clone_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_p_vm_instances import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudPvminstancesClonePostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesClonePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudPvminstancesClonePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 202: result := NewPcloudPvminstancesClonePostAccepted() @@ -146,7 +147,7 @@ func (o *PcloudPvminstancesClonePostAccepted) readResponse(response runtime.Clie o.Payload = new(models.PVMInstance) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -216,7 +217,7 @@ func (o *PcloudPvminstancesClonePostBadRequest) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -286,7 +287,7 @@ func (o *PcloudPvminstancesClonePostUnauthorized) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -356,7 +357,7 @@ func (o *PcloudPvminstancesClonePostForbidden) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -426,7 +427,7 @@ func (o *PcloudPvminstancesClonePostNotFound) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -496,7 +497,7 @@ func (o *PcloudPvminstancesClonePostConflict) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -566,7 +567,7 @@ func (o *PcloudPvminstancesClonePostGone) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -636,7 +637,7 @@ func (o *PcloudPvminstancesClonePostUnprocessableEntity) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -706,7 +707,7 @@ func (o *PcloudPvminstancesClonePostInternalServerError) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_get_responses.go index 85083359d9e..8ca5a2ad606 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_p_vm_instances import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudPvminstancesConsoleGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesConsoleGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudPvminstancesConsoleGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudPvminstancesConsoleGetOK() @@ -128,7 +129,7 @@ func (o *PcloudPvminstancesConsoleGetOK) readResponse(response runtime.ClientRes o.Payload = new(models.ConsoleLanguages) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudPvminstancesConsoleGetBadRequest) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudPvminstancesConsoleGetUnauthorized) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudPvminstancesConsoleGetForbidden) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudPvminstancesConsoleGetNotFound) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudPvminstancesConsoleGetInternalServerError) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_post_responses.go index 7bbc67ed62f..c785c3df7f2 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_p_vm_instances import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudPvminstancesConsolePostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesConsolePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudPvminstancesConsolePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 201: result := NewPcloudPvminstancesConsolePostCreated() @@ -140,7 +141,7 @@ func (o *PcloudPvminstancesConsolePostCreated) readResponse(response runtime.Cli o.Payload = new(models.PVMInstanceConsole) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -210,7 +211,7 @@ func (o *PcloudPvminstancesConsolePostBadRequest) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -280,7 +281,7 @@ func (o *PcloudPvminstancesConsolePostUnauthorized) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -350,7 +351,7 @@ func (o *PcloudPvminstancesConsolePostForbidden) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -420,7 +421,7 @@ func (o *PcloudPvminstancesConsolePostNotFound) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -490,7 +491,7 @@ func (o *PcloudPvminstancesConsolePostConflict) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -560,7 +561,7 @@ func (o *PcloudPvminstancesConsolePostUnprocessableEntity) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -630,7 +631,7 @@ func (o *PcloudPvminstancesConsolePostInternalServerError) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_put_responses.go index 21f30b57ea7..fd1d1dbc266 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_console_put_responses.go @@ -7,6 +7,7 @@ package p_cloud_p_vm_instances import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudPvminstancesConsolePutReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesConsolePutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudPvminstancesConsolePutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudPvminstancesConsolePutOK() @@ -134,7 +135,7 @@ func (o *PcloudPvminstancesConsolePutOK) readResponse(response runtime.ClientRes o.Payload = new(models.ConsoleLanguage) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *PcloudPvminstancesConsolePutBadRequest) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *PcloudPvminstancesConsolePutUnauthorized) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *PcloudPvminstancesConsolePutForbidden) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *PcloudPvminstancesConsolePutNotFound) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *PcloudPvminstancesConsolePutConflict) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *PcloudPvminstancesConsolePutInternalServerError) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_delete_responses.go index 19f033b09b9..286b75891e4 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_delete_responses.go @@ -7,6 +7,7 @@ package p_cloud_p_vm_instances import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudPvminstancesDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudPvminstancesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudPvminstancesDeleteOK() @@ -138,7 +139,7 @@ func (o *PcloudPvminstancesDeleteOK) GetPayload() models.Object { func (o *PcloudPvminstancesDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -208,7 +209,7 @@ func (o *PcloudPvminstancesDeleteBadRequest) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -278,7 +279,7 @@ func (o *PcloudPvminstancesDeleteUnauthorized) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -348,7 +349,7 @@ func (o *PcloudPvminstancesDeleteForbidden) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -418,7 +419,7 @@ func (o *PcloudPvminstancesDeleteNotFound) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -488,7 +489,7 @@ func (o *PcloudPvminstancesDeleteConflict) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -558,7 +559,7 @@ func (o *PcloudPvminstancesDeleteGone) readResponse(response runtime.ClientRespo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -628,7 +629,7 @@ func (o *PcloudPvminstancesDeleteInternalServerError) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_get_responses.go index c520c6c9e31..31988f4de6f 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_p_vm_instances import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudPvminstancesGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudPvminstancesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudPvminstancesGetOK() @@ -128,7 +129,7 @@ func (o *PcloudPvminstancesGetOK) readResponse(response runtime.ClientResponse, o.Payload = new(models.PVMInstance) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudPvminstancesGetBadRequest) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudPvminstancesGetUnauthorized) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudPvminstancesGetForbidden) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudPvminstancesGetNotFound) readResponse(response runtime.ClientResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudPvminstancesGetInternalServerError) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_getall_responses.go index 411ef74ba62..beb4cea75a0 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_getall_responses.go @@ -7,6 +7,7 @@ package p_cloud_p_vm_instances import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudPvminstancesGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudPvminstancesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudPvminstancesGetallOK() @@ -134,7 +135,7 @@ func (o *PcloudPvminstancesGetallOK) readResponse(response runtime.ClientRespons o.Payload = new(models.PVMInstances) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *PcloudPvminstancesGetallBadRequest) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *PcloudPvminstancesGetallUnauthorized) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *PcloudPvminstancesGetallForbidden) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *PcloudPvminstancesGetallNotFound) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *PcloudPvminstancesGetallRequestTimeout) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *PcloudPvminstancesGetallInternalServerError) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_delete_responses.go index 6649946ad13..b08fd400e81 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_delete_responses.go @@ -7,6 +7,7 @@ package p_cloud_p_vm_instances import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudPvminstancesNetworksDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesNetworksDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudPvminstancesNetworksDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudPvminstancesNetworksDeleteOK() @@ -138,7 +139,7 @@ func (o *PcloudPvminstancesNetworksDeleteOK) GetPayload() models.Object { func (o *PcloudPvminstancesNetworksDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -208,7 +209,7 @@ func (o *PcloudPvminstancesNetworksDeleteBadRequest) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -278,7 +279,7 @@ func (o *PcloudPvminstancesNetworksDeleteUnauthorized) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -348,7 +349,7 @@ func (o *PcloudPvminstancesNetworksDeleteForbidden) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -418,7 +419,7 @@ func (o *PcloudPvminstancesNetworksDeleteNotFound) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -488,7 +489,7 @@ func (o *PcloudPvminstancesNetworksDeleteConflict) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -558,7 +559,7 @@ func (o *PcloudPvminstancesNetworksDeleteGone) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -628,7 +629,7 @@ func (o *PcloudPvminstancesNetworksDeleteInternalServerError) readResponse(respo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_get_responses.go index 066032b9312..cea8703c1d0 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_p_vm_instances import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudPvminstancesNetworksGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesNetworksGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudPvminstancesNetworksGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudPvminstancesNetworksGetOK() @@ -128,7 +129,7 @@ func (o *PcloudPvminstancesNetworksGetOK) readResponse(response runtime.ClientRe o.Payload = new(models.PVMInstanceNetworks) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudPvminstancesNetworksGetBadRequest) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudPvminstancesNetworksGetUnauthorized) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudPvminstancesNetworksGetForbidden) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudPvminstancesNetworksGetNotFound) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudPvminstancesNetworksGetInternalServerError) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_getall_responses.go index 1c6a6f10012..e75d513cbb3 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_getall_responses.go @@ -7,6 +7,7 @@ package p_cloud_p_vm_instances import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudPvminstancesNetworksGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesNetworksGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudPvminstancesNetworksGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudPvminstancesNetworksGetallOK() @@ -128,7 +129,7 @@ func (o *PcloudPvminstancesNetworksGetallOK) readResponse(response runtime.Clien o.Payload = new(models.PVMInstanceNetworks) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudPvminstancesNetworksGetallBadRequest) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudPvminstancesNetworksGetallUnauthorized) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudPvminstancesNetworksGetallForbidden) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudPvminstancesNetworksGetallNotFound) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudPvminstancesNetworksGetallInternalServerError) readResponse(respo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_post_responses.go index 9048edeefcd..05bd41d23bc 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_networks_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_p_vm_instances import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudPvminstancesNetworksPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesNetworksPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudPvminstancesNetworksPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 201: result := NewPcloudPvminstancesNetworksPostCreated() @@ -140,7 +141,7 @@ func (o *PcloudPvminstancesNetworksPostCreated) readResponse(response runtime.Cl o.Payload = new(models.PVMInstanceNetwork) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -210,7 +211,7 @@ func (o *PcloudPvminstancesNetworksPostBadRequest) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -280,7 +281,7 @@ func (o *PcloudPvminstancesNetworksPostUnauthorized) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -350,7 +351,7 @@ func (o *PcloudPvminstancesNetworksPostForbidden) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -420,7 +421,7 @@ func (o *PcloudPvminstancesNetworksPostNotFound) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -490,7 +491,7 @@ func (o *PcloudPvminstancesNetworksPostConflict) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -560,7 +561,7 @@ func (o *PcloudPvminstancesNetworksPostUnprocessableEntity) readResponse(respons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -630,7 +631,7 @@ func (o *PcloudPvminstancesNetworksPostInternalServerError) readResponse(respons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_operations_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_operations_post_responses.go index 0844f328d72..ce1f5570311 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_operations_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_operations_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_p_vm_instances import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudPvminstancesOperationsPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesOperationsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudPvminstancesOperationsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudPvminstancesOperationsPostOK() @@ -138,7 +139,7 @@ func (o *PcloudPvminstancesOperationsPostOK) GetPayload() models.Object { func (o *PcloudPvminstancesOperationsPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -208,7 +209,7 @@ func (o *PcloudPvminstancesOperationsPostBadRequest) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -278,7 +279,7 @@ func (o *PcloudPvminstancesOperationsPostUnauthorized) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -348,7 +349,7 @@ func (o *PcloudPvminstancesOperationsPostForbidden) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -418,7 +419,7 @@ func (o *PcloudPvminstancesOperationsPostNotFound) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -488,7 +489,7 @@ func (o *PcloudPvminstancesOperationsPostConflict) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -558,7 +559,7 @@ func (o *PcloudPvminstancesOperationsPostUnprocessableEntity) readResponse(respo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -628,7 +629,7 @@ func (o *PcloudPvminstancesOperationsPostInternalServerError) readResponse(respo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_post_responses.go index 16e556e5ba8..164f7d42b6d 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_p_vm_instances import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudPvminstancesPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudPvminstancesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudPvminstancesPostOK() @@ -156,7 +157,7 @@ func (o *PcloudPvminstancesPostOK) GetPayload() models.PVMInstanceList { func (o *PcloudPvminstancesPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -224,7 +225,7 @@ func (o *PcloudPvminstancesPostCreated) GetPayload() models.PVMInstanceList { func (o *PcloudPvminstancesPostCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -292,7 +293,7 @@ func (o *PcloudPvminstancesPostAccepted) GetPayload() models.PVMInstanceList { func (o *PcloudPvminstancesPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -362,7 +363,7 @@ func (o *PcloudPvminstancesPostBadRequest) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -432,7 +433,7 @@ func (o *PcloudPvminstancesPostUnauthorized) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -502,7 +503,7 @@ func (o *PcloudPvminstancesPostForbidden) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -572,7 +573,7 @@ func (o *PcloudPvminstancesPostNotFound) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -642,7 +643,7 @@ func (o *PcloudPvminstancesPostConflict) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -712,7 +713,7 @@ func (o *PcloudPvminstancesPostUnprocessableEntity) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -782,7 +783,7 @@ func (o *PcloudPvminstancesPostInternalServerError) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -852,7 +853,7 @@ func (o *PcloudPvminstancesPostGatewayTimeout) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_put_responses.go index ee6dc366487..66037ef2dad 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_put_responses.go @@ -7,6 +7,7 @@ package p_cloud_p_vm_instances import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudPvminstancesPutReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudPvminstancesPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 202: result := NewPcloudPvminstancesPutAccepted() @@ -140,7 +141,7 @@ func (o *PcloudPvminstancesPutAccepted) readResponse(response runtime.ClientResp o.Payload = new(models.PVMInstanceUpdateResponse) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -210,7 +211,7 @@ func (o *PcloudPvminstancesPutBadRequest) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -280,7 +281,7 @@ func (o *PcloudPvminstancesPutUnauthorized) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -350,7 +351,7 @@ func (o *PcloudPvminstancesPutForbidden) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -420,7 +421,7 @@ func (o *PcloudPvminstancesPutNotFound) readResponse(response runtime.ClientResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -490,7 +491,7 @@ func (o *PcloudPvminstancesPutConflict) readResponse(response runtime.ClientResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -560,7 +561,7 @@ func (o *PcloudPvminstancesPutUnprocessableEntity) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -630,7 +631,7 @@ func (o *PcloudPvminstancesPutInternalServerError) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_getall_responses.go index f093e0305d6..ff0da6017fa 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_getall_responses.go @@ -7,6 +7,7 @@ package p_cloud_p_vm_instances import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudPvminstancesSnapshotsGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesSnapshotsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudPvminstancesSnapshotsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudPvminstancesSnapshotsGetallOK() @@ -128,7 +129,7 @@ func (o *PcloudPvminstancesSnapshotsGetallOK) readResponse(response runtime.Clie o.Payload = new(models.Snapshots) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudPvminstancesSnapshotsGetallBadRequest) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudPvminstancesSnapshotsGetallUnauthorized) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudPvminstancesSnapshotsGetallForbidden) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudPvminstancesSnapshotsGetallNotFound) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudPvminstancesSnapshotsGetallInternalServerError) readResponse(resp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_post_responses.go index 94ef37d9439..b48da093652 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_p_vm_instances import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudPvminstancesSnapshotsPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesSnapshotsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudPvminstancesSnapshotsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 202: result := NewPcloudPvminstancesSnapshotsPostAccepted() @@ -140,7 +141,7 @@ func (o *PcloudPvminstancesSnapshotsPostAccepted) readResponse(response runtime. o.Payload = new(models.SnapshotCreateResponse) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -210,7 +211,7 @@ func (o *PcloudPvminstancesSnapshotsPostBadRequest) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -280,7 +281,7 @@ func (o *PcloudPvminstancesSnapshotsPostUnauthorized) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -350,7 +351,7 @@ func (o *PcloudPvminstancesSnapshotsPostForbidden) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -420,7 +421,7 @@ func (o *PcloudPvminstancesSnapshotsPostNotFound) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -490,7 +491,7 @@ func (o *PcloudPvminstancesSnapshotsPostConflict) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -560,7 +561,7 @@ func (o *PcloudPvminstancesSnapshotsPostInternalServerError) readResponse(respon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -630,7 +631,7 @@ func (o *PcloudPvminstancesSnapshotsPostGatewayTimeout) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_restore_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_restore_post_responses.go index 1ceae2e9d2f..f07d612ef3f 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_restore_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_pvminstances_snapshots_restore_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_p_vm_instances import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudPvminstancesSnapshotsRestorePostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesSnapshotsRestorePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudPvminstancesSnapshotsRestorePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 202: result := NewPcloudPvminstancesSnapshotsRestorePostAccepted() @@ -134,7 +135,7 @@ func (o *PcloudPvminstancesSnapshotsRestorePostAccepted) readResponse(response r o.Payload = new(models.Snapshot) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *PcloudPvminstancesSnapshotsRestorePostBadRequest) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *PcloudPvminstancesSnapshotsRestorePostUnauthorized) readResponse(respon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *PcloudPvminstancesSnapshotsRestorePostForbidden) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *PcloudPvminstancesSnapshotsRestorePostNotFound) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *PcloudPvminstancesSnapshotsRestorePostConflict) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *PcloudPvminstancesSnapshotsRestorePostInternalServerError) readResponse o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_capture_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_capture_get_responses.go index b438eef9ddd..87c4fa65ca8 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_capture_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_capture_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_p_vm_instances import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudV2PvminstancesCaptureGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudV2PvminstancesCaptureGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudV2PvminstancesCaptureGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudV2PvminstancesCaptureGetOK() @@ -128,7 +129,7 @@ func (o *PcloudV2PvminstancesCaptureGetOK) readResponse(response runtime.ClientR o.Payload = new(models.Job) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudV2PvminstancesCaptureGetBadRequest) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudV2PvminstancesCaptureGetUnauthorized) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudV2PvminstancesCaptureGetForbidden) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudV2PvminstancesCaptureGetNotFound) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudV2PvminstancesCaptureGetInternalServerError) readResponse(respons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_capture_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_capture_post_responses.go index 1213c38bb9c..3533cd29519 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_capture_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_capture_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_p_vm_instances import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudV2PvminstancesCapturePostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudV2PvminstancesCapturePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudV2PvminstancesCapturePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 202: result := NewPcloudV2PvminstancesCapturePostAccepted() @@ -140,7 +141,7 @@ func (o *PcloudV2PvminstancesCapturePostAccepted) readResponse(response runtime. o.Payload = new(models.JobReference) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -210,7 +211,7 @@ func (o *PcloudV2PvminstancesCapturePostBadRequest) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -280,7 +281,7 @@ func (o *PcloudV2PvminstancesCapturePostUnauthorized) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -350,7 +351,7 @@ func (o *PcloudV2PvminstancesCapturePostForbidden) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -420,7 +421,7 @@ func (o *PcloudV2PvminstancesCapturePostNotFound) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -490,7 +491,7 @@ func (o *PcloudV2PvminstancesCapturePostConflict) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -560,7 +561,7 @@ func (o *PcloudV2PvminstancesCapturePostUnprocessableEntity) readResponse(respon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -630,7 +631,7 @@ func (o *PcloudV2PvminstancesCapturePostInternalServerError) readResponse(respon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_getall_responses.go index 52f5842ac43..61712a2f6c0 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_p_vm_instances/pcloud_v2_pvminstances_getall_responses.go @@ -7,6 +7,7 @@ package p_cloud_p_vm_instances import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudV2PvminstancesGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudV2PvminstancesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudV2PvminstancesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudV2PvminstancesGetallOK() @@ -134,7 +135,7 @@ func (o *PcloudV2PvminstancesGetallOK) readResponse(response runtime.ClientRespo o.Payload = new(models.PVMInstancesV2) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *PcloudV2PvminstancesGetallBadRequest) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *PcloudV2PvminstancesGetallUnauthorized) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *PcloudV2PvminstancesGetallForbidden) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *PcloudV2PvminstancesGetallNotFound) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *PcloudV2PvminstancesGetallRequestTimeout) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *PcloudV2PvminstancesGetallInternalServerError) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/p_cloud_placement_groups_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/p_cloud_placement_groups_client.go index 7ed0532a49a..d141a571253 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/p_cloud_placement_groups_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/p_cloud_placement_groups_client.go @@ -75,7 +75,7 @@ type ClientService interface { PcloudPlacementgroupsDelete deletes server placement group */ func (a *Client) PcloudPlacementgroupsDelete(params *PcloudPlacementgroupsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPlacementgroupsDeleteOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudPlacementgroupsDeleteParams() } @@ -95,17 +95,22 @@ func (a *Client) PcloudPlacementgroupsDelete(params *PcloudPlacementgroupsDelete for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudPlacementgroupsDeleteOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.placementgroups.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -114,7 +119,7 @@ func (a *Client) PcloudPlacementgroupsDelete(params *PcloudPlacementgroupsDelete PcloudPlacementgroupsGet gets server placement group detail */ func (a *Client) PcloudPlacementgroupsGet(params *PcloudPlacementgroupsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPlacementgroupsGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudPlacementgroupsGetParams() } @@ -134,17 +139,22 @@ func (a *Client) PcloudPlacementgroupsGet(params *PcloudPlacementgroupsGetParams for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudPlacementgroupsGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.placementgroups.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -153,7 +163,7 @@ func (a *Client) PcloudPlacementgroupsGet(params *PcloudPlacementgroupsGetParams PcloudPlacementgroupsGetall gets all server placement groups */ func (a *Client) PcloudPlacementgroupsGetall(params *PcloudPlacementgroupsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPlacementgroupsGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudPlacementgroupsGetallParams() } @@ -173,17 +183,22 @@ func (a *Client) PcloudPlacementgroupsGetall(params *PcloudPlacementgroupsGetall for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudPlacementgroupsGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.placementgroups.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -192,7 +207,7 @@ func (a *Client) PcloudPlacementgroupsGetall(params *PcloudPlacementgroupsGetall PcloudPlacementgroupsMembersDelete removes server from placement group */ func (a *Client) PcloudPlacementgroupsMembersDelete(params *PcloudPlacementgroupsMembersDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPlacementgroupsMembersDeleteOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudPlacementgroupsMembersDeleteParams() } @@ -212,17 +227,22 @@ func (a *Client) PcloudPlacementgroupsMembersDelete(params *PcloudPlacementgroup for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudPlacementgroupsMembersDeleteOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.placementgroups.members.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -231,7 +251,7 @@ func (a *Client) PcloudPlacementgroupsMembersDelete(params *PcloudPlacementgroup PcloudPlacementgroupsMembersPost adds server to placement group */ func (a *Client) PcloudPlacementgroupsMembersPost(params *PcloudPlacementgroupsMembersPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPlacementgroupsMembersPostOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudPlacementgroupsMembersPostParams() } @@ -251,17 +271,22 @@ func (a *Client) PcloudPlacementgroupsMembersPost(params *PcloudPlacementgroupsM for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudPlacementgroupsMembersPostOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.placementgroups.members.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -270,7 +295,7 @@ func (a *Client) PcloudPlacementgroupsMembersPost(params *PcloudPlacementgroupsM PcloudPlacementgroupsPost creates a new server placement group */ func (a *Client) PcloudPlacementgroupsPost(params *PcloudPlacementgroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPlacementgroupsPostOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudPlacementgroupsPostParams() } @@ -290,17 +315,22 @@ func (a *Client) PcloudPlacementgroupsPost(params *PcloudPlacementgroupsPostPara for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudPlacementgroupsPostOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.placementgroups.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_delete_responses.go index 69ec152f36f..8999c408996 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_delete_responses.go @@ -7,6 +7,7 @@ package p_cloud_placement_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudPlacementgroupsDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudPlacementgroupsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudPlacementgroupsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudPlacementgroupsDeleteOK() @@ -126,7 +127,7 @@ func (o *PcloudPlacementgroupsDeleteOK) GetPayload() models.Object { func (o *PcloudPlacementgroupsDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -196,7 +197,7 @@ func (o *PcloudPlacementgroupsDeleteBadRequest) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -266,7 +267,7 @@ func (o *PcloudPlacementgroupsDeleteUnauthorized) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -336,7 +337,7 @@ func (o *PcloudPlacementgroupsDeleteForbidden) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -406,7 +407,7 @@ func (o *PcloudPlacementgroupsDeleteNotFound) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -476,7 +477,7 @@ func (o *PcloudPlacementgroupsDeleteInternalServerError) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_get_responses.go index df2c047f040..9705ab144d4 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_placement_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudPlacementgroupsGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudPlacementgroupsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudPlacementgroupsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudPlacementgroupsGetOK() @@ -128,7 +129,7 @@ func (o *PcloudPlacementgroupsGetOK) readResponse(response runtime.ClientRespons o.Payload = new(models.PlacementGroup) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudPlacementgroupsGetBadRequest) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudPlacementgroupsGetUnauthorized) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudPlacementgroupsGetForbidden) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudPlacementgroupsGetNotFound) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudPlacementgroupsGetInternalServerError) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_getall_responses.go index d0016366de7..7153470a31f 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_getall_responses.go @@ -7,6 +7,7 @@ package p_cloud_placement_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudPlacementgroupsGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudPlacementgroupsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudPlacementgroupsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudPlacementgroupsGetallOK() @@ -128,7 +129,7 @@ func (o *PcloudPlacementgroupsGetallOK) readResponse(response runtime.ClientResp o.Payload = new(models.PlacementGroups) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudPlacementgroupsGetallBadRequest) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudPlacementgroupsGetallUnauthorized) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudPlacementgroupsGetallForbidden) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudPlacementgroupsGetallNotFound) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudPlacementgroupsGetallInternalServerError) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_delete_responses.go index 617f9ce06e7..6c2121f2cd7 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_delete_responses.go @@ -7,6 +7,7 @@ package p_cloud_placement_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudPlacementgroupsMembersDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudPlacementgroupsMembersDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudPlacementgroupsMembersDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudPlacementgroupsMembersDeleteOK() @@ -140,7 +141,7 @@ func (o *PcloudPlacementgroupsMembersDeleteOK) readResponse(response runtime.Cli o.Payload = new(models.PlacementGroup) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -210,7 +211,7 @@ func (o *PcloudPlacementgroupsMembersDeleteBadRequest) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -280,7 +281,7 @@ func (o *PcloudPlacementgroupsMembersDeleteUnauthorized) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -350,7 +351,7 @@ func (o *PcloudPlacementgroupsMembersDeleteForbidden) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -420,7 +421,7 @@ func (o *PcloudPlacementgroupsMembersDeleteNotFound) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -490,7 +491,7 @@ func (o *PcloudPlacementgroupsMembersDeleteConflict) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -560,7 +561,7 @@ func (o *PcloudPlacementgroupsMembersDeleteUnprocessableEntity) readResponse(res o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -630,7 +631,7 @@ func (o *PcloudPlacementgroupsMembersDeleteInternalServerError) readResponse(res o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_post_responses.go index c15ea979b6a..7972b4e4925 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_members_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_placement_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudPlacementgroupsMembersPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudPlacementgroupsMembersPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudPlacementgroupsMembersPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudPlacementgroupsMembersPostOK() @@ -140,7 +141,7 @@ func (o *PcloudPlacementgroupsMembersPostOK) readResponse(response runtime.Clien o.Payload = new(models.PlacementGroup) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -210,7 +211,7 @@ func (o *PcloudPlacementgroupsMembersPostBadRequest) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -280,7 +281,7 @@ func (o *PcloudPlacementgroupsMembersPostUnauthorized) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -350,7 +351,7 @@ func (o *PcloudPlacementgroupsMembersPostForbidden) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -420,7 +421,7 @@ func (o *PcloudPlacementgroupsMembersPostNotFound) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -490,7 +491,7 @@ func (o *PcloudPlacementgroupsMembersPostConflict) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -560,7 +561,7 @@ func (o *PcloudPlacementgroupsMembersPostUnprocessableEntity) readResponse(respo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -630,7 +631,7 @@ func (o *PcloudPlacementgroupsMembersPostInternalServerError) readResponse(respo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_post_responses.go index 0e908cf19d0..cb7c98eb32e 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups/pcloud_placementgroups_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_placement_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudPlacementgroupsPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudPlacementgroupsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudPlacementgroupsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudPlacementgroupsPostOK() @@ -140,7 +141,7 @@ func (o *PcloudPlacementgroupsPostOK) readResponse(response runtime.ClientRespon o.Payload = new(models.PlacementGroup) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -210,7 +211,7 @@ func (o *PcloudPlacementgroupsPostBadRequest) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -280,7 +281,7 @@ func (o *PcloudPlacementgroupsPostUnauthorized) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -350,7 +351,7 @@ func (o *PcloudPlacementgroupsPostForbidden) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -420,7 +421,7 @@ func (o *PcloudPlacementgroupsPostNotFound) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -490,7 +491,7 @@ func (o *PcloudPlacementgroupsPostConflict) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -560,7 +561,7 @@ func (o *PcloudPlacementgroupsPostUnprocessableEntity) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -630,7 +631,7 @@ func (o *PcloudPlacementgroupsPostInternalServerError) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_pod_capacity/p_cloud_pod_capacity_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_pod_capacity/p_cloud_pod_capacity_client.go index 65c17f94055..0a14d3a0f31 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_pod_capacity/p_cloud_pod_capacity_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_pod_capacity/p_cloud_pod_capacity_client.go @@ -67,7 +67,7 @@ PcloudPodcapacityGet lists of available resources within a particular pod Applicable to satellite locations only. */ func (a *Client) PcloudPodcapacityGet(params *PcloudPodcapacityGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPodcapacityGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudPodcapacityGetParams() } @@ -87,17 +87,22 @@ func (a *Client) PcloudPodcapacityGet(params *PcloudPodcapacityGetParams, authIn for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudPodcapacityGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.podcapacity.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_pod_capacity/pcloud_podcapacity_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_pod_capacity/pcloud_podcapacity_get_responses.go index d8e7f262856..01e70185b49 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_pod_capacity/pcloud_podcapacity_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_pod_capacity/pcloud_podcapacity_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_pod_capacity import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudPodcapacityGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudPodcapacityGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudPodcapacityGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudPodcapacityGetOK() @@ -128,7 +129,7 @@ func (o *PcloudPodcapacityGetOK) readResponse(response runtime.ClientResponse, c o.Payload = new(models.PodCapacity) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudPodcapacityGetBadRequest) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudPodcapacityGetUnauthorized) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudPodcapacityGetForbidden) readResponse(response runtime.ClientResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudPodcapacityGetNotFound) readResponse(response runtime.ClientRespo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudPodcapacityGetInternalServerError) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/p_cloudsap_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/p_cloudsap_client.go index f5433f52826..3739f74edf4 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/p_cloudsap_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/p_cloudsap_client.go @@ -69,7 +69,7 @@ type ClientService interface { PcloudSapGet gets the information on an s a p profile */ func (a *Client) PcloudSapGet(params *PcloudSapGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSapGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudSapGetParams() } @@ -89,17 +89,22 @@ func (a *Client) PcloudSapGet(params *PcloudSapGetParams, authInfo runtime.Clien for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudSapGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.sap.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -108,7 +113,7 @@ func (a *Client) PcloudSapGet(params *PcloudSapGetParams, authInfo runtime.Clien PcloudSapGetall gets list of s a p profiles */ func (a *Client) PcloudSapGetall(params *PcloudSapGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSapGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudSapGetallParams() } @@ -128,17 +133,22 @@ func (a *Client) PcloudSapGetall(params *PcloudSapGetallParams, authInfo runtime for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudSapGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.sap.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -147,7 +157,7 @@ func (a *Client) PcloudSapGetall(params *PcloudSapGetallParams, authInfo runtime PcloudSapPost creates a new s a p p VM instance */ func (a *Client) PcloudSapPost(params *PcloudSapPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSapPostOK, *PcloudSapPostCreated, *PcloudSapPostAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudSapPostParams() } @@ -167,11 +177,12 @@ func (a *Client) PcloudSapPost(params *PcloudSapPostParams, authInfo runtime.Cli for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, nil, nil, err } + + // several success responses have to be checked switch value := result.(type) { case *PcloudSapPostOK: return value, nil, nil, nil @@ -180,7 +191,10 @@ func (a *Client) PcloudSapPost(params *PcloudSapPostParams, authInfo runtime.Cli case *PcloudSapPostAccepted: return nil, nil, value, nil } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for p_cloud_s_a_p: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_get_responses.go index d0be31ba047..741cb5db36a 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_s_a_p import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudSapGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudSapGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudSapGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudSapGetOK() @@ -128,7 +129,7 @@ func (o *PcloudSapGetOK) readResponse(response runtime.ClientResponse, consumer o.Payload = new(models.SAPProfile) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudSapGetBadRequest) readResponse(response runtime.ClientResponse, c o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudSapGetUnauthorized) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudSapGetForbidden) readResponse(response runtime.ClientResponse, co o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudSapGetNotFound) readResponse(response runtime.ClientResponse, con o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudSapGetInternalServerError) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_getall_responses.go index e69d9995aec..6879a232749 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_getall_responses.go @@ -7,6 +7,7 @@ package p_cloud_s_a_p import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudSapGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudSapGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudSapGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudSapGetallOK() @@ -128,7 +129,7 @@ func (o *PcloudSapGetallOK) readResponse(response runtime.ClientResponse, consum o.Payload = new(models.SAPProfiles) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudSapGetallBadRequest) readResponse(response runtime.ClientResponse o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudSapGetallUnauthorized) readResponse(response runtime.ClientRespon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudSapGetallForbidden) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudSapGetallNotFound) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudSapGetallInternalServerError) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_post_responses.go index cb808bed883..5aa404f73a8 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p/pcloud_sap_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_s_a_p import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudSapPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudSapPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudSapPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudSapPostOK() @@ -150,7 +151,7 @@ func (o *PcloudSapPostOK) GetPayload() models.PVMInstanceList { func (o *PcloudSapPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -218,7 +219,7 @@ func (o *PcloudSapPostCreated) GetPayload() models.PVMInstanceList { func (o *PcloudSapPostCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -286,7 +287,7 @@ func (o *PcloudSapPostAccepted) GetPayload() models.PVMInstanceList { func (o *PcloudSapPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -356,7 +357,7 @@ func (o *PcloudSapPostBadRequest) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -426,7 +427,7 @@ func (o *PcloudSapPostUnauthorized) readResponse(response runtime.ClientResponse o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -496,7 +497,7 @@ func (o *PcloudSapPostForbidden) readResponse(response runtime.ClientResponse, c o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -566,7 +567,7 @@ func (o *PcloudSapPostNotFound) readResponse(response runtime.ClientResponse, co o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -636,7 +637,7 @@ func (o *PcloudSapPostConflict) readResponse(response runtime.ClientResponse, co o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -706,7 +707,7 @@ func (o *PcloudSapPostUnprocessableEntity) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -776,7 +777,7 @@ func (o *PcloudSapPostInternalServerError) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_p_p_placement_groups/p_cloudspp_placement_groups_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_p_p_placement_groups/p_cloudspp_placement_groups_client.go index e37b93ae9dd..a71114725f7 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_p_p_placement_groups/p_cloudspp_placement_groups_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_p_p_placement_groups/p_cloudspp_placement_groups_client.go @@ -75,7 +75,7 @@ type ClientService interface { PcloudSppplacementgroupsDelete deletes a shared processor pool placement group from a cloud instance */ func (a *Client) PcloudSppplacementgroupsDelete(params *PcloudSppplacementgroupsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSppplacementgroupsDeleteOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudSppplacementgroupsDeleteParams() } @@ -95,17 +95,22 @@ func (a *Client) PcloudSppplacementgroupsDelete(params *PcloudSppplacementgroups for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudSppplacementgroupsDeleteOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.sppplacementgroups.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -114,7 +119,7 @@ func (a *Client) PcloudSppplacementgroupsDelete(params *PcloudSppplacementgroups PcloudSppplacementgroupsGet gets the detail of a shared processor pool placement group for a cloud instance */ func (a *Client) PcloudSppplacementgroupsGet(params *PcloudSppplacementgroupsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSppplacementgroupsGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudSppplacementgroupsGetParams() } @@ -134,17 +139,22 @@ func (a *Client) PcloudSppplacementgroupsGet(params *PcloudSppplacementgroupsGet for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudSppplacementgroupsGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.sppplacementgroups.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -153,7 +163,7 @@ func (a *Client) PcloudSppplacementgroupsGet(params *PcloudSppplacementgroupsGet PcloudSppplacementgroupsGetall gets the list of shared processor pool placement groups for a cloud instance */ func (a *Client) PcloudSppplacementgroupsGetall(params *PcloudSppplacementgroupsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSppplacementgroupsGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudSppplacementgroupsGetallParams() } @@ -173,17 +183,22 @@ func (a *Client) PcloudSppplacementgroupsGetall(params *PcloudSppplacementgroups for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudSppplacementgroupsGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.sppplacementgroups.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -192,7 +207,7 @@ func (a *Client) PcloudSppplacementgroupsGetall(params *PcloudSppplacementgroups PcloudSppplacementgroupsMembersDelete deletes shared processor pool member from a shared processor pool placement group */ func (a *Client) PcloudSppplacementgroupsMembersDelete(params *PcloudSppplacementgroupsMembersDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSppplacementgroupsMembersDeleteOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudSppplacementgroupsMembersDeleteParams() } @@ -212,17 +227,22 @@ func (a *Client) PcloudSppplacementgroupsMembersDelete(params *PcloudSppplacemen for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudSppplacementgroupsMembersDeleteOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.sppplacementgroups.members.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -231,7 +251,7 @@ func (a *Client) PcloudSppplacementgroupsMembersDelete(params *PcloudSppplacemen PcloudSppplacementgroupsMembersPost adds shared processor pool as a member of a shared processor pool placement group */ func (a *Client) PcloudSppplacementgroupsMembersPost(params *PcloudSppplacementgroupsMembersPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSppplacementgroupsMembersPostOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudSppplacementgroupsMembersPostParams() } @@ -251,17 +271,22 @@ func (a *Client) PcloudSppplacementgroupsMembersPost(params *PcloudSppplacementg for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudSppplacementgroupsMembersPostOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.sppplacementgroups.members.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -270,7 +295,7 @@ func (a *Client) PcloudSppplacementgroupsMembersPost(params *PcloudSppplacementg PcloudSppplacementgroupsPost creates a new shared processor pool placement group */ func (a *Client) PcloudSppplacementgroupsPost(params *PcloudSppplacementgroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSppplacementgroupsPostOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudSppplacementgroupsPostParams() } @@ -290,17 +315,22 @@ func (a *Client) PcloudSppplacementgroupsPost(params *PcloudSppplacementgroupsPo for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudSppplacementgroupsPostOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.sppplacementgroups.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_delete_responses.go index b3865e6c016..52f886f8e07 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_delete_responses.go @@ -7,6 +7,7 @@ package p_cloud_s_p_p_placement_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudSppplacementgroupsDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudSppplacementgroupsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudSppplacementgroupsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudSppplacementgroupsDeleteOK() @@ -132,7 +133,7 @@ func (o *PcloudSppplacementgroupsDeleteOK) GetPayload() models.Object { func (o *PcloudSppplacementgroupsDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -202,7 +203,7 @@ func (o *PcloudSppplacementgroupsDeleteBadRequest) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -272,7 +273,7 @@ func (o *PcloudSppplacementgroupsDeleteUnauthorized) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -342,7 +343,7 @@ func (o *PcloudSppplacementgroupsDeleteForbidden) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -412,7 +413,7 @@ func (o *PcloudSppplacementgroupsDeleteNotFound) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -482,7 +483,7 @@ func (o *PcloudSppplacementgroupsDeleteConflict) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -552,7 +553,7 @@ func (o *PcloudSppplacementgroupsDeleteInternalServerError) readResponse(respons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_get_responses.go index f624ee83752..36549830df1 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_s_p_p_placement_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudSppplacementgroupsGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudSppplacementgroupsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudSppplacementgroupsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudSppplacementgroupsGetOK() @@ -128,7 +129,7 @@ func (o *PcloudSppplacementgroupsGetOK) readResponse(response runtime.ClientResp o.Payload = new(models.SPPPlacementGroup) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudSppplacementgroupsGetBadRequest) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudSppplacementgroupsGetUnauthorized) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudSppplacementgroupsGetForbidden) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudSppplacementgroupsGetNotFound) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudSppplacementgroupsGetInternalServerError) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_getall_responses.go index e29b8593638..3698110754f 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_getall_responses.go @@ -7,6 +7,7 @@ package p_cloud_s_p_p_placement_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudSppplacementgroupsGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudSppplacementgroupsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudSppplacementgroupsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudSppplacementgroupsGetallOK() @@ -128,7 +129,7 @@ func (o *PcloudSppplacementgroupsGetallOK) readResponse(response runtime.ClientR o.Payload = new(models.SPPPlacementGroups) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudSppplacementgroupsGetallBadRequest) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudSppplacementgroupsGetallUnauthorized) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudSppplacementgroupsGetallForbidden) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudSppplacementgroupsGetallNotFound) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudSppplacementgroupsGetallInternalServerError) readResponse(respons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_members_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_members_delete_responses.go index e7c542a650e..691e9161d9f 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_members_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_members_delete_responses.go @@ -7,6 +7,7 @@ package p_cloud_s_p_p_placement_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudSppplacementgroupsMembersDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudSppplacementgroupsMembersDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudSppplacementgroupsMembersDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudSppplacementgroupsMembersDeleteOK() @@ -134,7 +135,7 @@ func (o *PcloudSppplacementgroupsMembersDeleteOK) readResponse(response runtime. o.Payload = new(models.SPPPlacementGroup) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *PcloudSppplacementgroupsMembersDeleteBadRequest) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *PcloudSppplacementgroupsMembersDeleteUnauthorized) readResponse(respons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *PcloudSppplacementgroupsMembersDeleteForbidden) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *PcloudSppplacementgroupsMembersDeleteNotFound) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *PcloudSppplacementgroupsMembersDeleteConflict) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *PcloudSppplacementgroupsMembersDeleteInternalServerError) readResponse( o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_members_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_members_post_responses.go index e1c89983c31..e4328801b95 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_members_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_members_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_s_p_p_placement_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudSppplacementgroupsMembersPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudSppplacementgroupsMembersPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudSppplacementgroupsMembersPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudSppplacementgroupsMembersPostOK() @@ -140,7 +141,7 @@ func (o *PcloudSppplacementgroupsMembersPostOK) readResponse(response runtime.Cl o.Payload = new(models.SPPPlacementGroup) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -210,7 +211,7 @@ func (o *PcloudSppplacementgroupsMembersPostBadRequest) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -280,7 +281,7 @@ func (o *PcloudSppplacementgroupsMembersPostUnauthorized) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -350,7 +351,7 @@ func (o *PcloudSppplacementgroupsMembersPostForbidden) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -420,7 +421,7 @@ func (o *PcloudSppplacementgroupsMembersPostNotFound) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -490,7 +491,7 @@ func (o *PcloudSppplacementgroupsMembersPostConflict) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -560,7 +561,7 @@ func (o *PcloudSppplacementgroupsMembersPostUnprocessableEntity) readResponse(re o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -630,7 +631,7 @@ func (o *PcloudSppplacementgroupsMembersPostInternalServerError) readResponse(re o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_post_responses.go index d63449673d2..2863161d759 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_p_p_placement_groups/pcloud_sppplacementgroups_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_s_p_p_placement_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudSppplacementgroupsPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudSppplacementgroupsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudSppplacementgroupsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudSppplacementgroupsPostOK() @@ -140,7 +141,7 @@ func (o *PcloudSppplacementgroupsPostOK) readResponse(response runtime.ClientRes o.Payload = new(models.SPPPlacementGroup) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -210,7 +211,7 @@ func (o *PcloudSppplacementgroupsPostBadRequest) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -280,7 +281,7 @@ func (o *PcloudSppplacementgroupsPostUnauthorized) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -350,7 +351,7 @@ func (o *PcloudSppplacementgroupsPostForbidden) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -420,7 +421,7 @@ func (o *PcloudSppplacementgroupsPostNotFound) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -490,7 +491,7 @@ func (o *PcloudSppplacementgroupsPostConflict) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -560,7 +561,7 @@ func (o *PcloudSppplacementgroupsPostUnprocessableEntity) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -630,7 +631,7 @@ func (o *PcloudSppplacementgroupsPostInternalServerError) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/p_cloud_servicedhcp_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/p_cloud_servicedhcp_client.go index 7200abcd3fb..0e69f5b157d 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/p_cloud_servicedhcp_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/p_cloud_servicedhcp_client.go @@ -71,7 +71,7 @@ type ClientService interface { PcloudDhcpDelete deletes d h c p server open shift internal use only */ func (a *Client) PcloudDhcpDelete(params *PcloudDhcpDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudDhcpDeleteAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudDhcpDeleteParams() } @@ -91,17 +91,22 @@ func (a *Client) PcloudDhcpDelete(params *PcloudDhcpDeleteParams, authInfo runti for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudDhcpDeleteAccepted) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.dhcp.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -110,7 +115,7 @@ func (a *Client) PcloudDhcpDelete(params *PcloudDhcpDeleteParams, authInfo runti PcloudDhcpGet gets d h c p server information open shift internal use only */ func (a *Client) PcloudDhcpGet(params *PcloudDhcpGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudDhcpGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudDhcpGetParams() } @@ -130,17 +135,22 @@ func (a *Client) PcloudDhcpGet(params *PcloudDhcpGetParams, authInfo runtime.Cli for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudDhcpGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.dhcp.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -149,7 +159,7 @@ func (a *Client) PcloudDhcpGet(params *PcloudDhcpGetParams, authInfo runtime.Cli PcloudDhcpGetall gets all d h c p servers information open shift internal use only */ func (a *Client) PcloudDhcpGetall(params *PcloudDhcpGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudDhcpGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudDhcpGetallParams() } @@ -169,17 +179,22 @@ func (a *Client) PcloudDhcpGetall(params *PcloudDhcpGetallParams, authInfo runti for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudDhcpGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.dhcp.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -188,7 +203,7 @@ func (a *Client) PcloudDhcpGetall(params *PcloudDhcpGetallParams, authInfo runti PcloudDhcpPost creates a d h c p server open shift internal use only */ func (a *Client) PcloudDhcpPost(params *PcloudDhcpPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudDhcpPostAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudDhcpPostParams() } @@ -208,17 +223,22 @@ func (a *Client) PcloudDhcpPost(params *PcloudDhcpPostParams, authInfo runtime.C for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudDhcpPostAccepted) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.dhcp.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_delete_responses.go index f23ea986798..02999fcd12a 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_delete_responses.go @@ -7,6 +7,7 @@ package p_cloud_service_d_h_c_p import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudDhcpDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudDhcpDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudDhcpDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 202: result := NewPcloudDhcpDeleteAccepted() @@ -67,7 +68,7 @@ func NewPcloudDhcpDeleteAccepted() *PcloudDhcpDeleteAccepted { /* PcloudDhcpDeleteAccepted describes a response with status code 202, with default header values. -OK +Accepted */ type PcloudDhcpDeleteAccepted struct { Payload models.Object @@ -120,7 +121,7 @@ func (o *PcloudDhcpDeleteAccepted) GetPayload() models.Object { func (o *PcloudDhcpDeleteAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -190,7 +191,7 @@ func (o *PcloudDhcpDeleteBadRequest) readResponse(response runtime.ClientRespons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -260,7 +261,7 @@ func (o *PcloudDhcpDeleteForbidden) readResponse(response runtime.ClientResponse o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -330,7 +331,7 @@ func (o *PcloudDhcpDeleteNotFound) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -400,7 +401,7 @@ func (o *PcloudDhcpDeleteInternalServerError) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_get_responses.go index 858df91ad6d..6439488dcad 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_service_d_h_c_p import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudDhcpGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudDhcpGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudDhcpGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudDhcpGetOK() @@ -128,7 +129,7 @@ func (o *PcloudDhcpGetOK) readResponse(response runtime.ClientResponse, consumer o.Payload = new(models.DHCPServerDetail) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudDhcpGetBadRequest) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudDhcpGetUnauthorized) readResponse(response runtime.ClientResponse o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudDhcpGetForbidden) readResponse(response runtime.ClientResponse, c o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudDhcpGetNotFound) readResponse(response runtime.ClientResponse, co o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudDhcpGetInternalServerError) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_getall_responses.go index 2354a68e289..26f96eb3ade 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_getall_responses.go @@ -7,6 +7,7 @@ package p_cloud_service_d_h_c_p import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudDhcpGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudDhcpGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudDhcpGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudDhcpGetallOK() @@ -126,7 +127,7 @@ func (o *PcloudDhcpGetallOK) GetPayload() models.DHCPServers { func (o *PcloudDhcpGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -196,7 +197,7 @@ func (o *PcloudDhcpGetallBadRequest) readResponse(response runtime.ClientRespons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -266,7 +267,7 @@ func (o *PcloudDhcpGetallUnauthorized) readResponse(response runtime.ClientRespo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -336,7 +337,7 @@ func (o *PcloudDhcpGetallForbidden) readResponse(response runtime.ClientResponse o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -406,7 +407,7 @@ func (o *PcloudDhcpGetallNotFound) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -476,7 +477,7 @@ func (o *PcloudDhcpGetallInternalServerError) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_post_responses.go index 6c2181e7572..a1a5cb917bb 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p/pcloud_dhcp_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_service_d_h_c_p import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudDhcpPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudDhcpPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudDhcpPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 202: result := NewPcloudDhcpPostAccepted() @@ -73,7 +74,7 @@ func NewPcloudDhcpPostAccepted() *PcloudDhcpPostAccepted { /* PcloudDhcpPostAccepted describes a response with status code 202, with default header values. -OK +Accepted */ type PcloudDhcpPostAccepted struct { Payload *models.DHCPServer @@ -128,7 +129,7 @@ func (o *PcloudDhcpPostAccepted) readResponse(response runtime.ClientResponse, c o.Payload = new(models.DHCPServer) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudDhcpPostBadRequest) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudDhcpPostUnauthorized) readResponse(response runtime.ClientRespons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudDhcpPostForbidden) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudDhcpPostNotFound) readResponse(response runtime.ClientResponse, c o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudDhcpPostInternalServerError) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_shared_processor_pools/p_cloud_shared_processor_pools_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_shared_processor_pools/p_cloud_shared_processor_pools_client.go index 6e60de90885..5992a4d23ef 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_shared_processor_pools/p_cloud_shared_processor_pools_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_shared_processor_pools/p_cloud_shared_processor_pools_client.go @@ -73,7 +73,7 @@ type ClientService interface { PcloudSharedprocessorpoolsDelete deletes a shared processor pool from a cloud instance */ func (a *Client) PcloudSharedprocessorpoolsDelete(params *PcloudSharedprocessorpoolsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSharedprocessorpoolsDeleteOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudSharedprocessorpoolsDeleteParams() } @@ -93,17 +93,22 @@ func (a *Client) PcloudSharedprocessorpoolsDelete(params *PcloudSharedprocessorp for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudSharedprocessorpoolsDeleteOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.sharedprocessorpools.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -112,7 +117,7 @@ func (a *Client) PcloudSharedprocessorpoolsDelete(params *PcloudSharedprocessorp PcloudSharedprocessorpoolsGet gets the detail of a shared processor pool for a cloud instance */ func (a *Client) PcloudSharedprocessorpoolsGet(params *PcloudSharedprocessorpoolsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSharedprocessorpoolsGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudSharedprocessorpoolsGetParams() } @@ -132,17 +137,22 @@ func (a *Client) PcloudSharedprocessorpoolsGet(params *PcloudSharedprocessorpool for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudSharedprocessorpoolsGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.sharedprocessorpools.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -151,7 +161,7 @@ func (a *Client) PcloudSharedprocessorpoolsGet(params *PcloudSharedprocessorpool PcloudSharedprocessorpoolsGetall gets the list of shared processor pools for a cloud instance */ func (a *Client) PcloudSharedprocessorpoolsGetall(params *PcloudSharedprocessorpoolsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSharedprocessorpoolsGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudSharedprocessorpoolsGetallParams() } @@ -171,17 +181,22 @@ func (a *Client) PcloudSharedprocessorpoolsGetall(params *PcloudSharedprocessorp for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudSharedprocessorpoolsGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.sharedprocessorpools.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -190,7 +205,7 @@ func (a *Client) PcloudSharedprocessorpoolsGetall(params *PcloudSharedprocessorp PcloudSharedprocessorpoolsPost creates a new shared processor pool */ func (a *Client) PcloudSharedprocessorpoolsPost(params *PcloudSharedprocessorpoolsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSharedprocessorpoolsPostAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudSharedprocessorpoolsPostParams() } @@ -210,17 +225,22 @@ func (a *Client) PcloudSharedprocessorpoolsPost(params *PcloudSharedprocessorpoo for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudSharedprocessorpoolsPostAccepted) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.sharedprocessorpools.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -229,7 +249,7 @@ func (a *Client) PcloudSharedprocessorpoolsPost(params *PcloudSharedprocessorpoo PcloudSharedprocessorpoolsPut updates a shared processor pool for a cloud instance */ func (a *Client) PcloudSharedprocessorpoolsPut(params *PcloudSharedprocessorpoolsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSharedprocessorpoolsPutOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudSharedprocessorpoolsPutParams() } @@ -249,17 +269,22 @@ func (a *Client) PcloudSharedprocessorpoolsPut(params *PcloudSharedprocessorpool for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudSharedprocessorpoolsPutOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.sharedprocessorpools.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_delete_responses.go index 376e3f8dabc..5eca4f31830 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_delete_responses.go @@ -7,6 +7,7 @@ package p_cloud_shared_processor_pools import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudSharedprocessorpoolsDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudSharedprocessorpoolsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudSharedprocessorpoolsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudSharedprocessorpoolsDeleteOK() @@ -132,7 +133,7 @@ func (o *PcloudSharedprocessorpoolsDeleteOK) GetPayload() models.Object { func (o *PcloudSharedprocessorpoolsDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -202,7 +203,7 @@ func (o *PcloudSharedprocessorpoolsDeleteBadRequest) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -272,7 +273,7 @@ func (o *PcloudSharedprocessorpoolsDeleteUnauthorized) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -342,7 +343,7 @@ func (o *PcloudSharedprocessorpoolsDeleteForbidden) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -412,7 +413,7 @@ func (o *PcloudSharedprocessorpoolsDeleteNotFound) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -482,7 +483,7 @@ func (o *PcloudSharedprocessorpoolsDeleteConflict) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -552,7 +553,7 @@ func (o *PcloudSharedprocessorpoolsDeleteInternalServerError) readResponse(respo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_get_responses.go index 9e6503413da..a3c622f93ac 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_shared_processor_pools import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudSharedprocessorpoolsGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudSharedprocessorpoolsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudSharedprocessorpoolsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudSharedprocessorpoolsGetOK() @@ -128,7 +129,7 @@ func (o *PcloudSharedprocessorpoolsGetOK) readResponse(response runtime.ClientRe o.Payload = new(models.SharedProcessorPoolDetail) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudSharedprocessorpoolsGetBadRequest) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudSharedprocessorpoolsGetUnauthorized) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudSharedprocessorpoolsGetForbidden) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudSharedprocessorpoolsGetNotFound) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudSharedprocessorpoolsGetInternalServerError) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_getall_responses.go index 7d940969a94..1bbc79a38b6 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_getall_responses.go @@ -7,6 +7,7 @@ package p_cloud_shared_processor_pools import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudSharedprocessorpoolsGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudSharedprocessorpoolsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudSharedprocessorpoolsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudSharedprocessorpoolsGetallOK() @@ -128,7 +129,7 @@ func (o *PcloudSharedprocessorpoolsGetallOK) readResponse(response runtime.Clien o.Payload = new(models.SharedProcessorPools) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudSharedprocessorpoolsGetallBadRequest) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudSharedprocessorpoolsGetallUnauthorized) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudSharedprocessorpoolsGetallForbidden) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudSharedprocessorpoolsGetallNotFound) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudSharedprocessorpoolsGetallInternalServerError) readResponse(respo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_post_responses.go index 95e946fd44e..d0ce9247996 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_shared_processor_pools import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudSharedprocessorpoolsPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudSharedprocessorpoolsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudSharedprocessorpoolsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 202: result := NewPcloudSharedprocessorpoolsPostAccepted() @@ -140,7 +141,7 @@ func (o *PcloudSharedprocessorpoolsPostAccepted) readResponse(response runtime.C o.Payload = new(models.SharedProcessorPool) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -210,7 +211,7 @@ func (o *PcloudSharedprocessorpoolsPostBadRequest) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -280,7 +281,7 @@ func (o *PcloudSharedprocessorpoolsPostUnauthorized) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -350,7 +351,7 @@ func (o *PcloudSharedprocessorpoolsPostForbidden) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -420,7 +421,7 @@ func (o *PcloudSharedprocessorpoolsPostNotFound) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -490,7 +491,7 @@ func (o *PcloudSharedprocessorpoolsPostConflict) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -560,7 +561,7 @@ func (o *PcloudSharedprocessorpoolsPostUnprocessableEntity) readResponse(respons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -630,7 +631,7 @@ func (o *PcloudSharedprocessorpoolsPostInternalServerError) readResponse(respons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_put_responses.go index 2ab1daef244..7a7c69b6936 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_put_responses.go @@ -7,6 +7,7 @@ package p_cloud_shared_processor_pools import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudSharedprocessorpoolsPutReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudSharedprocessorpoolsPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudSharedprocessorpoolsPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudSharedprocessorpoolsPutOK() @@ -128,7 +129,7 @@ func (o *PcloudSharedprocessorpoolsPutOK) readResponse(response runtime.ClientRe o.Payload = new(models.SharedProcessorPool) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudSharedprocessorpoolsPutBadRequest) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudSharedprocessorpoolsPutUnauthorized) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudSharedprocessorpoolsPutForbidden) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudSharedprocessorpoolsPutNotFound) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudSharedprocessorpoolsPutInternalServerError) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/p_cloud_snapshots_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/p_cloud_snapshots_client.go index c5f625646f1..873e700ec09 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/p_cloud_snapshots_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/p_cloud_snapshots_client.go @@ -71,7 +71,7 @@ type ClientService interface { PcloudCloudinstancesSnapshotsDelete deletes a p VM instance snapshot of a cloud instance */ func (a *Client) PcloudCloudinstancesSnapshotsDelete(params *PcloudCloudinstancesSnapshotsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesSnapshotsDeleteAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudCloudinstancesSnapshotsDeleteParams() } @@ -91,17 +91,22 @@ func (a *Client) PcloudCloudinstancesSnapshotsDelete(params *PcloudCloudinstance for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudCloudinstancesSnapshotsDeleteAccepted) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.snapshots.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -110,7 +115,7 @@ func (a *Client) PcloudCloudinstancesSnapshotsDelete(params *PcloudCloudinstance PcloudCloudinstancesSnapshotsGet gets the detail of a snapshot */ func (a *Client) PcloudCloudinstancesSnapshotsGet(params *PcloudCloudinstancesSnapshotsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesSnapshotsGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudCloudinstancesSnapshotsGetParams() } @@ -130,17 +135,22 @@ func (a *Client) PcloudCloudinstancesSnapshotsGet(params *PcloudCloudinstancesSn for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudCloudinstancesSnapshotsGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.snapshots.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -149,7 +159,7 @@ func (a *Client) PcloudCloudinstancesSnapshotsGet(params *PcloudCloudinstancesSn PcloudCloudinstancesSnapshotsGetall lists all p VM instance snapshots for this cloud instance */ func (a *Client) PcloudCloudinstancesSnapshotsGetall(params *PcloudCloudinstancesSnapshotsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesSnapshotsGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudCloudinstancesSnapshotsGetallParams() } @@ -169,17 +179,22 @@ func (a *Client) PcloudCloudinstancesSnapshotsGetall(params *PcloudCloudinstance for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudCloudinstancesSnapshotsGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.snapshots.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -188,7 +203,7 @@ func (a *Client) PcloudCloudinstancesSnapshotsGetall(params *PcloudCloudinstance PcloudCloudinstancesSnapshotsPut updates a p VM instance snapshot */ func (a *Client) PcloudCloudinstancesSnapshotsPut(params *PcloudCloudinstancesSnapshotsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesSnapshotsPutOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudCloudinstancesSnapshotsPutParams() } @@ -208,17 +223,22 @@ func (a *Client) PcloudCloudinstancesSnapshotsPut(params *PcloudCloudinstancesSn for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudCloudinstancesSnapshotsPutOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.snapshots.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_delete_responses.go index 85dd41fdcf6..69efbf3a569 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_delete_responses.go @@ -7,6 +7,7 @@ package p_cloud_snapshots import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudCloudinstancesSnapshotsDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesSnapshotsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudCloudinstancesSnapshotsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 202: result := NewPcloudCloudinstancesSnapshotsDeleteAccepted() @@ -132,7 +133,7 @@ func (o *PcloudCloudinstancesSnapshotsDeleteAccepted) GetPayload() models.Object func (o *PcloudCloudinstancesSnapshotsDeleteAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -202,7 +203,7 @@ func (o *PcloudCloudinstancesSnapshotsDeleteBadRequest) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -272,7 +273,7 @@ func (o *PcloudCloudinstancesSnapshotsDeleteUnauthorized) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -342,7 +343,7 @@ func (o *PcloudCloudinstancesSnapshotsDeleteForbidden) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -412,7 +413,7 @@ func (o *PcloudCloudinstancesSnapshotsDeleteNotFound) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -482,7 +483,7 @@ func (o *PcloudCloudinstancesSnapshotsDeleteGone) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -552,7 +553,7 @@ func (o *PcloudCloudinstancesSnapshotsDeleteInternalServerError) readResponse(re o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_get_responses.go index df567764202..560c2ba91de 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_snapshots import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudCloudinstancesSnapshotsGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesSnapshotsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudCloudinstancesSnapshotsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudCloudinstancesSnapshotsGetOK() @@ -128,7 +129,7 @@ func (o *PcloudCloudinstancesSnapshotsGetOK) readResponse(response runtime.Clien o.Payload = new(models.Snapshot) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudCloudinstancesSnapshotsGetBadRequest) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudCloudinstancesSnapshotsGetUnauthorized) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudCloudinstancesSnapshotsGetForbidden) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudCloudinstancesSnapshotsGetNotFound) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudCloudinstancesSnapshotsGetInternalServerError) readResponse(respo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_getall_responses.go index 63d3af550ba..6174ccec4ea 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_getall_responses.go @@ -7,6 +7,7 @@ package p_cloud_snapshots import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudCloudinstancesSnapshotsGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesSnapshotsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudCloudinstancesSnapshotsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudCloudinstancesSnapshotsGetallOK() @@ -128,7 +129,7 @@ func (o *PcloudCloudinstancesSnapshotsGetallOK) readResponse(response runtime.Cl o.Payload = new(models.Snapshots) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudCloudinstancesSnapshotsGetallBadRequest) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudCloudinstancesSnapshotsGetallUnauthorized) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudCloudinstancesSnapshotsGetallForbidden) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudCloudinstancesSnapshotsGetallNotFound) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudCloudinstancesSnapshotsGetallInternalServerError) readResponse(re o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_put_responses.go index dcba5cb8a07..a49c092f7ff 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_put_responses.go @@ -7,6 +7,7 @@ package p_cloud_snapshots import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudCloudinstancesSnapshotsPutReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesSnapshotsPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudCloudinstancesSnapshotsPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudCloudinstancesSnapshotsPutOK() @@ -76,7 +77,7 @@ PcloudCloudinstancesSnapshotsPutOK describes a response with status code 200, wi OK */ type PcloudCloudinstancesSnapshotsPutOK struct { - Payload models.Object + Payload *models.Snapshot } // IsSuccess returns true when this pcloud cloudinstances snapshots put o k response has a 2xx status code @@ -119,14 +120,16 @@ func (o *PcloudCloudinstancesSnapshotsPutOK) String() string { return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsPutOK %s", 200, payload) } -func (o *PcloudCloudinstancesSnapshotsPutOK) GetPayload() models.Object { +func (o *PcloudCloudinstancesSnapshotsPutOK) GetPayload() *models.Snapshot { return o.Payload } func (o *PcloudCloudinstancesSnapshotsPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(models.Snapshot) + // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -196,7 +199,7 @@ func (o *PcloudCloudinstancesSnapshotsPutBadRequest) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -266,7 +269,7 @@ func (o *PcloudCloudinstancesSnapshotsPutUnauthorized) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -336,7 +339,7 @@ func (o *PcloudCloudinstancesSnapshotsPutForbidden) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -406,7 +409,7 @@ func (o *PcloudCloudinstancesSnapshotsPutNotFound) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -476,7 +479,7 @@ func (o *PcloudCloudinstancesSnapshotsPutInternalServerError) readResponse(respo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/p_cloud_storage_capacity_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/p_cloud_storage_capacity_client.go index e2305a8a10c..32f896767b4 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/p_cloud_storage_capacity_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/p_cloud_storage_capacity_client.go @@ -71,7 +71,7 @@ type ClientService interface { PcloudStoragecapacityPoolsGet storages capacity for a storage pool in a region */ func (a *Client) PcloudStoragecapacityPoolsGet(params *PcloudStoragecapacityPoolsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudStoragecapacityPoolsGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudStoragecapacityPoolsGetParams() } @@ -91,17 +91,22 @@ func (a *Client) PcloudStoragecapacityPoolsGet(params *PcloudStoragecapacityPool for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudStoragecapacityPoolsGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.storagecapacity.pools.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -110,7 +115,7 @@ func (a *Client) PcloudStoragecapacityPoolsGet(params *PcloudStoragecapacityPool PcloudStoragecapacityPoolsGetall storages capacity for all available storage pools in a region */ func (a *Client) PcloudStoragecapacityPoolsGetall(params *PcloudStoragecapacityPoolsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudStoragecapacityPoolsGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudStoragecapacityPoolsGetallParams() } @@ -130,17 +135,22 @@ func (a *Client) PcloudStoragecapacityPoolsGetall(params *PcloudStoragecapacityP for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudStoragecapacityPoolsGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.storagecapacity.pools.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -149,7 +159,7 @@ func (a *Client) PcloudStoragecapacityPoolsGetall(params *PcloudStoragecapacityP PcloudStoragecapacityTypesGet storages capacity for a storage type in a region */ func (a *Client) PcloudStoragecapacityTypesGet(params *PcloudStoragecapacityTypesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudStoragecapacityTypesGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudStoragecapacityTypesGetParams() } @@ -169,17 +179,22 @@ func (a *Client) PcloudStoragecapacityTypesGet(params *PcloudStoragecapacityType for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudStoragecapacityTypesGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.storagecapacity.types.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -188,7 +203,7 @@ func (a *Client) PcloudStoragecapacityTypesGet(params *PcloudStoragecapacityType PcloudStoragecapacityTypesGetall storages capacity for all available storage types in a region */ func (a *Client) PcloudStoragecapacityTypesGetall(params *PcloudStoragecapacityTypesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudStoragecapacityTypesGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudStoragecapacityTypesGetallParams() } @@ -208,17 +223,22 @@ func (a *Client) PcloudStoragecapacityTypesGetall(params *PcloudStoragecapacityT for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudStoragecapacityTypesGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.storagecapacity.types.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_get_responses.go index 7120965a4ed..57d8b965767 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_storage_capacity import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudStoragecapacityPoolsGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudStoragecapacityPoolsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudStoragecapacityPoolsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudStoragecapacityPoolsGetOK() @@ -128,7 +129,7 @@ func (o *PcloudStoragecapacityPoolsGetOK) readResponse(response runtime.ClientRe o.Payload = new(models.StoragePoolCapacity) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudStoragecapacityPoolsGetBadRequest) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudStoragecapacityPoolsGetUnauthorized) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudStoragecapacityPoolsGetForbidden) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudStoragecapacityPoolsGetNotFound) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudStoragecapacityPoolsGetInternalServerError) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_getall_responses.go index 97ac829fbc3..c0f2014166a 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_pools_getall_responses.go @@ -7,6 +7,7 @@ package p_cloud_storage_capacity import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudStoragecapacityPoolsGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudStoragecapacityPoolsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudStoragecapacityPoolsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudStoragecapacityPoolsGetallOK() @@ -128,7 +129,7 @@ func (o *PcloudStoragecapacityPoolsGetallOK) readResponse(response runtime.Clien o.Payload = new(models.StoragePoolsCapacity) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudStoragecapacityPoolsGetallBadRequest) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudStoragecapacityPoolsGetallUnauthorized) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudStoragecapacityPoolsGetallForbidden) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudStoragecapacityPoolsGetallNotFound) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudStoragecapacityPoolsGetallInternalServerError) readResponse(respo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_get_responses.go index 229517d3111..d3d8ef66443 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_storage_capacity import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudStoragecapacityTypesGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudStoragecapacityTypesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudStoragecapacityTypesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudStoragecapacityTypesGetOK() @@ -128,7 +129,7 @@ func (o *PcloudStoragecapacityTypesGetOK) readResponse(response runtime.ClientRe o.Payload = new(models.StorageTypeCapacity) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudStoragecapacityTypesGetBadRequest) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudStoragecapacityTypesGetUnauthorized) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudStoragecapacityTypesGetForbidden) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudStoragecapacityTypesGetNotFound) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudStoragecapacityTypesGetInternalServerError) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_getall_responses.go index dba3624c361..2771d016f4c 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity/pcloud_storagecapacity_types_getall_responses.go @@ -7,6 +7,7 @@ package p_cloud_storage_capacity import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudStoragecapacityTypesGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudStoragecapacityTypesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudStoragecapacityTypesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudStoragecapacityTypesGetallOK() @@ -128,7 +129,7 @@ func (o *PcloudStoragecapacityTypesGetallOK) readResponse(response runtime.Clien o.Payload = new(models.StorageTypesCapacity) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudStoragecapacityTypesGetallBadRequest) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudStoragecapacityTypesGetallUnauthorized) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudStoragecapacityTypesGetallForbidden) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudStoragecapacityTypesGetallNotFound) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudStoragecapacityTypesGetallInternalServerError) readResponse(respo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_tiers/p_cloud_storage_tiers_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_tiers/p_cloud_storage_tiers_client.go index 624d19155b8..2d005b2f153 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_tiers/p_cloud_storage_tiers_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_tiers/p_cloud_storage_tiers_client.go @@ -65,7 +65,7 @@ type ClientService interface { PcloudCloudinstancesStoragetiersGetall lists all supported storage tiers for this cloud instance */ func (a *Client) PcloudCloudinstancesStoragetiersGetall(params *PcloudCloudinstancesStoragetiersGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesStoragetiersGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudCloudinstancesStoragetiersGetallParams() } @@ -85,17 +85,22 @@ func (a *Client) PcloudCloudinstancesStoragetiersGetall(params *PcloudCloudinsta for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudCloudinstancesStoragetiersGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.storagetiers.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_tiers/pcloud_cloudinstances_storagetiers_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_tiers/pcloud_cloudinstances_storagetiers_getall_responses.go index 6a033ad38c8..9306aea700e 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_tiers/pcloud_cloudinstances_storagetiers_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_tiers/pcloud_cloudinstances_storagetiers_getall_responses.go @@ -7,6 +7,7 @@ package p_cloud_storage_tiers import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudCloudinstancesStoragetiersGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesStoragetiersGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudCloudinstancesStoragetiersGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudCloudinstancesStoragetiersGetallOK() @@ -126,7 +127,7 @@ func (o *PcloudCloudinstancesStoragetiersGetallOK) GetPayload() models.RegionSto func (o *PcloudCloudinstancesStoragetiersGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -196,7 +197,7 @@ func (o *PcloudCloudinstancesStoragetiersGetallBadRequest) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -266,7 +267,7 @@ func (o *PcloudCloudinstancesStoragetiersGetallUnauthorized) readResponse(respon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -336,7 +337,7 @@ func (o *PcloudCloudinstancesStoragetiersGetallForbidden) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -406,7 +407,7 @@ func (o *PcloudCloudinstancesStoragetiersGetallNotFound) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -476,7 +477,7 @@ func (o *PcloudCloudinstancesStoragetiersGetallInternalServerError) readResponse o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_system_pools/p_cloud_system_pools_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_system_pools/p_cloud_system_pools_client.go index 63de58c27c1..505090dd840 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_system_pools/p_cloud_system_pools_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_system_pools/p_cloud_system_pools_client.go @@ -65,7 +65,7 @@ type ClientService interface { PcloudSystempoolsGet lists of available system pools within a particular data center */ func (a *Client) PcloudSystempoolsGet(params *PcloudSystempoolsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSystempoolsGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudSystempoolsGetParams() } @@ -85,17 +85,22 @@ func (a *Client) PcloudSystempoolsGet(params *PcloudSystempoolsGetParams, authIn for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudSystempoolsGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.systempools.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_system_pools/pcloud_systempools_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_system_pools/pcloud_systempools_get_responses.go index 139f134da0d..64db5760d77 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_system_pools/pcloud_systempools_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_system_pools/pcloud_systempools_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_system_pools import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudSystempoolsGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudSystempoolsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudSystempoolsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudSystempoolsGetOK() @@ -126,7 +127,7 @@ func (o *PcloudSystempoolsGetOK) GetPayload() models.SystemPools { func (o *PcloudSystempoolsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -196,7 +197,7 @@ func (o *PcloudSystempoolsGetBadRequest) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -266,7 +267,7 @@ func (o *PcloudSystempoolsGetUnauthorized) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -336,7 +337,7 @@ func (o *PcloudSystempoolsGetForbidden) readResponse(response runtime.ClientResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -406,7 +407,7 @@ func (o *PcloudSystempoolsGetNotFound) readResponse(response runtime.ClientRespo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -476,7 +477,7 @@ func (o *PcloudSystempoolsGetInternalServerError) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/p_cloud_tasks_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/p_cloud_tasks_client.go index 47b5fe5d755..32ee7980680 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/p_cloud_tasks_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/p_cloud_tasks_client.go @@ -67,7 +67,7 @@ type ClientService interface { PcloudTasksDelete deletes a task */ func (a *Client) PcloudTasksDelete(params *PcloudTasksDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTasksDeleteOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudTasksDeleteParams() } @@ -87,17 +87,22 @@ func (a *Client) PcloudTasksDelete(params *PcloudTasksDeleteParams, authInfo run for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudTasksDeleteOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.tasks.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -106,7 +111,7 @@ func (a *Client) PcloudTasksDelete(params *PcloudTasksDeleteParams, authInfo run PcloudTasksGet gets a task */ func (a *Client) PcloudTasksGet(params *PcloudTasksGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTasksGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudTasksGetParams() } @@ -126,17 +131,22 @@ func (a *Client) PcloudTasksGet(params *PcloudTasksGetParams, authInfo runtime.C for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudTasksGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.tasks.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/pcloud_tasks_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/pcloud_tasks_delete_responses.go index b98b472bc28..f258415c159 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/pcloud_tasks_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/pcloud_tasks_delete_responses.go @@ -7,6 +7,7 @@ package p_cloud_tasks import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudTasksDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudTasksDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudTasksDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudTasksDeleteOK() @@ -132,7 +133,7 @@ func (o *PcloudTasksDeleteOK) GetPayload() models.Object { func (o *PcloudTasksDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -202,7 +203,7 @@ func (o *PcloudTasksDeleteBadRequest) readResponse(response runtime.ClientRespon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -272,7 +273,7 @@ func (o *PcloudTasksDeleteUnauthorized) readResponse(response runtime.ClientResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -342,7 +343,7 @@ func (o *PcloudTasksDeleteForbidden) readResponse(response runtime.ClientRespons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -412,7 +413,7 @@ func (o *PcloudTasksDeleteNotFound) readResponse(response runtime.ClientResponse o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -482,7 +483,7 @@ func (o *PcloudTasksDeleteGone) readResponse(response runtime.ClientResponse, co o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -552,7 +553,7 @@ func (o *PcloudTasksDeleteInternalServerError) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/pcloud_tasks_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/pcloud_tasks_get_responses.go index 7d919787d5c..5076ffe885c 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/pcloud_tasks_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks/pcloud_tasks_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_tasks import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudTasksGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudTasksGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudTasksGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudTasksGetOK() @@ -128,7 +129,7 @@ func (o *PcloudTasksGetOK) readResponse(response runtime.ClientResponse, consume o.Payload = new(models.Task) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudTasksGetBadRequest) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudTasksGetUnauthorized) readResponse(response runtime.ClientRespons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudTasksGetForbidden) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudTasksGetNotFound) readResponse(response runtime.ClientResponse, c o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudTasksGetInternalServerError) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/p_cloud_tenants_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/p_cloud_tenants_client.go index 0813b7f89fd..a7bf0648987 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/p_cloud_tenants_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/p_cloud_tenants_client.go @@ -67,7 +67,7 @@ type ClientService interface { PcloudTenantsGet gets a tenant s current state information */ func (a *Client) PcloudTenantsGet(params *PcloudTenantsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTenantsGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudTenantsGetParams() } @@ -87,17 +87,22 @@ func (a *Client) PcloudTenantsGet(params *PcloudTenantsGetParams, authInfo runti for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudTenantsGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.tenants.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -106,7 +111,7 @@ func (a *Client) PcloudTenantsGet(params *PcloudTenantsGetParams, authInfo runti PcloudTenantsPut updates a tenant */ func (a *Client) PcloudTenantsPut(params *PcloudTenantsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTenantsPutOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudTenantsPutParams() } @@ -126,17 +131,22 @@ func (a *Client) PcloudTenantsPut(params *PcloudTenantsPutParams, authInfo runti for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudTenantsPutOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.tenants.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/pcloud_tenants_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/pcloud_tenants_get_responses.go index be445f73c2d..c86e29f308b 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/pcloud_tenants_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/pcloud_tenants_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_tenants import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudTenantsGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudTenantsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudTenantsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudTenantsGetOK() @@ -128,7 +129,7 @@ func (o *PcloudTenantsGetOK) readResponse(response runtime.ClientResponse, consu o.Payload = new(models.Tenant) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudTenantsGetBadRequest) readResponse(response runtime.ClientRespons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudTenantsGetUnauthorized) readResponse(response runtime.ClientRespo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudTenantsGetForbidden) readResponse(response runtime.ClientResponse o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudTenantsGetNotFound) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudTenantsGetInternalServerError) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/pcloud_tenants_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/pcloud_tenants_put_responses.go index b91d00cf3c3..97b59e7bad3 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/pcloud_tenants_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants/pcloud_tenants_put_responses.go @@ -7,6 +7,7 @@ package p_cloud_tenants import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudTenantsPutReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudTenantsPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudTenantsPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudTenantsPutOK() @@ -134,7 +135,7 @@ func (o *PcloudTenantsPutOK) readResponse(response runtime.ClientResponse, consu o.Payload = new(models.Tenant) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *PcloudTenantsPutBadRequest) readResponse(response runtime.ClientRespons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *PcloudTenantsPutUnauthorized) readResponse(response runtime.ClientRespo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *PcloudTenantsPutForbidden) readResponse(response runtime.ClientResponse o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *PcloudTenantsPutNotFound) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *PcloudTenantsPutUnprocessableEntity) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *PcloudTenantsPutInternalServerError) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/p_cloud_tenants_ssh_keys_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/p_cloud_tenants_ssh_keys_client.go index 441452be122..263d96cb914 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/p_cloud_tenants_ssh_keys_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/p_cloud_tenants_ssh_keys_client.go @@ -73,7 +73,7 @@ type ClientService interface { PcloudTenantsSshkeysDelete deletes a tenant s SSH key */ func (a *Client) PcloudTenantsSshkeysDelete(params *PcloudTenantsSshkeysDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTenantsSshkeysDeleteOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudTenantsSshkeysDeleteParams() } @@ -93,17 +93,22 @@ func (a *Client) PcloudTenantsSshkeysDelete(params *PcloudTenantsSshkeysDeletePa for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudTenantsSshkeysDeleteOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.tenants.sshkeys.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -112,7 +117,7 @@ func (a *Client) PcloudTenantsSshkeysDelete(params *PcloudTenantsSshkeysDeletePa PcloudTenantsSshkeysGet gets a tenant s SSH key by name */ func (a *Client) PcloudTenantsSshkeysGet(params *PcloudTenantsSshkeysGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTenantsSshkeysGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudTenantsSshkeysGetParams() } @@ -132,17 +137,22 @@ func (a *Client) PcloudTenantsSshkeysGet(params *PcloudTenantsSshkeysGetParams, for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudTenantsSshkeysGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.tenants.sshkeys.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -151,7 +161,7 @@ func (a *Client) PcloudTenantsSshkeysGet(params *PcloudTenantsSshkeysGetParams, PcloudTenantsSshkeysGetall lists a tenant s SSH keys */ func (a *Client) PcloudTenantsSshkeysGetall(params *PcloudTenantsSshkeysGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTenantsSshkeysGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudTenantsSshkeysGetallParams() } @@ -171,17 +181,22 @@ func (a *Client) PcloudTenantsSshkeysGetall(params *PcloudTenantsSshkeysGetallPa for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudTenantsSshkeysGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.tenants.sshkeys.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -190,7 +205,7 @@ func (a *Client) PcloudTenantsSshkeysGetall(params *PcloudTenantsSshkeysGetallPa PcloudTenantsSshkeysPost adds a new SSH key to the tenant */ func (a *Client) PcloudTenantsSshkeysPost(params *PcloudTenantsSshkeysPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTenantsSshkeysPostOK, *PcloudTenantsSshkeysPostCreated, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudTenantsSshkeysPostParams() } @@ -210,18 +225,22 @@ func (a *Client) PcloudTenantsSshkeysPost(params *PcloudTenantsSshkeysPostParams for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } + + // several success responses have to be checked switch value := result.(type) { case *PcloudTenantsSshkeysPostOK: return value, nil, nil case *PcloudTenantsSshkeysPostCreated: return nil, value, nil } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for p_cloud_tenants_ssh_keys: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -230,7 +249,7 @@ func (a *Client) PcloudTenantsSshkeysPost(params *PcloudTenantsSshkeysPostParams PcloudTenantsSshkeysPut updates an SSH key */ func (a *Client) PcloudTenantsSshkeysPut(params *PcloudTenantsSshkeysPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudTenantsSshkeysPutOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudTenantsSshkeysPutParams() } @@ -250,17 +269,22 @@ func (a *Client) PcloudTenantsSshkeysPut(params *PcloudTenantsSshkeysPutParams, for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudTenantsSshkeysPutOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.tenants.sshkeys.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_delete_responses.go index b301a433bf1..0c2bb182beb 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_delete_responses.go @@ -7,6 +7,7 @@ package p_cloud_tenants_ssh_keys import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudTenantsSshkeysDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudTenantsSshkeysDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudTenantsSshkeysDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudTenantsSshkeysDeleteOK() @@ -132,7 +133,7 @@ func (o *PcloudTenantsSshkeysDeleteOK) GetPayload() models.Object { func (o *PcloudTenantsSshkeysDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -202,7 +203,7 @@ func (o *PcloudTenantsSshkeysDeleteBadRequest) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -272,7 +273,7 @@ func (o *PcloudTenantsSshkeysDeleteUnauthorized) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -342,7 +343,7 @@ func (o *PcloudTenantsSshkeysDeleteForbidden) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -412,7 +413,7 @@ func (o *PcloudTenantsSshkeysDeleteNotFound) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -482,7 +483,7 @@ func (o *PcloudTenantsSshkeysDeleteGone) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -552,7 +553,7 @@ func (o *PcloudTenantsSshkeysDeleteInternalServerError) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_get_responses.go index 03d83f7f86b..d3c8d3ae507 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_tenants_ssh_keys import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudTenantsSshkeysGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudTenantsSshkeysGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudTenantsSshkeysGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudTenantsSshkeysGetOK() @@ -128,7 +129,7 @@ func (o *PcloudTenantsSshkeysGetOK) readResponse(response runtime.ClientResponse o.Payload = new(models.SSHKey) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudTenantsSshkeysGetBadRequest) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudTenantsSshkeysGetUnauthorized) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudTenantsSshkeysGetForbidden) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudTenantsSshkeysGetNotFound) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudTenantsSshkeysGetInternalServerError) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_getall_responses.go index 6e339e1d014..fa888352813 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_getall_responses.go @@ -7,6 +7,7 @@ package p_cloud_tenants_ssh_keys import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudTenantsSshkeysGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudTenantsSshkeysGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudTenantsSshkeysGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudTenantsSshkeysGetallOK() @@ -128,7 +129,7 @@ func (o *PcloudTenantsSshkeysGetallOK) readResponse(response runtime.ClientRespo o.Payload = new(models.SSHKeys) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudTenantsSshkeysGetallBadRequest) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudTenantsSshkeysGetallUnauthorized) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudTenantsSshkeysGetallForbidden) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudTenantsSshkeysGetallNotFound) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudTenantsSshkeysGetallInternalServerError) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_post_responses.go index 76dbebc9566..83c3ade4eb2 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_tenants_ssh_keys import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudTenantsSshkeysPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudTenantsSshkeysPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudTenantsSshkeysPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudTenantsSshkeysPostOK() @@ -146,7 +147,7 @@ func (o *PcloudTenantsSshkeysPostOK) readResponse(response runtime.ClientRespons o.Payload = new(models.SSHKey) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -216,7 +217,7 @@ func (o *PcloudTenantsSshkeysPostCreated) readResponse(response runtime.ClientRe o.Payload = new(models.SSHKey) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -286,7 +287,7 @@ func (o *PcloudTenantsSshkeysPostBadRequest) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -356,7 +357,7 @@ func (o *PcloudTenantsSshkeysPostUnauthorized) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -426,7 +427,7 @@ func (o *PcloudTenantsSshkeysPostForbidden) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -496,7 +497,7 @@ func (o *PcloudTenantsSshkeysPostNotFound) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -566,7 +567,7 @@ func (o *PcloudTenantsSshkeysPostConflict) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -636,7 +637,7 @@ func (o *PcloudTenantsSshkeysPostUnprocessableEntity) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -706,7 +707,7 @@ func (o *PcloudTenantsSshkeysPostInternalServerError) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_put_responses.go index 70026ead738..5e2a4fb5253 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys/pcloud_tenants_sshkeys_put_responses.go @@ -7,6 +7,7 @@ package p_cloud_tenants_ssh_keys import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudTenantsSshkeysPutReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudTenantsSshkeysPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudTenantsSshkeysPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudTenantsSshkeysPutOK() @@ -134,7 +135,7 @@ func (o *PcloudTenantsSshkeysPutOK) readResponse(response runtime.ClientResponse o.Payload = new(models.SSHKey) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *PcloudTenantsSshkeysPutBadRequest) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *PcloudTenantsSshkeysPutUnauthorized) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *PcloudTenantsSshkeysPutForbidden) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *PcloudTenantsSshkeysPutNotFound) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *PcloudTenantsSshkeysPutUnprocessableEntity) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *PcloudTenantsSshkeysPutInternalServerError) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_mem_volumes/p_cloudvp_mem_volumes_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_mem_volumes/p_cloudvp_mem_volumes_client.go new file mode 100644 index 00000000000..175ddc014c6 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_mem_volumes/p_cloudvp_mem_volumes_client.go @@ -0,0 +1,253 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_v_p_mem_volumes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// New creates a new p cloud v p mem volumes API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +// New creates a new p cloud v p mem volumes API client with basic auth credentials. +// It takes the following parameters: +// - host: http host (github.com). +// - basePath: any base path for the API client ("/v1", "/v3"). +// - scheme: http scheme ("http", "https"). +// - user: user for basic authentication header. +// - password: password for basic authentication header. +func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { + transport := httptransport.New(host, basePath, []string{scheme}) + transport.DefaultAuthentication = httptransport.BasicAuth(user, password) + return &Client{transport: transport, formats: strfmt.Default} +} + +// New creates a new p cloud v p mem volumes API client with a bearer token for authentication. +// It takes the following parameters: +// - host: http host (github.com). +// - basePath: any base path for the API client ("/v1", "/v3"). +// - scheme: http scheme ("http", "https"). +// - bearerToken: bearer token for Bearer authentication header. +func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { + transport := httptransport.New(host, basePath, []string{scheme}) + transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) + return &Client{transport: transport, formats: strfmt.Default} +} + +/* +Client for p cloud v p mem volumes API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption may be used to customize the behavior of Client methods. +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + PcloudPvminstancesVpmemVolumesDelete(params *PcloudPvminstancesVpmemVolumesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVpmemVolumesDeleteAccepted, error) + + PcloudPvminstancesVpmemVolumesGet(params *PcloudPvminstancesVpmemVolumesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVpmemVolumesGetOK, error) + + PcloudPvminstancesVpmemVolumesGetall(params *PcloudPvminstancesVpmemVolumesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVpmemVolumesGetallOK, error) + + PcloudPvminstancesVpmemVolumesPost(params *PcloudPvminstancesVpmemVolumesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVpmemVolumesPostAccepted, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +PcloudPvminstancesVpmemVolumesDelete deletes a v p m e m volume attached to this p VM instance + +vPMEM volumes of PVM Instances using SAP profiles will return carved out memory. Other cases are a reduction from total memory. +*/ +func (a *Client) PcloudPvminstancesVpmemVolumesDelete(params *PcloudPvminstancesVpmemVolumesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVpmemVolumesDeleteAccepted, error) { + // NOTE: parameters are not validated before sending + if params == nil { + params = NewPcloudPvminstancesVpmemVolumesDeleteParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.pvminstances.vpmem-volumes.delete", + Method: "DELETE", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes/{vpmem_volume_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudPvminstancesVpmemVolumesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + + // only one success response has to be checked + success, ok := result.(*PcloudPvminstancesVpmemVolumesDeleteAccepted) + if ok { + return success, nil + } + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.vpmem-volumes.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +PcloudPvminstancesVpmemVolumesGet gets information about a v p m e m volume +*/ +func (a *Client) PcloudPvminstancesVpmemVolumesGet(params *PcloudPvminstancesVpmemVolumesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVpmemVolumesGetOK, error) { + // NOTE: parameters are not validated before sending + if params == nil { + params = NewPcloudPvminstancesVpmemVolumesGetParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.pvminstances.vpmem-volumes.get", + Method: "GET", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes/{vpmem_volume_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudPvminstancesVpmemVolumesGetReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + + // only one success response has to be checked + success, ok := result.(*PcloudPvminstancesVpmemVolumesGetOK) + if ok { + return success, nil + } + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.vpmem-volumes.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +PcloudPvminstancesVpmemVolumesGetall lists all v p m e m volumes attached to this p VM instance +*/ +func (a *Client) PcloudPvminstancesVpmemVolumesGetall(params *PcloudPvminstancesVpmemVolumesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVpmemVolumesGetallOK, error) { + // NOTE: parameters are not validated before sending + if params == nil { + params = NewPcloudPvminstancesVpmemVolumesGetallParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.pvminstances.vpmem-volumes.getall", + Method: "GET", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudPvminstancesVpmemVolumesGetallReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + + // only one success response has to be checked + success, ok := result.(*PcloudPvminstancesVpmemVolumesGetallOK) + if ok { + return success, nil + } + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.vpmem-volumes.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +PcloudPvminstancesVpmemVolumesPost creates a v p m e m volume to be attached to this p VM instance + +vPMEM volumes of PVM Instances using SAP profiles will be carved out of profile total memory. Other cases are in addition to total memory. +*/ +func (a *Client) PcloudPvminstancesVpmemVolumesPost(params *PcloudPvminstancesVpmemVolumesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVpmemVolumesPostAccepted, error) { + // NOTE: parameters are not validated before sending + if params == nil { + params = NewPcloudPvminstancesVpmemVolumesPostParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.pvminstances.vpmem-volumes.post", + Method: "POST", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudPvminstancesVpmemVolumesPostReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + + // only one success response has to be checked + success, ok := result.(*PcloudPvminstancesVpmemVolumesPostAccepted) + if ok { + return success, nil + } + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.vpmem-volumes.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_mem_volumes/pcloud_pvminstances_vpmem_volumes_delete_parameters.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_mem_volumes/pcloud_pvminstances_vpmem_volumes_delete_parameters.go new file mode 100644 index 00000000000..fede6ddc380 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_mem_volumes/pcloud_pvminstances_vpmem_volumes_delete_parameters.go @@ -0,0 +1,195 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_v_p_mem_volumes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewPcloudPvminstancesVpmemVolumesDeleteParams creates a new PcloudPvminstancesVpmemVolumesDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewPcloudPvminstancesVpmemVolumesDeleteParams() *PcloudPvminstancesVpmemVolumesDeleteParams { + return &PcloudPvminstancesVpmemVolumesDeleteParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPcloudPvminstancesVpmemVolumesDeleteParamsWithTimeout creates a new PcloudPvminstancesVpmemVolumesDeleteParams object +// with the ability to set a timeout on a request. +func NewPcloudPvminstancesVpmemVolumesDeleteParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesVpmemVolumesDeleteParams { + return &PcloudPvminstancesVpmemVolumesDeleteParams{ + timeout: timeout, + } +} + +// NewPcloudPvminstancesVpmemVolumesDeleteParamsWithContext creates a new PcloudPvminstancesVpmemVolumesDeleteParams object +// with the ability to set a context for a request. +func NewPcloudPvminstancesVpmemVolumesDeleteParamsWithContext(ctx context.Context) *PcloudPvminstancesVpmemVolumesDeleteParams { + return &PcloudPvminstancesVpmemVolumesDeleteParams{ + Context: ctx, + } +} + +// NewPcloudPvminstancesVpmemVolumesDeleteParamsWithHTTPClient creates a new PcloudPvminstancesVpmemVolumesDeleteParams object +// with the ability to set a custom HTTPClient for a request. +func NewPcloudPvminstancesVpmemVolumesDeleteParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesVpmemVolumesDeleteParams { + return &PcloudPvminstancesVpmemVolumesDeleteParams{ + HTTPClient: client, + } +} + +/* +PcloudPvminstancesVpmemVolumesDeleteParams contains all the parameters to send to the API endpoint + + for the pcloud pvminstances vpmem volumes delete operation. + + Typically these are written to a http.Request. +*/ +type PcloudPvminstancesVpmemVolumesDeleteParams struct { + + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance + */ + CloudInstanceID string + + /* PvmInstanceID. + + PCloud PVM Instance ID + */ + PvmInstanceID string + + /* VpmemVolumeID. + + vPMEM Volume ID + */ + VpmemVolumeID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the pcloud pvminstances vpmem volumes delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesVpmemVolumesDeleteParams) WithDefaults() *PcloudPvminstancesVpmemVolumesDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud pvminstances vpmem volumes delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesVpmemVolumesDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the pcloud pvminstances vpmem volumes delete params +func (o *PcloudPvminstancesVpmemVolumesDeleteParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesVpmemVolumesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the pcloud pvminstances vpmem volumes delete params +func (o *PcloudPvminstancesVpmemVolumesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the pcloud pvminstances vpmem volumes delete params +func (o *PcloudPvminstancesVpmemVolumesDeleteParams) WithContext(ctx context.Context) *PcloudPvminstancesVpmemVolumesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the pcloud pvminstances vpmem volumes delete params +func (o *PcloudPvminstancesVpmemVolumesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the pcloud pvminstances vpmem volumes delete params +func (o *PcloudPvminstancesVpmemVolumesDeleteParams) WithHTTPClient(client *http.Client) *PcloudPvminstancesVpmemVolumesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the pcloud pvminstances vpmem volumes delete params +func (o *PcloudPvminstancesVpmemVolumesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCloudInstanceID adds the cloudInstanceID to the pcloud pvminstances vpmem volumes delete params +func (o *PcloudPvminstancesVpmemVolumesDeleteParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPvminstancesVpmemVolumesDeleteParams { + o.SetCloudInstanceID(cloudInstanceID) + return o +} + +// SetCloudInstanceID adds the cloudInstanceId to the pcloud pvminstances vpmem volumes delete params +func (o *PcloudPvminstancesVpmemVolumesDeleteParams) SetCloudInstanceID(cloudInstanceID string) { + o.CloudInstanceID = cloudInstanceID +} + +// WithPvmInstanceID adds the pvmInstanceID to the pcloud pvminstances vpmem volumes delete params +func (o *PcloudPvminstancesVpmemVolumesDeleteParams) WithPvmInstanceID(pvmInstanceID string) *PcloudPvminstancesVpmemVolumesDeleteParams { + o.SetPvmInstanceID(pvmInstanceID) + return o +} + +// SetPvmInstanceID adds the pvmInstanceId to the pcloud pvminstances vpmem volumes delete params +func (o *PcloudPvminstancesVpmemVolumesDeleteParams) SetPvmInstanceID(pvmInstanceID string) { + o.PvmInstanceID = pvmInstanceID +} + +// WithVpmemVolumeID adds the vpmemVolumeID to the pcloud pvminstances vpmem volumes delete params +func (o *PcloudPvminstancesVpmemVolumesDeleteParams) WithVpmemVolumeID(vpmemVolumeID string) *PcloudPvminstancesVpmemVolumesDeleteParams { + o.SetVpmemVolumeID(vpmemVolumeID) + return o +} + +// SetVpmemVolumeID adds the vpmemVolumeId to the pcloud pvminstances vpmem volumes delete params +func (o *PcloudPvminstancesVpmemVolumesDeleteParams) SetVpmemVolumeID(vpmemVolumeID string) { + o.VpmemVolumeID = vpmemVolumeID +} + +// WriteToRequest writes these params to a swagger request +func (o *PcloudPvminstancesVpmemVolumesDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param cloud_instance_id + if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { + return err + } + + // path param pvm_instance_id + if err := r.SetPathParam("pvm_instance_id", o.PvmInstanceID); err != nil { + return err + } + + // path param vpmem_volume_id + if err := r.SetPathParam("vpmem_volume_id", o.VpmemVolumeID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_mem_volumes/pcloud_pvminstances_vpmem_volumes_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_mem_volumes/pcloud_pvminstances_vpmem_volumes_delete_responses.go new file mode 100644 index 00000000000..ae819b4574d --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_mem_volumes/pcloud_pvminstances_vpmem_volumes_delete_responses.go @@ -0,0 +1,561 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_v_p_mem_volumes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + stderrors "errors" + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// PcloudPvminstancesVpmemVolumesDeleteReader is a Reader for the PcloudPvminstancesVpmemVolumesDelete structure. +type PcloudPvminstancesVpmemVolumesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PcloudPvminstancesVpmemVolumesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { + switch response.Code() { + case 202: + result := NewPcloudPvminstancesVpmemVolumesDeleteAccepted() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewPcloudPvminstancesVpmemVolumesDeleteBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewPcloudPvminstancesVpmemVolumesDeleteUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPcloudPvminstancesVpmemVolumesDeleteForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPcloudPvminstancesVpmemVolumesDeleteNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewPcloudPvminstancesVpmemVolumesDeleteConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPcloudPvminstancesVpmemVolumesDeleteInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes/{vpmem_volume_id}] pcloud.pvminstances.vpmem-volumes.delete", response, response.Code()) + } +} + +// NewPcloudPvminstancesVpmemVolumesDeleteAccepted creates a PcloudPvminstancesVpmemVolumesDeleteAccepted with default headers values +func NewPcloudPvminstancesVpmemVolumesDeleteAccepted() *PcloudPvminstancesVpmemVolumesDeleteAccepted { + return &PcloudPvminstancesVpmemVolumesDeleteAccepted{} +} + +/* +PcloudPvminstancesVpmemVolumesDeleteAccepted describes a response with status code 202, with default header values. + +Accepted +*/ +type PcloudPvminstancesVpmemVolumesDeleteAccepted struct { + Payload models.Object +} + +// IsSuccess returns true when this pcloud pvminstances vpmem volumes delete accepted response has a 2xx status code +func (o *PcloudPvminstancesVpmemVolumesDeleteAccepted) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this pcloud pvminstances vpmem volumes delete accepted response has a 3xx status code +func (o *PcloudPvminstancesVpmemVolumesDeleteAccepted) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud pvminstances vpmem volumes delete accepted response has a 4xx status code +func (o *PcloudPvminstancesVpmemVolumesDeleteAccepted) IsClientError() bool { + return false +} + +// IsServerError returns true when this pcloud pvminstances vpmem volumes delete accepted response has a 5xx status code +func (o *PcloudPvminstancesVpmemVolumesDeleteAccepted) IsServerError() bool { + return false +} + +// IsCode returns true when this pcloud pvminstances vpmem volumes delete accepted response a status code equal to that given +func (o *PcloudPvminstancesVpmemVolumesDeleteAccepted) IsCode(code int) bool { + return code == 202 +} + +// Code gets the status code for the pcloud pvminstances vpmem volumes delete accepted response +func (o *PcloudPvminstancesVpmemVolumesDeleteAccepted) Code() int { + return 202 +} + +func (o *PcloudPvminstancesVpmemVolumesDeleteAccepted) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes/{vpmem_volume_id}][%d] pcloudPvminstancesVpmemVolumesDeleteAccepted %s", 202, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesDeleteAccepted) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes/{vpmem_volume_id}][%d] pcloudPvminstancesVpmemVolumesDeleteAccepted %s", 202, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesDeleteAccepted) GetPayload() models.Object { + return o.Payload +} + +func (o *PcloudPvminstancesVpmemVolumesDeleteAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPcloudPvminstancesVpmemVolumesDeleteBadRequest creates a PcloudPvminstancesVpmemVolumesDeleteBadRequest with default headers values +func NewPcloudPvminstancesVpmemVolumesDeleteBadRequest() *PcloudPvminstancesVpmemVolumesDeleteBadRequest { + return &PcloudPvminstancesVpmemVolumesDeleteBadRequest{} +} + +/* +PcloudPvminstancesVpmemVolumesDeleteBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type PcloudPvminstancesVpmemVolumesDeleteBadRequest struct { + Payload *models.Error +} + +// IsSuccess returns true when this pcloud pvminstances vpmem volumes delete bad request response has a 2xx status code +func (o *PcloudPvminstancesVpmemVolumesDeleteBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this pcloud pvminstances vpmem volumes delete bad request response has a 3xx status code +func (o *PcloudPvminstancesVpmemVolumesDeleteBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud pvminstances vpmem volumes delete bad request response has a 4xx status code +func (o *PcloudPvminstancesVpmemVolumesDeleteBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this pcloud pvminstances vpmem volumes delete bad request response has a 5xx status code +func (o *PcloudPvminstancesVpmemVolumesDeleteBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this pcloud pvminstances vpmem volumes delete bad request response a status code equal to that given +func (o *PcloudPvminstancesVpmemVolumesDeleteBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the pcloud pvminstances vpmem volumes delete bad request response +func (o *PcloudPvminstancesVpmemVolumesDeleteBadRequest) Code() int { + return 400 +} + +func (o *PcloudPvminstancesVpmemVolumesDeleteBadRequest) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes/{vpmem_volume_id}][%d] pcloudPvminstancesVpmemVolumesDeleteBadRequest %s", 400, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesDeleteBadRequest) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes/{vpmem_volume_id}][%d] pcloudPvminstancesVpmemVolumesDeleteBadRequest %s", 400, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesDeleteBadRequest) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudPvminstancesVpmemVolumesDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPcloudPvminstancesVpmemVolumesDeleteUnauthorized creates a PcloudPvminstancesVpmemVolumesDeleteUnauthorized with default headers values +func NewPcloudPvminstancesVpmemVolumesDeleteUnauthorized() *PcloudPvminstancesVpmemVolumesDeleteUnauthorized { + return &PcloudPvminstancesVpmemVolumesDeleteUnauthorized{} +} + +/* +PcloudPvminstancesVpmemVolumesDeleteUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type PcloudPvminstancesVpmemVolumesDeleteUnauthorized struct { + Payload *models.Error +} + +// IsSuccess returns true when this pcloud pvminstances vpmem volumes delete unauthorized response has a 2xx status code +func (o *PcloudPvminstancesVpmemVolumesDeleteUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this pcloud pvminstances vpmem volumes delete unauthorized response has a 3xx status code +func (o *PcloudPvminstancesVpmemVolumesDeleteUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud pvminstances vpmem volumes delete unauthorized response has a 4xx status code +func (o *PcloudPvminstancesVpmemVolumesDeleteUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this pcloud pvminstances vpmem volumes delete unauthorized response has a 5xx status code +func (o *PcloudPvminstancesVpmemVolumesDeleteUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this pcloud pvminstances vpmem volumes delete unauthorized response a status code equal to that given +func (o *PcloudPvminstancesVpmemVolumesDeleteUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the pcloud pvminstances vpmem volumes delete unauthorized response +func (o *PcloudPvminstancesVpmemVolumesDeleteUnauthorized) Code() int { + return 401 +} + +func (o *PcloudPvminstancesVpmemVolumesDeleteUnauthorized) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes/{vpmem_volume_id}][%d] pcloudPvminstancesVpmemVolumesDeleteUnauthorized %s", 401, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesDeleteUnauthorized) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes/{vpmem_volume_id}][%d] pcloudPvminstancesVpmemVolumesDeleteUnauthorized %s", 401, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesDeleteUnauthorized) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudPvminstancesVpmemVolumesDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPcloudPvminstancesVpmemVolumesDeleteForbidden creates a PcloudPvminstancesVpmemVolumesDeleteForbidden with default headers values +func NewPcloudPvminstancesVpmemVolumesDeleteForbidden() *PcloudPvminstancesVpmemVolumesDeleteForbidden { + return &PcloudPvminstancesVpmemVolumesDeleteForbidden{} +} + +/* +PcloudPvminstancesVpmemVolumesDeleteForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type PcloudPvminstancesVpmemVolumesDeleteForbidden struct { + Payload *models.Error +} + +// IsSuccess returns true when this pcloud pvminstances vpmem volumes delete forbidden response has a 2xx status code +func (o *PcloudPvminstancesVpmemVolumesDeleteForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this pcloud pvminstances vpmem volumes delete forbidden response has a 3xx status code +func (o *PcloudPvminstancesVpmemVolumesDeleteForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud pvminstances vpmem volumes delete forbidden response has a 4xx status code +func (o *PcloudPvminstancesVpmemVolumesDeleteForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this pcloud pvminstances vpmem volumes delete forbidden response has a 5xx status code +func (o *PcloudPvminstancesVpmemVolumesDeleteForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this pcloud pvminstances vpmem volumes delete forbidden response a status code equal to that given +func (o *PcloudPvminstancesVpmemVolumesDeleteForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the pcloud pvminstances vpmem volumes delete forbidden response +func (o *PcloudPvminstancesVpmemVolumesDeleteForbidden) Code() int { + return 403 +} + +func (o *PcloudPvminstancesVpmemVolumesDeleteForbidden) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes/{vpmem_volume_id}][%d] pcloudPvminstancesVpmemVolumesDeleteForbidden %s", 403, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesDeleteForbidden) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes/{vpmem_volume_id}][%d] pcloudPvminstancesVpmemVolumesDeleteForbidden %s", 403, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesDeleteForbidden) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudPvminstancesVpmemVolumesDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPcloudPvminstancesVpmemVolumesDeleteNotFound creates a PcloudPvminstancesVpmemVolumesDeleteNotFound with default headers values +func NewPcloudPvminstancesVpmemVolumesDeleteNotFound() *PcloudPvminstancesVpmemVolumesDeleteNotFound { + return &PcloudPvminstancesVpmemVolumesDeleteNotFound{} +} + +/* +PcloudPvminstancesVpmemVolumesDeleteNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type PcloudPvminstancesVpmemVolumesDeleteNotFound struct { + Payload *models.Error +} + +// IsSuccess returns true when this pcloud pvminstances vpmem volumes delete not found response has a 2xx status code +func (o *PcloudPvminstancesVpmemVolumesDeleteNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this pcloud pvminstances vpmem volumes delete not found response has a 3xx status code +func (o *PcloudPvminstancesVpmemVolumesDeleteNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud pvminstances vpmem volumes delete not found response has a 4xx status code +func (o *PcloudPvminstancesVpmemVolumesDeleteNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this pcloud pvminstances vpmem volumes delete not found response has a 5xx status code +func (o *PcloudPvminstancesVpmemVolumesDeleteNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this pcloud pvminstances vpmem volumes delete not found response a status code equal to that given +func (o *PcloudPvminstancesVpmemVolumesDeleteNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the pcloud pvminstances vpmem volumes delete not found response +func (o *PcloudPvminstancesVpmemVolumesDeleteNotFound) Code() int { + return 404 +} + +func (o *PcloudPvminstancesVpmemVolumesDeleteNotFound) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes/{vpmem_volume_id}][%d] pcloudPvminstancesVpmemVolumesDeleteNotFound %s", 404, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesDeleteNotFound) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes/{vpmem_volume_id}][%d] pcloudPvminstancesVpmemVolumesDeleteNotFound %s", 404, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesDeleteNotFound) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudPvminstancesVpmemVolumesDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPcloudPvminstancesVpmemVolumesDeleteConflict creates a PcloudPvminstancesVpmemVolumesDeleteConflict with default headers values +func NewPcloudPvminstancesVpmemVolumesDeleteConflict() *PcloudPvminstancesVpmemVolumesDeleteConflict { + return &PcloudPvminstancesVpmemVolumesDeleteConflict{} +} + +/* +PcloudPvminstancesVpmemVolumesDeleteConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type PcloudPvminstancesVpmemVolumesDeleteConflict struct { + Payload *models.Error +} + +// IsSuccess returns true when this pcloud pvminstances vpmem volumes delete conflict response has a 2xx status code +func (o *PcloudPvminstancesVpmemVolumesDeleteConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this pcloud pvminstances vpmem volumes delete conflict response has a 3xx status code +func (o *PcloudPvminstancesVpmemVolumesDeleteConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud pvminstances vpmem volumes delete conflict response has a 4xx status code +func (o *PcloudPvminstancesVpmemVolumesDeleteConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this pcloud pvminstances vpmem volumes delete conflict response has a 5xx status code +func (o *PcloudPvminstancesVpmemVolumesDeleteConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this pcloud pvminstances vpmem volumes delete conflict response a status code equal to that given +func (o *PcloudPvminstancesVpmemVolumesDeleteConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the pcloud pvminstances vpmem volumes delete conflict response +func (o *PcloudPvminstancesVpmemVolumesDeleteConflict) Code() int { + return 409 +} + +func (o *PcloudPvminstancesVpmemVolumesDeleteConflict) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes/{vpmem_volume_id}][%d] pcloudPvminstancesVpmemVolumesDeleteConflict %s", 409, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesDeleteConflict) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes/{vpmem_volume_id}][%d] pcloudPvminstancesVpmemVolumesDeleteConflict %s", 409, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesDeleteConflict) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudPvminstancesVpmemVolumesDeleteConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPcloudPvminstancesVpmemVolumesDeleteInternalServerError creates a PcloudPvminstancesVpmemVolumesDeleteInternalServerError with default headers values +func NewPcloudPvminstancesVpmemVolumesDeleteInternalServerError() *PcloudPvminstancesVpmemVolumesDeleteInternalServerError { + return &PcloudPvminstancesVpmemVolumesDeleteInternalServerError{} +} + +/* +PcloudPvminstancesVpmemVolumesDeleteInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type PcloudPvminstancesVpmemVolumesDeleteInternalServerError struct { + Payload *models.Error +} + +// IsSuccess returns true when this pcloud pvminstances vpmem volumes delete internal server error response has a 2xx status code +func (o *PcloudPvminstancesVpmemVolumesDeleteInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this pcloud pvminstances vpmem volumes delete internal server error response has a 3xx status code +func (o *PcloudPvminstancesVpmemVolumesDeleteInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud pvminstances vpmem volumes delete internal server error response has a 4xx status code +func (o *PcloudPvminstancesVpmemVolumesDeleteInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this pcloud pvminstances vpmem volumes delete internal server error response has a 5xx status code +func (o *PcloudPvminstancesVpmemVolumesDeleteInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this pcloud pvminstances vpmem volumes delete internal server error response a status code equal to that given +func (o *PcloudPvminstancesVpmemVolumesDeleteInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the pcloud pvminstances vpmem volumes delete internal server error response +func (o *PcloudPvminstancesVpmemVolumesDeleteInternalServerError) Code() int { + return 500 +} + +func (o *PcloudPvminstancesVpmemVolumesDeleteInternalServerError) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes/{vpmem_volume_id}][%d] pcloudPvminstancesVpmemVolumesDeleteInternalServerError %s", 500, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesDeleteInternalServerError) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes/{vpmem_volume_id}][%d] pcloudPvminstancesVpmemVolumesDeleteInternalServerError %s", 500, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesDeleteInternalServerError) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudPvminstancesVpmemVolumesDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_mem_volumes/pcloud_pvminstances_vpmem_volumes_get_parameters.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_mem_volumes/pcloud_pvminstances_vpmem_volumes_get_parameters.go new file mode 100644 index 00000000000..75c8d70df18 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_mem_volumes/pcloud_pvminstances_vpmem_volumes_get_parameters.go @@ -0,0 +1,195 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_v_p_mem_volumes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewPcloudPvminstancesVpmemVolumesGetParams creates a new PcloudPvminstancesVpmemVolumesGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewPcloudPvminstancesVpmemVolumesGetParams() *PcloudPvminstancesVpmemVolumesGetParams { + return &PcloudPvminstancesVpmemVolumesGetParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPcloudPvminstancesVpmemVolumesGetParamsWithTimeout creates a new PcloudPvminstancesVpmemVolumesGetParams object +// with the ability to set a timeout on a request. +func NewPcloudPvminstancesVpmemVolumesGetParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesVpmemVolumesGetParams { + return &PcloudPvminstancesVpmemVolumesGetParams{ + timeout: timeout, + } +} + +// NewPcloudPvminstancesVpmemVolumesGetParamsWithContext creates a new PcloudPvminstancesVpmemVolumesGetParams object +// with the ability to set a context for a request. +func NewPcloudPvminstancesVpmemVolumesGetParamsWithContext(ctx context.Context) *PcloudPvminstancesVpmemVolumesGetParams { + return &PcloudPvminstancesVpmemVolumesGetParams{ + Context: ctx, + } +} + +// NewPcloudPvminstancesVpmemVolumesGetParamsWithHTTPClient creates a new PcloudPvminstancesVpmemVolumesGetParams object +// with the ability to set a custom HTTPClient for a request. +func NewPcloudPvminstancesVpmemVolumesGetParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesVpmemVolumesGetParams { + return &PcloudPvminstancesVpmemVolumesGetParams{ + HTTPClient: client, + } +} + +/* +PcloudPvminstancesVpmemVolumesGetParams contains all the parameters to send to the API endpoint + + for the pcloud pvminstances vpmem volumes get operation. + + Typically these are written to a http.Request. +*/ +type PcloudPvminstancesVpmemVolumesGetParams struct { + + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance + */ + CloudInstanceID string + + /* PvmInstanceID. + + PCloud PVM Instance ID + */ + PvmInstanceID string + + /* VpmemVolumeID. + + vPMEM Volume ID + */ + VpmemVolumeID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the pcloud pvminstances vpmem volumes get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesVpmemVolumesGetParams) WithDefaults() *PcloudPvminstancesVpmemVolumesGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud pvminstances vpmem volumes get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesVpmemVolumesGetParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the pcloud pvminstances vpmem volumes get params +func (o *PcloudPvminstancesVpmemVolumesGetParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesVpmemVolumesGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the pcloud pvminstances vpmem volumes get params +func (o *PcloudPvminstancesVpmemVolumesGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the pcloud pvminstances vpmem volumes get params +func (o *PcloudPvminstancesVpmemVolumesGetParams) WithContext(ctx context.Context) *PcloudPvminstancesVpmemVolumesGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the pcloud pvminstances vpmem volumes get params +func (o *PcloudPvminstancesVpmemVolumesGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the pcloud pvminstances vpmem volumes get params +func (o *PcloudPvminstancesVpmemVolumesGetParams) WithHTTPClient(client *http.Client) *PcloudPvminstancesVpmemVolumesGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the pcloud pvminstances vpmem volumes get params +func (o *PcloudPvminstancesVpmemVolumesGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCloudInstanceID adds the cloudInstanceID to the pcloud pvminstances vpmem volumes get params +func (o *PcloudPvminstancesVpmemVolumesGetParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPvminstancesVpmemVolumesGetParams { + o.SetCloudInstanceID(cloudInstanceID) + return o +} + +// SetCloudInstanceID adds the cloudInstanceId to the pcloud pvminstances vpmem volumes get params +func (o *PcloudPvminstancesVpmemVolumesGetParams) SetCloudInstanceID(cloudInstanceID string) { + o.CloudInstanceID = cloudInstanceID +} + +// WithPvmInstanceID adds the pvmInstanceID to the pcloud pvminstances vpmem volumes get params +func (o *PcloudPvminstancesVpmemVolumesGetParams) WithPvmInstanceID(pvmInstanceID string) *PcloudPvminstancesVpmemVolumesGetParams { + o.SetPvmInstanceID(pvmInstanceID) + return o +} + +// SetPvmInstanceID adds the pvmInstanceId to the pcloud pvminstances vpmem volumes get params +func (o *PcloudPvminstancesVpmemVolumesGetParams) SetPvmInstanceID(pvmInstanceID string) { + o.PvmInstanceID = pvmInstanceID +} + +// WithVpmemVolumeID adds the vpmemVolumeID to the pcloud pvminstances vpmem volumes get params +func (o *PcloudPvminstancesVpmemVolumesGetParams) WithVpmemVolumeID(vpmemVolumeID string) *PcloudPvminstancesVpmemVolumesGetParams { + o.SetVpmemVolumeID(vpmemVolumeID) + return o +} + +// SetVpmemVolumeID adds the vpmemVolumeId to the pcloud pvminstances vpmem volumes get params +func (o *PcloudPvminstancesVpmemVolumesGetParams) SetVpmemVolumeID(vpmemVolumeID string) { + o.VpmemVolumeID = vpmemVolumeID +} + +// WriteToRequest writes these params to a swagger request +func (o *PcloudPvminstancesVpmemVolumesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param cloud_instance_id + if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { + return err + } + + // path param pvm_instance_id + if err := r.SetPathParam("pvm_instance_id", o.PvmInstanceID); err != nil { + return err + } + + // path param vpmem_volume_id + if err := r.SetPathParam("vpmem_volume_id", o.VpmemVolumeID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_mem_volumes/pcloud_pvminstances_vpmem_volumes_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_mem_volumes/pcloud_pvminstances_vpmem_volumes_get_responses.go new file mode 100644 index 00000000000..56594889775 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_mem_volumes/pcloud_pvminstances_vpmem_volumes_get_responses.go @@ -0,0 +1,487 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_v_p_mem_volumes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + stderrors "errors" + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// PcloudPvminstancesVpmemVolumesGetReader is a Reader for the PcloudPvminstancesVpmemVolumesGet structure. +type PcloudPvminstancesVpmemVolumesGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PcloudPvminstancesVpmemVolumesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { + switch response.Code() { + case 200: + result := NewPcloudPvminstancesVpmemVolumesGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewPcloudPvminstancesVpmemVolumesGetBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewPcloudPvminstancesVpmemVolumesGetUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPcloudPvminstancesVpmemVolumesGetForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPcloudPvminstancesVpmemVolumesGetNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPcloudPvminstancesVpmemVolumesGetInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes/{vpmem_volume_id}] pcloud.pvminstances.vpmem-volumes.get", response, response.Code()) + } +} + +// NewPcloudPvminstancesVpmemVolumesGetOK creates a PcloudPvminstancesVpmemVolumesGetOK with default headers values +func NewPcloudPvminstancesVpmemVolumesGetOK() *PcloudPvminstancesVpmemVolumesGetOK { + return &PcloudPvminstancesVpmemVolumesGetOK{} +} + +/* +PcloudPvminstancesVpmemVolumesGetOK describes a response with status code 200, with default header values. + +OK +*/ +type PcloudPvminstancesVpmemVolumesGetOK struct { + Payload *models.VPMemVolumeReference +} + +// IsSuccess returns true when this pcloud pvminstances vpmem volumes get o k response has a 2xx status code +func (o *PcloudPvminstancesVpmemVolumesGetOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this pcloud pvminstances vpmem volumes get o k response has a 3xx status code +func (o *PcloudPvminstancesVpmemVolumesGetOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud pvminstances vpmem volumes get o k response has a 4xx status code +func (o *PcloudPvminstancesVpmemVolumesGetOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this pcloud pvminstances vpmem volumes get o k response has a 5xx status code +func (o *PcloudPvminstancesVpmemVolumesGetOK) IsServerError() bool { + return false +} + +// IsCode returns true when this pcloud pvminstances vpmem volumes get o k response a status code equal to that given +func (o *PcloudPvminstancesVpmemVolumesGetOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the pcloud pvminstances vpmem volumes get o k response +func (o *PcloudPvminstancesVpmemVolumesGetOK) Code() int { + return 200 +} + +func (o *PcloudPvminstancesVpmemVolumesGetOK) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes/{vpmem_volume_id}][%d] pcloudPvminstancesVpmemVolumesGetOK %s", 200, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesGetOK) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes/{vpmem_volume_id}][%d] pcloudPvminstancesVpmemVolumesGetOK %s", 200, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesGetOK) GetPayload() *models.VPMemVolumeReference { + return o.Payload +} + +func (o *PcloudPvminstancesVpmemVolumesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.VPMemVolumeReference) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPcloudPvminstancesVpmemVolumesGetBadRequest creates a PcloudPvminstancesVpmemVolumesGetBadRequest with default headers values +func NewPcloudPvminstancesVpmemVolumesGetBadRequest() *PcloudPvminstancesVpmemVolumesGetBadRequest { + return &PcloudPvminstancesVpmemVolumesGetBadRequest{} +} + +/* +PcloudPvminstancesVpmemVolumesGetBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type PcloudPvminstancesVpmemVolumesGetBadRequest struct { + Payload *models.Error +} + +// IsSuccess returns true when this pcloud pvminstances vpmem volumes get bad request response has a 2xx status code +func (o *PcloudPvminstancesVpmemVolumesGetBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this pcloud pvminstances vpmem volumes get bad request response has a 3xx status code +func (o *PcloudPvminstancesVpmemVolumesGetBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud pvminstances vpmem volumes get bad request response has a 4xx status code +func (o *PcloudPvminstancesVpmemVolumesGetBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this pcloud pvminstances vpmem volumes get bad request response has a 5xx status code +func (o *PcloudPvminstancesVpmemVolumesGetBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this pcloud pvminstances vpmem volumes get bad request response a status code equal to that given +func (o *PcloudPvminstancesVpmemVolumesGetBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the pcloud pvminstances vpmem volumes get bad request response +func (o *PcloudPvminstancesVpmemVolumesGetBadRequest) Code() int { + return 400 +} + +func (o *PcloudPvminstancesVpmemVolumesGetBadRequest) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes/{vpmem_volume_id}][%d] pcloudPvminstancesVpmemVolumesGetBadRequest %s", 400, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesGetBadRequest) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes/{vpmem_volume_id}][%d] pcloudPvminstancesVpmemVolumesGetBadRequest %s", 400, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesGetBadRequest) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudPvminstancesVpmemVolumesGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPcloudPvminstancesVpmemVolumesGetUnauthorized creates a PcloudPvminstancesVpmemVolumesGetUnauthorized with default headers values +func NewPcloudPvminstancesVpmemVolumesGetUnauthorized() *PcloudPvminstancesVpmemVolumesGetUnauthorized { + return &PcloudPvminstancesVpmemVolumesGetUnauthorized{} +} + +/* +PcloudPvminstancesVpmemVolumesGetUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type PcloudPvminstancesVpmemVolumesGetUnauthorized struct { + Payload *models.Error +} + +// IsSuccess returns true when this pcloud pvminstances vpmem volumes get unauthorized response has a 2xx status code +func (o *PcloudPvminstancesVpmemVolumesGetUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this pcloud pvminstances vpmem volumes get unauthorized response has a 3xx status code +func (o *PcloudPvminstancesVpmemVolumesGetUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud pvminstances vpmem volumes get unauthorized response has a 4xx status code +func (o *PcloudPvminstancesVpmemVolumesGetUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this pcloud pvminstances vpmem volumes get unauthorized response has a 5xx status code +func (o *PcloudPvminstancesVpmemVolumesGetUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this pcloud pvminstances vpmem volumes get unauthorized response a status code equal to that given +func (o *PcloudPvminstancesVpmemVolumesGetUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the pcloud pvminstances vpmem volumes get unauthorized response +func (o *PcloudPvminstancesVpmemVolumesGetUnauthorized) Code() int { + return 401 +} + +func (o *PcloudPvminstancesVpmemVolumesGetUnauthorized) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes/{vpmem_volume_id}][%d] pcloudPvminstancesVpmemVolumesGetUnauthorized %s", 401, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesGetUnauthorized) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes/{vpmem_volume_id}][%d] pcloudPvminstancesVpmemVolumesGetUnauthorized %s", 401, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesGetUnauthorized) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudPvminstancesVpmemVolumesGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPcloudPvminstancesVpmemVolumesGetForbidden creates a PcloudPvminstancesVpmemVolumesGetForbidden with default headers values +func NewPcloudPvminstancesVpmemVolumesGetForbidden() *PcloudPvminstancesVpmemVolumesGetForbidden { + return &PcloudPvminstancesVpmemVolumesGetForbidden{} +} + +/* +PcloudPvminstancesVpmemVolumesGetForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type PcloudPvminstancesVpmemVolumesGetForbidden struct { + Payload *models.Error +} + +// IsSuccess returns true when this pcloud pvminstances vpmem volumes get forbidden response has a 2xx status code +func (o *PcloudPvminstancesVpmemVolumesGetForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this pcloud pvminstances vpmem volumes get forbidden response has a 3xx status code +func (o *PcloudPvminstancesVpmemVolumesGetForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud pvminstances vpmem volumes get forbidden response has a 4xx status code +func (o *PcloudPvminstancesVpmemVolumesGetForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this pcloud pvminstances vpmem volumes get forbidden response has a 5xx status code +func (o *PcloudPvminstancesVpmemVolumesGetForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this pcloud pvminstances vpmem volumes get forbidden response a status code equal to that given +func (o *PcloudPvminstancesVpmemVolumesGetForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the pcloud pvminstances vpmem volumes get forbidden response +func (o *PcloudPvminstancesVpmemVolumesGetForbidden) Code() int { + return 403 +} + +func (o *PcloudPvminstancesVpmemVolumesGetForbidden) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes/{vpmem_volume_id}][%d] pcloudPvminstancesVpmemVolumesGetForbidden %s", 403, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesGetForbidden) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes/{vpmem_volume_id}][%d] pcloudPvminstancesVpmemVolumesGetForbidden %s", 403, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesGetForbidden) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudPvminstancesVpmemVolumesGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPcloudPvminstancesVpmemVolumesGetNotFound creates a PcloudPvminstancesVpmemVolumesGetNotFound with default headers values +func NewPcloudPvminstancesVpmemVolumesGetNotFound() *PcloudPvminstancesVpmemVolumesGetNotFound { + return &PcloudPvminstancesVpmemVolumesGetNotFound{} +} + +/* +PcloudPvminstancesVpmemVolumesGetNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type PcloudPvminstancesVpmemVolumesGetNotFound struct { + Payload *models.Error +} + +// IsSuccess returns true when this pcloud pvminstances vpmem volumes get not found response has a 2xx status code +func (o *PcloudPvminstancesVpmemVolumesGetNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this pcloud pvminstances vpmem volumes get not found response has a 3xx status code +func (o *PcloudPvminstancesVpmemVolumesGetNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud pvminstances vpmem volumes get not found response has a 4xx status code +func (o *PcloudPvminstancesVpmemVolumesGetNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this pcloud pvminstances vpmem volumes get not found response has a 5xx status code +func (o *PcloudPvminstancesVpmemVolumesGetNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this pcloud pvminstances vpmem volumes get not found response a status code equal to that given +func (o *PcloudPvminstancesVpmemVolumesGetNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the pcloud pvminstances vpmem volumes get not found response +func (o *PcloudPvminstancesVpmemVolumesGetNotFound) Code() int { + return 404 +} + +func (o *PcloudPvminstancesVpmemVolumesGetNotFound) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes/{vpmem_volume_id}][%d] pcloudPvminstancesVpmemVolumesGetNotFound %s", 404, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesGetNotFound) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes/{vpmem_volume_id}][%d] pcloudPvminstancesVpmemVolumesGetNotFound %s", 404, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesGetNotFound) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudPvminstancesVpmemVolumesGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPcloudPvminstancesVpmemVolumesGetInternalServerError creates a PcloudPvminstancesVpmemVolumesGetInternalServerError with default headers values +func NewPcloudPvminstancesVpmemVolumesGetInternalServerError() *PcloudPvminstancesVpmemVolumesGetInternalServerError { + return &PcloudPvminstancesVpmemVolumesGetInternalServerError{} +} + +/* +PcloudPvminstancesVpmemVolumesGetInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type PcloudPvminstancesVpmemVolumesGetInternalServerError struct { + Payload *models.Error +} + +// IsSuccess returns true when this pcloud pvminstances vpmem volumes get internal server error response has a 2xx status code +func (o *PcloudPvminstancesVpmemVolumesGetInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this pcloud pvminstances vpmem volumes get internal server error response has a 3xx status code +func (o *PcloudPvminstancesVpmemVolumesGetInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud pvminstances vpmem volumes get internal server error response has a 4xx status code +func (o *PcloudPvminstancesVpmemVolumesGetInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this pcloud pvminstances vpmem volumes get internal server error response has a 5xx status code +func (o *PcloudPvminstancesVpmemVolumesGetInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this pcloud pvminstances vpmem volumes get internal server error response a status code equal to that given +func (o *PcloudPvminstancesVpmemVolumesGetInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the pcloud pvminstances vpmem volumes get internal server error response +func (o *PcloudPvminstancesVpmemVolumesGetInternalServerError) Code() int { + return 500 +} + +func (o *PcloudPvminstancesVpmemVolumesGetInternalServerError) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes/{vpmem_volume_id}][%d] pcloudPvminstancesVpmemVolumesGetInternalServerError %s", 500, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesGetInternalServerError) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes/{vpmem_volume_id}][%d] pcloudPvminstancesVpmemVolumesGetInternalServerError %s", 500, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudPvminstancesVpmemVolumesGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_mem_volumes/pcloud_pvminstances_vpmem_volumes_getall_parameters.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_mem_volumes/pcloud_pvminstances_vpmem_volumes_getall_parameters.go new file mode 100644 index 00000000000..baceb9c5a05 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_mem_volumes/pcloud_pvminstances_vpmem_volumes_getall_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_v_p_mem_volumes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewPcloudPvminstancesVpmemVolumesGetallParams creates a new PcloudPvminstancesVpmemVolumesGetallParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewPcloudPvminstancesVpmemVolumesGetallParams() *PcloudPvminstancesVpmemVolumesGetallParams { + return &PcloudPvminstancesVpmemVolumesGetallParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPcloudPvminstancesVpmemVolumesGetallParamsWithTimeout creates a new PcloudPvminstancesVpmemVolumesGetallParams object +// with the ability to set a timeout on a request. +func NewPcloudPvminstancesVpmemVolumesGetallParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesVpmemVolumesGetallParams { + return &PcloudPvminstancesVpmemVolumesGetallParams{ + timeout: timeout, + } +} + +// NewPcloudPvminstancesVpmemVolumesGetallParamsWithContext creates a new PcloudPvminstancesVpmemVolumesGetallParams object +// with the ability to set a context for a request. +func NewPcloudPvminstancesVpmemVolumesGetallParamsWithContext(ctx context.Context) *PcloudPvminstancesVpmemVolumesGetallParams { + return &PcloudPvminstancesVpmemVolumesGetallParams{ + Context: ctx, + } +} + +// NewPcloudPvminstancesVpmemVolumesGetallParamsWithHTTPClient creates a new PcloudPvminstancesVpmemVolumesGetallParams object +// with the ability to set a custom HTTPClient for a request. +func NewPcloudPvminstancesVpmemVolumesGetallParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesVpmemVolumesGetallParams { + return &PcloudPvminstancesVpmemVolumesGetallParams{ + HTTPClient: client, + } +} + +/* +PcloudPvminstancesVpmemVolumesGetallParams contains all the parameters to send to the API endpoint + + for the pcloud pvminstances vpmem volumes getall operation. + + Typically these are written to a http.Request. +*/ +type PcloudPvminstancesVpmemVolumesGetallParams struct { + + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance + */ + CloudInstanceID string + + /* PvmInstanceID. + + PCloud PVM Instance ID + */ + PvmInstanceID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the pcloud pvminstances vpmem volumes getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesVpmemVolumesGetallParams) WithDefaults() *PcloudPvminstancesVpmemVolumesGetallParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud pvminstances vpmem volumes getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesVpmemVolumesGetallParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the pcloud pvminstances vpmem volumes getall params +func (o *PcloudPvminstancesVpmemVolumesGetallParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesVpmemVolumesGetallParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the pcloud pvminstances vpmem volumes getall params +func (o *PcloudPvminstancesVpmemVolumesGetallParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the pcloud pvminstances vpmem volumes getall params +func (o *PcloudPvminstancesVpmemVolumesGetallParams) WithContext(ctx context.Context) *PcloudPvminstancesVpmemVolumesGetallParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the pcloud pvminstances vpmem volumes getall params +func (o *PcloudPvminstancesVpmemVolumesGetallParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the pcloud pvminstances vpmem volumes getall params +func (o *PcloudPvminstancesVpmemVolumesGetallParams) WithHTTPClient(client *http.Client) *PcloudPvminstancesVpmemVolumesGetallParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the pcloud pvminstances vpmem volumes getall params +func (o *PcloudPvminstancesVpmemVolumesGetallParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCloudInstanceID adds the cloudInstanceID to the pcloud pvminstances vpmem volumes getall params +func (o *PcloudPvminstancesVpmemVolumesGetallParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPvminstancesVpmemVolumesGetallParams { + o.SetCloudInstanceID(cloudInstanceID) + return o +} + +// SetCloudInstanceID adds the cloudInstanceId to the pcloud pvminstances vpmem volumes getall params +func (o *PcloudPvminstancesVpmemVolumesGetallParams) SetCloudInstanceID(cloudInstanceID string) { + o.CloudInstanceID = cloudInstanceID +} + +// WithPvmInstanceID adds the pvmInstanceID to the pcloud pvminstances vpmem volumes getall params +func (o *PcloudPvminstancesVpmemVolumesGetallParams) WithPvmInstanceID(pvmInstanceID string) *PcloudPvminstancesVpmemVolumesGetallParams { + o.SetPvmInstanceID(pvmInstanceID) + return o +} + +// SetPvmInstanceID adds the pvmInstanceId to the pcloud pvminstances vpmem volumes getall params +func (o *PcloudPvminstancesVpmemVolumesGetallParams) SetPvmInstanceID(pvmInstanceID string) { + o.PvmInstanceID = pvmInstanceID +} + +// WriteToRequest writes these params to a swagger request +func (o *PcloudPvminstancesVpmemVolumesGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param cloud_instance_id + if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { + return err + } + + // path param pvm_instance_id + if err := r.SetPathParam("pvm_instance_id", o.PvmInstanceID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_mem_volumes/pcloud_pvminstances_vpmem_volumes_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_mem_volumes/pcloud_pvminstances_vpmem_volumes_getall_responses.go new file mode 100644 index 00000000000..ea2447a02e8 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_mem_volumes/pcloud_pvminstances_vpmem_volumes_getall_responses.go @@ -0,0 +1,487 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_v_p_mem_volumes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + stderrors "errors" + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// PcloudPvminstancesVpmemVolumesGetallReader is a Reader for the PcloudPvminstancesVpmemVolumesGetall structure. +type PcloudPvminstancesVpmemVolumesGetallReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PcloudPvminstancesVpmemVolumesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { + switch response.Code() { + case 200: + result := NewPcloudPvminstancesVpmemVolumesGetallOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewPcloudPvminstancesVpmemVolumesGetallBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewPcloudPvminstancesVpmemVolumesGetallUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPcloudPvminstancesVpmemVolumesGetallForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPcloudPvminstancesVpmemVolumesGetallNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPcloudPvminstancesVpmemVolumesGetallInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes] pcloud.pvminstances.vpmem-volumes.getall", response, response.Code()) + } +} + +// NewPcloudPvminstancesVpmemVolumesGetallOK creates a PcloudPvminstancesVpmemVolumesGetallOK with default headers values +func NewPcloudPvminstancesVpmemVolumesGetallOK() *PcloudPvminstancesVpmemVolumesGetallOK { + return &PcloudPvminstancesVpmemVolumesGetallOK{} +} + +/* +PcloudPvminstancesVpmemVolumesGetallOK describes a response with status code 200, with default header values. + +OK +*/ +type PcloudPvminstancesVpmemVolumesGetallOK struct { + Payload *models.VPMemVolumes +} + +// IsSuccess returns true when this pcloud pvminstances vpmem volumes getall o k response has a 2xx status code +func (o *PcloudPvminstancesVpmemVolumesGetallOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this pcloud pvminstances vpmem volumes getall o k response has a 3xx status code +func (o *PcloudPvminstancesVpmemVolumesGetallOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud pvminstances vpmem volumes getall o k response has a 4xx status code +func (o *PcloudPvminstancesVpmemVolumesGetallOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this pcloud pvminstances vpmem volumes getall o k response has a 5xx status code +func (o *PcloudPvminstancesVpmemVolumesGetallOK) IsServerError() bool { + return false +} + +// IsCode returns true when this pcloud pvminstances vpmem volumes getall o k response a status code equal to that given +func (o *PcloudPvminstancesVpmemVolumesGetallOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the pcloud pvminstances vpmem volumes getall o k response +func (o *PcloudPvminstancesVpmemVolumesGetallOK) Code() int { + return 200 +} + +func (o *PcloudPvminstancesVpmemVolumesGetallOK) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes][%d] pcloudPvminstancesVpmemVolumesGetallOK %s", 200, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesGetallOK) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes][%d] pcloudPvminstancesVpmemVolumesGetallOK %s", 200, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesGetallOK) GetPayload() *models.VPMemVolumes { + return o.Payload +} + +func (o *PcloudPvminstancesVpmemVolumesGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.VPMemVolumes) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPcloudPvminstancesVpmemVolumesGetallBadRequest creates a PcloudPvminstancesVpmemVolumesGetallBadRequest with default headers values +func NewPcloudPvminstancesVpmemVolumesGetallBadRequest() *PcloudPvminstancesVpmemVolumesGetallBadRequest { + return &PcloudPvminstancesVpmemVolumesGetallBadRequest{} +} + +/* +PcloudPvminstancesVpmemVolumesGetallBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type PcloudPvminstancesVpmemVolumesGetallBadRequest struct { + Payload *models.Error +} + +// IsSuccess returns true when this pcloud pvminstances vpmem volumes getall bad request response has a 2xx status code +func (o *PcloudPvminstancesVpmemVolumesGetallBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this pcloud pvminstances vpmem volumes getall bad request response has a 3xx status code +func (o *PcloudPvminstancesVpmemVolumesGetallBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud pvminstances vpmem volumes getall bad request response has a 4xx status code +func (o *PcloudPvminstancesVpmemVolumesGetallBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this pcloud pvminstances vpmem volumes getall bad request response has a 5xx status code +func (o *PcloudPvminstancesVpmemVolumesGetallBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this pcloud pvminstances vpmem volumes getall bad request response a status code equal to that given +func (o *PcloudPvminstancesVpmemVolumesGetallBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the pcloud pvminstances vpmem volumes getall bad request response +func (o *PcloudPvminstancesVpmemVolumesGetallBadRequest) Code() int { + return 400 +} + +func (o *PcloudPvminstancesVpmemVolumesGetallBadRequest) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes][%d] pcloudPvminstancesVpmemVolumesGetallBadRequest %s", 400, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesGetallBadRequest) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes][%d] pcloudPvminstancesVpmemVolumesGetallBadRequest %s", 400, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesGetallBadRequest) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudPvminstancesVpmemVolumesGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPcloudPvminstancesVpmemVolumesGetallUnauthorized creates a PcloudPvminstancesVpmemVolumesGetallUnauthorized with default headers values +func NewPcloudPvminstancesVpmemVolumesGetallUnauthorized() *PcloudPvminstancesVpmemVolumesGetallUnauthorized { + return &PcloudPvminstancesVpmemVolumesGetallUnauthorized{} +} + +/* +PcloudPvminstancesVpmemVolumesGetallUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type PcloudPvminstancesVpmemVolumesGetallUnauthorized struct { + Payload *models.Error +} + +// IsSuccess returns true when this pcloud pvminstances vpmem volumes getall unauthorized response has a 2xx status code +func (o *PcloudPvminstancesVpmemVolumesGetallUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this pcloud pvminstances vpmem volumes getall unauthorized response has a 3xx status code +func (o *PcloudPvminstancesVpmemVolumesGetallUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud pvminstances vpmem volumes getall unauthorized response has a 4xx status code +func (o *PcloudPvminstancesVpmemVolumesGetallUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this pcloud pvminstances vpmem volumes getall unauthorized response has a 5xx status code +func (o *PcloudPvminstancesVpmemVolumesGetallUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this pcloud pvminstances vpmem volumes getall unauthorized response a status code equal to that given +func (o *PcloudPvminstancesVpmemVolumesGetallUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the pcloud pvminstances vpmem volumes getall unauthorized response +func (o *PcloudPvminstancesVpmemVolumesGetallUnauthorized) Code() int { + return 401 +} + +func (o *PcloudPvminstancesVpmemVolumesGetallUnauthorized) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes][%d] pcloudPvminstancesVpmemVolumesGetallUnauthorized %s", 401, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesGetallUnauthorized) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes][%d] pcloudPvminstancesVpmemVolumesGetallUnauthorized %s", 401, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesGetallUnauthorized) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudPvminstancesVpmemVolumesGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPcloudPvminstancesVpmemVolumesGetallForbidden creates a PcloudPvminstancesVpmemVolumesGetallForbidden with default headers values +func NewPcloudPvminstancesVpmemVolumesGetallForbidden() *PcloudPvminstancesVpmemVolumesGetallForbidden { + return &PcloudPvminstancesVpmemVolumesGetallForbidden{} +} + +/* +PcloudPvminstancesVpmemVolumesGetallForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type PcloudPvminstancesVpmemVolumesGetallForbidden struct { + Payload *models.Error +} + +// IsSuccess returns true when this pcloud pvminstances vpmem volumes getall forbidden response has a 2xx status code +func (o *PcloudPvminstancesVpmemVolumesGetallForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this pcloud pvminstances vpmem volumes getall forbidden response has a 3xx status code +func (o *PcloudPvminstancesVpmemVolumesGetallForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud pvminstances vpmem volumes getall forbidden response has a 4xx status code +func (o *PcloudPvminstancesVpmemVolumesGetallForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this pcloud pvminstances vpmem volumes getall forbidden response has a 5xx status code +func (o *PcloudPvminstancesVpmemVolumesGetallForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this pcloud pvminstances vpmem volumes getall forbidden response a status code equal to that given +func (o *PcloudPvminstancesVpmemVolumesGetallForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the pcloud pvminstances vpmem volumes getall forbidden response +func (o *PcloudPvminstancesVpmemVolumesGetallForbidden) Code() int { + return 403 +} + +func (o *PcloudPvminstancesVpmemVolumesGetallForbidden) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes][%d] pcloudPvminstancesVpmemVolumesGetallForbidden %s", 403, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesGetallForbidden) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes][%d] pcloudPvminstancesVpmemVolumesGetallForbidden %s", 403, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesGetallForbidden) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudPvminstancesVpmemVolumesGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPcloudPvminstancesVpmemVolumesGetallNotFound creates a PcloudPvminstancesVpmemVolumesGetallNotFound with default headers values +func NewPcloudPvminstancesVpmemVolumesGetallNotFound() *PcloudPvminstancesVpmemVolumesGetallNotFound { + return &PcloudPvminstancesVpmemVolumesGetallNotFound{} +} + +/* +PcloudPvminstancesVpmemVolumesGetallNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type PcloudPvminstancesVpmemVolumesGetallNotFound struct { + Payload *models.Error +} + +// IsSuccess returns true when this pcloud pvminstances vpmem volumes getall not found response has a 2xx status code +func (o *PcloudPvminstancesVpmemVolumesGetallNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this pcloud pvminstances vpmem volumes getall not found response has a 3xx status code +func (o *PcloudPvminstancesVpmemVolumesGetallNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud pvminstances vpmem volumes getall not found response has a 4xx status code +func (o *PcloudPvminstancesVpmemVolumesGetallNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this pcloud pvminstances vpmem volumes getall not found response has a 5xx status code +func (o *PcloudPvminstancesVpmemVolumesGetallNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this pcloud pvminstances vpmem volumes getall not found response a status code equal to that given +func (o *PcloudPvminstancesVpmemVolumesGetallNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the pcloud pvminstances vpmem volumes getall not found response +func (o *PcloudPvminstancesVpmemVolumesGetallNotFound) Code() int { + return 404 +} + +func (o *PcloudPvminstancesVpmemVolumesGetallNotFound) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes][%d] pcloudPvminstancesVpmemVolumesGetallNotFound %s", 404, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesGetallNotFound) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes][%d] pcloudPvminstancesVpmemVolumesGetallNotFound %s", 404, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesGetallNotFound) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudPvminstancesVpmemVolumesGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPcloudPvminstancesVpmemVolumesGetallInternalServerError creates a PcloudPvminstancesVpmemVolumesGetallInternalServerError with default headers values +func NewPcloudPvminstancesVpmemVolumesGetallInternalServerError() *PcloudPvminstancesVpmemVolumesGetallInternalServerError { + return &PcloudPvminstancesVpmemVolumesGetallInternalServerError{} +} + +/* +PcloudPvminstancesVpmemVolumesGetallInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type PcloudPvminstancesVpmemVolumesGetallInternalServerError struct { + Payload *models.Error +} + +// IsSuccess returns true when this pcloud pvminstances vpmem volumes getall internal server error response has a 2xx status code +func (o *PcloudPvminstancesVpmemVolumesGetallInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this pcloud pvminstances vpmem volumes getall internal server error response has a 3xx status code +func (o *PcloudPvminstancesVpmemVolumesGetallInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud pvminstances vpmem volumes getall internal server error response has a 4xx status code +func (o *PcloudPvminstancesVpmemVolumesGetallInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this pcloud pvminstances vpmem volumes getall internal server error response has a 5xx status code +func (o *PcloudPvminstancesVpmemVolumesGetallInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this pcloud pvminstances vpmem volumes getall internal server error response a status code equal to that given +func (o *PcloudPvminstancesVpmemVolumesGetallInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the pcloud pvminstances vpmem volumes getall internal server error response +func (o *PcloudPvminstancesVpmemVolumesGetallInternalServerError) Code() int { + return 500 +} + +func (o *PcloudPvminstancesVpmemVolumesGetallInternalServerError) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes][%d] pcloudPvminstancesVpmemVolumesGetallInternalServerError %s", 500, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesGetallInternalServerError) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes][%d] pcloudPvminstancesVpmemVolumesGetallInternalServerError %s", 500, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesGetallInternalServerError) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudPvminstancesVpmemVolumesGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_mem_volumes/pcloud_pvminstances_vpmem_volumes_post_parameters.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_mem_volumes/pcloud_pvminstances_vpmem_volumes_post_parameters.go new file mode 100644 index 00000000000..0aa898ed021 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_mem_volumes/pcloud_pvminstances_vpmem_volumes_post_parameters.go @@ -0,0 +1,197 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_v_p_mem_volumes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// NewPcloudPvminstancesVpmemVolumesPostParams creates a new PcloudPvminstancesVpmemVolumesPostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewPcloudPvminstancesVpmemVolumesPostParams() *PcloudPvminstancesVpmemVolumesPostParams { + return &PcloudPvminstancesVpmemVolumesPostParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPcloudPvminstancesVpmemVolumesPostParamsWithTimeout creates a new PcloudPvminstancesVpmemVolumesPostParams object +// with the ability to set a timeout on a request. +func NewPcloudPvminstancesVpmemVolumesPostParamsWithTimeout(timeout time.Duration) *PcloudPvminstancesVpmemVolumesPostParams { + return &PcloudPvminstancesVpmemVolumesPostParams{ + timeout: timeout, + } +} + +// NewPcloudPvminstancesVpmemVolumesPostParamsWithContext creates a new PcloudPvminstancesVpmemVolumesPostParams object +// with the ability to set a context for a request. +func NewPcloudPvminstancesVpmemVolumesPostParamsWithContext(ctx context.Context) *PcloudPvminstancesVpmemVolumesPostParams { + return &PcloudPvminstancesVpmemVolumesPostParams{ + Context: ctx, + } +} + +// NewPcloudPvminstancesVpmemVolumesPostParamsWithHTTPClient creates a new PcloudPvminstancesVpmemVolumesPostParams object +// with the ability to set a custom HTTPClient for a request. +func NewPcloudPvminstancesVpmemVolumesPostParamsWithHTTPClient(client *http.Client) *PcloudPvminstancesVpmemVolumesPostParams { + return &PcloudPvminstancesVpmemVolumesPostParams{ + HTTPClient: client, + } +} + +/* +PcloudPvminstancesVpmemVolumesPostParams contains all the parameters to send to the API endpoint + + for the pcloud pvminstances vpmem volumes post operation. + + Typically these are written to a http.Request. +*/ +type PcloudPvminstancesVpmemVolumesPostParams struct { + + /* Body. + + PVM Instance vPMEM volume create parameters + */ + Body *models.VPMemVolumeAttach + + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance + */ + CloudInstanceID string + + /* PvmInstanceID. + + PCloud PVM Instance ID + */ + PvmInstanceID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the pcloud pvminstances vpmem volumes post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesVpmemVolumesPostParams) WithDefaults() *PcloudPvminstancesVpmemVolumesPostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud pvminstances vpmem volumes post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudPvminstancesVpmemVolumesPostParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the pcloud pvminstances vpmem volumes post params +func (o *PcloudPvminstancesVpmemVolumesPostParams) WithTimeout(timeout time.Duration) *PcloudPvminstancesVpmemVolumesPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the pcloud pvminstances vpmem volumes post params +func (o *PcloudPvminstancesVpmemVolumesPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the pcloud pvminstances vpmem volumes post params +func (o *PcloudPvminstancesVpmemVolumesPostParams) WithContext(ctx context.Context) *PcloudPvminstancesVpmemVolumesPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the pcloud pvminstances vpmem volumes post params +func (o *PcloudPvminstancesVpmemVolumesPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the pcloud pvminstances vpmem volumes post params +func (o *PcloudPvminstancesVpmemVolumesPostParams) WithHTTPClient(client *http.Client) *PcloudPvminstancesVpmemVolumesPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the pcloud pvminstances vpmem volumes post params +func (o *PcloudPvminstancesVpmemVolumesPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the pcloud pvminstances vpmem volumes post params +func (o *PcloudPvminstancesVpmemVolumesPostParams) WithBody(body *models.VPMemVolumeAttach) *PcloudPvminstancesVpmemVolumesPostParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the pcloud pvminstances vpmem volumes post params +func (o *PcloudPvminstancesVpmemVolumesPostParams) SetBody(body *models.VPMemVolumeAttach) { + o.Body = body +} + +// WithCloudInstanceID adds the cloudInstanceID to the pcloud pvminstances vpmem volumes post params +func (o *PcloudPvminstancesVpmemVolumesPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudPvminstancesVpmemVolumesPostParams { + o.SetCloudInstanceID(cloudInstanceID) + return o +} + +// SetCloudInstanceID adds the cloudInstanceId to the pcloud pvminstances vpmem volumes post params +func (o *PcloudPvminstancesVpmemVolumesPostParams) SetCloudInstanceID(cloudInstanceID string) { + o.CloudInstanceID = cloudInstanceID +} + +// WithPvmInstanceID adds the pvmInstanceID to the pcloud pvminstances vpmem volumes post params +func (o *PcloudPvminstancesVpmemVolumesPostParams) WithPvmInstanceID(pvmInstanceID string) *PcloudPvminstancesVpmemVolumesPostParams { + o.SetPvmInstanceID(pvmInstanceID) + return o +} + +// SetPvmInstanceID adds the pvmInstanceId to the pcloud pvminstances vpmem volumes post params +func (o *PcloudPvminstancesVpmemVolumesPostParams) SetPvmInstanceID(pvmInstanceID string) { + o.PvmInstanceID = pvmInstanceID +} + +// WriteToRequest writes these params to a swagger request +func (o *PcloudPvminstancesVpmemVolumesPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param cloud_instance_id + if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { + return err + } + + // path param pvm_instance_id + if err := r.SetPathParam("pvm_instance_id", o.PvmInstanceID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_mem_volumes/pcloud_pvminstances_vpmem_volumes_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_mem_volumes/pcloud_pvminstances_vpmem_volumes_post_responses.go new file mode 100644 index 00000000000..7030e49e28e --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_mem_volumes/pcloud_pvminstances_vpmem_volumes_post_responses.go @@ -0,0 +1,639 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_v_p_mem_volumes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + stderrors "errors" + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// PcloudPvminstancesVpmemVolumesPostReader is a Reader for the PcloudPvminstancesVpmemVolumesPost structure. +type PcloudPvminstancesVpmemVolumesPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PcloudPvminstancesVpmemVolumesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { + switch response.Code() { + case 202: + result := NewPcloudPvminstancesVpmemVolumesPostAccepted() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewPcloudPvminstancesVpmemVolumesPostBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewPcloudPvminstancesVpmemVolumesPostUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPcloudPvminstancesVpmemVolumesPostForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPcloudPvminstancesVpmemVolumesPostNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewPcloudPvminstancesVpmemVolumesPostConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPcloudPvminstancesVpmemVolumesPostUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPcloudPvminstancesVpmemVolumesPostInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes] pcloud.pvminstances.vpmem-volumes.post", response, response.Code()) + } +} + +// NewPcloudPvminstancesVpmemVolumesPostAccepted creates a PcloudPvminstancesVpmemVolumesPostAccepted with default headers values +func NewPcloudPvminstancesVpmemVolumesPostAccepted() *PcloudPvminstancesVpmemVolumesPostAccepted { + return &PcloudPvminstancesVpmemVolumesPostAccepted{} +} + +/* +PcloudPvminstancesVpmemVolumesPostAccepted describes a response with status code 202, with default header values. + +Accepted +*/ +type PcloudPvminstancesVpmemVolumesPostAccepted struct { + Payload *models.VPMemVolumes +} + +// IsSuccess returns true when this pcloud pvminstances vpmem volumes post accepted response has a 2xx status code +func (o *PcloudPvminstancesVpmemVolumesPostAccepted) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this pcloud pvminstances vpmem volumes post accepted response has a 3xx status code +func (o *PcloudPvminstancesVpmemVolumesPostAccepted) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud pvminstances vpmem volumes post accepted response has a 4xx status code +func (o *PcloudPvminstancesVpmemVolumesPostAccepted) IsClientError() bool { + return false +} + +// IsServerError returns true when this pcloud pvminstances vpmem volumes post accepted response has a 5xx status code +func (o *PcloudPvminstancesVpmemVolumesPostAccepted) IsServerError() bool { + return false +} + +// IsCode returns true when this pcloud pvminstances vpmem volumes post accepted response a status code equal to that given +func (o *PcloudPvminstancesVpmemVolumesPostAccepted) IsCode(code int) bool { + return code == 202 +} + +// Code gets the status code for the pcloud pvminstances vpmem volumes post accepted response +func (o *PcloudPvminstancesVpmemVolumesPostAccepted) Code() int { + return 202 +} + +func (o *PcloudPvminstancesVpmemVolumesPostAccepted) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes][%d] pcloudPvminstancesVpmemVolumesPostAccepted %s", 202, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesPostAccepted) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes][%d] pcloudPvminstancesVpmemVolumesPostAccepted %s", 202, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesPostAccepted) GetPayload() *models.VPMemVolumes { + return o.Payload +} + +func (o *PcloudPvminstancesVpmemVolumesPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.VPMemVolumes) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPcloudPvminstancesVpmemVolumesPostBadRequest creates a PcloudPvminstancesVpmemVolumesPostBadRequest with default headers values +func NewPcloudPvminstancesVpmemVolumesPostBadRequest() *PcloudPvminstancesVpmemVolumesPostBadRequest { + return &PcloudPvminstancesVpmemVolumesPostBadRequest{} +} + +/* +PcloudPvminstancesVpmemVolumesPostBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type PcloudPvminstancesVpmemVolumesPostBadRequest struct { + Payload *models.Error +} + +// IsSuccess returns true when this pcloud pvminstances vpmem volumes post bad request response has a 2xx status code +func (o *PcloudPvminstancesVpmemVolumesPostBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this pcloud pvminstances vpmem volumes post bad request response has a 3xx status code +func (o *PcloudPvminstancesVpmemVolumesPostBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud pvminstances vpmem volumes post bad request response has a 4xx status code +func (o *PcloudPvminstancesVpmemVolumesPostBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this pcloud pvminstances vpmem volumes post bad request response has a 5xx status code +func (o *PcloudPvminstancesVpmemVolumesPostBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this pcloud pvminstances vpmem volumes post bad request response a status code equal to that given +func (o *PcloudPvminstancesVpmemVolumesPostBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the pcloud pvminstances vpmem volumes post bad request response +func (o *PcloudPvminstancesVpmemVolumesPostBadRequest) Code() int { + return 400 +} + +func (o *PcloudPvminstancesVpmemVolumesPostBadRequest) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes][%d] pcloudPvminstancesVpmemVolumesPostBadRequest %s", 400, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesPostBadRequest) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes][%d] pcloudPvminstancesVpmemVolumesPostBadRequest %s", 400, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesPostBadRequest) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudPvminstancesVpmemVolumesPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPcloudPvminstancesVpmemVolumesPostUnauthorized creates a PcloudPvminstancesVpmemVolumesPostUnauthorized with default headers values +func NewPcloudPvminstancesVpmemVolumesPostUnauthorized() *PcloudPvminstancesVpmemVolumesPostUnauthorized { + return &PcloudPvminstancesVpmemVolumesPostUnauthorized{} +} + +/* +PcloudPvminstancesVpmemVolumesPostUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type PcloudPvminstancesVpmemVolumesPostUnauthorized struct { + Payload *models.Error +} + +// IsSuccess returns true when this pcloud pvminstances vpmem volumes post unauthorized response has a 2xx status code +func (o *PcloudPvminstancesVpmemVolumesPostUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this pcloud pvminstances vpmem volumes post unauthorized response has a 3xx status code +func (o *PcloudPvminstancesVpmemVolumesPostUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud pvminstances vpmem volumes post unauthorized response has a 4xx status code +func (o *PcloudPvminstancesVpmemVolumesPostUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this pcloud pvminstances vpmem volumes post unauthorized response has a 5xx status code +func (o *PcloudPvminstancesVpmemVolumesPostUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this pcloud pvminstances vpmem volumes post unauthorized response a status code equal to that given +func (o *PcloudPvminstancesVpmemVolumesPostUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the pcloud pvminstances vpmem volumes post unauthorized response +func (o *PcloudPvminstancesVpmemVolumesPostUnauthorized) Code() int { + return 401 +} + +func (o *PcloudPvminstancesVpmemVolumesPostUnauthorized) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes][%d] pcloudPvminstancesVpmemVolumesPostUnauthorized %s", 401, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesPostUnauthorized) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes][%d] pcloudPvminstancesVpmemVolumesPostUnauthorized %s", 401, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesPostUnauthorized) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudPvminstancesVpmemVolumesPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPcloudPvminstancesVpmemVolumesPostForbidden creates a PcloudPvminstancesVpmemVolumesPostForbidden with default headers values +func NewPcloudPvminstancesVpmemVolumesPostForbidden() *PcloudPvminstancesVpmemVolumesPostForbidden { + return &PcloudPvminstancesVpmemVolumesPostForbidden{} +} + +/* +PcloudPvminstancesVpmemVolumesPostForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type PcloudPvminstancesVpmemVolumesPostForbidden struct { + Payload *models.Error +} + +// IsSuccess returns true when this pcloud pvminstances vpmem volumes post forbidden response has a 2xx status code +func (o *PcloudPvminstancesVpmemVolumesPostForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this pcloud pvminstances vpmem volumes post forbidden response has a 3xx status code +func (o *PcloudPvminstancesVpmemVolumesPostForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud pvminstances vpmem volumes post forbidden response has a 4xx status code +func (o *PcloudPvminstancesVpmemVolumesPostForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this pcloud pvminstances vpmem volumes post forbidden response has a 5xx status code +func (o *PcloudPvminstancesVpmemVolumesPostForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this pcloud pvminstances vpmem volumes post forbidden response a status code equal to that given +func (o *PcloudPvminstancesVpmemVolumesPostForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the pcloud pvminstances vpmem volumes post forbidden response +func (o *PcloudPvminstancesVpmemVolumesPostForbidden) Code() int { + return 403 +} + +func (o *PcloudPvminstancesVpmemVolumesPostForbidden) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes][%d] pcloudPvminstancesVpmemVolumesPostForbidden %s", 403, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesPostForbidden) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes][%d] pcloudPvminstancesVpmemVolumesPostForbidden %s", 403, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesPostForbidden) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudPvminstancesVpmemVolumesPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPcloudPvminstancesVpmemVolumesPostNotFound creates a PcloudPvminstancesVpmemVolumesPostNotFound with default headers values +func NewPcloudPvminstancesVpmemVolumesPostNotFound() *PcloudPvminstancesVpmemVolumesPostNotFound { + return &PcloudPvminstancesVpmemVolumesPostNotFound{} +} + +/* +PcloudPvminstancesVpmemVolumesPostNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type PcloudPvminstancesVpmemVolumesPostNotFound struct { + Payload *models.Error +} + +// IsSuccess returns true when this pcloud pvminstances vpmem volumes post not found response has a 2xx status code +func (o *PcloudPvminstancesVpmemVolumesPostNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this pcloud pvminstances vpmem volumes post not found response has a 3xx status code +func (o *PcloudPvminstancesVpmemVolumesPostNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud pvminstances vpmem volumes post not found response has a 4xx status code +func (o *PcloudPvminstancesVpmemVolumesPostNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this pcloud pvminstances vpmem volumes post not found response has a 5xx status code +func (o *PcloudPvminstancesVpmemVolumesPostNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this pcloud pvminstances vpmem volumes post not found response a status code equal to that given +func (o *PcloudPvminstancesVpmemVolumesPostNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the pcloud pvminstances vpmem volumes post not found response +func (o *PcloudPvminstancesVpmemVolumesPostNotFound) Code() int { + return 404 +} + +func (o *PcloudPvminstancesVpmemVolumesPostNotFound) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes][%d] pcloudPvminstancesVpmemVolumesPostNotFound %s", 404, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesPostNotFound) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes][%d] pcloudPvminstancesVpmemVolumesPostNotFound %s", 404, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesPostNotFound) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudPvminstancesVpmemVolumesPostNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPcloudPvminstancesVpmemVolumesPostConflict creates a PcloudPvminstancesVpmemVolumesPostConflict with default headers values +func NewPcloudPvminstancesVpmemVolumesPostConflict() *PcloudPvminstancesVpmemVolumesPostConflict { + return &PcloudPvminstancesVpmemVolumesPostConflict{} +} + +/* +PcloudPvminstancesVpmemVolumesPostConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type PcloudPvminstancesVpmemVolumesPostConflict struct { + Payload *models.Error +} + +// IsSuccess returns true when this pcloud pvminstances vpmem volumes post conflict response has a 2xx status code +func (o *PcloudPvminstancesVpmemVolumesPostConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this pcloud pvminstances vpmem volumes post conflict response has a 3xx status code +func (o *PcloudPvminstancesVpmemVolumesPostConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud pvminstances vpmem volumes post conflict response has a 4xx status code +func (o *PcloudPvminstancesVpmemVolumesPostConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this pcloud pvminstances vpmem volumes post conflict response has a 5xx status code +func (o *PcloudPvminstancesVpmemVolumesPostConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this pcloud pvminstances vpmem volumes post conflict response a status code equal to that given +func (o *PcloudPvminstancesVpmemVolumesPostConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the pcloud pvminstances vpmem volumes post conflict response +func (o *PcloudPvminstancesVpmemVolumesPostConflict) Code() int { + return 409 +} + +func (o *PcloudPvminstancesVpmemVolumesPostConflict) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes][%d] pcloudPvminstancesVpmemVolumesPostConflict %s", 409, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesPostConflict) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes][%d] pcloudPvminstancesVpmemVolumesPostConflict %s", 409, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesPostConflict) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudPvminstancesVpmemVolumesPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPcloudPvminstancesVpmemVolumesPostUnprocessableEntity creates a PcloudPvminstancesVpmemVolumesPostUnprocessableEntity with default headers values +func NewPcloudPvminstancesVpmemVolumesPostUnprocessableEntity() *PcloudPvminstancesVpmemVolumesPostUnprocessableEntity { + return &PcloudPvminstancesVpmemVolumesPostUnprocessableEntity{} +} + +/* +PcloudPvminstancesVpmemVolumesPostUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity +*/ +type PcloudPvminstancesVpmemVolumesPostUnprocessableEntity struct { + Payload *models.Error +} + +// IsSuccess returns true when this pcloud pvminstances vpmem volumes post unprocessable entity response has a 2xx status code +func (o *PcloudPvminstancesVpmemVolumesPostUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this pcloud pvminstances vpmem volumes post unprocessable entity response has a 3xx status code +func (o *PcloudPvminstancesVpmemVolumesPostUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud pvminstances vpmem volumes post unprocessable entity response has a 4xx status code +func (o *PcloudPvminstancesVpmemVolumesPostUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this pcloud pvminstances vpmem volumes post unprocessable entity response has a 5xx status code +func (o *PcloudPvminstancesVpmemVolumesPostUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this pcloud pvminstances vpmem volumes post unprocessable entity response a status code equal to that given +func (o *PcloudPvminstancesVpmemVolumesPostUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the pcloud pvminstances vpmem volumes post unprocessable entity response +func (o *PcloudPvminstancesVpmemVolumesPostUnprocessableEntity) Code() int { + return 422 +} + +func (o *PcloudPvminstancesVpmemVolumesPostUnprocessableEntity) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes][%d] pcloudPvminstancesVpmemVolumesPostUnprocessableEntity %s", 422, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesPostUnprocessableEntity) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes][%d] pcloudPvminstancesVpmemVolumesPostUnprocessableEntity %s", 422, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesPostUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudPvminstancesVpmemVolumesPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} + +// NewPcloudPvminstancesVpmemVolumesPostInternalServerError creates a PcloudPvminstancesVpmemVolumesPostInternalServerError with default headers values +func NewPcloudPvminstancesVpmemVolumesPostInternalServerError() *PcloudPvminstancesVpmemVolumesPostInternalServerError { + return &PcloudPvminstancesVpmemVolumesPostInternalServerError{} +} + +/* +PcloudPvminstancesVpmemVolumesPostInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type PcloudPvminstancesVpmemVolumesPostInternalServerError struct { + Payload *models.Error +} + +// IsSuccess returns true when this pcloud pvminstances vpmem volumes post internal server error response has a 2xx status code +func (o *PcloudPvminstancesVpmemVolumesPostInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this pcloud pvminstances vpmem volumes post internal server error response has a 3xx status code +func (o *PcloudPvminstancesVpmemVolumesPostInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud pvminstances vpmem volumes post internal server error response has a 4xx status code +func (o *PcloudPvminstancesVpmemVolumesPostInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this pcloud pvminstances vpmem volumes post internal server error response has a 5xx status code +func (o *PcloudPvminstancesVpmemVolumesPostInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this pcloud pvminstances vpmem volumes post internal server error response a status code equal to that given +func (o *PcloudPvminstancesVpmemVolumesPostInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the pcloud pvminstances vpmem volumes post internal server error response +func (o *PcloudPvminstancesVpmemVolumesPostInternalServerError) Code() int { + return 500 +} + +func (o *PcloudPvminstancesVpmemVolumesPostInternalServerError) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes][%d] pcloudPvminstancesVpmemVolumesPostInternalServerError %s", 500, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesPostInternalServerError) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/vpmem-volumes][%d] pcloudPvminstancesVpmemVolumesPostInternalServerError %s", 500, payload) +} + +func (o *PcloudPvminstancesVpmemVolumesPostInternalServerError) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudPvminstancesVpmemVolumesPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { + return err + } + + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/p_cloudvpn_connections_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/p_cloudvpn_connections_client.go index 1d549c5a5af..2611e36f844 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/p_cloudvpn_connections_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/p_cloudvpn_connections_client.go @@ -87,7 +87,7 @@ PcloudVpnconnectionsDelete deletes v p n connection Delete VPN Connection (by its identifier) */ func (a *Client) PcloudVpnconnectionsDelete(params *PcloudVpnconnectionsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsDeleteAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudVpnconnectionsDeleteParams() } @@ -107,17 +107,22 @@ func (a *Client) PcloudVpnconnectionsDelete(params *PcloudVpnconnectionsDeletePa for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudVpnconnectionsDeleteAccepted) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.vpnconnections.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -128,7 +133,7 @@ PcloudVpnconnectionsGet gets v p n connection Get a VPN Connection */ func (a *Client) PcloudVpnconnectionsGet(params *PcloudVpnconnectionsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudVpnconnectionsGetParams() } @@ -148,17 +153,22 @@ func (a *Client) PcloudVpnconnectionsGet(params *PcloudVpnconnectionsGetParams, for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudVpnconnectionsGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.vpnconnections.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -169,7 +179,7 @@ PcloudVpnconnectionsGetall gets all v p n connections Get all VPN Connections */ func (a *Client) PcloudVpnconnectionsGetall(params *PcloudVpnconnectionsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudVpnconnectionsGetallParams() } @@ -189,17 +199,22 @@ func (a *Client) PcloudVpnconnectionsGetall(params *PcloudVpnconnectionsGetallPa for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudVpnconnectionsGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.vpnconnections.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -210,7 +225,7 @@ PcloudVpnconnectionsNetworksDelete detaches network Detach network from a specific VPN Connection */ func (a *Client) PcloudVpnconnectionsNetworksDelete(params *PcloudVpnconnectionsNetworksDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsNetworksDeleteAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudVpnconnectionsNetworksDeleteParams() } @@ -230,17 +245,22 @@ func (a *Client) PcloudVpnconnectionsNetworksDelete(params *PcloudVpnconnections for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudVpnconnectionsNetworksDeleteAccepted) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.vpnconnections.networks.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -251,7 +271,7 @@ PcloudVpnconnectionsNetworksGet gets attached networks Get a list of network IDs attached to a VPN Connection */ func (a *Client) PcloudVpnconnectionsNetworksGet(params *PcloudVpnconnectionsNetworksGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsNetworksGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudVpnconnectionsNetworksGetParams() } @@ -271,17 +291,22 @@ func (a *Client) PcloudVpnconnectionsNetworksGet(params *PcloudVpnconnectionsNet for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudVpnconnectionsNetworksGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.vpnconnections.networks.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -292,7 +317,7 @@ PcloudVpnconnectionsNetworksPut attaches network Attach a network to a VPN Connection */ func (a *Client) PcloudVpnconnectionsNetworksPut(params *PcloudVpnconnectionsNetworksPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsNetworksPutAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudVpnconnectionsNetworksPutParams() } @@ -312,17 +337,22 @@ func (a *Client) PcloudVpnconnectionsNetworksPut(params *PcloudVpnconnectionsNet for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudVpnconnectionsNetworksPutAccepted) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.vpnconnections.networks.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -333,7 +363,7 @@ PcloudVpnconnectionsPeersubnetsDelete detaches peer subnet Detach peer subnet from a VPN Connection */ func (a *Client) PcloudVpnconnectionsPeersubnetsDelete(params *PcloudVpnconnectionsPeersubnetsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsPeersubnetsDeleteOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudVpnconnectionsPeersubnetsDeleteParams() } @@ -353,17 +383,22 @@ func (a *Client) PcloudVpnconnectionsPeersubnetsDelete(params *PcloudVpnconnecti for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudVpnconnectionsPeersubnetsDeleteOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.vpnconnections.peersubnets.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -374,7 +409,7 @@ PcloudVpnconnectionsPeersubnetsGet gets peer subnets Get a list of peer subnets attached to a specific VPN Connection */ func (a *Client) PcloudVpnconnectionsPeersubnetsGet(params *PcloudVpnconnectionsPeersubnetsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsPeersubnetsGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudVpnconnectionsPeersubnetsGetParams() } @@ -394,17 +429,22 @@ func (a *Client) PcloudVpnconnectionsPeersubnetsGet(params *PcloudVpnconnections for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudVpnconnectionsPeersubnetsGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.vpnconnections.peersubnets.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -415,7 +455,7 @@ PcloudVpnconnectionsPeersubnetsPut attaches peer subnet Attach peer subnet to a VPN Connection */ func (a *Client) PcloudVpnconnectionsPeersubnetsPut(params *PcloudVpnconnectionsPeersubnetsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsPeersubnetsPutOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudVpnconnectionsPeersubnetsPutParams() } @@ -435,17 +475,22 @@ func (a *Client) PcloudVpnconnectionsPeersubnetsPut(params *PcloudVpnconnections for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudVpnconnectionsPeersubnetsPutOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.vpnconnections.peersubnets.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -456,7 +501,7 @@ PcloudVpnconnectionsPost creates v p n connection Create a new VPN Connection */ func (a *Client) PcloudVpnconnectionsPost(params *PcloudVpnconnectionsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsPostAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudVpnconnectionsPostParams() } @@ -476,17 +521,22 @@ func (a *Client) PcloudVpnconnectionsPost(params *PcloudVpnconnectionsPostParams for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudVpnconnectionsPostAccepted) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.vpnconnections.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -497,7 +547,7 @@ PcloudVpnconnectionsPut updates v p n connection update a VPN Connection (by its identifier) */ func (a *Client) PcloudVpnconnectionsPut(params *PcloudVpnconnectionsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVpnconnectionsPutOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudVpnconnectionsPutParams() } @@ -517,17 +567,22 @@ func (a *Client) PcloudVpnconnectionsPut(params *PcloudVpnconnectionsPutParams, for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudVpnconnectionsPutOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.vpnconnections.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_delete_responses.go index c65485ab457..149ace4c0d2 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_delete_responses.go @@ -7,6 +7,7 @@ package p_cloud_v_p_n_connections import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudVpnconnectionsDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudVpnconnectionsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudVpnconnectionsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 202: result := NewPcloudVpnconnectionsDeleteAccepted() @@ -128,7 +129,7 @@ func (o *PcloudVpnconnectionsDeleteAccepted) readResponse(response runtime.Clien o.Payload = new(models.JobReference) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudVpnconnectionsDeleteBadRequest) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudVpnconnectionsDeleteUnauthorized) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudVpnconnectionsDeleteForbidden) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudVpnconnectionsDeleteNotFound) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudVpnconnectionsDeleteInternalServerError) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_get_responses.go index fcfd6dd00ef..360985cd6e4 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_v_p_n_connections import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudVpnconnectionsGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudVpnconnectionsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudVpnconnectionsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudVpnconnectionsGetOK() @@ -134,7 +135,7 @@ func (o *PcloudVpnconnectionsGetOK) readResponse(response runtime.ClientResponse o.Payload = new(models.VPNConnection) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *PcloudVpnconnectionsGetBadRequest) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *PcloudVpnconnectionsGetUnauthorized) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *PcloudVpnconnectionsGetForbidden) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *PcloudVpnconnectionsGetNotFound) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *PcloudVpnconnectionsGetUnprocessableEntity) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *PcloudVpnconnectionsGetInternalServerError) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_getall_responses.go index 30ec06a3bf0..83331206163 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_getall_responses.go @@ -7,6 +7,7 @@ package p_cloud_v_p_n_connections import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudVpnconnectionsGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudVpnconnectionsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudVpnconnectionsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudVpnconnectionsGetallOK() @@ -128,7 +129,7 @@ func (o *PcloudVpnconnectionsGetallOK) readResponse(response runtime.ClientRespo o.Payload = new(models.VPNConnections) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudVpnconnectionsGetallBadRequest) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudVpnconnectionsGetallUnauthorized) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudVpnconnectionsGetallForbidden) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudVpnconnectionsGetallNotFound) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudVpnconnectionsGetallInternalServerError) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_delete_responses.go index 8e465589115..e4c4379c915 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_delete_responses.go @@ -7,6 +7,7 @@ package p_cloud_v_p_n_connections import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudVpnconnectionsNetworksDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudVpnconnectionsNetworksDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudVpnconnectionsNetworksDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 202: result := NewPcloudVpnconnectionsNetworksDeleteAccepted() @@ -134,7 +135,7 @@ func (o *PcloudVpnconnectionsNetworksDeleteAccepted) readResponse(response runti o.Payload = new(models.JobReference) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *PcloudVpnconnectionsNetworksDeleteBadRequest) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *PcloudVpnconnectionsNetworksDeleteUnauthorized) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *PcloudVpnconnectionsNetworksDeleteForbidden) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *PcloudVpnconnectionsNetworksDeleteNotFound) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *PcloudVpnconnectionsNetworksDeleteUnprocessableEntity) readResponse(res o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *PcloudVpnconnectionsNetworksDeleteInternalServerError) readResponse(res o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_get_responses.go index 4a496ffef23..81f9d01af0c 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_v_p_n_connections import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudVpnconnectionsNetworksGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudVpnconnectionsNetworksGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudVpnconnectionsNetworksGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudVpnconnectionsNetworksGetOK() @@ -128,7 +129,7 @@ func (o *PcloudVpnconnectionsNetworksGetOK) readResponse(response runtime.Client o.Payload = new(models.NetworkIDs) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudVpnconnectionsNetworksGetBadRequest) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudVpnconnectionsNetworksGetUnauthorized) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudVpnconnectionsNetworksGetForbidden) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudVpnconnectionsNetworksGetNotFound) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudVpnconnectionsNetworksGetInternalServerError) readResponse(respon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_put_responses.go index 601d1d5724a..4c2d313116c 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_networks_put_responses.go @@ -7,6 +7,7 @@ package p_cloud_v_p_n_connections import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudVpnconnectionsNetworksPutReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudVpnconnectionsNetworksPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudVpnconnectionsNetworksPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 202: result := NewPcloudVpnconnectionsNetworksPutAccepted() @@ -134,7 +135,7 @@ func (o *PcloudVpnconnectionsNetworksPutAccepted) readResponse(response runtime. o.Payload = new(models.JobReference) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *PcloudVpnconnectionsNetworksPutBadRequest) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *PcloudVpnconnectionsNetworksPutUnauthorized) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *PcloudVpnconnectionsNetworksPutForbidden) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *PcloudVpnconnectionsNetworksPutNotFound) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *PcloudVpnconnectionsNetworksPutUnprocessableEntity) readResponse(respon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *PcloudVpnconnectionsNetworksPutInternalServerError) readResponse(respon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_delete_responses.go index 8ef0944e5a7..66d2a867e37 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_delete_responses.go @@ -7,6 +7,7 @@ package p_cloud_v_p_n_connections import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudVpnconnectionsPeersubnetsDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudVpnconnectionsPeersubnetsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudVpnconnectionsPeersubnetsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudVpnconnectionsPeersubnetsDeleteOK() @@ -134,7 +135,7 @@ func (o *PcloudVpnconnectionsPeersubnetsDeleteOK) readResponse(response runtime. o.Payload = new(models.PeerSubnets) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *PcloudVpnconnectionsPeersubnetsDeleteBadRequest) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *PcloudVpnconnectionsPeersubnetsDeleteUnauthorized) readResponse(respons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *PcloudVpnconnectionsPeersubnetsDeleteForbidden) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *PcloudVpnconnectionsPeersubnetsDeleteNotFound) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *PcloudVpnconnectionsPeersubnetsDeleteUnprocessableEntity) readResponse( o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *PcloudVpnconnectionsPeersubnetsDeleteInternalServerError) readResponse( o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_get_responses.go index 6dd71e97492..abe3bb13146 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_v_p_n_connections import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudVpnconnectionsPeersubnetsGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudVpnconnectionsPeersubnetsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudVpnconnectionsPeersubnetsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudVpnconnectionsPeersubnetsGetOK() @@ -128,7 +129,7 @@ func (o *PcloudVpnconnectionsPeersubnetsGetOK) readResponse(response runtime.Cli o.Payload = new(models.PeerSubnets) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudVpnconnectionsPeersubnetsGetBadRequest) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudVpnconnectionsPeersubnetsGetUnauthorized) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudVpnconnectionsPeersubnetsGetForbidden) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudVpnconnectionsPeersubnetsGetNotFound) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudVpnconnectionsPeersubnetsGetInternalServerError) readResponse(res o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_put_responses.go index a2f6e873bd1..4b0aadd45ca 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_peersubnets_put_responses.go @@ -7,6 +7,7 @@ package p_cloud_v_p_n_connections import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudVpnconnectionsPeersubnetsPutReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudVpnconnectionsPeersubnetsPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudVpnconnectionsPeersubnetsPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudVpnconnectionsPeersubnetsPutOK() @@ -134,7 +135,7 @@ func (o *PcloudVpnconnectionsPeersubnetsPutOK) readResponse(response runtime.Cli o.Payload = new(models.PeerSubnets) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *PcloudVpnconnectionsPeersubnetsPutBadRequest) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *PcloudVpnconnectionsPeersubnetsPutUnauthorized) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *PcloudVpnconnectionsPeersubnetsPutForbidden) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *PcloudVpnconnectionsPeersubnetsPutNotFound) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *PcloudVpnconnectionsPeersubnetsPutUnprocessableEntity) readResponse(res o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *PcloudVpnconnectionsPeersubnetsPutInternalServerError) readResponse(res o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_post_responses.go index 7306c239223..e2375f96eb5 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_v_p_n_connections import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudVpnconnectionsPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudVpnconnectionsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudVpnconnectionsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 202: result := NewPcloudVpnconnectionsPostAccepted() @@ -146,7 +147,7 @@ func (o *PcloudVpnconnectionsPostAccepted) readResponse(response runtime.ClientR o.Payload = new(models.VPNConnectionCreateResponse) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -216,7 +217,7 @@ func (o *PcloudVpnconnectionsPostBadRequest) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -286,7 +287,7 @@ func (o *PcloudVpnconnectionsPostUnauthorized) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -356,7 +357,7 @@ func (o *PcloudVpnconnectionsPostForbidden) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -426,7 +427,7 @@ func (o *PcloudVpnconnectionsPostNotFound) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -496,7 +497,7 @@ func (o *PcloudVpnconnectionsPostMethodNotAllowed) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -566,7 +567,7 @@ func (o *PcloudVpnconnectionsPostConflict) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -636,7 +637,7 @@ func (o *PcloudVpnconnectionsPostUnprocessableEntity) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -706,7 +707,7 @@ func (o *PcloudVpnconnectionsPostInternalServerError) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_put_responses.go index fd3b6409662..0b26b557fe9 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections/pcloud_vpnconnections_put_responses.go @@ -7,6 +7,7 @@ package p_cloud_v_p_n_connections import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudVpnconnectionsPutReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudVpnconnectionsPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudVpnconnectionsPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudVpnconnectionsPutOK() @@ -134,7 +135,7 @@ func (o *PcloudVpnconnectionsPutOK) readResponse(response runtime.ClientResponse o.Payload = new(models.VPNConnection) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *PcloudVpnconnectionsPutBadRequest) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *PcloudVpnconnectionsPutUnauthorized) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *PcloudVpnconnectionsPutForbidden) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *PcloudVpnconnectionsPutNotFound) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *PcloudVpnconnectionsPutUnprocessableEntity) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *PcloudVpnconnectionsPutInternalServerError) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/p_cloudvpn_policies_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/p_cloudvpn_policies_client.go index 0184c9dafad..8173da36daf 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/p_cloudvpn_policies_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/p_cloudvpn_policies_client.go @@ -85,7 +85,7 @@ PcloudIkepoliciesDelete deletes i k e policy Delete an IKE Policy (by its unique identifier) */ func (a *Client) PcloudIkepoliciesDelete(params *PcloudIkepoliciesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIkepoliciesDeleteOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudIkepoliciesDeleteParams() } @@ -105,17 +105,22 @@ func (a *Client) PcloudIkepoliciesDelete(params *PcloudIkepoliciesDeleteParams, for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudIkepoliciesDeleteOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.ikepolicies.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -126,7 +131,7 @@ PcloudIkepoliciesGet gets the specified i k e policy Get an IKE Policy (by its unique identifier) */ func (a *Client) PcloudIkepoliciesGet(params *PcloudIkepoliciesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIkepoliciesGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudIkepoliciesGetParams() } @@ -146,17 +151,22 @@ func (a *Client) PcloudIkepoliciesGet(params *PcloudIkepoliciesGetParams, authIn for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudIkepoliciesGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.ikepolicies.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -167,7 +177,7 @@ PcloudIkepoliciesGetall gets all i k e policies List all IKE Policies with all attributes */ func (a *Client) PcloudIkepoliciesGetall(params *PcloudIkepoliciesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIkepoliciesGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudIkepoliciesGetallParams() } @@ -187,17 +197,22 @@ func (a *Client) PcloudIkepoliciesGetall(params *PcloudIkepoliciesGetallParams, for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudIkepoliciesGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.ikepolicies.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -208,7 +223,7 @@ PcloudIkepoliciesPost adds i k e policy Add a new IKE Policy */ func (a *Client) PcloudIkepoliciesPost(params *PcloudIkepoliciesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIkepoliciesPostOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudIkepoliciesPostParams() } @@ -228,17 +243,22 @@ func (a *Client) PcloudIkepoliciesPost(params *PcloudIkepoliciesPostParams, auth for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudIkepoliciesPostOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.ikepolicies.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -249,7 +269,7 @@ PcloudIkepoliciesPut updates i k e policy update an IKE Policy (by its unique identifier) */ func (a *Client) PcloudIkepoliciesPut(params *PcloudIkepoliciesPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIkepoliciesPutOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudIkepoliciesPutParams() } @@ -269,17 +289,22 @@ func (a *Client) PcloudIkepoliciesPut(params *PcloudIkepoliciesPutParams, authIn for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudIkepoliciesPutOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.ikepolicies.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -290,7 +315,7 @@ PcloudIpsecpoliciesDelete deletes IP sec policy Delete an IPSec Policy (by its unique identifier) */ func (a *Client) PcloudIpsecpoliciesDelete(params *PcloudIpsecpoliciesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIpsecpoliciesDeleteOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudIpsecpoliciesDeleteParams() } @@ -310,17 +335,22 @@ func (a *Client) PcloudIpsecpoliciesDelete(params *PcloudIpsecpoliciesDeletePara for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudIpsecpoliciesDeleteOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.ipsecpolicies.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -331,7 +361,7 @@ PcloudIpsecpoliciesGet gets the specified IP sec policy Get an IPSec Policy (by its unique identifier) */ func (a *Client) PcloudIpsecpoliciesGet(params *PcloudIpsecpoliciesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIpsecpoliciesGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudIpsecpoliciesGetParams() } @@ -351,17 +381,22 @@ func (a *Client) PcloudIpsecpoliciesGet(params *PcloudIpsecpoliciesGetParams, au for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudIpsecpoliciesGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.ipsecpolicies.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -372,7 +407,7 @@ PcloudIpsecpoliciesGetall gets all IP sec policies Get all IPSec Policies with all their attributes */ func (a *Client) PcloudIpsecpoliciesGetall(params *PcloudIpsecpoliciesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIpsecpoliciesGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudIpsecpoliciesGetallParams() } @@ -392,17 +427,22 @@ func (a *Client) PcloudIpsecpoliciesGetall(params *PcloudIpsecpoliciesGetallPara for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudIpsecpoliciesGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.ipsecpolicies.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -413,7 +453,7 @@ PcloudIpsecpoliciesPost adds IP sec policy Add a new IPSec Policy */ func (a *Client) PcloudIpsecpoliciesPost(params *PcloudIpsecpoliciesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIpsecpoliciesPostOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudIpsecpoliciesPostParams() } @@ -433,17 +473,22 @@ func (a *Client) PcloudIpsecpoliciesPost(params *PcloudIpsecpoliciesPostParams, for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudIpsecpoliciesPostOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.ipsecpolicies.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -454,7 +499,7 @@ PcloudIpsecpoliciesPut updates IP sec policy update an IPSec Policy */ func (a *Client) PcloudIpsecpoliciesPut(params *PcloudIpsecpoliciesPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudIpsecpoliciesPutOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudIpsecpoliciesPutParams() } @@ -474,17 +519,22 @@ func (a *Client) PcloudIpsecpoliciesPut(params *PcloudIpsecpoliciesPutParams, au for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudIpsecpoliciesPutOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.ipsecpolicies.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_delete_responses.go index 642873dce45..6337e22439e 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_delete_responses.go @@ -7,6 +7,7 @@ package p_cloud_v_p_n_policies import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudIkepoliciesDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudIkepoliciesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudIkepoliciesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudIkepoliciesDeleteOK() @@ -126,7 +127,7 @@ func (o *PcloudIkepoliciesDeleteOK) GetPayload() models.Object { func (o *PcloudIkepoliciesDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -196,7 +197,7 @@ func (o *PcloudIkepoliciesDeleteBadRequest) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -266,7 +267,7 @@ func (o *PcloudIkepoliciesDeleteUnauthorized) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -336,7 +337,7 @@ func (o *PcloudIkepoliciesDeleteForbidden) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -406,7 +407,7 @@ func (o *PcloudIkepoliciesDeleteNotFound) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -476,7 +477,7 @@ func (o *PcloudIkepoliciesDeleteInternalServerError) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_get_responses.go index 48687437924..a7dc6e2a8fc 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_v_p_n_policies import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudIkepoliciesGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudIkepoliciesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudIkepoliciesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudIkepoliciesGetOK() @@ -134,7 +135,7 @@ func (o *PcloudIkepoliciesGetOK) readResponse(response runtime.ClientResponse, c o.Payload = new(models.IKEPolicy) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *PcloudIkepoliciesGetBadRequest) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *PcloudIkepoliciesGetUnauthorized) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *PcloudIkepoliciesGetForbidden) readResponse(response runtime.ClientResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *PcloudIkepoliciesGetNotFound) readResponse(response runtime.ClientRespo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *PcloudIkepoliciesGetUnprocessableEntity) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *PcloudIkepoliciesGetInternalServerError) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_getall_responses.go index ed9eeb0d968..bcf30d9f8db 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_getall_responses.go @@ -7,6 +7,7 @@ package p_cloud_v_p_n_policies import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudIkepoliciesGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudIkepoliciesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudIkepoliciesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudIkepoliciesGetallOK() @@ -128,7 +129,7 @@ func (o *PcloudIkepoliciesGetallOK) readResponse(response runtime.ClientResponse o.Payload = new(models.IKEPolicies) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudIkepoliciesGetallBadRequest) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudIkepoliciesGetallUnauthorized) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudIkepoliciesGetallForbidden) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudIkepoliciesGetallNotFound) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudIkepoliciesGetallInternalServerError) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_post_responses.go index 119e2e5af40..61222c13ee6 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_v_p_n_policies import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudIkepoliciesPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudIkepoliciesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudIkepoliciesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudIkepoliciesPostOK() @@ -134,7 +135,7 @@ func (o *PcloudIkepoliciesPostOK) readResponse(response runtime.ClientResponse, o.Payload = new(models.IKEPolicy) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *PcloudIkepoliciesPostBadRequest) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *PcloudIkepoliciesPostUnauthorized) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *PcloudIkepoliciesPostForbidden) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *PcloudIkepoliciesPostConflict) readResponse(response runtime.ClientResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *PcloudIkepoliciesPostUnprocessableEntity) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *PcloudIkepoliciesPostInternalServerError) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_put_responses.go index 046ca51acb4..80b1a1fec21 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ikepolicies_put_responses.go @@ -7,6 +7,7 @@ package p_cloud_v_p_n_policies import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudIkepoliciesPutReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudIkepoliciesPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudIkepoliciesPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudIkepoliciesPutOK() @@ -134,7 +135,7 @@ func (o *PcloudIkepoliciesPutOK) readResponse(response runtime.ClientResponse, c o.Payload = new(models.IKEPolicy) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *PcloudIkepoliciesPutBadRequest) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *PcloudIkepoliciesPutUnauthorized) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *PcloudIkepoliciesPutForbidden) readResponse(response runtime.ClientResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *PcloudIkepoliciesPutNotFound) readResponse(response runtime.ClientRespo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *PcloudIkepoliciesPutUnprocessableEntity) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *PcloudIkepoliciesPutInternalServerError) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_delete_responses.go index 4b3ba8ecd97..5ede2140a7c 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_delete_responses.go @@ -7,6 +7,7 @@ package p_cloud_v_p_n_policies import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudIpsecpoliciesDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudIpsecpoliciesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudIpsecpoliciesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudIpsecpoliciesDeleteOK() @@ -126,7 +127,7 @@ func (o *PcloudIpsecpoliciesDeleteOK) GetPayload() models.Object { func (o *PcloudIpsecpoliciesDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -196,7 +197,7 @@ func (o *PcloudIpsecpoliciesDeleteBadRequest) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -266,7 +267,7 @@ func (o *PcloudIpsecpoliciesDeleteUnauthorized) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -336,7 +337,7 @@ func (o *PcloudIpsecpoliciesDeleteForbidden) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -406,7 +407,7 @@ func (o *PcloudIpsecpoliciesDeleteNotFound) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -476,7 +477,7 @@ func (o *PcloudIpsecpoliciesDeleteInternalServerError) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_get_responses.go index 0aa1b208ea2..3ef2c3333bb 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_v_p_n_policies import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudIpsecpoliciesGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudIpsecpoliciesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudIpsecpoliciesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudIpsecpoliciesGetOK() @@ -134,7 +135,7 @@ func (o *PcloudIpsecpoliciesGetOK) readResponse(response runtime.ClientResponse, o.Payload = new(models.IPSecPolicy) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *PcloudIpsecpoliciesGetBadRequest) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *PcloudIpsecpoliciesGetUnauthorized) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *PcloudIpsecpoliciesGetForbidden) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *PcloudIpsecpoliciesGetNotFound) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *PcloudIpsecpoliciesGetUnprocessableEntity) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *PcloudIpsecpoliciesGetInternalServerError) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_getall_responses.go index d33c2905d7e..5bd5c10f004 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_getall_responses.go @@ -7,6 +7,7 @@ package p_cloud_v_p_n_policies import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudIpsecpoliciesGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudIpsecpoliciesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudIpsecpoliciesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudIpsecpoliciesGetallOK() @@ -128,7 +129,7 @@ func (o *PcloudIpsecpoliciesGetallOK) readResponse(response runtime.ClientRespon o.Payload = new(models.IPSecPolicies) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudIpsecpoliciesGetallBadRequest) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudIpsecpoliciesGetallUnauthorized) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudIpsecpoliciesGetallForbidden) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudIpsecpoliciesGetallNotFound) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudIpsecpoliciesGetallInternalServerError) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_post_responses.go index f7870d033df..6e516076009 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_v_p_n_policies import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudIpsecpoliciesPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudIpsecpoliciesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudIpsecpoliciesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudIpsecpoliciesPostOK() @@ -140,7 +141,7 @@ func (o *PcloudIpsecpoliciesPostOK) readResponse(response runtime.ClientResponse o.Payload = new(models.IPSecPolicy) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -210,7 +211,7 @@ func (o *PcloudIpsecpoliciesPostBadRequest) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -280,7 +281,7 @@ func (o *PcloudIpsecpoliciesPostUnauthorized) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -350,7 +351,7 @@ func (o *PcloudIpsecpoliciesPostForbidden) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -420,7 +421,7 @@ func (o *PcloudIpsecpoliciesPostNotFound) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -490,7 +491,7 @@ func (o *PcloudIpsecpoliciesPostConflict) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -560,7 +561,7 @@ func (o *PcloudIpsecpoliciesPostUnprocessableEntity) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -630,7 +631,7 @@ func (o *PcloudIpsecpoliciesPostInternalServerError) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_put_responses.go index b8626e3a786..3cfcf474384 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies/pcloud_ipsecpolicies_put_responses.go @@ -7,6 +7,7 @@ package p_cloud_v_p_n_policies import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudIpsecpoliciesPutReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudIpsecpoliciesPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudIpsecpoliciesPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudIpsecpoliciesPutOK() @@ -140,7 +141,7 @@ func (o *PcloudIpsecpoliciesPutOK) readResponse(response runtime.ClientResponse, o.Payload = new(models.IPSecPolicy) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -210,7 +211,7 @@ func (o *PcloudIpsecpoliciesPutBadRequest) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -280,7 +281,7 @@ func (o *PcloudIpsecpoliciesPutUnauthorized) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -350,7 +351,7 @@ func (o *PcloudIpsecpoliciesPutForbidden) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -420,7 +421,7 @@ func (o *PcloudIpsecpoliciesPutNotFound) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -490,7 +491,7 @@ func (o *PcloudIpsecpoliciesPutConflict) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -560,7 +561,7 @@ func (o *PcloudIpsecpoliciesPutUnprocessableEntity) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -630,7 +631,7 @@ func (o *PcloudIpsecpoliciesPutInternalServerError) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_cloudinstances_virtual_serial_number_getall_parameters.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_cloudinstances_virtual_serial_number_getall_parameters.go deleted file mode 100644 index 3f54fca4acd..00000000000 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_cloudinstances_virtual_serial_number_getall_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_virtual_serial_number - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewPcloudCloudinstancesVirtualSerialNumberGetallParams creates a new PcloudCloudinstancesVirtualSerialNumberGetallParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudCloudinstancesVirtualSerialNumberGetallParams() *PcloudCloudinstancesVirtualSerialNumberGetallParams { - return &PcloudCloudinstancesVirtualSerialNumberGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudCloudinstancesVirtualSerialNumberGetallParamsWithTimeout creates a new PcloudCloudinstancesVirtualSerialNumberGetallParams object -// with the ability to set a timeout on a request. -func NewPcloudCloudinstancesVirtualSerialNumberGetallParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesVirtualSerialNumberGetallParams { - return &PcloudCloudinstancesVirtualSerialNumberGetallParams{ - timeout: timeout, - } -} - -// NewPcloudCloudinstancesVirtualSerialNumberGetallParamsWithContext creates a new PcloudCloudinstancesVirtualSerialNumberGetallParams object -// with the ability to set a context for a request. -func NewPcloudCloudinstancesVirtualSerialNumberGetallParamsWithContext(ctx context.Context) *PcloudCloudinstancesVirtualSerialNumberGetallParams { - return &PcloudCloudinstancesVirtualSerialNumberGetallParams{ - Context: ctx, - } -} - -// NewPcloudCloudinstancesVirtualSerialNumberGetallParamsWithHTTPClient creates a new PcloudCloudinstancesVirtualSerialNumberGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudCloudinstancesVirtualSerialNumberGetallParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesVirtualSerialNumberGetallParams { - return &PcloudCloudinstancesVirtualSerialNumberGetallParams{ - HTTPClient: client, - } -} - -/* -PcloudCloudinstancesVirtualSerialNumberGetallParams contains all the parameters to send to the API endpoint - - for the pcloud cloudinstances virtual serial number getall operation. - - Typically these are written to a http.Request. -*/ -type PcloudCloudinstancesVirtualSerialNumberGetallParams struct { - - /* CloudInstanceID. - - Cloud Instance ID of a PCloud Instance - */ - CloudInstanceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the pcloud cloudinstances virtual serial number getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesVirtualSerialNumberGetallParams) WithDefaults() *PcloudCloudinstancesVirtualSerialNumberGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud cloudinstances virtual serial number getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesVirtualSerialNumberGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud cloudinstances virtual serial number getall params -func (o *PcloudCloudinstancesVirtualSerialNumberGetallParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesVirtualSerialNumberGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud cloudinstances virtual serial number getall params -func (o *PcloudCloudinstancesVirtualSerialNumberGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud cloudinstances virtual serial number getall params -func (o *PcloudCloudinstancesVirtualSerialNumberGetallParams) WithContext(ctx context.Context) *PcloudCloudinstancesVirtualSerialNumberGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud cloudinstances virtual serial number getall params -func (o *PcloudCloudinstancesVirtualSerialNumberGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud cloudinstances virtual serial number getall params -func (o *PcloudCloudinstancesVirtualSerialNumberGetallParams) WithHTTPClient(client *http.Client) *PcloudCloudinstancesVirtualSerialNumberGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud cloudinstances virtual serial number getall params -func (o *PcloudCloudinstancesVirtualSerialNumberGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudinstances virtual serial number getall params -func (o *PcloudCloudinstancesVirtualSerialNumberGetallParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudinstancesVirtualSerialNumberGetallParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudinstances virtual serial number getall params -func (o *PcloudCloudinstancesVirtualSerialNumberGetallParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudCloudinstancesVirtualSerialNumberGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_cloudinstances_virtual_serial_number_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_cloudinstances_virtual_serial_number_getall_responses.go deleted file mode 100644 index 37efbafdd55..00000000000 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_cloudinstances_virtual_serial_number_getall_responses.go +++ /dev/null @@ -1,484 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_virtual_serial_number - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudCloudinstancesVirtualSerialNumberGetallReader is a Reader for the PcloudCloudinstancesVirtualSerialNumberGetall structure. -type PcloudCloudinstancesVirtualSerialNumberGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesVirtualSerialNumberGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudCloudinstancesVirtualSerialNumberGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudCloudinstancesVirtualSerialNumberGetallBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudCloudinstancesVirtualSerialNumberGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudCloudinstancesVirtualSerialNumberGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudCloudinstancesVirtualSerialNumberGetallNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudCloudinstancesVirtualSerialNumberGetallInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/virtual-serial-number] pcloud.cloudinstances.virtual-serial-number.getall", response, response.Code()) - } -} - -// NewPcloudCloudinstancesVirtualSerialNumberGetallOK creates a PcloudCloudinstancesVirtualSerialNumberGetallOK with default headers values -func NewPcloudCloudinstancesVirtualSerialNumberGetallOK() *PcloudCloudinstancesVirtualSerialNumberGetallOK { - return &PcloudCloudinstancesVirtualSerialNumberGetallOK{} -} - -/* -PcloudCloudinstancesVirtualSerialNumberGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudCloudinstancesVirtualSerialNumberGetallOK struct { - Payload models.VirtualSerialNumberList -} - -// IsSuccess returns true when this pcloud cloudinstances virtual serial number getall o k response has a 2xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudinstances virtual serial number getall o k response has a 3xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances virtual serial number getall o k response has a 4xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances virtual serial number getall o k response has a 5xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances virtual serial number getall o k response a status code equal to that given -func (o *PcloudCloudinstancesVirtualSerialNumberGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud cloudinstances virtual serial number getall o k response -func (o *PcloudCloudinstancesVirtualSerialNumberGetallOK) Code() int { - return 200 -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/virtual-serial-number][%d] pcloudCloudinstancesVirtualSerialNumberGetallOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/virtual-serial-number][%d] pcloudCloudinstancesVirtualSerialNumberGetallOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallOK) GetPayload() models.VirtualSerialNumberList { - return o.Payload -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVirtualSerialNumberGetallBadRequest creates a PcloudCloudinstancesVirtualSerialNumberGetallBadRequest with default headers values -func NewPcloudCloudinstancesVirtualSerialNumberGetallBadRequest() *PcloudCloudinstancesVirtualSerialNumberGetallBadRequest { - return &PcloudCloudinstancesVirtualSerialNumberGetallBadRequest{} -} - -/* -PcloudCloudinstancesVirtualSerialNumberGetallBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudCloudinstancesVirtualSerialNumberGetallBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances virtual serial number getall bad request response has a 2xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances virtual serial number getall bad request response has a 3xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances virtual serial number getall bad request response has a 4xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances virtual serial number getall bad request response has a 5xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances virtual serial number getall bad request response a status code equal to that given -func (o *PcloudCloudinstancesVirtualSerialNumberGetallBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud cloudinstances virtual serial number getall bad request response -func (o *PcloudCloudinstancesVirtualSerialNumberGetallBadRequest) Code() int { - return 400 -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/virtual-serial-number][%d] pcloudCloudinstancesVirtualSerialNumberGetallBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/virtual-serial-number][%d] pcloudCloudinstancesVirtualSerialNumberGetallBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVirtualSerialNumberGetallUnauthorized creates a PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized with default headers values -func NewPcloudCloudinstancesVirtualSerialNumberGetallUnauthorized() *PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized { - return &PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized{} -} - -/* -PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances virtual serial number getall unauthorized response has a 2xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances virtual serial number getall unauthorized response has a 3xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances virtual serial number getall unauthorized response has a 4xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances virtual serial number getall unauthorized response has a 5xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances virtual serial number getall unauthorized response a status code equal to that given -func (o *PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud cloudinstances virtual serial number getall unauthorized response -func (o *PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized) Code() int { - return 401 -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/virtual-serial-number][%d] pcloudCloudinstancesVirtualSerialNumberGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/virtual-serial-number][%d] pcloudCloudinstancesVirtualSerialNumberGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVirtualSerialNumberGetallForbidden creates a PcloudCloudinstancesVirtualSerialNumberGetallForbidden with default headers values -func NewPcloudCloudinstancesVirtualSerialNumberGetallForbidden() *PcloudCloudinstancesVirtualSerialNumberGetallForbidden { - return &PcloudCloudinstancesVirtualSerialNumberGetallForbidden{} -} - -/* -PcloudCloudinstancesVirtualSerialNumberGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudCloudinstancesVirtualSerialNumberGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances virtual serial number getall forbidden response has a 2xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances virtual serial number getall forbidden response has a 3xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances virtual serial number getall forbidden response has a 4xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances virtual serial number getall forbidden response has a 5xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances virtual serial number getall forbidden response a status code equal to that given -func (o *PcloudCloudinstancesVirtualSerialNumberGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud cloudinstances virtual serial number getall forbidden response -func (o *PcloudCloudinstancesVirtualSerialNumberGetallForbidden) Code() int { - return 403 -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/virtual-serial-number][%d] pcloudCloudinstancesVirtualSerialNumberGetallForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/virtual-serial-number][%d] pcloudCloudinstancesVirtualSerialNumberGetallForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVirtualSerialNumberGetallNotFound creates a PcloudCloudinstancesVirtualSerialNumberGetallNotFound with default headers values -func NewPcloudCloudinstancesVirtualSerialNumberGetallNotFound() *PcloudCloudinstancesVirtualSerialNumberGetallNotFound { - return &PcloudCloudinstancesVirtualSerialNumberGetallNotFound{} -} - -/* -PcloudCloudinstancesVirtualSerialNumberGetallNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudCloudinstancesVirtualSerialNumberGetallNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances virtual serial number getall not found response has a 2xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances virtual serial number getall not found response has a 3xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances virtual serial number getall not found response has a 4xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances virtual serial number getall not found response has a 5xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances virtual serial number getall not found response a status code equal to that given -func (o *PcloudCloudinstancesVirtualSerialNumberGetallNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud cloudinstances virtual serial number getall not found response -func (o *PcloudCloudinstancesVirtualSerialNumberGetallNotFound) Code() int { - return 404 -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/virtual-serial-number][%d] pcloudCloudinstancesVirtualSerialNumberGetallNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/virtual-serial-number][%d] pcloudCloudinstancesVirtualSerialNumberGetallNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVirtualSerialNumberGetallInternalServerError creates a PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError with default headers values -func NewPcloudCloudinstancesVirtualSerialNumberGetallInternalServerError() *PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError { - return &PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError{} -} - -/* -PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances virtual serial number getall internal server error response has a 2xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances virtual serial number getall internal server error response has a 3xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances virtual serial number getall internal server error response has a 4xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances virtual serial number getall internal server error response has a 5xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudinstances virtual serial number getall internal server error response a status code equal to that given -func (o *PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud cloudinstances virtual serial number getall internal server error response -func (o *PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError) Code() int { - return 500 -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/virtual-serial-number][%d] pcloudCloudinstancesVirtualSerialNumberGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/virtual-serial-number][%d] pcloudCloudinstancesVirtualSerialNumberGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_pvminstances_virtualserialnumber_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_pvminstances_virtualserialnumber_delete_responses.go index 320b74c69b1..7c815b70d2a 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_pvminstances_virtualserialnumber_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_pvminstances_virtualserialnumber_delete_responses.go @@ -7,6 +7,7 @@ package p_cloud_virtual_serial_number import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudPvminstancesVirtualserialnumberDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesVirtualserialnumberDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudPvminstancesVirtualserialnumberDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 202: result := NewPcloudPvminstancesVirtualserialnumberDeleteAccepted() @@ -132,7 +133,7 @@ func (o *PcloudPvminstancesVirtualserialnumberDeleteAccepted) GetPayload() model func (o *PcloudPvminstancesVirtualserialnumberDeleteAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -202,7 +203,7 @@ func (o *PcloudPvminstancesVirtualserialnumberDeleteBadRequest) readResponse(res o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -272,7 +273,7 @@ func (o *PcloudPvminstancesVirtualserialnumberDeleteUnauthorized) readResponse(r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -342,7 +343,7 @@ func (o *PcloudPvminstancesVirtualserialnumberDeleteForbidden) readResponse(resp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -412,7 +413,7 @@ func (o *PcloudPvminstancesVirtualserialnumberDeleteNotFound) readResponse(respo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -482,7 +483,7 @@ func (o *PcloudPvminstancesVirtualserialnumberDeleteGone) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -552,7 +553,7 @@ func (o *PcloudPvminstancesVirtualserialnumberDeleteInternalServerError) readRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_pvminstances_virtualserialnumber_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_pvminstances_virtualserialnumber_get_responses.go index e9f85fbe816..17429f8ea73 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_pvminstances_virtualserialnumber_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_pvminstances_virtualserialnumber_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_virtual_serial_number import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudPvminstancesVirtualserialnumberGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesVirtualserialnumberGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudPvminstancesVirtualserialnumberGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudPvminstancesVirtualserialnumberGetOK() @@ -128,7 +129,7 @@ func (o *PcloudPvminstancesVirtualserialnumberGetOK) readResponse(response runti o.Payload = new(models.VirtualSerialNumber) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudPvminstancesVirtualserialnumberGetBadRequest) readResponse(respon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudPvminstancesVirtualserialnumberGetUnauthorized) readResponse(resp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudPvminstancesVirtualserialnumberGetForbidden) readResponse(respons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudPvminstancesVirtualserialnumberGetNotFound) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudPvminstancesVirtualserialnumberGetInternalServerError) readRespon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_pvminstances_virtualserialnumber_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_pvminstances_virtualserialnumber_post_responses.go index 8a7516dd858..176cc0eb843 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_pvminstances_virtualserialnumber_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_pvminstances_virtualserialnumber_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_virtual_serial_number import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudPvminstancesVirtualserialnumberPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesVirtualserialnumberPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudPvminstancesVirtualserialnumberPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 202: result := NewPcloudPvminstancesVirtualserialnumberPostAccepted() @@ -140,7 +141,7 @@ func (o *PcloudPvminstancesVirtualserialnumberPostAccepted) readResponse(respons o.Payload = new(models.VirtualSerialNumber) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -210,7 +211,7 @@ func (o *PcloudPvminstancesVirtualserialnumberPostBadRequest) readResponse(respo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -280,7 +281,7 @@ func (o *PcloudPvminstancesVirtualserialnumberPostUnauthorized) readResponse(res o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -350,7 +351,7 @@ func (o *PcloudPvminstancesVirtualserialnumberPostForbidden) readResponse(respon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -420,7 +421,7 @@ func (o *PcloudPvminstancesVirtualserialnumberPostNotFound) readResponse(respons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -490,7 +491,7 @@ func (o *PcloudPvminstancesVirtualserialnumberPostConflict) readResponse(respons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -560,7 +561,7 @@ func (o *PcloudPvminstancesVirtualserialnumberPostInternalServerError) readRespo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -630,7 +631,7 @@ func (o *PcloudPvminstancesVirtualserialnumberPostGatewayTimeout) readResponse(r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_pvminstances_virtualserialnumber_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_pvminstances_virtualserialnumber_put_responses.go index e351a1b06f6..dc4d65b304f 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_pvminstances_virtualserialnumber_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_pvminstances_virtualserialnumber_put_responses.go @@ -7,6 +7,7 @@ package p_cloud_virtual_serial_number import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudPvminstancesVirtualserialnumberPutReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesVirtualserialnumberPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudPvminstancesVirtualserialnumberPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudPvminstancesVirtualserialnumberPutOK() @@ -140,7 +141,7 @@ func (o *PcloudPvminstancesVirtualserialnumberPutOK) readResponse(response runti o.Payload = new(models.VirtualSerialNumber) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -210,7 +211,7 @@ func (o *PcloudPvminstancesVirtualserialnumberPutAccepted) readResponse(response o.Payload = new(models.VirtualSerialNumber) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -280,7 +281,7 @@ func (o *PcloudPvminstancesVirtualserialnumberPutBadRequest) readResponse(respon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -350,7 +351,7 @@ func (o *PcloudPvminstancesVirtualserialnumberPutUnauthorized) readResponse(resp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -420,7 +421,7 @@ func (o *PcloudPvminstancesVirtualserialnumberPutForbidden) readResponse(respons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -490,7 +491,7 @@ func (o *PcloudPvminstancesVirtualserialnumberPutNotFound) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -560,7 +561,7 @@ func (o *PcloudPvminstancesVirtualserialnumberPutUnprocessableEntity) readRespon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -630,7 +631,7 @@ func (o *PcloudPvminstancesVirtualserialnumberPutInternalServerError) readRespon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_virtualserialnumber_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_virtualserialnumber_delete_responses.go index c067ad876e9..40b3c1945bb 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_virtualserialnumber_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_virtualserialnumber_delete_responses.go @@ -7,6 +7,7 @@ package p_cloud_virtual_serial_number import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudVirtualserialnumberDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudVirtualserialnumberDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudVirtualserialnumberDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudVirtualserialnumberDeleteOK() @@ -132,7 +133,7 @@ func (o *PcloudVirtualserialnumberDeleteOK) GetPayload() models.Object { func (o *PcloudVirtualserialnumberDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -202,7 +203,7 @@ func (o *PcloudVirtualserialnumberDeleteBadRequest) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -272,7 +273,7 @@ func (o *PcloudVirtualserialnumberDeleteUnauthorized) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -342,7 +343,7 @@ func (o *PcloudVirtualserialnumberDeleteForbidden) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -412,7 +413,7 @@ func (o *PcloudVirtualserialnumberDeleteNotFound) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -482,7 +483,7 @@ func (o *PcloudVirtualserialnumberDeleteGone) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -552,7 +553,7 @@ func (o *PcloudVirtualserialnumberDeleteInternalServerError) readResponse(respon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_virtualserialnumber_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_virtualserialnumber_get_responses.go index 720b911be76..73d219bfca6 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_virtualserialnumber_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_virtualserialnumber_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_virtual_serial_number import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudVirtualserialnumberGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudVirtualserialnumberGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudVirtualserialnumberGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudVirtualserialnumberGetOK() @@ -128,7 +129,7 @@ func (o *PcloudVirtualserialnumberGetOK) readResponse(response runtime.ClientRes o.Payload = new(models.VirtualSerialNumber) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudVirtualserialnumberGetBadRequest) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudVirtualserialnumberGetUnauthorized) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudVirtualserialnumberGetForbidden) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudVirtualserialnumberGetNotFound) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudVirtualserialnumberGetInternalServerError) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_virtualserialnumber_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_virtualserialnumber_getall_responses.go index 9484d007614..1f340956a40 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_virtualserialnumber_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_virtualserialnumber_getall_responses.go @@ -7,6 +7,7 @@ package p_cloud_virtual_serial_number import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudVirtualserialnumberGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudVirtualserialnumberGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudVirtualserialnumberGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudVirtualserialnumberGetallOK() @@ -126,7 +127,7 @@ func (o *PcloudVirtualserialnumberGetallOK) GetPayload() models.VirtualSerialNum func (o *PcloudVirtualserialnumberGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -196,7 +197,7 @@ func (o *PcloudVirtualserialnumberGetallBadRequest) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -266,7 +267,7 @@ func (o *PcloudVirtualserialnumberGetallUnauthorized) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -336,7 +337,7 @@ func (o *PcloudVirtualserialnumberGetallForbidden) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -406,7 +407,7 @@ func (o *PcloudVirtualserialnumberGetallNotFound) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -476,7 +477,7 @@ func (o *PcloudVirtualserialnumberGetallInternalServerError) readResponse(respon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_virtualserialnumber_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_virtualserialnumber_put_responses.go index 577d9f7c082..1df5e85928b 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_virtualserialnumber_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_virtualserialnumber_put_responses.go @@ -7,6 +7,7 @@ package p_cloud_virtual_serial_number import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudVirtualserialnumberPutReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudVirtualserialnumberPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudVirtualserialnumberPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudVirtualserialnumberPutOK() @@ -134,7 +135,7 @@ func (o *PcloudVirtualserialnumberPutOK) readResponse(response runtime.ClientRes o.Payload = new(models.GetServerVirtualSerialNumber) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *PcloudVirtualserialnumberPutBadRequest) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *PcloudVirtualserialnumberPutUnauthorized) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *PcloudVirtualserialnumberPutForbidden) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *PcloudVirtualserialnumberPutNotFound) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *PcloudVirtualserialnumberPutGone) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *PcloudVirtualserialnumberPutInternalServerError) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_virtualserialnumber_softwaretiers_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_virtualserialnumber_softwaretiers_getall_responses.go index 53d0a5b9cc8..7f202b8af17 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_virtualserialnumber_softwaretiers_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number/pcloud_virtualserialnumber_softwaretiers_getall_responses.go @@ -7,6 +7,7 @@ package p_cloud_virtual_serial_number import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudVirtualserialnumberSoftwaretiersGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudVirtualserialnumberSoftwaretiersGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudVirtualserialnumberSoftwaretiersGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudVirtualserialnumberSoftwaretiersGetallOK() @@ -120,7 +121,7 @@ func (o *PcloudVirtualserialnumberSoftwaretiersGetallOK) GetPayload() models.Sup func (o *PcloudVirtualserialnumberSoftwaretiersGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -190,7 +191,7 @@ func (o *PcloudVirtualserialnumberSoftwaretiersGetallBadRequest) readResponse(re o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -260,7 +261,7 @@ func (o *PcloudVirtualserialnumberSoftwaretiersGetallUnauthorized) readResponse( o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -330,7 +331,7 @@ func (o *PcloudVirtualserialnumberSoftwaretiersGetallForbidden) readResponse(res o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -400,7 +401,7 @@ func (o *PcloudVirtualserialnumberSoftwaretiersGetallInternalServerError) readRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/p_cloud_volume_groups_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/p_cloud_volume_groups_client.go index f307f596a81..73aa355fc93 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/p_cloud_volume_groups_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/p_cloud_volume_groups_client.go @@ -85,7 +85,7 @@ PcloudVolumegroupsActionPost performs an action on a volume group Corresponding actions are 'start', 'stop', 'reset' */ func (a *Client) PcloudVolumegroupsActionPost(params *PcloudVolumegroupsActionPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumegroupsActionPostAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudVolumegroupsActionPostParams() } @@ -105,17 +105,22 @@ func (a *Client) PcloudVolumegroupsActionPost(params *PcloudVolumegroupsActionPo for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudVolumegroupsActionPostAccepted) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.volumegroups.action.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -124,7 +129,7 @@ func (a *Client) PcloudVolumegroupsActionPost(params *PcloudVolumegroupsActionPo PcloudVolumegroupsDelete deletes a cloud instance volume group */ func (a *Client) PcloudVolumegroupsDelete(params *PcloudVolumegroupsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumegroupsDeleteAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudVolumegroupsDeleteParams() } @@ -144,17 +149,22 @@ func (a *Client) PcloudVolumegroupsDelete(params *PcloudVolumegroupsDeleteParams for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudVolumegroupsDeleteAccepted) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.volumegroups.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -163,7 +173,7 @@ func (a *Client) PcloudVolumegroupsDelete(params *PcloudVolumegroupsDeleteParams PcloudVolumegroupsGet gets volume group */ func (a *Client) PcloudVolumegroupsGet(params *PcloudVolumegroupsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumegroupsGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudVolumegroupsGetParams() } @@ -183,17 +193,22 @@ func (a *Client) PcloudVolumegroupsGet(params *PcloudVolumegroupsGetParams, auth for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudVolumegroupsGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.volumegroups.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -202,7 +217,7 @@ func (a *Client) PcloudVolumegroupsGet(params *PcloudVolumegroupsGetParams, auth PcloudVolumegroupsGetDetails gets volume group details */ func (a *Client) PcloudVolumegroupsGetDetails(params *PcloudVolumegroupsGetDetailsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumegroupsGetDetailsOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudVolumegroupsGetDetailsParams() } @@ -222,17 +237,22 @@ func (a *Client) PcloudVolumegroupsGetDetails(params *PcloudVolumegroupsGetDetai for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudVolumegroupsGetDetailsOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.volumegroups.getDetails: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -241,7 +261,7 @@ func (a *Client) PcloudVolumegroupsGetDetails(params *PcloudVolumegroupsGetDetai PcloudVolumegroupsGetall gets all volume groups */ func (a *Client) PcloudVolumegroupsGetall(params *PcloudVolumegroupsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumegroupsGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudVolumegroupsGetallParams() } @@ -261,17 +281,22 @@ func (a *Client) PcloudVolumegroupsGetall(params *PcloudVolumegroupsGetallParams for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudVolumegroupsGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.volumegroups.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -280,7 +305,7 @@ func (a *Client) PcloudVolumegroupsGetall(params *PcloudVolumegroupsGetallParams PcloudVolumegroupsGetallDetails gets all volume groups with details */ func (a *Client) PcloudVolumegroupsGetallDetails(params *PcloudVolumegroupsGetallDetailsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumegroupsGetallDetailsOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudVolumegroupsGetallDetailsParams() } @@ -300,17 +325,22 @@ func (a *Client) PcloudVolumegroupsGetallDetails(params *PcloudVolumegroupsGetal for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudVolumegroupsGetallDetailsOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.volumegroups.getallDetails: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -319,7 +349,7 @@ func (a *Client) PcloudVolumegroupsGetallDetails(params *PcloudVolumegroupsGetal PcloudVolumegroupsPost creates a new volume group */ func (a *Client) PcloudVolumegroupsPost(params *PcloudVolumegroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumegroupsPostAccepted, *PcloudVolumegroupsPostPartialContent, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudVolumegroupsPostParams() } @@ -339,18 +369,22 @@ func (a *Client) PcloudVolumegroupsPost(params *PcloudVolumegroupsPostParams, au for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } + + // several success responses have to be checked switch value := result.(type) { case *PcloudVolumegroupsPostAccepted: return value, nil, nil case *PcloudVolumegroupsPostPartialContent: return nil, value, nil } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for p_cloud_volume_groups: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -359,7 +393,7 @@ func (a *Client) PcloudVolumegroupsPost(params *PcloudVolumegroupsPostParams, au PcloudVolumegroupsPut updates the volume group */ func (a *Client) PcloudVolumegroupsPut(params *PcloudVolumegroupsPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumegroupsPutAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudVolumegroupsPutParams() } @@ -379,17 +413,22 @@ func (a *Client) PcloudVolumegroupsPut(params *PcloudVolumegroupsPutParams, auth for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudVolumegroupsPutAccepted) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.volumegroups.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -398,7 +437,7 @@ func (a *Client) PcloudVolumegroupsPut(params *PcloudVolumegroupsPutParams, auth PcloudVolumegroupsRemoteCopyRelationshipsGet gets remote copy relationships of the volume belonging to volume group */ func (a *Client) PcloudVolumegroupsRemoteCopyRelationshipsGet(params *PcloudVolumegroupsRemoteCopyRelationshipsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumegroupsRemoteCopyRelationshipsGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudVolumegroupsRemoteCopyRelationshipsGetParams() } @@ -418,17 +457,22 @@ func (a *Client) PcloudVolumegroupsRemoteCopyRelationshipsGet(params *PcloudVolu for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudVolumegroupsRemoteCopyRelationshipsGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.volumegroups.remoteCopyRelationships.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -437,7 +481,7 @@ func (a *Client) PcloudVolumegroupsRemoteCopyRelationshipsGet(params *PcloudVolu PcloudVolumegroupsStorageDetailsGet gets storage details of volume group */ func (a *Client) PcloudVolumegroupsStorageDetailsGet(params *PcloudVolumegroupsStorageDetailsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumegroupsStorageDetailsGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudVolumegroupsStorageDetailsGetParams() } @@ -457,17 +501,22 @@ func (a *Client) PcloudVolumegroupsStorageDetailsGet(params *PcloudVolumegroupsS for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudVolumegroupsStorageDetailsGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.volumegroups.storageDetails.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_action_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_action_post_responses.go index 1bef926881c..61c4e469250 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_action_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_action_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_volume_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudVolumegroupsActionPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudVolumegroupsActionPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudVolumegroupsActionPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 202: result := NewPcloudVolumegroupsActionPostAccepted() @@ -132,7 +133,7 @@ func (o *PcloudVolumegroupsActionPostAccepted) GetPayload() models.Object { func (o *PcloudVolumegroupsActionPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -202,7 +203,7 @@ func (o *PcloudVolumegroupsActionPostBadRequest) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -272,7 +273,7 @@ func (o *PcloudVolumegroupsActionPostUnauthorized) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -342,7 +343,7 @@ func (o *PcloudVolumegroupsActionPostForbidden) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -412,7 +413,7 @@ func (o *PcloudVolumegroupsActionPostNotFound) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -482,7 +483,7 @@ func (o *PcloudVolumegroupsActionPostUnprocessableEntity) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -552,7 +553,7 @@ func (o *PcloudVolumegroupsActionPostInternalServerError) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_delete_responses.go index 259bec925ba..9d689cec11f 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_delete_responses.go @@ -7,6 +7,7 @@ package p_cloud_volume_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudVolumegroupsDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudVolumegroupsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudVolumegroupsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 202: result := NewPcloudVolumegroupsDeleteAccepted() @@ -126,7 +127,7 @@ func (o *PcloudVolumegroupsDeleteAccepted) GetPayload() models.Object { func (o *PcloudVolumegroupsDeleteAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -196,7 +197,7 @@ func (o *PcloudVolumegroupsDeleteBadRequest) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -266,7 +267,7 @@ func (o *PcloudVolumegroupsDeleteUnauthorized) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -336,7 +337,7 @@ func (o *PcloudVolumegroupsDeleteForbidden) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -406,7 +407,7 @@ func (o *PcloudVolumegroupsDeleteNotFound) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -476,7 +477,7 @@ func (o *PcloudVolumegroupsDeleteInternalServerError) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_get_details_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_get_details_responses.go index e44337c27de..77fef53980b 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_get_details_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_get_details_responses.go @@ -7,6 +7,7 @@ package p_cloud_volume_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudVolumegroupsGetDetailsReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudVolumegroupsGetDetailsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudVolumegroupsGetDetailsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudVolumegroupsGetDetailsOK() @@ -128,7 +129,7 @@ func (o *PcloudVolumegroupsGetDetailsOK) readResponse(response runtime.ClientRes o.Payload = new(models.VolumeGroupDetails) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudVolumegroupsGetDetailsBadRequest) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudVolumegroupsGetDetailsUnauthorized) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudVolumegroupsGetDetailsForbidden) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudVolumegroupsGetDetailsNotFound) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudVolumegroupsGetDetailsInternalServerError) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_get_responses.go index 38e740724bf..d0727fe08f7 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_volume_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudVolumegroupsGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudVolumegroupsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudVolumegroupsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudVolumegroupsGetOK() @@ -128,7 +129,7 @@ func (o *PcloudVolumegroupsGetOK) readResponse(response runtime.ClientResponse, o.Payload = new(models.VolumeGroup) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudVolumegroupsGetBadRequest) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudVolumegroupsGetUnauthorized) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudVolumegroupsGetForbidden) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudVolumegroupsGetNotFound) readResponse(response runtime.ClientResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudVolumegroupsGetInternalServerError) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_getall_details_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_getall_details_responses.go index bc076a047ae..98f12849f75 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_getall_details_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_getall_details_responses.go @@ -7,6 +7,7 @@ package p_cloud_volume_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudVolumegroupsGetallDetailsReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudVolumegroupsGetallDetailsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudVolumegroupsGetallDetailsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudVolumegroupsGetallDetailsOK() @@ -128,7 +129,7 @@ func (o *PcloudVolumegroupsGetallDetailsOK) readResponse(response runtime.Client o.Payload = new(models.VolumeGroupsDetails) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudVolumegroupsGetallDetailsBadRequest) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudVolumegroupsGetallDetailsUnauthorized) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudVolumegroupsGetallDetailsForbidden) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudVolumegroupsGetallDetailsNotFound) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudVolumegroupsGetallDetailsInternalServerError) readResponse(respon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_getall_responses.go index d8b1a7a2835..e264993756e 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_getall_responses.go @@ -7,6 +7,7 @@ package p_cloud_volume_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudVolumegroupsGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudVolumegroupsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudVolumegroupsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudVolumegroupsGetallOK() @@ -128,7 +129,7 @@ func (o *PcloudVolumegroupsGetallOK) readResponse(response runtime.ClientRespons o.Payload = new(models.VolumeGroups) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudVolumegroupsGetallBadRequest) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudVolumegroupsGetallUnauthorized) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudVolumegroupsGetallForbidden) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudVolumegroupsGetallNotFound) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudVolumegroupsGetallInternalServerError) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_post_responses.go index 731fc036c97..017b607f066 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_volume_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudVolumegroupsPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudVolumegroupsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudVolumegroupsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 202: result := NewPcloudVolumegroupsPostAccepted() @@ -152,7 +153,7 @@ func (o *PcloudVolumegroupsPostAccepted) readResponse(response runtime.ClientRes o.Payload = new(models.VolumeGroupCreateResponse) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -222,7 +223,7 @@ func (o *PcloudVolumegroupsPostPartialContent) readResponse(response runtime.Cli o.Payload = new(models.VolumeGroupCreateResponse) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -292,7 +293,7 @@ func (o *PcloudVolumegroupsPostBadRequest) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -362,7 +363,7 @@ func (o *PcloudVolumegroupsPostUnauthorized) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -432,7 +433,7 @@ func (o *PcloudVolumegroupsPostForbidden) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -502,7 +503,7 @@ func (o *PcloudVolumegroupsPostNotFound) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -572,7 +573,7 @@ func (o *PcloudVolumegroupsPostConflict) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -642,7 +643,7 @@ func (o *PcloudVolumegroupsPostUnprocessableEntity) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -712,7 +713,7 @@ func (o *PcloudVolumegroupsPostInternalServerError) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -782,7 +783,7 @@ func (o *PcloudVolumegroupsPostGatewayTimeout) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_put_responses.go index 4ed822ba063..194b18a918e 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_put_responses.go @@ -7,6 +7,7 @@ package p_cloud_volume_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudVolumegroupsPutReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudVolumegroupsPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudVolumegroupsPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 202: result := NewPcloudVolumegroupsPutAccepted() @@ -138,7 +139,7 @@ func (o *PcloudVolumegroupsPutAccepted) GetPayload() models.Object { func (o *PcloudVolumegroupsPutAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -208,7 +209,7 @@ func (o *PcloudVolumegroupsPutBadRequest) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -278,7 +279,7 @@ func (o *PcloudVolumegroupsPutUnauthorized) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -348,7 +349,7 @@ func (o *PcloudVolumegroupsPutForbidden) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -418,7 +419,7 @@ func (o *PcloudVolumegroupsPutNotFound) readResponse(response runtime.ClientResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -488,7 +489,7 @@ func (o *PcloudVolumegroupsPutConflict) readResponse(response runtime.ClientResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -558,7 +559,7 @@ func (o *PcloudVolumegroupsPutUnprocessableEntity) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -628,7 +629,7 @@ func (o *PcloudVolumegroupsPutInternalServerError) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_remote_copy_relationships_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_remote_copy_relationships_get_responses.go index 17163b577cc..f080841891e 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_remote_copy_relationships_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_remote_copy_relationships_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_volume_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudVolumegroupsRemoteCopyRelationshipsGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudVolumegroupsRemoteCopyRelationshipsGetOK() @@ -134,7 +135,7 @@ func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetOK) readResponse(response r o.Payload = new(models.VolumeGroupRemoteCopyRelationships) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetBadRequest) readResponse(re o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetUnauthorized) readResponse( o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetForbidden) readResponse(res o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetNotFound) readResponse(resp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetTooManyRequests) readRespon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetInternalServerError) readRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_storage_details_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_storage_details_get_responses.go index 54136c937b4..4863d586512 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_storage_details_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_groups/pcloud_volumegroups_storage_details_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_volume_groups import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudVolumegroupsStorageDetailsGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudVolumegroupsStorageDetailsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudVolumegroupsStorageDetailsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudVolumegroupsStorageDetailsGetOK() @@ -134,7 +135,7 @@ func (o *PcloudVolumegroupsStorageDetailsGetOK) readResponse(response runtime.Cl o.Payload = new(models.VolumeGroupStorageDetails) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *PcloudVolumegroupsStorageDetailsGetBadRequest) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *PcloudVolumegroupsStorageDetailsGetUnauthorized) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *PcloudVolumegroupsStorageDetailsGetForbidden) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *PcloudVolumegroupsStorageDetailsGetNotFound) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *PcloudVolumegroupsStorageDetailsGetTooManyRequests) readResponse(respon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *PcloudVolumegroupsStorageDetailsGetInternalServerError) readResponse(re o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_onboarding/p_cloud_volume_onboarding_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_onboarding/p_cloud_volume_onboarding_client.go index 9b7bfb391ae..571fc84a669 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_onboarding/p_cloud_volume_onboarding_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_onboarding/p_cloud_volume_onboarding_client.go @@ -69,7 +69,7 @@ type ClientService interface { PcloudVolumeOnboardingGet gets the information of volume onboarding operation */ func (a *Client) PcloudVolumeOnboardingGet(params *PcloudVolumeOnboardingGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumeOnboardingGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudVolumeOnboardingGetParams() } @@ -89,17 +89,22 @@ func (a *Client) PcloudVolumeOnboardingGet(params *PcloudVolumeOnboardingGetPara for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudVolumeOnboardingGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.volume.onboarding.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -108,7 +113,7 @@ func (a *Client) PcloudVolumeOnboardingGet(params *PcloudVolumeOnboardingGetPara PcloudVolumeOnboardingGetall lists all volume onboardings for this cloud instance */ func (a *Client) PcloudVolumeOnboardingGetall(params *PcloudVolumeOnboardingGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumeOnboardingGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudVolumeOnboardingGetallParams() } @@ -128,17 +133,22 @@ func (a *Client) PcloudVolumeOnboardingGetall(params *PcloudVolumeOnboardingGeta for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudVolumeOnboardingGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.volume.onboarding.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -147,7 +157,7 @@ func (a *Client) PcloudVolumeOnboardingGetall(params *PcloudVolumeOnboardingGeta PcloudVolumeOnboardingPost onboards auxiliary volumes to target site */ func (a *Client) PcloudVolumeOnboardingPost(params *PcloudVolumeOnboardingPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumeOnboardingPostAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudVolumeOnboardingPostParams() } @@ -167,17 +177,22 @@ func (a *Client) PcloudVolumeOnboardingPost(params *PcloudVolumeOnboardingPostPa for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudVolumeOnboardingPostAccepted) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.volume.onboarding.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_onboarding/pcloud_volume_onboarding_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_onboarding/pcloud_volume_onboarding_get_responses.go index 7f28d3c8072..901d6c8f591 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_onboarding/pcloud_volume_onboarding_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_onboarding/pcloud_volume_onboarding_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_volume_onboarding import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudVolumeOnboardingGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudVolumeOnboardingGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudVolumeOnboardingGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudVolumeOnboardingGetOK() @@ -128,7 +129,7 @@ func (o *PcloudVolumeOnboardingGetOK) readResponse(response runtime.ClientRespon o.Payload = new(models.VolumeOnboarding) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudVolumeOnboardingGetBadRequest) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudVolumeOnboardingGetUnauthorized) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudVolumeOnboardingGetForbidden) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudVolumeOnboardingGetNotFound) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudVolumeOnboardingGetInternalServerError) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_onboarding/pcloud_volume_onboarding_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_onboarding/pcloud_volume_onboarding_getall_responses.go index 59968522b50..12b40d2831e 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_onboarding/pcloud_volume_onboarding_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_onboarding/pcloud_volume_onboarding_getall_responses.go @@ -7,6 +7,7 @@ package p_cloud_volume_onboarding import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudVolumeOnboardingGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudVolumeOnboardingGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudVolumeOnboardingGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudVolumeOnboardingGetallOK() @@ -128,7 +129,7 @@ func (o *PcloudVolumeOnboardingGetallOK) readResponse(response runtime.ClientRes o.Payload = new(models.VolumeOnboardings) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudVolumeOnboardingGetallBadRequest) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudVolumeOnboardingGetallUnauthorized) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudVolumeOnboardingGetallForbidden) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudVolumeOnboardingGetallNotFound) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudVolumeOnboardingGetallInternalServerError) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_onboarding/pcloud_volume_onboarding_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_onboarding/pcloud_volume_onboarding_post_responses.go index 801df4b4101..09f309918e9 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_onboarding/pcloud_volume_onboarding_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volume_onboarding/pcloud_volume_onboarding_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_volume_onboarding import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudVolumeOnboardingPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudVolumeOnboardingPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudVolumeOnboardingPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 202: result := NewPcloudVolumeOnboardingPostAccepted() @@ -134,7 +135,7 @@ func (o *PcloudVolumeOnboardingPostAccepted) readResponse(response runtime.Clien o.Payload = new(models.VolumeOnboardingCreateResponse) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *PcloudVolumeOnboardingPostBadRequest) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *PcloudVolumeOnboardingPostUnauthorized) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *PcloudVolumeOnboardingPostForbidden) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *PcloudVolumeOnboardingPostNotFound) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *PcloudVolumeOnboardingPostConflict) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *PcloudVolumeOnboardingPostInternalServerError) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/p_cloud_volumes_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/p_cloud_volumes_client.go index 219bd859cdc..7528616f05b 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/p_cloud_volumes_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/p_cloud_volumes_client.go @@ -121,7 +121,7 @@ type ClientService interface { PcloudCloudinstancesVolumesFlashCopyMappingsGet gets a list of flashcopy mappings of a given volume */ func (a *Client) PcloudCloudinstancesVolumesFlashCopyMappingsGet(params *PcloudCloudinstancesVolumesFlashCopyMappingsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVolumesFlashCopyMappingsGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudCloudinstancesVolumesFlashCopyMappingsGetParams() } @@ -141,17 +141,22 @@ func (a *Client) PcloudCloudinstancesVolumesFlashCopyMappingsGet(params *PcloudC for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudCloudinstancesVolumesFlashCopyMappingsGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.volumes.FlashCopyMappings.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -160,7 +165,7 @@ func (a *Client) PcloudCloudinstancesVolumesFlashCopyMappingsGet(params *PcloudC PcloudCloudinstancesVolumesActionPost performs an action on a volume */ func (a *Client) PcloudCloudinstancesVolumesActionPost(params *PcloudCloudinstancesVolumesActionPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVolumesActionPostAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudCloudinstancesVolumesActionPostParams() } @@ -180,17 +185,22 @@ func (a *Client) PcloudCloudinstancesVolumesActionPost(params *PcloudCloudinstan for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudCloudinstancesVolumesActionPostAccepted) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.volumes.action.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -199,7 +209,7 @@ func (a *Client) PcloudCloudinstancesVolumesActionPost(params *PcloudCloudinstan PcloudCloudinstancesVolumesDelete deletes a cloud instance volume */ func (a *Client) PcloudCloudinstancesVolumesDelete(params *PcloudCloudinstancesVolumesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVolumesDeleteOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudCloudinstancesVolumesDeleteParams() } @@ -219,17 +229,22 @@ func (a *Client) PcloudCloudinstancesVolumesDelete(params *PcloudCloudinstancesV for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudCloudinstancesVolumesDeleteOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.volumes.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -238,7 +253,7 @@ func (a *Client) PcloudCloudinstancesVolumesDelete(params *PcloudCloudinstancesV PcloudCloudinstancesVolumesGet detaileds info of a volume */ func (a *Client) PcloudCloudinstancesVolumesGet(params *PcloudCloudinstancesVolumesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVolumesGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudCloudinstancesVolumesGetParams() } @@ -258,17 +273,22 @@ func (a *Client) PcloudCloudinstancesVolumesGet(params *PcloudCloudinstancesVolu for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudCloudinstancesVolumesGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.volumes.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -277,7 +297,7 @@ func (a *Client) PcloudCloudinstancesVolumesGet(params *PcloudCloudinstancesVolu PcloudCloudinstancesVolumesGetall lists all volumes for this cloud instance */ func (a *Client) PcloudCloudinstancesVolumesGetall(params *PcloudCloudinstancesVolumesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVolumesGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudCloudinstancesVolumesGetallParams() } @@ -297,17 +317,22 @@ func (a *Client) PcloudCloudinstancesVolumesGetall(params *PcloudCloudinstancesV for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudCloudinstancesVolumesGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.volumes.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -316,7 +341,7 @@ func (a *Client) PcloudCloudinstancesVolumesGetall(params *PcloudCloudinstancesV PcloudCloudinstancesVolumesPost creates a new data volume */ func (a *Client) PcloudCloudinstancesVolumesPost(params *PcloudCloudinstancesVolumesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVolumesPostAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudCloudinstancesVolumesPostParams() } @@ -336,17 +361,22 @@ func (a *Client) PcloudCloudinstancesVolumesPost(params *PcloudCloudinstancesVol for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudCloudinstancesVolumesPostAccepted) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.volumes.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -355,7 +385,7 @@ func (a *Client) PcloudCloudinstancesVolumesPost(params *PcloudCloudinstancesVol PcloudCloudinstancesVolumesPut updates a cloud instance volume */ func (a *Client) PcloudCloudinstancesVolumesPut(params *PcloudCloudinstancesVolumesPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVolumesPutOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudCloudinstancesVolumesPutParams() } @@ -375,17 +405,22 @@ func (a *Client) PcloudCloudinstancesVolumesPut(params *PcloudCloudinstancesVolu for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudCloudinstancesVolumesPutOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.volumes.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -394,7 +429,7 @@ func (a *Client) PcloudCloudinstancesVolumesPut(params *PcloudCloudinstancesVolu PcloudCloudinstancesVolumesRemoteCopyRelationshipGet gets remote copy relationship of a volume */ func (a *Client) PcloudCloudinstancesVolumesRemoteCopyRelationshipGet(params *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVolumesRemoteCopyRelationshipGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudCloudinstancesVolumesRemoteCopyRelationshipGetParams() } @@ -414,17 +449,22 @@ func (a *Client) PcloudCloudinstancesVolumesRemoteCopyRelationshipGet(params *Pc for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudCloudinstancesVolumesRemoteCopyRelationshipGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.cloudinstances.volumes.remoteCopyRelationship.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -433,7 +473,7 @@ func (a *Client) PcloudCloudinstancesVolumesRemoteCopyRelationshipGet(params *Pc PcloudPvminstancesVolumesDelete detaches a volume from a p VM instance */ func (a *Client) PcloudPvminstancesVolumesDelete(params *PcloudPvminstancesVolumesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVolumesDeleteAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudPvminstancesVolumesDeleteParams() } @@ -453,17 +493,22 @@ func (a *Client) PcloudPvminstancesVolumesDelete(params *PcloudPvminstancesVolum for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudPvminstancesVolumesDeleteAccepted) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.volumes.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -472,7 +517,7 @@ func (a *Client) PcloudPvminstancesVolumesDelete(params *PcloudPvminstancesVolum PcloudPvminstancesVolumesGet detaileds info of a volume attached to a p VM instance */ func (a *Client) PcloudPvminstancesVolumesGet(params *PcloudPvminstancesVolumesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVolumesGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudPvminstancesVolumesGetParams() } @@ -492,17 +537,22 @@ func (a *Client) PcloudPvminstancesVolumesGet(params *PcloudPvminstancesVolumesG for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudPvminstancesVolumesGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.volumes.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -511,7 +561,7 @@ func (a *Client) PcloudPvminstancesVolumesGet(params *PcloudPvminstancesVolumesG PcloudPvminstancesVolumesGetall lists all volumes attached to a p VM instance */ func (a *Client) PcloudPvminstancesVolumesGetall(params *PcloudPvminstancesVolumesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVolumesGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudPvminstancesVolumesGetallParams() } @@ -531,17 +581,22 @@ func (a *Client) PcloudPvminstancesVolumesGetall(params *PcloudPvminstancesVolum for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudPvminstancesVolumesGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.volumes.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -554,7 +609,7 @@ func (a *Client) PcloudPvminstancesVolumesGetall(params *PcloudPvminstancesVolum >**Note**: Recommended for attaching data volumes. In the case of VMRM, it is recommended to use the 'Attach all volumes to a PVM instance' API for attaching the first boot volume. */ func (a *Client) PcloudPvminstancesVolumesPost(params *PcloudPvminstancesVolumesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVolumesPostOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudPvminstancesVolumesPostParams() } @@ -574,17 +629,22 @@ func (a *Client) PcloudPvminstancesVolumesPost(params *PcloudPvminstancesVolumes for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudPvminstancesVolumesPostOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.volumes.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -593,7 +653,7 @@ func (a *Client) PcloudPvminstancesVolumesPost(params *PcloudPvminstancesVolumes PcloudPvminstancesVolumesPut updates a volume attached to a p VM instance */ func (a *Client) PcloudPvminstancesVolumesPut(params *PcloudPvminstancesVolumesPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVolumesPutOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudPvminstancesVolumesPutParams() } @@ -613,17 +673,22 @@ func (a *Client) PcloudPvminstancesVolumesPut(params *PcloudPvminstancesVolumesP for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudPvminstancesVolumesPutOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.volumes.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -636,7 +701,7 @@ func (a *Client) PcloudPvminstancesVolumesPut(params *PcloudPvminstancesVolumesP >**Note**: If a non-bootable volume is provided, it will be converted to a bootable volume and then attached. */ func (a *Client) PcloudPvminstancesVolumesSetbootPut(params *PcloudPvminstancesVolumesSetbootPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVolumesSetbootPutOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudPvminstancesVolumesSetbootPutParams() } @@ -656,17 +721,22 @@ func (a *Client) PcloudPvminstancesVolumesSetbootPut(params *PcloudPvminstancesV for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudPvminstancesVolumesSetbootPutOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.pvminstances.volumes.setboot.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -675,7 +745,7 @@ func (a *Client) PcloudPvminstancesVolumesSetbootPut(params *PcloudPvminstancesV PcloudV2PvminstancesVolumesDelete detaches multiple volumes from a p VM instance */ func (a *Client) PcloudV2PvminstancesVolumesDelete(params *PcloudV2PvminstancesVolumesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2PvminstancesVolumesDeleteAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudV2PvminstancesVolumesDeleteParams() } @@ -695,17 +765,22 @@ func (a *Client) PcloudV2PvminstancesVolumesDelete(params *PcloudV2PvminstancesV for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudV2PvminstancesVolumesDeleteAccepted) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.v2.pvminstances.volumes.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -718,7 +793,7 @@ func (a *Client) PcloudV2PvminstancesVolumesDelete(params *PcloudV2PvminstancesV >**Note**: In the case of VMRM, if a single volume ID is provided in the 'volumeIDs' field, that volume will be converted to a bootable volume and then attached. */ func (a *Client) PcloudV2PvminstancesVolumesPost(params *PcloudV2PvminstancesVolumesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2PvminstancesVolumesPostAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudV2PvminstancesVolumesPostParams() } @@ -738,17 +813,22 @@ func (a *Client) PcloudV2PvminstancesVolumesPost(params *PcloudV2PvminstancesVol for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudV2PvminstancesVolumesPostAccepted) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.v2.pvminstances.volumes.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -757,7 +837,7 @@ func (a *Client) PcloudV2PvminstancesVolumesPost(params *PcloudV2PvminstancesVol PcloudV2VolumesClonePost creates a volume clone for specified volumes */ func (a *Client) PcloudV2VolumesClonePost(params *PcloudV2VolumesClonePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumesClonePostAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudV2VolumesClonePostParams() } @@ -777,17 +857,22 @@ func (a *Client) PcloudV2VolumesClonePost(params *PcloudV2VolumesClonePostParams for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudV2VolumesClonePostAccepted) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.v2.volumes.clone.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -796,7 +881,7 @@ func (a *Client) PcloudV2VolumesClonePost(params *PcloudV2VolumesClonePostParams PcloudV2VolumesClonetasksGet gets the status of a volumes clone request for the specified clone task ID */ func (a *Client) PcloudV2VolumesClonetasksGet(params *PcloudV2VolumesClonetasksGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumesClonetasksGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudV2VolumesClonetasksGetParams() } @@ -816,17 +901,22 @@ func (a *Client) PcloudV2VolumesClonetasksGet(params *PcloudV2VolumesClonetasksG for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudV2VolumesClonetasksGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.v2.volumes.clonetasks.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -835,7 +925,7 @@ func (a *Client) PcloudV2VolumesClonetasksGet(params *PcloudV2VolumesClonetasksG PcloudV2VolumesDelete deletes all volumes */ func (a *Client) PcloudV2VolumesDelete(params *PcloudV2VolumesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumesDeleteAccepted, *PcloudV2VolumesDeletePartialContent, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudV2VolumesDeleteParams() } @@ -855,18 +945,22 @@ func (a *Client) PcloudV2VolumesDelete(params *PcloudV2VolumesDeleteParams, auth for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } + + // several success responses have to be checked switch value := result.(type) { case *PcloudV2VolumesDeleteAccepted: return value, nil, nil case *PcloudV2VolumesDeletePartialContent: return nil, value, nil } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for p_cloud_volumes: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -875,7 +969,7 @@ func (a *Client) PcloudV2VolumesDelete(params *PcloudV2VolumesDeleteParams, auth PcloudV2VolumesGetall lists specified volumes for this cloud instance */ func (a *Client) PcloudV2VolumesGetall(params *PcloudV2VolumesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumesGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudV2VolumesGetallParams() } @@ -895,17 +989,22 @@ func (a *Client) PcloudV2VolumesGetall(params *PcloudV2VolumesGetallParams, auth for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudV2VolumesGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.v2.volumes.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -914,7 +1013,7 @@ func (a *Client) PcloudV2VolumesGetall(params *PcloudV2VolumesGetallParams, auth PcloudV2VolumesPost creates multiple data volumes from a single definition */ func (a *Client) PcloudV2VolumesPost(params *PcloudV2VolumesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumesPostCreated, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudV2VolumesPostParams() } @@ -934,17 +1033,22 @@ func (a *Client) PcloudV2VolumesPost(params *PcloudV2VolumesPostParams, authInfo for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudV2VolumesPostCreated) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.v2.volumes.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -955,7 +1059,7 @@ PcloudV2VolumescloneCancelPost cancels a volumes clone request Initiates the cleanup action that performs the cleanup of the preparatory clones and snapshot volumes. */ func (a *Client) PcloudV2VolumescloneCancelPost(params *PcloudV2VolumescloneCancelPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumescloneCancelPostAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudV2VolumescloneCancelPostParams() } @@ -975,17 +1079,22 @@ func (a *Client) PcloudV2VolumescloneCancelPost(params *PcloudV2VolumescloneCanc for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudV2VolumescloneCancelPostAccepted) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.v2.volumesclone.cancel.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -994,7 +1103,7 @@ func (a *Client) PcloudV2VolumescloneCancelPost(params *PcloudV2VolumescloneCanc PcloudV2VolumescloneDelete deletes a volumes clone request */ func (a *Client) PcloudV2VolumescloneDelete(params *PcloudV2VolumescloneDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumescloneDeleteOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudV2VolumescloneDeleteParams() } @@ -1014,17 +1123,22 @@ func (a *Client) PcloudV2VolumescloneDelete(params *PcloudV2VolumescloneDeletePa for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudV2VolumescloneDeleteOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.v2.volumesclone.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -1035,7 +1149,7 @@ PcloudV2VolumescloneExecutePost initiates the execute action for a volumes clone Execute action creates the cloned volumes using the volume snapshots. */ func (a *Client) PcloudV2VolumescloneExecutePost(params *PcloudV2VolumescloneExecutePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumescloneExecutePostAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudV2VolumescloneExecutePostParams() } @@ -1055,17 +1169,22 @@ func (a *Client) PcloudV2VolumescloneExecutePost(params *PcloudV2VolumescloneExe for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudV2VolumescloneExecutePostAccepted) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.v2.volumesclone.execute.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -1074,7 +1193,7 @@ func (a *Client) PcloudV2VolumescloneExecutePost(params *PcloudV2VolumescloneExe PcloudV2VolumescloneGet gets the details for a volumes clone request */ func (a *Client) PcloudV2VolumescloneGet(params *PcloudV2VolumescloneGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumescloneGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudV2VolumescloneGetParams() } @@ -1094,17 +1213,22 @@ func (a *Client) PcloudV2VolumescloneGet(params *PcloudV2VolumescloneGetParams, for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudV2VolumescloneGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.v2.volumesclone.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -1113,7 +1237,7 @@ func (a *Client) PcloudV2VolumescloneGet(params *PcloudV2VolumescloneGetParams, PcloudV2VolumescloneGetall gets the list of volumes clone request for a cloud instance */ func (a *Client) PcloudV2VolumescloneGetall(params *PcloudV2VolumescloneGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumescloneGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudV2VolumescloneGetallParams() } @@ -1133,17 +1257,22 @@ func (a *Client) PcloudV2VolumescloneGetall(params *PcloudV2VolumescloneGetallPa for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudV2VolumescloneGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.v2.volumesclone.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -1159,7 +1288,7 @@ Prepare action does the preparatory work for creating the snapshot volumes. >**Note**: If there is an existing prepare, user cannot trigger another prepare for the same set of volumes. Prepare should be followed by start and execute. If existing prepare does not have to be used then it should be first cancelled before the next prepare operation. */ func (a *Client) PcloudV2VolumesclonePost(params *PcloudV2VolumesclonePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumesclonePostAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudV2VolumesclonePostParams() } @@ -1179,17 +1308,22 @@ func (a *Client) PcloudV2VolumesclonePost(params *PcloudV2VolumesclonePostParams for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudV2VolumesclonePostAccepted) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.v2.volumesclone.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -1200,7 +1334,7 @@ PcloudV2VolumescloneStartPost initiates the start action for a volumes clone req Start action starts the consistency group to initiate the flash copy. */ func (a *Client) PcloudV2VolumescloneStartPost(params *PcloudV2VolumescloneStartPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2VolumescloneStartPostOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudV2VolumescloneStartPostParams() } @@ -1220,17 +1354,22 @@ func (a *Client) PcloudV2VolumescloneStartPost(params *PcloudV2VolumescloneStart for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudV2VolumescloneStartPostOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.v2.volumesclone.start.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -1243,7 +1382,7 @@ func (a *Client) PcloudV2VolumescloneStartPost(params *PcloudV2VolumescloneStart >*Note*: Support for this API will be available till 31st March 2023. */ func (a *Client) PcloudVolumesClonePost(params *PcloudVolumesClonePostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumesClonePostOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewPcloudVolumesClonePostParams() } @@ -1263,17 +1402,22 @@ func (a *Client) PcloudVolumesClonePost(params *PcloudVolumesClonePostParams, au for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*PcloudVolumesClonePostOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for pcloud.volumes.clone.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_action_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_action_post_responses.go index 6be188ce32a..4f2489cc4e0 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_action_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_action_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_volumes import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudCloudinstancesVolumesActionPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesVolumesActionPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudCloudinstancesVolumesActionPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 202: result := NewPcloudCloudinstancesVolumesActionPostAccepted() @@ -132,7 +133,7 @@ func (o *PcloudCloudinstancesVolumesActionPostAccepted) GetPayload() models.Obje func (o *PcloudCloudinstancesVolumesActionPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -202,7 +203,7 @@ func (o *PcloudCloudinstancesVolumesActionPostBadRequest) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -272,7 +273,7 @@ func (o *PcloudCloudinstancesVolumesActionPostUnauthorized) readResponse(respons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -342,7 +343,7 @@ func (o *PcloudCloudinstancesVolumesActionPostForbidden) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -412,7 +413,7 @@ func (o *PcloudCloudinstancesVolumesActionPostNotFound) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -482,7 +483,7 @@ func (o *PcloudCloudinstancesVolumesActionPostConflict) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -552,7 +553,7 @@ func (o *PcloudCloudinstancesVolumesActionPostInternalServerError) readResponse( o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_delete_responses.go index 55000c6077d..e10fa3cc40a 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_delete_responses.go @@ -7,6 +7,7 @@ package p_cloud_volumes import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudCloudinstancesVolumesDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesVolumesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudCloudinstancesVolumesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudCloudinstancesVolumesDeleteOK() @@ -132,7 +133,7 @@ func (o *PcloudCloudinstancesVolumesDeleteOK) GetPayload() models.Object { func (o *PcloudCloudinstancesVolumesDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -202,7 +203,7 @@ func (o *PcloudCloudinstancesVolumesDeleteBadRequest) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -272,7 +273,7 @@ func (o *PcloudCloudinstancesVolumesDeleteUnauthorized) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -342,7 +343,7 @@ func (o *PcloudCloudinstancesVolumesDeleteForbidden) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -412,7 +413,7 @@ func (o *PcloudCloudinstancesVolumesDeleteNotFound) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -482,7 +483,7 @@ func (o *PcloudCloudinstancesVolumesDeleteGone) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -552,7 +553,7 @@ func (o *PcloudCloudinstancesVolumesDeleteInternalServerError) readResponse(resp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_flash_copy_mappings_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_flash_copy_mappings_get_responses.go index 150b2a2cfd5..aa5bab2b9f4 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_flash_copy_mappings_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_flash_copy_mappings_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_volumes import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudCloudinstancesVolumesFlashCopyMappingsGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudCloudinstancesVolumesFlashCopyMappingsGetOK() @@ -132,7 +133,7 @@ func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetOK) GetPayload() models. func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -202,7 +203,7 @@ func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetBadRequest) readResponse o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -272,7 +273,7 @@ func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetUnauthorized) readRespon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -342,7 +343,7 @@ func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetForbidden) readResponse( o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -412,7 +413,7 @@ func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetNotFound) readResponse(r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -482,7 +483,7 @@ func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetTooManyRequests) readRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -552,7 +553,7 @@ func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetInternalServerError) rea o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_get_responses.go index 7bbc8dda0bd..de5be37b5ac 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_volumes import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudCloudinstancesVolumesGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesVolumesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudCloudinstancesVolumesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudCloudinstancesVolumesGetOK() @@ -128,7 +129,7 @@ func (o *PcloudCloudinstancesVolumesGetOK) readResponse(response runtime.ClientR o.Payload = new(models.Volume) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudCloudinstancesVolumesGetBadRequest) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudCloudinstancesVolumesGetUnauthorized) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudCloudinstancesVolumesGetForbidden) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudCloudinstancesVolumesGetNotFound) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudCloudinstancesVolumesGetInternalServerError) readResponse(respons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_getall_responses.go index 82c90d1ca4c..9749ff72533 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_getall_responses.go @@ -7,6 +7,7 @@ package p_cloud_volumes import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudCloudinstancesVolumesGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesVolumesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudCloudinstancesVolumesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudCloudinstancesVolumesGetallOK() @@ -128,7 +129,7 @@ func (o *PcloudCloudinstancesVolumesGetallOK) readResponse(response runtime.Clie o.Payload = new(models.Volumes) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudCloudinstancesVolumesGetallBadRequest) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudCloudinstancesVolumesGetallUnauthorized) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudCloudinstancesVolumesGetallForbidden) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudCloudinstancesVolumesGetallNotFound) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudCloudinstancesVolumesGetallInternalServerError) readResponse(resp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_post_responses.go index 907ef6189c2..bf322ffc3ea 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_volumes import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudCloudinstancesVolumesPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesVolumesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudCloudinstancesVolumesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 202: result := NewPcloudCloudinstancesVolumesPostAccepted() @@ -140,7 +141,7 @@ func (o *PcloudCloudinstancesVolumesPostAccepted) readResponse(response runtime. o.Payload = new(models.Volume) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -210,7 +211,7 @@ func (o *PcloudCloudinstancesVolumesPostBadRequest) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -280,7 +281,7 @@ func (o *PcloudCloudinstancesVolumesPostUnauthorized) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -350,7 +351,7 @@ func (o *PcloudCloudinstancesVolumesPostForbidden) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -420,7 +421,7 @@ func (o *PcloudCloudinstancesVolumesPostNotFound) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -490,7 +491,7 @@ func (o *PcloudCloudinstancesVolumesPostConflict) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -560,7 +561,7 @@ func (o *PcloudCloudinstancesVolumesPostUnprocessableEntity) readResponse(respon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -630,7 +631,7 @@ func (o *PcloudCloudinstancesVolumesPostInternalServerError) readResponse(respon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_put_responses.go index ae40c474b13..c584dfefa11 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_put_responses.go @@ -7,6 +7,7 @@ package p_cloud_volumes import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudCloudinstancesVolumesPutReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesVolumesPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudCloudinstancesVolumesPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudCloudinstancesVolumesPutOK() @@ -140,7 +141,7 @@ func (o *PcloudCloudinstancesVolumesPutOK) readResponse(response runtime.ClientR o.Payload = new(models.Volume) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -210,7 +211,7 @@ func (o *PcloudCloudinstancesVolumesPutBadRequest) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -280,7 +281,7 @@ func (o *PcloudCloudinstancesVolumesPutUnauthorized) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -350,7 +351,7 @@ func (o *PcloudCloudinstancesVolumesPutForbidden) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -420,7 +421,7 @@ func (o *PcloudCloudinstancesVolumesPutNotFound) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -490,7 +491,7 @@ func (o *PcloudCloudinstancesVolumesPutConflict) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -560,7 +561,7 @@ func (o *PcloudCloudinstancesVolumesPutUnprocessableEntity) readResponse(respons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -630,7 +631,7 @@ func (o *PcloudCloudinstancesVolumesPutInternalServerError) readResponse(respons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_remote_copy_relationship_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_remote_copy_relationship_get_responses.go index 4ff6389310e..1543888202c 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_remote_copy_relationship_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_remote_copy_relationship_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_volumes import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudCloudinstancesVolumesRemoteCopyRelationshipGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudCloudinstancesVolumesRemoteCopyRelationshipGetOK() @@ -134,7 +135,7 @@ func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetOK) readResponse(re o.Payload = new(models.VolumeRemoteCopyRelationship) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetBadRequest) readRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetUnauthorized) readR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetForbidden) readResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetNotFound) readRespo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetTooManyRequests) re o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetInternalServerError o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_delete_responses.go index b29535e9f54..159e389bddd 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_delete_responses.go @@ -7,6 +7,7 @@ package p_cloud_volumes import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudPvminstancesVolumesDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesVolumesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudPvminstancesVolumesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 202: result := NewPcloudPvminstancesVolumesDeleteAccepted() @@ -79,7 +80,7 @@ func NewPcloudPvminstancesVolumesDeleteAccepted() *PcloudPvminstancesVolumesDele /* PcloudPvminstancesVolumesDeleteAccepted describes a response with status code 202, with default header values. -OK +Accepted */ type PcloudPvminstancesVolumesDeleteAccepted struct { Payload models.Object @@ -132,7 +133,7 @@ func (o *PcloudPvminstancesVolumesDeleteAccepted) GetPayload() models.Object { func (o *PcloudPvminstancesVolumesDeleteAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -202,7 +203,7 @@ func (o *PcloudPvminstancesVolumesDeleteBadRequest) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -272,7 +273,7 @@ func (o *PcloudPvminstancesVolumesDeleteUnauthorized) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -342,7 +343,7 @@ func (o *PcloudPvminstancesVolumesDeleteForbidden) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -412,7 +413,7 @@ func (o *PcloudPvminstancesVolumesDeleteNotFound) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -482,7 +483,7 @@ func (o *PcloudPvminstancesVolumesDeleteConflict) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -552,7 +553,7 @@ func (o *PcloudPvminstancesVolumesDeleteInternalServerError) readResponse(respon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_get_responses.go index c495c925081..234c36cfc28 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_volumes import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudPvminstancesVolumesGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesVolumesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudPvminstancesVolumesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudPvminstancesVolumesGetOK() @@ -128,7 +129,7 @@ func (o *PcloudPvminstancesVolumesGetOK) readResponse(response runtime.ClientRes o.Payload = new(models.Volume) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudPvminstancesVolumesGetBadRequest) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudPvminstancesVolumesGetUnauthorized) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudPvminstancesVolumesGetForbidden) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudPvminstancesVolumesGetNotFound) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudPvminstancesVolumesGetInternalServerError) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_getall_responses.go index d81c92f572b..65904726c58 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_getall_responses.go @@ -7,6 +7,7 @@ package p_cloud_volumes import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudPvminstancesVolumesGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesVolumesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudPvminstancesVolumesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudPvminstancesVolumesGetallOK() @@ -128,7 +129,7 @@ func (o *PcloudPvminstancesVolumesGetallOK) readResponse(response runtime.Client o.Payload = new(models.Volumes) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudPvminstancesVolumesGetallBadRequest) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudPvminstancesVolumesGetallUnauthorized) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudPvminstancesVolumesGetallForbidden) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudPvminstancesVolumesGetallNotFound) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudPvminstancesVolumesGetallInternalServerError) readResponse(respon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_post_responses.go index add3acdaf9a..702a6c36c1f 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_volumes import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudPvminstancesVolumesPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesVolumesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudPvminstancesVolumesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudPvminstancesVolumesPostOK() @@ -132,7 +133,7 @@ func (o *PcloudPvminstancesVolumesPostOK) GetPayload() models.Object { func (o *PcloudPvminstancesVolumesPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -202,7 +203,7 @@ func (o *PcloudPvminstancesVolumesPostBadRequest) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -272,7 +273,7 @@ func (o *PcloudPvminstancesVolumesPostUnauthorized) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -342,7 +343,7 @@ func (o *PcloudPvminstancesVolumesPostForbidden) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -412,7 +413,7 @@ func (o *PcloudPvminstancesVolumesPostNotFound) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -482,7 +483,7 @@ func (o *PcloudPvminstancesVolumesPostConflict) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -552,7 +553,7 @@ func (o *PcloudPvminstancesVolumesPostInternalServerError) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_put_responses.go index 15c63425f88..288d200e19c 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_put_responses.go @@ -7,6 +7,7 @@ package p_cloud_volumes import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudPvminstancesVolumesPutReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesVolumesPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudPvminstancesVolumesPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudPvminstancesVolumesPutOK() @@ -132,7 +133,7 @@ func (o *PcloudPvminstancesVolumesPutOK) GetPayload() models.Object { func (o *PcloudPvminstancesVolumesPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -202,7 +203,7 @@ func (o *PcloudPvminstancesVolumesPutBadRequest) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -272,7 +273,7 @@ func (o *PcloudPvminstancesVolumesPutUnauthorized) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -342,7 +343,7 @@ func (o *PcloudPvminstancesVolumesPutForbidden) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -412,7 +413,7 @@ func (o *PcloudPvminstancesVolumesPutNotFound) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -482,7 +483,7 @@ func (o *PcloudPvminstancesVolumesPutConflict) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -552,7 +553,7 @@ func (o *PcloudPvminstancesVolumesPutInternalServerError) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_setboot_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_setboot_put_responses.go index b05f294527e..5c5287ff767 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_setboot_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_setboot_put_responses.go @@ -7,6 +7,7 @@ package p_cloud_volumes import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudPvminstancesVolumesSetbootPutReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudPvminstancesVolumesSetbootPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudPvminstancesVolumesSetbootPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudPvminstancesVolumesSetbootPutOK() @@ -132,7 +133,7 @@ func (o *PcloudPvminstancesVolumesSetbootPutOK) GetPayload() models.Object { func (o *PcloudPvminstancesVolumesSetbootPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -202,7 +203,7 @@ func (o *PcloudPvminstancesVolumesSetbootPutBadRequest) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -272,7 +273,7 @@ func (o *PcloudPvminstancesVolumesSetbootPutUnauthorized) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -342,7 +343,7 @@ func (o *PcloudPvminstancesVolumesSetbootPutForbidden) readResponse(response run o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -412,7 +413,7 @@ func (o *PcloudPvminstancesVolumesSetbootPutNotFound) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -482,7 +483,7 @@ func (o *PcloudPvminstancesVolumesSetbootPutConflict) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -552,7 +553,7 @@ func (o *PcloudPvminstancesVolumesSetbootPutInternalServerError) readResponse(re o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_pvminstances_volumes_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_pvminstances_volumes_delete_responses.go index 21ab22789ce..7a772f6cf7d 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_pvminstances_volumes_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_pvminstances_volumes_delete_responses.go @@ -7,6 +7,7 @@ package p_cloud_volumes import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudV2PvminstancesVolumesDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudV2PvminstancesVolumesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudV2PvminstancesVolumesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 202: result := NewPcloudV2PvminstancesVolumesDeleteAccepted() @@ -134,7 +135,7 @@ func (o *PcloudV2PvminstancesVolumesDeleteAccepted) readResponse(response runtim o.Payload = new(models.VolumesDetachmentResponse) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *PcloudV2PvminstancesVolumesDeleteBadRequest) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *PcloudV2PvminstancesVolumesDeleteUnauthorized) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *PcloudV2PvminstancesVolumesDeleteForbidden) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *PcloudV2PvminstancesVolumesDeleteNotFound) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *PcloudV2PvminstancesVolumesDeleteConflict) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *PcloudV2PvminstancesVolumesDeleteInternalServerError) readResponse(resp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_pvminstances_volumes_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_pvminstances_volumes_post_responses.go index 4ead42953f5..7e680e74006 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_pvminstances_volumes_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_pvminstances_volumes_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_volumes import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudV2PvminstancesVolumesPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudV2PvminstancesVolumesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudV2PvminstancesVolumesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 202: result := NewPcloudV2PvminstancesVolumesPostAccepted() @@ -134,7 +135,7 @@ func (o *PcloudV2PvminstancesVolumesPostAccepted) readResponse(response runtime. o.Payload = new(models.VolumesAttachmentResponse) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *PcloudV2PvminstancesVolumesPostBadRequest) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *PcloudV2PvminstancesVolumesPostUnauthorized) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *PcloudV2PvminstancesVolumesPostForbidden) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *PcloudV2PvminstancesVolumesPostNotFound) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *PcloudV2PvminstancesVolumesPostConflict) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *PcloudV2PvminstancesVolumesPostInternalServerError) readResponse(respon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_clone_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_clone_post_responses.go index 96c73c807f2..eddcd7a3d04 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_clone_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_clone_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_volumes import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudV2VolumesClonePostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudV2VolumesClonePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudV2VolumesClonePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 202: result := NewPcloudV2VolumesClonePostAccepted() @@ -134,7 +135,7 @@ func (o *PcloudV2VolumesClonePostAccepted) readResponse(response runtime.ClientR o.Payload = new(models.CloneTaskReference) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *PcloudV2VolumesClonePostBadRequest) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *PcloudV2VolumesClonePostUnauthorized) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *PcloudV2VolumesClonePostForbidden) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *PcloudV2VolumesClonePostNotFound) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *PcloudV2VolumesClonePostConflict) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *PcloudV2VolumesClonePostInternalServerError) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_clonetasks_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_clonetasks_get_responses.go index 1efc53ca789..16d43dc3f68 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_clonetasks_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_clonetasks_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_volumes import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudV2VolumesClonetasksGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudV2VolumesClonetasksGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudV2VolumesClonetasksGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudV2VolumesClonetasksGetOK() @@ -134,7 +135,7 @@ func (o *PcloudV2VolumesClonetasksGetOK) readResponse(response runtime.ClientRes o.Payload = new(models.CloneTaskStatus) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *PcloudV2VolumesClonetasksGetBadRequest) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *PcloudV2VolumesClonetasksGetUnauthorized) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *PcloudV2VolumesClonetasksGetForbidden) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *PcloudV2VolumesClonetasksGetNotFound) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *PcloudV2VolumesClonetasksGetConflict) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *PcloudV2VolumesClonetasksGetInternalServerError) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_delete_responses.go index 822c9e957bf..f766ea00d8d 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_delete_responses.go @@ -7,6 +7,7 @@ package p_cloud_volumes import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudV2VolumesDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudV2VolumesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudV2VolumesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 202: result := NewPcloudV2VolumesDeleteAccepted() @@ -140,7 +141,7 @@ func (o *PcloudV2VolumesDeleteAccepted) readResponse(response runtime.ClientResp o.Payload = new(models.VolumesDeleteResponse) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -210,7 +211,7 @@ func (o *PcloudV2VolumesDeletePartialContent) readResponse(response runtime.Clie o.Payload = new(models.VolumesDeleteResponse) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -280,7 +281,7 @@ func (o *PcloudV2VolumesDeleteBadRequest) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -350,7 +351,7 @@ func (o *PcloudV2VolumesDeleteUnauthorized) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -420,7 +421,7 @@ func (o *PcloudV2VolumesDeleteNotFound) readResponse(response runtime.ClientResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -490,7 +491,7 @@ func (o *PcloudV2VolumesDeleteRequestTimeout) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -560,7 +561,7 @@ func (o *PcloudV2VolumesDeleteTooManyRequests) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -630,7 +631,7 @@ func (o *PcloudV2VolumesDeleteInternalServerError) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_getall_responses.go index 8d2120b5cd7..785cc8532ec 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_getall_responses.go @@ -7,6 +7,7 @@ package p_cloud_volumes import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudV2VolumesGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudV2VolumesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudV2VolumesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudV2VolumesGetallOK() @@ -128,7 +129,7 @@ func (o *PcloudV2VolumesGetallOK) readResponse(response runtime.ClientResponse, o.Payload = new(models.Volumes) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudV2VolumesGetallBadRequest) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudV2VolumesGetallUnauthorized) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudV2VolumesGetallForbidden) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudV2VolumesGetallNotFound) readResponse(response runtime.ClientResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudV2VolumesGetallInternalServerError) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_post_responses.go index 6febceb288a..1b2e4be249b 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumes_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_volumes import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudV2VolumesPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudV2VolumesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudV2VolumesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 201: result := NewPcloudV2VolumesPostCreated() @@ -140,7 +141,7 @@ func (o *PcloudV2VolumesPostCreated) readResponse(response runtime.ClientRespons o.Payload = new(models.Volumes) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -210,7 +211,7 @@ func (o *PcloudV2VolumesPostBadRequest) readResponse(response runtime.ClientResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -280,7 +281,7 @@ func (o *PcloudV2VolumesPostUnauthorized) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -350,7 +351,7 @@ func (o *PcloudV2VolumesPostForbidden) readResponse(response runtime.ClientRespo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -420,7 +421,7 @@ func (o *PcloudV2VolumesPostNotFound) readResponse(response runtime.ClientRespon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -490,7 +491,7 @@ func (o *PcloudV2VolumesPostConflict) readResponse(response runtime.ClientRespon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -560,7 +561,7 @@ func (o *PcloudV2VolumesPostUnprocessableEntity) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -630,7 +631,7 @@ func (o *PcloudV2VolumesPostInternalServerError) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_cancel_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_cancel_post_responses.go index 0ed0b8061cf..1569e873e8b 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_cancel_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_cancel_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_volumes import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudV2VolumescloneCancelPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudV2VolumescloneCancelPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudV2VolumescloneCancelPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 202: result := NewPcloudV2VolumescloneCancelPostAccepted() @@ -128,7 +129,7 @@ func (o *PcloudV2VolumescloneCancelPostAccepted) readResponse(response runtime.C o.Payload = new(models.VolumesClone) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudV2VolumescloneCancelPostBadRequest) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudV2VolumescloneCancelPostUnauthorized) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudV2VolumescloneCancelPostForbidden) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudV2VolumescloneCancelPostNotFound) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudV2VolumescloneCancelPostInternalServerError) readResponse(respons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_delete_responses.go index b5ca513a991..1b527e1655e 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_delete_responses.go @@ -7,6 +7,7 @@ package p_cloud_volumes import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudV2VolumescloneDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudV2VolumescloneDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudV2VolumescloneDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudV2VolumescloneDeleteOK() @@ -126,7 +127,7 @@ func (o *PcloudV2VolumescloneDeleteOK) GetPayload() models.Object { func (o *PcloudV2VolumescloneDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -196,7 +197,7 @@ func (o *PcloudV2VolumescloneDeleteBadRequest) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -266,7 +267,7 @@ func (o *PcloudV2VolumescloneDeleteUnauthorized) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -336,7 +337,7 @@ func (o *PcloudV2VolumescloneDeleteForbidden) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -406,7 +407,7 @@ func (o *PcloudV2VolumescloneDeleteNotFound) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -476,7 +477,7 @@ func (o *PcloudV2VolumescloneDeleteInternalServerError) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_execute_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_execute_post_responses.go index 0d09798c039..bd346393358 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_execute_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_execute_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_volumes import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudV2VolumescloneExecutePostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudV2VolumescloneExecutePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudV2VolumescloneExecutePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 202: result := NewPcloudV2VolumescloneExecutePostAccepted() @@ -128,7 +129,7 @@ func (o *PcloudV2VolumescloneExecutePostAccepted) readResponse(response runtime. o.Payload = new(models.VolumesClone) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudV2VolumescloneExecutePostBadRequest) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudV2VolumescloneExecutePostUnauthorized) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudV2VolumescloneExecutePostForbidden) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudV2VolumescloneExecutePostNotFound) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudV2VolumescloneExecutePostInternalServerError) readResponse(respon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_get_responses.go index 04f093c8534..2b2e42619e3 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_get_responses.go @@ -7,6 +7,7 @@ package p_cloud_volumes import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudV2VolumescloneGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudV2VolumescloneGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudV2VolumescloneGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudV2VolumescloneGetOK() @@ -128,7 +129,7 @@ func (o *PcloudV2VolumescloneGetOK) readResponse(response runtime.ClientResponse o.Payload = new(models.VolumesCloneDetail) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudV2VolumescloneGetBadRequest) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudV2VolumescloneGetUnauthorized) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudV2VolumescloneGetForbidden) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudV2VolumescloneGetNotFound) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudV2VolumescloneGetInternalServerError) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_getall_responses.go index a7317a2a112..1b6d348d568 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_getall_responses.go @@ -7,6 +7,7 @@ package p_cloud_volumes import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudV2VolumescloneGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudV2VolumescloneGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudV2VolumescloneGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudV2VolumescloneGetallOK() @@ -128,7 +129,7 @@ func (o *PcloudV2VolumescloneGetallOK) readResponse(response runtime.ClientRespo o.Payload = new(models.VolumesClones) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudV2VolumescloneGetallBadRequest) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudV2VolumescloneGetallUnauthorized) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudV2VolumescloneGetallForbidden) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudV2VolumescloneGetallNotFound) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudV2VolumescloneGetallInternalServerError) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_post_responses.go index 97ccfd7f955..661321bd0b0 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_volumes import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudV2VolumesclonePostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudV2VolumesclonePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudV2VolumesclonePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 202: result := NewPcloudV2VolumesclonePostAccepted() @@ -134,7 +135,7 @@ func (o *PcloudV2VolumesclonePostAccepted) readResponse(response runtime.ClientR o.Payload = new(models.VolumesClone) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *PcloudV2VolumesclonePostBadRequest) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *PcloudV2VolumesclonePostUnauthorized) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *PcloudV2VolumesclonePostForbidden) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *PcloudV2VolumesclonePostNotFound) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *PcloudV2VolumesclonePostConflict) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *PcloudV2VolumesclonePostInternalServerError) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_start_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_start_post_responses.go index 1af5ddc5e40..a874d261ceb 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_start_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_v2_volumesclone_start_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_volumes import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudV2VolumescloneStartPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudV2VolumescloneStartPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudV2VolumescloneStartPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudV2VolumescloneStartPostOK() @@ -128,7 +129,7 @@ func (o *PcloudV2VolumescloneStartPostOK) readResponse(response runtime.ClientRe o.Payload = new(models.VolumesClone) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *PcloudV2VolumescloneStartPostBadRequest) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *PcloudV2VolumescloneStartPostUnauthorized) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *PcloudV2VolumescloneStartPostForbidden) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *PcloudV2VolumescloneStartPostNotFound) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *PcloudV2VolumescloneStartPostInternalServerError) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_volumes_clone_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_volumes_clone_post_responses.go index bb5b118c85f..2de700fcfe9 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_volumes_clone_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_volumes/pcloud_volumes_clone_post_responses.go @@ -7,6 +7,7 @@ package p_cloud_volumes import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type PcloudVolumesClonePostReader struct { } // ReadResponse reads a server response into the received o. -func (o *PcloudVolumesClonePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *PcloudVolumesClonePostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewPcloudVolumesClonePostOK() @@ -134,7 +135,7 @@ func (o *PcloudVolumesClonePostOK) readResponse(response runtime.ClientResponse, o.Payload = new(models.VolumesCloneResponse) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *PcloudVolumesClonePostBadRequest) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *PcloudVolumesClonePostUnauthorized) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *PcloudVolumesClonePostForbidden) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *PcloudVolumesClonePostNotFound) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *PcloudVolumesClonePostConflict) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *PcloudVolumesClonePostInternalServerError) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/power_edge_router/power_edge_router_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/power_edge_router/power_edge_router_client.go index 67f3b9c7a9d..f6db763607c 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/power_edge_router/power_edge_router_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/power_edge_router/power_edge_router_client.go @@ -65,7 +65,7 @@ type ClientService interface { V1PoweredgerouterActionPost performs a power edge router action migrate start migrate validate on a workspace */ func (a *Client) V1PoweredgerouterActionPost(params *V1PoweredgerouterActionPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1PoweredgerouterActionPostOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1PoweredgerouterActionPostParams() } @@ -85,17 +85,22 @@ func (a *Client) V1PoweredgerouterActionPost(params *V1PoweredgerouterActionPost for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1PoweredgerouterActionPostOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.poweredgerouter.action.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/power_edge_router/v1_poweredgerouter_action_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/power_edge_router/v1_poweredgerouter_action_post_responses.go index 625910f4cf7..2b784462db8 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/power_edge_router/v1_poweredgerouter_action_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/power_edge_router/v1_poweredgerouter_action_post_responses.go @@ -7,6 +7,7 @@ package power_edge_router import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1PoweredgerouterActionPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1PoweredgerouterActionPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1PoweredgerouterActionPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1PoweredgerouterActionPostOK() @@ -132,7 +133,7 @@ func (o *V1PoweredgerouterActionPostOK) GetPayload() models.Object { func (o *V1PoweredgerouterActionPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -202,7 +203,7 @@ func (o *V1PoweredgerouterActionPostBadRequest) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -272,7 +273,7 @@ func (o *V1PoweredgerouterActionPostUnauthorized) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -342,7 +343,7 @@ func (o *V1PoweredgerouterActionPostForbidden) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -412,7 +413,7 @@ func (o *V1PoweredgerouterActionPostNotFound) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -482,7 +483,7 @@ func (o *V1PoweredgerouterActionPostConflict) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -552,7 +553,7 @@ func (o *V1PoweredgerouterActionPostInternalServerError) readResponse(response r o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/power_iaas_api_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/power_iaas_api_client.go index a637694abf9..c0e1829eb98 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/power_iaas_api_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/power_iaas_api_client.go @@ -17,6 +17,7 @@ import ( "github.com/IBM-Cloud/power-go-client/power/client/hardware_platforms" "github.com/IBM-Cloud/power-go-client/power/client/host_groups" "github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker" + "github.com/IBM-Cloud/power-go-client/power/client/internal_capacity_management" "github.com/IBM-Cloud/power-go-client/power/client/internal_operations_dedicated_hosts" "github.com/IBM-Cloud/power-go-client/power/client/internal_operations_images" "github.com/IBM-Cloud/power-go-client/power/client/internal_operations_network_address_groups" @@ -26,6 +27,7 @@ import ( "github.com/IBM-Cloud/power-go-client/power/client/internal_operations_pvm_instances" "github.com/IBM-Cloud/power-go-client/power/client/internal_operations_shared_processor_pools" "github.com/IBM-Cloud/power-go-client/power/client/internal_operations_snapshots" + "github.com/IBM-Cloud/power-go-client/power/client/internal_operations_v_p_mem_volumes" "github.com/IBM-Cloud/power-go-client/power/client/internal_operations_volumes" "github.com/IBM-Cloud/power-go-client/power/client/internal_power_v_s_instances" "github.com/IBM-Cloud/power-go-client/power/client/internal_power_v_s_locations" @@ -57,6 +59,7 @@ import ( "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tasks" "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants" "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_tenants_ssh_keys" + "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_mem_volumes" "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_connections" "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_v_p_n_policies" "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_virtual_serial_number" @@ -123,6 +126,7 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *PowerIaasA cli.HardwarePlatforms = hardware_platforms.New(transport, formats) cli.HostGroups = host_groups.New(transport, formats) cli.IaasServiceBroker = iaas_service_broker.New(transport, formats) + cli.InternalCapacityManagement = internal_capacity_management.New(transport, formats) cli.InternalOperationsDedicatedHosts = internal_operations_dedicated_hosts.New(transport, formats) cli.InternalOperationsImages = internal_operations_images.New(transport, formats) cli.InternalOperationsNetworkAddressGroups = internal_operations_network_address_groups.New(transport, formats) @@ -132,6 +136,7 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *PowerIaasA cli.InternalOperationsPvmInstances = internal_operations_pvm_instances.New(transport, formats) cli.InternalOperationsSharedProcessorPools = internal_operations_shared_processor_pools.New(transport, formats) cli.InternalOperationsSnapshots = internal_operations_snapshots.New(transport, formats) + cli.InternalOperationsvpMemVolumes = internal_operations_v_p_mem_volumes.New(transport, formats) cli.InternalOperationsVolumes = internal_operations_volumes.New(transport, formats) cli.InternalPowervsInstances = internal_power_v_s_instances.New(transport, formats) cli.InternalPowervsLocations = internal_power_v_s_locations.New(transport, formats) @@ -163,6 +168,7 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *PowerIaasA cli.PCloudTasks = p_cloud_tasks.New(transport, formats) cli.PCloudTenants = p_cloud_tenants.New(transport, formats) cli.PCloudTenantsSSHKeys = p_cloud_tenants_ssh_keys.New(transport, formats) + cli.PCloudvpMemVolumes = p_cloud_v_p_mem_volumes.New(transport, formats) cli.PCloudvpnConnections = p_cloud_v_p_n_connections.New(transport, formats) cli.PCloudvpnPolicies = p_cloud_v_p_n_policies.New(transport, formats) cli.PCloudVirtualSerialNumber = p_cloud_virtual_serial_number.New(transport, formats) @@ -236,6 +242,8 @@ type PowerIaasAPI struct { IaasServiceBroker iaas_service_broker.ClientService + InternalCapacityManagement internal_capacity_management.ClientService + InternalOperationsDedicatedHosts internal_operations_dedicated_hosts.ClientService InternalOperationsImages internal_operations_images.ClientService @@ -254,6 +262,8 @@ type PowerIaasAPI struct { InternalOperationsSnapshots internal_operations_snapshots.ClientService + InternalOperationsvpMemVolumes internal_operations_v_p_mem_volumes.ClientService + InternalOperationsVolumes internal_operations_volumes.ClientService InternalPowervsInstances internal_power_v_s_instances.ClientService @@ -316,6 +326,8 @@ type PowerIaasAPI struct { PCloudTenantsSSHKeys p_cloud_tenants_ssh_keys.ClientService + PCloudvpMemVolumes p_cloud_v_p_mem_volumes.ClientService + PCloudvpnConnections p_cloud_v_p_n_connections.ClientService PCloudvpnPolicies p_cloud_v_p_n_policies.ClientService @@ -359,6 +371,7 @@ func (c *PowerIaasAPI) SetTransport(transport runtime.ClientTransport) { c.HardwarePlatforms.SetTransport(transport) c.HostGroups.SetTransport(transport) c.IaasServiceBroker.SetTransport(transport) + c.InternalCapacityManagement.SetTransport(transport) c.InternalOperationsDedicatedHosts.SetTransport(transport) c.InternalOperationsImages.SetTransport(transport) c.InternalOperationsNetworkAddressGroups.SetTransport(transport) @@ -368,6 +381,7 @@ func (c *PowerIaasAPI) SetTransport(transport runtime.ClientTransport) { c.InternalOperationsPvmInstances.SetTransport(transport) c.InternalOperationsSharedProcessorPools.SetTransport(transport) c.InternalOperationsSnapshots.SetTransport(transport) + c.InternalOperationsvpMemVolumes.SetTransport(transport) c.InternalOperationsVolumes.SetTransport(transport) c.InternalPowervsInstances.SetTransport(transport) c.InternalPowervsLocations.SetTransport(transport) @@ -399,6 +413,7 @@ func (c *PowerIaasAPI) SetTransport(transport runtime.ClientTransport) { c.PCloudTasks.SetTransport(transport) c.PCloudTenants.SetTransport(transport) c.PCloudTenantsSSHKeys.SetTransport(transport) + c.PCloudvpMemVolumes.SetTransport(transport) c.PCloudvpnConnections.SetTransport(transport) c.PCloudvpnPolicies.SetTransport(transport) c.PCloudVirtualSerialNumber.SetTransport(transport) diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/routes/routes_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/routes/routes_client.go index 946f16df466..9fd4a578944 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/routes/routes_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/routes/routes_client.go @@ -75,7 +75,7 @@ type ClientService interface { V1RoutesDelete deletes a route */ func (a *Client) V1RoutesDelete(params *V1RoutesDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1RoutesDeleteOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1RoutesDeleteParams() } @@ -95,17 +95,22 @@ func (a *Client) V1RoutesDelete(params *V1RoutesDeleteParams, authInfo runtime.C for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1RoutesDeleteOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.routes.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -114,7 +119,7 @@ func (a *Client) V1RoutesDelete(params *V1RoutesDeleteParams, authInfo runtime.C V1RoutesGet gets a route s information */ func (a *Client) V1RoutesGet(params *V1RoutesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1RoutesGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1RoutesGetParams() } @@ -134,17 +139,22 @@ func (a *Client) V1RoutesGet(params *V1RoutesGetParams, authInfo runtime.ClientA for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1RoutesGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.routes.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -153,7 +163,7 @@ func (a *Client) V1RoutesGet(params *V1RoutesGetParams, authInfo runtime.ClientA V1RoutesGetall gets all routes in the workspace */ func (a *Client) V1RoutesGetall(params *V1RoutesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1RoutesGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1RoutesGetallParams() } @@ -173,17 +183,22 @@ func (a *Client) V1RoutesGetall(params *V1RoutesGetallParams, authInfo runtime.C for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1RoutesGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.routes.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -192,7 +207,7 @@ func (a *Client) V1RoutesGetall(params *V1RoutesGetallParams, authInfo runtime.C V1RoutesPost performs a route creation */ func (a *Client) V1RoutesPost(params *V1RoutesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1RoutesPostCreated, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1RoutesPostParams() } @@ -212,17 +227,22 @@ func (a *Client) V1RoutesPost(params *V1RoutesPostParams, authInfo runtime.Clien for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1RoutesPostCreated) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.routes.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -231,7 +251,7 @@ func (a *Client) V1RoutesPost(params *V1RoutesPostParams, authInfo runtime.Clien V1RoutesPut updates a route s information */ func (a *Client) V1RoutesPut(params *V1RoutesPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1RoutesPutOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1RoutesPutParams() } @@ -251,17 +271,22 @@ func (a *Client) V1RoutesPut(params *V1RoutesPutParams, authInfo runtime.ClientA for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1RoutesPutOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.routes.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -270,7 +295,7 @@ func (a *Client) V1RoutesPut(params *V1RoutesPutParams, authInfo runtime.ClientA V1RoutesReportGet gets the route report for a workspace */ func (a *Client) V1RoutesReportGet(params *V1RoutesReportGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1RoutesReportGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1RoutesReportGetParams() } @@ -290,17 +315,22 @@ func (a *Client) V1RoutesReportGet(params *V1RoutesReportGetParams, authInfo run for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1RoutesReportGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.routes.report.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/routes/v1_routes_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/routes/v1_routes_delete_responses.go index 6244d6c08e2..3ab2a9a5ac1 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/routes/v1_routes_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/routes/v1_routes_delete_responses.go @@ -7,6 +7,7 @@ package routes import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1RoutesDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1RoutesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1RoutesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1RoutesDeleteOK() @@ -132,7 +133,7 @@ func (o *V1RoutesDeleteOK) GetPayload() models.Object { func (o *V1RoutesDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -202,7 +203,7 @@ func (o *V1RoutesDeleteBadRequest) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -272,7 +273,7 @@ func (o *V1RoutesDeleteUnauthorized) readResponse(response runtime.ClientRespons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -342,7 +343,7 @@ func (o *V1RoutesDeleteForbidden) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -412,7 +413,7 @@ func (o *V1RoutesDeleteNotFound) readResponse(response runtime.ClientResponse, c o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -482,7 +483,7 @@ func (o *V1RoutesDeleteGone) readResponse(response runtime.ClientResponse, consu o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -552,7 +553,7 @@ func (o *V1RoutesDeleteInternalServerError) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/routes/v1_routes_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/routes/v1_routes_get_responses.go index e09afbbdb01..d3d1c831f05 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/routes/v1_routes_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/routes/v1_routes_get_responses.go @@ -7,6 +7,7 @@ package routes import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1RoutesGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1RoutesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1RoutesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1RoutesGetOK() @@ -128,7 +129,7 @@ func (o *V1RoutesGetOK) readResponse(response runtime.ClientResponse, consumer r o.Payload = new(models.Route) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *V1RoutesGetBadRequest) readResponse(response runtime.ClientResponse, co o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *V1RoutesGetUnauthorized) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *V1RoutesGetForbidden) readResponse(response runtime.ClientResponse, con o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *V1RoutesGetNotFound) readResponse(response runtime.ClientResponse, cons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *V1RoutesGetInternalServerError) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/routes/v1_routes_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/routes/v1_routes_getall_responses.go index cf9001c74ea..179bb3f20c1 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/routes/v1_routes_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/routes/v1_routes_getall_responses.go @@ -7,6 +7,7 @@ package routes import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1RoutesGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1RoutesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1RoutesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1RoutesGetallOK() @@ -128,7 +129,7 @@ func (o *V1RoutesGetallOK) readResponse(response runtime.ClientResponse, consume o.Payload = new(models.Routes) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *V1RoutesGetallBadRequest) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *V1RoutesGetallUnauthorized) readResponse(response runtime.ClientRespons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *V1RoutesGetallForbidden) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *V1RoutesGetallNotFound) readResponse(response runtime.ClientResponse, c o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *V1RoutesGetallInternalServerError) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/routes/v1_routes_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/routes/v1_routes_post_responses.go index 91acfe074f8..c7e956376f2 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/routes/v1_routes_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/routes/v1_routes_post_responses.go @@ -7,6 +7,7 @@ package routes import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1RoutesPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1RoutesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1RoutesPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 201: result := NewV1RoutesPostCreated() @@ -140,7 +141,7 @@ func (o *V1RoutesPostCreated) readResponse(response runtime.ClientResponse, cons o.Payload = new(models.Route) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -210,7 +211,7 @@ func (o *V1RoutesPostBadRequest) readResponse(response runtime.ClientResponse, c o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -280,7 +281,7 @@ func (o *V1RoutesPostUnauthorized) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -350,7 +351,7 @@ func (o *V1RoutesPostForbidden) readResponse(response runtime.ClientResponse, co o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -420,7 +421,7 @@ func (o *V1RoutesPostNotFound) readResponse(response runtime.ClientResponse, con o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -490,7 +491,7 @@ func (o *V1RoutesPostConflict) readResponse(response runtime.ClientResponse, con o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -560,7 +561,7 @@ func (o *V1RoutesPostUnprocessableEntity) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -630,7 +631,7 @@ func (o *V1RoutesPostInternalServerError) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/routes/v1_routes_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/routes/v1_routes_put_responses.go index 6d1f58a349a..bd30b3d8ab4 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/routes/v1_routes_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/routes/v1_routes_put_responses.go @@ -7,6 +7,7 @@ package routes import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1RoutesPutReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1RoutesPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1RoutesPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1RoutesPutOK() @@ -134,7 +135,7 @@ func (o *V1RoutesPutOK) readResponse(response runtime.ClientResponse, consumer r o.Payload = new(models.Route) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *V1RoutesPutBadRequest) readResponse(response runtime.ClientResponse, co o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *V1RoutesPutUnauthorized) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *V1RoutesPutForbidden) readResponse(response runtime.ClientResponse, con o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *V1RoutesPutNotFound) readResponse(response runtime.ClientResponse, cons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *V1RoutesPutUnprocessableEntity) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *V1RoutesPutInternalServerError) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/routes/v1_routes_report_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/routes/v1_routes_report_get_responses.go index 7081aec1c94..f0d51082a56 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/routes/v1_routes_report_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/routes/v1_routes_report_get_responses.go @@ -7,6 +7,7 @@ package routes import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1RoutesReportGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1RoutesReportGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1RoutesReportGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1RoutesReportGetOK() @@ -128,7 +129,7 @@ func (o *V1RoutesReportGetOK) readResponse(response runtime.ClientResponse, cons o.Payload = new(models.RouteReport) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *V1RoutesReportGetBadRequest) readResponse(response runtime.ClientRespon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *V1RoutesReportGetUnauthorized) readResponse(response runtime.ClientResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *V1RoutesReportGetForbidden) readResponse(response runtime.ClientRespons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *V1RoutesReportGetNotFound) readResponse(response runtime.ClientResponse o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *V1RoutesReportGetInternalServerError) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_binding_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_binding_responses.go index 6bd01f3cc1c..d1040b7b1fe 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_binding_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_binding_responses.go @@ -7,6 +7,7 @@ package service_bindings import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type ServiceBindingBindingReader struct { } // ReadResponse reads a server response into the received o. -func (o *ServiceBindingBindingReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ServiceBindingBindingReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewServiceBindingBindingOK() @@ -146,7 +147,7 @@ func (o *ServiceBindingBindingOK) readResponse(response runtime.ClientResponse, o.Payload = new(models.ServiceBinding) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -216,7 +217,7 @@ func (o *ServiceBindingBindingCreated) readResponse(response runtime.ClientRespo o.Payload = new(models.ServiceBinding) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -286,7 +287,7 @@ func (o *ServiceBindingBindingAccepted) readResponse(response runtime.ClientResp o.Payload = new(models.AsyncOperation) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -356,7 +357,7 @@ func (o *ServiceBindingBindingBadRequest) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -426,7 +427,7 @@ func (o *ServiceBindingBindingUnauthorized) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -496,7 +497,7 @@ func (o *ServiceBindingBindingForbidden) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -566,7 +567,7 @@ func (o *ServiceBindingBindingNotFound) readResponse(response runtime.ClientResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -636,7 +637,7 @@ func (o *ServiceBindingBindingConflict) readResponse(response runtime.ClientResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -706,7 +707,7 @@ func (o *ServiceBindingBindingUnprocessableEntity) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_get_responses.go index 740dc496524..a180e417ab0 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_get_responses.go @@ -7,6 +7,7 @@ package service_bindings import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type ServiceBindingGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *ServiceBindingGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ServiceBindingGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewServiceBindingGetOK() @@ -122,7 +123,7 @@ func (o *ServiceBindingGetOK) readResponse(response runtime.ClientResponse, cons o.Payload = new(models.ServiceBindingResource) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -192,7 +193,7 @@ func (o *ServiceBindingGetBadRequest) readResponse(response runtime.ClientRespon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -262,7 +263,7 @@ func (o *ServiceBindingGetUnauthorized) readResponse(response runtime.ClientResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -332,7 +333,7 @@ func (o *ServiceBindingGetForbidden) readResponse(response runtime.ClientRespons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -402,7 +403,7 @@ func (o *ServiceBindingGetNotFound) readResponse(response runtime.ClientResponse o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_last_operation_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_last_operation_get_responses.go index 9f0824ba5dd..01e5ac47fd7 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_last_operation_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_last_operation_get_responses.go @@ -7,6 +7,7 @@ package service_bindings import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type ServiceBindingLastOperationGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *ServiceBindingLastOperationGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ServiceBindingLastOperationGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewServiceBindingLastOperationGetOK() @@ -128,7 +129,7 @@ func (o *ServiceBindingLastOperationGetOK) readResponse(response runtime.ClientR o.Payload = new(models.LastOperationResource) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *ServiceBindingLastOperationGetBadRequest) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *ServiceBindingLastOperationGetUnauthorized) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *ServiceBindingLastOperationGetForbidden) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *ServiceBindingLastOperationGetNotFound) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *ServiceBindingLastOperationGetGone) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_unbinding_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_unbinding_responses.go index 2fdaa4f6ce9..c2a96c4bcf0 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_unbinding_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_binding_unbinding_responses.go @@ -7,6 +7,7 @@ package service_bindings import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type ServiceBindingUnbindingReader struct { } // ReadResponse reads a server response into the received o. -func (o *ServiceBindingUnbindingReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ServiceBindingUnbindingReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewServiceBindingUnbindingOK() @@ -132,7 +133,7 @@ func (o *ServiceBindingUnbindingOK) GetPayload() models.Object { func (o *ServiceBindingUnbindingOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -202,7 +203,7 @@ func (o *ServiceBindingUnbindingAccepted) readResponse(response runtime.ClientRe o.Payload = new(models.AsyncOperation) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -272,7 +273,7 @@ func (o *ServiceBindingUnbindingBadRequest) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -342,7 +343,7 @@ func (o *ServiceBindingUnbindingUnauthorized) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -412,7 +413,7 @@ func (o *ServiceBindingUnbindingForbidden) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -482,7 +483,7 @@ func (o *ServiceBindingUnbindingNotFound) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -552,7 +553,7 @@ func (o *ServiceBindingUnbindingGone) readResponse(response runtime.ClientRespon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_bindings_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_bindings_client.go index 7eb11603ef5..59b29aa6a91 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_bindings_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_bindings/service_bindings_client.go @@ -71,7 +71,7 @@ type ClientService interface { ServiceBindingBinding generations of a service binding */ func (a *Client) ServiceBindingBinding(params *ServiceBindingBindingParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBindingBindingOK, *ServiceBindingBindingCreated, *ServiceBindingBindingAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewServiceBindingBindingParams() } @@ -91,11 +91,12 @@ func (a *Client) ServiceBindingBinding(params *ServiceBindingBindingParams, auth for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, nil, nil, err } + + // several success responses have to be checked switch value := result.(type) { case *ServiceBindingBindingOK: return value, nil, nil, nil @@ -104,7 +105,10 @@ func (a *Client) ServiceBindingBinding(params *ServiceBindingBindingParams, auth case *ServiceBindingBindingAccepted: return nil, nil, value, nil } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for service_bindings: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -113,7 +117,7 @@ func (a *Client) ServiceBindingBinding(params *ServiceBindingBindingParams, auth ServiceBindingGet gets a service binding */ func (a *Client) ServiceBindingGet(params *ServiceBindingGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBindingGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewServiceBindingGetParams() } @@ -133,17 +137,22 @@ func (a *Client) ServiceBindingGet(params *ServiceBindingGetParams, authInfo run for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*ServiceBindingGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for serviceBinding.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -152,7 +161,7 @@ func (a *Client) ServiceBindingGet(params *ServiceBindingGetParams, authInfo run ServiceBindingLastOperationGet lasts requested operation state for service binding */ func (a *Client) ServiceBindingLastOperationGet(params *ServiceBindingLastOperationGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBindingLastOperationGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewServiceBindingLastOperationGetParams() } @@ -172,17 +181,22 @@ func (a *Client) ServiceBindingLastOperationGet(params *ServiceBindingLastOperat for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*ServiceBindingLastOperationGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for serviceBinding.lastOperation.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -191,7 +205,7 @@ func (a *Client) ServiceBindingLastOperationGet(params *ServiceBindingLastOperat ServiceBindingUnbinding deprovisions of a service binding */ func (a *Client) ServiceBindingUnbinding(params *ServiceBindingUnbindingParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceBindingUnbindingOK, *ServiceBindingUnbindingAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewServiceBindingUnbindingParams() } @@ -211,18 +225,22 @@ func (a *Client) ServiceBindingUnbinding(params *ServiceBindingUnbindingParams, for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } + + // several success responses have to be checked switch value := result.(type) { case *ServiceBindingUnbindingOK: return value, nil, nil case *ServiceBindingUnbindingAccepted: return nil, value, nil } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for service_bindings: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_deprovision_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_deprovision_responses.go index 83b0ddd2244..3afc8332dba 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_deprovision_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_deprovision_responses.go @@ -7,6 +7,7 @@ package service_instances import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type ServiceInstanceDeprovisionReader struct { } // ReadResponse reads a server response into the received o. -func (o *ServiceInstanceDeprovisionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ServiceInstanceDeprovisionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewServiceInstanceDeprovisionOK() @@ -138,7 +139,7 @@ func (o *ServiceInstanceDeprovisionOK) GetPayload() models.Object { func (o *ServiceInstanceDeprovisionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -208,7 +209,7 @@ func (o *ServiceInstanceDeprovisionAccepted) readResponse(response runtime.Clien o.Payload = new(models.AsyncOperation) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -278,7 +279,7 @@ func (o *ServiceInstanceDeprovisionBadRequest) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -348,7 +349,7 @@ func (o *ServiceInstanceDeprovisionUnauthorized) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -418,7 +419,7 @@ func (o *ServiceInstanceDeprovisionForbidden) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -488,7 +489,7 @@ func (o *ServiceInstanceDeprovisionNotFound) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -558,7 +559,7 @@ func (o *ServiceInstanceDeprovisionGone) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -628,7 +629,7 @@ func (o *ServiceInstanceDeprovisionUnprocessableEntity) readResponse(response ru o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_get_responses.go index d94ed17c377..1ce7ee66f19 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_get_responses.go @@ -7,6 +7,7 @@ package service_instances import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type ServiceInstanceGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *ServiceInstanceGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ServiceInstanceGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewServiceInstanceGetOK() @@ -122,7 +123,7 @@ func (o *ServiceInstanceGetOK) readResponse(response runtime.ClientResponse, con o.Payload = new(models.ServiceInstanceResource) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -192,7 +193,7 @@ func (o *ServiceInstanceGetBadRequest) readResponse(response runtime.ClientRespo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -262,7 +263,7 @@ func (o *ServiceInstanceGetUnauthorized) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -332,7 +333,7 @@ func (o *ServiceInstanceGetForbidden) readResponse(response runtime.ClientRespon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -402,7 +403,7 @@ func (o *ServiceInstanceGetNotFound) readResponse(response runtime.ClientRespons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_last_operation_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_last_operation_get_responses.go index e9a10245b7c..1bce0dc2a3b 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_last_operation_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_last_operation_get_responses.go @@ -7,6 +7,7 @@ package service_instances import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type ServiceInstanceLastOperationGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *ServiceInstanceLastOperationGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ServiceInstanceLastOperationGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewServiceInstanceLastOperationGetOK() @@ -128,7 +129,7 @@ func (o *ServiceInstanceLastOperationGetOK) readResponse(response runtime.Client o.Payload = new(models.LastOperationResource) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *ServiceInstanceLastOperationGetBadRequest) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *ServiceInstanceLastOperationGetUnauthorized) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *ServiceInstanceLastOperationGetForbidden) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *ServiceInstanceLastOperationGetNotFound) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *ServiceInstanceLastOperationGetGone) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_provision_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_provision_responses.go index 6d82abbf6a9..bcad0826ff5 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_provision_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_provision_responses.go @@ -7,6 +7,7 @@ package service_instances import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type ServiceInstanceProvisionReader struct { } // ReadResponse reads a server response into the received o. -func (o *ServiceInstanceProvisionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ServiceInstanceProvisionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewServiceInstanceProvisionOK() @@ -146,7 +147,7 @@ func (o *ServiceInstanceProvisionOK) readResponse(response runtime.ClientRespons o.Payload = new(models.ServiceInstanceProvision) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -216,7 +217,7 @@ func (o *ServiceInstanceProvisionCreated) readResponse(response runtime.ClientRe o.Payload = new(models.ServiceInstanceProvision) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -286,7 +287,7 @@ func (o *ServiceInstanceProvisionAccepted) readResponse(response runtime.ClientR o.Payload = new(models.ServiceInstanceAsyncOperation) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -356,7 +357,7 @@ func (o *ServiceInstanceProvisionBadRequest) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -426,7 +427,7 @@ func (o *ServiceInstanceProvisionUnauthorized) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -496,7 +497,7 @@ func (o *ServiceInstanceProvisionForbidden) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -566,7 +567,7 @@ func (o *ServiceInstanceProvisionNotFound) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -636,7 +637,7 @@ func (o *ServiceInstanceProvisionConflict) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -706,7 +707,7 @@ func (o *ServiceInstanceProvisionUnprocessableEntity) readResponse(response runt o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_update_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_update_responses.go index 94fcb782869..921f84fd6be 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_update_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instance_update_responses.go @@ -7,6 +7,7 @@ package service_instances import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type ServiceInstanceUpdateReader struct { } // ReadResponse reads a server response into the received o. -func (o *ServiceInstanceUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ServiceInstanceUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewServiceInstanceUpdateOK() @@ -134,7 +135,7 @@ func (o *ServiceInstanceUpdateOK) readResponse(response runtime.ClientResponse, o.Payload = new(models.ServiceInstanceUpdate) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *ServiceInstanceUpdateAccepted) readResponse(response runtime.ClientResp o.Payload = new(models.ServiceInstanceAsyncOperation) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *ServiceInstanceUpdateBadRequest) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *ServiceInstanceUpdateUnauthorized) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *ServiceInstanceUpdateForbidden) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *ServiceInstanceUpdateNotFound) readResponse(response runtime.ClientResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *ServiceInstanceUpdateUnprocessableEntity) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instances_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instances_client.go index 094ce61c0bf..3f7070f461d 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instances_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/service_instances/service_instances_client.go @@ -73,7 +73,7 @@ type ClientService interface { ServiceInstanceDeprovision deprovisions a service instance */ func (a *Client) ServiceInstanceDeprovision(params *ServiceInstanceDeprovisionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceInstanceDeprovisionOK, *ServiceInstanceDeprovisionAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewServiceInstanceDeprovisionParams() } @@ -93,18 +93,22 @@ func (a *Client) ServiceInstanceDeprovision(params *ServiceInstanceDeprovisionPa for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } + + // several success responses have to be checked switch value := result.(type) { case *ServiceInstanceDeprovisionOK: return value, nil, nil case *ServiceInstanceDeprovisionAccepted: return nil, value, nil } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for service_instances: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -113,7 +117,7 @@ func (a *Client) ServiceInstanceDeprovision(params *ServiceInstanceDeprovisionPa ServiceInstanceGet gets a service instance */ func (a *Client) ServiceInstanceGet(params *ServiceInstanceGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceInstanceGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewServiceInstanceGetParams() } @@ -133,17 +137,22 @@ func (a *Client) ServiceInstanceGet(params *ServiceInstanceGetParams, authInfo r for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*ServiceInstanceGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for serviceInstance.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -152,7 +161,7 @@ func (a *Client) ServiceInstanceGet(params *ServiceInstanceGetParams, authInfo r ServiceInstanceLastOperationGet lasts requested operation state for service instance */ func (a *Client) ServiceInstanceLastOperationGet(params *ServiceInstanceLastOperationGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceInstanceLastOperationGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewServiceInstanceLastOperationGetParams() } @@ -172,17 +181,22 @@ func (a *Client) ServiceInstanceLastOperationGet(params *ServiceInstanceLastOper for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*ServiceInstanceLastOperationGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for serviceInstance.lastOperation.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -191,7 +205,7 @@ func (a *Client) ServiceInstanceLastOperationGet(params *ServiceInstanceLastOper ServiceInstanceProvision provisions a service instance */ func (a *Client) ServiceInstanceProvision(params *ServiceInstanceProvisionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceInstanceProvisionOK, *ServiceInstanceProvisionCreated, *ServiceInstanceProvisionAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewServiceInstanceProvisionParams() } @@ -211,11 +225,12 @@ func (a *Client) ServiceInstanceProvision(params *ServiceInstanceProvisionParams for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, nil, nil, err } + + // several success responses have to be checked switch value := result.(type) { case *ServiceInstanceProvisionOK: return value, nil, nil, nil @@ -224,7 +239,10 @@ func (a *Client) ServiceInstanceProvision(params *ServiceInstanceProvisionParams case *ServiceInstanceProvisionAccepted: return nil, nil, value, nil } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for service_instances: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -233,7 +251,7 @@ func (a *Client) ServiceInstanceProvision(params *ServiceInstanceProvisionParams ServiceInstanceUpdate updates a service instance */ func (a *Client) ServiceInstanceUpdate(params *ServiceInstanceUpdateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ServiceInstanceUpdateOK, *ServiceInstanceUpdateAccepted, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewServiceInstanceUpdateParams() } @@ -253,18 +271,22 @@ func (a *Client) ServiceInstanceUpdate(params *ServiceInstanceUpdateParams, auth for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, nil, err } + + // several success responses have to be checked switch value := result.(type) { case *ServiceInstanceUpdateOK: return value, nil, nil case *ServiceInstanceUpdateAccepted: return nil, value, nil } - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for service_instances: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/snapshots/snapshots_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/snapshots/snapshots_client.go index a486474803d..633e5d5aa9d 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/snapshots/snapshots_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/snapshots/snapshots_client.go @@ -77,7 +77,7 @@ The API v1/volume-snapshots has replaced this endpoint. View the usage of a snapshot. The snapshot may take time sync because the data is cached. */ func (a *Client) V1SnapshotsGet(params *V1SnapshotsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1SnapshotsGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1SnapshotsGetParams() } @@ -97,17 +97,22 @@ func (a *Client) V1SnapshotsGet(params *V1SnapshotsGetParams, authInfo runtime.C for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1SnapshotsGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.snapshots.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -122,7 +127,7 @@ The API v1/volume-snapshots has replaced this endpoint. View the usage of snapshots on the workspace. The snapshots may take time sync because the data is cached. */ func (a *Client) V1SnapshotsGetall(params *V1SnapshotsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1SnapshotsGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1SnapshotsGetallParams() } @@ -142,17 +147,22 @@ func (a *Client) V1SnapshotsGetall(params *V1SnapshotsGetallParams, authInfo run for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1SnapshotsGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.snapshots.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -163,7 +173,7 @@ V1VolumeSnapshotsGet gets the detail of a volume snapshot View the usage of a snapshot. The snapshot may take time sync because the data is cached. */ func (a *Client) V1VolumeSnapshotsGet(params *V1VolumeSnapshotsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1VolumeSnapshotsGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1VolumeSnapshotsGetParams() } @@ -183,17 +193,22 @@ func (a *Client) V1VolumeSnapshotsGet(params *V1VolumeSnapshotsGetParams, authIn for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1VolumeSnapshotsGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.volume-snapshots.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -204,7 +219,7 @@ V1VolumeSnapshotsGetall gets the list of volume snapshots on a workspace View the usage of volume snapshots on the workspace. The volume snapshots may take time sync because the data is cached. */ func (a *Client) V1VolumeSnapshotsGetall(params *V1VolumeSnapshotsGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1VolumeSnapshotsGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1VolumeSnapshotsGetallParams() } @@ -224,17 +239,22 @@ func (a *Client) V1VolumeSnapshotsGetall(params *V1VolumeSnapshotsGetallParams, for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1VolumeSnapshotsGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.volume-snapshots.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/snapshots/v1_snapshots_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/snapshots/v1_snapshots_get_responses.go index ebddf6146e1..9940927eab1 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/snapshots/v1_snapshots_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/snapshots/v1_snapshots_get_responses.go @@ -7,6 +7,7 @@ package snapshots import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1SnapshotsGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1SnapshotsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1SnapshotsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1SnapshotsGetOK() @@ -134,7 +135,7 @@ func (o *V1SnapshotsGetOK) readResponse(response runtime.ClientResponse, consume o.Payload = new(models.SnapshotV1) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *V1SnapshotsGetBadRequest) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *V1SnapshotsGetUnauthorized) readResponse(response runtime.ClientRespons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *V1SnapshotsGetForbidden) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *V1SnapshotsGetNotFound) readResponse(response runtime.ClientResponse, c o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *V1SnapshotsGetInternalServerError) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *V1SnapshotsGetServiceUnavailable) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/snapshots/v1_snapshots_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/snapshots/v1_snapshots_getall_responses.go index 5c4ebf06db2..64b6ca76ba0 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/snapshots/v1_snapshots_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/snapshots/v1_snapshots_getall_responses.go @@ -7,6 +7,7 @@ package snapshots import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1SnapshotsGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1SnapshotsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1SnapshotsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1SnapshotsGetallOK() @@ -128,7 +129,7 @@ func (o *V1SnapshotsGetallOK) readResponse(response runtime.ClientResponse, cons o.Payload = new(models.SnapshotList) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *V1SnapshotsGetallUnauthorized) readResponse(response runtime.ClientResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *V1SnapshotsGetallForbidden) readResponse(response runtime.ClientRespons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *V1SnapshotsGetallNotFound) readResponse(response runtime.ClientResponse o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *V1SnapshotsGetallInternalServerError) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *V1SnapshotsGetallServiceUnavailable) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/snapshots/v1_volume_snapshots_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/snapshots/v1_volume_snapshots_get_responses.go index 4402d278b98..7974a666c65 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/snapshots/v1_volume_snapshots_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/snapshots/v1_volume_snapshots_get_responses.go @@ -7,6 +7,7 @@ package snapshots import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1VolumeSnapshotsGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1VolumeSnapshotsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1VolumeSnapshotsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1VolumeSnapshotsGetOK() @@ -134,7 +135,7 @@ func (o *V1VolumeSnapshotsGetOK) readResponse(response runtime.ClientResponse, c o.Payload = new(models.SnapshotV1) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *V1VolumeSnapshotsGetBadRequest) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *V1VolumeSnapshotsGetUnauthorized) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *V1VolumeSnapshotsGetForbidden) readResponse(response runtime.ClientResp o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *V1VolumeSnapshotsGetNotFound) readResponse(response runtime.ClientRespo o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *V1VolumeSnapshotsGetInternalServerError) readResponse(response runtime. o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *V1VolumeSnapshotsGetServiceUnavailable) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/snapshots/v1_volume_snapshots_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/snapshots/v1_volume_snapshots_getall_responses.go index 525835e8165..624cb7d7141 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/snapshots/v1_volume_snapshots_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/snapshots/v1_volume_snapshots_getall_responses.go @@ -7,6 +7,7 @@ package snapshots import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1VolumeSnapshotsGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1VolumeSnapshotsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1VolumeSnapshotsGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1VolumeSnapshotsGetallOK() @@ -128,7 +129,7 @@ func (o *V1VolumeSnapshotsGetallOK) readResponse(response runtime.ClientResponse o.Payload = new(models.VolumeSnapshotList) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *V1VolumeSnapshotsGetallUnauthorized) readResponse(response runtime.Clie o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *V1VolumeSnapshotsGetallForbidden) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *V1VolumeSnapshotsGetallNotFound) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *V1VolumeSnapshotsGetallInternalServerError) readResponse(response runti o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *V1VolumeSnapshotsGetallServiceUnavailable) readResponse(response runtim o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/ssh_keys/ssh_keys_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/ssh_keys/ssh_keys_client.go index 66ac214626f..9342dac07ca 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/ssh_keys/ssh_keys_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/ssh_keys/ssh_keys_client.go @@ -73,7 +73,7 @@ type ClientService interface { V1SshkeysDelete deletes ssh key */ func (a *Client) V1SshkeysDelete(params *V1SshkeysDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1SshkeysDeleteOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1SshkeysDeleteParams() } @@ -93,17 +93,22 @@ func (a *Client) V1SshkeysDelete(params *V1SshkeysDeleteParams, authInfo runtime for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1SshkeysDeleteOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.sshkeys.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -112,7 +117,7 @@ func (a *Client) V1SshkeysDelete(params *V1SshkeysDeleteParams, authInfo runtime V1SshkeysGet gets ssh key information */ func (a *Client) V1SshkeysGet(params *V1SshkeysGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1SshkeysGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1SshkeysGetParams() } @@ -132,17 +137,22 @@ func (a *Client) V1SshkeysGet(params *V1SshkeysGetParams, authInfo runtime.Clien for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1SshkeysGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.sshkeys.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -151,7 +161,7 @@ func (a *Client) V1SshkeysGet(params *V1SshkeysGetParams, authInfo runtime.Clien V1SshkeysGetall lists SSH keys */ func (a *Client) V1SshkeysGetall(params *V1SshkeysGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1SshkeysGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1SshkeysGetallParams() } @@ -171,17 +181,22 @@ func (a *Client) V1SshkeysGetall(params *V1SshkeysGetallParams, authInfo runtime for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1SshkeysGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.sshkeys.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -190,7 +205,7 @@ func (a *Client) V1SshkeysGetall(params *V1SshkeysGetallParams, authInfo runtime V1SshkeysPost adds a new SSH key */ func (a *Client) V1SshkeysPost(params *V1SshkeysPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1SshkeysPostCreated, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1SshkeysPostParams() } @@ -210,17 +225,22 @@ func (a *Client) V1SshkeysPost(params *V1SshkeysPostParams, authInfo runtime.Cli for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1SshkeysPostCreated) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.sshkeys.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -229,7 +249,7 @@ func (a *Client) V1SshkeysPost(params *V1SshkeysPostParams, authInfo runtime.Cli V1SshkeysPut updates the ssh key */ func (a *Client) V1SshkeysPut(params *V1SshkeysPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1SshkeysPutOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1SshkeysPutParams() } @@ -249,17 +269,22 @@ func (a *Client) V1SshkeysPut(params *V1SshkeysPutParams, authInfo runtime.Clien for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1SshkeysPutOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.sshkeys.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/ssh_keys/v1_sshkeys_delete_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/ssh_keys/v1_sshkeys_delete_responses.go index 6832171fe24..3225444f7cb 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/ssh_keys/v1_sshkeys_delete_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/ssh_keys/v1_sshkeys_delete_responses.go @@ -7,6 +7,7 @@ package ssh_keys import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1SshkeysDeleteReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1SshkeysDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1SshkeysDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1SshkeysDeleteOK() @@ -132,7 +133,7 @@ func (o *V1SshkeysDeleteOK) GetPayload() models.Object { func (o *V1SshkeysDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -202,7 +203,7 @@ func (o *V1SshkeysDeleteBadRequest) readResponse(response runtime.ClientResponse o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -272,7 +273,7 @@ func (o *V1SshkeysDeleteUnauthorized) readResponse(response runtime.ClientRespon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -342,7 +343,7 @@ func (o *V1SshkeysDeleteForbidden) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -412,7 +413,7 @@ func (o *V1SshkeysDeleteNotFound) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -482,7 +483,7 @@ func (o *V1SshkeysDeleteGone) readResponse(response runtime.ClientResponse, cons o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -552,7 +553,7 @@ func (o *V1SshkeysDeleteInternalServerError) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/ssh_keys/v1_sshkeys_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/ssh_keys/v1_sshkeys_get_responses.go index ffa2ff52ee2..826aa1fff10 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/ssh_keys/v1_sshkeys_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/ssh_keys/v1_sshkeys_get_responses.go @@ -7,6 +7,7 @@ package ssh_keys import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1SshkeysGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1SshkeysGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1SshkeysGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1SshkeysGetOK() @@ -128,7 +129,7 @@ func (o *V1SshkeysGetOK) readResponse(response runtime.ClientResponse, consumer o.Payload = new(models.WorkspaceSSHKey) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *V1SshkeysGetBadRequest) readResponse(response runtime.ClientResponse, c o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *V1SshkeysGetUnauthorized) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *V1SshkeysGetForbidden) readResponse(response runtime.ClientResponse, co o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *V1SshkeysGetNotFound) readResponse(response runtime.ClientResponse, con o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *V1SshkeysGetInternalServerError) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/ssh_keys/v1_sshkeys_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/ssh_keys/v1_sshkeys_getall_responses.go index 17c0243a360..4005777caac 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/ssh_keys/v1_sshkeys_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/ssh_keys/v1_sshkeys_getall_responses.go @@ -7,6 +7,7 @@ package ssh_keys import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1SshkeysGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1SshkeysGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1SshkeysGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1SshkeysGetallOK() @@ -128,7 +129,7 @@ func (o *V1SshkeysGetallOK) readResponse(response runtime.ClientResponse, consum o.Payload = new(models.WorkspaceSSHKeys) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -198,7 +199,7 @@ func (o *V1SshkeysGetallBadRequest) readResponse(response runtime.ClientResponse o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -268,7 +269,7 @@ func (o *V1SshkeysGetallUnauthorized) readResponse(response runtime.ClientRespon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -338,7 +339,7 @@ func (o *V1SshkeysGetallForbidden) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -408,7 +409,7 @@ func (o *V1SshkeysGetallNotFound) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -478,7 +479,7 @@ func (o *V1SshkeysGetallInternalServerError) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/ssh_keys/v1_sshkeys_post_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/ssh_keys/v1_sshkeys_post_responses.go index bb0ee957457..97ebfbef345 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/ssh_keys/v1_sshkeys_post_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/ssh_keys/v1_sshkeys_post_responses.go @@ -7,6 +7,7 @@ package ssh_keys import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1SshkeysPostReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1SshkeysPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1SshkeysPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 201: result := NewV1SshkeysPostCreated() @@ -140,7 +141,7 @@ func (o *V1SshkeysPostCreated) readResponse(response runtime.ClientResponse, con o.Payload = new(models.WorkspaceSSHKey) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -210,7 +211,7 @@ func (o *V1SshkeysPostBadRequest) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -280,7 +281,7 @@ func (o *V1SshkeysPostUnauthorized) readResponse(response runtime.ClientResponse o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -350,7 +351,7 @@ func (o *V1SshkeysPostForbidden) readResponse(response runtime.ClientResponse, c o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -420,7 +421,7 @@ func (o *V1SshkeysPostNotFound) readResponse(response runtime.ClientResponse, co o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -490,7 +491,7 @@ func (o *V1SshkeysPostConflict) readResponse(response runtime.ClientResponse, co o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -560,7 +561,7 @@ func (o *V1SshkeysPostUnprocessableEntity) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -630,7 +631,7 @@ func (o *V1SshkeysPostInternalServerError) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/ssh_keys/v1_sshkeys_put_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/ssh_keys/v1_sshkeys_put_responses.go index 10a4c21c4a3..eec32bcf6fc 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/ssh_keys/v1_sshkeys_put_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/ssh_keys/v1_sshkeys_put_responses.go @@ -7,6 +7,7 @@ package ssh_keys import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1SshkeysPutReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1SshkeysPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1SshkeysPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1SshkeysPutOK() @@ -140,7 +141,7 @@ func (o *V1SshkeysPutOK) readResponse(response runtime.ClientResponse, consumer o.Payload = new(models.WorkspaceSSHKey) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -210,7 +211,7 @@ func (o *V1SshkeysPutBadRequest) readResponse(response runtime.ClientResponse, c o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -280,7 +281,7 @@ func (o *V1SshkeysPutUnauthorized) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -350,7 +351,7 @@ func (o *V1SshkeysPutForbidden) readResponse(response runtime.ClientResponse, co o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -420,7 +421,7 @@ func (o *V1SshkeysPutNotFound) readResponse(response runtime.ClientResponse, con o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -490,7 +491,7 @@ func (o *V1SshkeysPutConflict) readResponse(response runtime.ClientResponse, con o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -560,7 +561,7 @@ func (o *V1SshkeysPutGone) readResponse(response runtime.ClientResponse, consume o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -630,7 +631,7 @@ func (o *V1SshkeysPutInternalServerError) readResponse(response runtime.ClientRe o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/storage_types/service_broker_storagetypes_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/storage_types/service_broker_storagetypes_get_responses.go index d8bd8f2df6e..1d246c26f82 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/storage_types/service_broker_storagetypes_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/storage_types/service_broker_storagetypes_get_responses.go @@ -7,6 +7,7 @@ package storage_types import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type ServiceBrokerStoragetypesGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *ServiceBrokerStoragetypesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ServiceBrokerStoragetypesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewServiceBrokerStoragetypesGetOK() @@ -132,7 +133,7 @@ func (o *ServiceBrokerStoragetypesGetOK) GetPayload() models.StorageTypes { func (o *ServiceBrokerStoragetypesGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -202,7 +203,7 @@ func (o *ServiceBrokerStoragetypesGetBadRequest) readResponse(response runtime.C o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -272,7 +273,7 @@ func (o *ServiceBrokerStoragetypesGetUnauthorized) readResponse(response runtime o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -342,7 +343,7 @@ func (o *ServiceBrokerStoragetypesGetForbidden) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -412,7 +413,7 @@ func (o *ServiceBrokerStoragetypesGetNotFound) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -482,7 +483,7 @@ func (o *ServiceBrokerStoragetypesGetUnprocessableEntity) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -552,7 +553,7 @@ func (o *ServiceBrokerStoragetypesGetInternalServerError) readResponse(response o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/storage_types/storage_types_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/storage_types/storage_types_client.go index 51bfe993683..8d0dc6fcef0 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/storage_types/storage_types_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/storage_types/storage_types_client.go @@ -69,7 +69,7 @@ type ClientService interface { >*Note*: Support for this API will be available till 31st October 2023. */ func (a *Client) ServiceBrokerStoragetypesGet(params *ServiceBrokerStoragetypesGetParams, opts ...ClientOption) (*ServiceBrokerStoragetypesGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewServiceBrokerStoragetypesGetParams() } @@ -88,17 +88,22 @@ func (a *Client) ServiceBrokerStoragetypesGet(params *ServiceBrokerStoragetypesG for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*ServiceBrokerStoragetypesGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for serviceBroker.storagetypes.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/swagger_spec/service_broker_swaggerspec_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/swagger_spec/service_broker_swaggerspec_responses.go index d938fd2fcd7..89697907fe7 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/swagger_spec/service_broker_swaggerspec_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/swagger_spec/service_broker_swaggerspec_responses.go @@ -7,6 +7,7 @@ package swagger_spec import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type ServiceBrokerSwaggerspecReader struct { } // ReadResponse reads a server response into the received o. -func (o *ServiceBrokerSwaggerspecReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ServiceBrokerSwaggerspecReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewServiceBrokerSwaggerspecOK() @@ -120,7 +121,7 @@ func (o *ServiceBrokerSwaggerspecOK) GetPayload() models.Object { func (o *ServiceBrokerSwaggerspecOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -190,7 +191,7 @@ func (o *ServiceBrokerSwaggerspecBadRequest) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -260,7 +261,7 @@ func (o *ServiceBrokerSwaggerspecUnauthorized) readResponse(response runtime.Cli o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -330,7 +331,7 @@ func (o *ServiceBrokerSwaggerspecForbidden) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -400,7 +401,7 @@ func (o *ServiceBrokerSwaggerspecNotFound) readResponse(response runtime.ClientR o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/swagger_spec/swagger_spec_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/swagger_spec/swagger_spec_client.go index 6ac981083d2..eb010206c2a 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/swagger_spec/swagger_spec_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/swagger_spec/swagger_spec_client.go @@ -65,7 +65,7 @@ type ClientService interface { ServiceBrokerSwaggerspec gets swagger json spec */ func (a *Client) ServiceBrokerSwaggerspec(params *ServiceBrokerSwaggerspecParams, opts ...ClientOption) (*ServiceBrokerSwaggerspecOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewServiceBrokerSwaggerspecParams() } @@ -84,17 +84,22 @@ func (a *Client) ServiceBrokerSwaggerspec(params *ServiceBrokerSwaggerspecParams for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*ServiceBrokerSwaggerspecOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for serviceBroker.swaggerspec: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/workspaces/v1_workspaces_get_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/workspaces/v1_workspaces_get_responses.go index 9a44710f9a2..824e7994c12 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/workspaces/v1_workspaces_get_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/workspaces/v1_workspaces_get_responses.go @@ -7,6 +7,7 @@ package workspaces import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1WorkspacesGetReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1WorkspacesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1WorkspacesGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1WorkspacesGetOK() @@ -134,7 +135,7 @@ func (o *V1WorkspacesGetOK) readResponse(response runtime.ClientResponse, consum o.Payload = new(models.Workspace) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -204,7 +205,7 @@ func (o *V1WorkspacesGetBadRequest) readResponse(response runtime.ClientResponse o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -274,7 +275,7 @@ func (o *V1WorkspacesGetUnauthorized) readResponse(response runtime.ClientRespon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -344,7 +345,7 @@ func (o *V1WorkspacesGetForbidden) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -414,7 +415,7 @@ func (o *V1WorkspacesGetNotFound) readResponse(response runtime.ClientResponse, o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -484,7 +485,7 @@ func (o *V1WorkspacesGetTooManyRequests) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -554,7 +555,7 @@ func (o *V1WorkspacesGetInternalServerError) readResponse(response runtime.Clien o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/workspaces/v1_workspaces_getall_parameters.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/workspaces/v1_workspaces_getall_parameters.go index 7e777b84828..126c502f334 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/workspaces/v1_workspaces_getall_parameters.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/workspaces/v1_workspaces_getall_parameters.go @@ -14,6 +14,7 @@ import ( "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" ) // NewV1WorkspacesGetallParams creates a new V1WorkspacesGetallParams object, @@ -60,6 +61,13 @@ V1WorkspacesGetallParams contains all the parameters to send to the API endpoint Typically these are written to a http.Request. */ type V1WorkspacesGetallParams struct { + + /* TgwByPassEnabled. + + Enable transit gateway bypass for the workspace list (default=false) + */ + TgwByPassEnabled *bool + timeout time.Duration Context context.Context HTTPClient *http.Client @@ -113,6 +121,17 @@ func (o *V1WorkspacesGetallParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithTgwByPassEnabled adds the tgwByPassEnabled to the v1 workspaces getall params +func (o *V1WorkspacesGetallParams) WithTgwByPassEnabled(tgwByPassEnabled *bool) *V1WorkspacesGetallParams { + o.SetTgwByPassEnabled(tgwByPassEnabled) + return o +} + +// SetTgwByPassEnabled adds the tgwByPassEnabled to the v1 workspaces getall params +func (o *V1WorkspacesGetallParams) SetTgwByPassEnabled(tgwByPassEnabled *bool) { + o.TgwByPassEnabled = tgwByPassEnabled +} + // WriteToRequest writes these params to a swagger request func (o *V1WorkspacesGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -121,6 +140,23 @@ func (o *V1WorkspacesGetallParams) WriteToRequest(r runtime.ClientRequest, reg s } var res []error + if o.TgwByPassEnabled != nil { + + // query param tgwByPassEnabled + var qrTgwByPassEnabled bool + + if o.TgwByPassEnabled != nil { + qrTgwByPassEnabled = *o.TgwByPassEnabled + } + qTgwByPassEnabled := swag.FormatBool(qrTgwByPassEnabled) + if qTgwByPassEnabled != "" { + + if err := r.SetQueryParam("tgwByPassEnabled", qTgwByPassEnabled); err != nil { + return err + } + } + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/workspaces/v1_workspaces_getall_responses.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/workspaces/v1_workspaces_getall_responses.go index 1ab245fc29b..2a08b56f7b8 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/workspaces/v1_workspaces_getall_responses.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/workspaces/v1_workspaces_getall_responses.go @@ -7,6 +7,7 @@ package workspaces import ( "encoding/json" + stderrors "errors" "fmt" "io" @@ -22,7 +23,7 @@ type V1WorkspacesGetallReader struct { } // ReadResponse reads a server response into the received o. -func (o *V1WorkspacesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *V1WorkspacesGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) { switch response.Code() { case 200: result := NewV1WorkspacesGetallOK() @@ -122,7 +123,7 @@ func (o *V1WorkspacesGetallOK) readResponse(response runtime.ClientResponse, con o.Payload = new(models.Workspaces) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -192,7 +193,7 @@ func (o *V1WorkspacesGetallUnauthorized) readResponse(response runtime.ClientRes o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -262,7 +263,7 @@ func (o *V1WorkspacesGetallForbidden) readResponse(response runtime.ClientRespon o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -332,7 +333,7 @@ func (o *V1WorkspacesGetallTooManyRequests) readResponse(response runtime.Client o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } @@ -402,7 +403,7 @@ func (o *V1WorkspacesGetallInternalServerError) readResponse(response runtime.Cl o.Payload = new(models.Error) // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/client/workspaces/workspaces_client.go b/vendor/github.com/IBM-Cloud/power-go-client/power/client/workspaces/workspaces_client.go index be7f3e6eed4..d8eb73b97f5 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/client/workspaces/workspaces_client.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/client/workspaces/workspaces_client.go @@ -67,7 +67,7 @@ type ClientService interface { V1WorkspacesGet gets a workspace s information and capabilities */ func (a *Client) V1WorkspacesGet(params *V1WorkspacesGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1WorkspacesGetOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1WorkspacesGetParams() } @@ -87,17 +87,22 @@ func (a *Client) V1WorkspacesGet(params *V1WorkspacesGetParams, authInfo runtime for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1WorkspacesGetOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.workspaces.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -106,7 +111,7 @@ func (a *Client) V1WorkspacesGet(params *V1WorkspacesGetParams, authInfo runtime V1WorkspacesGetall gets all workspaces information and capabilities for a tenant */ func (a *Client) V1WorkspacesGetall(params *V1WorkspacesGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1WorkspacesGetallOK, error) { - // TODO: Validate the params before sending + // NOTE: parameters are not validated before sending if params == nil { params = NewV1WorkspacesGetallParams() } @@ -126,17 +131,22 @@ func (a *Client) V1WorkspacesGetall(params *V1WorkspacesGetallParams, authInfo r for _, opt := range opts { opt(op) } - result, err := a.transport.Submit(op) if err != nil { return nil, err } + + // only one success response has to be checked success, ok := result.(*V1WorkspacesGetallOK) if ok { return success, nil } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + + // unexpected success response. + + // no default response is defined. + // + // safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue msg := fmt.Sprintf("unexpected success response for v1.workspaces.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/access_config.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/access_config.go index 1761bf0bb4a..4493985fc84 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/access_config.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/access_config.go @@ -14,7 +14,7 @@ import ( "github.com/go-openapi/validate" ) -// AccessConfig (deprecated - replaced by network peer id) +// AccessConfig [DEPRECATED] // Network communication configuration (for satellite locations only) // - `internal-only` - network is only used for internal host communication // - `outbound-only` - network will be capable of egress traffic @@ -53,7 +53,7 @@ const ( ) // for schema -var accessConfigEnum []interface{} +var accessConfigEnum []any func init() { var res []AccessConfig diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/access_role.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/access_role.go index 8b9f0224cc3..acb6955ebc7 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/access_role.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/access_role.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -49,11 +50,15 @@ func (m *AccessRole) validatePermissions(formats strfmt.Registry) error { if m.Permissions != nil { if err := m.Permissions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("permissions") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("permissions") } + return err } } @@ -80,11 +85,15 @@ func (m *AccessRole) contextValidatePermissions(ctx context.Context, formats str if m.Permissions != nil { if err := m.Permissions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("permissions") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("permissions") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/add_host.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/add_host.go index b4220ea7f94..3820a95da56 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/add_host.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/add_host.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -21,6 +22,9 @@ type AddHost struct { // Name of the host chosen by the user // Required: true + // Max Length: 32 + // Min Length: 2 + // Pattern: ^[A-Za-z0-9](?:[A-Za-z0-9_-]{0,30}[A-Za-z0-9])?$ DisplayName *string `json:"displayName"` // System type @@ -59,6 +63,18 @@ func (m *AddHost) validateDisplayName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("displayName", "body", *m.DisplayName, 2); err != nil { + return err + } + + if err := validate.MaxLength("displayName", "body", *m.DisplayName, 32); err != nil { + return err + } + + if err := validate.Pattern("displayName", "body", *m.DisplayName, `^[A-Za-z0-9](?:[A-Za-z0-9_-]{0,30}[A-Za-z0-9])?$`); err != nil { + return err + } + return nil } @@ -77,11 +93,15 @@ func (m *AddHost) validateUserTags(formats strfmt.Registry) error { } if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } @@ -105,11 +125,15 @@ func (m *AddHost) ContextValidate(ctx context.Context, formats strfmt.Registry) func (m *AddHost) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/auxiliary_volumes_for_onboarding.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/auxiliary_volumes_for_onboarding.go index 0fd76126515..150691b45e6 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/auxiliary_volumes_for_onboarding.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/auxiliary_volumes_for_onboarding.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -60,11 +61,15 @@ func (m *AuxiliaryVolumesForOnboarding) validateAuxiliaryVolumes(formats strfmt. if m.AuxiliaryVolumes[i] != nil { if err := m.AuxiliaryVolumes[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("auxiliaryVolumes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("auxiliaryVolumes" + "." + strconv.Itoa(i)) } + return err } } @@ -108,11 +113,15 @@ func (m *AuxiliaryVolumesForOnboarding) contextValidateAuxiliaryVolumes(ctx cont } if err := m.AuxiliaryVolumes[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("auxiliaryVolumes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("auxiliaryVolumes" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/available_host.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/available_host.go index db8b23bae1e..91101469578 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/available_host.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/available_host.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -49,11 +50,15 @@ func (m *AvailableHost) validateCapacity(formats strfmt.Registry) error { if m.Capacity != nil { if err := m.Capacity.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("capacity") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("capacity") } + return err } } @@ -84,11 +89,15 @@ func (m *AvailableHost) contextValidateCapacity(ctx context.Context, formats str } if err := m.Capacity.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("capacity") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("capacity") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/available_host_capacity.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/available_host_capacity.go index 0aed652d12b..a070840989b 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/available_host_capacity.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/available_host_capacity.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -50,11 +51,15 @@ func (m *AvailableHostCapacity) validateCores(formats strfmt.Registry) error { if m.Cores != nil { if err := m.Cores.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("cores") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("cores") } + return err } } @@ -69,11 +74,15 @@ func (m *AvailableHostCapacity) validateMemory(formats strfmt.Registry) error { if m.Memory != nil { if err := m.Memory.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("memory") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("memory") } + return err } } @@ -108,11 +117,15 @@ func (m *AvailableHostCapacity) contextValidateCores(ctx context.Context, format } if err := m.Cores.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("cores") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("cores") } + return err } } @@ -129,11 +142,15 @@ func (m *AvailableHostCapacity) contextValidateMemory(ctx context.Context, forma } if err := m.Memory.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("memory") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("memory") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/available_host_list.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/available_host_list.go index 17015104d6f..0047fee256b 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/available_host_list.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/available_host_list.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -29,11 +30,15 @@ func (m AvailableHostList) Validate(formats strfmt.Registry) error { } if val, ok := m[k]; ok { if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName(k) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName(k) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/available_stock_images.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/available_stock_images.go index ba40ca2d337..eaaebc71eb9 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/available_stock_images.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/available_stock_images.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -29,11 +30,15 @@ func (m AvailableStockImages) Validate(formats strfmt.Registry) error { } if err := m[k].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName(k) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName(k) } + return err } @@ -52,11 +57,15 @@ func (m AvailableStockImages) ContextValidate(ctx context.Context, formats strfm for k := range m { if err := m[k].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName(k) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName(k) } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/capabilities_details.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/capabilities_details.go index 9f11c204556..099c607bdcb 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/capabilities_details.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/capabilities_details.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -54,11 +55,15 @@ func (m *CapabilitiesDetails) validateDisasterRecovery(formats strfmt.Registry) if m.DisasterRecovery != nil { if err := m.DisasterRecovery.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("disasterRecovery") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("disasterRecovery") } + return err } } @@ -74,11 +79,15 @@ func (m *CapabilitiesDetails) validateSupportedSystems(formats strfmt.Registry) if m.SupportedSystems != nil { if err := m.SupportedSystems.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("supportedSystems") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("supportedSystems") } + return err } } @@ -109,11 +118,15 @@ func (m *CapabilitiesDetails) contextValidateDisasterRecovery(ctx context.Contex if m.DisasterRecovery != nil { if err := m.DisasterRecovery.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("disasterRecovery") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("disasterRecovery") } + return err } } @@ -126,11 +139,15 @@ func (m *CapabilitiesDetails) contextValidateSupportedSystems(ctx context.Contex if m.SupportedSystems != nil { if err := m.SupportedSystems.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("supportedSystems") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("supportedSystems") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/catalog.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/catalog.go index a5091d5ca3b..5351d9fb987 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/catalog.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/catalog.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -49,11 +50,15 @@ func (m *Catalog) validateServices(formats strfmt.Registry) error { if m.Services[i] != nil { if err := m.Services[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("services" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("services" + "." + strconv.Itoa(i)) } + return err } } @@ -88,11 +93,15 @@ func (m *Catalog) contextValidateServices(ctx context.Context, formats strfmt.Re } if err := m.Services[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("services" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("services" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/clone_task_status.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/clone_task_status.go index 1099b76a92f..f1cccd7b488 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/clone_task_status.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/clone_task_status.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -71,11 +72,15 @@ func (m *CloneTaskStatus) validateClonedVolumes(formats strfmt.Registry) error { if m.ClonedVolumes[i] != nil { if err := m.ClonedVolumes[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("clonedVolumes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("clonedVolumes" + "." + strconv.Itoa(i)) } + return err } } @@ -94,7 +99,7 @@ func (m *CloneTaskStatus) validatePercentComplete(formats strfmt.Registry) error return nil } -var cloneTaskStatusTypeStatusPropEnum []interface{} +var cloneTaskStatusTypeStatusPropEnum []any func init() { var res []string @@ -168,11 +173,15 @@ func (m *CloneTaskStatus) contextValidateClonedVolumes(ctx context.Context, form } if err := m.ClonedVolumes[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("clonedVolumes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("clonedVolumes" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloned_volume_detail.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloned_volume_detail.go index 0b241dc4059..302b15e54ba 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloned_volume_detail.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloned_volume_detail.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -54,11 +55,15 @@ func (m *ClonedVolumeDetail) validateClone(formats strfmt.Registry) error { if m.Clone != nil { if err := m.Clone.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("clone") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("clone") } + return err } } @@ -74,11 +79,15 @@ func (m *ClonedVolumeDetail) validateSource(formats strfmt.Registry) error { if m.Source != nil { if err := m.Source.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("source") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("source") } + return err } } @@ -109,11 +118,15 @@ func (m *ClonedVolumeDetail) contextValidateClone(ctx context.Context, formats s if m.Clone != nil { if err := m.Clone.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("clone") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("clone") } + return err } } @@ -126,11 +139,15 @@ func (m *ClonedVolumeDetail) contextValidateSource(ctx context.Context, formats if m.Source != nil { if err := m.Source.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("source") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("source") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection.go index 3aa1bdd0d4d..f263a74e444 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -143,11 +144,15 @@ func (m *CloudConnection) validateClassic(formats strfmt.Registry) error { if m.Classic != nil { if err := m.Classic.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("classic") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("classic") } + return err } } @@ -234,11 +239,15 @@ func (m *CloudConnection) validateNetworks(formats strfmt.Registry) error { if m.Networks[i] != nil { if err := m.Networks[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("networks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("networks" + "." + strconv.Itoa(i)) } + return err } } @@ -282,11 +291,15 @@ func (m *CloudConnection) validateVpc(formats strfmt.Registry) error { if m.Vpc != nil { if err := m.Vpc.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("vpc") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("vpc") } + return err } } @@ -325,11 +338,15 @@ func (m *CloudConnection) contextValidateClassic(ctx context.Context, formats st } if err := m.Classic.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("classic") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("classic") } + return err } } @@ -348,11 +365,15 @@ func (m *CloudConnection) contextValidateNetworks(ctx context.Context, formats s } if err := m.Networks[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("networks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("networks" + "." + strconv.Itoa(i)) } + return err } } @@ -371,11 +392,15 @@ func (m *CloudConnection) contextValidateVpc(ctx context.Context, formats strfmt } if err := m.Vpc.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("vpc") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("vpc") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_create.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_create.go index ccae9f01d45..90d6969b855 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_create.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_create.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -81,11 +82,15 @@ func (m *CloudConnectionCreate) validateClassic(formats strfmt.Registry) error { if m.Classic != nil { if err := m.Classic.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("classic") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("classic") } + return err } } @@ -102,7 +107,7 @@ func (m *CloudConnectionCreate) validateName(formats strfmt.Registry) error { return nil } -var cloudConnectionCreateTypeSpeedPropEnum []interface{} +var cloudConnectionCreateTypeSpeedPropEnum []any func init() { var res []int64 @@ -143,11 +148,15 @@ func (m *CloudConnectionCreate) validateVpc(formats strfmt.Registry) error { if m.Vpc != nil { if err := m.Vpc.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("vpc") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("vpc") } + return err } } @@ -182,11 +191,15 @@ func (m *CloudConnectionCreate) contextValidateClassic(ctx context.Context, form } if err := m.Classic.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("classic") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("classic") } + return err } } @@ -203,11 +216,15 @@ func (m *CloudConnectionCreate) contextValidateVpc(ctx context.Context, formats } if err := m.Vpc.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("vpc") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("vpc") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_create_response.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_create_response.go index 4797f9a4168..1125f3dfc11 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_create_response.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_create_response.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -94,11 +95,15 @@ func (m *CloudConnectionCreateResponse) validateJobRef(formats strfmt.Registry) if m.JobRef != nil { if err := m.JobRef.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("jobRef") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("jobRef") } + return err } } @@ -134,11 +139,15 @@ func (m *CloudConnectionCreateResponse) contextValidateJobRef(ctx context.Contex } if err := m.JobRef.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("jobRef") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("jobRef") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_endpoint_classic.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_endpoint_classic.go index 201be27e5b9..579da3bdb3a 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_endpoint_classic.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_endpoint_classic.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -46,11 +47,15 @@ func (m *CloudConnectionEndpointClassic) validateGre(formats strfmt.Registry) er if m.Gre != nil { if err := m.Gre.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("gre") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("gre") } + return err } } @@ -81,11 +86,15 @@ func (m *CloudConnectionEndpointClassic) contextValidateGre(ctx context.Context, } if err := m.Gre.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("gre") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("gre") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_endpoint_classic_update.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_endpoint_classic_update.go index bda835e0c30..6c1d3ca8b7b 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_endpoint_classic_update.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_endpoint_classic_update.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -46,11 +47,15 @@ func (m *CloudConnectionEndpointClassicUpdate) validateGre(formats strfmt.Regist if m.Gre != nil { if err := m.Gre.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("gre") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("gre") } + return err } } @@ -81,11 +86,15 @@ func (m *CloudConnectionEndpointClassicUpdate) contextValidateGre(ctx context.Co } if err := m.Gre.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("gre") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("gre") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_endpoint_v_p_c.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_endpoint_v_p_c.go index c2b158c4ab8..dfd82bab8b2 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_endpoint_v_p_c.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_endpoint_v_p_c.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -52,11 +53,15 @@ func (m *CloudConnectionEndpointVPC) validateVpcs(formats strfmt.Registry) error if m.Vpcs[i] != nil { if err := m.Vpcs[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("vpcs" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("vpcs" + "." + strconv.Itoa(i)) } + return err } } @@ -91,11 +96,15 @@ func (m *CloudConnectionEndpointVPC) contextValidateVpcs(ctx context.Context, fo } if err := m.Vpcs[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("vpcs" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("vpcs" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_update.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_update.go index eedf1a7ac3f..c634b5333ed 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_update.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_update.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -69,11 +70,15 @@ func (m *CloudConnectionUpdate) validateClassic(formats strfmt.Registry) error { if m.Classic != nil { if err := m.Classic.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("classic") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("classic") } + return err } } @@ -81,7 +86,7 @@ func (m *CloudConnectionUpdate) validateClassic(formats strfmt.Registry) error { return nil } -var cloudConnectionUpdateTypeSpeedPropEnum []interface{} +var cloudConnectionUpdateTypeSpeedPropEnum []any func init() { var res []int64 @@ -121,11 +126,15 @@ func (m *CloudConnectionUpdate) validateVpc(formats strfmt.Registry) error { if m.Vpc != nil { if err := m.Vpc.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("vpc") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("vpc") } + return err } } @@ -160,11 +169,15 @@ func (m *CloudConnectionUpdate) contextValidateClassic(ctx context.Context, form } if err := m.Classic.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("classic") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("classic") } + return err } } @@ -181,11 +194,15 @@ func (m *CloudConnectionUpdate) contextValidateVpc(ctx context.Context, formats } if err := m.Vpc.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("vpc") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("vpc") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_virtual_private_clouds.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_virtual_private_clouds.go index 509dc9ce763..2e682afe4f2 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_virtual_private_clouds.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connection_virtual_private_clouds.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -52,11 +53,15 @@ func (m *CloudConnectionVirtualPrivateClouds) validateVirtualPrivateClouds(forma if m.VirtualPrivateClouds[i] != nil { if err := m.VirtualPrivateClouds[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("virtualPrivateClouds" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("virtualPrivateClouds" + "." + strconv.Itoa(i)) } + return err } } @@ -91,11 +96,15 @@ func (m *CloudConnectionVirtualPrivateClouds) contextValidateVirtualPrivateCloud } if err := m.VirtualPrivateClouds[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("virtualPrivateClouds" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("virtualPrivateClouds" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connections.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connections.go index 337c969024b..1fe10cd3a6d 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connections.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_connections.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -52,11 +53,15 @@ func (m *CloudConnections) validateCloudConnections(formats strfmt.Registry) err if m.CloudConnections[i] != nil { if err := m.CloudConnections[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("cloudConnections" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("cloudConnections" + "." + strconv.Itoa(i)) } + return err } } @@ -91,11 +96,15 @@ func (m *CloudConnections) contextValidateCloudConnections(ctx context.Context, } if err := m.CloudConnections[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("cloudConnections" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("cloudConnections" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_initialization.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_initialization.go index 3bc111b2b56..5bdc82517c9 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_initialization.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_initialization.go @@ -39,7 +39,7 @@ func (m *CloudInitialization) Validate(formats strfmt.Registry) error { return nil } -var cloudInitializationTypeVirtualOpticalDevicePropEnum []interface{} +var cloudInitializationTypeVirtualOpticalDevicePropEnum []any func init() { var res []string diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_instance.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_instance.go index 8a66d0a3f5e..16f20a0fb29 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_instance.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_instance.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -149,11 +150,15 @@ func (m *CloudInstance) validateLimits(formats strfmt.Registry) error { if m.Limits != nil { if err := m.Limits.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("limits") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("limits") } + return err } } @@ -192,11 +197,15 @@ func (m *CloudInstance) validatePvmInstances(formats strfmt.Registry) error { if m.PvmInstances[i] != nil { if err := m.PvmInstances[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) } + return err } } @@ -232,11 +241,15 @@ func (m *CloudInstance) validateUsage(formats strfmt.Registry) error { if m.Usage != nil { if err := m.Usage.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("usage") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("usage") } + return err } } @@ -271,11 +284,15 @@ func (m *CloudInstance) contextValidateLimits(ctx context.Context, formats strfm if m.Limits != nil { if err := m.Limits.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("limits") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("limits") } + return err } } @@ -294,11 +311,15 @@ func (m *CloudInstance) contextValidatePvmInstances(ctx context.Context, formats } if err := m.PvmInstances[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) } + return err } } @@ -313,11 +334,15 @@ func (m *CloudInstance) contextValidateUsage(ctx context.Context, formats strfmt if m.Usage != nil { if err := m.Usage.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("usage") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("usage") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_instance_reference.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_instance_reference.go index c9129f31694..dfae399fb8d 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_instance_reference.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_instance_reference.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -133,11 +134,15 @@ func (m *CloudInstanceReference) validateLimits(formats strfmt.Registry) error { if m.Limits != nil { if err := m.Limits.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("limits") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("limits") } + return err } } @@ -182,11 +187,15 @@ func (m *CloudInstanceReference) contextValidateLimits(ctx context.Context, form if m.Limits != nil { if err := m.Limits.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("limits") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("limits") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_instance_shared_images.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_instance_shared_images.go new file mode 100644 index 00000000000..d33f4b49329 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/cloud_instance_shared_images.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CloudInstanceSharedImages cloud instance shared images +// +// swagger:model CloudInstanceSharedImages +type CloudInstanceSharedImages struct { + + // Allow images from this Cloud Instance to be shared + SharedImages bool `json:"sharedImages,omitempty"` +} + +// Validate validates this cloud instance shared images +func (m *CloudInstanceSharedImages) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this cloud instance shared images based on context it is used +func (m *CloudInstanceSharedImages) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CloudInstanceSharedImages) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CloudInstanceSharedImages) UnmarshalBinary(b []byte) error { + var res CloudInstanceSharedImages + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/console_languages.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/console_languages.go index 414ad193d5a..fb4a5ba7638 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/console_languages.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/console_languages.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -52,11 +53,15 @@ func (m *ConsoleLanguages) validateConsoleLanguages(formats strfmt.Registry) err if m.ConsoleLanguages[i] != nil { if err := m.ConsoleLanguages[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("consoleLanguages" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("consoleLanguages" + "." + strconv.Itoa(i)) } + return err } } @@ -91,11 +96,15 @@ func (m *ConsoleLanguages) contextValidateConsoleLanguages(ctx context.Context, } if err := m.ConsoleLanguages[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("consoleLanguages" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("consoleLanguages" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/context.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/context.go index 85e1cd011d1..fe61dc553e5 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/context.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/context.go @@ -8,4 +8,4 @@ package models // Context See [Context Conventions](https://github.com/openservicebrokerapi/servicebroker/blob/master/profile.md#context-object) for more details. // // swagger:model Context -type Context interface{} +type Context any diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_cos_image_import_job.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_cos_image_import_job.go index 9c83a7b53a3..6f043d707b9 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_cos_image_import_job.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_cos_image_import_job.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -115,7 +116,7 @@ func (m *CreateCosImageImportJob) Validate(formats strfmt.Registry) error { return nil } -var createCosImageImportJobTypeBucketAccessPropEnum []interface{} +var createCosImageImportJobTypeBucketAccessPropEnum []any func init() { var res []string @@ -191,11 +192,15 @@ func (m *CreateCosImageImportJob) validateImportDetails(formats strfmt.Registry) if m.ImportDetails != nil { if err := m.ImportDetails.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("importDetails") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("importDetails") } + return err } } @@ -203,7 +208,7 @@ func (m *CreateCosImageImportJob) validateImportDetails(formats strfmt.Registry) return nil } -var createCosImageImportJobTypeOsTypePropEnum []interface{} +var createCosImageImportJobTypeOsTypePropEnum []any func init() { var res []string @@ -267,11 +272,15 @@ func (m *CreateCosImageImportJob) validateStorageAffinity(formats strfmt.Registr if m.StorageAffinity != nil { if err := m.StorageAffinity.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("storageAffinity") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("storageAffinity") } + return err } } @@ -285,11 +294,15 @@ func (m *CreateCosImageImportJob) validateUserTags(formats strfmt.Registry) erro } if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } @@ -327,11 +340,15 @@ func (m *CreateCosImageImportJob) contextValidateImportDetails(ctx context.Conte } if err := m.ImportDetails.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("importDetails") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("importDetails") } + return err } } @@ -348,11 +365,15 @@ func (m *CreateCosImageImportJob) contextValidateStorageAffinity(ctx context.Con } if err := m.StorageAffinity.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("storageAffinity") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("storageAffinity") } + return err } } @@ -363,11 +384,15 @@ func (m *CreateCosImageImportJob) contextValidateStorageAffinity(ctx context.Con func (m *CreateCosImageImportJob) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_data_volume.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_data_volume.go index aa2aafc2e7d..d5f14a2e6f4 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_data_volume.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_data_volume.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -89,7 +90,7 @@ func (m *CreateDataVolume) Validate(formats strfmt.Registry) error { return nil } -var createDataVolumeTypeAffinityPolicyPropEnum []interface{} +var createDataVolumeTypeAffinityPolicyPropEnum []any func init() { var res []string @@ -155,11 +156,15 @@ func (m *CreateDataVolume) validateUserTags(formats strfmt.Registry) error { } if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } @@ -183,11 +188,15 @@ func (m *CreateDataVolume) ContextValidate(ctx context.Context, formats strfmt.R func (m *CreateDataVolume) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_image.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_image.go index 6603970bd03..5863fe35c3b 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_image.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_image.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -94,7 +95,7 @@ func (m *CreateImage) Validate(formats strfmt.Registry) error { return nil } -var createImageTypeOsTypePropEnum []interface{} +var createImageTypeOsTypePropEnum []any func init() { var res []string @@ -142,7 +143,7 @@ func (m *CreateImage) validateOsType(formats strfmt.Registry) error { return nil } -var createImageTypeSourcePropEnum []interface{} +var createImageTypeSourcePropEnum []any func init() { var res []string @@ -192,11 +193,15 @@ func (m *CreateImage) validateStorageAffinity(formats strfmt.Registry) error { if m.StorageAffinity != nil { if err := m.StorageAffinity.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("storageAffinity") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("storageAffinity") } + return err } } @@ -210,11 +215,15 @@ func (m *CreateImage) validateUserTags(formats strfmt.Registry) error { } if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } @@ -248,11 +257,15 @@ func (m *CreateImage) contextValidateStorageAffinity(ctx context.Context, format } if err := m.StorageAffinity.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("storageAffinity") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("storageAffinity") } + return err } } @@ -263,11 +276,15 @@ func (m *CreateImage) contextValidateStorageAffinity(ctx context.Context, format func (m *CreateImage) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_server_virtual_serial_number.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_server_virtual_serial_number.go index a69712d6909..5bbfd42a8a2 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_server_virtual_serial_number.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_server_virtual_serial_number.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -63,11 +64,15 @@ func (m *CreateServerVirtualSerialNumber) validateSoftwareTier(formats strfmt.Re } if err := m.SoftwareTier.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("softwareTier") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("softwareTier") } + return err } @@ -95,11 +100,15 @@ func (m *CreateServerVirtualSerialNumber) contextValidateSoftwareTier(ctx contex } if err := m.SoftwareTier.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("softwareTier") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("softwareTier") } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_workspace_ssh_key.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_workspace_ssh_key.go index c717df6dbed..d4605d63fa6 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_workspace_ssh_key.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/create_workspace_ssh_key.go @@ -86,7 +86,7 @@ func (m *CreateWorkspaceSSHKey) validateSSHKey(formats strfmt.Registry) error { return nil } -var createWorkspaceSshKeyTypeVisibilityPropEnum []interface{} +var createWorkspaceSshKeyTypeVisibilityPropEnum []any func init() { var res []string diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/d_h_c_p_server.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/d_h_c_p_server.go index 9721c12b555..8a6a54be542 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/d_h_c_p_server.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/d_h_c_p_server.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -71,11 +72,15 @@ func (m *DHCPServer) validateNetwork(formats strfmt.Registry) error { if m.Network != nil { if err := m.Network.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("network") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("network") } + return err } } @@ -111,11 +116,15 @@ func (m *DHCPServer) contextValidateNetwork(ctx context.Context, formats strfmt. if m.Network != nil { if err := m.Network.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("network") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("network") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/d_h_c_p_server_detail.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/d_h_c_p_server_detail.go index fac08ad210f..57bd23cada1 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/d_h_c_p_server_detail.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/d_h_c_p_server_detail.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -83,11 +84,15 @@ func (m *DHCPServerDetail) validateLeases(formats strfmt.Registry) error { if m.Leases[i] != nil { if err := m.Leases[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("leases" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("leases" + "." + strconv.Itoa(i)) } + return err } } @@ -105,11 +110,15 @@ func (m *DHCPServerDetail) validateNetwork(formats strfmt.Registry) error { if m.Network != nil { if err := m.Network.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("network") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("network") } + return err } } @@ -155,11 +164,15 @@ func (m *DHCPServerDetail) contextValidateLeases(ctx context.Context, formats st } if err := m.Leases[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("leases" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("leases" + "." + strconv.Itoa(i)) } + return err } } @@ -174,11 +187,15 @@ func (m *DHCPServerDetail) contextValidateNetwork(ctx context.Context, formats s if m.Network != nil { if err := m.Network.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("network") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("network") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/d_h_c_p_servers.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/d_h_c_p_servers.go index 4ebec2cc022..463c93405de 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/d_h_c_p_servers.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/d_h_c_p_servers.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -30,11 +31,15 @@ func (m DHCPServers) Validate(formats strfmt.Registry) error { if m[i] != nil { if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName(strconv.Itoa(i)) } + return err } } @@ -60,11 +65,15 @@ func (m DHCPServers) ContextValidate(ctx context.Context, formats strfmt.Registr } if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName(strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/datacenter.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/datacenter.go index 4dae0a17ed3..789286073ff 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/datacenter.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/datacenter.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -91,11 +92,15 @@ func (m *Datacenter) validateCapabilitiesDetails(formats strfmt.Registry) error if m.CapabilitiesDetails != nil { if err := m.CapabilitiesDetails.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("capabilitiesDetails") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("capabilitiesDetails") } + return err } } @@ -111,11 +116,15 @@ func (m *Datacenter) validateLocation(formats strfmt.Registry) error { if m.Location != nil { if err := m.Location.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("location") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("location") } + return err } } @@ -123,7 +132,7 @@ func (m *Datacenter) validateLocation(formats strfmt.Registry) error { return nil } -var datacenterTypeStatusPropEnum []interface{} +var datacenterTypeStatusPropEnum []any func init() { var res []string @@ -169,7 +178,7 @@ func (m *Datacenter) validateStatus(formats strfmt.Registry) error { return nil } -var datacenterTypeTypePropEnum []interface{} +var datacenterTypeTypePropEnum []any func init() { var res []string @@ -239,11 +248,15 @@ func (m *Datacenter) contextValidateCapabilitiesDetails(ctx context.Context, for } if err := m.CapabilitiesDetails.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("capabilitiesDetails") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("capabilitiesDetails") } + return err } } @@ -256,11 +269,15 @@ func (m *Datacenter) contextValidateLocation(ctx context.Context, formats strfmt if m.Location != nil { if err := m.Location.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("location") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("location") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/datacenters.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/datacenters.go index 9fd22e8fcb7..d83da880720 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/datacenters.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/datacenters.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -52,11 +53,15 @@ func (m *Datacenters) validateDatacenters(formats strfmt.Registry) error { if m.Datacenters[i] != nil { if err := m.Datacenters[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("datacenters" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("datacenters" + "." + strconv.Itoa(i)) } + return err } } @@ -91,11 +96,15 @@ func (m *Datacenters) contextValidateDatacenters(ctx context.Context, formats st } if err := m.Datacenters[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("datacenters" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("datacenters" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/dead_peer_detection.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/dead_peer_detection.go index 5ec338a856b..d1fa8aa2048 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/dead_peer_detection.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/dead_peer_detection.go @@ -62,7 +62,7 @@ func (m *DeadPeerDetection) Validate(formats strfmt.Registry) error { return nil } -var deadPeerDetectionTypeActionPropEnum []interface{} +var deadPeerDetectionTypeActionPropEnum []any func init() { var res []string diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/deployment_target.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/deployment_target.go index baf2b292a0b..65190f6f659 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/deployment_target.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/deployment_target.go @@ -57,7 +57,7 @@ func (m *DeploymentTarget) validateID(formats strfmt.Registry) error { return nil } -var deploymentTargetTypeTypePropEnum []interface{} +var deploymentTargetTypeTypePropEnum []any func init() { var res []string diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/disaster_recovery.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/disaster_recovery.go index f3e56e0cc37..695f1457284 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/disaster_recovery.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/disaster_recovery.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -53,11 +54,15 @@ func (m *DisasterRecovery) validateAsynchronousReplication(formats strfmt.Regist if m.AsynchronousReplication != nil { if err := m.AsynchronousReplication.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("asynchronousReplication") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("asynchronousReplication") } + return err } } @@ -72,11 +77,15 @@ func (m *DisasterRecovery) validateSynchronousReplication(formats strfmt.Registr if m.SynchronousReplication != nil { if err := m.SynchronousReplication.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("synchronousReplication") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("synchronousReplication") } + return err } } @@ -107,11 +116,15 @@ func (m *DisasterRecovery) contextValidateAsynchronousReplication(ctx context.Co if m.AsynchronousReplication != nil { if err := m.AsynchronousReplication.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("asynchronousReplication") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("asynchronousReplication") } + return err } } @@ -128,11 +141,15 @@ func (m *DisasterRecovery) contextValidateSynchronousReplication(ctx context.Con } if err := m.SynchronousReplication.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("synchronousReplication") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("synchronousReplication") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/disaster_recovery_location.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/disaster_recovery_location.go index a3e98f9b282..dcdfd1529e2 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/disaster_recovery_location.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/disaster_recovery_location.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -45,11 +46,15 @@ func (m *DisasterRecoveryLocation) validateReplicationSites(formats strfmt.Regis } if err := m.ReplicationSites.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("replicationSites") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("replicationSites") } + return err } @@ -73,11 +78,15 @@ func (m *DisasterRecoveryLocation) ContextValidate(ctx context.Context, formats func (m *DisasterRecoveryLocation) contextValidateReplicationSites(ctx context.Context, formats strfmt.Registry) error { if err := m.ReplicationSites.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("replicationSites") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("replicationSites") } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/disaster_recovery_locations.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/disaster_recovery_locations.go index ac7f31209dd..58ce8fe11fb 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/disaster_recovery_locations.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/disaster_recovery_locations.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -52,11 +53,15 @@ func (m *DisasterRecoveryLocations) validateDisasterRecoveryLocations(formats st if m.DisasterRecoveryLocations[i] != nil { if err := m.DisasterRecoveryLocations[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("disasterRecoveryLocations" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("disasterRecoveryLocations" + "." + strconv.Itoa(i)) } + return err } } @@ -91,11 +96,15 @@ func (m *DisasterRecoveryLocations) contextValidateDisasterRecoveryLocations(ctx } if err := m.DisasterRecoveryLocations[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("disasterRecoveryLocations" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("disasterRecoveryLocations" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/event.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/event.go index 79d6edec986..403f9aa90b3 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/event.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/event.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -38,7 +39,7 @@ type Event struct { Message *string `json:"message"` // Any metadata associated with the event - Metadata interface{} `json:"metadata,omitempty"` + Metadata any `json:"metadata,omitempty"` // Type of resource for this event // Required: true @@ -117,7 +118,7 @@ func (m *Event) validateEventID(formats strfmt.Registry) error { return nil } -var eventTypeLevelPropEnum []interface{} +var eventTypeLevelPropEnum []any func init() { var res []string @@ -213,11 +214,15 @@ func (m *Event) validateUser(formats strfmt.Registry) error { if m.User != nil { if err := m.User.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("user") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("user") } + return err } } @@ -248,11 +253,15 @@ func (m *Event) contextValidateUser(ctx context.Context, formats strfmt.Registry } if err := m.User.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("user") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("user") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/events.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/events.go index 669909f7222..ccb18dae489 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/events.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/events.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -52,11 +53,15 @@ func (m *Events) validateEvents(formats strfmt.Registry) error { if m.Events[i] != nil { if err := m.Events[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("events" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("events" + "." + strconv.Itoa(i)) } + return err } } @@ -91,11 +96,15 @@ func (m *Events) contextValidateEvents(ctx context.Context, formats strfmt.Regis } if err := m.Events[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("events" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("events" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/flash_copy_mappings.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/flash_copy_mappings.go index 70242a75282..b7608ab9815 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/flash_copy_mappings.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/flash_copy_mappings.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -30,11 +31,15 @@ func (m FlashCopyMappings) Validate(formats strfmt.Registry) error { if m[i] != nil { if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName(strconv.Itoa(i)) } + return err } } @@ -60,11 +65,15 @@ func (m FlashCopyMappings) ContextValidate(ctx context.Context, formats strfmt.R } if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName(strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/get_server_virtual_serial_number.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/get_server_virtual_serial_number.go index 116a64543a2..b5b58488801 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/get_server_virtual_serial_number.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/get_server_virtual_serial_number.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -77,11 +78,15 @@ func (m *GetServerVirtualSerialNumber) validateSoftwareTier(formats strfmt.Regis } if err := m.SoftwareTier.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("softwareTier") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("softwareTier") } + return err } @@ -109,11 +114,15 @@ func (m *GetServerVirtualSerialNumber) contextValidateSoftwareTier(ctx context.C } if err := m.SoftwareTier.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("softwareTier") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("softwareTier") } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/hardware_platform.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/hardware_platform.go index 0f6592e2639..cfd18bc35f6 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/hardware_platform.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/hardware_platform.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -67,11 +68,15 @@ func (m *HardwarePlatform) validateHostsResources(formats strfmt.Registry) error if m.HostsResources[i] != nil { if err := m.HostsResources[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("hostsResources" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("hostsResources" + "." + strconv.Itoa(i)) } + return err } } @@ -106,11 +111,15 @@ func (m *HardwarePlatform) contextValidateHostsResources(ctx context.Context, fo } if err := m.HostsResources[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("hostsResources" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("hostsResources" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/hardware_platforms.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/hardware_platforms.go index 8e98a5e08e2..ea5d89d0184 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/hardware_platforms.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/hardware_platforms.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -29,11 +30,15 @@ func (m HardwarePlatforms) Validate(formats strfmt.Registry) error { } if val, ok := m[k]; ok { if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName(k) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName(k) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_capacity.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_capacity.go index 506c43e5ede..4e2a7076876 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_capacity.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_capacity.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -50,11 +51,15 @@ func (m *HostCapacity) validateCores(formats strfmt.Registry) error { if m.Cores != nil { if err := m.Cores.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("cores") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("cores") } + return err } } @@ -69,11 +74,15 @@ func (m *HostCapacity) validateMemory(formats strfmt.Registry) error { if m.Memory != nil { if err := m.Memory.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("memory") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("memory") } + return err } } @@ -108,11 +117,15 @@ func (m *HostCapacity) contextValidateCores(ctx context.Context, formats strfmt. } if err := m.Cores.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("cores") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("cores") } + return err } } @@ -129,11 +142,15 @@ func (m *HostCapacity) contextValidateMemory(ctx context.Context, formats strfmt } if err := m.Memory.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("memory") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("memory") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_create.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_create.go index 8c256de80cb..aae5fbe124e 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_create.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_create.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -69,11 +70,15 @@ func (m *HostCreate) validateHosts(formats strfmt.Registry) error { if m.Hosts[i] != nil { if err := m.Hosts[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("hosts" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("hosts" + "." + strconv.Itoa(i)) } + return err } } @@ -108,11 +113,15 @@ func (m *HostCreate) contextValidateHosts(ctx context.Context, formats strfmt.Re } if err := m.Hosts[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("hosts" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("hosts" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_group.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_group.go index 2effa9326b9..92947b1c587 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_group.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_group.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -27,7 +28,7 @@ type HostGroup struct { // List of hosts Hosts []HostHref `json:"hosts"` - // Host group ID + // Host Group ID ID string `json:"id,omitempty"` // Name of the host group @@ -78,11 +79,15 @@ func (m *HostGroup) validateHosts(formats strfmt.Registry) error { for i := 0; i < len(m.Hosts); i++ { if err := m.Hosts[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("hosts" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("hosts" + "." + strconv.Itoa(i)) } + return err } @@ -114,11 +119,15 @@ func (m *HostGroup) contextValidateHosts(ctx context.Context, formats strfmt.Reg } if err := m.Hosts[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("hosts" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("hosts" + "." + strconv.Itoa(i)) } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_group_create.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_group_create.go index 48f3e169d52..d11e7a619e6 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_group_create.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_group_create.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -67,11 +68,15 @@ func (m *HostGroupCreate) validateHosts(formats strfmt.Registry) error { if m.Hosts[i] != nil { if err := m.Hosts[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("hosts" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("hosts" + "." + strconv.Itoa(i)) } + return err } } @@ -102,11 +107,15 @@ func (m *HostGroupCreate) validateSecondaries(formats strfmt.Registry) error { if m.Secondaries[i] != nil { if err := m.Secondaries[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("secondaries" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("secondaries" + "." + strconv.Itoa(i)) } + return err } } @@ -145,11 +154,15 @@ func (m *HostGroupCreate) contextValidateHosts(ctx context.Context, formats strf } if err := m.Hosts[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("hosts" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("hosts" + "." + strconv.Itoa(i)) } + return err } } @@ -170,11 +183,15 @@ func (m *HostGroupCreate) contextValidateSecondaries(ctx context.Context, format } if err := m.Secondaries[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("secondaries" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("secondaries" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_group_list.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_group_list.go index 617cb02d517..810dd6cd7b1 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_group_list.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_group_list.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -30,11 +31,15 @@ func (m HostGroupList) Validate(formats strfmt.Registry) error { if m[i] != nil { if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName(strconv.Itoa(i)) } + return err } } @@ -60,11 +65,15 @@ func (m HostGroupList) ContextValidate(ctx context.Context, formats strfmt.Regis } if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName(strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_group_share_op.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_group_share_op.go index f90d9d17c38..5fe85ef5f54 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_group_share_op.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_group_share_op.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -52,11 +53,15 @@ func (m *HostGroupShareOp) validateAdd(formats strfmt.Registry) error { if m.Add[i] != nil { if err := m.Add[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("add" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("add" + "." + strconv.Itoa(i)) } + return err } } @@ -91,11 +96,15 @@ func (m *HostGroupShareOp) contextValidateAdd(ctx context.Context, formats strfm } if err := m.Add[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("add" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("add" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_info.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_info.go index 754ed4ad22b..59485204d41 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_info.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_info.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -79,11 +80,15 @@ func (m *HostInfo) validateCores(formats strfmt.Registry) error { if m.Cores != nil { if err := m.Cores.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("cores") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("cores") } + return err } } @@ -117,11 +122,15 @@ func (m *HostInfo) validateMemory(formats strfmt.Registry) error { if m.Memory != nil { if err := m.Memory.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("memory") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("memory") } + return err } } @@ -142,11 +151,15 @@ func (m *HostInfo) validatePvmInstances(formats strfmt.Registry) error { if m.PvmInstances[i] != nil { if err := m.PvmInstances[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) } + return err } } @@ -183,11 +196,15 @@ func (m *HostInfo) contextValidateCores(ctx context.Context, formats strfmt.Regi if m.Cores != nil { if err := m.Cores.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("cores") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("cores") } + return err } } @@ -200,11 +217,15 @@ func (m *HostInfo) contextValidateMemory(ctx context.Context, formats strfmt.Reg if m.Memory != nil { if err := m.Memory.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("memory") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("memory") } + return err } } @@ -223,11 +244,15 @@ func (m *HostInfo) contextValidatePvmInstances(ctx context.Context, formats strf } if err := m.PvmInstances[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_list.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_list.go index 582de3fd91b..fddb1a89c98 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_list.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_list.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -30,11 +31,15 @@ func (m HostList) Validate(formats strfmt.Registry) error { if m[i] != nil { if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName(strconv.Itoa(i)) } + return err } } @@ -60,11 +65,15 @@ func (m HostList) ContextValidate(ctx context.Context, formats strfmt.Registry) } if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName(strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_p_vm_instance.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_p_vm_instance.go index d6c024a612a..364ae875549 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_p_vm_instance.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_p_vm_instance.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -95,11 +96,15 @@ func (m *HostPVMInstance) validateOwner(formats strfmt.Registry) error { if m.Owner != nil { if err := m.Owner.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("owner") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("owner") } + return err } } @@ -162,11 +167,15 @@ func (m *HostPVMInstance) contextValidateOwner(ctx context.Context, formats strf if m.Owner != nil { if err := m.Owner.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("owner") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("owner") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_put.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_put.go index ffb48fbb68b..f90f31fb508 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_put.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/host_put.go @@ -21,6 +21,9 @@ type HostPut struct { // Name of the host chosen by the user // Required: true + // Max Length: 32 + // Min Length: 2 + // Pattern: ^[A-Za-z0-9](?:[A-Za-z0-9_-]{0,30}[A-Za-z0-9])?$ DisplayName *string `json:"displayName"` } @@ -44,6 +47,18 @@ func (m *HostPut) validateDisplayName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("displayName", "body", *m.DisplayName, 2); err != nil { + return err + } + + if err := validate.MaxLength("displayName", "body", *m.DisplayName, 32); err != nil { + return err + } + + if err := validate.Pattern("displayName", "body", *m.DisplayName, `^[A-Za-z0-9](?:[A-Za-z0-9_-]{0,30}[A-Za-z0-9])?$`); err != nil { + return err + } + return nil } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policies.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policies.go index d8d27199cc5..646a4b98e1b 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policies.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policies.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -52,11 +53,15 @@ func (m *IKEPolicies) validateIkePolicies(formats strfmt.Registry) error { if m.IkePolicies[i] != nil { if err := m.IkePolicies[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("ikePolicies" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("ikePolicies" + "." + strconv.Itoa(i)) } + return err } } @@ -91,11 +96,15 @@ func (m *IKEPolicies) contextValidateIkePolicies(ctx context.Context, formats st } if err := m.IkePolicies[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("ikePolicies" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("ikePolicies" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy.go index b1464ef19ca..1c492e795f3 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -107,11 +108,15 @@ func (m *IKEPolicy) validateAuthentication(formats strfmt.Registry) error { if m.Authentication != nil { if err := m.Authentication.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("authentication") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("authentication") } + return err } } @@ -119,7 +124,7 @@ func (m *IKEPolicy) validateAuthentication(formats strfmt.Registry) error { return nil } -var iKEPolicyTypeDhGroupPropEnum []interface{} +var iKEPolicyTypeDhGroupPropEnum []any func init() { var res []int64 @@ -153,7 +158,7 @@ func (m *IKEPolicy) validateDhGroup(formats strfmt.Registry) error { return nil } -var iKEPolicyTypeEncryptionPropEnum []interface{} +var iKEPolicyTypeEncryptionPropEnum []any func init() { var res []string @@ -229,11 +234,15 @@ func (m *IKEPolicy) validateKeyLifetime(formats strfmt.Registry) error { if m.KeyLifetime != nil { if err := m.KeyLifetime.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("keyLifetime") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("keyLifetime") } + return err } } @@ -250,7 +259,7 @@ func (m *IKEPolicy) validateName(formats strfmt.Registry) error { return nil } -var iKEPolicyTypeVersionPropEnum []interface{} +var iKEPolicyTypeVersionPropEnum []any func init() { var res []int64 @@ -307,11 +316,15 @@ func (m *IKEPolicy) contextValidateAuthentication(ctx context.Context, formats s if m.Authentication != nil { if err := m.Authentication.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("authentication") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("authentication") } + return err } } @@ -324,11 +337,15 @@ func (m *IKEPolicy) contextValidateKeyLifetime(ctx context.Context, formats strf if m.KeyLifetime != nil { if err := m.KeyLifetime.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("keyLifetime") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("keyLifetime") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_authentication.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_authentication.go index 8cdd1e861f4..fcbcfec16fc 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_authentication.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_authentication.go @@ -45,7 +45,7 @@ const ( ) // for schema -var iKEPolicyAuthenticationEnum []interface{} +var iKEPolicyAuthenticationEnum []any func init() { var res []IKEPolicyAuthentication diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_create.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_create.go index 0f663cb59aa..ab5d8245efa 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_create.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_create.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -101,18 +102,22 @@ func (m *IKEPolicyCreate) validateAuthentication(formats strfmt.Registry) error } if err := m.Authentication.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("authentication") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("authentication") } + return err } return nil } -var iKEPolicyCreateTypeDhGroupPropEnum []interface{} +var iKEPolicyCreateTypeDhGroupPropEnum []any func init() { var res []int64 @@ -146,7 +151,7 @@ func (m *IKEPolicyCreate) validateDhGroup(formats strfmt.Registry) error { return nil } -var iKEPolicyCreateTypeEncryptionPropEnum []interface{} +var iKEPolicyCreateTypeEncryptionPropEnum []any func init() { var res []string @@ -213,11 +218,15 @@ func (m *IKEPolicyCreate) validateKeyLifetime(formats strfmt.Registry) error { if m.KeyLifetime != nil { if err := m.KeyLifetime.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("keyLifetime") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("keyLifetime") } + return err } } @@ -251,7 +260,7 @@ func (m *IKEPolicyCreate) validatePresharedKey(formats strfmt.Registry) error { return nil } -var iKEPolicyCreateTypeVersionPropEnum []interface{} +var iKEPolicyCreateTypeVersionPropEnum []any func init() { var res []int64 @@ -310,11 +319,15 @@ func (m *IKEPolicyCreate) contextValidateAuthentication(ctx context.Context, for } if err := m.Authentication.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("authentication") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("authentication") } + return err } @@ -326,11 +339,15 @@ func (m *IKEPolicyCreate) contextValidateKeyLifetime(ctx context.Context, format if m.KeyLifetime != nil { if err := m.KeyLifetime.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("keyLifetime") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("keyLifetime") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_update.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_update.go index 2bb87db9cdf..0385738cba1 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_update.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/i_k_e_policy_update.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -53,7 +54,7 @@ type IKEPolicyUpdate struct { Version int64 `json:"version,omitempty"` // i k e policy update additional properties - IKEPolicyUpdateAdditionalProperties map[string]interface{} `json:"-"` + IKEPolicyUpdateAdditionalProperties map[string]any `json:"-"` } // UnmarshalJSON unmarshals this object with additional properties from JSON @@ -120,9 +121,9 @@ func (m *IKEPolicyUpdate) UnmarshalJSON(data []byte) error { delete(stage2, "version") // stage 3, add additional properties values if len(stage2) > 0 { - result := make(map[string]interface{}) + result := make(map[string]any) for k, v := range stage2 { - var toadd interface{} + var toadd any if err := json.Unmarshal(v, &toadd); err != nil { return err } @@ -263,18 +264,22 @@ func (m *IKEPolicyUpdate) validateAuthentication(formats strfmt.Registry) error } if err := m.Authentication.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("authentication") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("authentication") } + return err } return nil } -var iKEPolicyUpdateTypeDhGroupPropEnum []interface{} +var iKEPolicyUpdateTypeDhGroupPropEnum []any func init() { var res []int64 @@ -307,7 +312,7 @@ func (m *IKEPolicyUpdate) validateDhGroup(formats strfmt.Registry) error { return nil } -var iKEPolicyUpdateTypeEncryptionPropEnum []interface{} +var iKEPolicyUpdateTypeEncryptionPropEnum []any func init() { var res []string @@ -367,11 +372,15 @@ func (m *IKEPolicyUpdate) validateKeyLifetime(formats strfmt.Registry) error { } if err := m.KeyLifetime.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("keyLifetime") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("keyLifetime") } + return err } @@ -394,7 +403,7 @@ func (m *IKEPolicyUpdate) validateName(formats strfmt.Registry) error { return nil } -var iKEPolicyUpdateTypeVersionPropEnum []interface{} +var iKEPolicyUpdateTypeVersionPropEnum []any func init() { var res []int64 @@ -452,11 +461,15 @@ func (m *IKEPolicyUpdate) contextValidateAuthentication(ctx context.Context, for } if err := m.Authentication.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("authentication") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("authentication") } + return err } @@ -470,11 +483,15 @@ func (m *IKEPolicyUpdate) contextValidateKeyLifetime(ctx context.Context, format } if err := m.KeyLifetime.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("keyLifetime") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("keyLifetime") } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/image.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/image.go index 20bc26d84a4..4cd6c9b6abe 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/image.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/image.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -160,11 +161,15 @@ func (m *Image) validateCrn(formats strfmt.Registry) error { } if err := m.Crn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("crn") } + return err } @@ -227,11 +232,15 @@ func (m *Image) validateSpecifications(formats strfmt.Registry) error { if m.Specifications != nil { if err := m.Specifications.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("specifications") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("specifications") } + return err } } @@ -264,11 +273,15 @@ func (m *Image) validateTaskref(formats strfmt.Registry) error { if m.Taskref != nil { if err := m.Taskref.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("taskref") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("taskref") } + return err } } @@ -282,11 +295,15 @@ func (m *Image) validateUserTags(formats strfmt.Registry) error { } if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } @@ -305,11 +322,15 @@ func (m *Image) validateVolumes(formats strfmt.Registry) error { if m.Volumes[i] != nil { if err := m.Volumes[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("volumes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("volumes" + "." + strconv.Itoa(i)) } + return err } } @@ -356,11 +377,15 @@ func (m *Image) contextValidateCrn(ctx context.Context, formats strfmt.Registry) } if err := m.Crn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("crn") } + return err } @@ -376,11 +401,15 @@ func (m *Image) contextValidateSpecifications(ctx context.Context, formats strfm } if err := m.Specifications.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("specifications") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("specifications") } + return err } } @@ -397,11 +426,15 @@ func (m *Image) contextValidateTaskref(ctx context.Context, formats strfmt.Regis } if err := m.Taskref.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("taskref") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("taskref") } + return err } } @@ -412,11 +445,15 @@ func (m *Image) contextValidateTaskref(ctx context.Context, formats strfmt.Regis func (m *Image) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } @@ -434,11 +471,15 @@ func (m *Image) contextValidateVolumes(ctx context.Context, formats strfmt.Regis } if err := m.Volumes[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("volumes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("volumes" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/image_import_details.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/image_import_details.go index 4fc18548a03..068ecc051ab 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/image_import_details.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/image_import_details.go @@ -58,7 +58,7 @@ func (m *ImageImportDetails) Validate(formats strfmt.Registry) error { return nil } -var imageImportDetailsTypeLicenseTypePropEnum []interface{} +var imageImportDetailsTypeLicenseTypePropEnum []any func init() { var res []string @@ -98,7 +98,7 @@ func (m *ImageImportDetails) validateLicenseType(formats strfmt.Registry) error return nil } -var imageImportDetailsTypeProductPropEnum []interface{} +var imageImportDetailsTypeProductPropEnum []any func init() { var res []string @@ -141,7 +141,7 @@ func (m *ImageImportDetails) validateProduct(formats strfmt.Registry) error { return nil } -var imageImportDetailsTypeVendorPropEnum []interface{} +var imageImportDetailsTypeVendorPropEnum []any func init() { var res []string diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/image_reference.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/image_reference.go index 02a984cb10b..101e27a5fd5 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/image_reference.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/image_reference.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -138,11 +139,15 @@ func (m *ImageReference) validateCrn(formats strfmt.Registry) error { } if err := m.Crn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("crn") } + return err } @@ -206,11 +211,15 @@ func (m *ImageReference) validateSpecifications(formats strfmt.Registry) error { if m.Specifications != nil { if err := m.Specifications.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("specifications") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("specifications") } + return err } } @@ -270,11 +279,15 @@ func (m *ImageReference) contextValidateCrn(ctx context.Context, formats strfmt. } if err := m.Crn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("crn") } + return err } @@ -286,11 +299,15 @@ func (m *ImageReference) contextValidateSpecifications(ctx context.Context, form if m.Specifications != nil { if err := m.Specifications.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("specifications") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("specifications") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/image_specifications.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/image_specifications.go index 70ec4210d82..4b1f8304b23 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/image_specifications.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/image_specifications.go @@ -38,6 +38,9 @@ type ImageSpecifications struct { // Operating System OperatingSystem string `json:"operatingSystem,omitempty"` + // Shared Image + Shared *bool `json:"shared,omitempty"` + // Checksum of the source file (imported images only) SourceChecksum string `json:"sourceChecksum,omitempty"` } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/images.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/images.go index 7ffa8a6320d..579ec8d20e1 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/images.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/images.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -52,11 +53,15 @@ func (m *Images) validateImages(formats strfmt.Registry) error { if m.Images[i] != nil { if err := m.Images[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("images" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("images" + "." + strconv.Itoa(i)) } + return err } } @@ -91,11 +96,15 @@ func (m *Images) contextValidateImages(ctx context.Context, formats strfmt.Regis } if err := m.Images[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("images" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("images" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/instance_capabilities.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/instance_capabilities.go index 68534bfd42c..c181c64a3ad 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/instance_capabilities.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/instance_capabilities.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -26,11 +27,15 @@ func (m InstanceCapabilities) Validate(formats strfmt.Registry) error { if val, ok := m[k]; ok { if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName(k) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName(k) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/internal_capacity_management_request.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/internal_capacity_management_request.go new file mode 100644 index 00000000000..db7a79eba34 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/internal_capacity_management_request.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// InternalCapacityManagementRequest internal capacity management request +// +// swagger:model InternalCapacityManagementRequest +type InternalCapacityManagementRequest struct { + + // The target datacenter + // Required: true + Datacenter *string `json:"datacenter"` + + // Disabling or enabling system provisioning + // Required: true + // Enum: ["disabled","enabled"] + Operation *string `json:"operation"` + + // The system type to be enabled or disabled + // Required: true + SystemType *string `json:"systemType"` +} + +// Validate validates this internal capacity management request +func (m *InternalCapacityManagementRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDatacenter(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOperation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSystemType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InternalCapacityManagementRequest) validateDatacenter(formats strfmt.Registry) error { + + if err := validate.Required("datacenter", "body", m.Datacenter); err != nil { + return err + } + + return nil +} + +var internalCapacityManagementRequestTypeOperationPropEnum []any + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["disabled","enabled"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + internalCapacityManagementRequestTypeOperationPropEnum = append(internalCapacityManagementRequestTypeOperationPropEnum, v) + } +} + +const ( + + // InternalCapacityManagementRequestOperationDisabled captures enum value "disabled" + InternalCapacityManagementRequestOperationDisabled string = "disabled" + + // InternalCapacityManagementRequestOperationEnabled captures enum value "enabled" + InternalCapacityManagementRequestOperationEnabled string = "enabled" +) + +// prop value enum +func (m *InternalCapacityManagementRequest) validateOperationEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, internalCapacityManagementRequestTypeOperationPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *InternalCapacityManagementRequest) validateOperation(formats strfmt.Registry) error { + + if err := validate.Required("operation", "body", m.Operation); err != nil { + return err + } + + // value enum + if err := m.validateOperationEnum("operation", "body", *m.Operation); err != nil { + return err + } + + return nil +} + +func (m *InternalCapacityManagementRequest) validateSystemType(formats strfmt.Registry) error { + + if err := validate.Required("systemType", "body", m.SystemType); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this internal capacity management request based on context it is used +func (m *InternalCapacityManagementRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *InternalCapacityManagementRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InternalCapacityManagementRequest) UnmarshalBinary(b []byte) error { + var res InternalCapacityManagementRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/internal_capacity_management_response.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/internal_capacity_management_response.go new file mode 100644 index 00000000000..4bcb4b5bf0d --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/internal_capacity_management_response.go @@ -0,0 +1,74 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// InternalCapacityManagementResponse internal capacity management response +// +// swagger:model InternalCapacityManagementResponse +type InternalCapacityManagementResponse struct { + + // The number of accounts in the whitelist + Accounts int64 `json:"accounts,omitempty"` + + // List of supported systems + // Required: true + SupportedSystems []string `json:"supportedSystems"` +} + +// Validate validates this internal capacity management response +func (m *InternalCapacityManagementResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSupportedSystems(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InternalCapacityManagementResponse) validateSupportedSystems(formats strfmt.Registry) error { + + if err := validate.Required("supportedSystems", "body", m.SupportedSystems); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this internal capacity management response based on context it is used +func (m *InternalCapacityManagementResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *InternalCapacityManagementResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InternalCapacityManagementResponse) UnmarshalBinary(b []byte) error { + var res InternalCapacityManagementResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/internal_operations_response.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/internal_operations_response.go index aec05341832..018905e0c6b 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/internal_operations_response.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/internal_operations_response.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -42,11 +43,15 @@ func (m *InternalOperationsResponse) validateCrn(formats strfmt.Registry) error } if err := m.Crn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("crn") } + return err } @@ -74,11 +79,15 @@ func (m *InternalOperationsResponse) contextValidateCrn(ctx context.Context, for } if err := m.Crn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("crn") } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_s_e_c_policy_authentication.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_s_e_c_policy_authentication.go index d3f704f02a5..f165862a423 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_s_e_c_policy_authentication.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_s_e_c_policy_authentication.go @@ -42,7 +42,7 @@ const ( ) // for schema -var ipSECPolicyAuthenticationEnum []interface{} +var ipSECPolicyAuthenticationEnum []any func init() { var res []IPSECPolicyAuthentication diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policies.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policies.go index 062ac0921eb..45d138b60fc 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policies.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policies.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -52,11 +53,15 @@ func (m *IPSecPolicies) validateIPSecPolicies(formats strfmt.Registry) error { if m.IPSecPolicies[i] != nil { if err := m.IPSecPolicies[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("ipSecPolicies" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("ipSecPolicies" + "." + strconv.Itoa(i)) } + return err } } @@ -91,11 +96,15 @@ func (m *IPSecPolicies) contextValidateIPSecPolicies(ctx context.Context, format } if err := m.IPSecPolicies[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("ipSecPolicies" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("ipSecPolicies" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policy.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policy.go index 67e87daa166..d5243a6d30e 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policy.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policy.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -106,11 +107,15 @@ func (m *IPSecPolicy) validateAuthentication(formats strfmt.Registry) error { if m.Authentication != nil { if err := m.Authentication.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("authentication") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("authentication") } + return err } } @@ -118,7 +123,7 @@ func (m *IPSecPolicy) validateAuthentication(formats strfmt.Registry) error { return nil } -var ipSecPolicyTypeDhGroupPropEnum []interface{} +var ipSecPolicyTypeDhGroupPropEnum []any func init() { var res []int64 @@ -152,7 +157,7 @@ func (m *IPSecPolicy) validateDhGroup(formats strfmt.Registry) error { return nil } -var ipSecPolicyTypeEncryptionPropEnum []interface{} +var ipSecPolicyTypeEncryptionPropEnum []any func init() { var res []string @@ -231,11 +236,15 @@ func (m *IPSecPolicy) validateKeyLifetime(formats strfmt.Registry) error { if m.KeyLifetime != nil { if err := m.KeyLifetime.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("keyLifetime") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("keyLifetime") } + return err } } @@ -284,11 +293,15 @@ func (m *IPSecPolicy) contextValidateAuthentication(ctx context.Context, formats if m.Authentication != nil { if err := m.Authentication.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("authentication") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("authentication") } + return err } } @@ -301,11 +314,15 @@ func (m *IPSecPolicy) contextValidateKeyLifetime(ctx context.Context, formats st if m.KeyLifetime != nil { if err := m.KeyLifetime.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("keyLifetime") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("keyLifetime") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policy_create.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policy_create.go index d64e5945d1c..a892859673f 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policy_create.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policy_create.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -92,18 +93,22 @@ func (m *IPSecPolicyCreate) validateAuthentication(formats strfmt.Registry) erro } if err := m.Authentication.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("authentication") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("authentication") } + return err } return nil } -var ipSecPolicyCreateTypeDhGroupPropEnum []interface{} +var ipSecPolicyCreateTypeDhGroupPropEnum []any func init() { var res []int64 @@ -137,7 +142,7 @@ func (m *IPSecPolicyCreate) validateDhGroup(formats strfmt.Registry) error { return nil } -var ipSecPolicyCreateTypeEncryptionPropEnum []interface{} +var ipSecPolicyCreateTypeEncryptionPropEnum []any func init() { var res []string @@ -207,11 +212,15 @@ func (m *IPSecPolicyCreate) validateKeyLifetime(formats strfmt.Registry) error { if m.KeyLifetime != nil { if err := m.KeyLifetime.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("keyLifetime") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("keyLifetime") } + return err } } @@ -270,11 +279,15 @@ func (m *IPSecPolicyCreate) contextValidateAuthentication(ctx context.Context, f } if err := m.Authentication.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("authentication") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("authentication") } + return err } @@ -286,11 +299,15 @@ func (m *IPSecPolicyCreate) contextValidateKeyLifetime(ctx context.Context, form if m.KeyLifetime != nil { if err := m.KeyLifetime.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("keyLifetime") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("keyLifetime") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policy_update.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policy_update.go index b795c162c24..1fbc3e5d7ec 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policy_update.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/ip_sec_policy_update.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -49,7 +50,7 @@ type IPSecPolicyUpdate struct { Pfs *bool `json:"pfs,omitempty"` // IP sec policy update additional properties - IPSecPolicyUpdateAdditionalProperties map[string]interface{} `json:"-"` + IPSecPolicyUpdateAdditionalProperties map[string]any `json:"-"` } // UnmarshalJSON unmarshals this object with additional properties from JSON @@ -110,9 +111,9 @@ func (m *IPSecPolicyUpdate) UnmarshalJSON(data []byte) error { delete(stage2, "pfs") // stage 3, add additional properties values if len(stage2) > 0 { - result := make(map[string]interface{}) + result := make(map[string]any) for k, v := range stage2 { - var toadd interface{} + var toadd any if err := json.Unmarshal(v, &toadd); err != nil { return err } @@ -244,18 +245,22 @@ func (m *IPSecPolicyUpdate) validateAuthentication(formats strfmt.Registry) erro } if err := m.Authentication.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("authentication") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("authentication") } + return err } return nil } -var ipSecPolicyUpdateTypeDhGroupPropEnum []interface{} +var ipSecPolicyUpdateTypeDhGroupPropEnum []any func init() { var res []int64 @@ -288,7 +293,7 @@ func (m *IPSecPolicyUpdate) validateDhGroup(formats strfmt.Registry) error { return nil } -var ipSecPolicyUpdateTypeEncryptionPropEnum []interface{} +var ipSecPolicyUpdateTypeEncryptionPropEnum []any func init() { var res []string @@ -351,11 +356,15 @@ func (m *IPSecPolicyUpdate) validateKeyLifetime(formats strfmt.Registry) error { } if err := m.KeyLifetime.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("keyLifetime") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("keyLifetime") } + return err } @@ -403,11 +412,15 @@ func (m *IPSecPolicyUpdate) contextValidateAuthentication(ctx context.Context, f } if err := m.Authentication.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("authentication") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("authentication") } + return err } @@ -421,11 +434,15 @@ func (m *IPSecPolicyUpdate) contextValidateKeyLifetime(ctx context.Context, form } if err := m.KeyLifetime.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("keyLifetime") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("keyLifetime") } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/job.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/job.go index b9a5884115f..894d7bc7829 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/job.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/job.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -91,11 +92,15 @@ func (m *Job) validateOperation(formats strfmt.Registry) error { if m.Operation != nil { if err := m.Operation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("operation") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("operation") } + return err } } @@ -111,11 +116,15 @@ func (m *Job) validateStatus(formats strfmt.Registry) error { if m.Status != nil { if err := m.Status.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("status") } + return err } } @@ -146,11 +155,15 @@ func (m *Job) contextValidateOperation(ctx context.Context, formats strfmt.Regis if m.Operation != nil { if err := m.Operation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("operation") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("operation") } + return err } } @@ -163,11 +176,15 @@ func (m *Job) contextValidateStatus(ctx context.Context, formats strfmt.Registry if m.Status != nil { if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("status") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/jobs.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/jobs.go index 983b9d90a60..acb271bf242 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/jobs.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/jobs.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -52,11 +53,15 @@ func (m *Jobs) validateJobs(formats strfmt.Registry) error { if m.Jobs[i] != nil { if err := m.Jobs[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("jobs" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("jobs" + "." + strconv.Itoa(i)) } + return err } } @@ -91,11 +96,15 @@ func (m *Jobs) contextValidateJobs(ctx context.Context, formats strfmt.Registry) } if err := m.Jobs[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("jobs" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("jobs" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/json_schema_object.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/json_schema_object.go index 9fec438a573..f47965ae108 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/json_schema_object.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/json_schema_object.go @@ -8,4 +8,4 @@ package models // JSONSchemaObject JSON schema object // // swagger:model JSONSchemaObject -type JSONSchemaObject interface{} +type JSONSchemaObject any diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/last_operation_resource.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/last_operation_resource.go index 10f953b5d7e..1bc87ae0cfc 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/last_operation_resource.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/last_operation_resource.go @@ -24,7 +24,7 @@ type LastOperationResource struct { Description string `json:"description,omitempty"` // extensions - Extensions interface{} `json:"extensions,omitempty"` + Extensions any `json:"extensions,omitempty"` // state // Required: true @@ -46,7 +46,7 @@ func (m *LastOperationResource) Validate(formats strfmt.Registry) error { return nil } -var lastOperationResourceTypeStatePropEnum []interface{} +var lastOperationResourceTypeStatePropEnum []any func init() { var res []string diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/metadata.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/metadata.go index fcebea3ace2..06a2e866312 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/metadata.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/metadata.go @@ -8,4 +8,4 @@ package models // Metadata See [Service Metadata Conventions](https://github.com/openservicebrokerapi/servicebroker/blob/master/profile.md#service-metadata) for more details. // // swagger:model Metadata -type Metadata interface{} +type Metadata any diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/multi_volumes_create.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/multi_volumes_create.go index 61aaa4f4b05..445df8dbc6d 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/multi_volumes_create.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/multi_volumes_create.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -92,7 +93,7 @@ func (m *MultiVolumesCreate) Validate(formats strfmt.Registry) error { return nil } -var multiVolumesCreateTypeAffinityPolicyPropEnum []interface{} +var multiVolumesCreateTypeAffinityPolicyPropEnum []any func init() { var res []string @@ -158,11 +159,15 @@ func (m *MultiVolumesCreate) validateUserTags(formats strfmt.Registry) error { } if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } @@ -186,11 +191,15 @@ func (m *MultiVolumesCreate) ContextValidate(ctx context.Context, formats strfmt func (m *MultiVolumesCreate) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network.go index 788d9681e4a..9b1aa79c428 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -39,8 +40,8 @@ type Network struct { // (currently not available) cloud connections this network is attached CloudConnections []*NetworkCloudConnectionsItems0 `json:"cloudConnections,omitempty"` - // The CRN for this resource - Crn string `json:"crn,omitempty"` + // crn + Crn CRN `json:"crn,omitempty"` // DHCP Managed Network DhcpManaged bool `json:"dhcpManaged,omitempty"` @@ -79,7 +80,7 @@ type Network struct { // Required: true NetworkID *string `json:"networkID"` - // Network Peer ID + // [DEPRECATED] Network Peer ID PeerID string `json:"peerID,omitempty"` // Public IP Address Ranges (for pub-vlan networks) @@ -90,8 +91,8 @@ type Network struct { // Enum: ["vlan","pub-vlan","dhcp-vlan"] Type *string `json:"type"` - // The user tags associated with this resource. - UserTags []string `json:"userTags,omitempty"` + // user tags + UserTags Tags `json:"userTags,omitempty"` // VLAN ID // Required: true @@ -122,6 +123,10 @@ func (m *Network) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateCrn(formats); err != nil { + res = append(res, err) + } + if err := m.validateDNSServers(formats); err != nil { res = append(res, err) } @@ -158,6 +163,10 @@ func (m *Network) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateUserTags(formats); err != nil { + res = append(res, err) + } + if err := m.validateVlanID(formats); err != nil { res = append(res, err) } @@ -174,18 +183,22 @@ func (m *Network) validateAccessConfig(formats strfmt.Registry) error { } if err := m.AccessConfig.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("accessConfig") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("accessConfig") } + return err } return nil } -var networkTypeAdvertisePropEnum []interface{} +var networkTypeAdvertisePropEnum []any func init() { var res []string @@ -227,7 +240,7 @@ func (m *Network) validateAdvertise(formats strfmt.Registry) error { return nil } -var networkTypeArpBroadcastPropEnum []interface{} +var networkTypeArpBroadcastPropEnum []any func init() { var res []string @@ -290,11 +303,15 @@ func (m *Network) validateCloudConnections(formats strfmt.Registry) error { if m.CloudConnections[i] != nil { if err := m.CloudConnections[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("cloudConnections" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("cloudConnections" + "." + strconv.Itoa(i)) } + return err } } @@ -304,6 +321,27 @@ func (m *Network) validateCloudConnections(formats strfmt.Registry) error { return nil } +func (m *Network) validateCrn(formats strfmt.Registry) error { + if swag.IsZero(m.Crn) { // not required + return nil + } + + if err := m.Crn.Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("crn") + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("crn") + } + + return err + } + + return nil +} + func (m *Network) validateDNSServers(formats strfmt.Registry) error { if err := validate.Required("dnsServers", "body", m.DNSServers); err != nil { @@ -321,11 +359,15 @@ func (m *Network) validateIPAddressMetrics(formats strfmt.Registry) error { if m.IPAddressMetrics != nil { if err := m.IPAddressMetrics.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("ipAddressMetrics") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("ipAddressMetrics") } + return err } } @@ -346,11 +388,15 @@ func (m *Network) validateIPAddressRanges(formats strfmt.Registry) error { if m.IPAddressRanges[i] != nil { if err := m.IPAddressRanges[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("ipAddressRanges" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("ipAddressRanges" + "." + strconv.Itoa(i)) } + return err } } @@ -392,11 +438,15 @@ func (m *Network) validateNetworkAddressTranslation(formats strfmt.Registry) err if m.NetworkAddressTranslation != nil { if err := m.NetworkAddressTranslation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("networkAddressTranslation") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("networkAddressTranslation") } + return err } } @@ -425,11 +475,15 @@ func (m *Network) validatePublicIPAddressRanges(formats strfmt.Registry) error { if m.PublicIPAddressRanges[i] != nil { if err := m.PublicIPAddressRanges[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("publicIPAddressRanges" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("publicIPAddressRanges" + "." + strconv.Itoa(i)) } + return err } } @@ -439,7 +493,7 @@ func (m *Network) validatePublicIPAddressRanges(formats strfmt.Registry) error { return nil } -var networkTypeTypePropEnum []interface{} +var networkTypeTypePropEnum []any func init() { var res []string @@ -485,6 +539,27 @@ func (m *Network) validateType(formats strfmt.Registry) error { return nil } +func (m *Network) validateUserTags(formats strfmt.Registry) error { + if swag.IsZero(m.UserTags) { // not required + return nil + } + + if err := m.UserTags.Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("userTags") + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("userTags") + } + + return err + } + + return nil +} + func (m *Network) validateVlanID(formats strfmt.Registry) error { if err := validate.Required("vlanID", "body", m.VlanID); err != nil { @@ -506,6 +581,10 @@ func (m *Network) ContextValidate(ctx context.Context, formats strfmt.Registry) res = append(res, err) } + if err := m.contextValidateCrn(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateIPAddressMetrics(ctx, formats); err != nil { res = append(res, err) } @@ -522,6 +601,10 @@ func (m *Network) ContextValidate(ctx context.Context, formats strfmt.Registry) res = append(res, err) } + if err := m.contextValidateUserTags(ctx, formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -535,11 +618,15 @@ func (m *Network) contextValidateAccessConfig(ctx context.Context, formats strfm } if err := m.AccessConfig.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("accessConfig") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("accessConfig") } + return err } @@ -557,11 +644,15 @@ func (m *Network) contextValidateCloudConnections(ctx context.Context, formats s } if err := m.CloudConnections[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("cloudConnections" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("cloudConnections" + "." + strconv.Itoa(i)) } + return err } } @@ -571,16 +662,42 @@ func (m *Network) contextValidateCloudConnections(ctx context.Context, formats s return nil } +func (m *Network) contextValidateCrn(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Crn) { // not required + return nil + } + + if err := m.Crn.ContextValidate(ctx, formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("crn") + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("crn") + } + + return err + } + + return nil +} + func (m *Network) contextValidateIPAddressMetrics(ctx context.Context, formats strfmt.Registry) error { if m.IPAddressMetrics != nil { if err := m.IPAddressMetrics.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("ipAddressMetrics") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("ipAddressMetrics") } + return err } } @@ -599,11 +716,15 @@ func (m *Network) contextValidateIPAddressRanges(ctx context.Context, formats st } if err := m.IPAddressRanges[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("ipAddressRanges" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("ipAddressRanges" + "." + strconv.Itoa(i)) } + return err } } @@ -622,11 +743,15 @@ func (m *Network) contextValidateNetworkAddressTranslation(ctx context.Context, } if err := m.NetworkAddressTranslation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("networkAddressTranslation") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("networkAddressTranslation") } + return err } } @@ -645,11 +770,15 @@ func (m *Network) contextValidatePublicIPAddressRanges(ctx context.Context, form } if err := m.PublicIPAddressRanges[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("publicIPAddressRanges" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("publicIPAddressRanges" + "." + strconv.Itoa(i)) } + return err } } @@ -659,6 +788,24 @@ func (m *Network) contextValidatePublicIPAddressRanges(ctx context.Context, form return nil } +func (m *Network) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.UserTags.ContextValidate(ctx, formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("userTags") + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("userTags") + } + + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *Network) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_address_group.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_address_group.go index 6a7d2a9c9be..ab82816d89e 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_address_group.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_address_group.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -35,8 +36,8 @@ type NetworkAddressGroup struct { // Required: true Name *string `json:"name"` - // The user tags associated with this resource. - UserTags []string `json:"userTags,omitempty"` + // user tags + UserTags Tags `json:"userTags,omitempty"` } // Validate validates this network address group @@ -59,6 +60,10 @@ func (m *NetworkAddressGroup) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateUserTags(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -95,11 +100,15 @@ func (m *NetworkAddressGroup) validateMembers(formats strfmt.Registry) error { if m.Members[i] != nil { if err := m.Members[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("members" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("members" + "." + strconv.Itoa(i)) } + return err } } @@ -118,6 +127,27 @@ func (m *NetworkAddressGroup) validateName(formats strfmt.Registry) error { return nil } +func (m *NetworkAddressGroup) validateUserTags(formats strfmt.Registry) error { + if swag.IsZero(m.UserTags) { // not required + return nil + } + + if err := m.UserTags.Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("userTags") + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("userTags") + } + + return err + } + + return nil +} + // ContextValidate validate this network address group based on the context it is used func (m *NetworkAddressGroup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -126,6 +156,10 @@ func (m *NetworkAddressGroup) ContextValidate(ctx context.Context, formats strfm res = append(res, err) } + if err := m.contextValidateUserTags(ctx, formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -143,11 +177,15 @@ func (m *NetworkAddressGroup) contextValidateMembers(ctx context.Context, format } if err := m.Members[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("members" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("members" + "." + strconv.Itoa(i)) } + return err } } @@ -157,6 +195,24 @@ func (m *NetworkAddressGroup) contextValidateMembers(ctx context.Context, format return nil } +func (m *NetworkAddressGroup) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.UserTags.ContextValidate(ctx, formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("userTags") + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("userTags") + } + + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *NetworkAddressGroup) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_address_group_create.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_address_group_create.go index 24a83dfbce9..b81edffc04b 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_address_group_create.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_address_group_create.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -23,8 +24,8 @@ type NetworkAddressGroupCreate struct { // Required: true Name *string `json:"name"` - // The user tags associated with this resource. - UserTags []string `json:"userTags,omitempty"` + // user tags + UserTags Tags `json:"userTags,omitempty"` } // Validate validates this network address group create @@ -35,6 +36,10 @@ func (m *NetworkAddressGroupCreate) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateUserTags(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -50,8 +55,56 @@ func (m *NetworkAddressGroupCreate) validateName(formats strfmt.Registry) error return nil } -// ContextValidate validates this network address group create based on context it is used +func (m *NetworkAddressGroupCreate) validateUserTags(formats strfmt.Registry) error { + if swag.IsZero(m.UserTags) { // not required + return nil + } + + if err := m.UserTags.Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("userTags") + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("userTags") + } + + return err + } + + return nil +} + +// ContextValidate validate this network address group create based on the context it is used func (m *NetworkAddressGroupCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateUserTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NetworkAddressGroupCreate) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.UserTags.ContextValidate(ctx, formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("userTags") + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("userTags") + } + + return err + } + return nil } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_address_groups.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_address_groups.go index 425077d8e63..8f8c76bc985 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_address_groups.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_address_groups.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -49,11 +50,15 @@ func (m *NetworkAddressGroups) validateNetworkAddressGroups(formats strfmt.Regis if m.NetworkAddressGroups[i] != nil { if err := m.NetworkAddressGroups[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("networkAddressGroups" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("networkAddressGroups" + "." + strconv.Itoa(i)) } + return err } } @@ -88,11 +93,15 @@ func (m *NetworkAddressGroups) contextValidateNetworkAddressGroups(ctx context.C } if err := m.NetworkAddressGroups[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("networkAddressGroups" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("networkAddressGroups" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_address_translation.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_address_translation.go index cd7eaca7ccb..160d19e4204 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_address_translation.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_address_translation.go @@ -12,7 +12,7 @@ import ( "github.com/go-openapi/swag" ) -// NetworkAddressTranslation Contains the Network Address Translation Details +// NetworkAddressTranslation [DEPRECATED] Contains the Network Address Translation Details // // swagger:model NetworkAddressTranslation type NetworkAddressTranslation struct { diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_create.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_create.go index cbc689d5d4b..8890aa40f1d 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_create.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_create.go @@ -61,7 +61,7 @@ type NetworkCreate struct { // Network Peer information Peer *NetworkCreatePeer `json:"peer,omitempty"` - // Type of Network - 'vlan' (private network) 'pub-vlan' (public network) 'dhcp-vlan' (for satellite locations only) + // Type of Network - 'vlan' (private network), 'pub-vlan' (public network), 'dhcp-vlan'[DEPRECATED] // Required: true // Enum: ["vlan","pub-vlan","dhcp-vlan"] Type *string `json:"type"` diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_create_peer.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_create_peer.go index 09c0e443999..9403bbf884d 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_create_peer.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_create_peer.go @@ -7,21 +7,20 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" - "github.com/go-openapi/validate" ) -// NetworkCreatePeer network create peer +// NetworkCreatePeer [DEPRECATED] // // swagger:model NetworkCreatePeer type NetworkCreatePeer struct { // ID of the network peer - // Required: true - ID *string `json:"id"` + ID string `json:"id,omitempty"` // network address translation NetworkAddressTranslation *NetworkAddressTranslation `json:"networkAddressTranslation,omitempty"` @@ -34,10 +33,6 @@ type NetworkCreatePeer struct { func (m *NetworkCreatePeer) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - if err := m.validateNetworkAddressTranslation(formats); err != nil { res = append(res, err) } @@ -52,15 +47,6 @@ func (m *NetworkCreatePeer) Validate(formats strfmt.Registry) error { return nil } -func (m *NetworkCreatePeer) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - func (m *NetworkCreatePeer) validateNetworkAddressTranslation(formats strfmt.Registry) error { if swag.IsZero(m.NetworkAddressTranslation) { // not required return nil @@ -68,11 +54,15 @@ func (m *NetworkCreatePeer) validateNetworkAddressTranslation(formats strfmt.Reg if m.NetworkAddressTranslation != nil { if err := m.NetworkAddressTranslation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("networkAddressTranslation") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("networkAddressTranslation") } + return err } } @@ -86,11 +76,15 @@ func (m *NetworkCreatePeer) validateType(formats strfmt.Registry) error { } if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("type") } + return err } @@ -124,11 +118,15 @@ func (m *NetworkCreatePeer) contextValidateNetworkAddressTranslation(ctx context } if err := m.NetworkAddressTranslation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("networkAddressTranslation") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("networkAddressTranslation") } + return err } } @@ -143,11 +141,15 @@ func (m *NetworkCreatePeer) contextValidateType(ctx context.Context, formats str } if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("type") } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_interface.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_interface.go index a5bd05ac309..11e8cff298c 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_interface.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_interface.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -52,8 +53,8 @@ type NetworkInterface struct { // Required: true Status *string `json:"status"` - // The user tags associated with this resource. - UserTags []string `json:"userTags,omitempty"` + // user tags + UserTags Tags `json:"userTags,omitempty"` } // Validate validates this network interface @@ -88,6 +89,10 @@ func (m *NetworkInterface) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateUserTags(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -119,11 +124,15 @@ func (m *NetworkInterface) validateInstance(formats strfmt.Registry) error { if m.Instance != nil { if err := m.Instance.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("instance") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("instance") } + return err } } @@ -167,6 +176,27 @@ func (m *NetworkInterface) validateStatus(formats strfmt.Registry) error { return nil } +func (m *NetworkInterface) validateUserTags(formats strfmt.Registry) error { + if swag.IsZero(m.UserTags) { // not required + return nil + } + + if err := m.UserTags.Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("userTags") + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("userTags") + } + + return err + } + + return nil +} + // ContextValidate validate this network interface based on the context it is used func (m *NetworkInterface) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -175,6 +205,10 @@ func (m *NetworkInterface) ContextValidate(ctx context.Context, formats strfmt.R res = append(res, err) } + if err := m.contextValidateUserTags(ctx, formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -190,11 +224,15 @@ func (m *NetworkInterface) contextValidateInstance(ctx context.Context, formats } if err := m.Instance.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("instance") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("instance") } + return err } } @@ -202,6 +240,24 @@ func (m *NetworkInterface) contextValidateInstance(ctx context.Context, formats return nil } +func (m *NetworkInterface) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.UserTags.ContextValidate(ctx, formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("userTags") + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("userTags") + } + + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *NetworkInterface) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_interfaces.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_interfaces.go index a9ec76a71e8..d0843cc3c54 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_interfaces.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_interfaces.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -52,11 +53,15 @@ func (m *NetworkInterfaces) validateInterfaces(formats strfmt.Registry) error { if m.Interfaces[i] != nil { if err := m.Interfaces[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("interfaces" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("interfaces" + "." + strconv.Itoa(i)) } + return err } } @@ -91,11 +96,15 @@ func (m *NetworkInterfaces) contextValidateInterfaces(ctx context.Context, forma } if err := m.Interfaces[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("interfaces" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("interfaces" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_peer.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_peer.go index 2ecb668113c..a7be4bdeaae 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_peer.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_peer.go @@ -7,6 +7,9 @@ package models import ( "context" + "encoding/json" + stderrors "errors" + "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -19,28 +22,136 @@ import ( // swagger:model NetworkPeer type NetworkPeer struct { - // Description of the network peer + // time stamp for create network peer // Required: true - Description *string `json:"description"` + CreationDate *string `json:"creationDate"` - // ID of the network peer + // ASN number at customer network side + // Example: 64512 + // Required: true + CustomerASN *int64 `json:"customerASN"` + + // IP address used for configuring customer network interface with network subnet mask. customerCidr and ibmCidr must have matching network and subnet mask values. + // Example: 192.168.91.2/30 + // Required: true + CustomerCidr *string `json:"customerCidr"` + + // default action for export route filter + // * allow: allow + // * deny: deny + // + // Example: allow + // Required: true + // Enum: ["allow","deny"] + DefaultExportRouteFilter *string `json:"defaultExportRouteFilter"` + + // default action for import route filter + // * allow: allow + // * deny: deny + // + // Example: allow + // Required: true + // Enum: ["allow","deny"] + DefaultImportRouteFilter *string `json:"defaultImportRouteFilter"` + + // error description + // Required: true + Error *string `json:"error"` + + // List of export route filters + // Required: true + ExportRouteFilters []*RouteFilter `json:"exportRouteFilters"` + + // ASN number at IBM PowerVS side + // Example: 64512 + // Required: true + IbmASN *int64 `json:"ibmASN"` + + // IP address used for configuring IBM network interface with network subnet mask. customerCidr and ibmCidr must have matching network and subnet mask values. + // Example: 192.168.91.1/30 + // Required: true + IbmCidr *string `json:"ibmCidr"` + + // network peer id + // Example: 031ab7da-bca6-493f-ac55-1a2a26f19160 // Required: true ID *string `json:"id"` - // Name of the network peer + // List of import route filters + // Required: true + ImportRouteFilters []*RouteFilter `json:"importRouteFilters"` + + // user defined name + // Example: newPeerNetwork // Required: true Name *string `json:"name"` - // type + // peer interface id. use API '/v1/network-peers/interfaces' to get a list of valid peer interface id + // Example: 031ab7da-bca6-493f-ac55-1a2a26f19160 // Required: true - Type *NetworkPeerType `json:"type"` + PeerInterfaceID *string `json:"peerInterfaceID"` + + // status of the network peer + // Example: active + // Required: true + // Enum: ["active","configuring","removing","error","updating"] + State *string `json:"state"` + + // type of the peer network + // * dcnetwork_bgp: broader gateway protocol is used to share routes between two autonomous network + // + // Example: dcnetwork_bgp + // Required: true + // Enum: ["dcnetwork_bgp"] + Type *string `json:"type"` + + // time stamp for update network peer + // Required: true + UpdatedDate *string `json:"updatedDate"` + + // A vlan configured at the customer network. + // Example: 2000 + // Required: true + Vlan *int64 `json:"vlan"` } // Validate validates this network peer func (m *NetworkPeer) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateDescription(formats); err != nil { + if err := m.validateCreationDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCustomerASN(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCustomerCidr(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDefaultExportRouteFilter(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDefaultImportRouteFilter(formats); err != nil { + res = append(res, err) + } + + if err := m.validateError(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExportRouteFilters(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIbmASN(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIbmCidr(formats); err != nil { res = append(res, err) } @@ -48,23 +159,205 @@ func (m *NetworkPeer) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateImportRouteFilters(formats); err != nil { + res = append(res, err) + } + if err := m.validateName(formats); err != nil { res = append(res, err) } + if err := m.validatePeerInterfaceID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateState(formats); err != nil { + res = append(res, err) + } + if err := m.validateType(formats); err != nil { res = append(res, err) } + if err := m.validateUpdatedDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVlan(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil } -func (m *NetworkPeer) validateDescription(formats strfmt.Registry) error { +func (m *NetworkPeer) validateCreationDate(formats strfmt.Registry) error { - if err := validate.Required("description", "body", m.Description); err != nil { + if err := validate.Required("creationDate", "body", m.CreationDate); err != nil { + return err + } + + return nil +} + +func (m *NetworkPeer) validateCustomerASN(formats strfmt.Registry) error { + + if err := validate.Required("customerASN", "body", m.CustomerASN); err != nil { + return err + } + + return nil +} + +func (m *NetworkPeer) validateCustomerCidr(formats strfmt.Registry) error { + + if err := validate.Required("customerCidr", "body", m.CustomerCidr); err != nil { + return err + } + + return nil +} + +var networkPeerTypeDefaultExportRouteFilterPropEnum []any + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["allow","deny"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + networkPeerTypeDefaultExportRouteFilterPropEnum = append(networkPeerTypeDefaultExportRouteFilterPropEnum, v) + } +} + +const ( + + // NetworkPeerDefaultExportRouteFilterAllow captures enum value "allow" + NetworkPeerDefaultExportRouteFilterAllow string = "allow" + + // NetworkPeerDefaultExportRouteFilterDeny captures enum value "deny" + NetworkPeerDefaultExportRouteFilterDeny string = "deny" +) + +// prop value enum +func (m *NetworkPeer) validateDefaultExportRouteFilterEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, networkPeerTypeDefaultExportRouteFilterPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *NetworkPeer) validateDefaultExportRouteFilter(formats strfmt.Registry) error { + + if err := validate.Required("defaultExportRouteFilter", "body", m.DefaultExportRouteFilter); err != nil { + return err + } + + // value enum + if err := m.validateDefaultExportRouteFilterEnum("defaultExportRouteFilter", "body", *m.DefaultExportRouteFilter); err != nil { + return err + } + + return nil +} + +var networkPeerTypeDefaultImportRouteFilterPropEnum []any + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["allow","deny"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + networkPeerTypeDefaultImportRouteFilterPropEnum = append(networkPeerTypeDefaultImportRouteFilterPropEnum, v) + } +} + +const ( + + // NetworkPeerDefaultImportRouteFilterAllow captures enum value "allow" + NetworkPeerDefaultImportRouteFilterAllow string = "allow" + + // NetworkPeerDefaultImportRouteFilterDeny captures enum value "deny" + NetworkPeerDefaultImportRouteFilterDeny string = "deny" +) + +// prop value enum +func (m *NetworkPeer) validateDefaultImportRouteFilterEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, networkPeerTypeDefaultImportRouteFilterPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *NetworkPeer) validateDefaultImportRouteFilter(formats strfmt.Registry) error { + + if err := validate.Required("defaultImportRouteFilter", "body", m.DefaultImportRouteFilter); err != nil { + return err + } + + // value enum + if err := m.validateDefaultImportRouteFilterEnum("defaultImportRouteFilter", "body", *m.DefaultImportRouteFilter); err != nil { + return err + } + + return nil +} + +func (m *NetworkPeer) validateError(formats strfmt.Registry) error { + + if err := validate.Required("error", "body", m.Error); err != nil { + return err + } + + return nil +} + +func (m *NetworkPeer) validateExportRouteFilters(formats strfmt.Registry) error { + + if err := validate.Required("exportRouteFilters", "body", m.ExportRouteFilters); err != nil { + return err + } + + for i := 0; i < len(m.ExportRouteFilters); i++ { + if swag.IsZero(m.ExportRouteFilters[i]) { // not required + continue + } + + if m.ExportRouteFilters[i] != nil { + if err := m.ExportRouteFilters[i].Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("exportRouteFilters" + "." + strconv.Itoa(i)) + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("exportRouteFilters" + "." + strconv.Itoa(i)) + } + + return err + } + } + + } + + return nil +} + +func (m *NetworkPeer) validateIbmASN(formats strfmt.Registry) error { + + if err := validate.Required("ibmASN", "body", m.IbmASN); err != nil { + return err + } + + return nil +} + +func (m *NetworkPeer) validateIbmCidr(formats strfmt.Registry) error { + + if err := validate.Required("ibmCidr", "body", m.IbmCidr); err != nil { return err } @@ -80,6 +373,37 @@ func (m *NetworkPeer) validateID(formats strfmt.Registry) error { return nil } +func (m *NetworkPeer) validateImportRouteFilters(formats strfmt.Registry) error { + + if err := validate.Required("importRouteFilters", "body", m.ImportRouteFilters); err != nil { + return err + } + + for i := 0; i < len(m.ImportRouteFilters); i++ { + if swag.IsZero(m.ImportRouteFilters[i]) { // not required + continue + } + + if m.ImportRouteFilters[i] != nil { + if err := m.ImportRouteFilters[i].Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("importRouteFilters" + "." + strconv.Itoa(i)) + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("importRouteFilters" + "." + strconv.Itoa(i)) + } + + return err + } + } + + } + + return nil +} + func (m *NetworkPeer) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { @@ -89,25 +413,120 @@ func (m *NetworkPeer) validateName(formats strfmt.Registry) error { return nil } +func (m *NetworkPeer) validatePeerInterfaceID(formats strfmt.Registry) error { + + if err := validate.Required("peerInterfaceID", "body", m.PeerInterfaceID); err != nil { + return err + } + + return nil +} + +var networkPeerTypeStatePropEnum []any + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["active","configuring","removing","error","updating"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + networkPeerTypeStatePropEnum = append(networkPeerTypeStatePropEnum, v) + } +} + +const ( + + // NetworkPeerStateActive captures enum value "active" + NetworkPeerStateActive string = "active" + + // NetworkPeerStateConfiguring captures enum value "configuring" + NetworkPeerStateConfiguring string = "configuring" + + // NetworkPeerStateRemoving captures enum value "removing" + NetworkPeerStateRemoving string = "removing" + + // NetworkPeerStateError captures enum value "error" + NetworkPeerStateError string = "error" + + // NetworkPeerStateUpdating captures enum value "updating" + NetworkPeerStateUpdating string = "updating" +) + +// prop value enum +func (m *NetworkPeer) validateStateEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, networkPeerTypeStatePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *NetworkPeer) validateState(formats strfmt.Registry) error { + + if err := validate.Required("state", "body", m.State); err != nil { + return err + } + + // value enum + if err := m.validateStateEnum("state", "body", *m.State); err != nil { + return err + } + + return nil +} + +var networkPeerTypeTypePropEnum []any + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["dcnetwork_bgp"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + networkPeerTypeTypePropEnum = append(networkPeerTypeTypePropEnum, v) + } +} + +const ( + + // NetworkPeerTypeDcnetworkBgp captures enum value "dcnetwork_bgp" + NetworkPeerTypeDcnetworkBgp string = "dcnetwork_bgp" +) + +// prop value enum +func (m *NetworkPeer) validateTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, networkPeerTypeTypePropEnum, true); err != nil { + return err + } + return nil +} + func (m *NetworkPeer) validateType(formats strfmt.Registry) error { if err := validate.Required("type", "body", m.Type); err != nil { return err } - if err := validate.Required("type", "body", m.Type); err != nil { + // value enum + if err := m.validateTypeEnum("type", "body", *m.Type); err != nil { return err } - if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } + return nil +} + +func (m *NetworkPeer) validateUpdatedDate(formats strfmt.Registry) error { + + if err := validate.Required("updatedDate", "body", m.UpdatedDate); err != nil { + return err + } + + return nil +} + +func (m *NetworkPeer) validateVlan(formats strfmt.Registry) error { + + if err := validate.Required("vlan", "body", m.Vlan); err != nil { + return err } return nil @@ -117,7 +536,11 @@ func (m *NetworkPeer) validateType(formats strfmt.Registry) error { func (m *NetworkPeer) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error - if err := m.contextValidateType(ctx, formats); err != nil { + if err := m.contextValidateExportRouteFilters(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateImportRouteFilters(ctx, formats); err != nil { res = append(res, err) } @@ -127,18 +550,59 @@ func (m *NetworkPeer) ContextValidate(ctx context.Context, formats strfmt.Regist return nil } -func (m *NetworkPeer) contextValidateType(ctx context.Context, formats strfmt.Registry) error { +func (m *NetworkPeer) contextValidateExportRouteFilters(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ExportRouteFilters); i++ { + + if m.ExportRouteFilters[i] != nil { + + if swag.IsZero(m.ExportRouteFilters[i]) { // not required + return nil + } + + if err := m.ExportRouteFilters[i].ContextValidate(ctx, formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("exportRouteFilters" + "." + strconv.Itoa(i)) + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("exportRouteFilters" + "." + strconv.Itoa(i)) + } + + return err + } + } + + } + + return nil +} + +func (m *NetworkPeer) contextValidateImportRouteFilters(ctx context.Context, formats strfmt.Registry) error { - if m.Type != nil { + for i := 0; i < len(m.ImportRouteFilters); i++ { - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") + if m.ImportRouteFilters[i] != nil { + + if swag.IsZero(m.ImportRouteFilters[i]) { // not required + return nil + } + + if err := m.ImportRouteFilters[i].ContextValidate(ctx, formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("importRouteFilters" + "." + strconv.Itoa(i)) + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("importRouteFilters" + "." + strconv.Itoa(i)) + } + + return err } - return err } + } return nil diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_peer_create.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_peer_create.go new file mode 100644 index 00000000000..3e3b69a2308 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_peer_create.go @@ -0,0 +1,339 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NetworkPeerCreate network peer create parameters +// +// swagger:model NetworkPeerCreate +type NetworkPeerCreate struct { + + // ASN number at customer network side + // Example: 64512 + // Required: true + CustomerASN *int64 `json:"customerASN"` + + // IP address used for configuring customer network interface with network subnet mask. customerCidr and ibmCidr must have matching network and subnet mask values. + // Example: 192.168.91.2/30 + // Required: true + CustomerCidr *string `json:"customerCidr"` + + // default action for export route filter + // * allow: allow + // * deny: deny + // + // Example: allow + // Enum: ["allow","deny"] + DefaultExportRouteFilter *string `json:"defaultExportRouteFilter,omitempty"` + + // default action for import route filter + // * allow: allow + // * deny: deny + // + // Example: allow + // Enum: ["allow","deny"] + DefaultImportRouteFilter *string `json:"defaultImportRouteFilter,omitempty"` + + // ASN number at IBM PowerVS side + // Example: 64512 + // Required: true + IbmASN *int64 `json:"ibmASN"` + + // IP address used for configuring IBM network interface with network subnet mask. customerCidr and ibmCidr must have matching network and subnet mask values. + // Example: 192.168.91.1/30 + // Required: true + IbmCidr *string `json:"ibmCidr"` + + // user defined name + // Example: newPeerNetwork + // Required: true + Name *string `json:"name"` + + // peer interface id. use API '/v1/network-peers/interfaces' to get a list of valid peer interface id + // Example: 031ab7da-bca6-493f-ac55-1a2a26f19160 + // Required: true + PeerInterfaceID *string `json:"peerInterfaceID"` + + // type of the peer network + // * dcnetwork_bgp: broader gateway protocol is used to share routes between two autonomous network + // + // Example: dcnetwork_bgp + // Enum: ["dcnetwork_bgp"] + Type *string `json:"type,omitempty"` + + // A vlan configured at the customer network. + // Example: 2000 + // Required: true + Vlan *int64 `json:"vlan"` +} + +// Validate validates this network peer create +func (m *NetworkPeerCreate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCustomerASN(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCustomerCidr(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDefaultExportRouteFilter(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDefaultImportRouteFilter(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIbmASN(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIbmCidr(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePeerInterfaceID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVlan(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NetworkPeerCreate) validateCustomerASN(formats strfmt.Registry) error { + + if err := validate.Required("customerASN", "body", m.CustomerASN); err != nil { + return err + } + + return nil +} + +func (m *NetworkPeerCreate) validateCustomerCidr(formats strfmt.Registry) error { + + if err := validate.Required("customerCidr", "body", m.CustomerCidr); err != nil { + return err + } + + return nil +} + +var networkPeerCreateTypeDefaultExportRouteFilterPropEnum []any + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["allow","deny"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + networkPeerCreateTypeDefaultExportRouteFilterPropEnum = append(networkPeerCreateTypeDefaultExportRouteFilterPropEnum, v) + } +} + +const ( + + // NetworkPeerCreateDefaultExportRouteFilterAllow captures enum value "allow" + NetworkPeerCreateDefaultExportRouteFilterAllow string = "allow" + + // NetworkPeerCreateDefaultExportRouteFilterDeny captures enum value "deny" + NetworkPeerCreateDefaultExportRouteFilterDeny string = "deny" +) + +// prop value enum +func (m *NetworkPeerCreate) validateDefaultExportRouteFilterEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, networkPeerCreateTypeDefaultExportRouteFilterPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *NetworkPeerCreate) validateDefaultExportRouteFilter(formats strfmt.Registry) error { + if swag.IsZero(m.DefaultExportRouteFilter) { // not required + return nil + } + + // value enum + if err := m.validateDefaultExportRouteFilterEnum("defaultExportRouteFilter", "body", *m.DefaultExportRouteFilter); err != nil { + return err + } + + return nil +} + +var networkPeerCreateTypeDefaultImportRouteFilterPropEnum []any + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["allow","deny"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + networkPeerCreateTypeDefaultImportRouteFilterPropEnum = append(networkPeerCreateTypeDefaultImportRouteFilterPropEnum, v) + } +} + +const ( + + // NetworkPeerCreateDefaultImportRouteFilterAllow captures enum value "allow" + NetworkPeerCreateDefaultImportRouteFilterAllow string = "allow" + + // NetworkPeerCreateDefaultImportRouteFilterDeny captures enum value "deny" + NetworkPeerCreateDefaultImportRouteFilterDeny string = "deny" +) + +// prop value enum +func (m *NetworkPeerCreate) validateDefaultImportRouteFilterEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, networkPeerCreateTypeDefaultImportRouteFilterPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *NetworkPeerCreate) validateDefaultImportRouteFilter(formats strfmt.Registry) error { + if swag.IsZero(m.DefaultImportRouteFilter) { // not required + return nil + } + + // value enum + if err := m.validateDefaultImportRouteFilterEnum("defaultImportRouteFilter", "body", *m.DefaultImportRouteFilter); err != nil { + return err + } + + return nil +} + +func (m *NetworkPeerCreate) validateIbmASN(formats strfmt.Registry) error { + + if err := validate.Required("ibmASN", "body", m.IbmASN); err != nil { + return err + } + + return nil +} + +func (m *NetworkPeerCreate) validateIbmCidr(formats strfmt.Registry) error { + + if err := validate.Required("ibmCidr", "body", m.IbmCidr); err != nil { + return err + } + + return nil +} + +func (m *NetworkPeerCreate) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *NetworkPeerCreate) validatePeerInterfaceID(formats strfmt.Registry) error { + + if err := validate.Required("peerInterfaceID", "body", m.PeerInterfaceID); err != nil { + return err + } + + return nil +} + +var networkPeerCreateTypeTypePropEnum []any + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["dcnetwork_bgp"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + networkPeerCreateTypeTypePropEnum = append(networkPeerCreateTypeTypePropEnum, v) + } +} + +const ( + + // NetworkPeerCreateTypeDcnetworkBgp captures enum value "dcnetwork_bgp" + NetworkPeerCreateTypeDcnetworkBgp string = "dcnetwork_bgp" +) + +// prop value enum +func (m *NetworkPeerCreate) validateTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, networkPeerCreateTypeTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *NetworkPeerCreate) validateType(formats strfmt.Registry) error { + if swag.IsZero(m.Type) { // not required + return nil + } + + // value enum + if err := m.validateTypeEnum("type", "body", *m.Type); err != nil { + return err + } + + return nil +} + +func (m *NetworkPeerCreate) validateVlan(formats strfmt.Registry) error { + + if err := validate.Required("vlan", "body", m.Vlan); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this network peer create based on context it is used +func (m *NetworkPeerCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *NetworkPeerCreate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NetworkPeerCreate) UnmarshalBinary(b []byte) error { + var res NetworkPeerCreate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_peer_type.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_peer_type.go index d47fb443eaa..0e16784b78e 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_peer_type.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_peer_type.go @@ -41,7 +41,7 @@ const ( ) // for schema -var networkPeerTypeEnum []interface{} +var networkPeerTypeEnum []any func init() { var res []NetworkPeerType diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_peer_update.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_peer_update.go new file mode 100644 index 00000000000..3a476371fe0 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_peer_update.go @@ -0,0 +1,241 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NetworkPeerUpdate network peer update parameters +// +// swagger:model NetworkPeerUpdate +type NetworkPeerUpdate struct { + + // ASN number at customer network side + // Example: 64512 + CustomerASN *int64 `json:"customerASN,omitempty"` + + // IP address used for configuring customer network interface with network subnet mask. customerCidr and ibmCidr must have matching network and subnet mask values. + // Example: 192.168.91.2/30 + CustomerCidr *string `json:"customerCidr,omitempty"` + + // default action for export route filter + // * allow: allow + // * deny: deny + // + // Example: allow + // Enum: ["allow","deny"] + DefaultExportRouteFilter *string `json:"defaultExportRouteFilter,omitempty"` + + // default action for import route filter + // * allow: allow + // * deny: deny + // + // Example: allow + // Enum: ["allow","deny"] + DefaultImportRouteFilter *string `json:"defaultImportRouteFilter,omitempty"` + + // ASN number at IBM PowerVS side + // Example: 64512 + IbmASN *int64 `json:"ibmASN,omitempty"` + + // IP address used for configuring IBM network interface with network subnet mask. customerCidr and ibmCidr must have matching network and subnet mask values. + // Example: 192.168.91.1/30 + IbmCidr *string `json:"ibmCidr,omitempty"` + + // user defined name + // Example: newPeerNetwork + Name *string `json:"name,omitempty"` + + // peer interface id. use API '/v1/network-peers/interfaces' to get a list of valid peer interface id + // Example: 031ab7da-bca6-493f-ac55-1a2a26f19160 + PeerInterfaceID *string `json:"peerInterfaceID,omitempty"` + + // type of the peer network + // * dcnetwork_bgp: broader gateway protocol is used to share routes between two autonomous network + // + // Example: dcnetwork_bgp + // Enum: ["dcnetwork_bgp"] + Type *string `json:"type,omitempty"` + + // A vlan configured at the customer network. + // Example: 2000 + Vlan *int64 `json:"vlan,omitempty"` +} + +// Validate validates this network peer update +func (m *NetworkPeerUpdate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDefaultExportRouteFilter(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDefaultImportRouteFilter(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var networkPeerUpdateTypeDefaultExportRouteFilterPropEnum []any + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["allow","deny"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + networkPeerUpdateTypeDefaultExportRouteFilterPropEnum = append(networkPeerUpdateTypeDefaultExportRouteFilterPropEnum, v) + } +} + +const ( + + // NetworkPeerUpdateDefaultExportRouteFilterAllow captures enum value "allow" + NetworkPeerUpdateDefaultExportRouteFilterAllow string = "allow" + + // NetworkPeerUpdateDefaultExportRouteFilterDeny captures enum value "deny" + NetworkPeerUpdateDefaultExportRouteFilterDeny string = "deny" +) + +// prop value enum +func (m *NetworkPeerUpdate) validateDefaultExportRouteFilterEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, networkPeerUpdateTypeDefaultExportRouteFilterPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *NetworkPeerUpdate) validateDefaultExportRouteFilter(formats strfmt.Registry) error { + if swag.IsZero(m.DefaultExportRouteFilter) { // not required + return nil + } + + // value enum + if err := m.validateDefaultExportRouteFilterEnum("defaultExportRouteFilter", "body", *m.DefaultExportRouteFilter); err != nil { + return err + } + + return nil +} + +var networkPeerUpdateTypeDefaultImportRouteFilterPropEnum []any + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["allow","deny"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + networkPeerUpdateTypeDefaultImportRouteFilterPropEnum = append(networkPeerUpdateTypeDefaultImportRouteFilterPropEnum, v) + } +} + +const ( + + // NetworkPeerUpdateDefaultImportRouteFilterAllow captures enum value "allow" + NetworkPeerUpdateDefaultImportRouteFilterAllow string = "allow" + + // NetworkPeerUpdateDefaultImportRouteFilterDeny captures enum value "deny" + NetworkPeerUpdateDefaultImportRouteFilterDeny string = "deny" +) + +// prop value enum +func (m *NetworkPeerUpdate) validateDefaultImportRouteFilterEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, networkPeerUpdateTypeDefaultImportRouteFilterPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *NetworkPeerUpdate) validateDefaultImportRouteFilter(formats strfmt.Registry) error { + if swag.IsZero(m.DefaultImportRouteFilter) { // not required + return nil + } + + // value enum + if err := m.validateDefaultImportRouteFilterEnum("defaultImportRouteFilter", "body", *m.DefaultImportRouteFilter); err != nil { + return err + } + + return nil +} + +var networkPeerUpdateTypeTypePropEnum []any + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["dcnetwork_bgp"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + networkPeerUpdateTypeTypePropEnum = append(networkPeerUpdateTypeTypePropEnum, v) + } +} + +const ( + + // NetworkPeerUpdateTypeDcnetworkBgp captures enum value "dcnetwork_bgp" + NetworkPeerUpdateTypeDcnetworkBgp string = "dcnetwork_bgp" +) + +// prop value enum +func (m *NetworkPeerUpdate) validateTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, networkPeerUpdateTypeTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *NetworkPeerUpdate) validateType(formats strfmt.Registry) error { + if swag.IsZero(m.Type) { // not required + return nil + } + + // value enum + if err := m.validateTypeEnum("type", "body", *m.Type); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this network peer update based on context it is used +func (m *NetworkPeerUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *NetworkPeerUpdate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NetworkPeerUpdate) UnmarshalBinary(b []byte) error { + var res NetworkPeerUpdate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_peers.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_peers.go index 38a9e55627c..49d6ebc910a 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_peers.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_peers.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -52,11 +53,15 @@ func (m *NetworkPeers) validateNetworkPeers(formats strfmt.Registry) error { if m.NetworkPeers[i] != nil { if err := m.NetworkPeers[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("networkPeers" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("networkPeers" + "." + strconv.Itoa(i)) } + return err } } @@ -91,11 +96,15 @@ func (m *NetworkPeers) contextValidateNetworkPeers(ctx context.Context, formats } if err := m.NetworkPeers[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("networkPeers" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("networkPeers" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_port.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_port.go index 997c0cfab5a..34060c26ba8 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_port.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_port.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -126,11 +127,15 @@ func (m *NetworkPort) validatePvmInstance(formats strfmt.Registry) error { if m.PvmInstance != nil { if err := m.PvmInstance.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("pvmInstance") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("pvmInstance") } + return err } } @@ -170,11 +175,15 @@ func (m *NetworkPort) contextValidatePvmInstance(ctx context.Context, formats st } if err := m.PvmInstance.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("pvmInstance") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("pvmInstance") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_port_create.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_port_create.go index d3ebbb1be7c..685f0531bf0 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_port_create.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_port_create.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -48,11 +49,15 @@ func (m *NetworkPortCreate) validateUserTags(formats strfmt.Registry) error { } if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } @@ -76,11 +81,15 @@ func (m *NetworkPortCreate) ContextValidate(ctx context.Context, formats strfmt. func (m *NetworkPortCreate) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_ports.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_ports.go index 66ba99b6484..424148ae13c 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_ports.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_ports.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -52,11 +53,15 @@ func (m *NetworkPorts) validatePorts(formats strfmt.Registry) error { if m.Ports[i] != nil { if err := m.Ports[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("ports" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("ports" + "." + strconv.Itoa(i)) } + return err } } @@ -91,11 +96,15 @@ func (m *NetworkPorts) contextValidatePorts(ctx context.Context, formats strfmt. } if err := m.Ports[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("ports" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("ports" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_reference.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_reference.go index 9b2482b61cc..1d859eb0335 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_reference.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_reference.go @@ -57,7 +57,7 @@ type NetworkReference struct { // Required: true NetworkID *string `json:"networkID"` - // Network Peer ID + // [DEPRECATED] Network Peer ID PeerID string `json:"peerID,omitempty"` // Type of Network - 'vlan' (private network) 'pub-vlan' (public network) 'dhcp-vlan' (for satellite locations only) diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_group.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_group.go index 581286a77bd..0f8f82d8890 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_group.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_group.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -41,8 +42,8 @@ type NetworkSecurityGroup struct { // The list of rules in the Network Security Group Rules []*NetworkSecurityGroupRule `json:"rules"` - // The user tags associated with this resource. - UserTags []string `json:"userTags,omitempty"` + // user tags + UserTags Tags `json:"userTags,omitempty"` } // Validate validates this network security group @@ -69,6 +70,10 @@ func (m *NetworkSecurityGroup) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateUserTags(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -105,11 +110,15 @@ func (m *NetworkSecurityGroup) validateMembers(formats strfmt.Registry) error { if m.Members[i] != nil { if err := m.Members[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("members" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("members" + "." + strconv.Itoa(i)) } + return err } } @@ -140,11 +149,15 @@ func (m *NetworkSecurityGroup) validateRules(formats strfmt.Registry) error { if m.Rules[i] != nil { if err := m.Rules[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("rules" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("rules" + "." + strconv.Itoa(i)) } + return err } } @@ -154,6 +167,27 @@ func (m *NetworkSecurityGroup) validateRules(formats strfmt.Registry) error { return nil } +func (m *NetworkSecurityGroup) validateUserTags(formats strfmt.Registry) error { + if swag.IsZero(m.UserTags) { // not required + return nil + } + + if err := m.UserTags.Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("userTags") + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("userTags") + } + + return err + } + + return nil +} + // ContextValidate validate this network security group based on the context it is used func (m *NetworkSecurityGroup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -166,6 +200,10 @@ func (m *NetworkSecurityGroup) ContextValidate(ctx context.Context, formats strf res = append(res, err) } + if err := m.contextValidateUserTags(ctx, formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -183,11 +221,15 @@ func (m *NetworkSecurityGroup) contextValidateMembers(ctx context.Context, forma } if err := m.Members[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("members" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("members" + "." + strconv.Itoa(i)) } + return err } } @@ -208,11 +250,15 @@ func (m *NetworkSecurityGroup) contextValidateRules(ctx context.Context, formats } if err := m.Rules[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("rules" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("rules" + "." + strconv.Itoa(i)) } + return err } } @@ -222,6 +268,24 @@ func (m *NetworkSecurityGroup) contextValidateRules(ctx context.Context, formats return nil } +func (m *NetworkSecurityGroup) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.UserTags.ContextValidate(ctx, formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("userTags") + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("userTags") + } + + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *NetworkSecurityGroup) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_group_add_member.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_group_add_member.go index abb75b1bc27..2927472883d 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_group_add_member.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_group_add_member.go @@ -57,7 +57,7 @@ func (m *NetworkSecurityGroupAddMember) validateTarget(formats strfmt.Registry) return nil } -var networkSecurityGroupAddMemberTypeTypePropEnum []interface{} +var networkSecurityGroupAddMemberTypeTypePropEnum []any func init() { var res []string diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_group_add_rule.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_group_add_rule.go index d57b3d7e400..4f518a6093f 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_group_add_rule.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_group_add_rule.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -84,7 +85,7 @@ func (m *NetworkSecurityGroupAddRule) Validate(formats strfmt.Registry) error { return nil } -var networkSecurityGroupAddRuleTypeActionPropEnum []interface{} +var networkSecurityGroupAddRuleTypeActionPropEnum []any func init() { var res []string @@ -134,11 +135,15 @@ func (m *NetworkSecurityGroupAddRule) validateDestinationPort(formats strfmt.Reg if m.DestinationPort != nil { if err := m.DestinationPort.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("destinationPort") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("destinationPort") } + return err } } @@ -153,11 +158,15 @@ func (m *NetworkSecurityGroupAddRule) validateDestinationPorts(formats strfmt.Re if m.DestinationPorts != nil { if err := m.DestinationPorts.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("destinationPorts") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("destinationPorts") } + return err } } @@ -173,11 +182,15 @@ func (m *NetworkSecurityGroupAddRule) validateProtocol(formats strfmt.Registry) if m.Protocol != nil { if err := m.Protocol.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("protocol") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("protocol") } + return err } } @@ -193,11 +206,15 @@ func (m *NetworkSecurityGroupAddRule) validateRemote(formats strfmt.Registry) er if m.Remote != nil { if err := m.Remote.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("remote") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("remote") } + return err } } @@ -212,11 +229,15 @@ func (m *NetworkSecurityGroupAddRule) validateSourcePort(formats strfmt.Registry if m.SourcePort != nil { if err := m.SourcePort.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("sourcePort") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("sourcePort") } + return err } } @@ -231,11 +252,15 @@ func (m *NetworkSecurityGroupAddRule) validateSourcePorts(formats strfmt.Registr if m.SourcePorts != nil { if err := m.SourcePorts.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("sourcePorts") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("sourcePorts") } + return err } } @@ -286,11 +311,15 @@ func (m *NetworkSecurityGroupAddRule) contextValidateDestinationPort(ctx context } if err := m.DestinationPort.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("destinationPort") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("destinationPort") } + return err } } @@ -307,11 +336,15 @@ func (m *NetworkSecurityGroupAddRule) contextValidateDestinationPorts(ctx contex } if err := m.DestinationPorts.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("destinationPorts") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("destinationPorts") } + return err } } @@ -324,11 +357,15 @@ func (m *NetworkSecurityGroupAddRule) contextValidateProtocol(ctx context.Contex if m.Protocol != nil { if err := m.Protocol.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("protocol") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("protocol") } + return err } } @@ -341,11 +378,15 @@ func (m *NetworkSecurityGroupAddRule) contextValidateRemote(ctx context.Context, if m.Remote != nil { if err := m.Remote.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("remote") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("remote") } + return err } } @@ -362,11 +403,15 @@ func (m *NetworkSecurityGroupAddRule) contextValidateSourcePort(ctx context.Cont } if err := m.SourcePort.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("sourcePort") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("sourcePort") } + return err } } @@ -383,11 +428,15 @@ func (m *NetworkSecurityGroupAddRule) contextValidateSourcePorts(ctx context.Con } if err := m.SourcePorts.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("sourcePorts") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("sourcePorts") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_group_create.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_group_create.go index fdafaa4287b..07c1c6e6049 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_group_create.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_group_create.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -23,8 +24,8 @@ type NetworkSecurityGroupCreate struct { // Required: true Name *string `json:"name"` - // The user tags associated with this resource. - UserTags []string `json:"userTags,omitempty"` + // user tags + UserTags Tags `json:"userTags,omitempty"` } // Validate validates this network security group create @@ -35,6 +36,10 @@ func (m *NetworkSecurityGroupCreate) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateUserTags(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -50,8 +55,56 @@ func (m *NetworkSecurityGroupCreate) validateName(formats strfmt.Registry) error return nil } -// ContextValidate validates this network security group create based on context it is used +func (m *NetworkSecurityGroupCreate) validateUserTags(formats strfmt.Registry) error { + if swag.IsZero(m.UserTags) { // not required + return nil + } + + if err := m.UserTags.Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("userTags") + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("userTags") + } + + return err + } + + return nil +} + +// ContextValidate validate this network security group create based on the context it is used func (m *NetworkSecurityGroupCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateUserTags(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NetworkSecurityGroupCreate) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.UserTags.ContextValidate(ctx, formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("userTags") + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("userTags") + } + + return err + } + return nil } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_group_member.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_group_member.go index 38eb82f17ab..27589a1d905 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_group_member.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_group_member.go @@ -80,7 +80,7 @@ func (m *NetworkSecurityGroupMember) validateTarget(formats strfmt.Registry) err return nil } -var networkSecurityGroupMemberTypeTypePropEnum []interface{} +var networkSecurityGroupMemberTypeTypePropEnum []any func init() { var res []string diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_group_rule.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_group_rule.go index a1be84f99f3..1561b2cfa76 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_group_rule.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_group_rule.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -78,7 +79,7 @@ func (m *NetworkSecurityGroupRule) Validate(formats strfmt.Registry) error { return nil } -var networkSecurityGroupRuleTypeActionPropEnum []interface{} +var networkSecurityGroupRuleTypeActionPropEnum []any func init() { var res []string @@ -128,11 +129,15 @@ func (m *NetworkSecurityGroupRule) validateDestinationPort(formats strfmt.Regist if m.DestinationPort != nil { if err := m.DestinationPort.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("destinationPort") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("destinationPort") } + return err } } @@ -157,11 +162,15 @@ func (m *NetworkSecurityGroupRule) validateProtocol(formats strfmt.Registry) err if m.Protocol != nil { if err := m.Protocol.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("protocol") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("protocol") } + return err } } @@ -177,11 +186,15 @@ func (m *NetworkSecurityGroupRule) validateRemote(formats strfmt.Registry) error if m.Remote != nil { if err := m.Remote.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("remote") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("remote") } + return err } } @@ -196,11 +209,15 @@ func (m *NetworkSecurityGroupRule) validateSourcePort(formats strfmt.Registry) e if m.SourcePort != nil { if err := m.SourcePort.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("sourcePort") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("sourcePort") } + return err } } @@ -243,11 +260,15 @@ func (m *NetworkSecurityGroupRule) contextValidateDestinationPort(ctx context.Co } if err := m.DestinationPort.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("destinationPort") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("destinationPort") } + return err } } @@ -260,11 +281,15 @@ func (m *NetworkSecurityGroupRule) contextValidateProtocol(ctx context.Context, if m.Protocol != nil { if err := m.Protocol.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("protocol") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("protocol") } + return err } } @@ -277,11 +302,15 @@ func (m *NetworkSecurityGroupRule) contextValidateRemote(ctx context.Context, fo if m.Remote != nil { if err := m.Remote.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("remote") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("remote") } + return err } } @@ -298,11 +327,15 @@ func (m *NetworkSecurityGroupRule) contextValidateSourcePort(ctx context.Context } if err := m.SourcePort.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("sourcePort") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("sourcePort") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_group_rule_protocol.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_group_rule_protocol.go index 3cb7cd170b7..6f4f14b3cc5 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_group_rule_protocol.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_group_rule_protocol.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -55,7 +56,7 @@ func (m *NetworkSecurityGroupRuleProtocol) Validate(formats strfmt.Registry) err return nil } -var networkSecurityGroupRuleProtocolTypeIcmpTypePropEnum []interface{} +var networkSecurityGroupRuleProtocolTypeIcmpTypePropEnum []any func init() { var res []string @@ -121,11 +122,15 @@ func (m *NetworkSecurityGroupRuleProtocol) validateTCPFlags(formats strfmt.Regis if m.TCPFlags[i] != nil { if err := m.TCPFlags[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("tcpFlags" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("tcpFlags" + "." + strconv.Itoa(i)) } + return err } } @@ -135,7 +140,7 @@ func (m *NetworkSecurityGroupRuleProtocol) validateTCPFlags(formats strfmt.Regis return nil } -var networkSecurityGroupRuleProtocolTypeTypePropEnum []interface{} +var networkSecurityGroupRuleProtocolTypeTypePropEnum []any func init() { var res []string @@ -208,11 +213,15 @@ func (m *NetworkSecurityGroupRuleProtocol) contextValidateTCPFlags(ctx context.C } if err := m.TCPFlags[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("tcpFlags" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("tcpFlags" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_group_rule_protocol_tcp_flag.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_group_rule_protocol_tcp_flag.go index 4340525e9cd..dc49c3b4a12 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_group_rule_protocol_tcp_flag.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_group_rule_protocol_tcp_flag.go @@ -39,7 +39,7 @@ func (m *NetworkSecurityGroupRuleProtocolTCPFlag) Validate(formats strfmt.Regist return nil } -var networkSecurityGroupRuleProtocolTcpFlagTypeFlagPropEnum []interface{} +var networkSecurityGroupRuleProtocolTcpFlagTypeFlagPropEnum []any func init() { var res []string diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_group_rule_remote.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_group_rule_remote.go index 47426697257..07932e1454b 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_group_rule_remote.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_group_rule_remote.go @@ -42,7 +42,7 @@ func (m *NetworkSecurityGroupRuleRemote) Validate(formats strfmt.Registry) error return nil } -var networkSecurityGroupRuleRemoteTypeTypePropEnum []interface{} +var networkSecurityGroupRuleRemoteTypeTypePropEnum []any func init() { var res []string diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_groups.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_groups.go index 82d72f8737e..e2f3419ecbc 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_groups.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_groups.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -49,11 +50,15 @@ func (m *NetworkSecurityGroups) validateNetworkSecurityGroups(formats strfmt.Reg if m.NetworkSecurityGroups[i] != nil { if err := m.NetworkSecurityGroups[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("networkSecurityGroups" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("networkSecurityGroups" + "." + strconv.Itoa(i)) } + return err } } @@ -88,11 +93,15 @@ func (m *NetworkSecurityGroups) contextValidateNetworkSecurityGroups(ctx context } if err := m.NetworkSecurityGroups[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("networkSecurityGroups" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("networkSecurityGroups" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_groups_action.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_groups_action.go index ad9b218a571..8b9e711c001 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_groups_action.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_security_groups_action.go @@ -40,7 +40,7 @@ func (m *NetworkSecurityGroupsAction) Validate(formats strfmt.Registry) error { return nil } -var networkSecurityGroupsActionTypeActionPropEnum []interface{} +var networkSecurityGroupsActionTypeActionPropEnum []any func init() { var res []string diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_update.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_update.go index adfb8bea970..4e983d3aec2 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_update.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/network_update.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -32,6 +33,9 @@ type NetworkUpdate struct { // Replaces the current DNS Servers DNSServers []string `json:"dnsServers"` + // network will support DHCP + EnableDHCP *bool `json:"enableDHCP,omitempty"` + // Replaces the current Gateway IP Address Gateway *string `json:"gateway,omitempty"` @@ -64,7 +68,7 @@ func (m *NetworkUpdate) Validate(formats strfmt.Registry) error { return nil } -var networkUpdateTypeAdvertisePropEnum []interface{} +var networkUpdateTypeAdvertisePropEnum []any func init() { var res []string @@ -106,7 +110,7 @@ func (m *NetworkUpdate) validateAdvertise(formats strfmt.Registry) error { return nil } -var networkUpdateTypeArpBroadcastPropEnum []interface{} +var networkUpdateTypeArpBroadcastPropEnum []any func init() { var res []string @@ -160,11 +164,15 @@ func (m *NetworkUpdate) validateIPAddressRanges(formats strfmt.Registry) error { if m.IPAddressRanges[i] != nil { if err := m.IPAddressRanges[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("ipAddressRanges" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("ipAddressRanges" + "." + strconv.Itoa(i)) } + return err } } @@ -199,11 +207,15 @@ func (m *NetworkUpdate) contextValidateIPAddressRanges(ctx context.Context, form } if err := m.IPAddressRanges[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("ipAddressRanges" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("ipAddressRanges" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/networks.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/networks.go index 24e4160a058..ec7cb23410a 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/networks.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/networks.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -52,11 +53,15 @@ func (m *Networks) validateNetworks(formats strfmt.Registry) error { if m.Networks[i] != nil { if err := m.Networks[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("networks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("networks" + "." + strconv.Itoa(i)) } + return err } } @@ -91,11 +96,15 @@ func (m *Networks) contextValidateNetworks(ctx context.Context, formats strfmt.R } if err := m.Networks[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("networks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("networks" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/object.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/object.go index cf28d25ee33..0e35074f730 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/object.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/object.go @@ -8,4 +8,4 @@ package models // Object object // // swagger:model Object -type Object interface{} +type Object any diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/open_stack_info.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/open_stack_info.go index 58b1e46136d..68256b3813d 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/open_stack_info.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/open_stack_info.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -60,11 +61,15 @@ func (m *OpenStackInfo) validateHosts(formats strfmt.Registry) error { if m.Hosts[i] != nil { if err := m.Hosts[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("hosts" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("hosts" + "." + strconv.Itoa(i)) } + return err } } @@ -108,11 +113,15 @@ func (m *OpenStackInfo) contextValidateHosts(ctx context.Context, formats strfmt } if err := m.Hosts[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("hosts" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("hosts" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/open_stacks.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/open_stacks.go index bddbddfa73c..e141aaee84f 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/open_stacks.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/open_stacks.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -52,11 +53,15 @@ func (m *OpenStacks) validateOpenStacks(formats strfmt.Registry) error { if m.OpenStacks[i] != nil { if err := m.OpenStacks[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("openStacks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("openStacks" + "." + strconv.Itoa(i)) } + return err } } @@ -91,11 +96,15 @@ func (m *OpenStacks) contextValidateOpenStacks(ctx context.Context, formats strf } if err := m.OpenStacks[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("openStacks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("openStacks" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/operations.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/operations.go index 66c44c0f84c..6c97932cfdb 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/operations.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/operations.go @@ -29,7 +29,7 @@ type Operations struct { OperatingMode string `json:"operatingMode,omitempty"` // Name of the job task to execute - // Enum: ["dston","retrydump","consoleservice","iopreset","remotedstoff","remotedston","iopdump","dumprestart"] + // Enum: ["consoleservice","dston","dumprestart","iopdump","iopreset","remotedstoff","remotedston","retrydump"] Task string `json:"task,omitempty"` } @@ -55,7 +55,7 @@ func (m *Operations) Validate(formats strfmt.Registry) error { return nil } -var operationsTypeBootModePropEnum []interface{} +var operationsTypeBootModePropEnum []any func init() { var res []string @@ -103,7 +103,7 @@ func (m *Operations) validateBootMode(formats strfmt.Registry) error { return nil } -var operationsTypeOperatingModePropEnum []interface{} +var operationsTypeOperatingModePropEnum []any func init() { var res []string @@ -145,11 +145,11 @@ func (m *Operations) validateOperatingMode(formats strfmt.Registry) error { return nil } -var operationsTypeTaskPropEnum []interface{} +var operationsTypeTaskPropEnum []any func init() { var res []string - if err := json.Unmarshal([]byte(`["dston","retrydump","consoleservice","iopreset","remotedstoff","remotedston","iopdump","dumprestart"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["consoleservice","dston","dumprestart","iopdump","iopreset","remotedstoff","remotedston","retrydump"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -159,14 +159,17 @@ func init() { const ( + // OperationsTaskConsoleservice captures enum value "consoleservice" + OperationsTaskConsoleservice string = "consoleservice" + // OperationsTaskDston captures enum value "dston" OperationsTaskDston string = "dston" - // OperationsTaskRetrydump captures enum value "retrydump" - OperationsTaskRetrydump string = "retrydump" + // OperationsTaskDumprestart captures enum value "dumprestart" + OperationsTaskDumprestart string = "dumprestart" - // OperationsTaskConsoleservice captures enum value "consoleservice" - OperationsTaskConsoleservice string = "consoleservice" + // OperationsTaskIopdump captures enum value "iopdump" + OperationsTaskIopdump string = "iopdump" // OperationsTaskIopreset captures enum value "iopreset" OperationsTaskIopreset string = "iopreset" @@ -177,11 +180,8 @@ const ( // OperationsTaskRemotedston captures enum value "remotedston" OperationsTaskRemotedston string = "remotedston" - // OperationsTaskIopdump captures enum value "iopdump" - OperationsTaskIopdump string = "iopdump" - - // OperationsTaskDumprestart captures enum value "dumprestart" - OperationsTaskDumprestart string = "dumprestart" + // OperationsTaskRetrydump captures enum value "retrydump" + OperationsTaskRetrydump string = "retrydump" ) // prop value enum diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/owner_info.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/owner_info.go index 6377b7f79a8..e466d077def 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/owner_info.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/owner_info.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -165,11 +166,15 @@ func (m *OwnerInfo) validateSoftlayerSubscriptions(formats strfmt.Registry) erro if m.SoftlayerSubscriptions[i] != nil { if err := m.SoftlayerSubscriptions[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("softlayerSubscriptions" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("softlayerSubscriptions" + "." + strconv.Itoa(i)) } + return err } } @@ -213,11 +218,15 @@ func (m *OwnerInfo) contextValidateSoftlayerSubscriptions(ctx context.Context, f } if err := m.SoftlayerSubscriptions[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("softlayerSubscriptions" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("softlayerSubscriptions" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance.go index 698429226ff..1d1e8be5047 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -44,6 +45,9 @@ type PVMInstance struct { // Required: true DiskSize *float64 `json:"diskSize"` + // Effective processor compatibility mode + EffectiveProcessorCompatibilityMode string `json:"effectiveProcessorCompatibilityMode,omitempty"` + // fault Fault *PVMInstanceFault `json:"fault,omitempty"` @@ -99,6 +103,9 @@ type PVMInstance struct { // The placement group of the server PlacementGroup *string `json:"placementGroup,omitempty"` + // Preferred processor compatibility mode + PreferredProcessorCompatibilityMode string `json:"preferredProcessorCompatibilityMode,omitempty"` + // Processor type (dedicated, shared, capped) // Required: true // Enum: ["dedicated","shared","capped",""] @@ -173,6 +180,9 @@ type PVMInstance struct { // List of volume IDs // Required: true VolumeIDs []string `json:"volumeIDs"` + + // List of vPMEM volumes attached to this PVM Instance + VpmemVolumes []*VPMemVolumeReference `json:"vpmemVolumes,omitempty"` } // Validate validates this p VM instance @@ -283,6 +293,10 @@ func (m *PVMInstance) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateVpmemVolumes(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -301,11 +315,15 @@ func (m *PVMInstance) validateAddresses(formats strfmt.Registry) error { if m.Addresses[i] != nil { if err := m.Addresses[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addresses" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addresses" + "." + strconv.Itoa(i)) } + return err } } @@ -322,11 +340,15 @@ func (m *PVMInstance) validateConsoleLanguage(formats strfmt.Registry) error { if m.ConsoleLanguage != nil { if err := m.ConsoleLanguage.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("consoleLanguage") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("consoleLanguage") } + return err } } @@ -352,11 +374,15 @@ func (m *PVMInstance) validateCrn(formats strfmt.Registry) error { } if err := m.Crn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("crn") } + return err } @@ -379,11 +405,15 @@ func (m *PVMInstance) validateFault(formats strfmt.Registry) error { if m.Fault != nil { if err := m.Fault.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("fault") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("fault") } + return err } } @@ -398,11 +428,15 @@ func (m *PVMInstance) validateHealth(formats strfmt.Registry) error { if m.Health != nil { if err := m.Health.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("health") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("health") } + return err } } @@ -449,11 +483,15 @@ func (m *PVMInstance) validateNetworks(formats strfmt.Registry) error { if m.Networks[i] != nil { if err := m.Networks[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("networks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("networks" + "." + strconv.Itoa(i)) } + return err } } @@ -472,7 +510,7 @@ func (m *PVMInstance) validateOsType(formats strfmt.Registry) error { return nil } -var pVmInstanceTypeProcTypePropEnum []interface{} +var pVmInstanceTypeProcTypePropEnum []any func init() { var res []string @@ -546,11 +584,15 @@ func (m *PVMInstance) validateSapProfile(formats strfmt.Registry) error { if m.SapProfile != nil { if err := m.SapProfile.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("sapProfile") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("sapProfile") } + return err } } @@ -574,11 +616,15 @@ func (m *PVMInstance) validateSoftwareLicenses(formats strfmt.Registry) error { if m.SoftwareLicenses != nil { if err := m.SoftwareLicenses.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("softwareLicenses") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("softwareLicenses") } + return err } } @@ -600,11 +646,15 @@ func (m *PVMInstance) validateSrcs(formats strfmt.Registry) error { if m.Srcs[i][ii] != nil { if err := m.Srcs[i][ii].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("srcs" + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("srcs" + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii)) } + return err } } @@ -652,11 +702,15 @@ func (m *PVMInstance) validateUserTags(formats strfmt.Registry) error { } if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } @@ -670,11 +724,15 @@ func (m *PVMInstance) validateVirtualCores(formats strfmt.Registry) error { if m.VirtualCores != nil { if err := m.VirtualCores.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("virtualCores") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("virtualCores") } + return err } } @@ -689,11 +747,15 @@ func (m *PVMInstance) validateVirtualSerialNumber(formats strfmt.Registry) error if m.VirtualSerialNumber != nil { if err := m.VirtualSerialNumber.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("virtualSerialNumber") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("virtualSerialNumber") } + return err } } @@ -710,6 +772,36 @@ func (m *PVMInstance) validateVolumeIDs(formats strfmt.Registry) error { return nil } +func (m *PVMInstance) validateVpmemVolumes(formats strfmt.Registry) error { + if swag.IsZero(m.VpmemVolumes) { // not required + return nil + } + + for i := 0; i < len(m.VpmemVolumes); i++ { + if swag.IsZero(m.VpmemVolumes[i]) { // not required + continue + } + + if m.VpmemVolumes[i] != nil { + if err := m.VpmemVolumes[i].Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("vpmemVolumes" + "." + strconv.Itoa(i)) + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("vpmemVolumes" + "." + strconv.Itoa(i)) + } + + return err + } + } + + } + + return nil +} + // ContextValidate validate this p VM instance based on the context it is used func (m *PVMInstance) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -762,6 +854,10 @@ func (m *PVMInstance) ContextValidate(ctx context.Context, formats strfmt.Regist res = append(res, err) } + if err := m.contextValidateVpmemVolumes(ctx, formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -779,11 +875,15 @@ func (m *PVMInstance) contextValidateAddresses(ctx context.Context, formats strf } if err := m.Addresses[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addresses" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addresses" + "." + strconv.Itoa(i)) } + return err } } @@ -802,11 +902,15 @@ func (m *PVMInstance) contextValidateConsoleLanguage(ctx context.Context, format } if err := m.ConsoleLanguage.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("consoleLanguage") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("consoleLanguage") } + return err } } @@ -821,11 +925,15 @@ func (m *PVMInstance) contextValidateCrn(ctx context.Context, formats strfmt.Reg } if err := m.Crn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("crn") } + return err } @@ -841,11 +949,15 @@ func (m *PVMInstance) contextValidateFault(ctx context.Context, formats strfmt.R } if err := m.Fault.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("fault") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("fault") } + return err } } @@ -862,11 +974,15 @@ func (m *PVMInstance) contextValidateHealth(ctx context.Context, formats strfmt. } if err := m.Health.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("health") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("health") } + return err } } @@ -885,11 +1001,15 @@ func (m *PVMInstance) contextValidateNetworks(ctx context.Context, formats strfm } if err := m.Networks[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("networks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("networks" + "." + strconv.Itoa(i)) } + return err } } @@ -908,11 +1028,15 @@ func (m *PVMInstance) contextValidateSapProfile(ctx context.Context, formats str } if err := m.SapProfile.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("sapProfile") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("sapProfile") } + return err } } @@ -929,11 +1053,15 @@ func (m *PVMInstance) contextValidateSoftwareLicenses(ctx context.Context, forma } if err := m.SoftwareLicenses.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("softwareLicenses") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("softwareLicenses") } + return err } } @@ -954,11 +1082,15 @@ func (m *PVMInstance) contextValidateSrcs(ctx context.Context, formats strfmt.Re } if err := m.Srcs[i][ii].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("srcs" + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("srcs" + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii)) } + return err } } @@ -973,11 +1105,15 @@ func (m *PVMInstance) contextValidateSrcs(ctx context.Context, formats strfmt.Re func (m *PVMInstance) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } @@ -993,11 +1129,15 @@ func (m *PVMInstance) contextValidateVirtualCores(ctx context.Context, formats s } if err := m.VirtualCores.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("virtualCores") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("virtualCores") } + return err } } @@ -1014,11 +1154,15 @@ func (m *PVMInstance) contextValidateVirtualSerialNumber(ctx context.Context, fo } if err := m.VirtualSerialNumber.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("virtualSerialNumber") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("virtualSerialNumber") } + return err } } @@ -1026,6 +1170,35 @@ func (m *PVMInstance) contextValidateVirtualSerialNumber(ctx context.Context, fo return nil } +func (m *PVMInstance) contextValidateVpmemVolumes(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.VpmemVolumes); i++ { + + if m.VpmemVolumes[i] != nil { + + if swag.IsZero(m.VpmemVolumes[i]) { // not required + return nil + } + + if err := m.VpmemVolumes[i].ContextValidate(ctx, formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("vpmemVolumes" + "." + strconv.Itoa(i)) + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("vpmemVolumes" + "." + strconv.Itoa(i)) + } + + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *PVMInstance) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_action.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_action.go index 582f52a512c..0a76ca0f2f2 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_action.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_action.go @@ -20,9 +20,9 @@ import ( // swagger:model PVMInstanceAction type PVMInstanceAction struct { - // Name of the action to take; can be start, stop, hard-reboot, soft-reboot, immediate-shutdown, reset-state, dhcp-ip-sync (on-prem only) + // Name of the action to take; can be 'dhcp-ip-sync' (on-prem only), 'dumprestart', 'hard-reboot', 'immediate-shutdown', 'reset-state', 'soft-reboot', 'start', 'stop' // Required: true - // Enum: ["start","stop","immediate-shutdown","hard-reboot","soft-reboot","reset-state","dhcp-ip-sync"] + // Enum: ["dhcp-ip-sync","dumprestart","hard-reboot","immediate-shutdown","reset-state","soft-reboot","start","stop"] Action *string `json:"action"` } @@ -40,11 +40,11 @@ func (m *PVMInstanceAction) Validate(formats strfmt.Registry) error { return nil } -var pVmInstanceActionTypeActionPropEnum []interface{} +var pVmInstanceActionTypeActionPropEnum []any func init() { var res []string - if err := json.Unmarshal([]byte(`["start","stop","immediate-shutdown","hard-reboot","soft-reboot","reset-state","dhcp-ip-sync"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["dhcp-ip-sync","dumprestart","hard-reboot","immediate-shutdown","reset-state","soft-reboot","start","stop"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -54,26 +54,29 @@ func init() { const ( - // PVMInstanceActionActionStart captures enum value "start" - PVMInstanceActionActionStart string = "start" + // PVMInstanceActionActionDhcpDashIPDashSync captures enum value "dhcp-ip-sync" + PVMInstanceActionActionDhcpDashIPDashSync string = "dhcp-ip-sync" - // PVMInstanceActionActionStop captures enum value "stop" - PVMInstanceActionActionStop string = "stop" + // PVMInstanceActionActionDumprestart captures enum value "dumprestart" + PVMInstanceActionActionDumprestart string = "dumprestart" + + // PVMInstanceActionActionHardDashReboot captures enum value "hard-reboot" + PVMInstanceActionActionHardDashReboot string = "hard-reboot" // PVMInstanceActionActionImmediateDashShutdown captures enum value "immediate-shutdown" PVMInstanceActionActionImmediateDashShutdown string = "immediate-shutdown" - // PVMInstanceActionActionHardDashReboot captures enum value "hard-reboot" - PVMInstanceActionActionHardDashReboot string = "hard-reboot" + // PVMInstanceActionActionResetDashState captures enum value "reset-state" + PVMInstanceActionActionResetDashState string = "reset-state" // PVMInstanceActionActionSoftDashReboot captures enum value "soft-reboot" PVMInstanceActionActionSoftDashReboot string = "soft-reboot" - // PVMInstanceActionActionResetDashState captures enum value "reset-state" - PVMInstanceActionActionResetDashState string = "reset-state" + // PVMInstanceActionActionStart captures enum value "start" + PVMInstanceActionActionStart string = "start" - // PVMInstanceActionActionDhcpDashIPDashSync captures enum value "dhcp-ip-sync" - PVMInstanceActionActionDhcpDashIPDashSync string = "dhcp-ip-sync" + // PVMInstanceActionActionStop captures enum value "stop" + PVMInstanceActionActionStop string = "stop" ) // prop value enum diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_capture.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_capture.go index 1094909f255..b76095098bd 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_capture.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_capture.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -73,7 +74,7 @@ func (m *PVMInstanceCapture) Validate(formats strfmt.Registry) error { return nil } -var pVmInstanceCaptureTypeCaptureDestinationPropEnum []interface{} +var pVmInstanceCaptureTypeCaptureDestinationPropEnum []any func init() { var res []string @@ -134,11 +135,15 @@ func (m *PVMInstanceCapture) validateUserTags(formats strfmt.Registry) error { } if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } @@ -162,11 +167,15 @@ func (m *PVMInstanceCapture) ContextValidate(ctx context.Context, formats strfmt func (m *PVMInstanceCapture) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_clone.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_clone.go index b1bbd983bde..0e72786c2cc 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_clone.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_clone.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -97,11 +98,15 @@ func (m *PVMInstanceClone) validateNetworks(formats strfmt.Registry) error { if m.Networks[i] != nil { if err := m.Networks[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("networks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("networks" + "." + strconv.Itoa(i)) } + return err } } @@ -111,7 +116,7 @@ func (m *PVMInstanceClone) validateNetworks(formats strfmt.Registry) error { return nil } -var pVmInstanceCloneTypeProcTypePropEnum []interface{} +var pVmInstanceCloneTypeProcTypePropEnum []any func init() { var res []string @@ -163,11 +168,15 @@ func (m *PVMInstanceClone) validateSoftwareLicenses(formats strfmt.Registry) err if m.SoftwareLicenses != nil { if err := m.SoftwareLicenses.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("softwareLicenses") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("softwareLicenses") } + return err } } @@ -204,11 +213,15 @@ func (m *PVMInstanceClone) contextValidateNetworks(ctx context.Context, formats } if err := m.Networks[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("networks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("networks" + "." + strconv.Itoa(i)) } + return err } } @@ -227,11 +240,15 @@ func (m *PVMInstanceClone) contextValidateSoftwareLicenses(ctx context.Context, } if err := m.SoftwareLicenses.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("softwareLicenses") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("softwareLicenses") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_configuration.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_configuration.go index 10c13a146b5..d911e790f95 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_configuration.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_configuration.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -68,11 +69,15 @@ func (m *PVMInstanceConfiguration) validateConsoleLanguage(formats strfmt.Regist if m.ConsoleLanguage != nil { if err := m.ConsoleLanguage.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("consoleLanguage") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("consoleLanguage") } + return err } } @@ -87,11 +92,15 @@ func (m *PVMInstanceConfiguration) validateSapProfile(formats strfmt.Registry) e if m.SapProfile != nil { if err := m.SapProfile.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("sapProfile") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("sapProfile") } + return err } } @@ -106,11 +115,15 @@ func (m *PVMInstanceConfiguration) validateSoftwareLicenses(formats strfmt.Regis if m.SoftwareLicenses != nil { if err := m.SoftwareLicenses.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("softwareLicenses") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("softwareLicenses") } + return err } } @@ -132,11 +145,15 @@ func (m *PVMInstanceConfiguration) validateSystemReferenceCodes(formats strfmt.R if m.SystemReferenceCodes[i][ii] != nil { if err := m.SystemReferenceCodes[i][ii].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("systemReferenceCodes" + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("systemReferenceCodes" + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii)) } + return err } } @@ -183,11 +200,15 @@ func (m *PVMInstanceConfiguration) contextValidateConsoleLanguage(ctx context.Co } if err := m.ConsoleLanguage.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("consoleLanguage") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("consoleLanguage") } + return err } } @@ -204,11 +225,15 @@ func (m *PVMInstanceConfiguration) contextValidateSapProfile(ctx context.Context } if err := m.SapProfile.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("sapProfile") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("sapProfile") } + return err } } @@ -225,11 +250,15 @@ func (m *PVMInstanceConfiguration) contextValidateSoftwareLicenses(ctx context.C } if err := m.SoftwareLicenses.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("softwareLicenses") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("softwareLicenses") } + return err } } @@ -250,11 +279,15 @@ func (m *PVMInstanceConfiguration) contextValidateSystemReferenceCodes(ctx conte } if err := m.SystemReferenceCodes[i][ii].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("systemReferenceCodes" + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("systemReferenceCodes" + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_create.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_create.go index a2b037d1954..011ba8ca50b 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_create.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_create.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -59,6 +60,9 @@ type PVMInstanceCreate struct { // The placement group for the server PlacementGroup string `json:"placementGroup,omitempty"` + // processor compatibility mode + PreferredProcessorCompatibilityMode string `json:"preferredProcessorCompatibilityMode,omitempty"` + // Processor type (dedicated, shared, capped) // Required: true // Enum: ["dedicated","shared","capped"] @@ -130,6 +134,9 @@ type PVMInstanceCreate struct { // List of volume IDs VolumeIDs []string `json:"volumeIDs"` + + // The vPMEM volumes information + VpmemVolumes []*VPMemVolumeCreate `json:"vpmemVolumes"` } // Validate validates this p VM instance create @@ -208,6 +215,10 @@ func (m *PVMInstanceCreate) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateVpmemVolumes(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -221,11 +232,15 @@ func (m *PVMInstanceCreate) validateDeploymentTarget(formats strfmt.Registry) er if m.DeploymentTarget != nil { if err := m.DeploymentTarget.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("deploymentTarget") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("deploymentTarget") } + return err } } @@ -263,11 +278,15 @@ func (m *PVMInstanceCreate) validateNetworks(formats strfmt.Registry) error { if m.Networks[i] != nil { if err := m.Networks[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("networks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("networks" + "." + strconv.Itoa(i)) } + return err } } @@ -283,18 +302,22 @@ func (m *PVMInstanceCreate) validatePinPolicy(formats strfmt.Registry) error { } if err := m.PinPolicy.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("pinPolicy") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("pinPolicy") } + return err } return nil } -var pVmInstanceCreateTypeProcTypePropEnum []interface{} +var pVmInstanceCreateTypeProcTypePropEnum []any func init() { var res []string @@ -349,7 +372,7 @@ func (m *PVMInstanceCreate) validateProcessors(formats strfmt.Registry) error { return nil } -var pVmInstanceCreateTypeReplicantAffinityPolicyPropEnum []interface{} +var pVmInstanceCreateTypeReplicantAffinityPolicyPropEnum []any func init() { var res []string @@ -394,7 +417,7 @@ func (m *PVMInstanceCreate) validateReplicantAffinityPolicy(formats strfmt.Regis return nil } -var pVmInstanceCreateTypeReplicantNamingSchemePropEnum []interface{} +var pVmInstanceCreateTypeReplicantNamingSchemePropEnum []any func init() { var res []string @@ -464,11 +487,15 @@ func (m *PVMInstanceCreate) validateSoftwareLicenses(formats strfmt.Registry) er if m.SoftwareLicenses != nil { if err := m.SoftwareLicenses.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("softwareLicenses") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("softwareLicenses") } + return err } } @@ -483,11 +510,15 @@ func (m *PVMInstanceCreate) validateStorageAffinity(formats strfmt.Registry) err if m.StorageAffinity != nil { if err := m.StorageAffinity.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("storageAffinity") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("storageAffinity") } + return err } } @@ -495,7 +526,7 @@ func (m *PVMInstanceCreate) validateStorageAffinity(formats strfmt.Registry) err return nil } -var pVmInstanceCreateTypeStorageConnectionPropEnum []interface{} +var pVmInstanceCreateTypeStorageConnectionPropEnum []any func init() { var res []string @@ -537,7 +568,7 @@ func (m *PVMInstanceCreate) validateStorageConnection(formats strfmt.Registry) e return nil } -var pVmInstanceCreateTypeStorageConnectionV2PropEnum []interface{} +var pVmInstanceCreateTypeStorageConnectionV2PropEnum []any func init() { var res []string @@ -585,11 +616,15 @@ func (m *PVMInstanceCreate) validateUserTags(formats strfmt.Registry) error { } if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } @@ -603,11 +638,15 @@ func (m *PVMInstanceCreate) validateVirtualCores(formats strfmt.Registry) error if m.VirtualCores != nil { if err := m.VirtualCores.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("virtualCores") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("virtualCores") } + return err } } @@ -622,11 +661,15 @@ func (m *PVMInstanceCreate) validateVirtualSerialNumber(formats strfmt.Registry) if m.VirtualSerialNumber != nil { if err := m.VirtualSerialNumber.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("virtualSerialNumber") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("virtualSerialNumber") } + return err } } @@ -634,6 +677,36 @@ func (m *PVMInstanceCreate) validateVirtualSerialNumber(formats strfmt.Registry) return nil } +func (m *PVMInstanceCreate) validateVpmemVolumes(formats strfmt.Registry) error { + if swag.IsZero(m.VpmemVolumes) { // not required + return nil + } + + for i := 0; i < len(m.VpmemVolumes); i++ { + if swag.IsZero(m.VpmemVolumes[i]) { // not required + continue + } + + if m.VpmemVolumes[i] != nil { + if err := m.VpmemVolumes[i].Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("vpmemVolumes" + "." + strconv.Itoa(i)) + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("vpmemVolumes" + "." + strconv.Itoa(i)) + } + + return err + } + } + + } + + return nil +} + // ContextValidate validate this p VM instance create based on the context it is used func (m *PVMInstanceCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -670,6 +743,10 @@ func (m *PVMInstanceCreate) ContextValidate(ctx context.Context, formats strfmt. res = append(res, err) } + if err := m.contextValidateVpmemVolumes(ctx, formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -685,11 +762,15 @@ func (m *PVMInstanceCreate) contextValidateDeploymentTarget(ctx context.Context, } if err := m.DeploymentTarget.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("deploymentTarget") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("deploymentTarget") } + return err } } @@ -708,11 +789,15 @@ func (m *PVMInstanceCreate) contextValidateNetworks(ctx context.Context, formats } if err := m.Networks[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("networks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("networks" + "." + strconv.Itoa(i)) } + return err } } @@ -729,11 +814,15 @@ func (m *PVMInstanceCreate) contextValidatePinPolicy(ctx context.Context, format } if err := m.PinPolicy.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("pinPolicy") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("pinPolicy") } + return err } @@ -749,11 +838,15 @@ func (m *PVMInstanceCreate) contextValidateSoftwareLicenses(ctx context.Context, } if err := m.SoftwareLicenses.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("softwareLicenses") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("softwareLicenses") } + return err } } @@ -770,11 +863,15 @@ func (m *PVMInstanceCreate) contextValidateStorageAffinity(ctx context.Context, } if err := m.StorageAffinity.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("storageAffinity") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("storageAffinity") } + return err } } @@ -785,11 +882,15 @@ func (m *PVMInstanceCreate) contextValidateStorageAffinity(ctx context.Context, func (m *PVMInstanceCreate) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } @@ -805,11 +906,15 @@ func (m *PVMInstanceCreate) contextValidateVirtualCores(ctx context.Context, for } if err := m.VirtualCores.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("virtualCores") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("virtualCores") } + return err } } @@ -826,11 +931,15 @@ func (m *PVMInstanceCreate) contextValidateVirtualSerialNumber(ctx context.Conte } if err := m.VirtualSerialNumber.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("virtualSerialNumber") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("virtualSerialNumber") } + return err } } @@ -838,6 +947,35 @@ func (m *PVMInstanceCreate) contextValidateVirtualSerialNumber(ctx context.Conte return nil } +func (m *PVMInstanceCreate) contextValidateVpmemVolumes(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.VpmemVolumes); i++ { + + if m.VpmemVolumes[i] != nil { + + if swag.IsZero(m.VpmemVolumes[i]) { // not required + return nil + } + + if err := m.VpmemVolumes[i].ContextValidate(ctx, formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("vpmemVolumes" + "." + strconv.Itoa(i)) + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("vpmemVolumes" + "." + strconv.Itoa(i)) + } + + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *PVMInstanceCreate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_list.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_list.go index 531cb4b870e..30f63b167d4 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_list.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_list.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -30,11 +31,15 @@ func (m PVMInstanceList) Validate(formats strfmt.Registry) error { if m[i] != nil { if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName(strconv.Itoa(i)) } + return err } } @@ -60,11 +65,15 @@ func (m PVMInstanceList) ContextValidate(ctx context.Context, formats strfmt.Reg } if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName(strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_multi_create.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_multi_create.go index 7df1b2e6671..85e9fd6ddca 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_multi_create.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_multi_create.go @@ -50,7 +50,7 @@ func (m *PVMInstanceMultiCreate) Validate(formats strfmt.Registry) error { return nil } -var pVmInstanceMultiCreateTypeAffinityPolicyPropEnum []interface{} +var pVmInstanceMultiCreateTypeAffinityPolicyPropEnum []any func init() { var res []string @@ -95,7 +95,7 @@ func (m *PVMInstanceMultiCreate) validateAffinityPolicy(formats strfmt.Registry) return nil } -var pVmInstanceMultiCreateTypeNumericalPropEnum []interface{} +var pVmInstanceMultiCreateTypeNumericalPropEnum []any func init() { var res []string diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_networks.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_networks.go index dab3b208330..3eeee0c63c6 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_networks.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_networks.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -52,11 +53,15 @@ func (m *PVMInstanceNetworks) validateNetworks(formats strfmt.Registry) error { if m.Networks[i] != nil { if err := m.Networks[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("networks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("networks" + "." + strconv.Itoa(i)) } + return err } } @@ -91,11 +96,15 @@ func (m *PVMInstanceNetworks) contextValidateNetworks(ctx context.Context, forma } if err := m.Networks[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("networks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("networks" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_operation.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_operation.go index 88a38dfbb8d..5450336cd30 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_operation.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_operation.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -56,11 +57,15 @@ func (m *PVMInstanceOperation) validateOperation(formats strfmt.Registry) error if m.Operation != nil { if err := m.Operation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("operation") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("operation") } + return err } } @@ -68,7 +73,7 @@ func (m *PVMInstanceOperation) validateOperation(formats strfmt.Registry) error return nil } -var pVmInstanceOperationTypeOperationTypePropEnum []interface{} +var pVmInstanceOperationTypeOperationTypePropEnum []any func init() { var res []string @@ -130,11 +135,15 @@ func (m *PVMInstanceOperation) contextValidateOperation(ctx context.Context, for if m.Operation != nil { if err := m.Operation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("operation") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("operation") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_reference.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_reference.go index be890f3ab9e..97fba5d298a 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_reference.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_reference.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -41,6 +42,9 @@ type PVMInstanceReference struct { // Required: true DiskSize *float64 `json:"diskSize"` + // Effective processor compatibility mode + EffectiveProcessorCompatibilityMode string `json:"effectiveProcessorCompatibilityMode,omitempty"` + // fault Fault *PVMInstanceFault `json:"fault,omitempty"` @@ -93,6 +97,9 @@ type PVMInstanceReference struct { // The placement group of the server PlacementGroup *string `json:"placementGroup,omitempty"` + // Preferred processor compatibility mode + PreferredProcessorCompatibilityMode string `json:"preferredProcessorCompatibilityMode,omitempty"` + // Processor type (dedicated, shared, capped) // Required: true // Enum: ["dedicated","shared","capped"] @@ -159,6 +166,9 @@ type PVMInstanceReference struct { // Information about Virtual Serial Number assigned to the PVM Instance VirtualSerialNumber *GetServerVirtualSerialNumber `json:"virtualSerialNumber,omitempty"` + + // List of vPMEM volumes attached to this PVM Instance + VpmemVolumes []*VPMemVolumeReference `json:"vpmemVolumes,omitempty"` } // Validate validates this p VM instance reference @@ -257,6 +267,10 @@ func (m *PVMInstanceReference) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateVpmemVolumes(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -275,11 +289,15 @@ func (m *PVMInstanceReference) validateAddresses(formats strfmt.Registry) error if m.Addresses[i] != nil { if err := m.Addresses[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addresses" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addresses" + "." + strconv.Itoa(i)) } + return err } } @@ -296,11 +314,15 @@ func (m *PVMInstanceReference) validateConsoleLanguage(formats strfmt.Registry) if m.ConsoleLanguage != nil { if err := m.ConsoleLanguage.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("consoleLanguage") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("consoleLanguage") } + return err } } @@ -326,11 +348,15 @@ func (m *PVMInstanceReference) validateCrn(formats strfmt.Registry) error { } if err := m.Crn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("crn") } + return err } @@ -353,11 +379,15 @@ func (m *PVMInstanceReference) validateFault(formats strfmt.Registry) error { if m.Fault != nil { if err := m.Fault.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("fault") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("fault") } + return err } } @@ -372,11 +402,15 @@ func (m *PVMInstanceReference) validateHealth(formats strfmt.Registry) error { if m.Health != nil { if err := m.Health.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("health") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("health") } + return err } } @@ -423,11 +457,15 @@ func (m *PVMInstanceReference) validateNetworks(formats strfmt.Registry) error { if m.Networks[i] != nil { if err := m.Networks[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("networks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("networks" + "." + strconv.Itoa(i)) } + return err } } @@ -446,7 +484,7 @@ func (m *PVMInstanceReference) validateOsType(formats strfmt.Registry) error { return nil } -var pVmInstanceReferenceTypeProcTypePropEnum []interface{} +var pVmInstanceReferenceTypeProcTypePropEnum []any func init() { var res []string @@ -517,11 +555,15 @@ func (m *PVMInstanceReference) validateSapProfile(formats strfmt.Registry) error if m.SapProfile != nil { if err := m.SapProfile.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("sapProfile") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("sapProfile") } + return err } } @@ -545,11 +587,15 @@ func (m *PVMInstanceReference) validateSoftwareLicenses(formats strfmt.Registry) if m.SoftwareLicenses != nil { if err := m.SoftwareLicenses.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("softwareLicenses") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("softwareLicenses") } + return err } } @@ -571,11 +617,15 @@ func (m *PVMInstanceReference) validateSrcs(formats strfmt.Registry) error { if m.Srcs[i][ii] != nil { if err := m.Srcs[i][ii].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("srcs" + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("srcs" + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii)) } + return err } } @@ -615,11 +665,15 @@ func (m *PVMInstanceReference) validateVirtualCores(formats strfmt.Registry) err if m.VirtualCores != nil { if err := m.VirtualCores.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("virtualCores") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("virtualCores") } + return err } } @@ -634,11 +688,15 @@ func (m *PVMInstanceReference) validateVirtualSerialNumber(formats strfmt.Regist if m.VirtualSerialNumber != nil { if err := m.VirtualSerialNumber.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("virtualSerialNumber") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("virtualSerialNumber") } + return err } } @@ -646,6 +704,36 @@ func (m *PVMInstanceReference) validateVirtualSerialNumber(formats strfmt.Regist return nil } +func (m *PVMInstanceReference) validateVpmemVolumes(formats strfmt.Registry) error { + if swag.IsZero(m.VpmemVolumes) { // not required + return nil + } + + for i := 0; i < len(m.VpmemVolumes); i++ { + if swag.IsZero(m.VpmemVolumes[i]) { // not required + continue + } + + if m.VpmemVolumes[i] != nil { + if err := m.VpmemVolumes[i].Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("vpmemVolumes" + "." + strconv.Itoa(i)) + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("vpmemVolumes" + "." + strconv.Itoa(i)) + } + + return err + } + } + + } + + return nil +} + // ContextValidate validate this p VM instance reference based on the context it is used func (m *PVMInstanceReference) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -694,6 +782,10 @@ func (m *PVMInstanceReference) ContextValidate(ctx context.Context, formats strf res = append(res, err) } + if err := m.contextValidateVpmemVolumes(ctx, formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -711,11 +803,15 @@ func (m *PVMInstanceReference) contextValidateAddresses(ctx context.Context, for } if err := m.Addresses[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("addresses" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("addresses" + "." + strconv.Itoa(i)) } + return err } } @@ -734,11 +830,15 @@ func (m *PVMInstanceReference) contextValidateConsoleLanguage(ctx context.Contex } if err := m.ConsoleLanguage.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("consoleLanguage") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("consoleLanguage") } + return err } } @@ -753,11 +853,15 @@ func (m *PVMInstanceReference) contextValidateCrn(ctx context.Context, formats s } if err := m.Crn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("crn") } + return err } @@ -773,11 +877,15 @@ func (m *PVMInstanceReference) contextValidateFault(ctx context.Context, formats } if err := m.Fault.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("fault") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("fault") } + return err } } @@ -794,11 +902,15 @@ func (m *PVMInstanceReference) contextValidateHealth(ctx context.Context, format } if err := m.Health.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("health") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("health") } + return err } } @@ -817,11 +929,15 @@ func (m *PVMInstanceReference) contextValidateNetworks(ctx context.Context, form } if err := m.Networks[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("networks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("networks" + "." + strconv.Itoa(i)) } + return err } } @@ -840,11 +956,15 @@ func (m *PVMInstanceReference) contextValidateSapProfile(ctx context.Context, fo } if err := m.SapProfile.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("sapProfile") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("sapProfile") } + return err } } @@ -861,11 +981,15 @@ func (m *PVMInstanceReference) contextValidateSoftwareLicenses(ctx context.Conte } if err := m.SoftwareLicenses.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("softwareLicenses") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("softwareLicenses") } + return err } } @@ -886,11 +1010,15 @@ func (m *PVMInstanceReference) contextValidateSrcs(ctx context.Context, formats } if err := m.Srcs[i][ii].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("srcs" + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("srcs" + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii)) } + return err } } @@ -911,11 +1039,15 @@ func (m *PVMInstanceReference) contextValidateVirtualCores(ctx context.Context, } if err := m.VirtualCores.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("virtualCores") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("virtualCores") } + return err } } @@ -932,11 +1064,15 @@ func (m *PVMInstanceReference) contextValidateVirtualSerialNumber(ctx context.Co } if err := m.VirtualSerialNumber.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("virtualSerialNumber") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("virtualSerialNumber") } + return err } } @@ -944,6 +1080,35 @@ func (m *PVMInstanceReference) contextValidateVirtualSerialNumber(ctx context.Co return nil } +func (m *PVMInstanceReference) contextValidateVpmemVolumes(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.VpmemVolumes); i++ { + + if m.VpmemVolumes[i] != nil { + + if swag.IsZero(m.VpmemVolumes[i]) { // not required + return nil + } + + if err := m.VpmemVolumes[i].ContextValidate(ctx, formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("vpmemVolumes" + "." + strconv.Itoa(i)) + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("vpmemVolumes" + "." + strconv.Itoa(i)) + } + + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *PVMInstanceReference) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_reference_v2.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_reference_v2.go index 57fd301fabf..587dfdb76a8 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_reference_v2.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_reference_v2.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -80,6 +81,9 @@ type PVMInstanceReferenceV2 struct { // Information about Virtual Serial Number assigned to the PVM Instance VirtualSerialNumber *GetServerVirtualSerialNumber `json:"virtualSerialNumber,omitempty"` + + // List of vPMEM volumes attached to this PVM Instance + VpmemVolumes []*VPMemVolumeReference `json:"vpmemVolumes,omitempty"` } // Validate validates this p VM instance reference v2 @@ -154,6 +158,10 @@ func (m *PVMInstanceReferenceV2) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateVpmemVolumes(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -167,11 +175,15 @@ func (m *PVMInstanceReferenceV2) validateConfiguration(formats strfmt.Registry) if m.Configuration != nil { if err := m.Configuration.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("configuration") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("configuration") } + return err } } @@ -187,11 +199,15 @@ func (m *PVMInstanceReferenceV2) validateCores(formats strfmt.Registry) error { if m.Cores != nil { if err := m.Cores.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("cores") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("cores") } + return err } } @@ -217,11 +233,15 @@ func (m *PVMInstanceReferenceV2) validateCrn(formats strfmt.Registry) error { } if err := m.Crn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("crn") } + return err } @@ -236,11 +256,15 @@ func (m *PVMInstanceReferenceV2) validateDeployment(formats strfmt.Registry) err if m.Deployment != nil { if err := m.Deployment.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("deployment") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("deployment") } + return err } } @@ -255,11 +279,15 @@ func (m *PVMInstanceReferenceV2) validateHealth(formats strfmt.Registry) error { if m.Health != nil { if err := m.Health.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("health") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("health") } + return err } } @@ -274,11 +302,15 @@ func (m *PVMInstanceReferenceV2) validateHost(formats strfmt.Registry) error { if m.Host != nil { if err := m.Host.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("host") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("host") } + return err } } @@ -312,11 +344,15 @@ func (m *PVMInstanceReferenceV2) validateMemory(formats strfmt.Registry) error { if m.Memory != nil { if err := m.Memory.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("memory") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("memory") } + return err } } @@ -346,11 +382,15 @@ func (m *PVMInstanceReferenceV2) validateNetworkPorts(formats strfmt.Registry) e if m.NetworkPorts[i] != nil { if err := m.NetworkPorts[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("networkPorts" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("networkPorts" + "." + strconv.Itoa(i)) } + return err } } @@ -368,11 +408,15 @@ func (m *PVMInstanceReferenceV2) validateOperatingSystem(formats strfmt.Registry if m.OperatingSystem != nil { if err := m.OperatingSystem.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("operatingSystem") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("operatingSystem") } + return err } } @@ -387,11 +431,15 @@ func (m *PVMInstanceReferenceV2) validatePlacementGroup(formats strfmt.Registry) if m.PlacementGroup != nil { if err := m.PlacementGroup.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("placementGroup") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("placementGroup") } + return err } } @@ -415,11 +463,15 @@ func (m *PVMInstanceReferenceV2) validateVirtualCores(formats strfmt.Registry) e if m.VirtualCores != nil { if err := m.VirtualCores.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("virtualCores") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("virtualCores") } + return err } } @@ -434,11 +486,15 @@ func (m *PVMInstanceReferenceV2) validateVirtualSerialNumber(formats strfmt.Regi if m.VirtualSerialNumber != nil { if err := m.VirtualSerialNumber.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("virtualSerialNumber") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("virtualSerialNumber") } + return err } } @@ -446,6 +502,36 @@ func (m *PVMInstanceReferenceV2) validateVirtualSerialNumber(formats strfmt.Regi return nil } +func (m *PVMInstanceReferenceV2) validateVpmemVolumes(formats strfmt.Registry) error { + if swag.IsZero(m.VpmemVolumes) { // not required + return nil + } + + for i := 0; i < len(m.VpmemVolumes); i++ { + if swag.IsZero(m.VpmemVolumes[i]) { // not required + continue + } + + if m.VpmemVolumes[i] != nil { + if err := m.VpmemVolumes[i].Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("vpmemVolumes" + "." + strconv.Itoa(i)) + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("vpmemVolumes" + "." + strconv.Itoa(i)) + } + + return err + } + } + + } + + return nil +} + // ContextValidate validate this p VM instance reference v2 based on the context it is used func (m *PVMInstanceReferenceV2) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -498,6 +584,10 @@ func (m *PVMInstanceReferenceV2) ContextValidate(ctx context.Context, formats st res = append(res, err) } + if err := m.contextValidateVpmemVolumes(ctx, formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -513,11 +603,15 @@ func (m *PVMInstanceReferenceV2) contextValidateConfiguration(ctx context.Contex } if err := m.Configuration.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("configuration") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("configuration") } + return err } } @@ -530,11 +624,15 @@ func (m *PVMInstanceReferenceV2) contextValidateCores(ctx context.Context, forma if m.Cores != nil { if err := m.Cores.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("cores") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("cores") } + return err } } @@ -549,11 +647,15 @@ func (m *PVMInstanceReferenceV2) contextValidateCrn(ctx context.Context, formats } if err := m.Crn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("crn") } + return err } @@ -565,11 +667,15 @@ func (m *PVMInstanceReferenceV2) contextValidateDeployment(ctx context.Context, if m.Deployment != nil { if err := m.Deployment.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("deployment") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("deployment") } + return err } } @@ -586,11 +692,15 @@ func (m *PVMInstanceReferenceV2) contextValidateHealth(ctx context.Context, form } if err := m.Health.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("health") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("health") } + return err } } @@ -607,11 +717,15 @@ func (m *PVMInstanceReferenceV2) contextValidateHost(ctx context.Context, format } if err := m.Host.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("host") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("host") } + return err } } @@ -624,11 +738,15 @@ func (m *PVMInstanceReferenceV2) contextValidateMemory(ctx context.Context, form if m.Memory != nil { if err := m.Memory.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("memory") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("memory") } + return err } } @@ -647,11 +765,15 @@ func (m *PVMInstanceReferenceV2) contextValidateNetworkPorts(ctx context.Context } if err := m.NetworkPorts[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("networkPorts" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("networkPorts" + "." + strconv.Itoa(i)) } + return err } } @@ -666,11 +788,15 @@ func (m *PVMInstanceReferenceV2) contextValidateOperatingSystem(ctx context.Cont if m.OperatingSystem != nil { if err := m.OperatingSystem.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("operatingSystem") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("operatingSystem") } + return err } } @@ -687,11 +813,15 @@ func (m *PVMInstanceReferenceV2) contextValidatePlacementGroup(ctx context.Conte } if err := m.PlacementGroup.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("placementGroup") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("placementGroup") } + return err } } @@ -708,11 +838,15 @@ func (m *PVMInstanceReferenceV2) contextValidateVirtualCores(ctx context.Context } if err := m.VirtualCores.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("virtualCores") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("virtualCores") } + return err } } @@ -729,11 +863,15 @@ func (m *PVMInstanceReferenceV2) contextValidateVirtualSerialNumber(ctx context. } if err := m.VirtualSerialNumber.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("virtualSerialNumber") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("virtualSerialNumber") } + return err } } @@ -741,6 +879,35 @@ func (m *PVMInstanceReferenceV2) contextValidateVirtualSerialNumber(ctx context. return nil } +func (m *PVMInstanceReferenceV2) contextValidateVpmemVolumes(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.VpmemVolumes); i++ { + + if m.VpmemVolumes[i] != nil { + + if swag.IsZero(m.VpmemVolumes[i]) { // not required + return nil + } + + if err := m.VpmemVolumes[i].ContextValidate(ctx, formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("vpmemVolumes" + "." + strconv.Itoa(i)) + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("vpmemVolumes" + "." + strconv.Itoa(i)) + } + + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *PVMInstanceReferenceV2) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_update.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_update.go index 56e06295da1..00331d7eb42 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_update.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_update.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -35,6 +36,9 @@ type PVMInstanceUpdate struct { // pin policy PinPolicy PinPolicy `json:"pinPolicy,omitempty"` + // Preferred processor compatibility mode + PreferredProcessorCompatibilityMode string `json:"preferredProcessorCompatibilityMode,omitempty"` + // Processor type (dedicated, shared, capped) // Enum: ["dedicated","shared","capped"] ProcType string `json:"procType,omitempty"` @@ -95,11 +99,15 @@ func (m *PVMInstanceUpdate) validateCloudInitialization(formats strfmt.Registry) if m.CloudInitialization != nil { if err := m.CloudInitialization.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("cloudInitialization") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("cloudInitialization") } + return err } } @@ -113,18 +121,22 @@ func (m *PVMInstanceUpdate) validatePinPolicy(formats strfmt.Registry) error { } if err := m.PinPolicy.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("pinPolicy") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("pinPolicy") } + return err } return nil } -var pVmInstanceUpdateTypeProcTypePropEnum []interface{} +var pVmInstanceUpdateTypeProcTypePropEnum []any func init() { var res []string @@ -176,11 +188,15 @@ func (m *PVMInstanceUpdate) validateSoftwareLicenses(formats strfmt.Registry) er if m.SoftwareLicenses != nil { if err := m.SoftwareLicenses.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("softwareLicenses") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("softwareLicenses") } + return err } } @@ -195,11 +211,15 @@ func (m *PVMInstanceUpdate) validateVirtualCores(formats strfmt.Registry) error if m.VirtualCores != nil { if err := m.VirtualCores.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("virtualCores") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("virtualCores") } + return err } } @@ -242,11 +262,15 @@ func (m *PVMInstanceUpdate) contextValidateCloudInitialization(ctx context.Conte } if err := m.CloudInitialization.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("cloudInitialization") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("cloudInitialization") } + return err } } @@ -261,11 +285,15 @@ func (m *PVMInstanceUpdate) contextValidatePinPolicy(ctx context.Context, format } if err := m.PinPolicy.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("pinPolicy") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("pinPolicy") } + return err } @@ -281,11 +309,15 @@ func (m *PVMInstanceUpdate) contextValidateSoftwareLicenses(ctx context.Context, } if err := m.SoftwareLicenses.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("softwareLicenses") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("softwareLicenses") } + return err } } @@ -302,11 +334,15 @@ func (m *PVMInstanceUpdate) contextValidateVirtualCores(ctx context.Context, for } if err := m.VirtualCores.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("virtualCores") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("virtualCores") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_update_response.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_update_response.go index 4a373de2479..bc139747672 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_update_response.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_update_response.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -29,6 +30,9 @@ type PVMInstanceUpdateResponse struct { // pin policy PinPolicy PinPolicy `json:"pinPolicy,omitempty"` + // Preferred processor compatibility mode + PreferredProcessorCompatibilityMode string `json:"preferredProcessorCompatibilityMode,omitempty"` + // Processor type (dedicated, shared, capped) // Enum: ["dedicated","shared","capped"] ProcType string `json:"procType,omitempty"` @@ -77,18 +81,22 @@ func (m *PVMInstanceUpdateResponse) validatePinPolicy(formats strfmt.Registry) e } if err := m.PinPolicy.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("pinPolicy") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("pinPolicy") } + return err } return nil } -var pVmInstanceUpdateResponseTypeProcTypePropEnum []interface{} +var pVmInstanceUpdateResponseTypeProcTypePropEnum []any func init() { var res []string @@ -140,11 +148,15 @@ func (m *PVMInstanceUpdateResponse) validateVirtualCores(formats strfmt.Registry if m.VirtualCores != nil { if err := m.VirtualCores.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("virtualCores") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("virtualCores") } + return err } } @@ -177,11 +189,15 @@ func (m *PVMInstanceUpdateResponse) contextValidatePinPolicy(ctx context.Context } if err := m.PinPolicy.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("pinPolicy") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("pinPolicy") } + return err } @@ -197,11 +213,15 @@ func (m *PVMInstanceUpdateResponse) contextValidateVirtualCores(ctx context.Cont } if err := m.VirtualCores.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("virtualCores") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("virtualCores") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_v2_network_port.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_v2_network_port.go index 840f0d507c8..4051e03b26d 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_v2_network_port.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instance_v2_network_port.go @@ -56,7 +56,7 @@ func (m *PVMInstanceV2NetworkPort) Validate(formats strfmt.Registry) error { return nil } -var pVmInstanceV2NetworkPortTypeIPProtocolPropEnum []interface{} +var pVmInstanceV2NetworkPortTypeIPProtocolPropEnum []any func init() { var res []string @@ -98,7 +98,7 @@ func (m *PVMInstanceV2NetworkPort) validateIPProtocol(formats strfmt.Registry) e return nil } -var pVmInstanceV2NetworkPortTypeTypePropEnum []interface{} +var pVmInstanceV2NetworkPortTypeTypePropEnum []any func init() { var res []string diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instances.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instances.go index 1d0f5513a73..abdc1eb6a3d 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instances.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instances.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -52,11 +53,15 @@ func (m *PVMInstances) validatePvmInstances(formats strfmt.Registry) error { if m.PvmInstances[i] != nil { if err := m.PvmInstances[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) } + return err } } @@ -91,11 +96,15 @@ func (m *PVMInstances) contextValidatePvmInstances(ctx context.Context, formats } if err := m.PvmInstances[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instances_v2.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instances_v2.go index 84e3e299583..fd9a3809fd1 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instances_v2.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/p_vm_instances_v2.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -52,11 +53,15 @@ func (m *PVMInstancesV2) validatePvmInstances(formats strfmt.Registry) error { if m.PvmInstances[i] != nil { if err := m.PvmInstances[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) } + return err } } @@ -91,11 +96,15 @@ func (m *PVMInstancesV2) contextValidatePvmInstances(ctx context.Context, format } if err := m.PvmInstances[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("pvmInstances" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/peer_interface.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/peer_interface.go new file mode 100644 index 00000000000..62ac7d09bde --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/peer_interface.go @@ -0,0 +1,180 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PeerInterface peer interface +// +// swagger:model PeerInterface +type PeerInterface struct { + + // device ID of the peer interface + // Example: switch1 + // Required: true + DeviceID *string `json:"deviceID"` + + // peer interface name + // Example: Peer121 + // Required: true + Name *string `json:"name"` + + // peer interface ID + // Example: 031ab7da-bca6-493f-ac55-1a2a26f19160 + // Required: true + PeerInterfaceID *string `json:"peerInterfaceID"` + + // type of peer interface + // Example: interface + // Required: true + // Enum: ["interface","lag"] + PeerType *string `json:"peerType"` + + // port ID of the peer interface + // Example: po10 + // Required: true + PortID *string `json:"portID"` +} + +// Validate validates this peer interface +func (m *PeerInterface) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDeviceID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePeerInterfaceID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePeerType(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePortID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PeerInterface) validateDeviceID(formats strfmt.Registry) error { + + if err := validate.Required("deviceID", "body", m.DeviceID); err != nil { + return err + } + + return nil +} + +func (m *PeerInterface) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *PeerInterface) validatePeerInterfaceID(formats strfmt.Registry) error { + + if err := validate.Required("peerInterfaceID", "body", m.PeerInterfaceID); err != nil { + return err + } + + return nil +} + +var peerInterfaceTypePeerTypePropEnum []any + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["interface","lag"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + peerInterfaceTypePeerTypePropEnum = append(peerInterfaceTypePeerTypePropEnum, v) + } +} + +const ( + + // PeerInterfacePeerTypeInterface captures enum value "interface" + PeerInterfacePeerTypeInterface string = "interface" + + // PeerInterfacePeerTypeLag captures enum value "lag" + PeerInterfacePeerTypeLag string = "lag" +) + +// prop value enum +func (m *PeerInterface) validatePeerTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, peerInterfaceTypePeerTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *PeerInterface) validatePeerType(formats strfmt.Registry) error { + + if err := validate.Required("peerType", "body", m.PeerType); err != nil { + return err + } + + // value enum + if err := m.validatePeerTypeEnum("peerType", "body", *m.PeerType); err != nil { + return err + } + + return nil +} + +func (m *PeerInterface) validatePortID(formats strfmt.Registry) error { + + if err := validate.Required("portID", "body", m.PortID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this peer interface based on context it is used +func (m *PeerInterface) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PeerInterface) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PeerInterface) UnmarshalBinary(b []byte) error { + var res PeerInterface + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/peer_interfaces.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/peer_interfaces.go new file mode 100644 index 00000000000..fe60ada66d2 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/peer_interfaces.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + stderrors "errors" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PeerInterfaces peer interfaces +// +// swagger:model PeerInterfaces +type PeerInterfaces []*PeerInterface + +// Validate validates this peer interfaces +func (m PeerInterfaces) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName(strconv.Itoa(i)) + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName(strconv.Itoa(i)) + } + + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this peer interfaces based on the context it is used +func (m PeerInterfaces) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName(strconv.Itoa(i)) + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName(strconv.Itoa(i)) + } + + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/pin_policy.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/pin_policy.go index 9a1f4e45267..79df5232512 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/pin_policy.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/pin_policy.go @@ -41,7 +41,7 @@ const ( ) // for schema -var pinPolicyEnum []interface{} +var pinPolicyEnum []any func init() { var res []PinPolicy diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_group.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_group.go index cf51a31d40f..0aad4e09c36 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_group.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_group.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -84,11 +85,15 @@ func (m *PlacementGroup) validateCrn(formats strfmt.Registry) error { } if err := m.Crn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("crn") } + return err } @@ -122,7 +127,7 @@ func (m *PlacementGroup) validateName(formats strfmt.Registry) error { return nil } -var placementGroupTypePolicyPropEnum []interface{} +var placementGroupTypePolicyPropEnum []any func init() { var res []string @@ -171,11 +176,15 @@ func (m *PlacementGroup) validateUserTags(formats strfmt.Registry) error { } if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } @@ -207,11 +216,15 @@ func (m *PlacementGroup) contextValidateCrn(ctx context.Context, formats strfmt. } if err := m.Crn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("crn") } + return err } @@ -221,11 +234,15 @@ func (m *PlacementGroup) contextValidateCrn(ctx context.Context, formats strfmt. func (m *PlacementGroup) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_group_create.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_group_create.go index d12ec8c0443..a7b4a0e77a9 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_group_create.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_group_create.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -64,7 +65,7 @@ func (m *PlacementGroupCreate) validateName(formats strfmt.Registry) error { return nil } -var placementGroupCreateTypePolicyPropEnum []interface{} +var placementGroupCreateTypePolicyPropEnum []any func init() { var res []string @@ -113,11 +114,15 @@ func (m *PlacementGroupCreate) validateUserTags(formats strfmt.Registry) error { } if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } @@ -141,11 +146,15 @@ func (m *PlacementGroupCreate) ContextValidate(ctx context.Context, formats strf func (m *PlacementGroupCreate) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_groups.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_groups.go index f0912c9b2e0..04118381729 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_groups.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/placement_groups.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -52,11 +53,15 @@ func (m *PlacementGroups) validatePlacementGroups(formats strfmt.Registry) error if m.PlacementGroups[i] != nil { if err := m.PlacementGroups[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("placementGroups" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("placementGroups" + "." + strconv.Itoa(i)) } + return err } } @@ -91,11 +96,15 @@ func (m *PlacementGroups) contextValidatePlacementGroups(ctx context.Context, fo } if err := m.PlacementGroups[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("placementGroups" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("placementGroups" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/plan.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/plan.go index c74c46fb941..bb5c7247bde 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/plan.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/plan.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -104,11 +105,15 @@ func (m *Plan) validateSchemas(formats strfmt.Registry) error { if m.Schemas != nil { if err := m.Schemas.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("schemas") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("schemas") } + return err } } @@ -139,11 +144,15 @@ func (m *Plan) contextValidateSchemas(ctx context.Context, formats strfmt.Regist } if err := m.Schemas.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("schemas") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("schemas") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/pod_capacity.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/pod_capacity.go index c0a4e2a32a1..82f39c81295 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/pod_capacity.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/pod_capacity.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -57,11 +58,15 @@ func (m *PodCapacity) validatePodData(formats strfmt.Registry) error { if m.PodData != nil { if err := m.PodData.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("PodData") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("PodData") } + return err } } @@ -76,11 +81,15 @@ func (m *PodCapacity) validateStorageControllers(formats strfmt.Registry) error if m.StorageControllers != nil { if err := m.StorageControllers.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("StorageControllers") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("StorageControllers") } + return err } } @@ -95,11 +104,15 @@ func (m *PodCapacity) validateSystemPools(formats strfmt.Registry) error { if m.SystemPools != nil { if err := m.SystemPools.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("SystemPools") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("SystemPools") } + return err } } @@ -138,11 +151,15 @@ func (m *PodCapacity) contextValidatePodData(ctx context.Context, formats strfmt } if err := m.PodData.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("PodData") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("PodData") } + return err } } @@ -157,11 +174,15 @@ func (m *PodCapacity) contextValidateStorageControllers(ctx context.Context, for } if err := m.StorageControllers.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("StorageControllers") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("StorageControllers") } + return err } @@ -175,11 +196,15 @@ func (m *PodCapacity) contextValidateSystemPools(ctx context.Context, formats st } if err := m.SystemPools.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("SystemPools") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("SystemPools") } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/power_edge_router_action.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/power_edge_router_action.go index 428c4ef4263..a22ea5abef8 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/power_edge_router_action.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/power_edge_router_action.go @@ -40,7 +40,7 @@ func (m *PowerEdgeRouterAction) Validate(formats strfmt.Registry) error { return nil } -var powerEdgeRouterActionTypeActionPropEnum []interface{} +var powerEdgeRouterActionTypeActionPropEnum []any func init() { var res []string diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/power_v_s_instance.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/power_v_s_instance.go index c8c86175075..15aeee62ba3 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/power_v_s_instance.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/power_v_s_instance.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -131,11 +132,15 @@ func (m *PowerVSInstance) validateCapabilities(formats strfmt.Registry) error { if m.Capabilities != nil { if err := m.Capabilities.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("capabilities") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("capabilities") } + return err } } @@ -241,11 +246,15 @@ func (m *PowerVSInstance) ContextValidate(ctx context.Context, formats strfmt.Re func (m *PowerVSInstance) contextValidateCapabilities(ctx context.Context, formats strfmt.Registry) error { if err := m.Capabilities.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("capabilities") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("capabilities") } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/power_v_s_instances.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/power_v_s_instances.go index e881a1cfc48..4d5e409db61 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/power_v_s_instances.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/power_v_s_instances.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -52,11 +53,15 @@ func (m *PowerVSInstances) validatePowerVsInstances(formats strfmt.Registry) err if m.PowerVsInstances[i] != nil { if err := m.PowerVsInstances[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("powerVsInstances" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("powerVsInstances" + "." + strconv.Itoa(i)) } + return err } } @@ -91,11 +96,15 @@ func (m *PowerVSInstances) contextValidatePowerVsInstances(ctx context.Context, } if err := m.PowerVsInstances[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("powerVsInstances" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("powerVsInstances" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/pvm_instance_deployment.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/pvm_instance_deployment.go index 24a38568929..1d60ff929fd 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/pvm_instance_deployment.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/pvm_instance_deployment.go @@ -49,7 +49,7 @@ func (m *PvmInstanceDeployment) Validate(formats strfmt.Registry) error { return nil } -var pvmInstanceDeploymentTypeProcessorModePropEnum []interface{} +var pvmInstanceDeploymentTypeProcessorModePropEnum []any func init() { var res []string diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/region_storage_tiers.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/region_storage_tiers.go index 3635ac973a8..a1abae8a609 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/region_storage_tiers.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/region_storage_tiers.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -30,11 +31,15 @@ func (m RegionStorageTiers) Validate(formats strfmt.Registry) error { if m[i] != nil { if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName(strconv.Itoa(i)) } + return err } } @@ -60,11 +65,15 @@ func (m RegionStorageTiers) ContextValidate(ctx context.Context, formats strfmt. } if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName(strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/region_storage_types.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/region_storage_types.go index 3498cc66c86..ef2a560ab89 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/region_storage_types.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/region_storage_types.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -30,11 +31,15 @@ func (m RegionStorageTypes) Validate(formats strfmt.Registry) error { if m[i] != nil { if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName(strconv.Itoa(i)) } + return err } } @@ -60,11 +65,15 @@ func (m RegionStorageTypes) ContextValidate(ctx context.Context, formats strfmt. } if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName(strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/replication_service.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/replication_service.go index c16beb90d00..2826cf4eb1f 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/replication_service.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/replication_service.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -69,11 +70,15 @@ func (m *ReplicationService) validateTargetLocations(formats strfmt.Registry) er if m.TargetLocations[i] != nil { if err := m.TargetLocations[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("targetLocations" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("targetLocations" + "." + strconv.Itoa(i)) } + return err } } @@ -108,11 +113,15 @@ func (m *ReplicationService) contextValidateTargetLocations(ctx context.Context, } if err := m.TargetLocations[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("targetLocations" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("targetLocations" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/replication_sites.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/replication_sites.go index c3b25fe875c..8d63d06a5ec 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/replication_sites.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/replication_sites.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -30,11 +31,15 @@ func (m ReplicationSites) Validate(formats strfmt.Registry) error { if m[i] != nil { if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName(strconv.Itoa(i)) } + return err } } @@ -60,11 +65,15 @@ func (m ReplicationSites) ContextValidate(ctx context.Context, formats strfmt.Re } if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName(strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/replication_target_location.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/replication_target_location.go index 453edf48810..689b638a9c7 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/replication_target_location.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/replication_target_location.go @@ -42,7 +42,7 @@ func (m *ReplicationTargetLocation) Validate(formats strfmt.Registry) error { return nil } -var replicationTargetLocationTypeStatusPropEnum []interface{} +var replicationTargetLocationTypeStatusPropEnum []any func init() { var res []string diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/resource_access.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/resource_access.go index b1130aa017f..e8acb373463 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/resource_access.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/resource_access.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -29,11 +30,15 @@ func (m ResourceAccess) Validate(formats strfmt.Registry) error { } if val, ok := m[k]; ok { if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName(k) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName(k) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/route.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/route.go index 2d2b107d45d..7c9db9b2530 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/route.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/route.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -128,7 +129,7 @@ func (m *Route) Validate(formats strfmt.Registry) error { return nil } -var routeTypeActionPropEnum []interface{} +var routeTypeActionPropEnum []any func init() { var res []string @@ -168,7 +169,7 @@ func (m *Route) validateAction(formats strfmt.Registry) error { return nil } -var routeTypeAdvertisePropEnum []interface{} +var routeTypeAdvertisePropEnum []any func init() { var res []string @@ -229,7 +230,7 @@ func (m *Route) validateDestination(formats strfmt.Registry) error { return nil } -var routeTypeDestinationTypePropEnum []interface{} +var routeTypeDestinationTypePropEnum []any func init() { var res []string @@ -304,7 +305,7 @@ func (m *Route) validateNextHop(formats strfmt.Registry) error { return nil } -var routeTypeNextHopTypePropEnum []interface{} +var routeTypeNextHopTypePropEnum []any func init() { var res []string @@ -344,7 +345,7 @@ func (m *Route) validateNextHopType(formats strfmt.Registry) error { return nil } -var routeTypeStatePropEnum []interface{} +var routeTypeStatePropEnum []any func init() { var res []string @@ -396,11 +397,15 @@ func (m *Route) validateUserTags(formats strfmt.Registry) error { } if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } @@ -424,11 +429,15 @@ func (m *Route) ContextValidate(ctx context.Context, formats strfmt.Registry) er func (m *Route) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/route_create.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/route_create.go index 6513fe33831..95804a94ecd 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/route_create.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/route_create.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -99,7 +100,7 @@ func (m *RouteCreate) Validate(formats strfmt.Registry) error { return nil } -var routeCreateTypeActionPropEnum []interface{} +var routeCreateTypeActionPropEnum []any func init() { var res []string @@ -138,7 +139,7 @@ func (m *RouteCreate) validateAction(formats strfmt.Registry) error { return nil } -var routeCreateTypeAdvertisePropEnum []interface{} +var routeCreateTypeAdvertisePropEnum []any func init() { var res []string @@ -189,7 +190,7 @@ func (m *RouteCreate) validateDestination(formats strfmt.Registry) error { return nil } -var routeCreateTypeDestinationTypePropEnum []interface{} +var routeCreateTypeDestinationTypePropEnum []any func init() { var res []string @@ -254,7 +255,7 @@ func (m *RouteCreate) validateNextHop(formats strfmt.Registry) error { return nil } -var routeCreateTypeNextHopTypePropEnum []interface{} +var routeCreateTypeNextHopTypePropEnum []any func init() { var res []string @@ -299,11 +300,15 @@ func (m *RouteCreate) validateUserTags(formats strfmt.Registry) error { } if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } @@ -327,11 +332,15 @@ func (m *RouteCreate) ContextValidate(ctx context.Context, formats strfmt.Regist func (m *RouteCreate) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/route_filter.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/route_filter.go new file mode 100644 index 00000000000..c96ecb6020d --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/route_filter.go @@ -0,0 +1,367 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// RouteFilter route filter +// +// swagger:model RouteFilter +type RouteFilter struct { + + // The minimum matching length of the prefix-set(1 ≤ value ≤ 32 value ≤ GE) + // Example: 25 + // Maximum: 32 + // Minimum: 1 + GE *int64 `json:"GE,omitempty"` + + // The maximum matching length of the prefix-set( 1 ≤ value ≤ 32 value >= GE) + // Example: 30 + // Maximum: 32 + // Minimum: 1 + LE *int64 `json:"LE,omitempty"` + + // action of the filter + // * allow: allow + // * deny: deny + // + // Required: true + // Enum: ["allow","deny"] + Action *string `json:"action"` + + // time stamp for create route filter + // Required: true + CreationDate *string `json:"creationDate"` + + // direction of the filter + // * import - import the routes + // * export - export the routes + // + // Required: true + // Enum: ["import","export"] + Direction *string `json:"direction"` + + // error description + // Required: true + Error *string `json:"error"` + + // priority or order of the filter + // Example: 10 + // Required: true + Index *int64 `json:"index"` + + // IP prefix representing an address and mask length of the prefix-set + // Example: 192.168.91.0/24 + // Required: true + Prefix *string `json:"prefix"` + + // route filter ID + // Example: 031ab7da-bca6-493f-ac55-1a2a26f19160 + // Required: true + RouteFilterID *string `json:"routeFilterID"` + + // status of the route filter + // Example: active + // Required: true + // Enum: ["active","configuring","removing","error","updating"] + State *string `json:"state"` +} + +// Validate validates this route filter +func (m *RouteFilter) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateGE(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLE(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAction(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreationDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDirection(formats); err != nil { + res = append(res, err) + } + + if err := m.validateError(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIndex(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrefix(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRouteFilterID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateState(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RouteFilter) validateGE(formats strfmt.Registry) error { + if swag.IsZero(m.GE) { // not required + return nil + } + + if err := validate.MinimumInt("GE", "body", *m.GE, 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("GE", "body", *m.GE, 32, false); err != nil { + return err + } + + return nil +} + +func (m *RouteFilter) validateLE(formats strfmt.Registry) error { + if swag.IsZero(m.LE) { // not required + return nil + } + + if err := validate.MinimumInt("LE", "body", *m.LE, 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("LE", "body", *m.LE, 32, false); err != nil { + return err + } + + return nil +} + +var routeFilterTypeActionPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["allow","deny"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + routeFilterTypeActionPropEnum = append(routeFilterTypeActionPropEnum, v) + } +} + +const ( + + // RouteFilterActionAllow captures enum value "allow" + RouteFilterActionAllow string = "allow" + + // RouteFilterActionDeny captures enum value "deny" + RouteFilterActionDeny string = "deny" +) + +// prop value enum +func (m *RouteFilter) validateActionEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, routeFilterTypeActionPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *RouteFilter) validateAction(formats strfmt.Registry) error { + + if err := validate.Required("action", "body", m.Action); err != nil { + return err + } + + // value enum + if err := m.validateActionEnum("action", "body", *m.Action); err != nil { + return err + } + + return nil +} + +func (m *RouteFilter) validateCreationDate(formats strfmt.Registry) error { + + if err := validate.Required("creationDate", "body", m.CreationDate); err != nil { + return err + } + + return nil +} + +var routeFilterTypeDirectionPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["import","export"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + routeFilterTypeDirectionPropEnum = append(routeFilterTypeDirectionPropEnum, v) + } +} + +const ( + + // RouteFilterDirectionImport captures enum value "import" + RouteFilterDirectionImport string = "import" + + // RouteFilterDirectionExport captures enum value "export" + RouteFilterDirectionExport string = "export" +) + +// prop value enum +func (m *RouteFilter) validateDirectionEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, routeFilterTypeDirectionPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *RouteFilter) validateDirection(formats strfmt.Registry) error { + + if err := validate.Required("direction", "body", m.Direction); err != nil { + return err + } + + // value enum + if err := m.validateDirectionEnum("direction", "body", *m.Direction); err != nil { + return err + } + + return nil +} + +func (m *RouteFilter) validateError(formats strfmt.Registry) error { + + if err := validate.Required("error", "body", m.Error); err != nil { + return err + } + + return nil +} + +func (m *RouteFilter) validateIndex(formats strfmt.Registry) error { + + if err := validate.Required("index", "body", m.Index); err != nil { + return err + } + + return nil +} + +func (m *RouteFilter) validatePrefix(formats strfmt.Registry) error { + + if err := validate.Required("prefix", "body", m.Prefix); err != nil { + return err + } + + return nil +} + +func (m *RouteFilter) validateRouteFilterID(formats strfmt.Registry) error { + + if err := validate.Required("routeFilterID", "body", m.RouteFilterID); err != nil { + return err + } + + return nil +} + +var routeFilterTypeStatePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["active","configuring","removing","error","updating"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + routeFilterTypeStatePropEnum = append(routeFilterTypeStatePropEnum, v) + } +} + +const ( + + // RouteFilterStateActive captures enum value "active" + RouteFilterStateActive string = "active" + + // RouteFilterStateConfiguring captures enum value "configuring" + RouteFilterStateConfiguring string = "configuring" + + // RouteFilterStateRemoving captures enum value "removing" + RouteFilterStateRemoving string = "removing" + + // RouteFilterStateError captures enum value "error" + RouteFilterStateError string = "error" + + // RouteFilterStateUpdating captures enum value "updating" + RouteFilterStateUpdating string = "updating" +) + +// prop value enum +func (m *RouteFilter) validateStateEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, routeFilterTypeStatePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *RouteFilter) validateState(formats strfmt.Registry) error { + + if err := validate.Required("state", "body", m.State); err != nil { + return err + } + + // value enum + if err := m.validateStateEnum("state", "body", *m.State); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this route filter based on context it is used +func (m *RouteFilter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *RouteFilter) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RouteFilter) UnmarshalBinary(b []byte) error { + var res RouteFilter + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/route_filter_create.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/route_filter_create.go new file mode 100644 index 00000000000..6c7aea4fa74 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/route_filter_create.go @@ -0,0 +1,261 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// RouteFilterCreate route filter create +// +// swagger:model RouteFilterCreate +type RouteFilterCreate struct { + + // The minimum matching length of the prefix-set(1 ≤ value ≤ 32 & value ≤ LE) + // Example: 25 + // Maximum: 32 + // Minimum: 1 + GE int64 `json:"GE,omitempty"` + + // The maximum matching length of the prefix-set( 1 ≤ value ≤ 32 & value >= GE) + // Example: 30 + // Maximum: 32 + // Minimum: 1 + LE int64 `json:"LE,omitempty"` + + // action of the filter + // * allow: allow + // * deny: deny + // + // Enum: ["allow","deny"] + Action *string `json:"action,omitempty"` + + // direction of the filter + // * import - import the routes + // * export - export the routes + // + // Required: true + // Enum: ["import","export"] + Direction *string `json:"direction"` + + // priority or order of the filter + // Example: 10 + // Required: true + // Maximum: 1e+07 + // Minimum: 1 + Index *int64 `json:"index"` + + // IP prefix representing an address and mask length of the prefix-set + // Example: 192.168.91.0/24 + // Required: true + Prefix *string `json:"prefix"` +} + +// Validate validates this route filter create +func (m *RouteFilterCreate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateGE(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLE(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAction(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDirection(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIndex(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrefix(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RouteFilterCreate) validateGE(formats strfmt.Registry) error { + if swag.IsZero(m.GE) { // not required + return nil + } + + if err := validate.MinimumInt("GE", "body", m.GE, 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("GE", "body", m.GE, 32, false); err != nil { + return err + } + + return nil +} + +func (m *RouteFilterCreate) validateLE(formats strfmt.Registry) error { + if swag.IsZero(m.LE) { // not required + return nil + } + + if err := validate.MinimumInt("LE", "body", m.LE, 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("LE", "body", m.LE, 32, false); err != nil { + return err + } + + return nil +} + +var routeFilterCreateTypeActionPropEnum []any + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["allow","deny"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + routeFilterCreateTypeActionPropEnum = append(routeFilterCreateTypeActionPropEnum, v) + } +} + +const ( + + // RouteFilterCreateActionAllow captures enum value "allow" + RouteFilterCreateActionAllow string = "allow" + + // RouteFilterCreateActionDeny captures enum value "deny" + RouteFilterCreateActionDeny string = "deny" +) + +// prop value enum +func (m *RouteFilterCreate) validateActionEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, routeFilterCreateTypeActionPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *RouteFilterCreate) validateAction(formats strfmt.Registry) error { + if swag.IsZero(m.Action) { // not required + return nil + } + + // value enum + if err := m.validateActionEnum("action", "body", *m.Action); err != nil { + return err + } + + return nil +} + +var routeFilterCreateTypeDirectionPropEnum []any + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["import","export"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + routeFilterCreateTypeDirectionPropEnum = append(routeFilterCreateTypeDirectionPropEnum, v) + } +} + +const ( + + // RouteFilterCreateDirectionImport captures enum value "import" + RouteFilterCreateDirectionImport string = "import" + + // RouteFilterCreateDirectionExport captures enum value "export" + RouteFilterCreateDirectionExport string = "export" +) + +// prop value enum +func (m *RouteFilterCreate) validateDirectionEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, routeFilterCreateTypeDirectionPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *RouteFilterCreate) validateDirection(formats strfmt.Registry) error { + + if err := validate.Required("direction", "body", m.Direction); err != nil { + return err + } + + // value enum + if err := m.validateDirectionEnum("direction", "body", *m.Direction); err != nil { + return err + } + + return nil +} + +func (m *RouteFilterCreate) validateIndex(formats strfmt.Registry) error { + + if err := validate.Required("index", "body", m.Index); err != nil { + return err + } + + if err := validate.MinimumInt("index", "body", *m.Index, 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("index", "body", *m.Index, 1e+07, false); err != nil { + return err + } + + return nil +} + +func (m *RouteFilterCreate) validatePrefix(formats strfmt.Registry) error { + + if err := validate.Required("prefix", "body", m.Prefix); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this route filter create based on context it is used +func (m *RouteFilterCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *RouteFilterCreate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RouteFilterCreate) UnmarshalBinary(b []byte) error { + var res RouteFilterCreate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/route_report.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/route_report.go index 7d21b2c3bea..0c706a93669 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/route_report.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/route_report.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -52,11 +53,15 @@ func (m *RouteReport) validateRoutes(formats strfmt.Registry) error { if m.Routes[i] != nil { if err := m.Routes[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("routes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("routes" + "." + strconv.Itoa(i)) } + return err } } @@ -91,11 +96,15 @@ func (m *RouteReport) contextValidateRoutes(ctx context.Context, formats strfmt. } if err := m.Routes[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("routes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("routes" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/route_report_route.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/route_report_route.go index 0f1f8709233..b0e772fa9c1 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/route_report_route.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/route_report_route.go @@ -57,7 +57,7 @@ func (m *RouteReportRoute) validateDestination(formats strfmt.Registry) error { return nil } -var routeReportRouteTypeTypePropEnum []interface{} +var routeReportRouteTypeTypePropEnum []any func init() { var res []string diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/routes.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/routes.go index 1f5cd277735..37f5f411dad 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/routes.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/routes.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -52,11 +53,15 @@ func (m *Routes) validateRoutes(formats strfmt.Registry) error { if m.Routes[i] != nil { if err := m.Routes[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("routes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("routes" + "." + strconv.Itoa(i)) } + return err } } @@ -91,11 +96,15 @@ func (m *Routes) contextValidateRoutes(ctx context.Context, formats strfmt.Regis } if err := m.Routes[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("routes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("routes" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_a_p_create.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_a_p_create.go index 1659a9292ef..3d5caa1e855 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_a_p_create.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_a_p_create.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -50,6 +51,9 @@ type SAPCreate struct { // The placement group for the server PlacementGroup string `json:"placementGroup,omitempty"` + // Preferred processor compatibility mode + PreferredProcessorCompatibilityMode string `json:"preferredProcessorCompatibilityMode,omitempty"` + // SAP Profile ID for the amount of cores and memory // Required: true // Pattern: ^[\s]*[A-Za-z][A-Za-z0-9\-]{3,}$ @@ -73,7 +77,7 @@ type SAPCreate struct { // Storage type for server deployment; if storageType is not provided the storage type will default to 'tier3'. StorageType string `json:"storageType,omitempty"` - // System type used to host the instance. Only e880, e980, e1080 are supported + // System type used to host the instance. Only e980, s1022, e1050, e1080, s1122, e1150, and e1180 are supported SysType string `json:"sysType,omitempty"` // Cloud init user defined data; For FLS, only cloud-config user-data is supported and data must not be compressed or exceed 63K @@ -84,6 +88,9 @@ type SAPCreate struct { // List of Volume IDs to attach to the pvm-instance on creation VolumeIDs []string `json:"volumeIDs"` + + // The vPMEM volumes information. Only one volume is supported at this time. + VpmemVolumes []*VPMemVolumeCreate `json:"vpmemVolumes"` } // Validate validates this s a p create @@ -126,6 +133,10 @@ func (m *SAPCreate) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateVpmemVolumes(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -139,11 +150,15 @@ func (m *SAPCreate) validateDeploymentTarget(formats strfmt.Registry) error { if m.DeploymentTarget != nil { if err := m.DeploymentTarget.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("deploymentTarget") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("deploymentTarget") } + return err } } @@ -167,11 +182,15 @@ func (m *SAPCreate) validateInstances(formats strfmt.Registry) error { if m.Instances != nil { if err := m.Instances.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("instances") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("instances") } + return err } } @@ -201,11 +220,15 @@ func (m *SAPCreate) validateNetworks(formats strfmt.Registry) error { if m.Networks[i] != nil { if err := m.Networks[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("networks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("networks" + "." + strconv.Itoa(i)) } + return err } } @@ -221,11 +244,15 @@ func (m *SAPCreate) validatePinPolicy(formats strfmt.Registry) error { } if err := m.PinPolicy.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("pinPolicy") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("pinPolicy") } + return err } @@ -252,11 +279,15 @@ func (m *SAPCreate) validateStorageAffinity(formats strfmt.Registry) error { if m.StorageAffinity != nil { if err := m.StorageAffinity.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("storageAffinity") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("storageAffinity") } + return err } } @@ -270,17 +301,51 @@ func (m *SAPCreate) validateUserTags(formats strfmt.Registry) error { } if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } return nil } +func (m *SAPCreate) validateVpmemVolumes(formats strfmt.Registry) error { + if swag.IsZero(m.VpmemVolumes) { // not required + return nil + } + + for i := 0; i < len(m.VpmemVolumes); i++ { + if swag.IsZero(m.VpmemVolumes[i]) { // not required + continue + } + + if m.VpmemVolumes[i] != nil { + if err := m.VpmemVolumes[i].Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("vpmemVolumes" + "." + strconv.Itoa(i)) + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("vpmemVolumes" + "." + strconv.Itoa(i)) + } + + return err + } + } + + } + + return nil +} + // ContextValidate validate this s a p create based on the context it is used func (m *SAPCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error @@ -309,6 +374,10 @@ func (m *SAPCreate) ContextValidate(ctx context.Context, formats strfmt.Registry res = append(res, err) } + if err := m.contextValidateVpmemVolumes(ctx, formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -324,11 +393,15 @@ func (m *SAPCreate) contextValidateDeploymentTarget(ctx context.Context, formats } if err := m.DeploymentTarget.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("deploymentTarget") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("deploymentTarget") } + return err } } @@ -345,11 +418,15 @@ func (m *SAPCreate) contextValidateInstances(ctx context.Context, formats strfmt } if err := m.Instances.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("instances") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("instances") } + return err } } @@ -368,11 +445,15 @@ func (m *SAPCreate) contextValidateNetworks(ctx context.Context, formats strfmt. } if err := m.Networks[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("networks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("networks" + "." + strconv.Itoa(i)) } + return err } } @@ -389,11 +470,15 @@ func (m *SAPCreate) contextValidatePinPolicy(ctx context.Context, formats strfmt } if err := m.PinPolicy.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("pinPolicy") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("pinPolicy") } + return err } @@ -409,11 +494,15 @@ func (m *SAPCreate) contextValidateStorageAffinity(ctx context.Context, formats } if err := m.StorageAffinity.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("storageAffinity") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("storageAffinity") } + return err } } @@ -424,17 +513,50 @@ func (m *SAPCreate) contextValidateStorageAffinity(ctx context.Context, formats func (m *SAPCreate) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } return nil } +func (m *SAPCreate) contextValidateVpmemVolumes(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.VpmemVolumes); i++ { + + if m.VpmemVolumes[i] != nil { + + if swag.IsZero(m.VpmemVolumes[i]) { // not required + return nil + } + + if err := m.VpmemVolumes[i].ContextValidate(ctx, formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("vpmemVolumes" + "." + strconv.Itoa(i)) + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("vpmemVolumes" + "." + strconv.Itoa(i)) + } + + return err + } + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *SAPCreate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_a_p_profile.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_a_p_profile.go index 0ae04109bd2..9cc93084f51 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_a_p_profile.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_a_p_profile.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -57,6 +58,9 @@ type SAPProfile struct { // Enum: ["balanced","compute","memory","ultra-memory","small","sap-rise","sap-rise-app"] Type *string `json:"type"` + // vpmem volume + VpmemVolume *SAPProfileVpmemVolume `json:"vpmemVolume,omitempty"` + // List of supported workload types WorkloadTypes []string `json:"workloadTypes"` } @@ -89,6 +93,10 @@ func (m *SAPProfile) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateVpmemVolume(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -131,7 +139,7 @@ func (m *SAPProfile) validateProfileID(formats strfmt.Registry) error { return nil } -var sAPProfileTypeSmtModePropEnum []interface{} +var sAPProfileTypeSmtModePropEnum []any func init() { var res []int64 @@ -164,7 +172,7 @@ func (m *SAPProfile) validateSmtMode(formats strfmt.Registry) error { return nil } -var sAPProfileTypeTypePropEnum []interface{} +var sAPProfileTypeTypePropEnum []any func init() { var res []string @@ -222,8 +230,65 @@ func (m *SAPProfile) validateType(formats strfmt.Registry) error { return nil } -// ContextValidate validates this s a p profile based on context it is used +func (m *SAPProfile) validateVpmemVolume(formats strfmt.Registry) error { + if swag.IsZero(m.VpmemVolume) { // not required + return nil + } + + if m.VpmemVolume != nil { + if err := m.VpmemVolume.Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("vpmemVolume") + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("vpmemVolume") + } + + return err + } + } + + return nil +} + +// ContextValidate validate this s a p profile based on the context it is used func (m *SAPProfile) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateVpmemVolume(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SAPProfile) contextValidateVpmemVolume(ctx context.Context, formats strfmt.Registry) error { + + if m.VpmemVolume != nil { + + if swag.IsZero(m.VpmemVolume) { // not required + return nil + } + + if err := m.VpmemVolume.ContextValidate(ctx, formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("vpmemVolume") + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("vpmemVolume") + } + + return err + } + } + return nil } @@ -244,3 +309,43 @@ func (m *SAPProfile) UnmarshalBinary(b []byte) error { *m = res return nil } + +// SAPProfileVpmemVolume vPMEM volume details for the profile +// +// swagger:model SAPProfileVpmemVolume +type SAPProfileVpmemVolume struct { + + // Maximum percent of memory to be assigned for carved out vPMEM volume + MaxPercent int64 `json:"maxPercent,omitempty"` + + // Minimum percent of memory to be assigned for carved out vPMEM volume + MinPercent int64 `json:"minPercent,omitempty"` +} + +// Validate validates this s a p profile vpmem volume +func (m *SAPProfileVpmemVolume) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this s a p profile vpmem volume based on context it is used +func (m *SAPProfileVpmemVolume) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *SAPProfileVpmemVolume) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SAPProfileVpmemVolume) UnmarshalBinary(b []byte) error { + var res SAPProfileVpmemVolume + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_a_p_profiles.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_a_p_profiles.go index f094b2b213b..33582e0163f 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_a_p_profiles.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_a_p_profiles.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -52,11 +53,15 @@ func (m *SAPProfiles) validateProfiles(formats strfmt.Registry) error { if m.Profiles[i] != nil { if err := m.Profiles[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("profiles" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("profiles" + "." + strconv.Itoa(i)) } + return err } } @@ -91,11 +96,15 @@ func (m *SAPProfiles) contextValidateProfiles(ctx context.Context, formats strfm } if err := m.Profiles[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("profiles" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("profiles" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_p_p_placement_group.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_p_p_placement_group.go index d85567fc33b..037b2a0acc1 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_p_p_placement_group.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_p_p_placement_group.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -77,11 +78,15 @@ func (m *SPPPlacementGroup) validateCrn(formats strfmt.Registry) error { } if err := m.Crn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("crn") } + return err } @@ -121,11 +126,15 @@ func (m *SPPPlacementGroup) validateUserTags(formats strfmt.Registry) error { } if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } @@ -157,11 +166,15 @@ func (m *SPPPlacementGroup) contextValidateCrn(ctx context.Context, formats strf } if err := m.Crn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("crn") } + return err } @@ -171,11 +184,15 @@ func (m *SPPPlacementGroup) contextValidateCrn(ctx context.Context, formats strf func (m *SPPPlacementGroup) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_p_p_placement_group_create.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_p_p_placement_group_create.go index a69cbbb19dd..4817fa8e52a 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_p_p_placement_group_create.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_p_p_placement_group_create.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -79,7 +80,7 @@ func (m *SPPPlacementGroupCreate) validateName(formats strfmt.Registry) error { return nil } -var sPPPlacementGroupCreateTypePolicyPropEnum []interface{} +var sPPPlacementGroupCreateTypePolicyPropEnum []any func init() { var res []string @@ -128,11 +129,15 @@ func (m *SPPPlacementGroupCreate) validateUserTags(formats strfmt.Registry) erro } if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } @@ -156,11 +161,15 @@ func (m *SPPPlacementGroupCreate) ContextValidate(ctx context.Context, formats s func (m *SPPPlacementGroupCreate) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_p_p_placement_groups.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_p_p_placement_groups.go index 82d9be42da3..023c0d951dd 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_p_p_placement_groups.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/s_p_p_placement_groups.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -49,11 +50,15 @@ func (m *SPPPlacementGroups) validateSppPlacementGroups(formats strfmt.Registry) if m.SppPlacementGroups[i] != nil { if err := m.SppPlacementGroups[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("sppPlacementGroups" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("sppPlacementGroups" + "." + strconv.Itoa(i)) } + return err } } @@ -88,11 +93,15 @@ func (m *SPPPlacementGroups) contextValidateSppPlacementGroups(ctx context.Conte } if err := m.SppPlacementGroups[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("sppPlacementGroups" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("sppPlacementGroups" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/schemas_object.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/schemas_object.go index f4ba396b35d..c5c45188afc 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/schemas_object.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/schemas_object.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -50,11 +51,15 @@ func (m *SchemasObject) validateServiceBinding(formats strfmt.Registry) error { if m.ServiceBinding != nil { if err := m.ServiceBinding.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("service_binding") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("service_binding") } + return err } } @@ -69,11 +74,15 @@ func (m *SchemasObject) validateServiceInstance(formats strfmt.Registry) error { if m.ServiceInstance != nil { if err := m.ServiceInstance.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("service_instance") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("service_instance") } + return err } } @@ -108,11 +117,15 @@ func (m *SchemasObject) contextValidateServiceBinding(ctx context.Context, forma } if err := m.ServiceBinding.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("service_binding") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("service_binding") } + return err } } @@ -129,11 +142,15 @@ func (m *SchemasObject) contextValidateServiceInstance(ctx context.Context, form } if err := m.ServiceInstance.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("service_instance") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("service_instance") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/service.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/service.go index 3e2344dff66..ffef46bde7f 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/service.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/service.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -123,11 +124,15 @@ func (m *Service) validateDashboardClient(formats strfmt.Registry) error { if m.DashboardClient != nil { if err := m.DashboardClient.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("dashboard_client") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("dashboard_client") } + return err } } @@ -175,11 +180,15 @@ func (m *Service) validatePlans(formats strfmt.Registry) error { if m.Plans[i] != nil { if err := m.Plans[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("plans" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("plans" + "." + strconv.Itoa(i)) } + return err } } @@ -189,7 +198,7 @@ func (m *Service) validatePlans(formats strfmt.Registry) error { return nil } -var serviceRequiresItemsEnum []interface{} +var serviceRequiresItemsEnum []any func init() { var res []string @@ -252,11 +261,15 @@ func (m *Service) contextValidateDashboardClient(ctx context.Context, formats st } if err := m.DashboardClient.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("dashboard_client") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("dashboard_client") } + return err } } @@ -275,11 +288,15 @@ func (m *Service) contextValidatePlans(ctx context.Context, formats strfmt.Regis } if err := m.Plans[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("plans" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("plans" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_authentication_info.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_authentication_info.go index 475324bc279..02d92850ef3 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_authentication_info.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_authentication_info.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -68,11 +69,15 @@ func (m *ServiceAuthenticationInfo) validateCapabilities(formats strfmt.Registry if m.Capabilities != nil { if err := m.Capabilities.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("capabilities") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("capabilities") } + return err } } @@ -106,11 +111,15 @@ func (m *ServiceAuthenticationInfo) validateToken(formats strfmt.Registry) error if m.Token != nil { if err := m.Token.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("token") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("token") } + return err } } @@ -143,11 +152,15 @@ func (m *ServiceAuthenticationInfo) contextValidateCapabilities(ctx context.Cont } if err := m.Capabilities.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("capabilities") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("capabilities") } + return err } @@ -159,11 +172,15 @@ func (m *ServiceAuthenticationInfo) contextValidateToken(ctx context.Context, fo if m.Token != nil { if err := m.Token.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("token") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("token") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding.go index fbbc7f645d5..558369e83f8 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -58,11 +59,15 @@ func (m *ServiceBinding) validateVolumeMounts(formats strfmt.Registry) error { if m.VolumeMounts[i] != nil { if err := m.VolumeMounts[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("volume_mounts" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("volume_mounts" + "." + strconv.Itoa(i)) } + return err } } @@ -97,11 +102,15 @@ func (m *ServiceBinding) contextValidateVolumeMounts(ctx context.Context, format } if err := m.VolumeMounts[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("volume_mounts" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("volume_mounts" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_request.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_request.go index 8c304bb1bac..be37c8ceba1 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_request.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_request.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -69,11 +70,15 @@ func (m *ServiceBindingRequest) validateBindResource(formats strfmt.Registry) er if m.BindResource != nil { if err := m.BindResource.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("bind_resource") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("bind_resource") } + return err } } @@ -122,11 +127,15 @@ func (m *ServiceBindingRequest) contextValidateBindResource(ctx context.Context, } if err := m.BindResource.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("bind_resource") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("bind_resource") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_resource.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_resource.go index dfe72c66509..eb7135fafda 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_resource.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_resource.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -61,11 +62,15 @@ func (m *ServiceBindingResource) validateVolumeMounts(formats strfmt.Registry) e if m.VolumeMounts[i] != nil { if err := m.VolumeMounts[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("volume_mounts" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("volume_mounts" + "." + strconv.Itoa(i)) } + return err } } @@ -100,11 +105,15 @@ func (m *ServiceBindingResource) contextValidateVolumeMounts(ctx context.Context } if err := m.VolumeMounts[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("volume_mounts" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("volume_mounts" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_schema_object.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_schema_object.go index 92f2865c8d9..fb20ec2d080 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_schema_object.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_schema_object.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -43,11 +44,15 @@ func (m *ServiceBindingSchemaObject) validateCreate(formats strfmt.Registry) err if m.Create != nil { if err := m.Create.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("create") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("create") } + return err } } @@ -78,11 +83,15 @@ func (m *ServiceBindingSchemaObject) contextValidateCreate(ctx context.Context, } if err := m.Create.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("create") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("create") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_volume_mount.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_volume_mount.go index e95edd18a07..839ef77c090 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_volume_mount.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_binding_volume_mount.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -90,11 +91,15 @@ func (m *ServiceBindingVolumeMount) validateDevice(formats strfmt.Registry) erro if m.Device != nil { if err := m.Device.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("device") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("device") } + return err } } @@ -102,7 +107,7 @@ func (m *ServiceBindingVolumeMount) validateDevice(formats strfmt.Registry) erro return nil } -var serviceBindingVolumeMountTypeDeviceTypePropEnum []interface{} +var serviceBindingVolumeMountTypeDeviceTypePropEnum []any func init() { var res []string @@ -151,7 +156,7 @@ func (m *ServiceBindingVolumeMount) validateDriver(formats strfmt.Registry) erro return nil } -var serviceBindingVolumeMountTypeModePropEnum []interface{} +var serviceBindingVolumeMountTypeModePropEnum []any func init() { var res []string @@ -213,11 +218,15 @@ func (m *ServiceBindingVolumeMount) contextValidateDevice(ctx context.Context, f if m.Device != nil { if err := m.Device.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("device") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("device") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_async_operation.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_async_operation.go index 5658b00cf4e..4ff2a8a3b13 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_async_operation.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_async_operation.go @@ -21,7 +21,7 @@ type ServiceInstanceAsyncOperation struct { DashboardURL string `json:"dashboard_url,omitempty"` // extensions - Extensions interface{} `json:"extensions,omitempty"` + Extensions any `json:"extensions,omitempty"` // operation Operation string `json:"operation,omitempty"` diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_schema_object.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_schema_object.go index 76b3fc13552..b7c72a13c1b 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_schema_object.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_schema_object.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -50,11 +51,15 @@ func (m *ServiceInstanceSchemaObject) validateCreate(formats strfmt.Registry) er if m.Create != nil { if err := m.Create.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("create") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("create") } + return err } } @@ -69,11 +74,15 @@ func (m *ServiceInstanceSchemaObject) validateUpdate(formats strfmt.Registry) er if m.Update != nil { if err := m.Update.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("update") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("update") } + return err } } @@ -108,11 +117,15 @@ func (m *ServiceInstanceSchemaObject) contextValidateCreate(ctx context.Context, } if err := m.Create.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("create") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("create") } + return err } } @@ -129,11 +142,15 @@ func (m *ServiceInstanceSchemaObject) contextValidateUpdate(ctx context.Context, } if err := m.Update.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("update") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("update") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_update.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_update.go index eeac73f2086..6f25f2f36cb 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_update.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_update.go @@ -21,7 +21,7 @@ type ServiceInstanceUpdate struct { DashboardURL string `json:"dashboard_url,omitempty"` // extensions - Extensions interface{} `json:"extensions,omitempty"` + Extensions any `json:"extensions,omitempty"` } // Validate validates this service instance update diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_update_request.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_update_request.go index 506864ca69b..6ee07abeb99 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_update_request.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/service_instance_update_request.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -61,11 +62,15 @@ func (m *ServiceInstanceUpdateRequest) validatePreviousValues(formats strfmt.Reg if m.PreviousValues != nil { if err := m.PreviousValues.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("previous_values") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("previous_values") } + return err } } @@ -105,11 +110,15 @@ func (m *ServiceInstanceUpdateRequest) contextValidatePreviousValues(ctx context } if err := m.PreviousValues.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("previous_values") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("previous_values") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/shared_processor_pool.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/shared_processor_pool.go index 263b357a863..0d6eff13965 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/shared_processor_pool.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/shared_processor_pool.go @@ -28,6 +28,10 @@ type SharedProcessorPool struct { // Required: true AvailableCores *float64 `json:"availableCores"` + // The creation time of the Shared Processor Pool + // Format: date-time + CreationDate *strfmt.DateTime `json:"creationDate,omitempty"` + // crn Crn CRN `json:"crn,omitempty"` @@ -77,6 +81,10 @@ func (m *SharedProcessorPool) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateCreationDate(formats); err != nil { + res = append(res, err) + } + if err := m.validateCrn(formats); err != nil { res = append(res, err) } @@ -125,6 +133,18 @@ func (m *SharedProcessorPool) validateAvailableCores(formats strfmt.Registry) er return nil } +func (m *SharedProcessorPool) validateCreationDate(formats strfmt.Registry) error { + if swag.IsZero(m.CreationDate) { // not required + return nil + } + + if err := validate.FormatOf("creationDate", "body", "date-time", m.CreationDate.String(), formats); err != nil { + return err + } + + return nil +} + func (m *SharedProcessorPool) validateCrn(formats strfmt.Registry) error { if swag.IsZero(m.Crn) { // not required return nil diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/shared_processor_pool_create.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/shared_processor_pool_create.go index 95eaf671b47..3873c63556a 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/shared_processor_pool_create.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/shared_processor_pool_create.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -100,11 +101,15 @@ func (m *SharedProcessorPoolCreate) validateUserTags(formats strfmt.Registry) er } if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } @@ -128,11 +133,15 @@ func (m *SharedProcessorPoolCreate) ContextValidate(ctx context.Context, formats func (m *SharedProcessorPoolCreate) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/shared_processor_pool_detail.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/shared_processor_pool_detail.go index b58e967dfba..1cb8ac633ae 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/shared_processor_pool_detail.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/shared_processor_pool_detail.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -60,11 +61,15 @@ func (m *SharedProcessorPoolDetail) validateServers(formats strfmt.Registry) err if m.Servers[i] != nil { if err := m.Servers[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("servers" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("servers" + "." + strconv.Itoa(i)) } + return err } } @@ -82,11 +87,15 @@ func (m *SharedProcessorPoolDetail) validateSharedProcessorPool(formats strfmt.R if m.SharedProcessorPool != nil { if err := m.SharedProcessorPool.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("sharedProcessorPool") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("sharedProcessorPool") } + return err } } @@ -123,11 +132,15 @@ func (m *SharedProcessorPoolDetail) contextValidateServers(ctx context.Context, } if err := m.Servers[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("servers" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("servers" + "." + strconv.Itoa(i)) } + return err } } @@ -142,11 +155,15 @@ func (m *SharedProcessorPoolDetail) contextValidateSharedProcessorPool(ctx conte if m.SharedProcessorPool != nil { if err := m.SharedProcessorPool.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("sharedProcessorPool") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("sharedProcessorPool") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/shared_processor_pools.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/shared_processor_pools.go index b48639706e0..4dd97074273 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/shared_processor_pools.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/shared_processor_pools.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -49,11 +50,15 @@ func (m *SharedProcessorPools) validateSharedProcessorPools(formats strfmt.Regis if m.SharedProcessorPools[i] != nil { if err := m.SharedProcessorPools[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("sharedProcessorPools" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("sharedProcessorPools" + "." + strconv.Itoa(i)) } + return err } } @@ -88,11 +93,15 @@ func (m *SharedProcessorPools) contextValidateSharedProcessorPools(ctx context.C } if err := m.SharedProcessorPools[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("sharedProcessorPools" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("sharedProcessorPools" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/site.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/site.go index 2a9caa29e63..39afd5daae4 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/site.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/site.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -55,11 +56,15 @@ func (m *Site) validateReplicationPoolMap(formats strfmt.Registry) error { if m.ReplicationPoolMap[i] != nil { if err := m.ReplicationPoolMap[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("ReplicationPoolMap" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("ReplicationPoolMap" + "." + strconv.Itoa(i)) } + return err } } @@ -94,11 +99,15 @@ func (m *Site) contextValidateReplicationPoolMap(ctx context.Context, formats st } if err := m.ReplicationPoolMap[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("ReplicationPoolMap" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("ReplicationPoolMap" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot.go index 59a91324b7d..cfa55531fa6 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -29,7 +30,7 @@ type Snapshot struct { // crn Crn CRN `json:"crn,omitempty"` - // Description of the PVM instance snapshot + // Description of the PVM instance snapshot with a maximum of 255 characters allowed. Description string `json:"description,omitempty"` // Last Update Date @@ -118,11 +119,15 @@ func (m *Snapshot) validateCrn(formats strfmt.Registry) error { } if err := m.Crn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("crn") } + return err } @@ -198,11 +203,15 @@ func (m *Snapshot) contextValidateCrn(ctx context.Context, formats strfmt.Regist } if err := m.Crn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("crn") } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot_create.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot_create.go index dbd12da8c99..b34c868e3df 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot_create.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot_create.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -20,6 +21,7 @@ import ( type SnapshotCreate struct { // Description of the PVM instance snapshot + // Max Length: 255 Description string `json:"description,omitempty"` // Name of the PVM instance snapshot to create @@ -39,6 +41,10 @@ type SnapshotCreate struct { func (m *SnapshotCreate) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + if err := m.validateName(formats); err != nil { res = append(res, err) } @@ -53,6 +59,18 @@ func (m *SnapshotCreate) Validate(formats strfmt.Registry) error { return nil } +func (m *SnapshotCreate) validateDescription(formats strfmt.Registry) error { + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", m.Description, 255); err != nil { + return err + } + + return nil +} + func (m *SnapshotCreate) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { @@ -76,11 +94,15 @@ func (m *SnapshotCreate) validateUserTags(formats strfmt.Registry) error { } if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } @@ -104,11 +126,15 @@ func (m *SnapshotCreate) ContextValidate(ctx context.Context, formats strfmt.Reg func (m *SnapshotCreate) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot_create_response.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot_create_response.go index eda2822b3d4..e0a04d6a9ac 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot_create_response.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot_create_response.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -58,11 +59,15 @@ func (m *SnapshotCreateResponse) validateCrn(formats strfmt.Registry) error { } if err := m.Crn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("crn") } + return err } @@ -84,11 +89,15 @@ func (m *SnapshotCreateResponse) validateUserTags(formats strfmt.Registry) error } if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } @@ -120,11 +129,15 @@ func (m *SnapshotCreateResponse) contextValidateCrn(ctx context.Context, formats } if err := m.Crn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("crn") } + return err } @@ -134,11 +147,15 @@ func (m *SnapshotCreateResponse) contextValidateCrn(ctx context.Context, formats func (m *SnapshotCreateResponse) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot_list.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot_list.go index ee6a7d7b976..c0069e95eaf 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot_list.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot_list.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -52,11 +53,15 @@ func (m *SnapshotList) validateSnapshots(formats strfmt.Registry) error { if m.Snapshots[i] != nil { if err := m.Snapshots[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("snapshots" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("snapshots" + "." + strconv.Itoa(i)) } + return err } } @@ -91,11 +96,15 @@ func (m *SnapshotList) contextValidateSnapshots(ctx context.Context, formats str } if err := m.Snapshots[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("snapshots" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("snapshots" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot_update.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot_update.go index e924ad1160f..1ade1de4f4b 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot_update.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot_update.go @@ -19,19 +19,24 @@ import ( // swagger:model SnapshotUpdate type SnapshotUpdate struct { - // Description of the PVM instance snapshot - Description string `json:"description,omitempty"` + // Description of the PVM instance snapshot with a maximum of 255 characters allowed. + // Max Length: 255 + Description *string `json:"description,omitempty"` // Name of the PVM instance snapshot // Max Length: 120 // Pattern: ^[a-zA-Z0-9_.-]+$ - Name string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` } // Validate validates this snapshot update func (m *SnapshotUpdate) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + if err := m.validateName(formats); err != nil { res = append(res, err) } @@ -42,16 +47,28 @@ func (m *SnapshotUpdate) Validate(formats strfmt.Registry) error { return nil } +func (m *SnapshotUpdate) validateDescription(formats strfmt.Registry) error { + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", *m.Description, 255); err != nil { + return err + } + + return nil +} + func (m *SnapshotUpdate) validateName(formats strfmt.Registry) error { if swag.IsZero(m.Name) { // not required return nil } - if err := validate.MaxLength("name", "body", m.Name, 120); err != nil { + if err := validate.MaxLength("name", "body", *m.Name, 120); err != nil { return err } - if err := validate.Pattern("name", "body", m.Name, `^[a-zA-Z0-9_.-]+$`); err != nil { + if err := validate.Pattern("name", "body", *m.Name, `^[a-zA-Z0-9_.-]+$`); err != nil { return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot_v1.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot_v1.go index 570c3a4fa93..fb5f0de6531 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot_v1.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshot_v1.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -111,11 +112,15 @@ func (m *SnapshotV1) validateCrn(formats strfmt.Registry) error { } if err := m.Crn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("crn") } + return err } @@ -200,11 +205,15 @@ func (m *SnapshotV1) contextValidateCrn(ctx context.Context, formats strfmt.Regi } if err := m.Crn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("crn") } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshots.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshots.go index 46928ccef80..331409f9a2b 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshots.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/snapshots.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -52,11 +53,15 @@ func (m *Snapshots) validateSnapshots(formats strfmt.Registry) error { if m.Snapshots[i] != nil { if err := m.Snapshots[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("snapshots" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("snapshots" + "." + strconv.Itoa(i)) } + return err } } @@ -91,11 +96,15 @@ func (m *Snapshots) contextValidateSnapshots(ctx context.Context, formats strfmt } if err := m.Snapshots[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("snapshots" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("snapshots" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/software_tier.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/software_tier.go index 3f471c59c81..b0229a89d5a 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/software_tier.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/software_tier.go @@ -44,7 +44,7 @@ const ( ) // for schema -var softwareTierEnum []interface{} +var softwareTierEnum []any func init() { var res []SoftwareTier diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/ssh_keys.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/ssh_keys.go index 786d1ce5d85..a7e58bdf9d0 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/ssh_keys.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/ssh_keys.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -52,11 +53,15 @@ func (m *SSHKeys) validateSSHKeys(formats strfmt.Registry) error { if m.SSHKeys[i] != nil { if err := m.SSHKeys[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("sshKeys" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("sshKeys" + "." + strconv.Itoa(i)) } + return err } } @@ -91,11 +96,15 @@ func (m *SSHKeys) contextValidateSSHKeys(ctx context.Context, formats strfmt.Reg } if err := m.SSHKeys[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("sshKeys" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("sshKeys" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/status_description.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/status_description.go index 5f913ccd206..7119b134c52 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/status_description.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/status_description.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -49,11 +50,15 @@ func (m *StatusDescription) validateErrors(formats strfmt.Registry) error { if m.Errors[i] != nil { if err := m.Errors[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("errors" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("errors" + "." + strconv.Itoa(i)) } + return err } } @@ -88,11 +93,15 @@ func (m *StatusDescription) contextValidateErrors(ctx context.Context, formats s } if err := m.Errors[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("errors" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("errors" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/stock_images.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/stock_images.go index cf5ab313de6..9777ed262f0 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/stock_images.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/stock_images.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -30,11 +31,15 @@ func (m StockImages) Validate(formats strfmt.Registry) error { if m[i] != nil { if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName(strconv.Itoa(i)) } + return err } } @@ -60,11 +65,15 @@ func (m StockImages) ContextValidate(ctx context.Context, formats strfmt.Registr } if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName(strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_affinity.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_affinity.go index 49ea8ed6c10..d307dadd45d 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_affinity.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_affinity.go @@ -51,7 +51,7 @@ func (m *StorageAffinity) Validate(formats strfmt.Registry) error { return nil } -var storageAffinityTypeAffinityPolicyPropEnum []interface{} +var storageAffinityTypeAffinityPolicyPropEnum []any func init() { var res []string diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_controller.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_controller.go index 3c967f44265..6efa720a389 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_controller.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_controller.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -119,11 +120,15 @@ func (m *StorageController) validatePools(formats strfmt.Registry) error { } if val, ok := m.Pools[k]; ok { if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("pools" + "." + k) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("pools" + "." + k) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_controllers.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_controllers.go index 05d88631876..b6a637fba62 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_controllers.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_controllers.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -29,11 +30,15 @@ func (m StorageControllers) Validate(formats strfmt.Registry) error { } if val, ok := m[k]; ok { if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName(k) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName(k) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_pool.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_pool.go index 3f70d6a3985..e94dc02f418 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_pool.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_pool.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -113,11 +114,15 @@ func (m *StoragePool) validateOverrideThresholds(formats strfmt.Registry) error if m.OverrideThresholds != nil { if err := m.OverrideThresholds.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("overrideThresholds") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("overrideThresholds") } + return err } } @@ -125,7 +130,7 @@ func (m *StoragePool) validateOverrideThresholds(formats strfmt.Registry) error return nil } -var storagePoolTypeStatePropEnum []interface{} +var storagePoolTypeStatePropEnum []any func init() { var res []string @@ -200,11 +205,15 @@ func (m *StoragePool) contextValidateOverrideThresholds(ctx context.Context, for } if err := m.OverrideThresholds.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("overrideThresholds") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("overrideThresholds") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_pools.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_pools.go index fc5b533e410..20d40d82473 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_pools.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_pools.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -30,11 +31,15 @@ func (m StoragePools) Validate(formats strfmt.Registry) error { if m[i] != nil { if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName(strconv.Itoa(i)) } + return err } } @@ -60,11 +65,15 @@ func (m StoragePools) ContextValidate(ctx context.Context, formats strfmt.Regist } if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName(strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_pools_capacity.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_pools_capacity.go index 7f5e3aafbc0..958e5611b06 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_pools_capacity.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_pools_capacity.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -51,11 +52,15 @@ func (m *StoragePoolsCapacity) validateMaximumStorageAllocation(formats strfmt.R if m.MaximumStorageAllocation != nil { if err := m.MaximumStorageAllocation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("maximumStorageAllocation") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("maximumStorageAllocation") } + return err } } @@ -75,11 +80,15 @@ func (m *StoragePoolsCapacity) validateStoragePoolsCapacity(formats strfmt.Regis if m.StoragePoolsCapacity[i] != nil { if err := m.StoragePoolsCapacity[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("storagePoolsCapacity" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("storagePoolsCapacity" + "." + strconv.Itoa(i)) } + return err } } @@ -116,11 +125,15 @@ func (m *StoragePoolsCapacity) contextValidateMaximumStorageAllocation(ctx conte } if err := m.MaximumStorageAllocation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("maximumStorageAllocation") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("maximumStorageAllocation") } + return err } } @@ -139,11 +152,15 @@ func (m *StoragePoolsCapacity) contextValidateStoragePoolsCapacity(ctx context.C } if err := m.StoragePoolsCapacity[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("storagePoolsCapacity" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("storagePoolsCapacity" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_tier.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_tier.go index 16531848ae5..bb090d3ccb0 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_tier.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_tier.go @@ -45,7 +45,7 @@ func (m *StorageTier) Validate(formats strfmt.Registry) error { return nil } -var storageTierTypeStatePropEnum []interface{} +var storageTierTypeStatePropEnum []any func init() { var res []string diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_type.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_type.go index 79b41647c18..525cb744fd2 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_type.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_type.go @@ -48,7 +48,7 @@ func (m *StorageType) Validate(formats strfmt.Registry) error { return nil } -var storageTypeTypeStatePropEnum []interface{} +var storageTypeTypeStatePropEnum []any func init() { var res []string diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_type_capacity.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_type_capacity.go index 30fd85e2c1b..14dd2fcb2e6 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_type_capacity.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_type_capacity.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -54,11 +55,15 @@ func (m *StorageTypeCapacity) validateMaximumStorageAllocation(formats strfmt.Re if m.MaximumStorageAllocation != nil { if err := m.MaximumStorageAllocation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("maximumStorageAllocation") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("maximumStorageAllocation") } + return err } } @@ -78,11 +83,15 @@ func (m *StorageTypeCapacity) validateStoragePoolsCapacity(formats strfmt.Regist if m.StoragePoolsCapacity[i] != nil { if err := m.StoragePoolsCapacity[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("storagePoolsCapacity" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("storagePoolsCapacity" + "." + strconv.Itoa(i)) } + return err } } @@ -119,11 +128,15 @@ func (m *StorageTypeCapacity) contextValidateMaximumStorageAllocation(ctx contex } if err := m.MaximumStorageAllocation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("maximumStorageAllocation") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("maximumStorageAllocation") } + return err } } @@ -142,11 +155,15 @@ func (m *StorageTypeCapacity) contextValidateStoragePoolsCapacity(ctx context.Co } if err := m.StoragePoolsCapacity[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("storagePoolsCapacity" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("storagePoolsCapacity" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_types.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_types.go index d00c9cd4e4e..7ee6a5e7eec 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_types.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_types.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -29,11 +30,15 @@ func (m StorageTypes) Validate(formats strfmt.Registry) error { } if err := m[k].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName(k) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName(k) } + return err } @@ -52,11 +57,15 @@ func (m StorageTypes) ContextValidate(ctx context.Context, formats strfmt.Regist for k := range m { if err := m[k].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName(k) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName(k) } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_types_capacity.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_types_capacity.go index a0fee64b520..f47a8604c99 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_types_capacity.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/storage_types_capacity.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -51,11 +52,15 @@ func (m *StorageTypesCapacity) validateMaximumStorageAllocation(formats strfmt.R if m.MaximumStorageAllocation != nil { if err := m.MaximumStorageAllocation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("maximumStorageAllocation") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("maximumStorageAllocation") } + return err } } @@ -75,11 +80,15 @@ func (m *StorageTypesCapacity) validateStorageTypesCapacity(formats strfmt.Regis if m.StorageTypesCapacity[i] != nil { if err := m.StorageTypesCapacity[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("storageTypesCapacity" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("storageTypesCapacity" + "." + strconv.Itoa(i)) } + return err } } @@ -116,11 +125,15 @@ func (m *StorageTypesCapacity) contextValidateMaximumStorageAllocation(ctx conte } if err := m.MaximumStorageAllocation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("maximumStorageAllocation") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("maximumStorageAllocation") } + return err } } @@ -139,11 +152,15 @@ func (m *StorageTypesCapacity) contextValidateStorageTypesCapacity(ctx context.C } if err := m.StorageTypesCapacity[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("storageTypesCapacity" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("storageTypesCapacity" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/supported_software_tier.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/supported_software_tier.go index dce5eedf973..2ec4f4924e8 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/supported_software_tier.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/supported_software_tier.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -45,11 +46,15 @@ func (m *SupportedSoftwareTier) validateTier(formats strfmt.Registry) error { } if err := m.Tier.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("tier") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("tier") } + return err } @@ -77,11 +82,15 @@ func (m *SupportedSoftwareTier) contextValidateTier(ctx context.Context, formats } if err := m.Tier.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("tier") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("tier") } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/supported_software_tier_list.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/supported_software_tier_list.go index de22fd67ebf..d96b756b28d 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/supported_software_tier_list.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/supported_software_tier_list.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -30,11 +31,15 @@ func (m SupportedSoftwareTierList) Validate(formats strfmt.Registry) error { if m[i] != nil { if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName(strconv.Itoa(i)) } + return err } } @@ -60,11 +65,15 @@ func (m SupportedSoftwareTierList) ContextValidate(ctx context.Context, formats } if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName(strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/system_pool.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/system_pool.go index 42d0c350692..f024228e80d 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/system_pool.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/system_pool.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -88,11 +89,15 @@ func (m *SystemPool) validateCapacity(formats strfmt.Registry) error { if m.Capacity != nil { if err := m.Capacity.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("capacity") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("capacity") } + return err } } @@ -107,11 +112,15 @@ func (m *SystemPool) validateMaxAvailable(formats strfmt.Registry) error { if m.MaxAvailable != nil { if err := m.MaxAvailable.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("maxAvailable") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("maxAvailable") } + return err } } @@ -126,11 +135,15 @@ func (m *SystemPool) validateMaxCoresAvailable(formats strfmt.Registry) error { if m.MaxCoresAvailable != nil { if err := m.MaxCoresAvailable.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("maxCoresAvailable") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("maxCoresAvailable") } + return err } } @@ -145,11 +158,15 @@ func (m *SystemPool) validateMaxMemoryAvailable(formats strfmt.Registry) error { if m.MaxMemoryAvailable != nil { if err := m.MaxMemoryAvailable.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("maxMemoryAvailable") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("maxMemoryAvailable") } + return err } } @@ -164,11 +181,15 @@ func (m *SystemPool) validateSharedCoreRatio(formats strfmt.Registry) error { if m.SharedCoreRatio != nil { if err := m.SharedCoreRatio.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("sharedCoreRatio") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("sharedCoreRatio") } + return err } } @@ -188,11 +209,15 @@ func (m *SystemPool) validateSystems(formats strfmt.Registry) error { if m.Systems[i] != nil { if err := m.Systems[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("systems" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("systems" + "." + strconv.Itoa(i)) } + return err } } @@ -245,11 +270,15 @@ func (m *SystemPool) contextValidateCapacity(ctx context.Context, formats strfmt } if err := m.Capacity.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("capacity") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("capacity") } + return err } } @@ -266,11 +295,15 @@ func (m *SystemPool) contextValidateMaxAvailable(ctx context.Context, formats st } if err := m.MaxAvailable.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("maxAvailable") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("maxAvailable") } + return err } } @@ -287,11 +320,15 @@ func (m *SystemPool) contextValidateMaxCoresAvailable(ctx context.Context, forma } if err := m.MaxCoresAvailable.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("maxCoresAvailable") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("maxCoresAvailable") } + return err } } @@ -308,11 +345,15 @@ func (m *SystemPool) contextValidateMaxMemoryAvailable(ctx context.Context, form } if err := m.MaxMemoryAvailable.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("maxMemoryAvailable") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("maxMemoryAvailable") } + return err } } @@ -329,11 +370,15 @@ func (m *SystemPool) contextValidateSharedCoreRatio(ctx context.Context, formats } if err := m.SharedCoreRatio.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("sharedCoreRatio") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("sharedCoreRatio") } + return err } } @@ -352,11 +397,15 @@ func (m *SystemPool) contextValidateSystems(ctx context.Context, formats strfmt. } if err := m.Systems[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("systems" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("systems" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/system_pool_capacity.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/system_pool_capacity.go index 592b1b0b9c3..916fafac1b6 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/system_pool_capacity.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/system_pool_capacity.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -116,11 +117,15 @@ func (m *SystemPoolCapacity) validateSystems(formats strfmt.Registry) error { if m.Systems[i] != nil { if err := m.Systems[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("systems" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("systems" + "." + strconv.Itoa(i)) } + return err } } @@ -191,11 +196,15 @@ func (m *SystemPoolCapacity) contextValidateSystems(ctx context.Context, formats } if err := m.Systems[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("systems" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("systems" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/system_pools.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/system_pools.go index afae9a2f15a..bd926c8bbfa 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/system_pools.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/system_pools.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -29,11 +30,15 @@ func (m SystemPools) Validate(formats strfmt.Registry) error { } if val, ok := m[k]; ok { if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName(k) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName(k) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/system_pools_capacity.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/system_pools_capacity.go index b2c015c2dda..bab3a924d42 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/system_pools_capacity.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/system_pools_capacity.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -29,11 +30,15 @@ func (m SystemPoolsCapacity) Validate(formats strfmt.Registry) error { } if val, ok := m[k]; ok { if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName(k) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName(k) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/tenant.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/tenant.go index fc0c7ca6729..16b338cea00 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/tenant.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/tenant.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -94,11 +95,15 @@ func (m *Tenant) validateCloudInstances(formats strfmt.Registry) error { if m.CloudInstances[i] != nil { if err := m.CloudInstances[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("cloudInstances" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("cloudInstances" + "." + strconv.Itoa(i)) } + return err } } @@ -142,11 +147,15 @@ func (m *Tenant) validatePeeringNetworks(formats strfmt.Registry) error { if m.PeeringNetworks[i] != nil { if err := m.PeeringNetworks[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("peeringNetworks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("peeringNetworks" + "." + strconv.Itoa(i)) } + return err } } @@ -168,11 +177,15 @@ func (m *Tenant) validateSSHKeys(formats strfmt.Registry) error { if m.SSHKeys[i] != nil { if err := m.SSHKeys[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("sshKeys" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("sshKeys" + "." + strconv.Itoa(i)) } + return err } } @@ -224,11 +237,15 @@ func (m *Tenant) contextValidateCloudInstances(ctx context.Context, formats strf } if err := m.CloudInstances[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("cloudInstances" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("cloudInstances" + "." + strconv.Itoa(i)) } + return err } } @@ -249,11 +266,15 @@ func (m *Tenant) contextValidatePeeringNetworks(ctx context.Context, formats str } if err := m.PeeringNetworks[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("peeringNetworks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("peeringNetworks" + "." + strconv.Itoa(i)) } + return err } } @@ -274,11 +295,15 @@ func (m *Tenant) contextValidateSSHKeys(ctx context.Context, formats strfmt.Regi } if err := m.SSHKeys[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("sshKeys" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("sshKeys" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/tenant_update.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/tenant_update.go index b45551007fa..e2122365c82 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/tenant_update.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/tenant_update.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -52,11 +53,15 @@ func (m *TenantUpdate) validatePeeringNetworks(formats strfmt.Registry) error { if m.PeeringNetworks[i] != nil { if err := m.PeeringNetworks[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("peeringNetworks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("peeringNetworks" + "." + strconv.Itoa(i)) } + return err } } @@ -91,11 +96,15 @@ func (m *TenantUpdate) contextValidatePeeringNetworks(ctx context.Context, forma } if err := m.PeeringNetworks[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("peeringNetworks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("peeringNetworks" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/thresholds.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/thresholds.go index 575e3830441..809e23f787a 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/thresholds.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/thresholds.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -71,11 +72,15 @@ func (m *Thresholds) validateCapacity(formats strfmt.Registry) error { if m.Capacity != nil { if err := m.Capacity.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("capacity") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("capacity") } + return err } } @@ -90,11 +95,15 @@ func (m *Thresholds) validateOvercommit(formats strfmt.Registry) error { if m.Overcommit != nil { if err := m.Overcommit.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("overcommit") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("overcommit") } + return err } } @@ -109,11 +118,15 @@ func (m *Thresholds) validatePhysicalCapacity(formats strfmt.Registry) error { if m.PhysicalCapacity != nil { if err := m.PhysicalCapacity.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("physicalCapacity") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("physicalCapacity") } + return err } } @@ -128,11 +141,15 @@ func (m *Thresholds) validateVdiskCapacity(formats strfmt.Registry) error { if m.VdiskCapacity != nil { if err := m.VdiskCapacity.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("vdiskCapacity") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("vdiskCapacity") } + return err } } @@ -147,11 +164,15 @@ func (m *Thresholds) validateVdiskLimit(formats strfmt.Registry) error { if m.VdiskLimit != nil { if err := m.VdiskLimit.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("vdiskLimit") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("vdiskLimit") } + return err } } @@ -198,11 +219,15 @@ func (m *Thresholds) contextValidateCapacity(ctx context.Context, formats strfmt } if err := m.Capacity.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("capacity") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("capacity") } + return err } } @@ -219,11 +244,15 @@ func (m *Thresholds) contextValidateOvercommit(ctx context.Context, formats strf } if err := m.Overcommit.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("overcommit") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("overcommit") } + return err } } @@ -240,11 +269,15 @@ func (m *Thresholds) contextValidatePhysicalCapacity(ctx context.Context, format } if err := m.PhysicalCapacity.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("physicalCapacity") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("physicalCapacity") } + return err } } @@ -261,11 +294,15 @@ func (m *Thresholds) contextValidateVdiskCapacity(ctx context.Context, formats s } if err := m.VdiskCapacity.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("vdiskCapacity") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("vdiskCapacity") } + return err } } @@ -282,11 +319,15 @@ func (m *Thresholds) contextValidateVdiskLimit(ctx context.Context, formats strf } if err := m.VdiskLimit.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("vdiskLimit") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("vdiskLimit") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/token_extra.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/token_extra.go index c3687773d2f..960754930be 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/token_extra.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/token_extra.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -93,11 +94,15 @@ func (m *TokenExtra) validateToken(formats strfmt.Registry) error { if m.Token != nil { if err := m.Token.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("token") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("token") } + return err } } @@ -133,11 +138,15 @@ func (m *TokenExtra) contextValidateToken(ctx context.Context, formats strfmt.Re if m.Token != nil { if err := m.Token.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("token") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("token") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/token_request.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/token_request.go index a6801a13f82..dc1b7e948bf 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/token_request.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/token_request.go @@ -57,7 +57,7 @@ func (m *TokenRequest) validateRefreshToken(formats strfmt.Registry) error { return nil } -var tokenRequestTypeSourcePropEnum []interface{} +var tokenRequestTypeSourcePropEnum []any func init() { var res []string diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/transit_connection_error_item.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/transit_connection_error_item.go index 4e9138eeff2..cbb14d68224 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/transit_connection_error_item.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/transit_connection_error_item.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -78,11 +79,15 @@ func (m *TransitConnectionErrorItem) validateTarget(formats strfmt.Registry) err if m.Target != nil { if err := m.Target.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("target") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("target") } + return err } } @@ -113,11 +118,15 @@ func (m *TransitConnectionErrorItem) contextValidateTarget(ctx context.Context, } if err := m.Target.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("target") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("target") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/transit_gateway_instance.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/transit_gateway_instance.go index 9a4db4c8154..6c3f6432d8d 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/transit_gateway_instance.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/transit_gateway_instance.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -72,11 +73,15 @@ func (m *TransitGatewayInstance) validateErrors(formats strfmt.Registry) error { if m.Errors[i] != nil { if err := m.Errors[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("errors" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("errors" + "." + strconv.Itoa(i)) } + return err } } @@ -111,11 +116,15 @@ func (m *TransitGatewayInstance) contextValidateErrors(ctx context.Context, form } if err := m.Errors[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("errors" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("errors" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/transit_gateway_location.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/transit_gateway_location.go index 766183b66ed..c5e7fff6787 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/transit_gateway_location.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/transit_gateway_location.go @@ -68,7 +68,7 @@ func (m *TransitGatewayLocation) validateLocation(formats strfmt.Registry) error return nil } -var transitGatewayLocationTypeLocationTypePropEnum []interface{} +var transitGatewayLocationTypeLocationTypePropEnum []any func init() { var res []string diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/transit_gateway_locations.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/transit_gateway_locations.go index b1e4cccbbbe..a49d9fead55 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/transit_gateway_locations.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/transit_gateway_locations.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -52,11 +53,15 @@ func (m *TransitGatewayLocations) validateTransitGatewayLocations(formats strfmt if m.TransitGatewayLocations[i] != nil { if err := m.TransitGatewayLocations[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("transitGatewayLocations" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("transitGatewayLocations" + "." + strconv.Itoa(i)) } + return err } } @@ -91,11 +96,15 @@ func (m *TransitGatewayLocations) contextValidateTransitGatewayLocations(ctx con } if err := m.TransitGatewayLocations[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("transitGatewayLocations" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("transitGatewayLocations" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/update_server_virtual_serial_number.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/update_server_virtual_serial_number.go index c1dbba537e9..7faf869f89a 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/update_server_virtual_serial_number.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/update_server_virtual_serial_number.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -45,11 +46,15 @@ func (m *UpdateServerVirtualSerialNumber) validateSoftwareTier(formats strfmt.Re } if err := m.SoftwareTier.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("softwareTier") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("softwareTier") } + return err } @@ -77,11 +82,15 @@ func (m *UpdateServerVirtualSerialNumber) contextValidateSoftwareTier(ctx contex } if err := m.SoftwareTier.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("softwareTier") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("softwareTier") } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/update_storage_pool.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/update_storage_pool.go index cdb59e49ee5..2a32de2fc4d 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/update_storage_pool.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/update_storage_pool.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -59,11 +60,15 @@ func (m *UpdateStoragePool) validateOverrideThresholds(formats strfmt.Registry) if m.OverrideThresholds != nil { if err := m.OverrideThresholds.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("overrideThresholds") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("overrideThresholds") } + return err } } @@ -71,7 +76,7 @@ func (m *UpdateStoragePool) validateOverrideThresholds(formats strfmt.Registry) return nil } -var updateStoragePoolTypeStatePropEnum []interface{} +var updateStoragePoolTypeStatePropEnum []any func init() { var res []string @@ -136,11 +141,15 @@ func (m *UpdateStoragePool) contextValidateOverrideThresholds(ctx context.Contex } if err := m.OverrideThresholds.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("overrideThresholds") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("overrideThresholds") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/update_workspace_ssh_key.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/update_workspace_ssh_key.go index d923a9a09e7..b1386d89459 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/update_workspace_ssh_key.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/update_workspace_ssh_key.go @@ -70,7 +70,7 @@ func (m *UpdateWorkspaceSSHKey) validateName(formats strfmt.Registry) error { return nil } -var updateWorkspaceSshKeyTypeVisibilityPropEnum []interface{} +var updateWorkspaceSshKeyTypeVisibilityPropEnum []any func init() { var res []string diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/user_authentication_info.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/user_authentication_info.go index 83e1f944b24..1e2d88df939 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/user_authentication_info.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/user_authentication_info.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -106,11 +107,15 @@ func (m *UserAuthenticationInfo) validateCapabilities(formats strfmt.Registry) e if m.Capabilities != nil { if err := m.Capabilities.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("capabilities") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("capabilities") } + return err } } @@ -125,11 +130,15 @@ func (m *UserAuthenticationInfo) validateCrnAccess(formats strfmt.Registry) erro if m.CrnAccess != nil { if err := m.CrnAccess.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("crnAccess") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("crnAccess") } + return err } } @@ -172,11 +181,15 @@ func (m *UserAuthenticationInfo) validateToken(formats strfmt.Registry) error { if m.Token != nil { if err := m.Token.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("token") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("token") } + return err } } @@ -213,11 +226,15 @@ func (m *UserAuthenticationInfo) contextValidateCapabilities(ctx context.Context } if err := m.Capabilities.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("capabilities") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("capabilities") } + return err } @@ -231,11 +248,15 @@ func (m *UserAuthenticationInfo) contextValidateCrnAccess(ctx context.Context, f } if err := m.CrnAccess.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("crnAccess") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("crnAccess") } + return err } @@ -247,11 +268,15 @@ func (m *UserAuthenticationInfo) contextValidateToken(ctx context.Context, forma if m.Token != nil { if err := m.Token.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("token") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("token") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_mem_volume_attach.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_mem_volume_attach.go new file mode 100644 index 00000000000..d1e5110e507 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_mem_volume_attach.go @@ -0,0 +1,183 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + stderrors "errors" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// VPMemVolumeAttach v p mem volume attach +// +// swagger:model VPMemVolumeAttach +type VPMemVolumeAttach struct { + + // user tags + UserTags Tags `json:"userTags,omitempty"` + + // Description of volumes to create + // Required: true + VpmemVolumes []*VPMemVolumeCreate `json:"vpmemVolumes"` +} + +// Validate validates this v p mem volume attach +func (m *VPMemVolumeAttach) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateUserTags(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVpmemVolumes(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VPMemVolumeAttach) validateUserTags(formats strfmt.Registry) error { + if swag.IsZero(m.UserTags) { // not required + return nil + } + + if err := m.UserTags.Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("userTags") + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("userTags") + } + + return err + } + + return nil +} + +func (m *VPMemVolumeAttach) validateVpmemVolumes(formats strfmt.Registry) error { + + if err := validate.Required("vpmemVolumes", "body", m.VpmemVolumes); err != nil { + return err + } + + for i := 0; i < len(m.VpmemVolumes); i++ { + if swag.IsZero(m.VpmemVolumes[i]) { // not required + continue + } + + if m.VpmemVolumes[i] != nil { + if err := m.VpmemVolumes[i].Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("vpmemVolumes" + "." + strconv.Itoa(i)) + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("vpmemVolumes" + "." + strconv.Itoa(i)) + } + + return err + } + } + + } + + return nil +} + +// ContextValidate validate this v p mem volume attach based on the context it is used +func (m *VPMemVolumeAttach) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateUserTags(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateVpmemVolumes(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VPMemVolumeAttach) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { + + if err := m.UserTags.ContextValidate(ctx, formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("userTags") + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("userTags") + } + + return err + } + + return nil +} + +func (m *VPMemVolumeAttach) contextValidateVpmemVolumes(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.VpmemVolumes); i++ { + + if m.VpmemVolumes[i] != nil { + + if swag.IsZero(m.VpmemVolumes[i]) { // not required + return nil + } + + if err := m.VpmemVolumes[i].ContextValidate(ctx, formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("vpmemVolumes" + "." + strconv.Itoa(i)) + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("vpmemVolumes" + "." + strconv.Itoa(i)) + } + + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VPMemVolumeAttach) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VPMemVolumeAttach) UnmarshalBinary(b []byte) error { + var res VPMemVolumeAttach + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_mem_volume_create.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_mem_volume_create.go new file mode 100644 index 00000000000..44bd7466f61 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_mem_volume_create.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// VPMemVolumeCreate v p mem volume create +// +// swagger:model VPMemVolumeCreate +type VPMemVolumeCreate struct { + + // Volume base name + // Required: true + // Max Length: 20 + // Min Length: 1 + // Pattern: ^[a-zA-Z0-9][a-zA-Z0-9-_]*$ + Name *string `json:"name"` + + // Volume size (GB) + // Required: true + // Minimum: 1 + Size *int64 `json:"size"` +} + +// Validate validates this v p mem volume create +func (m *VPMemVolumeCreate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSize(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VPMemVolumeCreate) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MinLength("name", "body", *m.Name, 1); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", *m.Name, 20); err != nil { + return err + } + + if err := validate.Pattern("name", "body", *m.Name, `^[a-zA-Z0-9][a-zA-Z0-9-_]*$`); err != nil { + return err + } + + return nil +} + +func (m *VPMemVolumeCreate) validateSize(formats strfmt.Registry) error { + + if err := validate.Required("size", "body", m.Size); err != nil { + return err + } + + if err := validate.MinimumInt("size", "body", *m.Size, 1, false); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this v p mem volume create based on context it is used +func (m *VPMemVolumeCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *VPMemVolumeCreate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VPMemVolumeCreate) UnmarshalBinary(b []byte) error { + var res VPMemVolumeCreate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_mem_volume_reference.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_mem_volume_reference.go new file mode 100644 index 00000000000..5d40afa9968 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_mem_volume_reference.go @@ -0,0 +1,264 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + stderrors "errors" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// VPMemVolumeReference v p mem volume reference +// +// swagger:model VPMemVolumeReference +type VPMemVolumeReference struct { + + // The date and time when the volume was created + // Required: true + // Format: date-time + CreationDate *strfmt.DateTime `json:"creationDate"` + + // crn + Crn CRN `json:"crn,omitempty"` + + // Error code for the vPMEM volume + ErrorCode string `json:"errorCode,omitempty"` + + // Link to vPMEM volume resource + // Required: true + Href *string `json:"href"` + + // Volume Name + // Required: true + Name *string `json:"name"` + + // PVM Instance ID which the volume is attached to + // Required: true + PvmInstanceID *string `json:"pvmInstanceID"` + + // Reason for error + Reason string `json:"reason,omitempty"` + + // Volume Size (GB) + // Required: true + Size *float64 `json:"size"` + + // Status of the volume + // Required: true + Status *string `json:"status"` + + // The date and time when the volume was updated + // Format: date-time + UpdatedDate *strfmt.DateTime `json:"updatedDate,omitempty"` + + // Volume ID + // Required: true + UUID *string `json:"uuid"` +} + +// Validate validates this v p mem volume reference +func (m *VPMemVolumeReference) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreationDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCrn(formats); err != nil { + res = append(res, err) + } + + if err := m.validateHref(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePvmInstanceID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSize(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUUID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VPMemVolumeReference) validateCreationDate(formats strfmt.Registry) error { + + if err := validate.Required("creationDate", "body", m.CreationDate); err != nil { + return err + } + + if err := validate.FormatOf("creationDate", "body", "date-time", m.CreationDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *VPMemVolumeReference) validateCrn(formats strfmt.Registry) error { + if swag.IsZero(m.Crn) { // not required + return nil + } + + if err := m.Crn.Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("crn") + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("crn") + } + + return err + } + + return nil +} + +func (m *VPMemVolumeReference) validateHref(formats strfmt.Registry) error { + + if err := validate.Required("href", "body", m.Href); err != nil { + return err + } + + return nil +} + +func (m *VPMemVolumeReference) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *VPMemVolumeReference) validatePvmInstanceID(formats strfmt.Registry) error { + + if err := validate.Required("pvmInstanceID", "body", m.PvmInstanceID); err != nil { + return err + } + + return nil +} + +func (m *VPMemVolumeReference) validateSize(formats strfmt.Registry) error { + + if err := validate.Required("size", "body", m.Size); err != nil { + return err + } + + return nil +} + +func (m *VPMemVolumeReference) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +func (m *VPMemVolumeReference) validateUpdatedDate(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedDate) { // not required + return nil + } + + if err := validate.FormatOf("updatedDate", "body", "date-time", m.UpdatedDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *VPMemVolumeReference) validateUUID(formats strfmt.Registry) error { + + if err := validate.Required("uuid", "body", m.UUID); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this v p mem volume reference based on the context it is used +func (m *VPMemVolumeReference) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCrn(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VPMemVolumeReference) contextValidateCrn(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Crn) { // not required + return nil + } + + if err := m.Crn.ContextValidate(ctx, formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("crn") + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("crn") + } + + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VPMemVolumeReference) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VPMemVolumeReference) UnmarshalBinary(b []byte) error { + var res VPMemVolumeReference + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_mem_volumes.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_mem_volumes.go new file mode 100644 index 00000000000..f18c3642bc5 --- /dev/null +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_mem_volumes.go @@ -0,0 +1,133 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + stderrors "errors" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// VPMemVolumes v p mem volumes +// +// swagger:model VPMemVolumes +type VPMemVolumes struct { + + // List of vPMEM volumes + // Required: true + Volumes []*VPMemVolumeReference `json:"volumes"` +} + +// Validate validates this v p mem volumes +func (m *VPMemVolumes) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateVolumes(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VPMemVolumes) validateVolumes(formats strfmt.Registry) error { + + if err := validate.Required("volumes", "body", m.Volumes); err != nil { + return err + } + + for i := 0; i < len(m.Volumes); i++ { + if swag.IsZero(m.Volumes[i]) { // not required + continue + } + + if m.Volumes[i] != nil { + if err := m.Volumes[i].Validate(formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("volumes" + "." + strconv.Itoa(i)) + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("volumes" + "." + strconv.Itoa(i)) + } + + return err + } + } + + } + + return nil +} + +// ContextValidate validate this v p mem volumes based on the context it is used +func (m *VPMemVolumes) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateVolumes(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VPMemVolumes) contextValidateVolumes(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Volumes); i++ { + + if m.Volumes[i] != nil { + + if swag.IsZero(m.Volumes[i]) { // not required + return nil + } + + if err := m.Volumes[i].ContextValidate(ctx, formats); err != nil { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { + return ve.ValidateName("volumes" + "." + strconv.Itoa(i)) + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { + return ce.ValidateName("volumes" + "." + strconv.Itoa(i)) + } + + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VPMemVolumes) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VPMemVolumes) UnmarshalBinary(b []byte) error { + var res VPMemVolumes + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connection.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connection.go index cafa6591094..c374e1660ca 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connection.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connection.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -144,11 +145,15 @@ func (m *VPNConnection) validateDeadPeerDetection(formats strfmt.Registry) error if m.DeadPeerDetection != nil { if err := m.DeadPeerDetection.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("deadPeerDetection") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("deadPeerDetection") } + return err } } @@ -173,11 +178,15 @@ func (m *VPNConnection) validateIkePolicy(formats strfmt.Registry) error { if m.IkePolicy != nil { if err := m.IkePolicy.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("ikePolicy") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("ikePolicy") } + return err } } @@ -193,11 +202,15 @@ func (m *VPNConnection) validateIPSecPolicy(formats strfmt.Registry) error { if m.IPSecPolicy != nil { if err := m.IPSecPolicy.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("ipSecPolicy") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("ipSecPolicy") } + return err } } @@ -214,7 +227,7 @@ func (m *VPNConnection) validateLocalGatewayAddress(formats strfmt.Registry) err return nil } -var vPNConnectionTypeModePropEnum []interface{} +var vPNConnectionTypeModePropEnum []any func init() { var res []string @@ -287,11 +300,15 @@ func (m *VPNConnection) validatePeerGatewayAddress(formats strfmt.Registry) erro if m.PeerGatewayAddress != nil { if err := m.PeerGatewayAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("peerGatewayAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("peerGatewayAddress") } + return err } } @@ -308,7 +325,7 @@ func (m *VPNConnection) validatePeerSubnets(formats strfmt.Registry) error { return nil } -var vPNConnectionTypeStatusPropEnum []interface{} +var vPNConnectionTypeStatusPropEnum []any func init() { var res []string @@ -394,11 +411,15 @@ func (m *VPNConnection) contextValidateDeadPeerDetection(ctx context.Context, fo if m.DeadPeerDetection != nil { if err := m.DeadPeerDetection.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("deadPeerDetection") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("deadPeerDetection") } + return err } } @@ -411,11 +432,15 @@ func (m *VPNConnection) contextValidateIkePolicy(ctx context.Context, formats st if m.IkePolicy != nil { if err := m.IkePolicy.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("ikePolicy") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("ikePolicy") } + return err } } @@ -428,11 +453,15 @@ func (m *VPNConnection) contextValidateIPSecPolicy(ctx context.Context, formats if m.IPSecPolicy != nil { if err := m.IPSecPolicy.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("ipSecPolicy") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("ipSecPolicy") } + return err } } @@ -445,11 +474,15 @@ func (m *VPNConnection) contextValidatePeerGatewayAddress(ctx context.Context, f if m.PeerGatewayAddress != nil { if err := m.PeerGatewayAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("peerGatewayAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("peerGatewayAddress") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connection_create.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connection_create.go index 817382851e3..e6fae3814bf 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connection_create.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connection_create.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -113,7 +114,7 @@ func (m *VPNConnectionCreate) validateIPSecPolicy(formats strfmt.Registry) error return nil } -var vPNConnectionCreateTypeModePropEnum []interface{} +var vPNConnectionCreateTypeModePropEnum []any func init() { var res []string @@ -186,11 +187,15 @@ func (m *VPNConnectionCreate) validatePeerGatewayAddress(formats strfmt.Registry if m.PeerGatewayAddress != nil { if err := m.PeerGatewayAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("peerGatewayAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("peerGatewayAddress") } + return err } } @@ -226,11 +231,15 @@ func (m *VPNConnectionCreate) contextValidatePeerGatewayAddress(ctx context.Cont if m.PeerGatewayAddress != nil { if err := m.PeerGatewayAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("peerGatewayAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("peerGatewayAddress") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connection_create_response.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connection_create_response.go index d3eea567534..813f6e9dab8 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connection_create_response.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connection_create_response.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -94,11 +95,15 @@ func (m *VPNConnectionCreateResponse) validateJobRef(formats strfmt.Registry) er if m.JobRef != nil { if err := m.JobRef.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("jobRef") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("jobRef") } + return err } } @@ -134,11 +139,15 @@ func (m *VPNConnectionCreateResponse) contextValidateJobRef(ctx context.Context, } if err := m.JobRef.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("jobRef") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("jobRef") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connection_update.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connection_update.go index 5fe68e01037..18efba92c99 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connection_update.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connection_update.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -38,7 +39,7 @@ type VPNConnectionUpdate struct { PeerGatewayAddress PeerGatewayAddress `json:"peerGatewayAddress,omitempty"` // v p n connection update additional properties - VPNConnectionUpdateAdditionalProperties map[string]interface{} `json:"-"` + VPNConnectionUpdateAdditionalProperties map[string]any `json:"-"` } // UnmarshalJSON unmarshals this object with additional properties from JSON @@ -85,9 +86,9 @@ func (m *VPNConnectionUpdate) UnmarshalJSON(data []byte) error { delete(stage2, "peerGatewayAddress") // stage 3, add additional properties values if len(stage2) > 0 { - result := make(map[string]interface{}) + result := make(map[string]any) for k, v := range stage2 { - var toadd interface{} + var toadd any if err := json.Unmarshal(v, &toadd); err != nil { return err } @@ -191,11 +192,15 @@ func (m *VPNConnectionUpdate) validatePeerGatewayAddress(formats strfmt.Registry } if err := m.PeerGatewayAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("peerGatewayAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("peerGatewayAddress") } + return err } @@ -223,11 +228,15 @@ func (m *VPNConnectionUpdate) contextValidatePeerGatewayAddress(ctx context.Cont } if err := m.PeerGatewayAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("peerGatewayAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("peerGatewayAddress") } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connections.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connections.go index d86298c76a0..6de716713de 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connections.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/v_p_n_connections.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -50,11 +51,15 @@ func (m *VPNConnections) validateVpnConnections(formats strfmt.Registry) error { if m.VpnConnections[i] != nil { if err := m.VpnConnections[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("vpnConnections" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("vpnConnections" + "." + strconv.Itoa(i)) } + return err } } @@ -89,11 +94,15 @@ func (m *VPNConnections) contextValidateVpnConnections(ctx context.Context, form } if err := m.VpnConnections[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("vpnConnections" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("vpnConnections" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/virtual_serial_number.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/virtual_serial_number.go index 4e712394b04..60e414b0e03 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/virtual_serial_number.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/virtual_serial_number.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -94,11 +95,15 @@ func (m *VirtualSerialNumber) validateSoftwareTier(formats strfmt.Registry) erro } if err := m.SoftwareTier.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("softwareTier") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("softwareTier") } + return err } @@ -126,11 +131,15 @@ func (m *VirtualSerialNumber) contextValidateSoftwareTier(ctx context.Context, f } if err := m.SoftwareTier.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("softwareTier") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("softwareTier") } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/virtual_serial_number_list.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/virtual_serial_number_list.go index a83f8bdac6e..925a61e5e18 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/virtual_serial_number_list.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/virtual_serial_number_list.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -30,11 +31,15 @@ func (m VirtualSerialNumberList) Validate(formats strfmt.Registry) error { if m[i] != nil { if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName(strconv.Itoa(i)) } + return err } } @@ -60,11 +65,15 @@ func (m VirtualSerialNumberList) ContextValidate(ctx context.Context, formats st } if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName(strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume.go index 8a7fc54faab..f612917ff56 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -93,6 +94,9 @@ type Volume struct { // Replication status of a volume ReplicationStatus string `json:"replicationStatus,omitempty"` + // CRN of the replication targert workspace; for a primary replicated volume this is the target workspace that owns the auxiliary data; for an auxiliary replicated volume this is the target workspace that owns the primary data. + ReplicationTargetCRN string `json:"replicationTargetCRN,omitempty"` + // type of replication(metro,global) ReplicationType string `json:"replicationType,omitempty"` @@ -188,11 +192,15 @@ func (m *Volume) validateCrn(formats strfmt.Registry) error { } if err := m.Crn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("crn") } + return err } @@ -233,7 +241,7 @@ func (m *Volume) validateName(formats strfmt.Registry) error { return nil } -var volumeTypePrimaryRolePropEnum []interface{} +var volumeTypePrimaryRolePropEnum []any func init() { var res []string @@ -290,11 +298,15 @@ func (m *Volume) validateUserTags(formats strfmt.Registry) error { } if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } @@ -335,11 +347,15 @@ func (m *Volume) contextValidateCrn(ctx context.Context, formats strfmt.Registry } if err := m.Crn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("crn") } + return err } @@ -349,11 +365,15 @@ func (m *Volume) contextValidateCrn(ctx context.Context, formats strfmt.Registry func (m *Volume) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_group.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_group.go index 77e8f9dc3f3..3d269d9da41 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_group.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_group.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -96,11 +97,15 @@ func (m *VolumeGroup) validateStatusDescription(formats strfmt.Registry) error { if m.StatusDescription != nil { if err := m.StatusDescription.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("statusDescription") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("statusDescription") } + return err } } @@ -131,11 +136,15 @@ func (m *VolumeGroup) contextValidateStatusDescription(ctx context.Context, form } if err := m.StatusDescription.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("statusDescription") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("statusDescription") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_group_action.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_group_action.go index 9da802f0dd6..c50950bce0e 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_group_action.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_group_action.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -32,7 +33,7 @@ type VolumeGroupAction struct { Stop *VolumeGroupActionStop `json:"stop,omitempty"` // volume group action additional properties - VolumeGroupActionAdditionalProperties map[string]interface{} `json:"-"` + VolumeGroupActionAdditionalProperties map[string]any `json:"-"` } // UnmarshalJSON unmarshals this object with additional properties from JSON @@ -70,9 +71,9 @@ func (m *VolumeGroupAction) UnmarshalJSON(data []byte) error { delete(stage2, "stop") // stage 3, add additional properties values if len(stage2) > 0 { - result := make(map[string]interface{}) + result := make(map[string]any) for k, v := range stage2 { - var toadd interface{} + var toadd any if err := json.Unmarshal(v, &toadd); err != nil { return err } @@ -182,11 +183,15 @@ func (m *VolumeGroupAction) validateReset(formats strfmt.Registry) error { if m.Reset != nil { if err := m.Reset.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("reset") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("reset") } + return err } } @@ -201,11 +206,15 @@ func (m *VolumeGroupAction) validateStart(formats strfmt.Registry) error { if m.Start != nil { if err := m.Start.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("start") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("start") } + return err } } @@ -220,11 +229,15 @@ func (m *VolumeGroupAction) validateStop(formats strfmt.Registry) error { if m.Stop != nil { if err := m.Stop.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("stop") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("stop") } + return err } } @@ -263,11 +276,15 @@ func (m *VolumeGroupAction) contextValidateReset(ctx context.Context, formats st } if err := m.Reset.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("reset") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("reset") } + return err } } @@ -284,11 +301,15 @@ func (m *VolumeGroupAction) contextValidateStart(ctx context.Context, formats st } if err := m.Start.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("start") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("start") } + return err } } @@ -305,11 +326,15 @@ func (m *VolumeGroupAction) contextValidateStop(ctx context.Context, formats str } if err := m.Stop.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("stop") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("stop") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_group_action_reset.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_group_action_reset.go index 1e5bb0ac712..a073e4408d7 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_group_action_reset.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_group_action_reset.go @@ -40,7 +40,7 @@ func (m *VolumeGroupActionReset) Validate(formats strfmt.Registry) error { return nil } -var volumeGroupActionResetTypeStatusPropEnum []interface{} +var volumeGroupActionResetTypeStatusPropEnum []any func init() { var res []string diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_group_action_start.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_group_action_start.go index fe500653c59..3ee6050937b 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_group_action_start.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_group_action_start.go @@ -40,7 +40,7 @@ func (m *VolumeGroupActionStart) Validate(formats strfmt.Registry) error { return nil } -var volumeGroupActionStartTypeSourcePropEnum []interface{} +var volumeGroupActionStartTypeSourcePropEnum []any func init() { var res []string diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_group_create.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_group_create.go index da11dd45216..aa77527b039 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_group_create.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_group_create.go @@ -27,6 +27,9 @@ type VolumeGroupCreate struct { // Pattern: ^[\s]*[A-Za-z0-9:_.\-][A-Za-z0-9\s:_.\-]*$ Name string `json:"name,omitempty"` + // Target CRN of the secondary workspace where the auxiliary data resides; optional; if specified, the auxiliary volumes for the primary volumes getting added to the new volume group will be automatically onboarded into the secondary workspace and added to the corresponding auxiliary consistency group. + TargetCRN string `json:"targetCRN,omitempty"` + // List of volume IDs,members of VolumeGroup // Required: true VolumeIDs []string `json:"volumeIDs"` diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_group_details.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_group_details.go index fb9a4edf77a..e0000427209 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_group_details.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_group_details.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -39,6 +40,9 @@ type VolumeGroupDetails struct { // Replication status of volume group ReplicationStatus string `json:"replicationStatus,omitempty"` + // CRN of the replication targert workspace; for a primary replicated volume this is the target workspace that owns the auxiliary data; for an auxiliary replicated volume this is the target workspace that owns the primary data. + ReplicationTargetCRN string `json:"replicationTargetCRN,omitempty"` + // Status of the volume group Status string `json:"status,omitempty"` @@ -99,11 +103,15 @@ func (m *VolumeGroupDetails) validateStatusDescription(formats strfmt.Registry) if m.StatusDescription != nil { if err := m.StatusDescription.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("statusDescription") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("statusDescription") } + return err } } @@ -134,11 +142,15 @@ func (m *VolumeGroupDetails) contextValidateStatusDescription(ctx context.Contex } if err := m.StatusDescription.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("statusDescription") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("statusDescription") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_group_remote_copy_relationships.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_group_remote_copy_relationships.go index db283ffd882..7f1bb429742 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_group_remote_copy_relationships.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_group_remote_copy_relationships.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -52,11 +53,15 @@ func (m *VolumeGroupRemoteCopyRelationships) validateRemoteCopyRelationships(for if m.RemoteCopyRelationships[i] != nil { if err := m.RemoteCopyRelationships[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("remoteCopyRelationships" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("remoteCopyRelationships" + "." + strconv.Itoa(i)) } + return err } } @@ -91,11 +96,15 @@ func (m *VolumeGroupRemoteCopyRelationships) contextValidateRemoteCopyRelationsh } if err := m.RemoteCopyRelationships[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("remoteCopyRelationships" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("remoteCopyRelationships" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_group_update.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_group_update.go index a283929d556..e2e484419d9 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_group_update.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_group_update.go @@ -22,6 +22,9 @@ type VolumeGroupUpdate struct { // List of volume IDs to remove from the volume-group RemoveVolumes []string `json:"removeVolumes"` + + // Target CRN of the secondary workspace where the auxiliary data resides; optional; if specified, the primary volume's corresponding auxiliary volume will be automatically added or removed from the auxiliary consistency group. + TargetCRN string `json:"targetCRN,omitempty"` } // Validate validates this volume group update diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_groups.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_groups.go index 0af75b13fd5..0b3597932f9 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_groups.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_groups.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -52,11 +53,15 @@ func (m *VolumeGroups) validateVolumeGroups(formats strfmt.Registry) error { if m.VolumeGroups[i] != nil { if err := m.VolumeGroups[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("volumeGroups" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("volumeGroups" + "." + strconv.Itoa(i)) } + return err } } @@ -91,11 +96,15 @@ func (m *VolumeGroups) contextValidateVolumeGroups(ctx context.Context, formats } if err := m.VolumeGroups[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("volumeGroups" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("volumeGroups" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_groups_details.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_groups_details.go index 254b14812b7..7cac8319474 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_groups_details.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_groups_details.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -52,11 +53,15 @@ func (m *VolumeGroupsDetails) validateVolumeGroups(formats strfmt.Registry) erro if m.VolumeGroups[i] != nil { if err := m.VolumeGroups[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("volumeGroups" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("volumeGroups" + "." + strconv.Itoa(i)) } + return err } } @@ -91,11 +96,15 @@ func (m *VolumeGroupsDetails) contextValidateVolumeGroups(ctx context.Context, f } if err := m.VolumeGroups[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("volumeGroups" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("volumeGroups" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_info.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_info.go index 59905e25705..23bd094474c 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_info.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_info.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -48,11 +49,15 @@ func (m *VolumeInfo) validateCrn(formats strfmt.Registry) error { } if err := m.Crn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("crn") } + return err } @@ -80,11 +85,15 @@ func (m *VolumeInfo) contextValidateCrn(ctx context.Context, formats strfmt.Regi } if err := m.Crn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("crn") } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_onboarding.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_onboarding.go index 4bca382d7d5..2f120b2697e 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_onboarding.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_onboarding.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -135,11 +136,15 @@ func (m *VolumeOnboarding) validateResults(formats strfmt.Registry) error { if m.Results != nil { if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("results") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("results") } + return err } } @@ -175,11 +180,15 @@ func (m *VolumeOnboarding) contextValidateResults(ctx context.Context, formats s } if err := m.Results.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("results") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("results") } + return err } } @@ -243,11 +252,15 @@ func (m *VolumeOnboardingResults) validateVolumeOnboardingFailures(formats strfm if m.VolumeOnboardingFailures[i] != nil { if err := m.VolumeOnboardingFailures[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("results" + "." + "volumeOnboardingFailures" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("results" + "." + "volumeOnboardingFailures" + "." + strconv.Itoa(i)) } + return err } } @@ -282,11 +295,15 @@ func (m *VolumeOnboardingResults) contextValidateVolumeOnboardingFailures(ctx co } if err := m.VolumeOnboardingFailures[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("results" + "." + "volumeOnboardingFailures" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("results" + "." + "volumeOnboardingFailures" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_onboarding_create.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_onboarding_create.go index 30863a53d3b..0760c269d95 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_onboarding_create.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_onboarding_create.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -62,11 +63,15 @@ func (m *VolumeOnboardingCreate) validateVolumes(formats strfmt.Registry) error if m.Volumes[i] != nil { if err := m.Volumes[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("Volumes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("Volumes" + "." + strconv.Itoa(i)) } + return err } } @@ -82,11 +87,15 @@ func (m *VolumeOnboardingCreate) validateUserTags(formats strfmt.Registry) error } if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } @@ -122,11 +131,15 @@ func (m *VolumeOnboardingCreate) contextValidateVolumes(ctx context.Context, for } if err := m.Volumes[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("Volumes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("Volumes" + "." + strconv.Itoa(i)) } + return err } } @@ -139,11 +152,15 @@ func (m *VolumeOnboardingCreate) contextValidateVolumes(ctx context.Context, for func (m *VolumeOnboardingCreate) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_onboardings.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_onboardings.go index 8b2e760911b..224ac8f9a03 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_onboardings.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_onboardings.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -52,11 +53,15 @@ func (m *VolumeOnboardings) validateOnboardings(formats strfmt.Registry) error { if m.Onboardings[i] != nil { if err := m.Onboardings[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("onboardings" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("onboardings" + "." + strconv.Itoa(i)) } + return err } } @@ -91,11 +96,15 @@ func (m *VolumeOnboardings) contextValidateOnboardings(ctx context.Context, form } if err := m.Onboardings[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("onboardings" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("onboardings" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_reference.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_reference.go index dedbebfb0cd..9e01ed27b15 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_reference.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_reference.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -99,6 +100,9 @@ type VolumeReference struct { // shows the replication status of a volume ReplicationStatus string `json:"replicationStatus,omitempty"` + // CRN of the replication targert workspace; for a primary replicated volume this is the target workspace that owns the auxiliary data; for an auxiliary replicated volume this is the target workspace that owns the primary data. + ReplicationTargetCRN string `json:"replicationTargetCRN,omitempty"` + // type of replication(metro, global)s ReplicationType string `json:"replicationType,omitempty"` @@ -230,11 +234,15 @@ func (m *VolumeReference) validateCrn(formats strfmt.Registry) error { } if err := m.Crn.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("crn") } + return err } @@ -293,7 +301,7 @@ func (m *VolumeReference) validateName(formats strfmt.Registry) error { return nil } -var volumeReferenceTypePrimaryRolePropEnum []interface{} +var volumeReferenceTypePrimaryRolePropEnum []any func init() { var res []string @@ -368,11 +376,15 @@ func (m *VolumeReference) validateUserTags(formats strfmt.Registry) error { } if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } @@ -422,11 +434,15 @@ func (m *VolumeReference) contextValidateCrn(ctx context.Context, formats strfmt } if err := m.Crn.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("crn") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("crn") } + return err } @@ -436,11 +452,15 @@ func (m *VolumeReference) contextValidateCrn(ctx context.Context, formats strfmt func (m *VolumeReference) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_snapshot_list.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_snapshot_list.go index 9190cd33020..35899a3b490 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_snapshot_list.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volume_snapshot_list.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -49,11 +50,15 @@ func (m *VolumeSnapshotList) validateVolumeSnapshots(formats strfmt.Registry) er if m.VolumeSnapshots[i] != nil { if err := m.VolumeSnapshots[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("volumeSnapshots" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("volumeSnapshots" + "." + strconv.Itoa(i)) } + return err } } @@ -88,11 +93,15 @@ func (m *VolumeSnapshotList) contextValidateVolumeSnapshots(ctx context.Context, } if err := m.VolumeSnapshots[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("volumeSnapshots" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("volumeSnapshots" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes.go index 45225e3ca31..34664ad3fb1 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -52,11 +53,15 @@ func (m *Volumes) validateVolumes(formats strfmt.Registry) error { if m.Volumes[i] != nil { if err := m.Volumes[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("volumes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("volumes" + "." + strconv.Itoa(i)) } + return err } } @@ -91,11 +96,15 @@ func (m *Volumes) contextValidateVolumes(ctx context.Context, formats strfmt.Reg } if err := m.Volumes[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("volumes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("volumes" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_async_request.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_async_request.go index 6d9f8c3b452..8336f6768ae 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_async_request.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_async_request.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -85,11 +86,15 @@ func (m *VolumesCloneAsyncRequest) validateUserTags(formats strfmt.Registry) err } if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } @@ -122,11 +127,15 @@ func (m *VolumesCloneAsyncRequest) ContextValidate(ctx context.Context, formats func (m *VolumesCloneAsyncRequest) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_detail.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_detail.go index 5ce539cfc89..ec711220886 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_detail.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_detail.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -89,11 +90,15 @@ func (m *VolumesCloneDetail) validateClonedVolumes(formats strfmt.Registry) erro if m.ClonedVolumes[i] != nil { if err := m.ClonedVolumes[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("clonedVolumes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("clonedVolumes" + "." + strconv.Itoa(i)) } + return err } } @@ -161,11 +166,15 @@ func (m *VolumesCloneDetail) contextValidateClonedVolumes(ctx context.Context, f } if err := m.ClonedVolumes[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("clonedVolumes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("clonedVolumes" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_execute.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_execute.go index e118ea23b4d..e18870ae01f 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_execute.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_execute.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -82,11 +83,15 @@ func (m *VolumesCloneExecute) validateUserTags(formats strfmt.Registry) error { } if err := m.UserTags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } @@ -110,11 +115,15 @@ func (m *VolumesCloneExecute) ContextValidate(ctx context.Context, formats strfm func (m *VolumesCloneExecute) contextValidateUserTags(ctx context.Context, formats strfmt.Registry) error { if err := m.UserTags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("userTags") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("userTags") } + return err } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_response.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_response.go index 09ecf72c26f..7ab2407e761 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_response.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clone_response.go @@ -21,7 +21,7 @@ type VolumesCloneResponse struct { AdditionalProperties string `json:"additionalProperties,omitempty"` // A map of volume IDs to cloned volume IDs - ClonedVolumes interface{} `json:"clonedVolumes,omitempty"` + ClonedVolumes any `json:"clonedVolumes,omitempty"` } // Validate validates this volumes clone response diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clones.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clones.go index e8abde5e348..cb7db97464c 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clones.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/volumes_clones.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -49,11 +50,15 @@ func (m *VolumesClones) validateVolumesClone(formats strfmt.Registry) error { if m.VolumesClone[i] != nil { if err := m.VolumesClone[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("volumesClone" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("volumesClone" + "." + strconv.Itoa(i)) } + return err } } @@ -88,11 +93,15 @@ func (m *VolumesClones) contextValidateVolumesClone(ctx context.Context, formats } if err := m.VolumesClone[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("volumesClone" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("volumesClone" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/workspace.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/workspace.go index 89fdc4dc7bd..e3145ecc4da 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/workspace.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/workspace.go @@ -8,6 +8,7 @@ package models import ( "context" "encoding/json" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -105,11 +106,15 @@ func (m *Workspace) validateDetails(formats strfmt.Registry) error { if m.Details != nil { if err := m.Details.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("details") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("details") } + return err } } @@ -134,11 +139,15 @@ func (m *Workspace) validateLocation(formats strfmt.Registry) error { if m.Location != nil { if err := m.Location.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("location") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("location") } + return err } } @@ -164,7 +173,7 @@ func (m *Workspace) validateStatus(formats strfmt.Registry) error { return nil } -var workspaceTypeTypePropEnum []interface{} +var workspaceTypeTypePropEnum []any func init() { var res []string @@ -230,11 +239,15 @@ func (m *Workspace) contextValidateDetails(ctx context.Context, formats strfmt.R if m.Details != nil { if err := m.Details.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("details") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("details") } + return err } } @@ -247,11 +260,15 @@ func (m *Workspace) contextValidateLocation(ctx context.Context, formats strfmt. if m.Location != nil { if err := m.Location.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("location") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("location") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/workspace_details.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/workspace_details.go index a26cc6ea53e..faf000d270b 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/workspace_details.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/workspace_details.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -93,11 +94,15 @@ func (m *WorkspaceDetails) validateNetworkSecurityGroups(formats strfmt.Registry if m.NetworkSecurityGroups != nil { if err := m.NetworkSecurityGroups.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("networkSecurityGroups") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("networkSecurityGroups") } + return err } } @@ -112,11 +117,15 @@ func (m *WorkspaceDetails) validatePowerEdgeRouter(formats strfmt.Registry) erro if m.PowerEdgeRouter != nil { if err := m.PowerEdgeRouter.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("powerEdgeRouter") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("powerEdgeRouter") } + return err } } @@ -151,11 +160,15 @@ func (m *WorkspaceDetails) contextValidateNetworkSecurityGroups(ctx context.Cont } if err := m.NetworkSecurityGroups.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("networkSecurityGroups") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("networkSecurityGroups") } + return err } } @@ -172,11 +185,15 @@ func (m *WorkspaceDetails) contextValidatePowerEdgeRouter(ctx context.Context, f } if err := m.PowerEdgeRouter.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("powerEdgeRouter") - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("powerEdgeRouter") } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/workspace_network_security_groups_details.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/workspace_network_security_groups_details.go index baf2523e0b5..a8e2f38a56b 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/workspace_network_security_groups_details.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/workspace_network_security_groups_details.go @@ -40,7 +40,7 @@ func (m *WorkspaceNetworkSecurityGroupsDetails) Validate(formats strfmt.Registry return nil } -var workspaceNetworkSecurityGroupsDetailsTypeStatePropEnum []interface{} +var workspaceNetworkSecurityGroupsDetailsTypeStatePropEnum []any func init() { var res []string diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/workspace_power_edge_router_details.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/workspace_power_edge_router_details.go index 993163305f3..e7639db65bd 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/workspace_power_edge_router_details.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/workspace_power_edge_router_details.go @@ -57,7 +57,7 @@ func (m *WorkspacePowerEdgeRouterDetails) Validate(formats strfmt.Registry) erro return nil } -var workspacePowerEdgeRouterDetailsTypeMigrationStatusPropEnum []interface{} +var workspacePowerEdgeRouterDetailsTypeMigrationStatusPropEnum []any func init() { var res []string @@ -105,7 +105,7 @@ func (m *WorkspacePowerEdgeRouterDetails) validateMigrationStatus(formats strfmt return nil } -var workspacePowerEdgeRouterDetailsTypeStatePropEnum []interface{} +var workspacePowerEdgeRouterDetailsTypeStatePropEnum []any func init() { var res []string @@ -166,7 +166,7 @@ func (m *WorkspacePowerEdgeRouterDetails) validateState(formats strfmt.Registry) return nil } -var workspacePowerEdgeRouterDetailsTypeTypePropEnum []interface{} +var workspacePowerEdgeRouterDetailsTypeTypePropEnum []any func init() { var res []string diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/workspace_ssh_keys.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/workspace_ssh_keys.go index 44eaea4cba9..d935790dca8 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/workspace_ssh_keys.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/workspace_ssh_keys.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -52,11 +53,15 @@ func (m *WorkspaceSSHKeys) validateSSHKeys(formats strfmt.Registry) error { if m.SSHKeys[i] != nil { if err := m.SSHKeys[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("sshKeys" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("sshKeys" + "." + strconv.Itoa(i)) } + return err } } @@ -91,11 +96,15 @@ func (m *WorkspaceSSHKeys) contextValidateSSHKeys(ctx context.Context, formats s } if err := m.SSHKeys[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("sshKeys" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("sshKeys" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM-Cloud/power-go-client/power/models/workspaces.go b/vendor/github.com/IBM-Cloud/power-go-client/power/models/workspaces.go index ef05e062111..cd18b3de871 100644 --- a/vendor/github.com/IBM-Cloud/power-go-client/power/models/workspaces.go +++ b/vendor/github.com/IBM-Cloud/power-go-client/power/models/workspaces.go @@ -7,6 +7,7 @@ package models import ( "context" + stderrors "errors" "strconv" "github.com/go-openapi/errors" @@ -52,11 +53,15 @@ func (m *Workspaces) validateWorkspaces(formats strfmt.Registry) error { if m.Workspaces[i] != nil { if err := m.Workspaces[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("workspaces" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("workspaces" + "." + strconv.Itoa(i)) } + return err } } @@ -91,11 +96,15 @@ func (m *Workspaces) contextValidateWorkspaces(ctx context.Context, formats strf } if err := m.Workspaces[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { + ve := new(errors.Validation) + if stderrors.As(err, &ve) { return ve.ValidateName("workspaces" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { + } + ce := new(errors.CompositeError) + if stderrors.As(err, &ce) { return ce.ValidateName("workspaces" + "." + strconv.Itoa(i)) } + return err } } diff --git a/vendor/github.com/IBM/go-sdk-core/v5/core/version.go b/vendor/github.com/IBM/go-sdk-core/v5/core/version.go index 5b70ae7ff9c..2fe9feb7b0d 100644 --- a/vendor/github.com/IBM/go-sdk-core/v5/core/version.go +++ b/vendor/github.com/IBM/go-sdk-core/v5/core/version.go @@ -15,4 +15,4 @@ package core // limitations under the License. // Version of the SDK -const __VERSION__ = "5.21.0" +const __VERSION__ = "5.21.2" diff --git a/vendor/github.com/IBM/ibm-cos-sdk-go/aws/endpoints/defaults.go b/vendor/github.com/IBM/ibm-cos-sdk-go/aws/endpoints/defaults.go index 3bb705161a0..bf1d4fd0cd6 100644 --- a/vendor/github.com/IBM/ibm-cos-sdk-go/aws/endpoints/defaults.go +++ b/vendor/github.com/IBM/ibm-cos-sdk-go/aws/endpoints/defaults.go @@ -73,10 +73,10 @@ func DefaultResolver() Resolver { // DefaultPartitions returns a list of the partitions the SDK is bundled // with. The available partitions are: AWS Standard, AWS China, AWS GovCloud (US), AWS ISO (US), and AWS ISOB (US). // -// partitions := endpoints.DefaultPartitions -// for _, p := range partitions { -// // ... inspect partitions -// } +// partitions := endpoints.DefaultPartitions +// for _, p := range partitions { +// // ... inspect partitions +// } func DefaultPartitions() []Partition { return defaultPartitions.Partitions() } diff --git a/vendor/github.com/IBM/ibm-cos-sdk-go/aws/version.go b/vendor/github.com/IBM/ibm-cos-sdk-go/aws/version.go index 770f83fd602..086a32b793c 100644 --- a/vendor/github.com/IBM/ibm-cos-sdk-go/aws/version.go +++ b/vendor/github.com/IBM/ibm-cos-sdk-go/aws/version.go @@ -7,6 +7,6 @@ package aws const SDKName = "ibm-cos-sdk-go" // SDKVersion is the version of this SDK -const SDKVersion = "1.12.3" +const SDKVersion = "1.12.4" // IBM COS SDK Code -- END diff --git a/vendor/github.com/IBM/ibm-cos-sdk-go/service/s3/api.go b/vendor/github.com/IBM/ibm-cos-sdk-go/service/s3/api.go index b1968d8c300..e47e73c7ae7 100644 --- a/vendor/github.com/IBM/ibm-cos-sdk-go/service/s3/api.go +++ b/vendor/github.com/IBM/ibm-cos-sdk-go/service/s3/api.go @@ -3700,6 +3700,81 @@ func (c *S3) HeadObjectWithContext(ctx aws.Context, input *HeadObjectInput, opts return out, req.Send() } +const opListBucketReplicationFailures = "ListBucketReplicationFailures" + +// ListBucketReplicationFailuresRequest generates a "aws/request.Request" representing the +// client's request for the ListBucketReplicationFailures operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListBucketReplicationFailures for more information on using the ListBucketReplicationFailures +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// // Example sending a request using the ListBucketReplicationFailuresRequest method. +// req, resp := client.ListBucketReplicationFailuresRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketReplicationFailures +func (c *S3) ListBucketReplicationFailuresRequest(input *ListBucketReplicationFailuresInput) (req *request.Request, output *ListBucketReplicationFailuresOutput) { + op := &request.Operation{ + Name: opListBucketReplicationFailures, + HTTPMethod: "GET", + HTTPPath: "/{Bucket}?ibm-replication-failures", + } + + if input == nil { + input = &ListBucketReplicationFailuresInput{} + } + + output = &ListBucketReplicationFailuresOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Build.PushBackNamed(request.NamedHandler{ + Name: "contentMd5Handler", + Fn: checksum.AddBodyContentMD5Handler, + }) + return +} + +// ListBucketReplicationFailures API operation for Amazon Simple Storage Service. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation ListBucketReplicationFailures for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketReplicationFailures +func (c *S3) ListBucketReplicationFailures(input *ListBucketReplicationFailuresInput) (*ListBucketReplicationFailuresOutput, error) { + req, out := c.ListBucketReplicationFailuresRequest(input) + return out, req.Send() +} + +// ListBucketReplicationFailuresWithContext is the same as ListBucketReplicationFailures with the addition of +// the ability to pass a context and additional request options. +// +// See ListBucketReplicationFailures for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) ListBucketReplicationFailuresWithContext(ctx aws.Context, input *ListBucketReplicationFailuresInput, opts ...request.Option) (*ListBucketReplicationFailuresOutput, error) { + req, out := c.ListBucketReplicationFailuresRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opListBuckets = "ListBuckets" // ListBucketsRequest generates a "aws/request.Request" representing the @@ -5446,6 +5521,82 @@ func (c *S3) PutBucketReplicationWithContext(ctx aws.Context, input *PutBucketRe return out, req.Send() } +const opPutBucketReplicationReattempt = "PutBucketReplicationReattempt" + +// PutBucketReplicationReattemptRequest generates a "aws/request.Request" representing the +// client's request for the PutBucketReplicationReattempt operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutBucketReplicationReattempt for more information on using the PutBucketReplicationReattempt +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// // Example sending a request using the PutBucketReplicationReattemptRequest method. +// req, resp := client.PutBucketReplicationReattemptRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketReplicationReattempt +func (c *S3) PutBucketReplicationReattemptRequest(input *PutBucketReplicationReattemptInput) (req *request.Request, output *PutBucketReplicationReattemptOutput) { + op := &request.Operation{ + Name: opPutBucketReplicationReattempt, + HTTPMethod: "PUT", + HTTPPath: "/{Bucket}?ibm-replication-reattempt", + } + + if input == nil { + input = &PutBucketReplicationReattemptInput{} + } + + output = &PutBucketReplicationReattemptOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + req.Handlers.Build.PushBackNamed(request.NamedHandler{ + Name: "contentMd5Handler", + Fn: checksum.AddBodyContentMD5Handler, + }) + return +} + +// PutBucketReplicationReattempt API operation for Amazon Simple Storage Service. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation PutBucketReplicationReattempt for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketReplicationReattempt +func (c *S3) PutBucketReplicationReattempt(input *PutBucketReplicationReattemptInput) (*PutBucketReplicationReattemptOutput, error) { + req, out := c.PutBucketReplicationReattemptRequest(input) + return out, req.Send() +} + +// PutBucketReplicationReattemptWithContext is the same as PutBucketReplicationReattempt with the addition of +// the ability to pass a context and additional request options. +// +// See PutBucketReplicationReattempt for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) PutBucketReplicationReattemptWithContext(ctx aws.Context, input *PutBucketReplicationReattemptInput, opts ...request.Option) (*PutBucketReplicationReattemptOutput, error) { + req, out := c.PutBucketReplicationReattemptRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opPutBucketVersioning = "PutBucketVersioning" // PutBucketVersioningRequest generates a "aws/request.Request" representing the @@ -15906,6 +16057,128 @@ func (s *LifecycleRuleFilter) SetTag(v *Tag) *LifecycleRuleFilter { return s } +type ListBucketReplicationFailuresInput struct { + _ struct{} `locationName:"ListBucketReplicationFailuresRequest" type:"structure"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + + ContinuationToken *string `location:"querystring" locationName:"continuation-token" type:"string"` + + // Requests Amazon S3 to encode the object keys in the response and specifies + // the encoding method to use. An object key can contain any Unicode character; + // however, the XML 1.0 parser cannot parse some characters, such as characters + // with an ASCII value from 0 to 10. For characters that are not supported in + // XML 1.0, you can add this parameter to request that Amazon S3 encode the + // keys in the response. + EncodingType *string `location:"querystring" locationName:"encoding-type" type:"string" enum:"EncodingType"` + + FirstSyncAttemptedBefore *string `location:"querystring" locationName:"first-sync-attempted-before" type:"string"` + + MaxKeys *int64 `location:"querystring" locationName:"max-keys" type:"integer"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ListBucketReplicationFailuresInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ListBucketReplicationFailuresInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListBucketReplicationFailuresInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListBucketReplicationFailuresInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.Bucket != nil && len(*s.Bucket) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *ListBucketReplicationFailuresInput) SetBucket(v string) *ListBucketReplicationFailuresInput { + s.Bucket = &v + return s +} + +func (s *ListBucketReplicationFailuresInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +// SetContinuationToken sets the ContinuationToken field's value. +func (s *ListBucketReplicationFailuresInput) SetContinuationToken(v string) *ListBucketReplicationFailuresInput { + s.ContinuationToken = &v + return s +} + +// SetEncodingType sets the EncodingType field's value. +func (s *ListBucketReplicationFailuresInput) SetEncodingType(v string) *ListBucketReplicationFailuresInput { + s.EncodingType = &v + return s +} + +// SetFirstSyncAttemptedBefore sets the FirstSyncAttemptedBefore field's value. +func (s *ListBucketReplicationFailuresInput) SetFirstSyncAttemptedBefore(v string) *ListBucketReplicationFailuresInput { + s.FirstSyncAttemptedBefore = &v + return s +} + +// SetMaxKeys sets the MaxKeys field's value. +func (s *ListBucketReplicationFailuresInput) SetMaxKeys(v int64) *ListBucketReplicationFailuresInput { + s.MaxKeys = &v + return s +} + +type ListBucketReplicationFailuresOutput struct { + _ struct{} `type:"structure" payload:"ListReplicationFailureResult"` + + ListReplicationFailureResult *ListReplicationFailureResult `locationName:"ListReplicationFailureResult" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ListBucketReplicationFailuresOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ListBucketReplicationFailuresOutput) GoString() string { + return s.String() +} + +// SetListReplicationFailureResult sets the ListReplicationFailureResult field's value. +func (s *ListBucketReplicationFailuresOutput) SetListReplicationFailureResult(v *ListReplicationFailureResult) *ListBucketReplicationFailuresOutput { + s.ListReplicationFailureResult = v + return s +} + type ListBucketsExtendedInput struct { _ struct{} `locationName:"ListBucketsExtendedRequest" type:"structure"` @@ -17856,6 +18129,110 @@ func (s *ListPartsOutput) SetUploadId(v string) *ListPartsOutput { return s } +type ListReplicationFailureResult struct { + _ struct{} `type:"structure"` + + // Contents is a required field + Contents []*ObjectSyncAttempted `locationNameList:"Contents" type:"list" flattened:"true" required:"true"` + + ContinuationToken *string `type:"string"` + + // Requests Amazon S3 to encode the object keys in the response and specifies + // the encoding method to use. An object key can contain any Unicode character; + // however, the XML 1.0 parser cannot parse some characters, such as characters + // with an ASCII value from 0 to 10. For characters that are not supported in + // XML 1.0, you can add this parameter to request that Amazon S3 encode the + // keys in the response. + EncodingType *string `type:"string" enum:"EncodingType"` + + FirstSyncAttemptedBefore *string `type:"string"` + + // IsTruncated is a required field + IsTruncated *bool `type:"boolean" required:"true"` + + // KeyCount is a required field + KeyCount *int64 `type:"integer" required:"true"` + + MaxKeys *int64 `type:"integer"` + + // Name is a required field + Name *string `type:"string" required:"true"` + + NextContinuationToken *string `type:"string"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ListReplicationFailureResult) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ListReplicationFailureResult) GoString() string { + return s.String() +} + +// SetContents sets the Contents field's value. +func (s *ListReplicationFailureResult) SetContents(v []*ObjectSyncAttempted) *ListReplicationFailureResult { + s.Contents = v + return s +} + +// SetContinuationToken sets the ContinuationToken field's value. +func (s *ListReplicationFailureResult) SetContinuationToken(v string) *ListReplicationFailureResult { + s.ContinuationToken = &v + return s +} + +// SetEncodingType sets the EncodingType field's value. +func (s *ListReplicationFailureResult) SetEncodingType(v string) *ListReplicationFailureResult { + s.EncodingType = &v + return s +} + +// SetFirstSyncAttemptedBefore sets the FirstSyncAttemptedBefore field's value. +func (s *ListReplicationFailureResult) SetFirstSyncAttemptedBefore(v string) *ListReplicationFailureResult { + s.FirstSyncAttemptedBefore = &v + return s +} + +// SetIsTruncated sets the IsTruncated field's value. +func (s *ListReplicationFailureResult) SetIsTruncated(v bool) *ListReplicationFailureResult { + s.IsTruncated = &v + return s +} + +// SetKeyCount sets the KeyCount field's value. +func (s *ListReplicationFailureResult) SetKeyCount(v int64) *ListReplicationFailureResult { + s.KeyCount = &v + return s +} + +// SetMaxKeys sets the MaxKeys field's value. +func (s *ListReplicationFailureResult) SetMaxKeys(v int64) *ListReplicationFailureResult { + s.MaxKeys = &v + return s +} + +// SetName sets the Name field's value. +func (s *ListReplicationFailureResult) SetName(v string) *ListReplicationFailureResult { + s.Name = &v + return s +} + +// SetNextContinuationToken sets the NextContinuationToken field's value. +func (s *ListReplicationFailureResult) SetNextContinuationToken(v string) *ListReplicationFailureResult { + s.NextContinuationToken = &v + return s +} + // Describes where logs are stored and the prefix that Amazon S3 assigns to // all log object keys for a bucket. For more information, see PUT Bucket logging // (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlogging.html) @@ -18439,6 +18816,81 @@ func (s *ObjectLockRule) SetDefaultRetention(v *DefaultRetention) *ObjectLockRul return s } +type ObjectSyncAttempted struct { + _ struct{} `type:"structure"` + + // FirstSyncAttempted is a required field + FirstSyncAttempted *time.Time `type:"timestamp" required:"true"` + + // Key is a required field + Key *string `min:"1" type:"string" required:"true"` + + // LastSyncAttempted is a required field + LastSyncAttempted *time.Time `type:"timestamp" required:"true"` + + SyncFailureCause *string `type:"string"` + + // SyncType is a required field + SyncType *string `type:"string" required:"true"` + + // VersionId is a required field + VersionId *string `type:"string" required:"true"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ObjectSyncAttempted) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s ObjectSyncAttempted) GoString() string { + return s.String() +} + +// SetFirstSyncAttempted sets the FirstSyncAttempted field's value. +func (s *ObjectSyncAttempted) SetFirstSyncAttempted(v time.Time) *ObjectSyncAttempted { + s.FirstSyncAttempted = &v + return s +} + +// SetKey sets the Key field's value. +func (s *ObjectSyncAttempted) SetKey(v string) *ObjectSyncAttempted { + s.Key = &v + return s +} + +// SetLastSyncAttempted sets the LastSyncAttempted field's value. +func (s *ObjectSyncAttempted) SetLastSyncAttempted(v time.Time) *ObjectSyncAttempted { + s.LastSyncAttempted = &v + return s +} + +// SetSyncFailureCause sets the SyncFailureCause field's value. +func (s *ObjectSyncAttempted) SetSyncFailureCause(v string) *ObjectSyncAttempted { + s.SyncFailureCause = &v + return s +} + +// SetSyncType sets the SyncType field's value. +func (s *ObjectSyncAttempted) SetSyncType(v string) *ObjectSyncAttempted { + s.SyncType = &v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *ObjectSyncAttempted) SetVersionId(v string) *ObjectSyncAttempted { + s.VersionId = &v + return s +} + // The version of an object. type ObjectVersion struct { _ struct{} `type:"structure"` @@ -19487,6 +19939,82 @@ func (s PutBucketReplicationOutput) GoString() string { return s.String() } +type PutBucketReplicationReattemptInput struct { + _ struct{} `locationName:"PutBucketReplicationReattemptRequest" type:"structure"` + + // Bucket is a required field + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s PutBucketReplicationReattemptInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s PutBucketReplicationReattemptInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutBucketReplicationReattemptInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutBucketReplicationReattemptInput"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.Bucket != nil && len(*s.Bucket) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *PutBucketReplicationReattemptInput) SetBucket(v string) *PutBucketReplicationReattemptInput { + s.Bucket = &v + return s +} + +func (s *PutBucketReplicationReattemptInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +type PutBucketReplicationReattemptOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s PutBucketReplicationReattemptOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation. +// +// API parameter values that are decorated as "sensitive" in the API will not +// be included in the string output. The member name will be present, but the +// value will be replaced with "sensitive". +func (s PutBucketReplicationReattemptOutput) GoString() string { + return s.String() +} + type PutBucketVersioningInput struct { _ struct{} `locationName:"PutBucketVersioningRequest" type:"structure" payload:"VersioningConfiguration"` diff --git a/vendor/github.com/IBM/networking-go-sdk/transitgatewayapisv1/transit_gateway_apis_v1.go b/vendor/github.com/IBM/networking-go-sdk/transitgatewayapisv1/transit_gateway_apis_v1.go index df0c02ccff8..dffe47a9fcf 100644 --- a/vendor/github.com/IBM/networking-go-sdk/transitgatewayapisv1/transit_gateway_apis_v1.go +++ b/vendor/github.com/IBM/networking-go-sdk/transitgatewayapisv1/transit_gateway_apis_v1.go @@ -15,7 +15,7 @@ */ /* - * IBM OpenAPI SDK Code Generator Version: 3.73.0-eeee85a9-20230607-165104 + * IBM OpenAPI SDK Code Generator Version: 3.107.1-41b0fbd0-20250825-080732 */ // Package transitgatewayapisv1 : Operations and models for the TransitGatewayApisV1 service @@ -72,22 +72,26 @@ func NewTransitGatewayApisV1UsingExternalConfig(options *TransitGatewayApisV1Opt if options.Authenticator == nil { options.Authenticator, err = core.GetAuthenticatorFromEnvironment(options.ServiceName) if err != nil { + err = core.SDKErrorf(err, "", "env-auth-error", common.GetComponentInfo()) return } } transitGatewayApis, err = NewTransitGatewayApisV1(options) + err = core.RepurposeSDKProblem(err, "new-client-error") if err != nil { return } err = transitGatewayApis.Service.ConfigureService(options.ServiceName) if err != nil { + err = core.SDKErrorf(err, "", "client-config-error", common.GetComponentInfo()) return } if options.URL != "" { err = transitGatewayApis.Service.SetServiceURL(options.URL) + err = core.RepurposeSDKProblem(err, "url-set-error") } return } @@ -101,17 +105,20 @@ func NewTransitGatewayApisV1(options *TransitGatewayApisV1Options) (service *Tra err = core.ValidateStruct(options, "options") if err != nil { + err = core.SDKErrorf(err, "", "invalid-global-options", common.GetComponentInfo()) return } baseService, err := core.NewBaseService(serviceOptions) if err != nil { + err = core.SDKErrorf(err, "", "new-base-error", common.GetComponentInfo()) return } if options.URL != "" { err = baseService.SetServiceURL(options.URL) if err != nil { + err = core.SDKErrorf(err, "", "set-url-error", common.GetComponentInfo()) return } } @@ -126,7 +133,7 @@ func NewTransitGatewayApisV1(options *TransitGatewayApisV1Options) (service *Tra // GetServiceURLForRegion returns the service URL to be used for the specified region func GetServiceURLForRegion(region string) (string, error) { - return "", fmt.Errorf("service does not support regional URLs") + return "", core.SDKErrorf(nil, "service does not support regional URLs", "no-regional-support", common.GetComponentInfo()) } // Clone makes a copy of "transitGatewayApis" suitable for processing requests. @@ -141,7 +148,11 @@ func (transitGatewayApis *TransitGatewayApisV1) Clone() *TransitGatewayApisV1 { // SetServiceURL sets the service URL func (transitGatewayApis *TransitGatewayApisV1) SetServiceURL(url string) error { - return transitGatewayApis.Service.SetServiceURL(url) + err := transitGatewayApis.Service.SetServiceURL(url) + if err != nil { + err = core.SDKErrorf(err, "", "url-set-error", common.GetComponentInfo()) + } + return err } // GetServiceURL returns the service URL @@ -178,13 +189,16 @@ func (transitGatewayApis *TransitGatewayApisV1) DisableRetries() { // ListTransitGateways : Retrieves all Transit Gateways // List all Transit Gateways in account the caller is authorized to view. func (transitGatewayApis *TransitGatewayApisV1) ListTransitGateways(listTransitGatewaysOptions *ListTransitGatewaysOptions) (result *TransitGatewayCollection, response *core.DetailedResponse, err error) { - return transitGatewayApis.ListTransitGatewaysWithContext(context.Background(), listTransitGatewaysOptions) + result, response, err = transitGatewayApis.ListTransitGatewaysWithContext(context.Background(), listTransitGatewaysOptions) + err = core.RepurposeSDKProblem(err, "") + return } // ListTransitGatewaysWithContext is an alternate form of the ListTransitGateways method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewaysWithContext(ctx context.Context, listTransitGatewaysOptions *ListTransitGatewaysOptions) (result *TransitGatewayCollection, response *core.DetailedResponse, err error) { err = core.ValidateStruct(listTransitGatewaysOptions, "listTransitGatewaysOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -193,15 +207,16 @@ func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewaysWithContext(c builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways`, nil) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range listTransitGatewaysOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "ListTransitGateways") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "ListTransitGateways") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range listTransitGatewaysOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -216,17 +231,21 @@ func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewaysWithContext(c request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "list_transit_gateways", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalTransitGatewayCollection) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -238,17 +257,21 @@ func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewaysWithContext(c // CreateTransitGateway : Creates a Transit Gateway // Create a Transit Gateway based on the supplied input template. func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGateway(createTransitGatewayOptions *CreateTransitGatewayOptions) (result *TransitGateway, response *core.DetailedResponse, err error) { - return transitGatewayApis.CreateTransitGatewayWithContext(context.Background(), createTransitGatewayOptions) + result, response, err = transitGatewayApis.CreateTransitGatewayWithContext(context.Background(), createTransitGatewayOptions) + err = core.RepurposeSDKProblem(err, "") + return } // CreateTransitGatewayWithContext is an alternate form of the CreateTransitGateway method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayWithContext(ctx context.Context, createTransitGatewayOptions *CreateTransitGatewayOptions) (result *TransitGateway, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(createTransitGatewayOptions, "createTransitGatewayOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(createTransitGatewayOptions, "createTransitGatewayOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -257,15 +280,16 @@ func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayWithContext( builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways`, nil) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range createTransitGatewayOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "CreateTransitGateway") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "CreateTransitGateway") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range createTransitGatewayOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -291,22 +315,27 @@ func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayWithContext( } _, err = builder.SetBodyContentJSON(body) if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "create_transit_gateway", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalTransitGateway) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -319,17 +348,21 @@ func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayWithContext( // This request deletes a Transit Gateway. This operation cannot be reversed. For this request to succeed, the Transit // Gateway must not contain connections. func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGateway(deleteTransitGatewayOptions *DeleteTransitGatewayOptions) (response *core.DetailedResponse, err error) { - return transitGatewayApis.DeleteTransitGatewayWithContext(context.Background(), deleteTransitGatewayOptions) + response, err = transitGatewayApis.DeleteTransitGatewayWithContext(context.Background(), deleteTransitGatewayOptions) + err = core.RepurposeSDKProblem(err, "") + return } // DeleteTransitGatewayWithContext is an alternate form of the DeleteTransitGateway method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayWithContext(ctx context.Context, deleteTransitGatewayOptions *DeleteTransitGatewayOptions) (response *core.DetailedResponse, err error) { err = core.ValidateNotNil(deleteTransitGatewayOptions, "deleteTransitGatewayOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(deleteTransitGatewayOptions, "deleteTransitGatewayOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -342,15 +375,16 @@ func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayWithContext( builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range deleteTransitGatewayOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "DeleteTransitGateway") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "DeleteTransitGateway") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range deleteTransitGatewayOptions.Headers { builder.AddHeader(headerName, headerValue) } @@ -358,10 +392,16 @@ func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayWithContext( request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } response, err = transitGatewayApis.Service.Request(request, nil) + if err != nil { + core.EnrichHTTPProblem(err, "delete_transit_gateway", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } return } @@ -369,17 +409,21 @@ func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayWithContext( // GetTransitGateway : Retrieves specified Transit Gateway // This request retrieves a single Transit Gateway specified by the identifier in the URL. func (transitGatewayApis *TransitGatewayApisV1) GetTransitGateway(getTransitGatewayOptions *GetTransitGatewayOptions) (result *TransitGateway, response *core.DetailedResponse, err error) { - return transitGatewayApis.GetTransitGatewayWithContext(context.Background(), getTransitGatewayOptions) + result, response, err = transitGatewayApis.GetTransitGatewayWithContext(context.Background(), getTransitGatewayOptions) + err = core.RepurposeSDKProblem(err, "") + return } // GetTransitGatewayWithContext is an alternate form of the GetTransitGateway method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayWithContext(ctx context.Context, getTransitGatewayOptions *GetTransitGatewayOptions) (result *TransitGateway, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(getTransitGatewayOptions, "getTransitGatewayOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(getTransitGatewayOptions, "getTransitGatewayOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -392,15 +436,16 @@ func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayWithContext(ctx builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range getTransitGatewayOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "GetTransitGateway") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "GetTransitGateway") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range getTransitGatewayOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -409,17 +454,21 @@ func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayWithContext(ctx request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "get_transit_gateway", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalTransitGateway) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -431,17 +480,21 @@ func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayWithContext(ctx // UpdateTransitGateway : Updates specified Transit Gateway // This request updates a Transit Gateway's name and/or global flag. func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGateway(updateTransitGatewayOptions *UpdateTransitGatewayOptions) (result *TransitGateway, response *core.DetailedResponse, err error) { - return transitGatewayApis.UpdateTransitGatewayWithContext(context.Background(), updateTransitGatewayOptions) + result, response, err = transitGatewayApis.UpdateTransitGatewayWithContext(context.Background(), updateTransitGatewayOptions) + err = core.RepurposeSDKProblem(err, "") + return } // UpdateTransitGatewayWithContext is an alternate form of the UpdateTransitGateway method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayWithContext(ctx context.Context, updateTransitGatewayOptions *UpdateTransitGatewayOptions) (result *TransitGateway, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(updateTransitGatewayOptions, "updateTransitGatewayOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(updateTransitGatewayOptions, "updateTransitGatewayOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -454,15 +507,16 @@ func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayWithContext( builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range updateTransitGatewayOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "UpdateTransitGateway") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "UpdateTransitGateway") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range updateTransitGatewayOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -482,22 +536,27 @@ func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayWithContext( } _, err = builder.SetBodyContentJSON(body) if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "update_transit_gateway", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalTransitGateway) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -509,13 +568,16 @@ func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayWithContext( // ListConnections : Retrieves all connections // List all transit gateway connections associated with this account. func (transitGatewayApis *TransitGatewayApisV1) ListConnections(listConnectionsOptions *ListConnectionsOptions) (result *TransitConnectionCollection, response *core.DetailedResponse, err error) { - return transitGatewayApis.ListConnectionsWithContext(context.Background(), listConnectionsOptions) + result, response, err = transitGatewayApis.ListConnectionsWithContext(context.Background(), listConnectionsOptions) + err = core.RepurposeSDKProblem(err, "") + return } // ListConnectionsWithContext is an alternate form of the ListConnections method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) ListConnectionsWithContext(ctx context.Context, listConnectionsOptions *ListConnectionsOptions) (result *TransitConnectionCollection, response *core.DetailedResponse, err error) { err = core.ValidateStruct(listConnectionsOptions, "listConnectionsOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -524,15 +586,16 @@ func (transitGatewayApis *TransitGatewayApisV1) ListConnectionsWithContext(ctx c builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/connections`, nil) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range listConnectionsOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "ListConnections") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "ListConnections") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range listConnectionsOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -553,17 +616,21 @@ func (transitGatewayApis *TransitGatewayApisV1) ListConnectionsWithContext(ctx c request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "list_connections", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalTransitConnectionCollection) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -575,17 +642,21 @@ func (transitGatewayApis *TransitGatewayApisV1) ListConnectionsWithContext(ctx c // ListTransitGatewayConnections : Retrieves all connections in a Transit Gateway // This request retrieves all connections in a Transit Gateway. func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayConnections(listTransitGatewayConnectionsOptions *ListTransitGatewayConnectionsOptions) (result *TransitGatewayConnectionCollection, response *core.DetailedResponse, err error) { - return transitGatewayApis.ListTransitGatewayConnectionsWithContext(context.Background(), listTransitGatewayConnectionsOptions) + result, response, err = transitGatewayApis.ListTransitGatewayConnectionsWithContext(context.Background(), listTransitGatewayConnectionsOptions) + err = core.RepurposeSDKProblem(err, "") + return } // ListTransitGatewayConnectionsWithContext is an alternate form of the ListTransitGatewayConnections method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayConnectionsWithContext(ctx context.Context, listTransitGatewayConnectionsOptions *ListTransitGatewayConnectionsOptions) (result *TransitGatewayConnectionCollection, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(listTransitGatewayConnectionsOptions, "listTransitGatewayConnectionsOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(listTransitGatewayConnectionsOptions, "listTransitGatewayConnectionsOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -598,15 +669,16 @@ func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayConnectionsWit builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/connections`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range listTransitGatewayConnectionsOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "ListTransitGatewayConnections") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "ListTransitGatewayConnections") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range listTransitGatewayConnectionsOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -624,17 +696,21 @@ func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayConnectionsWit request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "list_transit_gateway_connections", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalTransitGatewayConnectionCollection) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -646,17 +722,21 @@ func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayConnectionsWit // CreateTransitGatewayConnection : Adds a connection to a Transit Gateway // Add a connection to Transit Gateway. func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayConnection(createTransitGatewayConnectionOptions *CreateTransitGatewayConnectionOptions) (result *TransitGatewayConnectionCust, response *core.DetailedResponse, err error) { - return transitGatewayApis.CreateTransitGatewayConnectionWithContext(context.Background(), createTransitGatewayConnectionOptions) + result, response, err = transitGatewayApis.CreateTransitGatewayConnectionWithContext(context.Background(), createTransitGatewayConnectionOptions) + err = core.RepurposeSDKProblem(err, "") + return } // CreateTransitGatewayConnectionWithContext is an alternate form of the CreateTransitGatewayConnection method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayConnectionWithContext(ctx context.Context, createTransitGatewayConnectionOptions *CreateTransitGatewayConnectionOptions) (result *TransitGatewayConnectionCust, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(createTransitGatewayConnectionOptions, "createTransitGatewayConnectionOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(createTransitGatewayConnectionOptions, "createTransitGatewayConnectionOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -669,15 +749,16 @@ func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayConnectionWi builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/connections`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range createTransitGatewayConnectionOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "CreateTransitGatewayConnection") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "CreateTransitGatewayConnection") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range createTransitGatewayConnectionOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -736,22 +817,27 @@ func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayConnectionWi } _, err = builder.SetBodyContentJSON(body) if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "create_transit_gateway_connection", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalTransitGatewayConnectionCust) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -764,17 +850,21 @@ func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayConnectionWi // After the specified connection is detached, entities still within the Transit Gateway will no longer be able to // communicate directly to it through the IBM Cloud private backbone. func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayConnection(deleteTransitGatewayConnectionOptions *DeleteTransitGatewayConnectionOptions) (response *core.DetailedResponse, err error) { - return transitGatewayApis.DeleteTransitGatewayConnectionWithContext(context.Background(), deleteTransitGatewayConnectionOptions) + response, err = transitGatewayApis.DeleteTransitGatewayConnectionWithContext(context.Background(), deleteTransitGatewayConnectionOptions) + err = core.RepurposeSDKProblem(err, "") + return } // DeleteTransitGatewayConnectionWithContext is an alternate form of the DeleteTransitGatewayConnection method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayConnectionWithContext(ctx context.Context, deleteTransitGatewayConnectionOptions *DeleteTransitGatewayConnectionOptions) (response *core.DetailedResponse, err error) { err = core.ValidateNotNil(deleteTransitGatewayConnectionOptions, "deleteTransitGatewayConnectionOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(deleteTransitGatewayConnectionOptions, "deleteTransitGatewayConnectionOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -788,15 +878,16 @@ func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayConnectionWi builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/connections/{id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range deleteTransitGatewayConnectionOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "DeleteTransitGatewayConnection") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "DeleteTransitGatewayConnection") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range deleteTransitGatewayConnectionOptions.Headers { builder.AddHeader(headerName, headerValue) } @@ -804,10 +895,16 @@ func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayConnectionWi request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } response, err = transitGatewayApis.Service.Request(request, nil) + if err != nil { + core.EnrichHTTPProblem(err, "delete_transit_gateway_connection", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } return } @@ -815,17 +912,21 @@ func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayConnectionWi // GetTransitGatewayConnection : Retrieves specified Transit Gateway connection // This request retrieves a connection from the Transit Gateway. func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayConnection(getTransitGatewayConnectionOptions *GetTransitGatewayConnectionOptions) (result *TransitGatewayConnectionCust, response *core.DetailedResponse, err error) { - return transitGatewayApis.GetTransitGatewayConnectionWithContext(context.Background(), getTransitGatewayConnectionOptions) + result, response, err = transitGatewayApis.GetTransitGatewayConnectionWithContext(context.Background(), getTransitGatewayConnectionOptions) + err = core.RepurposeSDKProblem(err, "") + return } // GetTransitGatewayConnectionWithContext is an alternate form of the GetTransitGatewayConnection method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayConnectionWithContext(ctx context.Context, getTransitGatewayConnectionOptions *GetTransitGatewayConnectionOptions) (result *TransitGatewayConnectionCust, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(getTransitGatewayConnectionOptions, "getTransitGatewayConnectionOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(getTransitGatewayConnectionOptions, "getTransitGatewayConnectionOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -839,15 +940,16 @@ func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayConnectionWithC builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/connections/{id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range getTransitGatewayConnectionOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "GetTransitGatewayConnection") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "GetTransitGatewayConnection") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range getTransitGatewayConnectionOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -856,17 +958,21 @@ func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayConnectionWithC request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "get_transit_gateway_connection", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalTransitGatewayConnectionCust) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -878,17 +984,21 @@ func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayConnectionWithC // UpdateTransitGatewayConnection : Updates specified Transit Gateway connection // Update the name of a connection to a Transit Gateway. func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayConnection(updateTransitGatewayConnectionOptions *UpdateTransitGatewayConnectionOptions) (result *TransitGatewayConnectionCust, response *core.DetailedResponse, err error) { - return transitGatewayApis.UpdateTransitGatewayConnectionWithContext(context.Background(), updateTransitGatewayConnectionOptions) + result, response, err = transitGatewayApis.UpdateTransitGatewayConnectionWithContext(context.Background(), updateTransitGatewayConnectionOptions) + err = core.RepurposeSDKProblem(err, "") + return } // UpdateTransitGatewayConnectionWithContext is an alternate form of the UpdateTransitGatewayConnection method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayConnectionWithContext(ctx context.Context, updateTransitGatewayConnectionOptions *UpdateTransitGatewayConnectionOptions) (result *TransitGatewayConnectionCust, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(updateTransitGatewayConnectionOptions, "updateTransitGatewayConnectionOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(updateTransitGatewayConnectionOptions, "updateTransitGatewayConnectionOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -902,15 +1012,16 @@ func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayConnectionWi builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/connections/{id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range updateTransitGatewayConnectionOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "UpdateTransitGatewayConnection") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "UpdateTransitGatewayConnection") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range updateTransitGatewayConnectionOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -927,22 +1038,27 @@ func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayConnectionWi } _, err = builder.SetBodyContentJSON(body) if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "update_transit_gateway_connection", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalTransitGatewayConnectionCust) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -954,17 +1070,21 @@ func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayConnectionWi // CreateTransitGatewayConnectionActions : Performs actions on a connection for a Transit Gateway // Allow a network owner to approve or reject a cross-account connection request. func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayConnectionActions(createTransitGatewayConnectionActionsOptions *CreateTransitGatewayConnectionActionsOptions) (response *core.DetailedResponse, err error) { - return transitGatewayApis.CreateTransitGatewayConnectionActionsWithContext(context.Background(), createTransitGatewayConnectionActionsOptions) + response, err = transitGatewayApis.CreateTransitGatewayConnectionActionsWithContext(context.Background(), createTransitGatewayConnectionActionsOptions) + err = core.RepurposeSDKProblem(err, "") + return } // CreateTransitGatewayConnectionActionsWithContext is an alternate form of the CreateTransitGatewayConnectionActions method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayConnectionActionsWithContext(ctx context.Context, createTransitGatewayConnectionActionsOptions *CreateTransitGatewayConnectionActionsOptions) (response *core.DetailedResponse, err error) { err = core.ValidateNotNil(createTransitGatewayConnectionActionsOptions, "createTransitGatewayConnectionActionsOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(createTransitGatewayConnectionActionsOptions, "createTransitGatewayConnectionActionsOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -978,15 +1098,16 @@ func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayConnectionAc builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/connections/{id}/actions`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range createTransitGatewayConnectionActionsOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "CreateTransitGatewayConnectionActions") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "CreateTransitGatewayConnectionActions") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range createTransitGatewayConnectionActionsOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Content-Type", "application/json") @@ -999,15 +1120,22 @@ func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayConnectionAc } _, err = builder.SetBodyContentJSON(body) if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } response, err = transitGatewayApis.Service.Request(request, nil) + if err != nil { + core.EnrichHTTPProblem(err, "create_transit_gateway_connection_actions", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } return } @@ -1015,17 +1143,21 @@ func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayConnectionAc // ListTransitGatewayGreTunnel : Retrieves specified Transit Gateway redundant gre connection tunnels // This request retrieves a list of all the tunnels for connection. func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayGreTunnel(listTransitGatewayGreTunnelOptions *ListTransitGatewayGreTunnelOptions) (result *TransitGatewayTunnelCollection, response *core.DetailedResponse, err error) { - return transitGatewayApis.ListTransitGatewayGreTunnelWithContext(context.Background(), listTransitGatewayGreTunnelOptions) + result, response, err = transitGatewayApis.ListTransitGatewayGreTunnelWithContext(context.Background(), listTransitGatewayGreTunnelOptions) + err = core.RepurposeSDKProblem(err, "") + return } // ListTransitGatewayGreTunnelWithContext is an alternate form of the ListTransitGatewayGreTunnel method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayGreTunnelWithContext(ctx context.Context, listTransitGatewayGreTunnelOptions *ListTransitGatewayGreTunnelOptions) (result *TransitGatewayTunnelCollection, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(listTransitGatewayGreTunnelOptions, "listTransitGatewayGreTunnelOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(listTransitGatewayGreTunnelOptions, "listTransitGatewayGreTunnelOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1039,15 +1171,16 @@ func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayGreTunnelWithC builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/connections/{id}/tunnels`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range listTransitGatewayGreTunnelOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "ListTransitGatewayGreTunnel") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "ListTransitGatewayGreTunnel") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range listTransitGatewayGreTunnelOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -1056,17 +1189,21 @@ func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayGreTunnelWithC request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "list_transit_gateway_gre_tunnel", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalTransitGatewayTunnelCollection) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -1078,17 +1215,21 @@ func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayGreTunnelWithC // CreateTransitGatewayGreTunnel : Creates a Transit Gateway redundant GRE tunnel // Add a tunnel to an existing Redundant GRE connection. func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayGreTunnel(createTransitGatewayGreTunnelOptions *CreateTransitGatewayGreTunnelOptions) (result *TransitGatewayTunnel, response *core.DetailedResponse, err error) { - return transitGatewayApis.CreateTransitGatewayGreTunnelWithContext(context.Background(), createTransitGatewayGreTunnelOptions) + result, response, err = transitGatewayApis.CreateTransitGatewayGreTunnelWithContext(context.Background(), createTransitGatewayGreTunnelOptions) + err = core.RepurposeSDKProblem(err, "") + return } // CreateTransitGatewayGreTunnelWithContext is an alternate form of the CreateTransitGatewayGreTunnel method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayGreTunnelWithContext(ctx context.Context, createTransitGatewayGreTunnelOptions *CreateTransitGatewayGreTunnelOptions) (result *TransitGatewayTunnel, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(createTransitGatewayGreTunnelOptions, "createTransitGatewayGreTunnelOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(createTransitGatewayGreTunnelOptions, "createTransitGatewayGreTunnelOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1102,15 +1243,16 @@ func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayGreTunnelWit builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/connections/{id}/tunnels`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range createTransitGatewayGreTunnelOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "CreateTransitGatewayGreTunnel") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "CreateTransitGatewayGreTunnel") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range createTransitGatewayGreTunnelOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -1142,22 +1284,27 @@ func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayGreTunnelWit } _, err = builder.SetBodyContentJSON(body) if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "create_transit_gateway_gre_tunnel", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalTransitGatewayTunnel) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -1169,17 +1316,21 @@ func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayGreTunnelWit // DeleteTransitGatewayConnectionTunnels : Deletes a specified Transit Gateway redundant GRE tunnel // Remove a tunnel from a redundant GRE connection. func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayConnectionTunnels(deleteTransitGatewayConnectionTunnelsOptions *DeleteTransitGatewayConnectionTunnelsOptions) (response *core.DetailedResponse, err error) { - return transitGatewayApis.DeleteTransitGatewayConnectionTunnelsWithContext(context.Background(), deleteTransitGatewayConnectionTunnelsOptions) + response, err = transitGatewayApis.DeleteTransitGatewayConnectionTunnelsWithContext(context.Background(), deleteTransitGatewayConnectionTunnelsOptions) + err = core.RepurposeSDKProblem(err, "") + return } // DeleteTransitGatewayConnectionTunnelsWithContext is an alternate form of the DeleteTransitGatewayConnectionTunnels method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayConnectionTunnelsWithContext(ctx context.Context, deleteTransitGatewayConnectionTunnelsOptions *DeleteTransitGatewayConnectionTunnelsOptions) (response *core.DetailedResponse, err error) { err = core.ValidateNotNil(deleteTransitGatewayConnectionTunnelsOptions, "deleteTransitGatewayConnectionTunnelsOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(deleteTransitGatewayConnectionTunnelsOptions, "deleteTransitGatewayConnectionTunnelsOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1194,15 +1345,16 @@ func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayConnectionTu builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/connections/{id}/tunnels/{gre_tunnel_id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range deleteTransitGatewayConnectionTunnelsOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "DeleteTransitGatewayConnectionTunnels") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "DeleteTransitGatewayConnectionTunnels") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range deleteTransitGatewayConnectionTunnelsOptions.Headers { builder.AddHeader(headerName, headerValue) } @@ -1210,10 +1362,16 @@ func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayConnectionTu request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } response, err = transitGatewayApis.Service.Request(request, nil) + if err != nil { + core.EnrichHTTPProblem(err, "delete_transit_gateway_connection_tunnels", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } return } @@ -1221,17 +1379,21 @@ func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayConnectionTu // GetTransitGatewayConnectionTunnels : Retrieves specified Transit Gateway connection tunnel // This request retrieves a connection tunnel from the Transit Gateway connection. func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayConnectionTunnels(getTransitGatewayConnectionTunnelsOptions *GetTransitGatewayConnectionTunnelsOptions) (result *TransitGatewayTunnel, response *core.DetailedResponse, err error) { - return transitGatewayApis.GetTransitGatewayConnectionTunnelsWithContext(context.Background(), getTransitGatewayConnectionTunnelsOptions) + result, response, err = transitGatewayApis.GetTransitGatewayConnectionTunnelsWithContext(context.Background(), getTransitGatewayConnectionTunnelsOptions) + err = core.RepurposeSDKProblem(err, "") + return } // GetTransitGatewayConnectionTunnelsWithContext is an alternate form of the GetTransitGatewayConnectionTunnels method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayConnectionTunnelsWithContext(ctx context.Context, getTransitGatewayConnectionTunnelsOptions *GetTransitGatewayConnectionTunnelsOptions) (result *TransitGatewayTunnel, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(getTransitGatewayConnectionTunnelsOptions, "getTransitGatewayConnectionTunnelsOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(getTransitGatewayConnectionTunnelsOptions, "getTransitGatewayConnectionTunnelsOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1246,15 +1408,16 @@ func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayConnectionTunne builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/connections/{id}/tunnels/{gre_tunnel_id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range getTransitGatewayConnectionTunnelsOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "GetTransitGatewayConnectionTunnels") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "GetTransitGatewayConnectionTunnels") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range getTransitGatewayConnectionTunnelsOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -1263,17 +1426,21 @@ func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayConnectionTunne request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "get_transit_gateway_connection_tunnels", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalTransitGatewayTunnel) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -1285,17 +1452,21 @@ func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayConnectionTunne // UpdateTransitGatewayConnectionTunnels : Updates specified Transit Gateway redundant GRE tunnel // Update the name of a connection tunnel. func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayConnectionTunnels(updateTransitGatewayConnectionTunnelsOptions *UpdateTransitGatewayConnectionTunnelsOptions) (result *TransitGatewayTunnel, response *core.DetailedResponse, err error) { - return transitGatewayApis.UpdateTransitGatewayConnectionTunnelsWithContext(context.Background(), updateTransitGatewayConnectionTunnelsOptions) + result, response, err = transitGatewayApis.UpdateTransitGatewayConnectionTunnelsWithContext(context.Background(), updateTransitGatewayConnectionTunnelsOptions) + err = core.RepurposeSDKProblem(err, "") + return } // UpdateTransitGatewayConnectionTunnelsWithContext is an alternate form of the UpdateTransitGatewayConnectionTunnels method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayConnectionTunnelsWithContext(ctx context.Context, updateTransitGatewayConnectionTunnelsOptions *UpdateTransitGatewayConnectionTunnelsOptions) (result *TransitGatewayTunnel, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(updateTransitGatewayConnectionTunnelsOptions, "updateTransitGatewayConnectionTunnelsOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(updateTransitGatewayConnectionTunnelsOptions, "updateTransitGatewayConnectionTunnelsOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1310,15 +1481,16 @@ func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayConnectionTu builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/connections/{id}/tunnels/{gre_tunnel_id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range updateTransitGatewayConnectionTunnelsOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "UpdateTransitGatewayConnectionTunnels") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "UpdateTransitGatewayConnectionTunnels") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range updateTransitGatewayConnectionTunnelsOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -1328,22 +1500,27 @@ func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayConnectionTu _, err = builder.SetBodyContentJSON(updateTransitGatewayConnectionTunnelsOptions.TransitGatewayTunnelPatch) if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "update_transit_gateway_connection_tunnels", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalTransitGatewayTunnel) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -1355,13 +1532,16 @@ func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayConnectionTu // ListGatewayLocations : Lists all locations that support Transit Gateways // List all locations that support Transit Gateways. func (transitGatewayApis *TransitGatewayApisV1) ListGatewayLocations(listGatewayLocationsOptions *ListGatewayLocationsOptions) (result *TSCollection, response *core.DetailedResponse, err error) { - return transitGatewayApis.ListGatewayLocationsWithContext(context.Background(), listGatewayLocationsOptions) + result, response, err = transitGatewayApis.ListGatewayLocationsWithContext(context.Background(), listGatewayLocationsOptions) + err = core.RepurposeSDKProblem(err, "") + return } // ListGatewayLocationsWithContext is an alternate form of the ListGatewayLocations method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) ListGatewayLocationsWithContext(ctx context.Context, listGatewayLocationsOptions *ListGatewayLocationsOptions) (result *TSCollection, response *core.DetailedResponse, err error) { err = core.ValidateStruct(listGatewayLocationsOptions, "listGatewayLocationsOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1370,15 +1550,16 @@ func (transitGatewayApis *TransitGatewayApisV1) ListGatewayLocationsWithContext( builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/locations`, nil) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range listGatewayLocationsOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "ListGatewayLocations") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "ListGatewayLocations") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range listGatewayLocationsOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -1387,17 +1568,21 @@ func (transitGatewayApis *TransitGatewayApisV1) ListGatewayLocationsWithContext( request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "list_gateway_locations", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalTSCollection) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -1409,17 +1594,21 @@ func (transitGatewayApis *TransitGatewayApisV1) ListGatewayLocationsWithContext( // GetGatewayLocation : Shows the details of a given Transit Gateway location // Get the details of a Transit Gateway Location. func (transitGatewayApis *TransitGatewayApisV1) GetGatewayLocation(getGatewayLocationOptions *GetGatewayLocationOptions) (result *TSLocation, response *core.DetailedResponse, err error) { - return transitGatewayApis.GetGatewayLocationWithContext(context.Background(), getGatewayLocationOptions) + result, response, err = transitGatewayApis.GetGatewayLocationWithContext(context.Background(), getGatewayLocationOptions) + err = core.RepurposeSDKProblem(err, "") + return } // GetGatewayLocationWithContext is an alternate form of the GetGatewayLocation method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) GetGatewayLocationWithContext(ctx context.Context, getGatewayLocationOptions *GetGatewayLocationOptions) (result *TSLocation, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(getGatewayLocationOptions, "getGatewayLocationOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(getGatewayLocationOptions, "getGatewayLocationOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1432,15 +1621,16 @@ func (transitGatewayApis *TransitGatewayApisV1) GetGatewayLocationWithContext(ct builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/locations/{name}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range getGatewayLocationOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "GetGatewayLocation") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "GetGatewayLocation") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range getGatewayLocationOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -1449,17 +1639,21 @@ func (transitGatewayApis *TransitGatewayApisV1) GetGatewayLocationWithContext(ct request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "get_gateway_location", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalTSLocation) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -1471,17 +1665,21 @@ func (transitGatewayApis *TransitGatewayApisV1) GetGatewayLocationWithContext(ct // ListTransitGatewayConnectionPrefixFilters : Retrieves all prefix filters in a Transit Gateway connection // This request retrieves all prefix filters in a Transit Gateway connection. func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayConnectionPrefixFilters(listTransitGatewayConnectionPrefixFiltersOptions *ListTransitGatewayConnectionPrefixFiltersOptions) (result *PrefixFilterCollection, response *core.DetailedResponse, err error) { - return transitGatewayApis.ListTransitGatewayConnectionPrefixFiltersWithContext(context.Background(), listTransitGatewayConnectionPrefixFiltersOptions) + result, response, err = transitGatewayApis.ListTransitGatewayConnectionPrefixFiltersWithContext(context.Background(), listTransitGatewayConnectionPrefixFiltersOptions) + err = core.RepurposeSDKProblem(err, "") + return } // ListTransitGatewayConnectionPrefixFiltersWithContext is an alternate form of the ListTransitGatewayConnectionPrefixFilters method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayConnectionPrefixFiltersWithContext(ctx context.Context, listTransitGatewayConnectionPrefixFiltersOptions *ListTransitGatewayConnectionPrefixFiltersOptions) (result *PrefixFilterCollection, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(listTransitGatewayConnectionPrefixFiltersOptions, "listTransitGatewayConnectionPrefixFiltersOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(listTransitGatewayConnectionPrefixFiltersOptions, "listTransitGatewayConnectionPrefixFiltersOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1495,15 +1693,16 @@ func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayConnectionPref builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/connections/{id}/prefix_filters`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range listTransitGatewayConnectionPrefixFiltersOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "ListTransitGatewayConnectionPrefixFilters") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "ListTransitGatewayConnectionPrefixFilters") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range listTransitGatewayConnectionPrefixFiltersOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -1512,17 +1711,21 @@ func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayConnectionPref request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "list_transit_gateway_connection_prefix_filters", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPrefixFilterCollection) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -1532,19 +1735,25 @@ func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayConnectionPref } // CreateTransitGatewayConnectionPrefixFilter : Add a prefix filter to a Transit Gateway connection -// Add a prefix filter to a Transit Gateway connection. +// Add a Prefix Filter to a Transit Gateway Connection. Prefix Filters can be added to `vpc`, `classic`, `directlink`, +// and `power_virtual_server` Connection types. Prefix Filters cannot be added to `gre_tunnel`, `unbound_gre_tunnel`, +// `redundant_gre` or `vpn_gateway` Connection types. func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayConnectionPrefixFilter(createTransitGatewayConnectionPrefixFilterOptions *CreateTransitGatewayConnectionPrefixFilterOptions) (result *PrefixFilterCust, response *core.DetailedResponse, err error) { - return transitGatewayApis.CreateTransitGatewayConnectionPrefixFilterWithContext(context.Background(), createTransitGatewayConnectionPrefixFilterOptions) + result, response, err = transitGatewayApis.CreateTransitGatewayConnectionPrefixFilterWithContext(context.Background(), createTransitGatewayConnectionPrefixFilterOptions) + err = core.RepurposeSDKProblem(err, "") + return } // CreateTransitGatewayConnectionPrefixFilterWithContext is an alternate form of the CreateTransitGatewayConnectionPrefixFilter method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayConnectionPrefixFilterWithContext(ctx context.Context, createTransitGatewayConnectionPrefixFilterOptions *CreateTransitGatewayConnectionPrefixFilterOptions) (result *PrefixFilterCust, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(createTransitGatewayConnectionPrefixFilterOptions, "createTransitGatewayConnectionPrefixFilterOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(createTransitGatewayConnectionPrefixFilterOptions, "createTransitGatewayConnectionPrefixFilterOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1558,15 +1767,16 @@ func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayConnectionPr builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/connections/{id}/prefix_filters`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range createTransitGatewayConnectionPrefixFilterOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "CreateTransitGatewayConnectionPrefixFilter") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "CreateTransitGatewayConnectionPrefixFilter") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range createTransitGatewayConnectionPrefixFilterOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -1592,95 +1802,27 @@ func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayConnectionPr } _, err = builder.SetBodyContentJSON(body) if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "create_transit_gateway_connection_prefix_filter", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPrefixFilterCust) if err != nil { - return - } - response.Result = result - } - - return -} - -// ReplaceTransitGatewayConnectionPrefixFilter : Replaces the prefix filters of the Transit Gateway connection -// Replaces the prefix filters of the Transit Gateway connection. -func (transitGatewayApis *TransitGatewayApisV1) ReplaceTransitGatewayConnectionPrefixFilter(replaceTransitGatewayConnectionPrefixFilterOptions *ReplaceTransitGatewayConnectionPrefixFilterOptions) (result *PrefixFilterCollection, response *core.DetailedResponse, err error) { - return transitGatewayApis.ReplaceTransitGatewayConnectionPrefixFilterWithContext(context.Background(), replaceTransitGatewayConnectionPrefixFilterOptions) -} - -// ReplaceTransitGatewayConnectionPrefixFilterWithContext is an alternate form of the ReplaceTransitGatewayConnectionPrefixFilter method which supports a Context parameter -func (transitGatewayApis *TransitGatewayApisV1) ReplaceTransitGatewayConnectionPrefixFilterWithContext(ctx context.Context, replaceTransitGatewayConnectionPrefixFilterOptions *ReplaceTransitGatewayConnectionPrefixFilterOptions) (result *PrefixFilterCollection, response *core.DetailedResponse, err error) { - err = core.ValidateNotNil(replaceTransitGatewayConnectionPrefixFilterOptions, "replaceTransitGatewayConnectionPrefixFilterOptions cannot be nil") - if err != nil { - return - } - err = core.ValidateStruct(replaceTransitGatewayConnectionPrefixFilterOptions, "replaceTransitGatewayConnectionPrefixFilterOptions") - if err != nil { - return - } - - pathParamsMap := map[string]string{ - "transit_gateway_id": *replaceTransitGatewayConnectionPrefixFilterOptions.TransitGatewayID, - "id": *replaceTransitGatewayConnectionPrefixFilterOptions.ID, - } - - builder := core.NewRequestBuilder(core.PUT) - builder = builder.WithContext(ctx) - builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() - _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/connections/{id}/prefix_filters`, pathParamsMap) - if err != nil { - return - } - - for headerName, headerValue := range replaceTransitGatewayConnectionPrefixFilterOptions.Headers { - builder.AddHeader(headerName, headerValue) - } - - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "ReplaceTransitGatewayConnectionPrefixFilter") - for headerName, headerValue := range sdkHeaders { - builder.AddHeader(headerName, headerValue) - } - builder.AddHeader("Accept", "application/json") - builder.AddHeader("Content-Type", "application/json") - - builder.AddQuery("version", fmt.Sprint(*transitGatewayApis.Version)) - - body := make(map[string]interface{}) - if replaceTransitGatewayConnectionPrefixFilterOptions.PrefixFilters != nil { - body["prefix_filters"] = replaceTransitGatewayConnectionPrefixFilterOptions.PrefixFilters - } - _, err = builder.SetBodyContentJSON(body) - if err != nil { - return - } - - request, err := builder.Build() - if err != nil { - return - } - - var rawResponse map[string]json.RawMessage - response, err = transitGatewayApis.Service.Request(request, &rawResponse) - if err != nil { - return - } - if rawResponse != nil { - err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPrefixFilterCollection) - if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -1692,17 +1834,21 @@ func (transitGatewayApis *TransitGatewayApisV1) ReplaceTransitGatewayConnectionP // DeleteTransitGatewayConnectionPrefixFilter : Remove prefix filter from Transit Gateway connection // Delete a prefix filter. func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayConnectionPrefixFilter(deleteTransitGatewayConnectionPrefixFilterOptions *DeleteTransitGatewayConnectionPrefixFilterOptions) (response *core.DetailedResponse, err error) { - return transitGatewayApis.DeleteTransitGatewayConnectionPrefixFilterWithContext(context.Background(), deleteTransitGatewayConnectionPrefixFilterOptions) + response, err = transitGatewayApis.DeleteTransitGatewayConnectionPrefixFilterWithContext(context.Background(), deleteTransitGatewayConnectionPrefixFilterOptions) + err = core.RepurposeSDKProblem(err, "") + return } // DeleteTransitGatewayConnectionPrefixFilterWithContext is an alternate form of the DeleteTransitGatewayConnectionPrefixFilter method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayConnectionPrefixFilterWithContext(ctx context.Context, deleteTransitGatewayConnectionPrefixFilterOptions *DeleteTransitGatewayConnectionPrefixFilterOptions) (response *core.DetailedResponse, err error) { err = core.ValidateNotNil(deleteTransitGatewayConnectionPrefixFilterOptions, "deleteTransitGatewayConnectionPrefixFilterOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(deleteTransitGatewayConnectionPrefixFilterOptions, "deleteTransitGatewayConnectionPrefixFilterOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1717,15 +1863,16 @@ func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayConnectionPr builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/connections/{id}/prefix_filters/{filter_id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range deleteTransitGatewayConnectionPrefixFilterOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "DeleteTransitGatewayConnectionPrefixFilter") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "DeleteTransitGatewayConnectionPrefixFilter") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range deleteTransitGatewayConnectionPrefixFilterOptions.Headers { builder.AddHeader(headerName, headerValue) } @@ -1733,10 +1880,16 @@ func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayConnectionPr request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } response, err = transitGatewayApis.Service.Request(request, nil) + if err != nil { + core.EnrichHTTPProblem(err, "delete_transit_gateway_connection_prefix_filter", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } return } @@ -1744,17 +1897,21 @@ func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayConnectionPr // GetTransitGatewayConnectionPrefixFilter : Retrieves specified Transit Gateway connection prefix filter // This request retrieves a prefix filter from the Transit Gateway connection. func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayConnectionPrefixFilter(getTransitGatewayConnectionPrefixFilterOptions *GetTransitGatewayConnectionPrefixFilterOptions) (result *PrefixFilterCust, response *core.DetailedResponse, err error) { - return transitGatewayApis.GetTransitGatewayConnectionPrefixFilterWithContext(context.Background(), getTransitGatewayConnectionPrefixFilterOptions) + result, response, err = transitGatewayApis.GetTransitGatewayConnectionPrefixFilterWithContext(context.Background(), getTransitGatewayConnectionPrefixFilterOptions) + err = core.RepurposeSDKProblem(err, "") + return } // GetTransitGatewayConnectionPrefixFilterWithContext is an alternate form of the GetTransitGatewayConnectionPrefixFilter method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayConnectionPrefixFilterWithContext(ctx context.Context, getTransitGatewayConnectionPrefixFilterOptions *GetTransitGatewayConnectionPrefixFilterOptions) (result *PrefixFilterCust, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(getTransitGatewayConnectionPrefixFilterOptions, "getTransitGatewayConnectionPrefixFilterOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(getTransitGatewayConnectionPrefixFilterOptions, "getTransitGatewayConnectionPrefixFilterOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1769,15 +1926,16 @@ func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayConnectionPrefi builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/connections/{id}/prefix_filters/{filter_id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range getTransitGatewayConnectionPrefixFilterOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "GetTransitGatewayConnectionPrefixFilter") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "GetTransitGatewayConnectionPrefixFilter") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range getTransitGatewayConnectionPrefixFilterOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -1786,17 +1944,21 @@ func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayConnectionPrefi request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "get_transit_gateway_connection_prefix_filter", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPrefixFilterCust) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -1808,17 +1970,21 @@ func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayConnectionPrefi // UpdateTransitGatewayConnectionPrefixFilter : Updates specified Transit Gateway connection prefix filter // Update prefix filter for a Transit Gateway Connection. func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayConnectionPrefixFilter(updateTransitGatewayConnectionPrefixFilterOptions *UpdateTransitGatewayConnectionPrefixFilterOptions) (result *PrefixFilterCust, response *core.DetailedResponse, err error) { - return transitGatewayApis.UpdateTransitGatewayConnectionPrefixFilterWithContext(context.Background(), updateTransitGatewayConnectionPrefixFilterOptions) + result, response, err = transitGatewayApis.UpdateTransitGatewayConnectionPrefixFilterWithContext(context.Background(), updateTransitGatewayConnectionPrefixFilterOptions) + err = core.RepurposeSDKProblem(err, "") + return } // UpdateTransitGatewayConnectionPrefixFilterWithContext is an alternate form of the UpdateTransitGatewayConnectionPrefixFilter method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayConnectionPrefixFilterWithContext(ctx context.Context, updateTransitGatewayConnectionPrefixFilterOptions *UpdateTransitGatewayConnectionPrefixFilterOptions) (result *PrefixFilterCust, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(updateTransitGatewayConnectionPrefixFilterOptions, "updateTransitGatewayConnectionPrefixFilterOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(updateTransitGatewayConnectionPrefixFilterOptions, "updateTransitGatewayConnectionPrefixFilterOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1833,15 +1999,16 @@ func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayConnectionPr builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/connections/{id}/prefix_filters/{filter_id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range updateTransitGatewayConnectionPrefixFilterOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "UpdateTransitGatewayConnectionPrefixFilter") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "UpdateTransitGatewayConnectionPrefixFilter") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range updateTransitGatewayConnectionPrefixFilterOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -1867,22 +2034,27 @@ func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayConnectionPr } _, err = builder.SetBodyContentJSON(body) if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "update_transit_gateway_connection_prefix_filter", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalPrefixFilterCust) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -1895,17 +2067,21 @@ func (transitGatewayApis *TransitGatewayApisV1) UpdateTransitGatewayConnectionPr // Retrieve all route reports for the specified Transit Gateway. There will normally be at most one completed report // and one pending report. Additionally, completed route reports are written to IBM Cloud Activity Tracker. func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayRouteReports(listTransitGatewayRouteReportsOptions *ListTransitGatewayRouteReportsOptions) (result *RouteReportCollection, response *core.DetailedResponse, err error) { - return transitGatewayApis.ListTransitGatewayRouteReportsWithContext(context.Background(), listTransitGatewayRouteReportsOptions) + result, response, err = transitGatewayApis.ListTransitGatewayRouteReportsWithContext(context.Background(), listTransitGatewayRouteReportsOptions) + err = core.RepurposeSDKProblem(err, "") + return } // ListTransitGatewayRouteReportsWithContext is an alternate form of the ListTransitGatewayRouteReports method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayRouteReportsWithContext(ctx context.Context, listTransitGatewayRouteReportsOptions *ListTransitGatewayRouteReportsOptions) (result *RouteReportCollection, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(listTransitGatewayRouteReportsOptions, "listTransitGatewayRouteReportsOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(listTransitGatewayRouteReportsOptions, "listTransitGatewayRouteReportsOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1918,15 +2094,16 @@ func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayRouteReportsWi builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/route_reports`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range listTransitGatewayRouteReportsOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "ListTransitGatewayRouteReports") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "ListTransitGatewayRouteReports") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range listTransitGatewayRouteReportsOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -1935,17 +2112,21 @@ func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayRouteReportsWi request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "list_transit_gateway_route_reports", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRouteReportCollection) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -1958,17 +2139,21 @@ func (transitGatewayApis *TransitGatewayApisV1) ListTransitGatewayRouteReportsWi // Request route report generation. While report generation is in progress, additional requests to generate a report // are ignored and return the current pending report. func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayRouteReport(createTransitGatewayRouteReportOptions *CreateTransitGatewayRouteReportOptions) (result *RouteReport, response *core.DetailedResponse, err error) { - return transitGatewayApis.CreateTransitGatewayRouteReportWithContext(context.Background(), createTransitGatewayRouteReportOptions) + result, response, err = transitGatewayApis.CreateTransitGatewayRouteReportWithContext(context.Background(), createTransitGatewayRouteReportOptions) + err = core.RepurposeSDKProblem(err, "") + return } // CreateTransitGatewayRouteReportWithContext is an alternate form of the CreateTransitGatewayRouteReport method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayRouteReportWithContext(ctx context.Context, createTransitGatewayRouteReportOptions *CreateTransitGatewayRouteReportOptions) (result *RouteReport, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(createTransitGatewayRouteReportOptions, "createTransitGatewayRouteReportOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(createTransitGatewayRouteReportOptions, "createTransitGatewayRouteReportOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -1981,15 +2166,16 @@ func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayRouteReportW builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/route_reports`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range createTransitGatewayRouteReportOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "CreateTransitGatewayRouteReport") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "CreateTransitGatewayRouteReport") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range createTransitGatewayRouteReportOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -1998,17 +2184,21 @@ func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayRouteReportW request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "create_transit_gateway_route_report", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRouteReport) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -2020,17 +2210,21 @@ func (transitGatewayApis *TransitGatewayApisV1) CreateTransitGatewayRouteReportW // DeleteTransitGatewayRouteReport : Deletes a route report // Delete a route report. func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayRouteReport(deleteTransitGatewayRouteReportOptions *DeleteTransitGatewayRouteReportOptions) (response *core.DetailedResponse, err error) { - return transitGatewayApis.DeleteTransitGatewayRouteReportWithContext(context.Background(), deleteTransitGatewayRouteReportOptions) + response, err = transitGatewayApis.DeleteTransitGatewayRouteReportWithContext(context.Background(), deleteTransitGatewayRouteReportOptions) + err = core.RepurposeSDKProblem(err, "") + return } // DeleteTransitGatewayRouteReportWithContext is an alternate form of the DeleteTransitGatewayRouteReport method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayRouteReportWithContext(ctx context.Context, deleteTransitGatewayRouteReportOptions *DeleteTransitGatewayRouteReportOptions) (response *core.DetailedResponse, err error) { err = core.ValidateNotNil(deleteTransitGatewayRouteReportOptions, "deleteTransitGatewayRouteReportOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(deleteTransitGatewayRouteReportOptions, "deleteTransitGatewayRouteReportOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -2044,15 +2238,16 @@ func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayRouteReportW builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/route_reports/{id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range deleteTransitGatewayRouteReportOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "DeleteTransitGatewayRouteReport") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "DeleteTransitGatewayRouteReport") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range deleteTransitGatewayRouteReportOptions.Headers { builder.AddHeader(headerName, headerValue) } @@ -2060,10 +2255,16 @@ func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayRouteReportW request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } response, err = transitGatewayApis.Service.Request(request, nil) + if err != nil { + core.EnrichHTTPProblem(err, "delete_transit_gateway_route_report", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } return } @@ -2071,17 +2272,21 @@ func (transitGatewayApis *TransitGatewayApisV1) DeleteTransitGatewayRouteReportW // GetTransitGatewayRouteReport : Retrieves a route report // Retrieve a route report. func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayRouteReport(getTransitGatewayRouteReportOptions *GetTransitGatewayRouteReportOptions) (result *RouteReport, response *core.DetailedResponse, err error) { - return transitGatewayApis.GetTransitGatewayRouteReportWithContext(context.Background(), getTransitGatewayRouteReportOptions) + result, response, err = transitGatewayApis.GetTransitGatewayRouteReportWithContext(context.Background(), getTransitGatewayRouteReportOptions) + err = core.RepurposeSDKProblem(err, "") + return } // GetTransitGatewayRouteReportWithContext is an alternate form of the GetTransitGatewayRouteReport method which supports a Context parameter func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayRouteReportWithContext(ctx context.Context, getTransitGatewayRouteReportOptions *GetTransitGatewayRouteReportOptions) (result *RouteReport, response *core.DetailedResponse, err error) { err = core.ValidateNotNil(getTransitGatewayRouteReportOptions, "getTransitGatewayRouteReportOptions cannot be nil") if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } err = core.ValidateStruct(getTransitGatewayRouteReportOptions, "getTransitGatewayRouteReportOptions") if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } @@ -2095,15 +2300,16 @@ func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayRouteReportWith builder.EnableGzipCompression = transitGatewayApis.GetEnableGzipCompression() _, err = builder.ResolveRequestURL(transitGatewayApis.Service.Options.URL, `/transit_gateways/{transit_gateway_id}/route_reports/{id}`, pathParamsMap) if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - for headerName, headerValue := range getTransitGatewayRouteReportOptions.Headers { + sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "GetTransitGatewayRouteReport") + for headerName, headerValue := range sdkHeaders { builder.AddHeader(headerName, headerValue) } - sdkHeaders := common.GetSdkHeaders("transit_gateway_apis", "V1", "GetTransitGatewayRouteReport") - for headerName, headerValue := range sdkHeaders { + for headerName, headerValue := range getTransitGatewayRouteReportOptions.Headers { builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") @@ -2112,17 +2318,21 @@ func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayRouteReportWith request, err := builder.Build() if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } var rawResponse map[string]json.RawMessage response, err = transitGatewayApis.Service.Request(request, &rawResponse) if err != nil { + core.EnrichHTTPProblem(err, "get_transit_gateway_route_report", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } if rawResponse != nil { err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRouteReport) if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) return } response.Result = result @@ -2130,6 +2340,9 @@ func (transitGatewayApis *TransitGatewayApisV1) GetTransitGatewayRouteReportWith return } +func getServiceComponentInfo() *core.ProblemComponent { + return core.NewProblemComponent(DefaultServiceName, "__VERSION__") +} // CreateTransitGatewayConnectionActionsOptions : The CreateTransitGatewayConnectionActions options. type CreateTransitGatewayConnectionActionsOptions struct { @@ -2142,7 +2355,7 @@ type CreateTransitGatewayConnectionActionsOptions struct { // The action that is to be performed against the connection request. Action *string `json:"action" validate:"required"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -2305,7 +2518,7 @@ type CreateTransitGatewayConnectionOptions struct { // `redundant_gre` connections. Zone ZoneIdentityIntf `json:"zone,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -2501,7 +2714,7 @@ type CreateTransitGatewayConnectionPrefixFilterOptions struct { // If the `ge` value is non-zero the the `le` value must between the `ge` value and 32, inclusive. Le *int64 `json:"le,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -2604,7 +2817,7 @@ type CreateTransitGatewayGreTunnelOptions struct { // will assign an ASN. RemoteBgpAsn *int64 `json:"remote_bgp_asn,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -2700,7 +2913,7 @@ type CreateTransitGatewayOptions struct { // group](https://console.bluemix.net/apidocs/resource-manager#introduction) is used. ResourceGroup *ResourceGroupIdentity `json:"resource_group,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -2753,7 +2966,7 @@ type CreateTransitGatewayRouteReportOptions struct { // The Transit Gateway identifier. TransitGatewayID *string `json:"transit_gateway_id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -2784,7 +2997,7 @@ type DeleteTransitGatewayConnectionOptions struct { // The connection identifier. ID *string `json:"id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -2825,7 +3038,7 @@ type DeleteTransitGatewayConnectionPrefixFilterOptions struct { // Prefix filter identifier. FilterID *string `json:"filter_id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -2873,7 +3086,7 @@ type DeleteTransitGatewayConnectionTunnelsOptions struct { // The tunnel identifier. GreTunnelID *string `json:"gre_tunnel_id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -2915,7 +3128,7 @@ type DeleteTransitGatewayOptions struct { // The Transit Gateway identifier. ID *string `json:"id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -2946,7 +3159,7 @@ type DeleteTransitGatewayRouteReportOptions struct { // Route report identifier. ID *string `json:"id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -2981,7 +3194,7 @@ type GetGatewayLocationOptions struct { // The Transit Gateway location Name. Name *string `json:"name" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -3012,7 +3225,7 @@ type GetTransitGatewayConnectionOptions struct { // The connection identifier. ID *string `json:"id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -3053,7 +3266,7 @@ type GetTransitGatewayConnectionPrefixFilterOptions struct { // Prefix filter identifier. FilterID *string `json:"filter_id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -3101,7 +3314,7 @@ type GetTransitGatewayConnectionTunnelsOptions struct { // The tunnel identifier. GreTunnelID *string `json:"gre_tunnel_id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -3143,7 +3356,7 @@ type GetTransitGatewayOptions struct { // The Transit Gateway identifier. ID *string `json:"id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -3174,7 +3387,7 @@ type GetTransitGatewayRouteReportOptions struct { // Route report identifier. ID *string `json:"id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -3218,7 +3431,7 @@ type ListConnectionsOptions struct { // Search for connections with the given network_type value. NetworkType *string `json:"network_type,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -3260,7 +3473,7 @@ func (options *ListConnectionsOptions) SetHeaders(param map[string]string) *List // ListGatewayLocationsOptions : The ListGatewayLocations options. type ListGatewayLocationsOptions struct { - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -3283,7 +3496,7 @@ type ListTransitGatewayConnectionPrefixFiltersOptions struct { // The connection identifier. ID *string `json:"id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -3327,7 +3540,7 @@ type ListTransitGatewayConnectionsOptions struct { // Search for connections with the given name. Name *string `json:"name,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -3376,7 +3589,7 @@ type ListTransitGatewayGreTunnelOptions struct { // The connection identifier. ID *string `json:"id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -3411,7 +3624,7 @@ type ListTransitGatewayRouteReportsOptions struct { // The Transit Gateway identifier. TransitGatewayID *string `json:"transit_gateway_id" validate:"required,ne="` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -3442,7 +3655,7 @@ type ListTransitGatewaysOptions struct { // A server supplied token determining which resource to start the page on. Start *string `json:"start,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -3480,6 +3693,7 @@ func UnmarshalPaginationFirstConnection(m map[string]json.RawMessage, result int obj := new(PaginationFirstConnection) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -3497,6 +3711,7 @@ func UnmarshalPaginationFirstTG(m map[string]json.RawMessage, result interface{} obj := new(PaginationFirstTG) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -3515,6 +3730,7 @@ func UnmarshalPaginationFirstTGWConnection(m map[string]json.RawMessage, result obj := new(PaginationFirstTGWConnection) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -3535,10 +3751,12 @@ func UnmarshalPaginationNextConnection(m map[string]json.RawMessage, result inte obj := new(PaginationNextConnection) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "start", &obj.Start) if err != nil { + err = core.SDKErrorf(err, "", "start-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -3559,10 +3777,12 @@ func UnmarshalPaginationNextTG(m map[string]json.RawMessage, result interface{}) obj := new(PaginationNextTG) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "start", &obj.Start) if err != nil { + err = core.SDKErrorf(err, "", "start-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -3583,10 +3803,12 @@ func UnmarshalPaginationNextTGWConnection(m map[string]json.RawMessage, result i obj := new(PaginationNextTGWConnection) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "start", &obj.Start) if err != nil { + err = core.SDKErrorf(err, "", "start-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -3604,6 +3826,7 @@ func UnmarshalPrefixFilterCollection(m map[string]json.RawMessage, result interf obj := new(PrefixFilterCollection) err = core.UnmarshalModel(m, "prefix_filters", &obj.PrefixFilters, UnmarshalPrefixFilterCust) if err != nil { + err = core.SDKErrorf(err, "", "prefix_filters-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -3668,157 +3891,48 @@ func UnmarshalPrefixFilterCust(m map[string]json.RawMessage, result interface{}) obj := new(PrefixFilterCust) err = core.UnmarshalPrimitive(m, "action", &obj.Action) if err != nil { + err = core.SDKErrorf(err, "", "action-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "before", &obj.Before) if err != nil { + err = core.SDKErrorf(err, "", "before-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "ge", &obj.Ge) if err != nil { + err = core.SDKErrorf(err, "", "ge-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "le", &obj.Le) if err != nil { + err = core.SDKErrorf(err, "", "le-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "prefix", &obj.Prefix) if err != nil { + err = core.SDKErrorf(err, "", "prefix-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) if err != nil { + err = core.SDKErrorf(err, "", "updated_at-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// PrefixFilterPut : A prefix filter update template. -type PrefixFilterPut struct { - // Whether or not this prefix filter should allow or deny prefixes matching this filter's prefix definition. - Action *string `json:"action" validate:"required"` - - // Defines the minimum matched prefix precision. If this field is non-zero then the filter will match all routes within - // the `prefix` that have a prefix length greater or equal to this value. - // - // This value can be zero, or a non-negative number greater than or equal to the prefix length of the filter's prefix - // or less then or equal to 32. If this value is set to zero, the filter will not use the `ge` route matching behavior. - // If the `le` value is non-zero the the `ge` value must between the prefix length and the - // `le` value, inclusive. - Ge *int64 `json:"ge,omitempty"` - - // Defines the maximum matched prefix precision. If this field is non-zero then the filter will match all routes within - // the `prefix` that have a prefix length less than or equal to this value. - // - // This value can be zero, or a non-negative number greater than or equal to the prefix length of the filter's prefix - // or less then or equal to 32. If this value is set to zero, the filter will not use the `le` route matching behavior. - // If the `ge` value is non-zero the the `le` value must between the `ge` value and 32, inclusive. - Le *int64 `json:"le,omitempty"` - - // The IPv4 Prefix to be matched by this filter. If both the `le` and `ge` are zero, then this filter will only apply - // to routes that exactly match this prefix, while a non-zero value for either `le` or `ge`, this filter can apply to - // multiple routes with different prefix lengths, but will still only apply to prefixes contained in the address space - // defined by `prefix`. - Prefix *string `json:"prefix" validate:"required"` -} - -// Constants associated with the PrefixFilterPut.Action property. -// Whether or not this prefix filter should allow or deny prefixes matching this filter's prefix definition. -const ( - PrefixFilterPut_Action_Deny = "deny" - PrefixFilterPut_Action_Permit = "permit" -) - -// NewPrefixFilterPut : Instantiate PrefixFilterPut (Generic Model Constructor) -func (*TransitGatewayApisV1) NewPrefixFilterPut(action string, prefix string) (_model *PrefixFilterPut, err error) { - _model = &PrefixFilterPut{ - Action: core.StringPtr(action), - Prefix: core.StringPtr(prefix), - } - err = core.ValidateStruct(_model, "required parameters") - return -} - -// UnmarshalPrefixFilterPut unmarshals an instance of PrefixFilterPut from the specified map of raw messages. -func UnmarshalPrefixFilterPut(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PrefixFilterPut) - err = core.UnmarshalPrimitive(m, "action", &obj.Action) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "ge", &obj.Ge) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "le", &obj.Le) - if err != nil { - return - } - err = core.UnmarshalPrimitive(m, "prefix", &obj.Prefix) - if err != nil { - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ReplaceTransitGatewayConnectionPrefixFilterOptions : The ReplaceTransitGatewayConnectionPrefixFilter options. -type ReplaceTransitGatewayConnectionPrefixFilterOptions struct { - // The Transit Gateway identifier. - TransitGatewayID *string `json:"transit_gateway_id" validate:"required,ne="` - - // The connection identifier. - ID *string `json:"id" validate:"required,ne="` - - // Array of prefix filters. - PrefixFilters []PrefixFilterPut `json:"prefix_filters" validate:"required"` - - // Allows users to set headers on API requests - Headers map[string]string -} - -// NewReplaceTransitGatewayConnectionPrefixFilterOptions : Instantiate ReplaceTransitGatewayConnectionPrefixFilterOptions -func (*TransitGatewayApisV1) NewReplaceTransitGatewayConnectionPrefixFilterOptions(transitGatewayID string, id string, prefixFilters []PrefixFilterPut) *ReplaceTransitGatewayConnectionPrefixFilterOptions { - return &ReplaceTransitGatewayConnectionPrefixFilterOptions{ - TransitGatewayID: core.StringPtr(transitGatewayID), - ID: core.StringPtr(id), - PrefixFilters: prefixFilters, - } -} - -// SetTransitGatewayID : Allow user to set TransitGatewayID -func (_options *ReplaceTransitGatewayConnectionPrefixFilterOptions) SetTransitGatewayID(transitGatewayID string) *ReplaceTransitGatewayConnectionPrefixFilterOptions { - _options.TransitGatewayID = core.StringPtr(transitGatewayID) - return _options -} - -// SetID : Allow user to set ID -func (_options *ReplaceTransitGatewayConnectionPrefixFilterOptions) SetID(id string) *ReplaceTransitGatewayConnectionPrefixFilterOptions { - _options.ID = core.StringPtr(id) - return _options -} - -// SetPrefixFilters : Allow user to set PrefixFilters -func (_options *ReplaceTransitGatewayConnectionPrefixFilterOptions) SetPrefixFilters(prefixFilters []PrefixFilterPut) *ReplaceTransitGatewayConnectionPrefixFilterOptions { - _options.PrefixFilters = prefixFilters - return _options -} - -// SetHeaders : Allow user to set Headers -func (options *ReplaceTransitGatewayConnectionPrefixFilterOptions) SetHeaders(param map[string]string) *ReplaceTransitGatewayConnectionPrefixFilterOptions { - options.Headers = param - return options -} - // ResourceGroupIdentity : The resource group to use. If unspecified, the account's [default resource // group](https://console.bluemix.net/apidocs/resource-manager#introduction) is used. type ResourceGroupIdentity struct { @@ -3832,6 +3946,9 @@ func (*TransitGatewayApisV1) NewResourceGroupIdentity(id string) (_model *Resour ID: core.StringPtr(id), } err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } return } @@ -3840,6 +3957,7 @@ func UnmarshalResourceGroupIdentity(m map[string]json.RawMessage, result interfa obj := new(ResourceGroupIdentity) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -3861,10 +3979,12 @@ func UnmarshalResourceGroupReference(m map[string]json.RawMessage, result interf obj := new(ResourceGroupReference) err = core.UnmarshalPrimitive(m, "href", &obj.Href) if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -3907,26 +4027,32 @@ func UnmarshalRouteReport(m map[string]json.RawMessage, result interface{}) (err obj := new(RouteReport) err = core.UnmarshalModel(m, "connections", &obj.Connections, UnmarshalRouteReportConnection) if err != nil { + err = core.SDKErrorf(err, "", "connections-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "overlapping_routes", &obj.OverlappingRoutes, UnmarshalRouteReportOverlappingRouteGroup) if err != nil { + err = core.SDKErrorf(err, "", "overlapping_routes-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { + err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) if err != nil { + err = core.SDKErrorf(err, "", "updated_at-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -3944,6 +4070,7 @@ func UnmarshalRouteReportCollection(m map[string]json.RawMessage, result interfa obj := new(RouteReportCollection) err = core.UnmarshalModel(m, "route_reports", &obj.RouteReports, UnmarshalRouteReport) if err != nil { + err = core.SDKErrorf(err, "", "route_reports-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -3973,22 +4100,27 @@ func UnmarshalRouteReportConnection(m map[string]json.RawMessage, result interfa obj := new(RouteReportConnection) err = core.UnmarshalModel(m, "bgps", &obj.Bgps, UnmarshalRouteReportConnectionBgp) if err != nil { + err = core.SDKErrorf(err, "", "bgps-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "routes", &obj.Routes, UnmarshalRouteReportConnectionRoute) if err != nil { + err = core.SDKErrorf(err, "", "routes-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4015,18 +4147,22 @@ func UnmarshalRouteReportConnectionBgp(m map[string]json.RawMessage, result inte obj := new(RouteReportConnectionBgp) err = core.UnmarshalPrimitive(m, "as_path", &obj.AsPath) if err != nil { + err = core.SDKErrorf(err, "", "as_path-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "is_used", &obj.IsUsed) if err != nil { + err = core.SDKErrorf(err, "", "is_used-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "local_preference", &obj.LocalPreference) if err != nil { + err = core.SDKErrorf(err, "", "local_preference-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "prefix", &obj.Prefix) if err != nil { + err = core.SDKErrorf(err, "", "prefix-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4044,6 +4180,7 @@ func UnmarshalRouteReportConnectionRoute(m map[string]json.RawMessage, result in obj := new(RouteReportConnectionRoute) err = core.UnmarshalPrimitive(m, "prefix", &obj.Prefix) if err != nil { + err = core.SDKErrorf(err, "", "prefix-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4064,10 +4201,12 @@ func UnmarshalRouteReportOverlappingRoute(m map[string]json.RawMessage, result i obj := new(RouteReportOverlappingRoute) err = core.UnmarshalPrimitive(m, "connection_id", &obj.ConnectionID) if err != nil { + err = core.SDKErrorf(err, "", "connection_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "prefix", &obj.Prefix) if err != nil { + err = core.SDKErrorf(err, "", "prefix-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4085,6 +4224,7 @@ func UnmarshalRouteReportOverlappingRouteGroup(m map[string]json.RawMessage, res obj := new(RouteReportOverlappingRouteGroup) err = core.UnmarshalModel(m, "routes", &obj.Routes, UnmarshalRouteReportOverlappingRoute) if err != nil { + err = core.SDKErrorf(err, "", "routes-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4102,6 +4242,7 @@ func UnmarshalTSCollection(m map[string]json.RawMessage, result interface{}) (er obj := new(TSCollection) err = core.UnmarshalModel(m, "locations", &obj.Locations, UnmarshalTSLocationBasic) if err != nil { + err = core.SDKErrorf(err, "", "locations-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4139,18 +4280,22 @@ func UnmarshalTSLocalLocation(m map[string]json.RawMessage, result interface{}) obj := new(TSLocalLocation) err = core.UnmarshalPrimitive(m, "display_name", &obj.DisplayName) if err != nil { + err = core.SDKErrorf(err, "", "display_name-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "supported_connection_types", &obj.SupportedConnectionTypes) if err != nil { + err = core.SDKErrorf(err, "", "supported_connection_types-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4180,22 +4325,27 @@ func UnmarshalTSLocation(m map[string]json.RawMessage, result interface{}) (err obj := new(TSLocation) err = core.UnmarshalPrimitive(m, "billing_location", &obj.BillingLocation) if err != nil { + err = core.SDKErrorf(err, "", "billing_location-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "local_connection_locations", &obj.LocalConnectionLocations, UnmarshalTSLocalLocation) if err != nil { + err = core.SDKErrorf(err, "", "local_connection_locations-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "zones", &obj.Zones, UnmarshalZoneReference) if err != nil { + err = core.SDKErrorf(err, "", "zones-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4219,14 +4369,17 @@ func UnmarshalTSLocationBasic(m map[string]json.RawMessage, result interface{}) obj := new(TSLocationBasic) err = core.UnmarshalPrimitive(m, "billing_location", &obj.BillingLocation) if err != nil { + err = core.SDKErrorf(err, "", "billing_location-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "type", &obj.Type) if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4387,94 +4540,117 @@ func UnmarshalTransitConnection(m map[string]json.RawMessage, result interface{} obj := new(TransitConnection) err = core.UnmarshalPrimitive(m, "base_network_type", &obj.BaseNetworkType) if err != nil { + err = core.SDKErrorf(err, "", "base_network_type-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "network_id", &obj.NetworkID) if err != nil { + err = core.SDKErrorf(err, "", "network_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "network_type", &obj.NetworkType) if err != nil { + err = core.SDKErrorf(err, "", "network_type-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "base_connection_id", &obj.BaseConnectionID) if err != nil { + err = core.SDKErrorf(err, "", "base_connection_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "local_bgp_asn", &obj.LocalBgpAsn) if err != nil { + err = core.SDKErrorf(err, "", "local_bgp_asn-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "local_gateway_ip", &obj.LocalGatewayIp) if err != nil { + err = core.SDKErrorf(err, "", "local_gateway_ip-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "local_tunnel_ip", &obj.LocalTunnelIp) if err != nil { + err = core.SDKErrorf(err, "", "local_tunnel_ip-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "mtu", &obj.Mtu) if err != nil { + err = core.SDKErrorf(err, "", "mtu-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "network_account_id", &obj.NetworkAccountID) if err != nil { + err = core.SDKErrorf(err, "", "network_account_id-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "prefix_filters", &obj.PrefixFilters, UnmarshalTransitGatewayConnectionPrefixFilterReference) if err != nil { + err = core.SDKErrorf(err, "", "prefix_filters-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "prefix_filters_default", &obj.PrefixFiltersDefault) if err != nil { + err = core.SDKErrorf(err, "", "prefix_filters_default-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "remote_bgp_asn", &obj.RemoteBgpAsn) if err != nil { + err = core.SDKErrorf(err, "", "remote_bgp_asn-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "remote_gateway_ip", &obj.RemoteGatewayIp) if err != nil { + err = core.SDKErrorf(err, "", "remote_gateway_ip-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "remote_tunnel_ip", &obj.RemoteTunnelIp) if err != nil { + err = core.SDKErrorf(err, "", "remote_tunnel_ip-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "request_status", &obj.RequestStatus) if err != nil { + err = core.SDKErrorf(err, "", "request_status-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { + err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "transit_gateway", &obj.TransitGateway, UnmarshalTransitGatewayReference) if err != nil { + err = core.SDKErrorf(err, "", "transit_gateway-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "tunnels", &obj.Tunnels, UnmarshalTransitGatewayTunnel) if err != nil { + err = core.SDKErrorf(err, "", "tunnels-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) if err != nil { + err = core.SDKErrorf(err, "", "updated_at-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) if err != nil { + err = core.SDKErrorf(err, "", "zone-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4501,18 +4677,22 @@ func UnmarshalTransitConnectionCollection(m map[string]json.RawMessage, result i obj := new(TransitConnectionCollection) err = core.UnmarshalModel(m, "connections", &obj.Connections, UnmarshalTransitConnection) if err != nil { + err = core.SDKErrorf(err, "", "connections-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalPaginationFirstConnection) if err != nil { + err = core.SDKErrorf(err, "", "first-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalPaginationNextConnection) if err != nil { + err = core.SDKErrorf(err, "", "next-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4585,50 +4765,62 @@ func UnmarshalTransitGateway(m map[string]json.RawMessage, result interface{}) ( obj := new(TransitGateway) err = core.UnmarshalPrimitive(m, "connection_count", &obj.ConnectionCount) if err != nil { + err = core.SDKErrorf(err, "", "connection_count-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "connection_needs_attention", &obj.ConnectionNeedsAttention) if err != nil { + err = core.SDKErrorf(err, "", "connection_needs_attention-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "crn", &obj.Crn) if err != nil { + err = core.SDKErrorf(err, "", "crn-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "global", &obj.Global) if err != nil { + err = core.SDKErrorf(err, "", "global-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "gre_enhanced_route_propagation", &obj.GreEnhancedRoutePropagation) if err != nil { + err = core.SDKErrorf(err, "", "gre_enhanced_route_propagation-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "location", &obj.Location) if err != nil { + err = core.SDKErrorf(err, "", "location-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) if err != nil { + err = core.SDKErrorf(err, "", "resource_group-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { + err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) if err != nil { + err = core.SDKErrorf(err, "", "updated_at-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4655,18 +4847,22 @@ func UnmarshalTransitGatewayCollection(m map[string]json.RawMessage, result inte obj := new(TransitGatewayCollection) err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalPaginationFirstTG) if err != nil { + err = core.SDKErrorf(err, "", "first-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalPaginationNextTG) if err != nil { + err = core.SDKErrorf(err, "", "next-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "transit_gateways", &obj.TransitGateways, UnmarshalTransitGateway) if err != nil { + err = core.SDKErrorf(err, "", "transit_gateways-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4706,22 +4902,27 @@ func UnmarshalTransitGatewayConnectionCollection(m map[string]json.RawMessage, r obj := new(TransitGatewayConnectionCollection) err = core.UnmarshalModel(m, "connections", &obj.Connections, UnmarshalTransitGatewayConnectionCust) if err != nil { + err = core.SDKErrorf(err, "", "connections-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalPaginationFirstTGWConnection) if err != nil { + err = core.SDKErrorf(err, "", "first-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalPaginationNextTGWConnection) if err != nil { + err = core.SDKErrorf(err, "", "next-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) if err != nil { + err = core.SDKErrorf(err, "", "total_count-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -4898,94 +5099,117 @@ func UnmarshalTransitGatewayConnectionCust(m map[string]json.RawMessage, result obj := new(TransitGatewayConnectionCust) err = core.UnmarshalPrimitive(m, "base_connection_id", &obj.BaseConnectionID) if err != nil { + err = core.SDKErrorf(err, "", "base_connection_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "base_network_type", &obj.BaseNetworkType) if err != nil { + err = core.SDKErrorf(err, "", "base_network_type-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "cidr", &obj.Cidr) if err != nil { + err = core.SDKErrorf(err, "", "cidr-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "local_bgp_asn", &obj.LocalBgpAsn) if err != nil { + err = core.SDKErrorf(err, "", "local_bgp_asn-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "local_gateway_ip", &obj.LocalGatewayIp) if err != nil { + err = core.SDKErrorf(err, "", "local_gateway_ip-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "local_tunnel_ip", &obj.LocalTunnelIp) if err != nil { + err = core.SDKErrorf(err, "", "local_tunnel_ip-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "mtu", &obj.Mtu) if err != nil { + err = core.SDKErrorf(err, "", "mtu-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "network_account_id", &obj.NetworkAccountID) if err != nil { + err = core.SDKErrorf(err, "", "network_account_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "network_id", &obj.NetworkID) if err != nil { + err = core.SDKErrorf(err, "", "network_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "network_type", &obj.NetworkType) if err != nil { + err = core.SDKErrorf(err, "", "network_type-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "prefix_filters", &obj.PrefixFilters, UnmarshalTransitGatewayConnectionPrefixFilterReference) if err != nil { + err = core.SDKErrorf(err, "", "prefix_filters-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "prefix_filters_default", &obj.PrefixFiltersDefault) if err != nil { + err = core.SDKErrorf(err, "", "prefix_filters_default-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "remote_bgp_asn", &obj.RemoteBgpAsn) if err != nil { + err = core.SDKErrorf(err, "", "remote_bgp_asn-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "remote_gateway_ip", &obj.RemoteGatewayIp) if err != nil { + err = core.SDKErrorf(err, "", "remote_gateway_ip-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "remote_tunnel_ip", &obj.RemoteTunnelIp) if err != nil { + err = core.SDKErrorf(err, "", "remote_tunnel_ip-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "request_status", &obj.RequestStatus) if err != nil { + err = core.SDKErrorf(err, "", "request_status-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { + err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "tunnels", &obj.Tunnels, UnmarshalTransitGatewayTunnel) if err != nil { + err = core.SDKErrorf(err, "", "tunnels-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) if err != nil { + err = core.SDKErrorf(err, "", "updated_at-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) if err != nil { + err = core.SDKErrorf(err, "", "zone-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5021,6 +5245,9 @@ func (*TransitGatewayApisV1) NewTransitGatewayConnectionPrefixFilter(action stri Prefix: core.StringPtr(prefix), } err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } return } @@ -5029,18 +5256,22 @@ func UnmarshalTransitGatewayConnectionPrefixFilter(m map[string]json.RawMessage, obj := new(TransitGatewayConnectionPrefixFilter) err = core.UnmarshalPrimitive(m, "action", &obj.Action) if err != nil { + err = core.SDKErrorf(err, "", "action-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "ge", &obj.Ge) if err != nil { + err = core.SDKErrorf(err, "", "ge-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "le", &obj.Le) if err != nil { + err = core.SDKErrorf(err, "", "le-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "prefix", &obj.Prefix) if err != nil { + err = core.SDKErrorf(err, "", "prefix-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5101,34 +5332,42 @@ func UnmarshalTransitGatewayConnectionPrefixFilterReference(m map[string]json.Ra obj := new(TransitGatewayConnectionPrefixFilterReference) err = core.UnmarshalPrimitive(m, "action", &obj.Action) if err != nil { + err = core.SDKErrorf(err, "", "action-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "before", &obj.Before) if err != nil { + err = core.SDKErrorf(err, "", "before-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "ge", &obj.Ge) if err != nil { + err = core.SDKErrorf(err, "", "ge-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "le", &obj.Le) if err != nil { + err = core.SDKErrorf(err, "", "le-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "prefix", &obj.Prefix) if err != nil { + err = core.SDKErrorf(err, "", "prefix-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) if err != nil { + err = core.SDKErrorf(err, "", "updated_at-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5152,14 +5391,17 @@ func UnmarshalTransitGatewayReference(m map[string]json.RawMessage, result inter obj := new(TransitGatewayReference) err = core.UnmarshalPrimitive(m, "crn", &obj.Crn) if err != nil { + err = core.SDKErrorf(err, "", "crn-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5200,9 +5442,9 @@ type TransitGatewayTunnel struct { // The ID of the network VPC being connected via this connection. NetworkID *string `json:"network_id,omitempty"` - // Remote network BGP ASN. The following ASN values are reserved and unavailable 0, 13884, 36351, 64512-64513, 65100, - // 65200-65234, 65402-65433, 65500 and 4201065000-4201065999. If `remote_bgp_asn` is omitted on create requests, IBM - // will assign an ASN. + // Remote network BGP ASN. The following ASN values are reserved and unavailable 0, 13884, 36351, 64512, 64513, 65100, + // 65200-65234, 65402-65433, 65500, 65516, 65519, 65521, 65531 and 4201065000-4201065999 If `remote_bgp_asn` is omitted + // on create requests, IBM will assign an ASN. RemoteBgpAsn *int64 `json:"remote_bgp_asn" validate:"required"` // Remote gateway IP address. @@ -5228,6 +5470,7 @@ type TransitGatewayTunnel struct { const ( TransitGatewayTunnel_BaseNetworkType_Classic = "classic" TransitGatewayTunnel_BaseNetworkType_Vpc = "vpc" + TransitGatewayTunnel_BaseNetworkType_Vpn = "vpn" ) // Constants associated with the TransitGatewayTunnel.Status property. @@ -5249,66 +5492,82 @@ func UnmarshalTransitGatewayTunnel(m map[string]json.RawMessage, result interfac obj := new(TransitGatewayTunnel) err = core.UnmarshalPrimitive(m, "base_network_type", &obj.BaseNetworkType) if err != nil { + err = core.SDKErrorf(err, "", "base_network_type-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "local_bgp_asn", &obj.LocalBgpAsn) if err != nil { + err = core.SDKErrorf(err, "", "local_bgp_asn-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "local_gateway_ip", &obj.LocalGatewayIp) if err != nil { + err = core.SDKErrorf(err, "", "local_gateway_ip-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "local_tunnel_ip", &obj.LocalTunnelIp) if err != nil { + err = core.SDKErrorf(err, "", "local_tunnel_ip-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "mtu", &obj.Mtu) if err != nil { + err = core.SDKErrorf(err, "", "mtu-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "network_account_id", &obj.NetworkAccountID) if err != nil { + err = core.SDKErrorf(err, "", "network_account_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "network_id", &obj.NetworkID) if err != nil { + err = core.SDKErrorf(err, "", "network_id-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "remote_bgp_asn", &obj.RemoteBgpAsn) if err != nil { + err = core.SDKErrorf(err, "", "remote_bgp_asn-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "remote_gateway_ip", &obj.RemoteGatewayIp) if err != nil { + err = core.SDKErrorf(err, "", "remote_gateway_ip-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "remote_tunnel_ip", &obj.RemoteTunnelIp) if err != nil { + err = core.SDKErrorf(err, "", "remote_tunnel_ip-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "status", &obj.Status) if err != nil { + err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "updated_at", &obj.UpdatedAt) if err != nil { + err = core.SDKErrorf(err, "", "updated_at-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneReference) if err != nil { + err = core.SDKErrorf(err, "", "zone-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5326,6 +5585,7 @@ func UnmarshalTransitGatewayTunnelCollection(m map[string]json.RawMessage, resul obj := new(TransitGatewayTunnelCollection) err = core.UnmarshalModel(m, "tunnels", &obj.Tunnels, UnmarshalTransitGatewayTunnel) if err != nil { + err = core.SDKErrorf(err, "", "tunnels-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5343,6 +5603,7 @@ func UnmarshalTransitGatewayTunnelPatch(m map[string]json.RawMessage, result int obj := new(TransitGatewayTunnelPatch) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5351,11 +5612,11 @@ func UnmarshalTransitGatewayTunnelPatch(m map[string]json.RawMessage, result int // AsPatch returns a generic map representation of the TransitGatewayTunnelPatch func (transitGatewayTunnelPatch *TransitGatewayTunnelPatch) AsPatch() (_patch map[string]interface{}, err error) { - var jsonData []byte - jsonData, err = json.Marshal(transitGatewayTunnelPatch) - if err == nil { - err = json.Unmarshal(jsonData, &_patch) + _patch = map[string]interface{}{} + if !core.IsNil(transitGatewayTunnelPatch.Name) { + _patch["name"] = transitGatewayTunnelPatch.Name } + return } @@ -5399,6 +5660,9 @@ func (*TransitGatewayApisV1) NewTransitGatewayTunnelTemplate(localGatewayIp stri Zone: zone, } err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } return } @@ -5407,30 +5671,37 @@ func UnmarshalTransitGatewayTunnelTemplate(m map[string]json.RawMessage, result obj := new(TransitGatewayTunnelTemplate) err = core.UnmarshalPrimitive(m, "local_gateway_ip", &obj.LocalGatewayIp) if err != nil { + err = core.SDKErrorf(err, "", "local_gateway_ip-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "local_tunnel_ip", &obj.LocalTunnelIp) if err != nil { + err = core.SDKErrorf(err, "", "local_tunnel_ip-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "remote_bgp_asn", &obj.RemoteBgpAsn) if err != nil { + err = core.SDKErrorf(err, "", "remote_bgp_asn-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "remote_gateway_ip", &obj.RemoteGatewayIp) if err != nil { + err = core.SDKErrorf(err, "", "remote_gateway_ip-error", common.GetComponentInfo()) return } err = core.UnmarshalPrimitive(m, "remote_tunnel_ip", &obj.RemoteTunnelIp) if err != nil { + err = core.SDKErrorf(err, "", "remote_tunnel_ip-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) if err != nil { + err = core.SDKErrorf(err, "", "zone-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5453,7 +5724,7 @@ type UpdateTransitGatewayConnectionOptions struct { // Default setting of permit or deny which applies to any routes that don't match a specified filter. PrefixFiltersDefault *string `json:"prefix_filters_default,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -5544,7 +5815,7 @@ type UpdateTransitGatewayConnectionPrefixFilterOptions struct { // The IPv4 Prefix to be matched by this filter. Prefix *string `json:"prefix,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -5632,7 +5903,7 @@ type UpdateTransitGatewayConnectionTunnelsOptions struct { // The update connection tunnel template. TransitGatewayTunnelPatch map[string]interface{} `json:"TransitGatewayTunnel_patch" validate:"required"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -5690,7 +5961,7 @@ type UpdateTransitGatewayOptions struct { // A human readable name for a resource. Name *string `json:"name,omitempty"` - // Allows users to set headers on API requests + // Allows users to set headers on API requests. Headers map[string]string } @@ -5752,6 +6023,7 @@ func UnmarshalZoneIdentity(m map[string]json.RawMessage, result interface{}) (er obj := new(ZoneIdentity) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5769,6 +6041,7 @@ func UnmarshalZoneReference(m map[string]json.RawMessage, result interface{}) (e obj := new(ZoneReference) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5791,6 +6064,7 @@ func UnmarshalZoneIdentityByName(m map[string]json.RawMessage, result interface{ obj := new(ZoneIdentityByName) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -5810,7 +6084,7 @@ type TransitGatewaysPager struct { // NewTransitGatewaysPager returns a new TransitGatewaysPager instance. func (transitGatewayApis *TransitGatewayApisV1) NewTransitGatewaysPager(options *ListTransitGatewaysOptions) (pager *TransitGatewaysPager, err error) { if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") + err = core.SDKErrorf(nil, "the 'options.Start' field should not be set", "no-query-setting", common.GetComponentInfo()) return } @@ -5838,6 +6112,7 @@ func (pager *TransitGatewaysPager) GetNextWithContext(ctx context.Context) (page result, _, err := pager.client.ListTransitGatewaysWithContext(ctx, pager.options) if err != nil { + err = core.RepurposeSDKProblem(err, "error-getting-next-page") return } @@ -5859,6 +6134,7 @@ func (pager *TransitGatewaysPager) GetAllWithContext(ctx context.Context) (allIt var nextPage []TransitGateway nextPage, err = pager.GetNextWithContext(ctx) if err != nil { + err = core.RepurposeSDKProblem(err, "error-getting-next-page") return } allItems = append(allItems, nextPage...) @@ -5868,12 +6144,16 @@ func (pager *TransitGatewaysPager) GetAllWithContext(ctx context.Context) (allIt // GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. func (pager *TransitGatewaysPager) GetNext() (page []TransitGateway, err error) { - return pager.GetNextWithContext(context.Background()) + page, err = pager.GetNextWithContext(context.Background()) + err = core.RepurposeSDKProblem(err, "") + return } // GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. func (pager *TransitGatewaysPager) GetAll() (allItems []TransitGateway, err error) { - return pager.GetAllWithContext(context.Background()) + allItems, err = pager.GetAllWithContext(context.Background()) + err = core.RepurposeSDKProblem(err, "") + return } // ConnectionsPager can be used to simplify the use of the "ListConnections" method. @@ -5889,7 +6169,7 @@ type ConnectionsPager struct { // NewConnectionsPager returns a new ConnectionsPager instance. func (transitGatewayApis *TransitGatewayApisV1) NewConnectionsPager(options *ListConnectionsOptions) (pager *ConnectionsPager, err error) { if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") + err = core.SDKErrorf(nil, "the 'options.Start' field should not be set", "no-query-setting", common.GetComponentInfo()) return } @@ -5917,6 +6197,7 @@ func (pager *ConnectionsPager) GetNextWithContext(ctx context.Context) (page []T result, _, err := pager.client.ListConnectionsWithContext(ctx, pager.options) if err != nil { + err = core.RepurposeSDKProblem(err, "error-getting-next-page") return } @@ -5938,6 +6219,7 @@ func (pager *ConnectionsPager) GetAllWithContext(ctx context.Context) (allItems var nextPage []TransitConnection nextPage, err = pager.GetNextWithContext(ctx) if err != nil { + err = core.RepurposeSDKProblem(err, "error-getting-next-page") return } allItems = append(allItems, nextPage...) @@ -5947,12 +6229,16 @@ func (pager *ConnectionsPager) GetAllWithContext(ctx context.Context) (allItems // GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. func (pager *ConnectionsPager) GetNext() (page []TransitConnection, err error) { - return pager.GetNextWithContext(context.Background()) + page, err = pager.GetNextWithContext(context.Background()) + err = core.RepurposeSDKProblem(err, "") + return } // GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. func (pager *ConnectionsPager) GetAll() (allItems []TransitConnection, err error) { - return pager.GetAllWithContext(context.Background()) + allItems, err = pager.GetAllWithContext(context.Background()) + err = core.RepurposeSDKProblem(err, "") + return } // TransitGatewayConnectionsPager can be used to simplify the use of the "ListTransitGatewayConnections" method. @@ -5968,7 +6254,7 @@ type TransitGatewayConnectionsPager struct { // NewTransitGatewayConnectionsPager returns a new TransitGatewayConnectionsPager instance. func (transitGatewayApis *TransitGatewayApisV1) NewTransitGatewayConnectionsPager(options *ListTransitGatewayConnectionsOptions) (pager *TransitGatewayConnectionsPager, err error) { if options.Start != nil && *options.Start != "" { - err = fmt.Errorf("the 'options.Start' field should not be set") + err = core.SDKErrorf(nil, "the 'options.Start' field should not be set", "no-query-setting", common.GetComponentInfo()) return } @@ -5996,6 +6282,7 @@ func (pager *TransitGatewayConnectionsPager) GetNextWithContext(ctx context.Cont result, _, err := pager.client.ListTransitGatewayConnectionsWithContext(ctx, pager.options) if err != nil { + err = core.RepurposeSDKProblem(err, "error-getting-next-page") return } @@ -6017,6 +6304,7 @@ func (pager *TransitGatewayConnectionsPager) GetAllWithContext(ctx context.Conte var nextPage []TransitGatewayConnectionCust nextPage, err = pager.GetNextWithContext(ctx) if err != nil { + err = core.RepurposeSDKProblem(err, "error-getting-next-page") return } allItems = append(allItems, nextPage...) @@ -6026,10 +6314,14 @@ func (pager *TransitGatewayConnectionsPager) GetAllWithContext(ctx context.Conte // GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. func (pager *TransitGatewayConnectionsPager) GetNext() (page []TransitGatewayConnectionCust, err error) { - return pager.GetNextWithContext(context.Background()) + page, err = pager.GetNextWithContext(context.Background()) + err = core.RepurposeSDKProblem(err, "") + return } // GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. func (pager *TransitGatewayConnectionsPager) GetAll() (allItems []TransitGatewayConnectionCust, err error) { - return pager.GetAllWithContext(context.Background()) + allItems, err = pager.GetAllWithContext(context.Background()) + err = core.RepurposeSDKProblem(err, "") + return } diff --git a/vendor/github.com/IBM/platform-services-go-sdk/common/version.go b/vendor/github.com/IBM/platform-services-go-sdk/common/version.go index 960e3191513..6ec06b79e72 100644 --- a/vendor/github.com/IBM/platform-services-go-sdk/common/version.go +++ b/vendor/github.com/IBM/platform-services-go-sdk/common/version.go @@ -17,4 +17,4 @@ package common // Version of the SDK -const Version = "0.86.1" +const Version = "0.91.0" diff --git a/vendor/github.com/IBM/platform-services-go-sdk/iamidentityv1/iam_identity_v1.go b/vendor/github.com/IBM/platform-services-go-sdk/iamidentityv1/iam_identity_v1.go index 7a0cfc7f283..22c126e0f19 100644 --- a/vendor/github.com/IBM/platform-services-go-sdk/iamidentityv1/iam_identity_v1.go +++ b/vendor/github.com/IBM/platform-services-go-sdk/iamidentityv1/iam_identity_v1.go @@ -15,7 +15,7 @@ */ /* - * IBM OpenAPI SDK Code Generator Version: 3.106.0-09823488-20250707-071701 + * IBM OpenAPI SDK Code Generator Version: 3.107.1-41b0fbd0-20250825-080732 */ // Package iamidentityv1 : Operations and models for the IamIdentityV1 service @@ -3559,6 +3559,9 @@ func (iamIdentity *IamIdentityV1) GetAccountSettingsWithContext(ctx context.Cont if getAccountSettingsOptions.IncludeHistory != nil { builder.AddQuery("include_history", fmt.Sprint(*getAccountSettingsOptions.IncludeHistory)) } + if getAccountSettingsOptions.ResolveUserMfa != nil { + builder.AddQuery("resolve_user_mfa", fmt.Sprint(*getAccountSettingsOptions.ResolveUserMfa)) + } request, err := builder.Build() if err != nil { @@ -3665,6 +3668,12 @@ func (iamIdentity *IamIdentityV1) UpdateAccountSettingsWithContext(ctx context.C if updateAccountSettingsOptions.SystemRefreshTokenExpirationInSeconds != nil { body["system_refresh_token_expiration_in_seconds"] = updateAccountSettingsOptions.SystemRefreshTokenExpirationInSeconds } + if updateAccountSettingsOptions.RestrictUserListVisibility != nil { + body["restrict_user_list_visibility"] = updateAccountSettingsOptions.RestrictUserListVisibility + } + if updateAccountSettingsOptions.RestrictUserDomains != nil { + body["restrict_user_domains"] = updateAccountSettingsOptions.RestrictUserDomains + } _, err = builder.SetBodyContentJSON(body) if err != nil { err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) @@ -6729,206 +6738,35 @@ func UnmarshalAccountBasedMfaEnrollment(m map[string]json.RawMessage, result int return } -// AccountSettingsAccountSection : AccountSettingsAccountSection struct -type AccountSettingsAccountSection struct { - // Unique ID of the account. - AccountID *string `json:"account_id,omitempty"` - - // Defines whether or not creating a service ID is access controlled. Valid values: - // * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service - // IDs, including the account owner - // * NOT_RESTRICTED - all members of an account can create service IDs - // * NOT_SET - to 'unset' a previous set value. - RestrictCreateServiceID *string `json:"restrict_create_service_id,omitempty"` - - // Defines whether or not creating platform API keys is access controlled. Valid values: - // * RESTRICTED - to apply access control - // * NOT_RESTRICTED - to remove access control - // * NOT_SET - to 'unset' a previous set value. - RestrictCreatePlatformApikey *string `json:"restrict_create_platform_apikey,omitempty"` - - // Defines the IP addresses and subnets from which IAM tokens can be created for the account. - AllowedIPAddresses *string `json:"allowed_ip_addresses,omitempty"` - - // Defines the MFA requirement for the user. Valid values: - // * NONE - No MFA trait set - // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password - // * TOTP - For all non-federated IBMId users - // * TOTP4ALL - For all users - // * LEVEL1 - Email-based MFA for all users - // * LEVEL2 - TOTP-based MFA for all users - // * LEVEL3 - U2F MFA for all users. - Mfa *string `json:"mfa,omitempty"` - - // List of users that are exempted from the MFA requirement of the account. - UserMfa []EffectiveAccountSettingsUserMfa `json:"user_mfa,omitempty"` - - // History of the Account Settings. - History []EnityHistoryRecord `json:"history,omitempty"` - - // Defines the session expiration in seconds for the account. Valid values: - // * Any whole number between between '900' and '86400' - // * NOT_SET - To unset account setting and use service default. - SessionExpirationInSeconds *string `json:"session_expiration_in_seconds,omitempty"` - - // Defines the period of time in seconds in which a session will be invalidated due to inactivity. Valid values: - // * Any whole number between '900' and '7200' - // * NOT_SET - To unset account setting and use service default. - SessionInvalidationInSeconds *string `json:"session_invalidation_in_seconds,omitempty"` - - // Defines the max allowed sessions per identity required by the account. Valid values: - // * Any whole number greater than 0 - // * NOT_SET - To unset account setting and use service default. - MaxSessionsPerIdentity *string `json:"max_sessions_per_identity,omitempty"` - - // Defines the access token expiration in seconds. Valid values: - // * Any whole number between '900' and '3600' - // * NOT_SET - To unset account setting and use service default. - SystemAccessTokenExpirationInSeconds *string `json:"system_access_token_expiration_in_seconds,omitempty"` - - // Defines the refresh token expiration in seconds. Valid values: - // * Any whole number between '900' and '259200' - // * NOT_SET - To unset account setting and use service default. - SystemRefreshTokenExpirationInSeconds *string `json:"system_refresh_token_expiration_in_seconds,omitempty"` -} - -// Constants associated with the AccountSettingsAccountSection.RestrictCreateServiceID property. -// Defines whether or not creating a service ID is access controlled. Valid values: -// * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service -// IDs, including the account owner -// * NOT_RESTRICTED - all members of an account can create service IDs -// * NOT_SET - to 'unset' a previous set value. -const ( - AccountSettingsAccountSectionRestrictCreateServiceIDNotRestrictedConst = "NOT_RESTRICTED" - AccountSettingsAccountSectionRestrictCreateServiceIDNotSetConst = "NOT_SET" - AccountSettingsAccountSectionRestrictCreateServiceIDRestrictedConst = "RESTRICTED" -) - -// Constants associated with the AccountSettingsAccountSection.RestrictCreatePlatformApikey property. -// Defines whether or not creating platform API keys is access controlled. Valid values: -// * RESTRICTED - to apply access control -// * NOT_RESTRICTED - to remove access control -// * NOT_SET - to 'unset' a previous set value. -const ( - AccountSettingsAccountSectionRestrictCreatePlatformApikeyNotRestrictedConst = "NOT_RESTRICTED" - AccountSettingsAccountSectionRestrictCreatePlatformApikeyNotSetConst = "NOT_SET" - AccountSettingsAccountSectionRestrictCreatePlatformApikeyRestrictedConst = "RESTRICTED" -) - -// Constants associated with the AccountSettingsAccountSection.Mfa property. -// Defines the MFA requirement for the user. Valid values: -// * NONE - No MFA trait set -// * NONE_NO_ROPC- No MFA, disable CLI logins with only a password -// * TOTP - For all non-federated IBMId users -// * TOTP4ALL - For all users -// * LEVEL1 - Email-based MFA for all users -// * LEVEL2 - TOTP-based MFA for all users -// * LEVEL3 - U2F MFA for all users. -const ( - AccountSettingsAccountSectionMfaLevel1Const = "LEVEL1" - AccountSettingsAccountSectionMfaLevel2Const = "LEVEL2" - AccountSettingsAccountSectionMfaLevel3Const = "LEVEL3" - AccountSettingsAccountSectionMfaNoneConst = "NONE" - AccountSettingsAccountSectionMfaNoneNoRopcConst = "NONE_NO_ROPC" - AccountSettingsAccountSectionMfaTotpConst = "TOTP" - AccountSettingsAccountSectionMfaTotp4allConst = "TOTP4ALL" -) - -// UnmarshalAccountSettingsAccountSection unmarshals an instance of AccountSettingsAccountSection from the specified map of raw messages. -func UnmarshalAccountSettingsAccountSection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(AccountSettingsAccountSection) - err = core.UnmarshalPrimitive(m, "account_id", &obj.AccountID) - if err != nil { - err = core.SDKErrorf(err, "", "account_id-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "restrict_create_service_id", &obj.RestrictCreateServiceID) - if err != nil { - err = core.SDKErrorf(err, "", "restrict_create_service_id-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "restrict_create_platform_apikey", &obj.RestrictCreatePlatformApikey) - if err != nil { - err = core.SDKErrorf(err, "", "restrict_create_platform_apikey-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "allowed_ip_addresses", &obj.AllowedIPAddresses) - if err != nil { - err = core.SDKErrorf(err, "", "allowed_ip_addresses-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "mfa", &obj.Mfa) - if err != nil { - err = core.SDKErrorf(err, "", "mfa-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "user_mfa", &obj.UserMfa, UnmarshalEffectiveAccountSettingsUserMfa) - if err != nil { - err = core.SDKErrorf(err, "", "user_mfa-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "history", &obj.History, UnmarshalEnityHistoryRecord) - if err != nil { - err = core.SDKErrorf(err, "", "history-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "session_expiration_in_seconds", &obj.SessionExpirationInSeconds) - if err != nil { - err = core.SDKErrorf(err, "", "session_expiration_in_seconds-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "session_invalidation_in_seconds", &obj.SessionInvalidationInSeconds) - if err != nil { - err = core.SDKErrorf(err, "", "session_invalidation_in_seconds-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "max_sessions_per_identity", &obj.MaxSessionsPerIdentity) - if err != nil { - err = core.SDKErrorf(err, "", "max_sessions_per_identity-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "system_access_token_expiration_in_seconds", &obj.SystemAccessTokenExpirationInSeconds) - if err != nil { - err = core.SDKErrorf(err, "", "system_access_token_expiration_in_seconds-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "system_refresh_token_expiration_in_seconds", &obj.SystemRefreshTokenExpirationInSeconds) - if err != nil { - err = core.SDKErrorf(err, "", "system_refresh_token_expiration_in_seconds-error", common.GetComponentInfo()) - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AccountSettingsAssignedTemplatesSection : AccountSettingsAssignedTemplatesSection struct +// AccountSettingsAssignedTemplatesSection : Input body parameters for the Account Settings REST request. type AccountSettingsAssignedTemplatesSection struct { // Template Id. - TemplateID *string `json:"template_id,omitempty"` + TemplateID *string `json:"template_id" validate:"required"` // Template version. - TemplateVersion *int64 `json:"template_version,omitempty"` + TemplateVersion *int64 `json:"template_version" validate:"required"` // Template name. - TemplateName *string `json:"template_name,omitempty"` + TemplateName *string `json:"template_name" validate:"required"` - // Defines whether or not creating a service ID is access controlled. Valid values: + // Defines whether or not creating the resource is access controlled. Valid values: // * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service // IDs, including the account owner // * NOT_RESTRICTED - all members of an account can create service IDs // * NOT_SET - to 'unset' a previous set value. RestrictCreateServiceID *string `json:"restrict_create_service_id,omitempty"` - // Defines whether or not creating platform API keys is access controlled. Valid values: - // * RESTRICTED - to apply access control - // * NOT_RESTRICTED - to remove access control + // Defines whether or not creating the resource is access controlled. Valid values: + // * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service + // IDs, including the account owner + // * NOT_RESTRICTED - all members of an account can create service IDs // * NOT_SET - to 'unset' a previous set value. RestrictCreatePlatformApikey *string `json:"restrict_create_platform_apikey,omitempty"` // Defines the IP addresses and subnets from which IAM tokens can be created for the account. AllowedIPAddresses *string `json:"allowed_ip_addresses,omitempty"` - // Defines the MFA requirement for the user. Valid values: + // MFA trait definitions as follows: // * NONE - No MFA trait set // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password // * TOTP - For all non-federated IBMId users @@ -6938,9 +6776,6 @@ type AccountSettingsAssignedTemplatesSection struct { // * LEVEL3 - U2F MFA for all users. Mfa *string `json:"mfa,omitempty"` - // List of users that are exempted from the MFA requirement of the account. - UserMfa []EffectiveAccountSettingsUserMfa `json:"user_mfa,omitempty"` - // Defines the session expiration in seconds for the account. Valid values: // * Any whole number between between '900' and '86400' // * NOT_SET - To unset account setting and use service default. @@ -6965,10 +6800,22 @@ type AccountSettingsAssignedTemplatesSection struct { // * Any whole number between '900' and '259200' // * NOT_SET - To unset account setting and use service default. SystemRefreshTokenExpirationInSeconds *string `json:"system_refresh_token_expiration_in_seconds,omitempty"` + + // Defines whether or not user visibility is access controlled. Valid values: + // * RESTRICTED - users can view only specific types of users in the account, such as those the user has invited to + // the account, or descendants of those users based on the classic infrastructure hierarchy + // * NOT_RESTRICTED - any user in the account can view other users from the Users page in IBM Cloud console + // * NOT_SET - to 'unset' a previous set value. + RestrictUserListVisibility *string `json:"restrict_user_list_visibility,omitempty"` + + // List of users that are exempted from the MFA requirement of the account. + UserMfa []AccountSettingsUserMfaResponse `json:"user_mfa,omitempty"` + + RestrictUserDomains *AssignedTemplatesAccountSettingsRestrictUserDomains `json:"restrict_user_domains,omitempty"` } // Constants associated with the AccountSettingsAssignedTemplatesSection.RestrictCreateServiceID property. -// Defines whether or not creating a service ID is access controlled. Valid values: +// Defines whether or not creating the resource is access controlled. Valid values: // * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service // IDs, including the account owner // * NOT_RESTRICTED - all members of an account can create service IDs @@ -6980,9 +6827,10 @@ const ( ) // Constants associated with the AccountSettingsAssignedTemplatesSection.RestrictCreatePlatformApikey property. -// Defines whether or not creating platform API keys is access controlled. Valid values: -// * RESTRICTED - to apply access control -// * NOT_RESTRICTED - to remove access control +// Defines whether or not creating the resource is access controlled. Valid values: +// * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service +// IDs, including the account owner +// * NOT_RESTRICTED - all members of an account can create service IDs // * NOT_SET - to 'unset' a previous set value. const ( AccountSettingsAssignedTemplatesSectionRestrictCreatePlatformApikeyNotRestrictedConst = "NOT_RESTRICTED" @@ -6991,7 +6839,7 @@ const ( ) // Constants associated with the AccountSettingsAssignedTemplatesSection.Mfa property. -// Defines the MFA requirement for the user. Valid values: +// MFA trait definitions as follows: // * NONE - No MFA trait set // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password // * TOTP - For all non-federated IBMId users @@ -7009,6 +6857,18 @@ const ( AccountSettingsAssignedTemplatesSectionMfaTotp4allConst = "TOTP4ALL" ) +// Constants associated with the AccountSettingsAssignedTemplatesSection.RestrictUserListVisibility property. +// Defines whether or not user visibility is access controlled. Valid values: +// * RESTRICTED - users can view only specific types of users in the account, such as those the user has invited to +// the account, or descendants of those users based on the classic infrastructure hierarchy +// * NOT_RESTRICTED - any user in the account can view other users from the Users page in IBM Cloud console +// * NOT_SET - to 'unset' a previous set value. +const ( + AccountSettingsAssignedTemplatesSectionRestrictUserListVisibilityNotRestrictedConst = "NOT_RESTRICTED" + AccountSettingsAssignedTemplatesSectionRestrictUserListVisibilityNotSetConst = "NOT_SET" + AccountSettingsAssignedTemplatesSectionRestrictUserListVisibilityRestrictedConst = "RESTRICTED" +) + // UnmarshalAccountSettingsAssignedTemplatesSection unmarshals an instance of AccountSettingsAssignedTemplatesSection from the specified map of raw messages. func UnmarshalAccountSettingsAssignedTemplatesSection(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(AccountSettingsAssignedTemplatesSection) @@ -7047,11 +6907,6 @@ func UnmarshalAccountSettingsAssignedTemplatesSection(m map[string]json.RawMessa err = core.SDKErrorf(err, "", "mfa-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "user_mfa", &obj.UserMfa, UnmarshalEffectiveAccountSettingsUserMfa) - if err != nil { - err = core.SDKErrorf(err, "", "user_mfa-error", common.GetComponentInfo()) - return - } err = core.UnmarshalPrimitive(m, "session_expiration_in_seconds", &obj.SessionExpirationInSeconds) if err != nil { err = core.SDKErrorf(err, "", "session_expiration_in_seconds-error", common.GetComponentInfo()) @@ -7077,160 +6932,19 @@ func UnmarshalAccountSettingsAssignedTemplatesSection(m map[string]json.RawMessa err = core.SDKErrorf(err, "", "system_refresh_token_expiration_in_seconds-error", common.GetComponentInfo()) return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// AccountSettingsComponent : AccountSettingsComponent struct -type AccountSettingsComponent struct { - // Defines whether or not creating a service ID is access controlled. Valid values: - // * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service - // IDs, including the account owner - // * NOT_RESTRICTED - all members of an account can create service IDs - // * NOT_SET - to 'unset' a previous set value. - RestrictCreateServiceID *string `json:"restrict_create_service_id,omitempty"` - - // Defines whether or not creating platform API keys is access controlled. Valid values: - // * RESTRICTED - to apply access control - // * NOT_RESTRICTED - to remove access control - // * NOT_SET - to 'unset' a previous set value. - RestrictCreatePlatformApikey *string `json:"restrict_create_platform_apikey,omitempty"` - - // Defines the IP addresses and subnets from which IAM tokens can be created for the account. - AllowedIPAddresses *string `json:"allowed_ip_addresses,omitempty"` - - // Defines the MFA trait for the account. Valid values: - // * NONE - No MFA trait set - // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password - // * TOTP - For all non-federated IBMId users - // * TOTP4ALL - For all users - // * LEVEL1 - Email-based MFA for all users - // * LEVEL2 - TOTP-based MFA for all users - // * LEVEL3 - U2F MFA for all users. - Mfa *string `json:"mfa,omitempty"` - - // List of users that are exempted from the MFA requirement of the account. - UserMfa []AccountSettingsUserMfa `json:"user_mfa,omitempty"` - - // Defines the session expiration in seconds for the account. Valid values: - // * Any whole number between between '900' and '86400' - // * NOT_SET - To unset account setting and use service default. - SessionExpirationInSeconds *string `json:"session_expiration_in_seconds,omitempty"` - - // Defines the period of time in seconds in which a session will be invalidated due to inactivity. Valid values: - // * Any whole number between '900' and '7200' - // * NOT_SET - To unset account setting and use service default. - SessionInvalidationInSeconds *string `json:"session_invalidation_in_seconds,omitempty"` - - // Defines the max allowed sessions per identity required by the account. Valid values: - // * Any whole number greater than 0 - // * NOT_SET - To unset account setting and use service default. - MaxSessionsPerIdentity *string `json:"max_sessions_per_identity,omitempty"` - - // Defines the access token expiration in seconds. Valid values: - // * Any whole number between '900' and '3600' - // * NOT_SET - To unset account setting and use service default. - SystemAccessTokenExpirationInSeconds *string `json:"system_access_token_expiration_in_seconds,omitempty"` - - // Defines the refresh token expiration in seconds. Valid values: - // * Any whole number between '900' and '259200' - // * NOT_SET - To unset account setting and use service default. - SystemRefreshTokenExpirationInSeconds *string `json:"system_refresh_token_expiration_in_seconds,omitempty"` -} - -// Constants associated with the AccountSettingsComponent.RestrictCreateServiceID property. -// Defines whether or not creating a service ID is access controlled. Valid values: -// * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service -// IDs, including the account owner -// * NOT_RESTRICTED - all members of an account can create service IDs -// * NOT_SET - to 'unset' a previous set value. -const ( - AccountSettingsComponentRestrictCreateServiceIDNotRestrictedConst = "NOT_RESTRICTED" - AccountSettingsComponentRestrictCreateServiceIDNotSetConst = "NOT_SET" - AccountSettingsComponentRestrictCreateServiceIDRestrictedConst = "RESTRICTED" -) - -// Constants associated with the AccountSettingsComponent.RestrictCreatePlatformApikey property. -// Defines whether or not creating platform API keys is access controlled. Valid values: -// * RESTRICTED - to apply access control -// * NOT_RESTRICTED - to remove access control -// * NOT_SET - to 'unset' a previous set value. -const ( - AccountSettingsComponentRestrictCreatePlatformApikeyNotRestrictedConst = "NOT_RESTRICTED" - AccountSettingsComponentRestrictCreatePlatformApikeyNotSetConst = "NOT_SET" - AccountSettingsComponentRestrictCreatePlatformApikeyRestrictedConst = "RESTRICTED" -) - -// Constants associated with the AccountSettingsComponent.Mfa property. -// Defines the MFA trait for the account. Valid values: -// * NONE - No MFA trait set -// * NONE_NO_ROPC- No MFA, disable CLI logins with only a password -// * TOTP - For all non-federated IBMId users -// * TOTP4ALL - For all users -// * LEVEL1 - Email-based MFA for all users -// * LEVEL2 - TOTP-based MFA for all users -// * LEVEL3 - U2F MFA for all users. -const ( - AccountSettingsComponentMfaLevel1Const = "LEVEL1" - AccountSettingsComponentMfaLevel2Const = "LEVEL2" - AccountSettingsComponentMfaLevel3Const = "LEVEL3" - AccountSettingsComponentMfaNoneConst = "NONE" - AccountSettingsComponentMfaNoneNoRopcConst = "NONE_NO_ROPC" - AccountSettingsComponentMfaTotpConst = "TOTP" - AccountSettingsComponentMfaTotp4allConst = "TOTP4ALL" -) - -// UnmarshalAccountSettingsComponent unmarshals an instance of AccountSettingsComponent from the specified map of raw messages. -func UnmarshalAccountSettingsComponent(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(AccountSettingsComponent) - err = core.UnmarshalPrimitive(m, "restrict_create_service_id", &obj.RestrictCreateServiceID) - if err != nil { - err = core.SDKErrorf(err, "", "restrict_create_service_id-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "restrict_create_platform_apikey", &obj.RestrictCreatePlatformApikey) - if err != nil { - err = core.SDKErrorf(err, "", "restrict_create_platform_apikey-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "allowed_ip_addresses", &obj.AllowedIPAddresses) - if err != nil { - err = core.SDKErrorf(err, "", "allowed_ip_addresses-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "mfa", &obj.Mfa) + err = core.UnmarshalPrimitive(m, "restrict_user_list_visibility", &obj.RestrictUserListVisibility) if err != nil { - err = core.SDKErrorf(err, "", "mfa-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "restrict_user_list_visibility-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "user_mfa", &obj.UserMfa, UnmarshalAccountSettingsUserMfa) + err = core.UnmarshalModel(m, "user_mfa", &obj.UserMfa, UnmarshalAccountSettingsUserMfaResponse) if err != nil { err = core.SDKErrorf(err, "", "user_mfa-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "session_expiration_in_seconds", &obj.SessionExpirationInSeconds) - if err != nil { - err = core.SDKErrorf(err, "", "session_expiration_in_seconds-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "session_invalidation_in_seconds", &obj.SessionInvalidationInSeconds) - if err != nil { - err = core.SDKErrorf(err, "", "session_invalidation_in_seconds-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "max_sessions_per_identity", &obj.MaxSessionsPerIdentity) - if err != nil { - err = core.SDKErrorf(err, "", "max_sessions_per_identity-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "system_access_token_expiration_in_seconds", &obj.SystemAccessTokenExpirationInSeconds) - if err != nil { - err = core.SDKErrorf(err, "", "system_access_token_expiration_in_seconds-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "system_refresh_token_expiration_in_seconds", &obj.SystemRefreshTokenExpirationInSeconds) + err = core.UnmarshalModel(m, "restrict_user_domains", &obj.RestrictUserDomains, UnmarshalAssignedTemplatesAccountSettingsRestrictUserDomains) if err != nil { - err = core.SDKErrorf(err, "", "system_refresh_token_expiration_in_seconds-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "restrict_user_domains-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -7239,23 +6953,30 @@ func UnmarshalAccountSettingsComponent(m map[string]json.RawMessage, result inte // AccountSettingsEffectiveSection : AccountSettingsEffectiveSection struct type AccountSettingsEffectiveSection struct { - // Defines whether or not creating a service ID is access controlled. Valid values: + // Defines whether or not creating the resource is access controlled. Valid values: // * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service // IDs, including the account owner // * NOT_RESTRICTED - all members of an account can create service IDs // * NOT_SET - to 'unset' a previous set value. RestrictCreateServiceID *string `json:"restrict_create_service_id,omitempty"` - // Defines whether or not creating platform API keys is access controlled. Valid values: - // * RESTRICTED - to apply access control - // * NOT_RESTRICTED - to remove access control + // Defines whether or not creating the resource is access controlled. Valid values: + // * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service + // IDs, including the account owner + // * NOT_RESTRICTED - all members of an account can create service IDs // * NOT_SET - to 'unset' a previous set value. RestrictCreatePlatformApikey *string `json:"restrict_create_platform_apikey,omitempty"` + // Defines whether or not user visibility is access controlled. Valid values: + // * RESTRICTED - users can view only specific types of users in the account, such as those the user has invited to + // the account, or descendants of those users based on the classic infrastructure hierarchy + // * NOT_RESTRICTED - any user in the account can view other users from the Users page in IBM Cloud console. + RestrictUserListVisibility *string `json:"restrict_user_list_visibility,omitempty"` + // Defines the IP addresses and subnets from which IAM tokens can be created for the account. AllowedIPAddresses *string `json:"allowed_ip_addresses,omitempty"` - // Defines the MFA requirement for the user. Valid values: + // MFA trait definitions as follows: // * NONE - No MFA trait set // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password // * TOTP - For all non-federated IBMId users @@ -7266,7 +6987,7 @@ type AccountSettingsEffectiveSection struct { Mfa *string `json:"mfa,omitempty"` // List of users that are exempted from the MFA requirement of the account. - UserMfa []EffectiveAccountSettingsUserMfa `json:"user_mfa,omitempty"` + UserMfa []AccountSettingsUserMfaResponse `json:"user_mfa,omitempty"` // Defines the session expiration in seconds for the account. Valid values: // * Any whole number between between '900' and '86400' @@ -7295,7 +7016,7 @@ type AccountSettingsEffectiveSection struct { } // Constants associated with the AccountSettingsEffectiveSection.RestrictCreateServiceID property. -// Defines whether or not creating a service ID is access controlled. Valid values: +// Defines whether or not creating the resource is access controlled. Valid values: // * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service // IDs, including the account owner // * NOT_RESTRICTED - all members of an account can create service IDs @@ -7307,9 +7028,10 @@ const ( ) // Constants associated with the AccountSettingsEffectiveSection.RestrictCreatePlatformApikey property. -// Defines whether or not creating platform API keys is access controlled. Valid values: -// * RESTRICTED - to apply access control -// * NOT_RESTRICTED - to remove access control +// Defines whether or not creating the resource is access controlled. Valid values: +// * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service +// IDs, including the account owner +// * NOT_RESTRICTED - all members of an account can create service IDs // * NOT_SET - to 'unset' a previous set value. const ( AccountSettingsEffectiveSectionRestrictCreatePlatformApikeyNotRestrictedConst = "NOT_RESTRICTED" @@ -7317,8 +7039,18 @@ const ( AccountSettingsEffectiveSectionRestrictCreatePlatformApikeyRestrictedConst = "RESTRICTED" ) +// Constants associated with the AccountSettingsEffectiveSection.RestrictUserListVisibility property. +// Defines whether or not user visibility is access controlled. Valid values: +// * RESTRICTED - users can view only specific types of users in the account, such as those the user has invited to +// the account, or descendants of those users based on the classic infrastructure hierarchy +// * NOT_RESTRICTED - any user in the account can view other users from the Users page in IBM Cloud console. +const ( + AccountSettingsEffectiveSectionRestrictUserListVisibilityNotRestrictedConst = "NOT_RESTRICTED" + AccountSettingsEffectiveSectionRestrictUserListVisibilityRestrictedConst = "RESTRICTED" +) + // Constants associated with the AccountSettingsEffectiveSection.Mfa property. -// Defines the MFA requirement for the user. Valid values: +// MFA trait definitions as follows: // * NONE - No MFA trait set // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password // * TOTP - For all non-federated IBMId users @@ -7349,6 +7081,11 @@ func UnmarshalAccountSettingsEffectiveSection(m map[string]json.RawMessage, resu err = core.SDKErrorf(err, "", "restrict_create_platform_apikey-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "restrict_user_list_visibility", &obj.RestrictUserListVisibility) + if err != nil { + err = core.SDKErrorf(err, "", "restrict_user_list_visibility-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "allowed_ip_addresses", &obj.AllowedIPAddresses) if err != nil { err = core.SDKErrorf(err, "", "allowed_ip_addresses-error", common.GetComponentInfo()) @@ -7359,7 +7096,7 @@ func UnmarshalAccountSettingsEffectiveSection(m map[string]json.RawMessage, resu err = core.SDKErrorf(err, "", "mfa-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "user_mfa", &obj.UserMfa, UnmarshalEffectiveAccountSettingsUserMfa) + err = core.UnmarshalModel(m, "user_mfa", &obj.UserMfa, UnmarshalAccountSettingsUserMfaResponse) if err != nil { err = core.SDKErrorf(err, "", "user_mfa-error", common.GetComponentInfo()) return @@ -7393,7 +7130,7 @@ func UnmarshalAccountSettingsEffectiveSection(m map[string]json.RawMessage, resu return } -// AccountSettingsResponse : Response body format for Account Settings REST requests. +// AccountSettingsResponse : Input body parameters for the Account Settings REST request. type AccountSettingsResponse struct { // Context with key properties for problem determination. Context *ResponseContext `json:"context,omitempty"` @@ -7401,26 +7138,30 @@ type AccountSettingsResponse struct { // Unique ID of the account. AccountID *string `json:"account_id" validate:"required"` - // Defines whether or not creating a service ID is access controlled. Valid values: + // Version of the account settings. + EntityTag *string `json:"entity_tag" validate:"required"` + + // History of the Account Settings. + History []EnityHistoryRecord `json:"history,omitempty"` + + // Defines whether or not creating the resource is access controlled. Valid values: // * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service // IDs, including the account owner // * NOT_RESTRICTED - all members of an account can create service IDs // * NOT_SET - to 'unset' a previous set value. RestrictCreateServiceID *string `json:"restrict_create_service_id" validate:"required"` - // Defines whether or not creating platform API keys is access controlled. Valid values: - // * RESTRICTED - to apply access control - // * NOT_RESTRICTED - to remove access control + // Defines whether or not creating the resource is access controlled. Valid values: + // * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service + // IDs, including the account owner + // * NOT_RESTRICTED - all members of an account can create service IDs // * NOT_SET - to 'unset' a previous set value. RestrictCreatePlatformApikey *string `json:"restrict_create_platform_apikey" validate:"required"` // Defines the IP addresses and subnets from which IAM tokens can be created for the account. AllowedIPAddresses *string `json:"allowed_ip_addresses" validate:"required"` - // Version of the account settings. - EntityTag *string `json:"entity_tag" validate:"required"` - - // Defines the MFA trait for the account. Valid values: + // MFA trait definitions as follows: // * NONE - No MFA trait set // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password // * TOTP - For all non-federated IBMId users @@ -7430,12 +7171,6 @@ type AccountSettingsResponse struct { // * LEVEL3 - U2F MFA for all users. Mfa *string `json:"mfa" validate:"required"` - // List of users that are exempted from the MFA requirement of the account. - UserMfa []AccountSettingsUserMfa `json:"user_mfa" validate:"required"` - - // History of the Account Settings. - History []EnityHistoryRecord `json:"history,omitempty"` - // Defines the session expiration in seconds for the account. Valid values: // * Any whole number between between '900' and '86400' // * NOT_SET - To unset account setting and use service default. @@ -7460,10 +7195,23 @@ type AccountSettingsResponse struct { // * Any whole number between '900' and '259200' // * NOT_SET - To unset account setting and use service default. SystemRefreshTokenExpirationInSeconds *string `json:"system_refresh_token_expiration_in_seconds" validate:"required"` + + // Defines whether or not user visibility is access controlled. Valid values: + // * RESTRICTED - users can view only specific types of users in the account, such as those the user has invited to + // the account, or descendants of those users based on the classic infrastructure hierarchy + // * NOT_RESTRICTED - any user in the account can view other users from the Users page in IBM Cloud console. + RestrictUserListVisibility *string `json:"restrict_user_list_visibility" validate:"required"` + + // List of users that are exempted from the MFA requirement of the account. + UserMfa []AccountSettingsUserMfaResponse `json:"user_mfa" validate:"required"` + + // Defines if account invitations are restricted to specified domains. To remove an entry for a realm_id, perform an + // update (PUT) request with only the realm_id set. + RestrictUserDomains []AccountSettingsUserDomainRestriction `json:"restrict_user_domains" validate:"required"` } // Constants associated with the AccountSettingsResponse.RestrictCreateServiceID property. -// Defines whether or not creating a service ID is access controlled. Valid values: +// Defines whether or not creating the resource is access controlled. Valid values: // * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service // IDs, including the account owner // * NOT_RESTRICTED - all members of an account can create service IDs @@ -7475,9 +7223,10 @@ const ( ) // Constants associated with the AccountSettingsResponse.RestrictCreatePlatformApikey property. -// Defines whether or not creating platform API keys is access controlled. Valid values: -// * RESTRICTED - to apply access control -// * NOT_RESTRICTED - to remove access control +// Defines whether or not creating the resource is access controlled. Valid values: +// * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service +// IDs, including the account owner +// * NOT_RESTRICTED - all members of an account can create service IDs // * NOT_SET - to 'unset' a previous set value. const ( AccountSettingsResponseRestrictCreatePlatformApikeyNotRestrictedConst = "NOT_RESTRICTED" @@ -7486,7 +7235,7 @@ const ( ) // Constants associated with the AccountSettingsResponse.Mfa property. -// Defines the MFA trait for the account. Valid values: +// MFA trait definitions as follows: // * NONE - No MFA trait set // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password // * TOTP - For all non-federated IBMId users @@ -7504,6 +7253,16 @@ const ( AccountSettingsResponseMfaTotp4allConst = "TOTP4ALL" ) +// Constants associated with the AccountSettingsResponse.RestrictUserListVisibility property. +// Defines whether or not user visibility is access controlled. Valid values: +// * RESTRICTED - users can view only specific types of users in the account, such as those the user has invited to +// the account, or descendants of those users based on the classic infrastructure hierarchy +// * NOT_RESTRICTED - any user in the account can view other users from the Users page in IBM Cloud console. +const ( + AccountSettingsResponseRestrictUserListVisibilityNotRestrictedConst = "NOT_RESTRICTED" + AccountSettingsResponseRestrictUserListVisibilityRestrictedConst = "RESTRICTED" +) + // UnmarshalAccountSettingsResponse unmarshals an instance of AccountSettingsResponse from the specified map of raw messages. func UnmarshalAccountSettingsResponse(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(AccountSettingsResponse) @@ -7517,6 +7276,16 @@ func UnmarshalAccountSettingsResponse(m map[string]json.RawMessage, result inter err = core.SDKErrorf(err, "", "account_id-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "entity_tag", &obj.EntityTag) + if err != nil { + err = core.SDKErrorf(err, "", "entity_tag-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "history", &obj.History, UnmarshalEnityHistoryRecord) + if err != nil { + err = core.SDKErrorf(err, "", "history-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "restrict_create_service_id", &obj.RestrictCreateServiceID) if err != nil { err = core.SDKErrorf(err, "", "restrict_create_service_id-error", common.GetComponentInfo()) @@ -7532,26 +7301,11 @@ func UnmarshalAccountSettingsResponse(m map[string]json.RawMessage, result inter err = core.SDKErrorf(err, "", "allowed_ip_addresses-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "entity_tag", &obj.EntityTag) - if err != nil { - err = core.SDKErrorf(err, "", "entity_tag-error", common.GetComponentInfo()) - return - } err = core.UnmarshalPrimitive(m, "mfa", &obj.Mfa) if err != nil { err = core.SDKErrorf(err, "", "mfa-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "user_mfa", &obj.UserMfa, UnmarshalAccountSettingsUserMfa) - if err != nil { - err = core.SDKErrorf(err, "", "user_mfa-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "history", &obj.History, UnmarshalEnityHistoryRecord) - if err != nil { - err = core.SDKErrorf(err, "", "history-error", common.GetComponentInfo()) - return - } err = core.UnmarshalPrimitive(m, "session_expiration_in_seconds", &obj.SessionExpirationInSeconds) if err != nil { err = core.SDKErrorf(err, "", "session_expiration_in_seconds-error", common.GetComponentInfo()) @@ -7577,6 +7331,21 @@ func UnmarshalAccountSettingsResponse(m map[string]json.RawMessage, result inter err = core.SDKErrorf(err, "", "system_refresh_token_expiration_in_seconds-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "restrict_user_list_visibility", &obj.RestrictUserListVisibility) + if err != nil { + err = core.SDKErrorf(err, "", "restrict_user_list_visibility-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "user_mfa", &obj.UserMfa, UnmarshalAccountSettingsUserMfaResponse) + if err != nil { + err = core.SDKErrorf(err, "", "user_mfa-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "restrict_user_domains", &obj.RestrictUserDomains, UnmarshalAccountSettingsUserDomainRestriction) + if err != nil { + err = core.SDKErrorf(err, "", "restrict_user_domains-error", common.GetComponentInfo()) + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -7669,7 +7438,8 @@ type AccountSettingsTemplateResponse struct { // Committed flag determines if the template is ready for assignment. Committed *bool `json:"committed" validate:"required"` - AccountSettings *AccountSettingsComponent `json:"account_settings" validate:"required"` + // Input body parameters for the Account Settings REST request. + AccountSettings *TemplateAccountSettings `json:"account_settings" validate:"required"` // History of the Template. History []EnityHistoryRecord `json:"history,omitempty"` @@ -7726,7 +7496,7 @@ func UnmarshalAccountSettingsTemplateResponse(m map[string]json.RawMessage, resu err = core.SDKErrorf(err, "", "committed-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "account_settings", &obj.AccountSettings, UnmarshalAccountSettingsComponent) + err = core.UnmarshalModel(m, "account_settings", &obj.AccountSettings, UnmarshalTemplateAccountSettings) if err != nil { err = core.SDKErrorf(err, "", "account_settings-error", common.GetComponentInfo()) return @@ -7770,12 +7540,60 @@ func UnmarshalAccountSettingsTemplateResponse(m map[string]json.RawMessage, resu return } -// AccountSettingsUserMfa : AccountSettingsUserMfa struct -type AccountSettingsUserMfa struct { +// AccountSettingsUserDomainRestriction : Input body parameters for the Account Settings REST request. +type AccountSettingsUserDomainRestriction struct { + // The realm that the restrictions apply to. + RealmID *string `json:"realm_id" validate:"required"` + + // The list of allowed email patterns. Wildcard syntax is supported, '*' represents any sequence of zero or more + // characters in the string, except for '.' and '@'. The sequence ends if a '.' or '@' was found. '**' represents any + // sequence of zero or more characters in the string - without limit. + InvitationEmailAllowPatterns []string `json:"invitation_email_allow_patterns,omitempty"` + + // When true invites will only be possible to the domain patterns provided, otherwise invites are unrestricted. + RestrictInvitation *bool `json:"restrict_invitation,omitempty"` +} + +// NewAccountSettingsUserDomainRestriction : Instantiate AccountSettingsUserDomainRestriction (Generic Model Constructor) +func (*IamIdentityV1) NewAccountSettingsUserDomainRestriction(realmID string) (_model *AccountSettingsUserDomainRestriction, err error) { + _model = &AccountSettingsUserDomainRestriction{ + RealmID: core.StringPtr(realmID), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +// UnmarshalAccountSettingsUserDomainRestriction unmarshals an instance of AccountSettingsUserDomainRestriction from the specified map of raw messages. +func UnmarshalAccountSettingsUserDomainRestriction(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(AccountSettingsUserDomainRestriction) + err = core.UnmarshalPrimitive(m, "realm_id", &obj.RealmID) + if err != nil { + err = core.SDKErrorf(err, "", "realm_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "invitation_email_allow_patterns", &obj.InvitationEmailAllowPatterns) + if err != nil { + err = core.SDKErrorf(err, "", "invitation_email_allow_patterns-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "restrict_invitation", &obj.RestrictInvitation) + if err != nil { + err = core.SDKErrorf(err, "", "restrict_invitation-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AccountSettingsUserMfaResponse : AccountSettingsUserMfaResponse struct +type AccountSettingsUserMfaResponse struct { // The iam_id of the user. IamID *string `json:"iam_id" validate:"required"` - // Defines the MFA requirement for the user. Valid values: + // MFA trait definitions as follows: // * NONE - No MFA trait set // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password // * TOTP - For all non-federated IBMId users @@ -7784,10 +7602,22 @@ type AccountSettingsUserMfa struct { // * LEVEL2 - TOTP-based MFA for all users // * LEVEL3 - U2F MFA for all users. Mfa *string `json:"mfa" validate:"required"` + + // name of the user account. + Name *string `json:"name,omitempty"` + + // userName of the user. + UserName *string `json:"userName,omitempty"` + + // email of the user. + Email *string `json:"email,omitempty"` + + // optional description. + Description *string `json:"description,omitempty"` } -// Constants associated with the AccountSettingsUserMfa.Mfa property. -// Defines the MFA requirement for the user. Valid values: +// Constants associated with the AccountSettingsUserMfaResponse.Mfa property. +// MFA trait definitions as follows: // * NONE - No MFA trait set // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password // * TOTP - For all non-federated IBMId users @@ -7796,31 +7626,18 @@ type AccountSettingsUserMfa struct { // * LEVEL2 - TOTP-based MFA for all users // * LEVEL3 - U2F MFA for all users. const ( - AccountSettingsUserMfaMfaLevel1Const = "LEVEL1" - AccountSettingsUserMfaMfaLevel2Const = "LEVEL2" - AccountSettingsUserMfaMfaLevel3Const = "LEVEL3" - AccountSettingsUserMfaMfaNoneConst = "NONE" - AccountSettingsUserMfaMfaNoneNoRopcConst = "NONE_NO_ROPC" - AccountSettingsUserMfaMfaTotpConst = "TOTP" - AccountSettingsUserMfaMfaTotp4allConst = "TOTP4ALL" + AccountSettingsUserMfaResponseMfaLevel1Const = "LEVEL1" + AccountSettingsUserMfaResponseMfaLevel2Const = "LEVEL2" + AccountSettingsUserMfaResponseMfaLevel3Const = "LEVEL3" + AccountSettingsUserMfaResponseMfaNoneConst = "NONE" + AccountSettingsUserMfaResponseMfaNoneNoRopcConst = "NONE_NO_ROPC" + AccountSettingsUserMfaResponseMfaTotpConst = "TOTP" + AccountSettingsUserMfaResponseMfaTotp4allConst = "TOTP4ALL" ) -// NewAccountSettingsUserMfa : Instantiate AccountSettingsUserMfa (Generic Model Constructor) -func (*IamIdentityV1) NewAccountSettingsUserMfa(iamID string, mfa string) (_model *AccountSettingsUserMfa, err error) { - _model = &AccountSettingsUserMfa{ - IamID: core.StringPtr(iamID), - Mfa: core.StringPtr(mfa), - } - err = core.ValidateStruct(_model, "required parameters") - if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) - } - return -} - -// UnmarshalAccountSettingsUserMfa unmarshals an instance of AccountSettingsUserMfa from the specified map of raw messages. -func UnmarshalAccountSettingsUserMfa(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(AccountSettingsUserMfa) +// UnmarshalAccountSettingsUserMfaResponse unmarshals an instance of AccountSettingsUserMfaResponse from the specified map of raw messages. +func UnmarshalAccountSettingsUserMfaResponse(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(AccountSettingsUserMfaResponse) err = core.UnmarshalPrimitive(m, "iam_id", &obj.IamID) if err != nil { err = core.SDKErrorf(err, "", "iam_id-error", common.GetComponentInfo()) @@ -7831,6 +7648,26 @@ func UnmarshalAccountSettingsUserMfa(m map[string]json.RawMessage, result interf err = core.SDKErrorf(err, "", "mfa-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "userName", &obj.UserName) + if err != nil { + err = core.SDKErrorf(err, "", "userName-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "email", &obj.Email) + if err != nil { + err = core.SDKErrorf(err, "", "email-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "description", &obj.Description) + if err != nil { + err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -8434,6 +8271,32 @@ func UnmarshalApikeyActivityUser(m map[string]json.RawMessage, result interface{ return } +// AssignedTemplatesAccountSettingsRestrictUserDomains : AssignedTemplatesAccountSettingsRestrictUserDomains struct +type AssignedTemplatesAccountSettingsRestrictUserDomains struct { + AccountSufficient *bool `json:"account_sufficient,omitempty"` + + // Defines if account invitations are restricted to specified domains. To remove an entry for a realm_id, perform an + // update (PUT) request with only the realm_id set. + Restrictions []AccountSettingsUserDomainRestriction `json:"restrictions,omitempty"` +} + +// UnmarshalAssignedTemplatesAccountSettingsRestrictUserDomains unmarshals an instance of AssignedTemplatesAccountSettingsRestrictUserDomains from the specified map of raw messages. +func UnmarshalAssignedTemplatesAccountSettingsRestrictUserDomains(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(AssignedTemplatesAccountSettingsRestrictUserDomains) + err = core.UnmarshalPrimitive(m, "account_sufficient", &obj.AccountSufficient) + if err != nil { + err = core.SDKErrorf(err, "", "account_sufficient-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "restrictions", &obj.Restrictions, UnmarshalAccountSettingsUserDomainRestriction) + if err != nil { + err = core.SDKErrorf(err, "", "restrictions-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // CommitAccountSettingsTemplateOptions : The CommitAccountSettingsTemplate options. type CommitAccountSettingsTemplateOptions struct { // ID of the account settings template. @@ -8586,7 +8449,8 @@ type CreateAccountSettingsTemplateOptions struct { // The description of the trusted profile template. Describe the template for enterprise account users. Description *string `json:"description,omitempty"` - AccountSettings *AccountSettingsComponent `json:"account_settings,omitempty"` + // Input body parameters for the Account Settings REST request. + AccountSettings *TemplateAccountSettings `json:"account_settings,omitempty"` // Allows users to set headers on API requests. Headers map[string]string @@ -8616,7 +8480,7 @@ func (_options *CreateAccountSettingsTemplateOptions) SetDescription(description } // SetAccountSettings : Allow user to set AccountSettings -func (_options *CreateAccountSettingsTemplateOptions) SetAccountSettings(accountSettings *AccountSettingsComponent) *CreateAccountSettingsTemplateOptions { +func (_options *CreateAccountSettingsTemplateOptions) SetAccountSettings(accountSettings *TemplateAccountSettings) *CreateAccountSettingsTemplateOptions { _options.AccountSettings = accountSettings return _options } @@ -8641,7 +8505,8 @@ type CreateAccountSettingsTemplateVersionOptions struct { // The description of the trusted profile template. Describe the template for enterprise account users. Description *string `json:"description,omitempty"` - AccountSettings *AccountSettingsComponent `json:"account_settings,omitempty"` + // Input body parameters for the Account Settings REST request. + AccountSettings *TemplateAccountSettings `json:"account_settings,omitempty"` // Allows users to set headers on API requests. Headers map[string]string @@ -8679,7 +8544,7 @@ func (_options *CreateAccountSettingsTemplateVersionOptions) SetDescription(desc } // SetAccountSettings : Allow user to set AccountSettings -func (_options *CreateAccountSettingsTemplateVersionOptions) SetAccountSettings(accountSettings *AccountSettingsComponent) *CreateAccountSettingsTemplateVersionOptions { +func (_options *CreateAccountSettingsTemplateVersionOptions) SetAccountSettings(accountSettings *TemplateAccountSettings) *CreateAccountSettingsTemplateVersionOptions { _options.AccountSettings = accountSettings return _options } @@ -10139,122 +10004,39 @@ type EffectiveAccountSettingsResponse struct { Effective *AccountSettingsEffectiveSection `json:"effective" validate:"required"` - Account *AccountSettingsAccountSection `json:"account" validate:"required"` - - // assigned template section. - AssignedTemplates []AccountSettingsAssignedTemplatesSection `json:"assigned_templates,omitempty"` -} - -// UnmarshalEffectiveAccountSettingsResponse unmarshals an instance of EffectiveAccountSettingsResponse from the specified map of raw messages. -func UnmarshalEffectiveAccountSettingsResponse(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EffectiveAccountSettingsResponse) - err = core.UnmarshalModel(m, "context", &obj.Context, UnmarshalResponseContext) - if err != nil { - err = core.SDKErrorf(err, "", "context-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "account_id", &obj.AccountID) - if err != nil { - err = core.SDKErrorf(err, "", "account_id-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "effective", &obj.Effective, UnmarshalAccountSettingsEffectiveSection) - if err != nil { - err = core.SDKErrorf(err, "", "effective-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "account", &obj.Account, UnmarshalAccountSettingsAccountSection) - if err != nil { - err = core.SDKErrorf(err, "", "account-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "assigned_templates", &obj.AssignedTemplates, UnmarshalAccountSettingsAssignedTemplatesSection) - if err != nil { - err = core.SDKErrorf(err, "", "assigned_templates-error", common.GetComponentInfo()) - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// EffectiveAccountSettingsUserMfa : EffectiveAccountSettingsUserMfa struct -type EffectiveAccountSettingsUserMfa struct { - // The iam_id of the user. - IamID *string `json:"iam_id" validate:"required"` - - // Defines the MFA requirement for the user. Valid values: - // * NONE - No MFA trait set - // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password - // * TOTP - For all non-federated IBMId users - // * TOTP4ALL - For all users - // * LEVEL1 - Email-based MFA for all users - // * LEVEL2 - TOTP-based MFA for all users - // * LEVEL3 - U2F MFA for all users. - Mfa *string `json:"mfa" validate:"required"` - - // name of the user account. - Name *string `json:"name,omitempty"` - - // userName of the user. - UserName *string `json:"userName,omitempty"` - - // email of the user. - Email *string `json:"email,omitempty"` - - // optional description. - Description *string `json:"description,omitempty"` -} + // Input body parameters for the Account Settings REST request. + Account *AccountSettingsResponse `json:"account" validate:"required"` -// Constants associated with the EffectiveAccountSettingsUserMfa.Mfa property. -// Defines the MFA requirement for the user. Valid values: -// * NONE - No MFA trait set -// * NONE_NO_ROPC- No MFA, disable CLI logins with only a password -// * TOTP - For all non-federated IBMId users -// * TOTP4ALL - For all users -// * LEVEL1 - Email-based MFA for all users -// * LEVEL2 - TOTP-based MFA for all users -// * LEVEL3 - U2F MFA for all users. -const ( - EffectiveAccountSettingsUserMfaMfaLevel1Const = "LEVEL1" - EffectiveAccountSettingsUserMfaMfaLevel2Const = "LEVEL2" - EffectiveAccountSettingsUserMfaMfaLevel3Const = "LEVEL3" - EffectiveAccountSettingsUserMfaMfaNoneConst = "NONE" - EffectiveAccountSettingsUserMfaMfaNoneNoRopcConst = "NONE_NO_ROPC" - EffectiveAccountSettingsUserMfaMfaTotpConst = "TOTP" - EffectiveAccountSettingsUserMfaMfaTotp4allConst = "TOTP4ALL" -) + // assigned template section. + AssignedTemplates []AccountSettingsAssignedTemplatesSection `json:"assigned_templates,omitempty"` +} -// UnmarshalEffectiveAccountSettingsUserMfa unmarshals an instance of EffectiveAccountSettingsUserMfa from the specified map of raw messages. -func UnmarshalEffectiveAccountSettingsUserMfa(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(EffectiveAccountSettingsUserMfa) - err = core.UnmarshalPrimitive(m, "iam_id", &obj.IamID) - if err != nil { - err = core.SDKErrorf(err, "", "iam_id-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "mfa", &obj.Mfa) +// UnmarshalEffectiveAccountSettingsResponse unmarshals an instance of EffectiveAccountSettingsResponse from the specified map of raw messages. +func UnmarshalEffectiveAccountSettingsResponse(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EffectiveAccountSettingsResponse) + err = core.UnmarshalModel(m, "context", &obj.Context, UnmarshalResponseContext) if err != nil { - err = core.SDKErrorf(err, "", "mfa-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "context-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) + err = core.UnmarshalPrimitive(m, "account_id", &obj.AccountID) if err != nil { - err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "account_id-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "userName", &obj.UserName) + err = core.UnmarshalModel(m, "effective", &obj.Effective, UnmarshalAccountSettingsEffectiveSection) if err != nil { - err = core.SDKErrorf(err, "", "userName-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "effective-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "email", &obj.Email) + err = core.UnmarshalModel(m, "account", &obj.Account, UnmarshalAccountSettingsResponse) if err != nil { - err = core.SDKErrorf(err, "", "email-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "account-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "description", &obj.Description) + err = core.UnmarshalModel(m, "assigned_templates", &obj.AssignedTemplates, UnmarshalAccountSettingsAssignedTemplatesSection) if err != nil { - err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "assigned_templates-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -10512,6 +10294,9 @@ type GetAccountSettingsOptions struct { // Defines if the entity history is included in the response. IncludeHistory *bool `json:"include_history,omitempty"` + // Enrich MFA exemptions with user PI. + ResolveUserMfa *bool `json:"resolve_user_mfa,omitempty"` + // Allows users to set headers on API requests. Headers map[string]string } @@ -10535,6 +10320,12 @@ func (_options *GetAccountSettingsOptions) SetIncludeHistory(includeHistory bool return _options } +// SetResolveUserMfa : Allow user to set ResolveUserMfa +func (_options *GetAccountSettingsOptions) SetResolveUserMfa(resolveUserMfa bool) *GetAccountSettingsOptions { + _options.ResolveUserMfa = core.BoolPtr(resolveUserMfa) + return _options +} + // SetHeaders : Allow user to set Headers func (options *GetAccountSettingsOptions) SetHeaders(param map[string]string) *GetAccountSettingsOptions { options.Headers = param @@ -11368,7 +11159,7 @@ func (options *GetTrustedProfileAssignmentOptions) SetHeaders(param map[string]s // IDBasedMfaEnrollment : IDBasedMfaEnrollment struct type IDBasedMfaEnrollment struct { - // Defines the MFA trait for the account. Valid values: + // MFA trait definitions as follows: // * NONE - No MFA trait set // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password // * TOTP - For all non-federated IBMId users @@ -11378,7 +11169,7 @@ type IDBasedMfaEnrollment struct { // * LEVEL3 - U2F MFA for all users. TraitAccountDefault *string `json:"trait_account_default" validate:"required"` - // Defines the MFA trait for the account. Valid values: + // MFA trait definitions as follows: // * NONE - No MFA trait set // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password // * TOTP - For all non-federated IBMId users @@ -11388,7 +11179,7 @@ type IDBasedMfaEnrollment struct { // * LEVEL3 - U2F MFA for all users. TraitUserSpecific *string `json:"trait_user_specific,omitempty"` - // Defines the MFA trait for the account. Valid values: + // MFA trait definitions as follows: // * NONE - No MFA trait set // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password // * TOTP - For all non-federated IBMId users @@ -11410,7 +11201,7 @@ type IDBasedMfaEnrollment struct { } // Constants associated with the IDBasedMfaEnrollment.TraitAccountDefault property. -// Defines the MFA trait for the account. Valid values: +// MFA trait definitions as follows: // * NONE - No MFA trait set // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password // * TOTP - For all non-federated IBMId users @@ -11429,7 +11220,7 @@ const ( ) // Constants associated with the IDBasedMfaEnrollment.TraitUserSpecific property. -// Defines the MFA trait for the account. Valid values: +// MFA trait definitions as follows: // * NONE - No MFA trait set // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password // * TOTP - For all non-federated IBMId users @@ -11448,7 +11239,7 @@ const ( ) // Constants associated with the IDBasedMfaEnrollment.TraitEffective property. -// Defines the MFA trait for the account. Valid values: +// MFA trait definitions as follows: // * NONE - No MFA trait set // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password // * TOTP - For all non-federated IBMId users @@ -13954,6 +13745,221 @@ func (options *SetProfileIdentityOptions) SetHeaders(param map[string]string) *S return options } +// TemplateAccountSettings : Input body parameters for the Account Settings REST request. +type TemplateAccountSettings struct { + // Defines whether or not creating the resource is access controlled. Valid values: + // * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service + // IDs, including the account owner + // * NOT_RESTRICTED - all members of an account can create service IDs + // * NOT_SET - to 'unset' a previous set value. + RestrictCreateServiceID *string `json:"restrict_create_service_id,omitempty"` + + // Defines whether or not creating the resource is access controlled. Valid values: + // * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service + // IDs, including the account owner + // * NOT_RESTRICTED - all members of an account can create service IDs + // * NOT_SET - to 'unset' a previous set value. + RestrictCreatePlatformApikey *string `json:"restrict_create_platform_apikey,omitempty"` + + // Defines the IP addresses and subnets from which IAM tokens can be created for the account. + AllowedIPAddresses *string `json:"allowed_ip_addresses,omitempty"` + + // MFA trait definitions as follows: + // * NONE - No MFA trait set + // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password + // * TOTP - For all non-federated IBMId users + // * TOTP4ALL - For all users + // * LEVEL1 - Email-based MFA for all users + // * LEVEL2 - TOTP-based MFA for all users + // * LEVEL3 - U2F MFA for all users. + Mfa *string `json:"mfa,omitempty"` + + // List of users that are exempted from the MFA requirement of the account. + UserMfa []UserMfa `json:"user_mfa,omitempty"` + + // Defines the session expiration in seconds for the account. Valid values: + // * Any whole number between between '900' and '86400' + // * NOT_SET - To unset account setting and use service default. + SessionExpirationInSeconds *string `json:"session_expiration_in_seconds,omitempty"` + + // Defines the period of time in seconds in which a session will be invalidated due to inactivity. Valid values: + // * Any whole number between '900' and '7200' + // * NOT_SET - To unset account setting and use service default. + SessionInvalidationInSeconds *string `json:"session_invalidation_in_seconds,omitempty"` + + // Defines the max allowed sessions per identity required by the account. Valid values: + // * Any whole number greater than 0 + // * NOT_SET - To unset account setting and use service default. + MaxSessionsPerIdentity *string `json:"max_sessions_per_identity,omitempty"` + + // Defines the access token expiration in seconds. Valid values: + // * Any whole number between '900' and '3600' + // * NOT_SET - To unset account setting and use service default. + SystemAccessTokenExpirationInSeconds *string `json:"system_access_token_expiration_in_seconds,omitempty"` + + // Defines the refresh token expiration in seconds. Valid values: + // * Any whole number between '900' and '259200' + // * NOT_SET - To unset account setting and use service default. + SystemRefreshTokenExpirationInSeconds *string `json:"system_refresh_token_expiration_in_seconds,omitempty"` + + // Defines whether or not user visibility is access controlled. Valid values: + // * RESTRICTED - users can view only specific types of users in the account, such as those the user has invited to + // the account, or descendants of those users based on the classic infrastructure hierarchy + // * NOT_RESTRICTED - any user in the account can view other users from the Users page in IBM Cloud console + // * NOT_SET - to 'unset' a previous set value. + RestrictUserListVisibility *string `json:"restrict_user_list_visibility,omitempty"` + + RestrictUserDomains *TemplateAccountSettingsRestrictUserDomains `json:"restrict_user_domains,omitempty"` +} + +// Constants associated with the TemplateAccountSettings.RestrictCreateServiceID property. +// Defines whether or not creating the resource is access controlled. Valid values: +// * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service +// IDs, including the account owner +// * NOT_RESTRICTED - all members of an account can create service IDs +// * NOT_SET - to 'unset' a previous set value. +const ( + TemplateAccountSettingsRestrictCreateServiceIDNotRestrictedConst = "NOT_RESTRICTED" + TemplateAccountSettingsRestrictCreateServiceIDNotSetConst = "NOT_SET" + TemplateAccountSettingsRestrictCreateServiceIDRestrictedConst = "RESTRICTED" +) + +// Constants associated with the TemplateAccountSettings.RestrictCreatePlatformApikey property. +// Defines whether or not creating the resource is access controlled. Valid values: +// * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service +// IDs, including the account owner +// * NOT_RESTRICTED - all members of an account can create service IDs +// * NOT_SET - to 'unset' a previous set value. +const ( + TemplateAccountSettingsRestrictCreatePlatformApikeyNotRestrictedConst = "NOT_RESTRICTED" + TemplateAccountSettingsRestrictCreatePlatformApikeyNotSetConst = "NOT_SET" + TemplateAccountSettingsRestrictCreatePlatformApikeyRestrictedConst = "RESTRICTED" +) + +// Constants associated with the TemplateAccountSettings.Mfa property. +// MFA trait definitions as follows: +// * NONE - No MFA trait set +// * NONE_NO_ROPC- No MFA, disable CLI logins with only a password +// * TOTP - For all non-federated IBMId users +// * TOTP4ALL - For all users +// * LEVEL1 - Email-based MFA for all users +// * LEVEL2 - TOTP-based MFA for all users +// * LEVEL3 - U2F MFA for all users. +const ( + TemplateAccountSettingsMfaLevel1Const = "LEVEL1" + TemplateAccountSettingsMfaLevel2Const = "LEVEL2" + TemplateAccountSettingsMfaLevel3Const = "LEVEL3" + TemplateAccountSettingsMfaNoneConst = "NONE" + TemplateAccountSettingsMfaNoneNoRopcConst = "NONE_NO_ROPC" + TemplateAccountSettingsMfaTotpConst = "TOTP" + TemplateAccountSettingsMfaTotp4allConst = "TOTP4ALL" +) + +// Constants associated with the TemplateAccountSettings.RestrictUserListVisibility property. +// Defines whether or not user visibility is access controlled. Valid values: +// * RESTRICTED - users can view only specific types of users in the account, such as those the user has invited to +// the account, or descendants of those users based on the classic infrastructure hierarchy +// * NOT_RESTRICTED - any user in the account can view other users from the Users page in IBM Cloud console +// * NOT_SET - to 'unset' a previous set value. +const ( + TemplateAccountSettingsRestrictUserListVisibilityNotRestrictedConst = "NOT_RESTRICTED" + TemplateAccountSettingsRestrictUserListVisibilityNotSetConst = "NOT_SET" + TemplateAccountSettingsRestrictUserListVisibilityRestrictedConst = "RESTRICTED" +) + +// UnmarshalTemplateAccountSettings unmarshals an instance of TemplateAccountSettings from the specified map of raw messages. +func UnmarshalTemplateAccountSettings(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(TemplateAccountSettings) + err = core.UnmarshalPrimitive(m, "restrict_create_service_id", &obj.RestrictCreateServiceID) + if err != nil { + err = core.SDKErrorf(err, "", "restrict_create_service_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "restrict_create_platform_apikey", &obj.RestrictCreatePlatformApikey) + if err != nil { + err = core.SDKErrorf(err, "", "restrict_create_platform_apikey-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "allowed_ip_addresses", &obj.AllowedIPAddresses) + if err != nil { + err = core.SDKErrorf(err, "", "allowed_ip_addresses-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "mfa", &obj.Mfa) + if err != nil { + err = core.SDKErrorf(err, "", "mfa-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "user_mfa", &obj.UserMfa, UnmarshalUserMfa) + if err != nil { + err = core.SDKErrorf(err, "", "user_mfa-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "session_expiration_in_seconds", &obj.SessionExpirationInSeconds) + if err != nil { + err = core.SDKErrorf(err, "", "session_expiration_in_seconds-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "session_invalidation_in_seconds", &obj.SessionInvalidationInSeconds) + if err != nil { + err = core.SDKErrorf(err, "", "session_invalidation_in_seconds-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "max_sessions_per_identity", &obj.MaxSessionsPerIdentity) + if err != nil { + err = core.SDKErrorf(err, "", "max_sessions_per_identity-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "system_access_token_expiration_in_seconds", &obj.SystemAccessTokenExpirationInSeconds) + if err != nil { + err = core.SDKErrorf(err, "", "system_access_token_expiration_in_seconds-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "system_refresh_token_expiration_in_seconds", &obj.SystemRefreshTokenExpirationInSeconds) + if err != nil { + err = core.SDKErrorf(err, "", "system_refresh_token_expiration_in_seconds-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "restrict_user_list_visibility", &obj.RestrictUserListVisibility) + if err != nil { + err = core.SDKErrorf(err, "", "restrict_user_list_visibility-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "restrict_user_domains", &obj.RestrictUserDomains, UnmarshalTemplateAccountSettingsRestrictUserDomains) + if err != nil { + err = core.SDKErrorf(err, "", "restrict_user_domains-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// TemplateAccountSettingsRestrictUserDomains : TemplateAccountSettingsRestrictUserDomains struct +type TemplateAccountSettingsRestrictUserDomains struct { + AccountSufficient *bool `json:"account_sufficient,omitempty"` + + // Defines if account invitations are restricted to specified domains. To remove an entry for a realm_id, perform an + // update (PUT) request with only the realm_id set. + Restrictions []AccountSettingsUserDomainRestriction `json:"restrictions,omitempty"` +} + +// UnmarshalTemplateAccountSettingsRestrictUserDomains unmarshals an instance of TemplateAccountSettingsRestrictUserDomains from the specified map of raw messages. +func UnmarshalTemplateAccountSettingsRestrictUserDomains(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(TemplateAccountSettingsRestrictUserDomains) + err = core.UnmarshalPrimitive(m, "account_sufficient", &obj.AccountSufficient) + if err != nil { + err = core.SDKErrorf(err, "", "account_sufficient-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "restrictions", &obj.Restrictions, UnmarshalAccountSettingsUserDomainRestriction) + if err != nil { + err = core.SDKErrorf(err, "", "restrictions-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // TemplateAssignmentListResponse : List Response body format for Template Assignments Records. type TemplateAssignmentListResponse struct { // Context with key properties for problem determination. @@ -15053,24 +15059,24 @@ type UpdateAccountSettingsOptions struct { // The id of the account to update the settings for. AccountID *string `json:"account_id" validate:"required,ne="` - // Defines whether or not creating a service ID is access controlled. Valid values: + // Defines whether or not creating the resource is access controlled. Valid values: // * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service // IDs, including the account owner // * NOT_RESTRICTED - all members of an account can create service IDs // * NOT_SET - to 'unset' a previous set value. RestrictCreateServiceID *string `json:"restrict_create_service_id,omitempty"` - // Defines whether or not creating platform API keys is access controlled. Valid values: - // * RESTRICTED - only users assigned the 'User API key creator' role on the IAM Identity Service can create API - // keys, including the account owner - // * NOT_RESTRICTED - all members of an account can create platform API keys + // Defines whether or not creating the resource is access controlled. Valid values: + // * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service + // IDs, including the account owner + // * NOT_RESTRICTED - all members of an account can create service IDs // * NOT_SET - to 'unset' a previous set value. RestrictCreatePlatformApikey *string `json:"restrict_create_platform_apikey,omitempty"` // Defines the IP addresses and subnets from which IAM tokens can be created for the account. AllowedIPAddresses *string `json:"allowed_ip_addresses,omitempty"` - // Defines the MFA trait for the account. Valid values: + // MFA trait definitions as follows: // * NONE - No MFA trait set // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password // * TOTP - For all non-federated IBMId users @@ -15081,7 +15087,7 @@ type UpdateAccountSettingsOptions struct { Mfa *string `json:"mfa,omitempty"` // List of users that are exempted from the MFA requirement of the account. - UserMfa []AccountSettingsUserMfa `json:"user_mfa,omitempty"` + UserMfa []UserMfa `json:"user_mfa,omitempty"` // Defines the session expiration in seconds for the account. Valid values: // * Any whole number between between '900' and '86400' @@ -15093,7 +15099,7 @@ type UpdateAccountSettingsOptions struct { // * NOT_SET - To unset account setting and use service default. SessionInvalidationInSeconds *string `json:"session_invalidation_in_seconds,omitempty"` - // Defines the max allowed sessions per identity required by the account. Value values: + // Defines the max allowed sessions per identity required by the account. Valid values: // * Any whole number greater than 0 // * NOT_SET - To unset account setting and use service default. MaxSessionsPerIdentity *string `json:"max_sessions_per_identity,omitempty"` @@ -15108,12 +15114,22 @@ type UpdateAccountSettingsOptions struct { // * NOT_SET - To unset account setting and use service default. SystemRefreshTokenExpirationInSeconds *string `json:"system_refresh_token_expiration_in_seconds,omitempty"` + // Defines whether or not user visibility is access controlled. Valid values: + // * RESTRICTED - users can view only specific types of users in the account, such as those the user has invited to + // the account, or descendants of those users based on the classic infrastructure hierarchy + // * NOT_RESTRICTED - any user in the account can view other users from the Users page in IBM Cloud console. + RestrictUserListVisibility *string `json:"restrict_user_list_visibility,omitempty"` + + // Defines if account invitations are restricted to specified domains. To remove an entry for a realm_id, perform an + // update (PUT) request with only the realm_id set. + RestrictUserDomains []AccountSettingsUserDomainRestriction `json:"restrict_user_domains,omitempty"` + // Allows users to set headers on API requests. Headers map[string]string } // Constants associated with the UpdateAccountSettingsOptions.RestrictCreateServiceID property. -// Defines whether or not creating a service ID is access controlled. Valid values: +// Defines whether or not creating the resource is access controlled. Valid values: // * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service // IDs, including the account owner // * NOT_RESTRICTED - all members of an account can create service IDs @@ -15125,10 +15141,10 @@ const ( ) // Constants associated with the UpdateAccountSettingsOptions.RestrictCreatePlatformApikey property. -// Defines whether or not creating platform API keys is access controlled. Valid values: -// * RESTRICTED - only users assigned the 'User API key creator' role on the IAM Identity Service can create API keys, -// including the account owner -// * NOT_RESTRICTED - all members of an account can create platform API keys +// Defines whether or not creating the resource is access controlled. Valid values: +// * RESTRICTED - only users assigned the 'Service ID creator' role on the IAM Identity Service can create service +// IDs, including the account owner +// * NOT_RESTRICTED - all members of an account can create service IDs // * NOT_SET - to 'unset' a previous set value. const ( UpdateAccountSettingsOptionsRestrictCreatePlatformApikeyNotRestrictedConst = "NOT_RESTRICTED" @@ -15137,7 +15153,7 @@ const ( ) // Constants associated with the UpdateAccountSettingsOptions.Mfa property. -// Defines the MFA trait for the account. Valid values: +// MFA trait definitions as follows: // * NONE - No MFA trait set // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password // * TOTP - For all non-federated IBMId users @@ -15155,6 +15171,16 @@ const ( UpdateAccountSettingsOptionsMfaTotp4allConst = "TOTP4ALL" ) +// Constants associated with the UpdateAccountSettingsOptions.RestrictUserListVisibility property. +// Defines whether or not user visibility is access controlled. Valid values: +// * RESTRICTED - users can view only specific types of users in the account, such as those the user has invited to +// the account, or descendants of those users based on the classic infrastructure hierarchy +// * NOT_RESTRICTED - any user in the account can view other users from the Users page in IBM Cloud console. +const ( + UpdateAccountSettingsOptionsRestrictUserListVisibilityNotRestrictedConst = "NOT_RESTRICTED" + UpdateAccountSettingsOptionsRestrictUserListVisibilityRestrictedConst = "RESTRICTED" +) + // NewUpdateAccountSettingsOptions : Instantiate UpdateAccountSettingsOptions func (*IamIdentityV1) NewUpdateAccountSettingsOptions(ifMatch string, accountID string) *UpdateAccountSettingsOptions { return &UpdateAccountSettingsOptions{ @@ -15200,7 +15226,7 @@ func (_options *UpdateAccountSettingsOptions) SetMfa(mfa string) *UpdateAccountS } // SetUserMfa : Allow user to set UserMfa -func (_options *UpdateAccountSettingsOptions) SetUserMfa(userMfa []AccountSettingsUserMfa) *UpdateAccountSettingsOptions { +func (_options *UpdateAccountSettingsOptions) SetUserMfa(userMfa []UserMfa) *UpdateAccountSettingsOptions { _options.UserMfa = userMfa return _options } @@ -15235,6 +15261,18 @@ func (_options *UpdateAccountSettingsOptions) SetSystemRefreshTokenExpirationInS return _options } +// SetRestrictUserListVisibility : Allow user to set RestrictUserListVisibility +func (_options *UpdateAccountSettingsOptions) SetRestrictUserListVisibility(restrictUserListVisibility string) *UpdateAccountSettingsOptions { + _options.RestrictUserListVisibility = core.StringPtr(restrictUserListVisibility) + return _options +} + +// SetRestrictUserDomains : Allow user to set RestrictUserDomains +func (_options *UpdateAccountSettingsOptions) SetRestrictUserDomains(restrictUserDomains []AccountSettingsUserDomainRestriction) *UpdateAccountSettingsOptions { + _options.RestrictUserDomains = restrictUserDomains + return _options +} + // SetHeaders : Allow user to set Headers func (options *UpdateAccountSettingsOptions) SetHeaders(param map[string]string) *UpdateAccountSettingsOptions { options.Headers = param @@ -15263,7 +15301,8 @@ type UpdateAccountSettingsTemplateVersionOptions struct { // The description of the trusted profile template. Describe the template for enterprise account users. Description *string `json:"description,omitempty"` - AccountSettings *AccountSettingsComponent `json:"account_settings,omitempty"` + // Input body parameters for the Account Settings REST request. + AccountSettings *TemplateAccountSettings `json:"account_settings,omitempty"` // Allows users to set headers on API requests. Headers map[string]string @@ -15315,7 +15354,7 @@ func (_options *UpdateAccountSettingsTemplateVersionOptions) SetDescription(desc } // SetAccountSettings : Allow user to set AccountSettings -func (_options *UpdateAccountSettingsTemplateVersionOptions) SetAccountSettings(accountSettings *AccountSettingsComponent) *UpdateAccountSettingsTemplateVersionOptions { +func (_options *UpdateAccountSettingsTemplateVersionOptions) SetAccountSettings(accountSettings *TemplateAccountSettings) *UpdateAccountSettingsTemplateVersionOptions { _options.AccountSettings = accountSettings return _options } @@ -16016,6 +16055,58 @@ func UnmarshalUserActivity(m map[string]json.RawMessage, result interface{}) (er return } +// UserMfa : UserMfa struct +type UserMfa struct { + // The iam_id of the user. + IamID *string `json:"iam_id,omitempty"` + + // MFA trait definitions as follows: + // * NONE - No MFA trait set + // * NONE_NO_ROPC- No MFA, disable CLI logins with only a password + // * TOTP - For all non-federated IBMId users + // * TOTP4ALL - For all users + // * LEVEL1 - Email-based MFA for all users + // * LEVEL2 - TOTP-based MFA for all users + // * LEVEL3 - U2F MFA for all users. + Mfa *string `json:"mfa,omitempty"` +} + +// Constants associated with the UserMfa.Mfa property. +// MFA trait definitions as follows: +// * NONE - No MFA trait set +// * NONE_NO_ROPC- No MFA, disable CLI logins with only a password +// * TOTP - For all non-federated IBMId users +// * TOTP4ALL - For all users +// * LEVEL1 - Email-based MFA for all users +// * LEVEL2 - TOTP-based MFA for all users +// * LEVEL3 - U2F MFA for all users. +const ( + UserMfaMfaLevel1Const = "LEVEL1" + UserMfaMfaLevel2Const = "LEVEL2" + UserMfaMfaLevel3Const = "LEVEL3" + UserMfaMfaNoneConst = "NONE" + UserMfaMfaNoneNoRopcConst = "NONE_NO_ROPC" + UserMfaMfaTotpConst = "TOTP" + UserMfaMfaTotp4allConst = "TOTP4ALL" +) + +// UnmarshalUserMfa unmarshals an instance of UserMfa from the specified map of raw messages. +func UnmarshalUserMfa(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(UserMfa) + err = core.UnmarshalPrimitive(m, "iam_id", &obj.IamID) + if err != nil { + err = core.SDKErrorf(err, "", "iam_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "mfa", &obj.Mfa) + if err != nil { + err = core.SDKErrorf(err, "", "mfa-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // UserMfaEnrollments : UserMfaEnrollments struct type UserMfaEnrollments struct { // IAMid of the user. diff --git a/vendor/github.com/IBM/platform-services-go-sdk/iampolicymanagementv1/iam_policy_management_v1.go b/vendor/github.com/IBM/platform-services-go-sdk/iampolicymanagementv1/iam_policy_management_v1.go index 4386dca177e..8d6d27483fa 100644 --- a/vendor/github.com/IBM/platform-services-go-sdk/iampolicymanagementv1/iam_policy_management_v1.go +++ b/vendor/github.com/IBM/platform-services-go-sdk/iampolicymanagementv1/iam_policy_management_v1.go @@ -15,7 +15,7 @@ */ /* - * IBM OpenAPI SDK Code Generator Version: 3.106.0-09823488-20250707-071701 + * IBM OpenAPI SDK Code Generator Version: 3.107.1-41b0fbd0-20250825-080732 */ // Package iampolicymanagementv1 : Operations and models for the IamPolicyManagementV1 service @@ -4316,989 +4316,2178 @@ func (iamPolicyManagement *IamPolicyManagementV1) DeleteActionControlAssignmentW return } -func getServiceComponentInfo() *core.ProblemComponent { - return core.NewProblemComponent(DefaultServiceName, "1.0.1") -} -// AccountSettingsAccessManagement : The Access Management Account Settings that are currently set for the requested account. -type AccountSettingsAccessManagement struct { - // How external accounts can interact in relation to the requested account. - ExternalAccountIdentityInteraction *ExternalAccountIdentityInteraction `json:"external_account_identity_interaction" validate:"required"` +// ListRoleTemplates : List role templates by attributes +// List role templates and filter by attributes by using query parameters. The following attributes are supported: +// `account_id`, `name`, `role_name`, `role_service_name`, `state`, `limit`, `start`. +// `account_id` is a required query parameter. Only role templates that have the specified attributes and that the +// caller has read access to are returned. If the caller does not have read access to any role templates an empty array +// is returned. +func (iamPolicyManagement *IamPolicyManagementV1) ListRoleTemplates(listRoleTemplatesOptions *ListRoleTemplatesOptions) (result *RoleTemplateCollection, response *core.DetailedResponse, err error) { + result, response, err = iamPolicyManagement.ListRoleTemplatesWithContext(context.Background(), listRoleTemplatesOptions) + err = core.RepurposeSDKProblem(err, "") + return } -// UnmarshalAccountSettingsAccessManagement unmarshals an instance of AccountSettingsAccessManagement from the specified map of raw messages. -func UnmarshalAccountSettingsAccessManagement(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(AccountSettingsAccessManagement) - err = core.UnmarshalModel(m, "external_account_identity_interaction", &obj.ExternalAccountIdentityInteraction, UnmarshalExternalAccountIdentityInteraction) +// ListRoleTemplatesWithContext is an alternate form of the ListRoleTemplates method which supports a Context parameter +func (iamPolicyManagement *IamPolicyManagementV1) ListRoleTemplatesWithContext(ctx context.Context, listRoleTemplatesOptions *ListRoleTemplatesOptions) (result *RoleTemplateCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listRoleTemplatesOptions, "listRoleTemplatesOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "external_account_identity_interaction-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(listRoleTemplatesOptions, "listRoleTemplatesOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// ActionControlAssignment : The set of properties associated with the assigned action control template. -type ActionControlAssignment struct { - // Action control assignment ID. - ID *string `json:"id,omitempty"` - - // The account GUID that the action control assignments belong to. - AccountID *string `json:"account_id,omitempty"` - - // The href URL that links to the action control assignments API by action control assignment ID. - Href *string `json:"href,omitempty"` - - // The UTC timestamp when the action control assignment was created. - CreatedAt *strfmt.DateTime `json:"created_at,omitempty"` - - // The IAM ID of the entity that created the action control assignment. - CreatedByID *string `json:"created_by_id,omitempty"` - // The UTC timestamp when the action control assignment was last modified. - LastModifiedAt *strfmt.DateTime `json:"last_modified_at,omitempty"` + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/role_templates`, nil) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } - // The IAM ID of the entity that last modified the action control assignment. - LastModifiedByID *string `json:"last_modified_by_id,omitempty"` + sdkHeaders := common.GetSdkHeaders("iam_policy_management", "V1", "ListRoleTemplates") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } - // The current operation of the action control assignment. - Operation *string `json:"operation,omitempty"` + for headerName, headerValue := range listRoleTemplatesOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + if listRoleTemplatesOptions.AcceptLanguage != nil { + builder.AddHeader("Accept-Language", fmt.Sprint(*listRoleTemplatesOptions.AcceptLanguage)) + } - // Resources created when action control template is assigned. - Resources []ActionControlAssignmentResource `json:"resources,omitempty"` + builder.AddQuery("account_id", fmt.Sprint(*listRoleTemplatesOptions.AccountID)) + if listRoleTemplatesOptions.Name != nil { + builder.AddQuery("name", fmt.Sprint(*listRoleTemplatesOptions.Name)) + } + if listRoleTemplatesOptions.RoleName != nil { + builder.AddQuery("role_name", fmt.Sprint(*listRoleTemplatesOptions.RoleName)) + } + if listRoleTemplatesOptions.RoleServiceName != nil { + builder.AddQuery("role_service_name", fmt.Sprint(*listRoleTemplatesOptions.RoleServiceName)) + } + if listRoleTemplatesOptions.State != nil { + builder.AddQuery("state", fmt.Sprint(*listRoleTemplatesOptions.State)) + } + if listRoleTemplatesOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listRoleTemplatesOptions.Limit)) + } + if listRoleTemplatesOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listRoleTemplatesOptions.Start)) + } - // The action control template id and version that will be assigned. - Template *ActionControlAssignmentTemplate `json:"template" validate:"required"` + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } - // assignment target account and type. - Target *AssignmentTargetDetails `json:"target" validate:"required"` + var rawResponse map[string]json.RawMessage + response, err = iamPolicyManagement.Service.Request(request, &rawResponse) + if err != nil { + core.EnrichHTTPProblem(err, "list_role_templates", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoleTemplateCollection) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } - // The action control assignment status. - Status *string `json:"status,omitempty"` + return } -// Constants associated with the ActionControlAssignment.Operation property. -// The current operation of the action control assignment. -const ( - ActionControlAssignmentOperationApplyConst = "apply" - ActionControlAssignmentOperationCreateConst = "create" - ActionControlAssignmentOperationRemoveConst = "remove" - ActionControlAssignmentOperationUpdateConst = "update" -) - -// Constants associated with the ActionControlAssignment.Status property. -// The action control assignment status. -const ( - ActionControlAssignmentStatusAcceptedConst = "accepted" - ActionControlAssignmentStatusFailureConst = "failure" - ActionControlAssignmentStatusInProgressConst = "in_progress" - ActionControlAssignmentStatusSupersededConst = "superseded" -) +// CreateRoleTemplate : Create role template +// Create a role template. Role templates define roles from an existing system or service defined role. +func (iamPolicyManagement *IamPolicyManagementV1) CreateRoleTemplate(createRoleTemplateOptions *CreateRoleTemplateOptions) (result *RoleTemplate, response *core.DetailedResponse, err error) { + result, response, err = iamPolicyManagement.CreateRoleTemplateWithContext(context.Background(), createRoleTemplateOptions) + err = core.RepurposeSDKProblem(err, "") + return +} -// UnmarshalActionControlAssignment unmarshals an instance of ActionControlAssignment from the specified map of raw messages. -func UnmarshalActionControlAssignment(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ActionControlAssignment) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) +// CreateRoleTemplateWithContext is an alternate form of the CreateRoleTemplate method which supports a Context parameter +func (iamPolicyManagement *IamPolicyManagementV1) CreateRoleTemplateWithContext(ctx context.Context, createRoleTemplateOptions *CreateRoleTemplateOptions) (result *RoleTemplate, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createRoleTemplateOptions, "createRoleTemplateOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "account_id", &obj.AccountID) + err = core.ValidateStruct(createRoleTemplateOptions, "createRoleTemplateOptions") if err != nil { - err = core.SDKErrorf(err, "", "account_id-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) + + builder := core.NewRequestBuilder(core.POST) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/role_templates`, nil) if err != nil { - err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) - return + + sdkHeaders := common.GetSdkHeaders("iam_policy_management", "V1", "CreateRoleTemplate") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) } - err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) - if err != nil { - err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) - return + + for headerName, headerValue := range createRoleTemplateOptions.Headers { + builder.AddHeader(headerName, headerValue) } - err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) - if err != nil { - err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) - return + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") + if createRoleTemplateOptions.AcceptLanguage != nil { + builder.AddHeader("Accept-Language", fmt.Sprint(*createRoleTemplateOptions.AcceptLanguage)) } - err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) - if err != nil { - err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) - return + + body := make(map[string]interface{}) + if createRoleTemplateOptions.Name != nil { + body["name"] = createRoleTemplateOptions.Name } - err = core.UnmarshalPrimitive(m, "operation", &obj.Operation) - if err != nil { - err = core.SDKErrorf(err, "", "operation-error", common.GetComponentInfo()) - return + if createRoleTemplateOptions.AccountID != nil { + body["account_id"] = createRoleTemplateOptions.AccountID } - err = core.UnmarshalModel(m, "resources", &obj.Resources, UnmarshalActionControlAssignmentResource) - if err != nil { - err = core.SDKErrorf(err, "", "resources-error", common.GetComponentInfo()) - return + if createRoleTemplateOptions.Description != nil { + body["description"] = createRoleTemplateOptions.Description } - err = core.UnmarshalModel(m, "template", &obj.Template, UnmarshalActionControlAssignmentTemplate) + if createRoleTemplateOptions.Committed != nil { + body["committed"] = createRoleTemplateOptions.Committed + } + if createRoleTemplateOptions.Role != nil { + body["role"] = createRoleTemplateOptions.Role + } + _, err = builder.SetBodyContentJSON(body) if err != nil { - err = core.SDKErrorf(err, "", "template-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalAssignmentTargetDetails) + + request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "target-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) + + var rawResponse map[string]json.RawMessage + response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { - err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) + core.EnrichHTTPProblem(err, "create_role_template", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoleTemplate) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + return } -// ActionControlAssignmentCollection : A collection of action control assignments. -type ActionControlAssignmentCollection struct { - // The number of documents to include per each page of the collection. - Limit *int64 `json:"limit,omitempty"` - - // Details with linking href to first page of requested collection. - First *First `json:"first,omitempty"` - - // Details with href linking to the following page of requested collection. - Next *Next `json:"next,omitempty"` - - // Details with linking href to previous page of requested collection. - Previous *Previous `json:"previous,omitempty"` - - // List of action control assignments. - Assignments []ActionControlAssignment `json:"assignments" validate:"required"` +// GetRoleTemplate : Retrieve the latest version of a role template +// Retrieve the latest version of a role template by providing a role template ID. +func (iamPolicyManagement *IamPolicyManagementV1) GetRoleTemplate(getRoleTemplateOptions *GetRoleTemplateOptions) (result *RoleTemplate, response *core.DetailedResponse, err error) { + result, response, err = iamPolicyManagement.GetRoleTemplateWithContext(context.Background(), getRoleTemplateOptions) + err = core.RepurposeSDKProblem(err, "") + return } -// UnmarshalActionControlAssignmentCollection unmarshals an instance of ActionControlAssignmentCollection from the specified map of raw messages. -func UnmarshalActionControlAssignmentCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ActionControlAssignmentCollection) - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) +// GetRoleTemplateWithContext is an alternate form of the GetRoleTemplate method which supports a Context parameter +func (iamPolicyManagement *IamPolicyManagementV1) GetRoleTemplateWithContext(ctx context.Context, getRoleTemplateOptions *GetRoleTemplateOptions) (result *RoleTemplate, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getRoleTemplateOptions, "getRoleTemplateOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalFirst) + err = core.ValidateStruct(getRoleTemplateOptions, "getRoleTemplateOptions") if err != nil { - err = core.SDKErrorf(err, "", "first-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalNext) + + pathParamsMap := map[string]string{ + "role_template_id": *getRoleTemplateOptions.RoleTemplateID, + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/role_templates/{role_template_id}`, pathParamsMap) if err != nil { - err = core.SDKErrorf(err, "", "next-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "previous", &obj.Previous, UnmarshalPrevious) + + sdkHeaders := common.GetSdkHeaders("iam_policy_management", "V1", "GetRoleTemplate") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range getRoleTemplateOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + if getRoleTemplateOptions.State != nil { + builder.AddQuery("state", fmt.Sprint(*getRoleTemplateOptions.State)) + } + + request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "previous-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "assignments", &obj.Assignments, UnmarshalActionControlAssignment) + + var rawResponse map[string]json.RawMessage + response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { - err = core.SDKErrorf(err, "", "assignments-error", common.GetComponentInfo()) + core.EnrichHTTPProblem(err, "get_role_template", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoleTemplate) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + return } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *ActionControlAssignmentCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - return resp.Next.Start, nil +// DeleteRoleTemplate : Delete a Role template +// Delete a role template by providing the role template ID. This deletes all versions of this template. A role template +// can't be deleted if any version of the template is assigned to one or more child accounts. You must remove the role +// assignments first. +func (iamPolicyManagement *IamPolicyManagementV1) DeleteRoleTemplate(deleteRoleTemplateOptions *DeleteRoleTemplateOptions) (response *core.DetailedResponse, err error) { + response, err = iamPolicyManagement.DeleteRoleTemplateWithContext(context.Background(), deleteRoleTemplateOptions) + err = core.RepurposeSDKProblem(err, "") + return } -// ActionControlAssignmentResource : The action control assignment resources and target where the template is assigned. -type ActionControlAssignmentResource struct { - // assignment target account and type. - Target *AssignmentTargetDetails `json:"target" validate:"required"` +// DeleteRoleTemplateWithContext is an alternate form of the DeleteRoleTemplate method which supports a Context parameter +func (iamPolicyManagement *IamPolicyManagementV1) DeleteRoleTemplateWithContext(ctx context.Context, deleteRoleTemplateOptions *DeleteRoleTemplateOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteRoleTemplateOptions, "deleteRoleTemplateOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(deleteRoleTemplateOptions, "deleteRoleTemplateOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } - // Set of properties of the assigned resource or error message if assignment failed. - ActionControl *ActionControlAssignmentResourceActionControl `json:"action_control,omitempty"` -} + pathParamsMap := map[string]string{ + "role_template_id": *deleteRoleTemplateOptions.RoleTemplateID, + } -// UnmarshalActionControlAssignmentResource unmarshals an instance of ActionControlAssignmentResource from the specified map of raw messages. -func UnmarshalActionControlAssignmentResource(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ActionControlAssignmentResource) - err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalAssignmentTargetDetails) + builder := core.NewRequestBuilder(core.DELETE) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/role_templates/{role_template_id}`, pathParamsMap) if err != nil { - err = core.SDKErrorf(err, "", "target-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "action_control", &obj.ActionControl, UnmarshalActionControlAssignmentResourceActionControl) + + sdkHeaders := common.GetSdkHeaders("iam_policy_management", "V1", "DeleteRoleTemplate") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range deleteRoleTemplateOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "action_control-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + + response, err = iamPolicyManagement.Service.Request(request, nil) + if err != nil { + core.EnrichHTTPProblem(err, "delete_role_template", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + return } -// ActionControlAssignmentResourceActionControl : Set of properties of the assigned resource or error message if assignment failed. -type ActionControlAssignmentResourceActionControl struct { - // On success, it includes the action control assigned. - ResourceCreated *ActionControlAssignmentResourceCreated `json:"resource_created,omitempty"` - - // Body parameters for assignment error. - ErrorMessage *AssignmentResourceError `json:"error_message,omitempty"` +// CreateRoleTemplateVersion : Create a new role template version +// Create a new version of a role template. Use this if you need to make updates to a role template that is committed. +func (iamPolicyManagement *IamPolicyManagementV1) CreateRoleTemplateVersion(createRoleTemplateVersionOptions *CreateRoleTemplateVersionOptions) (result *RoleTemplate, response *core.DetailedResponse, err error) { + result, response, err = iamPolicyManagement.CreateRoleTemplateVersionWithContext(context.Background(), createRoleTemplateVersionOptions) + err = core.RepurposeSDKProblem(err, "") + return } -// UnmarshalActionControlAssignmentResourceActionControl unmarshals an instance of ActionControlAssignmentResourceActionControl from the specified map of raw messages. -func UnmarshalActionControlAssignmentResourceActionControl(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ActionControlAssignmentResourceActionControl) - err = core.UnmarshalModel(m, "resource_created", &obj.ResourceCreated, UnmarshalActionControlAssignmentResourceCreated) +// CreateRoleTemplateVersionWithContext is an alternate form of the CreateRoleTemplateVersion method which supports a Context parameter +func (iamPolicyManagement *IamPolicyManagementV1) CreateRoleTemplateVersionWithContext(ctx context.Context, createRoleTemplateVersionOptions *CreateRoleTemplateVersionOptions) (result *RoleTemplate, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createRoleTemplateVersionOptions, "createRoleTemplateVersionOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "resource_created-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "error_message", &obj.ErrorMessage, UnmarshalAssignmentResourceError) + err = core.ValidateStruct(createRoleTemplateVersionOptions, "createRoleTemplateVersionOptions") if err != nil { - err = core.SDKErrorf(err, "", "error_message-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} -// ActionControlAssignmentResourceCreated : On success, it includes the action control assigned. -type ActionControlAssignmentResourceCreated struct { - // action control id. - ID *string `json:"id,omitempty"` -} + pathParamsMap := map[string]string{ + "role_template_id": *createRoleTemplateVersionOptions.RoleTemplateID, + } -// UnmarshalActionControlAssignmentResourceCreated unmarshals an instance of ActionControlAssignmentResourceCreated from the specified map of raw messages. -func UnmarshalActionControlAssignmentResourceCreated(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ActionControlAssignmentResourceCreated) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + builder := core.NewRequestBuilder(core.POST) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/role_templates/{role_template_id}/versions`, pathParamsMap) if err != nil { - err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} -// ActionControlAssignmentTemplate : The action control template id and version that will be assigned. -type ActionControlAssignmentTemplate struct { - // Action control template ID. - ID *string `json:"id" validate:"required"` + sdkHeaders := common.GetSdkHeaders("iam_policy_management", "V1", "CreateRoleTemplateVersion") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } - // Action control template version. - Version *string `json:"version" validate:"required"` -} + for headerName, headerValue := range createRoleTemplateVersionOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") -// NewActionControlAssignmentTemplate : Instantiate ActionControlAssignmentTemplate (Generic Model Constructor) -func (*IamPolicyManagementV1) NewActionControlAssignmentTemplate(id string, version string) (_model *ActionControlAssignmentTemplate, err error) { - _model = &ActionControlAssignmentTemplate{ - ID: core.StringPtr(id), - Version: core.StringPtr(version), + body := make(map[string]interface{}) + if createRoleTemplateVersionOptions.Name != nil { + body["name"] = createRoleTemplateVersionOptions.Name } - err = core.ValidateStruct(_model, "required parameters") + if createRoleTemplateVersionOptions.Description != nil { + body["description"] = createRoleTemplateVersionOptions.Description + } + if createRoleTemplateVersionOptions.Role != nil { + body["role"] = createRoleTemplateVersionOptions.Role + } + if createRoleTemplateVersionOptions.Committed != nil { + body["committed"] = createRoleTemplateVersionOptions.Committed + } + _, err = builder.SetBodyContentJSON(body) if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) + return } - return -} -// UnmarshalActionControlAssignmentTemplate unmarshals an instance of ActionControlAssignmentTemplate from the specified map of raw messages. -func UnmarshalActionControlAssignmentTemplate(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ActionControlAssignmentTemplate) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "version", &obj.Version) + + var rawResponse map[string]json.RawMessage + response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { - err = core.SDKErrorf(err, "", "version-error", common.GetComponentInfo()) + core.EnrichHTTPProblem(err, "create_role_template_version", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoleTemplate) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + return } -// ActionControlTemplate : The set of properties associated with the action control template. -type ActionControlTemplate struct { - // Required field when creating a new template. Otherwise, this field is optional. If the field is included, it changes - // the name value for all existing versions of the template. - Name *string `json:"name" validate:"required"` - - // Description of the action control template. This is shown to users in the enterprise account. Use this to describe - // the purpose or context of the action control for enterprise users managing IAM templates. - Description *string `json:"description" validate:"required"` - - // Enterprise account ID where this template is created. - AccountID *string `json:"account_id" validate:"required"` - - // Committed status of the template. If committed is set to true, then the template version can no longer be updated. - Committed *bool `json:"committed,omitempty"` - - // The action control properties that are created in an action resource when the template is assigned. - ActionControl *TemplateActionControl `json:"action_control,omitempty"` - - // The action control template ID. - ID *string `json:"id,omitempty"` - - // The href URL that links to the action control templates API by action control template ID. - Href *string `json:"href,omitempty"` - - // The UTC timestamp when the action control template was created. - CreatedAt *strfmt.DateTime `json:"created_at,omitempty"` - - // The IAM ID of the entity that created the action control template. - CreatedByID *string `json:"created_by_id,omitempty"` - - // The UTC timestamp when the action control template was last modified. - LastModifiedAt *strfmt.DateTime `json:"last_modified_at,omitempty"` - - // The IAM ID of the entity that last modified the action control template. - LastModifiedByID *string `json:"last_modified_by_id,omitempty"` - - // The version number of the template used to identify different versions of same template. - Version *string `json:"version" validate:"required"` - - // State of action control template. - State *string `json:"state" validate:"required"` +// ListRoleTemplateVersions : Retrieve role template versions +// Retrieve the versions of a role template by providing a role template ID. +func (iamPolicyManagement *IamPolicyManagementV1) ListRoleTemplateVersions(listRoleTemplateVersionsOptions *ListRoleTemplateVersionsOptions) (result *RoleTemplateVersionsCollection, response *core.DetailedResponse, err error) { + result, response, err = iamPolicyManagement.ListRoleTemplateVersionsWithContext(context.Background(), listRoleTemplateVersionsOptions) + err = core.RepurposeSDKProblem(err, "") + return } -// Constants associated with the ActionControlTemplate.State property. -// State of action control template. -const ( - ActionControlTemplateStateActiveConst = "active" - ActionControlTemplateStateDeletedConst = "deleted" -) - -// UnmarshalActionControlTemplate unmarshals an instance of ActionControlTemplate from the specified map of raw messages. -func UnmarshalActionControlTemplate(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ActionControlTemplate) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// ListRoleTemplateVersionsWithContext is an alternate form of the ListRoleTemplateVersions method which supports a Context parameter +func (iamPolicyManagement *IamPolicyManagementV1) ListRoleTemplateVersionsWithContext(ctx context.Context, listRoleTemplateVersionsOptions *ListRoleTemplateVersionsOptions) (result *RoleTemplateVersionsCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listRoleTemplateVersionsOptions, "listRoleTemplateVersionsOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "description", &obj.Description) + err = core.ValidateStruct(listRoleTemplateVersionsOptions, "listRoleTemplateVersionsOptions") if err != nil { - err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "account_id", &obj.AccountID) - if err != nil { - err = core.SDKErrorf(err, "", "account_id-error", common.GetComponentInfo()) - return + + pathParamsMap := map[string]string{ + "role_template_id": *listRoleTemplateVersionsOptions.RoleTemplateID, } - err = core.UnmarshalPrimitive(m, "committed", &obj.Committed) + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/role_templates/{role_template_id}/versions`, pathParamsMap) if err != nil { - err = core.SDKErrorf(err, "", "committed-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "action_control", &obj.ActionControl, UnmarshalTemplateActionControl) - if err != nil { - err = core.SDKErrorf(err, "", "action_control-error", common.GetComponentInfo()) - return + + sdkHeaders := common.GetSdkHeaders("iam_policy_management", "V1", "ListRoleTemplateVersions") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) - return + + for headerName, headerValue := range listRoleTemplateVersionsOptions.Headers { + builder.AddHeader(headerName, headerValue) } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) - return + builder.AddHeader("Accept", "application/json") + + if listRoleTemplateVersionsOptions.State != nil { + builder.AddQuery("state", fmt.Sprint(*listRoleTemplateVersionsOptions.State)) } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) - return + if listRoleTemplateVersionsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listRoleTemplateVersionsOptions.Limit)) } - err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) - if err != nil { - err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) - return + if listRoleTemplateVersionsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listRoleTemplateVersionsOptions.Start)) } - err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) + + request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) + + var rawResponse map[string]json.RawMessage + response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { - err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) + core.EnrichHTTPProblem(err, "list_role_template_versions", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "version", &obj.Version) - if err != nil { - err = core.SDKErrorf(err, "", "version-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "state", &obj.State) - if err != nil { - err = core.SDKErrorf(err, "", "state-error", common.GetComponentInfo()) - return + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoleTemplateVersionsCollection) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ActionControlTemplateCollection : A collection of action control templates. -type ActionControlTemplateCollection struct { - // The number of documents to include per each page of the collection. - Limit *int64 `json:"limit,omitempty"` - - // Details with linking href to first page of requested collection. - First *First `json:"first,omitempty"` - - // Details with href linking to the following page of requested collection. - Next *Next `json:"next,omitempty"` - - // Details with linking href to previous page of requested collection. - Previous *Previous `json:"previous,omitempty"` - - // List of action control templates. - ActionControlTemplates []ActionControlTemplate `json:"action_control_templates" validate:"required"` +// ReplaceRoleTemplate : Update a role template version +// Update a specific version of a role template. You can use this only if the version isn't committed. +func (iamPolicyManagement *IamPolicyManagementV1) ReplaceRoleTemplate(replaceRoleTemplateOptions *ReplaceRoleTemplateOptions) (result *RoleTemplate, response *core.DetailedResponse, err error) { + result, response, err = iamPolicyManagement.ReplaceRoleTemplateWithContext(context.Background(), replaceRoleTemplateOptions) + err = core.RepurposeSDKProblem(err, "") + return } -// UnmarshalActionControlTemplateCollection unmarshals an instance of ActionControlTemplateCollection from the specified map of raw messages. -func UnmarshalActionControlTemplateCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ActionControlTemplateCollection) - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) +// ReplaceRoleTemplateWithContext is an alternate form of the ReplaceRoleTemplate method which supports a Context parameter +func (iamPolicyManagement *IamPolicyManagementV1) ReplaceRoleTemplateWithContext(ctx context.Context, replaceRoleTemplateOptions *ReplaceRoleTemplateOptions) (result *RoleTemplate, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(replaceRoleTemplateOptions, "replaceRoleTemplateOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalFirst) + err = core.ValidateStruct(replaceRoleTemplateOptions, "replaceRoleTemplateOptions") if err != nil { - err = core.SDKErrorf(err, "", "first-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalNext) + + pathParamsMap := map[string]string{ + "role_template_id": *replaceRoleTemplateOptions.RoleTemplateID, + "version": *replaceRoleTemplateOptions.Version, + } + + builder := core.NewRequestBuilder(core.PUT) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/role_templates/{role_template_id}/versions/{version}`, pathParamsMap) if err != nil { - err = core.SDKErrorf(err, "", "next-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "previous", &obj.Previous, UnmarshalPrevious) + + sdkHeaders := common.GetSdkHeaders("iam_policy_management", "V1", "ReplaceRoleTemplate") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range replaceRoleTemplateOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") + if replaceRoleTemplateOptions.IfMatch != nil { + builder.AddHeader("If-Match", fmt.Sprint(*replaceRoleTemplateOptions.IfMatch)) + } + + body := make(map[string]interface{}) + if replaceRoleTemplateOptions.Name != nil { + body["name"] = replaceRoleTemplateOptions.Name + } + if replaceRoleTemplateOptions.Description != nil { + body["description"] = replaceRoleTemplateOptions.Description + } + if replaceRoleTemplateOptions.Role != nil { + body["role"] = replaceRoleTemplateOptions.Role + } + if replaceRoleTemplateOptions.Committed != nil { + body["committed"] = replaceRoleTemplateOptions.Committed + } + _, err = builder.SetBodyContentJSON(body) if err != nil { - err = core.SDKErrorf(err, "", "previous-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "action_control_templates", &obj.ActionControlTemplates, UnmarshalActionControlTemplate) + + request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "action_control_templates-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} -// Retrieve the value to be passed to a request to access the next page of results -func (resp *ActionControlTemplateCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil + var rawResponse map[string]json.RawMessage + response, err = iamPolicyManagement.Service.Request(request, &rawResponse) + if err != nil { + core.EnrichHTTPProblem(err, "replace_role_template", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoleTemplate) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result } - return resp.Next.Start, nil -} - -// ActionControlTemplateVersionsCollection : A collection of versions for a specific action control template. -type ActionControlTemplateVersionsCollection struct { - // The number of documents to include per each page of the collection. - Limit *int64 `json:"limit,omitempty"` - - // Details with linking href to first page of requested collection. - First *First `json:"first,omitempty"` - - // Details with href linking to the following page of requested collection. - Next *Next `json:"next,omitempty"` - // Details with linking href to previous page of requested collection. - Previous *Previous `json:"previous,omitempty"` + return +} - // List of action control templates versions. - Versions []ActionControlTemplate `json:"versions" validate:"required"` +// DeleteRoleTemplateVersion : Delete a role template version +// Delete a specific version of a role template by providing a role template ID and version number. You can't delete a +// role template version that is assigned to one or more child accounts. You must remove the role assignments first. +func (iamPolicyManagement *IamPolicyManagementV1) DeleteRoleTemplateVersion(deleteRoleTemplateVersionOptions *DeleteRoleTemplateVersionOptions) (response *core.DetailedResponse, err error) { + response, err = iamPolicyManagement.DeleteRoleTemplateVersionWithContext(context.Background(), deleteRoleTemplateVersionOptions) + err = core.RepurposeSDKProblem(err, "") + return } -// UnmarshalActionControlTemplateVersionsCollection unmarshals an instance of ActionControlTemplateVersionsCollection from the specified map of raw messages. -func UnmarshalActionControlTemplateVersionsCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ActionControlTemplateVersionsCollection) - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) +// DeleteRoleTemplateVersionWithContext is an alternate form of the DeleteRoleTemplateVersion method which supports a Context parameter +func (iamPolicyManagement *IamPolicyManagementV1) DeleteRoleTemplateVersionWithContext(ctx context.Context, deleteRoleTemplateVersionOptions *DeleteRoleTemplateVersionOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteRoleTemplateVersionOptions, "deleteRoleTemplateVersionOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalFirst) + err = core.ValidateStruct(deleteRoleTemplateVersionOptions, "deleteRoleTemplateVersionOptions") if err != nil { - err = core.SDKErrorf(err, "", "first-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalNext) - if err != nil { - err = core.SDKErrorf(err, "", "next-error", common.GetComponentInfo()) - return + + pathParamsMap := map[string]string{ + "role_template_id": *deleteRoleTemplateVersionOptions.RoleTemplateID, + "version": *deleteRoleTemplateVersionOptions.Version, } - err = core.UnmarshalModel(m, "previous", &obj.Previous, UnmarshalPrevious) + + builder := core.NewRequestBuilder(core.DELETE) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/role_templates/{role_template_id}/versions/{version}`, pathParamsMap) if err != nil { - err = core.SDKErrorf(err, "", "previous-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "versions", &obj.Versions, UnmarshalActionControlTemplate) - if err != nil { - err = core.SDKErrorf(err, "", "versions-error", common.GetComponentInfo()) - return + + sdkHeaders := common.GetSdkHeaders("iam_policy_management", "V1", "DeleteRoleTemplateVersion") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} -// Retrieve the value to be passed to a request to access the next page of results -func (resp *ActionControlTemplateVersionsCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil + for headerName, headerValue := range deleteRoleTemplateVersionOptions.Headers { + builder.AddHeader(headerName, headerValue) } - return resp.Next.Start, nil -} -// AssignmentResourceCreated : On success, includes the policy that is assigned. -type AssignmentResourceCreated struct { - // Policy id. - ID *string `json:"id,omitempty"` -} + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } -// UnmarshalAssignmentResourceCreated unmarshals an instance of AssignmentResourceCreated from the specified map of raw messages. -func UnmarshalAssignmentResourceCreated(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(AssignmentResourceCreated) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + response, err = iamPolicyManagement.Service.Request(request, nil) if err != nil { - err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + core.EnrichHTTPProblem(err, "delete_role_template_version", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// AssignmentResourceError : Body parameters for assignment error. -type AssignmentResourceError struct { - // Name of the error. - Name *string `json:"name,omitempty"` - - // error code. - ErrorCode *string `json:"errorCode,omitempty"` - - // Error message detailing the nature of the error. - Message *string `json:"message,omitempty"` - - // Internal status code for the error. - Code *string `json:"code,omitempty"` - - // The errors encountered during the response. - Errors []ErrorObject `json:"errors,omitempty"` +// GetRoleTemplateVersion : Retrieve a role template version +// Retrieve a role template by providing a role template ID and version number. +func (iamPolicyManagement *IamPolicyManagementV1) GetRoleTemplateVersion(getRoleTemplateVersionOptions *GetRoleTemplateVersionOptions) (result *RoleTemplate, response *core.DetailedResponse, err error) { + result, response, err = iamPolicyManagement.GetRoleTemplateVersionWithContext(context.Background(), getRoleTemplateVersionOptions) + err = core.RepurposeSDKProblem(err, "") + return } -// UnmarshalAssignmentResourceError unmarshals an instance of AssignmentResourceError from the specified map of raw messages. -func UnmarshalAssignmentResourceError(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(AssignmentResourceError) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// GetRoleTemplateVersionWithContext is an alternate form of the GetRoleTemplateVersion method which supports a Context parameter +func (iamPolicyManagement *IamPolicyManagementV1) GetRoleTemplateVersionWithContext(ctx context.Context, getRoleTemplateVersionOptions *GetRoleTemplateVersionOptions) (result *RoleTemplate, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getRoleTemplateVersionOptions, "getRoleTemplateVersionOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "errorCode", &obj.ErrorCode) + err = core.ValidateStruct(getRoleTemplateVersionOptions, "getRoleTemplateVersionOptions") if err != nil { - err = core.SDKErrorf(err, "", "errorCode-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "message", &obj.Message) + + pathParamsMap := map[string]string{ + "role_template_id": *getRoleTemplateVersionOptions.RoleTemplateID, + "version": *getRoleTemplateVersionOptions.Version, + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/role_templates/{role_template_id}/versions/{version}`, pathParamsMap) if err != nil { - err = core.SDKErrorf(err, "", "message-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "code", &obj.Code) + + sdkHeaders := common.GetSdkHeaders("iam_policy_management", "V1", "GetRoleTemplateVersion") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range getRoleTemplateVersionOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "code-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "errors", &obj.Errors, UnmarshalErrorObject) + + var rawResponse map[string]json.RawMessage + response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { - err = core.SDKErrorf(err, "", "errors-error", common.GetComponentInfo()) + core.EnrichHTTPProblem(err, "get_role_template_version", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoleTemplate) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + return } -// AssignmentTargetDetails : assignment target account and type. -type AssignmentTargetDetails struct { - // Assignment target type. - Type *string `json:"type" validate:"required"` - - // ID of the target account. - ID *string `json:"id" validate:"required"` +// CommitRoleTemplate : Commit a role template version +// Commit a role template version. You cannot make any further changes to the role template once it's committed. If you +// have to make updates after committing a version, create a new version. +func (iamPolicyManagement *IamPolicyManagementV1) CommitRoleTemplate(commitRoleTemplateOptions *CommitRoleTemplateOptions) (response *core.DetailedResponse, err error) { + response, err = iamPolicyManagement.CommitRoleTemplateWithContext(context.Background(), commitRoleTemplateOptions) + err = core.RepurposeSDKProblem(err, "") + return } -// Constants associated with the AssignmentTargetDetails.Type property. -// Assignment target type. -const ( - AssignmentTargetDetailsTypeAccountConst = "Account" -) - -// NewAssignmentTargetDetails : Instantiate AssignmentTargetDetails (Generic Model Constructor) -func (*IamPolicyManagementV1) NewAssignmentTargetDetails(typeVar string, id string) (_model *AssignmentTargetDetails, err error) { - _model = &AssignmentTargetDetails{ - Type: core.StringPtr(typeVar), - ID: core.StringPtr(id), - } - err = core.ValidateStruct(_model, "required parameters") +// CommitRoleTemplateWithContext is an alternate form of the CommitRoleTemplate method which supports a Context parameter +func (iamPolicyManagement *IamPolicyManagementV1) CommitRoleTemplateWithContext(ctx context.Context, commitRoleTemplateOptions *CommitRoleTemplateOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(commitRoleTemplateOptions, "commitRoleTemplateOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return } - return -} - -// UnmarshalAssignmentTargetDetails unmarshals an instance of AssignmentTargetDetails from the specified map of raw messages. -func UnmarshalAssignmentTargetDetails(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(AssignmentTargetDetails) - err = core.UnmarshalPrimitive(m, "type", &obj.Type) + err = core.ValidateStruct(commitRoleTemplateOptions, "commitRoleTemplateOptions") if err != nil { - err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + + pathParamsMap := map[string]string{ + "role_template_id": *commitRoleTemplateOptions.RoleTemplateID, + "version": *commitRoleTemplateOptions.Version, + } + + builder := core.NewRequestBuilder(core.POST) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/role_templates/{role_template_id}/versions/{version}/commit`, pathParamsMap) if err != nil { - err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} -// AssignmentTemplateDetails : policy template details. -type AssignmentTemplateDetails struct { - // Policy template ID. - ID *string `json:"id,omitempty"` + sdkHeaders := common.GetSdkHeaders("iam_policy_management", "V1", "CommitRoleTemplate") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } - // Policy template version. - Version *string `json:"version,omitempty"` -} + for headerName, headerValue := range commitRoleTemplateOptions.Headers { + builder.AddHeader(headerName, headerValue) + } -// UnmarshalAssignmentTemplateDetails unmarshals an instance of AssignmentTemplateDetails from the specified map of raw messages. -func UnmarshalAssignmentTemplateDetails(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(AssignmentTemplateDetails) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) + request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "version", &obj.Version) + + response, err = iamPolicyManagement.Service.Request(request, nil) if err != nil { - err = core.SDKErrorf(err, "", "version-error", common.GetComponentInfo()) + core.EnrichHTTPProblem(err, "commit_role_template", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// CommitActionControlTemplateOptions : The CommitActionControlTemplate options. -type CommitActionControlTemplateOptions struct { - // Action control template ID. - ActionControlTemplateID *string `json:"action_control_template_id" validate:"required,ne="` - - // The action control template version. - Version *string `json:"version" validate:"required,ne="` - - // Allows users to set headers on API requests. - Headers map[string]string +// ListRoleAssignments : Get role template assignments +// Get role template assignments by attributes. The following attributes are supported: +// `account_id`, `template_id`, `template_version`, `target`, `target_type`, `limit`, `start`. +// `account_id` is a required query parameter. Only role template assignments with the specified attributes and +// accessible by the caller are returned. If the caller does not have read access to any role template assignments, an +// empty array is returned. +func (iamPolicyManagement *IamPolicyManagementV1) ListRoleAssignments(listRoleAssignmentsOptions *ListRoleAssignmentsOptions) (result *RoleAssignmentCollection, response *core.DetailedResponse, err error) { + result, response, err = iamPolicyManagement.ListRoleAssignmentsWithContext(context.Background(), listRoleAssignmentsOptions) + err = core.RepurposeSDKProblem(err, "") + return } -// NewCommitActionControlTemplateOptions : Instantiate CommitActionControlTemplateOptions -func (*IamPolicyManagementV1) NewCommitActionControlTemplateOptions(actionControlTemplateID string, version string) *CommitActionControlTemplateOptions { - return &CommitActionControlTemplateOptions{ - ActionControlTemplateID: core.StringPtr(actionControlTemplateID), - Version: core.StringPtr(version), +// ListRoleAssignmentsWithContext is an alternate form of the ListRoleAssignments method which supports a Context parameter +func (iamPolicyManagement *IamPolicyManagementV1) ListRoleAssignmentsWithContext(ctx context.Context, listRoleAssignmentsOptions *ListRoleAssignmentsOptions) (result *RoleAssignmentCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listRoleAssignmentsOptions, "listRoleAssignmentsOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(listRoleAssignmentsOptions, "listRoleAssignmentsOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return } -} - -// SetActionControlTemplateID : Allow user to set ActionControlTemplateID -func (_options *CommitActionControlTemplateOptions) SetActionControlTemplateID(actionControlTemplateID string) *CommitActionControlTemplateOptions { - _options.ActionControlTemplateID = core.StringPtr(actionControlTemplateID) - return _options -} -// SetVersion : Allow user to set Version -func (_options *CommitActionControlTemplateOptions) SetVersion(version string) *CommitActionControlTemplateOptions { - _options.Version = core.StringPtr(version) - return _options -} + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/role_assignments`, nil) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } -// SetHeaders : Allow user to set Headers -func (options *CommitActionControlTemplateOptions) SetHeaders(param map[string]string) *CommitActionControlTemplateOptions { - options.Headers = param - return options -} + sdkHeaders := common.GetSdkHeaders("iam_policy_management", "V1", "ListRoleAssignments") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } -// CommitPolicyTemplateOptions : The CommitPolicyTemplate options. -type CommitPolicyTemplateOptions struct { - // The policy template ID. - PolicyTemplateID *string `json:"policy_template_id" validate:"required,ne="` + for headerName, headerValue := range listRoleAssignmentsOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + if listRoleAssignmentsOptions.AcceptLanguage != nil { + builder.AddHeader("Accept-Language", fmt.Sprint(*listRoleAssignmentsOptions.AcceptLanguage)) + } - // The policy template version. - Version *string `json:"version" validate:"required,ne="` + builder.AddQuery("account_id", fmt.Sprint(*listRoleAssignmentsOptions.AccountID)) + if listRoleAssignmentsOptions.TemplateID != nil { + builder.AddQuery("template_id", fmt.Sprint(*listRoleAssignmentsOptions.TemplateID)) + } + if listRoleAssignmentsOptions.TemplateVersion != nil { + builder.AddQuery("template_version", fmt.Sprint(*listRoleAssignmentsOptions.TemplateVersion)) + } + if listRoleAssignmentsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listRoleAssignmentsOptions.Limit)) + } + if listRoleAssignmentsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listRoleAssignmentsOptions.Start)) + } - // Allows users to set headers on API requests. - Headers map[string]string -} + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } -// NewCommitPolicyTemplateOptions : Instantiate CommitPolicyTemplateOptions -func (*IamPolicyManagementV1) NewCommitPolicyTemplateOptions(policyTemplateID string, version string) *CommitPolicyTemplateOptions { - return &CommitPolicyTemplateOptions{ - PolicyTemplateID: core.StringPtr(policyTemplateID), - Version: core.StringPtr(version), + var rawResponse map[string]json.RawMessage + response, err = iamPolicyManagement.Service.Request(request, &rawResponse) + if err != nil { + core.EnrichHTTPProblem(err, "list_role_assignments", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoleAssignmentCollection) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result } -} -// SetPolicyTemplateID : Allow user to set PolicyTemplateID -func (_options *CommitPolicyTemplateOptions) SetPolicyTemplateID(policyTemplateID string) *CommitPolicyTemplateOptions { - _options.PolicyTemplateID = core.StringPtr(policyTemplateID) - return _options + return } -// SetVersion : Allow user to set Version -func (_options *CommitPolicyTemplateOptions) SetVersion(version string) *CommitPolicyTemplateOptions { - _options.Version = core.StringPtr(version) - return _options +// CreateRoleTemplateAssignment : Create a role template assignment +// Assign a role template to child accounts and account groups. This creates the role in the accounts and account groups +// that you specify. +func (iamPolicyManagement *IamPolicyManagementV1) CreateRoleTemplateAssignment(createRoleTemplateAssignmentOptions *CreateRoleTemplateAssignmentOptions) (result *RoleAssignmentCollection, response *core.DetailedResponse, err error) { + result, response, err = iamPolicyManagement.CreateRoleTemplateAssignmentWithContext(context.Background(), createRoleTemplateAssignmentOptions) + err = core.RepurposeSDKProblem(err, "") + return } -// SetHeaders : Allow user to set Headers -func (options *CommitPolicyTemplateOptions) SetHeaders(param map[string]string) *CommitPolicyTemplateOptions { - options.Headers = param - return options -} +// CreateRoleTemplateAssignmentWithContext is an alternate form of the CreateRoleTemplateAssignment method which supports a Context parameter +func (iamPolicyManagement *IamPolicyManagementV1) CreateRoleTemplateAssignmentWithContext(ctx context.Context, createRoleTemplateAssignmentOptions *CreateRoleTemplateAssignmentOptions) (result *RoleAssignmentCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createRoleTemplateAssignmentOptions, "createRoleTemplateAssignmentOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(createRoleTemplateAssignmentOptions, "createRoleTemplateAssignmentOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } -// ConflictsWith : Details of conflicting resource. -type ConflictsWith struct { - // The revision number of the resource. - Etag *string `json:"etag,omitempty"` + builder := core.NewRequestBuilder(core.POST) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/role_assignments`, nil) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } - // The conflicting role of ID. - Role *string `json:"role,omitempty"` + sdkHeaders := common.GetSdkHeaders("iam_policy_management", "V1", "CreateRoleTemplateAssignment") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } - // The conflicting policy ID. - Policy *string `json:"policy,omitempty"` -} + for headerName, headerValue := range createRoleTemplateAssignmentOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") + if createRoleTemplateAssignmentOptions.AcceptLanguage != nil { + builder.AddHeader("Accept-Language", fmt.Sprint(*createRoleTemplateAssignmentOptions.AcceptLanguage)) + } -// UnmarshalConflictsWith unmarshals an instance of ConflictsWith from the specified map of raw messages. -func UnmarshalConflictsWith(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ConflictsWith) - err = core.UnmarshalPrimitive(m, "etag", &obj.Etag) + body := make(map[string]interface{}) + if createRoleTemplateAssignmentOptions.Target != nil { + body["target"] = createRoleTemplateAssignmentOptions.Target + } + if createRoleTemplateAssignmentOptions.Templates != nil { + body["templates"] = createRoleTemplateAssignmentOptions.Templates + } + _, err = builder.SetBodyContentJSON(body) if err != nil { - err = core.SDKErrorf(err, "", "etag-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "role", &obj.Role) + + request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "role-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "policy", &obj.Policy) + + var rawResponse map[string]json.RawMessage + response, err = iamPolicyManagement.Service.Request(request, &rawResponse) if err != nil { - err = core.SDKErrorf(err, "", "policy-error", common.GetComponentInfo()) + core.EnrichHTTPProblem(err, "create_role_template_assignment", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoleAssignmentCollection) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + return } -// Control : Specifies the type of access that is granted by the policy. -type Control struct { - // Permission is granted by the policy. - Grant *Grant `json:"grant" validate:"required"` +// GetRoleAssignment : Retrieve a role assignment +// Retrieve a role template assignment by providing a role assignment ID. +func (iamPolicyManagement *IamPolicyManagementV1) GetRoleAssignment(getRoleAssignmentOptions *GetRoleAssignmentOptions) (result *RoleAssignment, response *core.DetailedResponse, err error) { + result, response, err = iamPolicyManagement.GetRoleAssignmentWithContext(context.Background(), getRoleAssignmentOptions) + err = core.RepurposeSDKProblem(err, "") + return } -// NewControl : Instantiate Control (Generic Model Constructor) -func (*IamPolicyManagementV1) NewControl(grant *Grant) (_model *Control, err error) { - _model = &Control{ - Grant: grant, - } - err = core.ValidateStruct(_model, "required parameters") +// GetRoleAssignmentWithContext is an alternate form of the GetRoleAssignment method which supports a Context parameter +func (iamPolicyManagement *IamPolicyManagementV1) GetRoleAssignmentWithContext(ctx context.Context, getRoleAssignmentOptions *GetRoleAssignmentOptions) (result *RoleAssignment, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getRoleAssignmentOptions, "getRoleAssignmentOptions cannot be nil") if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return } - return -} - -// UnmarshalControl unmarshals an instance of Control from the specified map of raw messages. -func UnmarshalControl(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Control) - err = core.UnmarshalModel(m, "grant", &obj.Grant, UnmarshalGrant) + err = core.ValidateStruct(getRoleAssignmentOptions, "getRoleAssignmentOptions") if err != nil { - err = core.SDKErrorf(err, "", "grant-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} -// ControlResponse : ControlResponse struct -// Models which "extend" this model: -// - ControlResponseControl -// - ControlResponseControlWithEnrichedRoles -type ControlResponse struct { - // Permission is granted by the policy. - Grant *Grant `json:"grant,omitempty"` -} -func (*ControlResponse) isaControlResponse() bool { - return true -} + pathParamsMap := map[string]string{ + "assignment_id": *getRoleAssignmentOptions.AssignmentID, + } -type ControlResponseIntf interface { - isaControlResponse() bool -} + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/role_assignments/{assignment_id}`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } -// UnmarshalControlResponse unmarshals an instance of ControlResponse from the specified map of raw messages. -func UnmarshalControlResponse(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ControlResponse) - err = core.UnmarshalModel(m, "grant", &obj.Grant, UnmarshalGrant) + sdkHeaders := common.GetSdkHeaders("iam_policy_management", "V1", "GetRoleAssignment") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range getRoleAssignmentOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + request, err := builder.Build() if err != nil { - err = core.SDKErrorf(err, "", "grant-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + + var rawResponse map[string]json.RawMessage + response, err = iamPolicyManagement.Service.Request(request, &rawResponse) + if err != nil { + core.EnrichHTTPProblem(err, "get_role_assignment", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoleAssignment) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + return } -// CreateActionControlTemplateAssignmentOptions : The CreateActionControlTemplateAssignment options. -type CreateActionControlTemplateAssignmentOptions struct { - // assignment target account and type. - Target *AssignmentTargetDetails `json:"target" validate:"required"` +// UpdateRoleAssignment : Update a role assignment +// Update a role assignment by providing a role assignment ID. +func (iamPolicyManagement *IamPolicyManagementV1) UpdateRoleAssignment(updateRoleAssignmentOptions *UpdateRoleAssignmentOptions) (result *RoleAssignment, response *core.DetailedResponse, err error) { + result, response, err = iamPolicyManagement.UpdateRoleAssignmentWithContext(context.Background(), updateRoleAssignmentOptions) + err = core.RepurposeSDKProblem(err, "") + return +} - // List of action control template details for action control assignment. - Templates []ActionControlAssignmentTemplate `json:"templates" validate:"required"` +// UpdateRoleAssignmentWithContext is an alternate form of the UpdateRoleAssignment method which supports a Context parameter +func (iamPolicyManagement *IamPolicyManagementV1) UpdateRoleAssignmentWithContext(ctx context.Context, updateRoleAssignmentOptions *UpdateRoleAssignmentOptions) (result *RoleAssignment, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateRoleAssignmentOptions, "updateRoleAssignmentOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(updateRoleAssignmentOptions, "updateRoleAssignmentOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } - // Language code for translations - // * `default` - English - // * `de` - German (Standard) - // * `en` - English - // * `es` - Spanish (Spain) - // * `fr` - French (Standard) - // * `it` - Italian (Standard) - // * `ja` - Japanese - // * `ko` - Korean - // * `pt-br` - Portuguese (Brazil) - // * `zh-cn` - Chinese (Simplified, PRC) - // * `zh-tw` - (Chinese, Taiwan). - AcceptLanguage *string `json:"Accept-Language,omitempty"` + pathParamsMap := map[string]string{ + "assignment_id": *updateRoleAssignmentOptions.AssignmentID, + } - // Allows users to set headers on API requests. - Headers map[string]string -} + builder := core.NewRequestBuilder(core.PATCH) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/role_assignments/{assignment_id}`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } -// NewCreateActionControlTemplateAssignmentOptions : Instantiate CreateActionControlTemplateAssignmentOptions -func (*IamPolicyManagementV1) NewCreateActionControlTemplateAssignmentOptions(target *AssignmentTargetDetails, templates []ActionControlAssignmentTemplate) *CreateActionControlTemplateAssignmentOptions { - return &CreateActionControlTemplateAssignmentOptions{ - Target: target, - Templates: templates, + sdkHeaders := common.GetSdkHeaders("iam_policy_management", "V1", "UpdateRoleAssignment") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) } -} -// SetTarget : Allow user to set Target -func (_options *CreateActionControlTemplateAssignmentOptions) SetTarget(target *AssignmentTargetDetails) *CreateActionControlTemplateAssignmentOptions { - _options.Target = target - return _options -} + for headerName, headerValue := range updateRoleAssignmentOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") + if updateRoleAssignmentOptions.IfMatch != nil { + builder.AddHeader("If-Match", fmt.Sprint(*updateRoleAssignmentOptions.IfMatch)) + } -// SetTemplates : Allow user to set Templates -func (_options *CreateActionControlTemplateAssignmentOptions) SetTemplates(templates []ActionControlAssignmentTemplate) *CreateActionControlTemplateAssignmentOptions { - _options.Templates = templates - return _options -} + body := make(map[string]interface{}) + if updateRoleAssignmentOptions.TemplateVersion != nil { + body["template_version"] = updateRoleAssignmentOptions.TemplateVersion + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) + return + } -// SetAcceptLanguage : Allow user to set AcceptLanguage -func (_options *CreateActionControlTemplateAssignmentOptions) SetAcceptLanguage(acceptLanguage string) *CreateActionControlTemplateAssignmentOptions { - _options.AcceptLanguage = core.StringPtr(acceptLanguage) - return _options -} + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } -// SetHeaders : Allow user to set Headers -func (options *CreateActionControlTemplateAssignmentOptions) SetHeaders(param map[string]string) *CreateActionControlTemplateAssignmentOptions { - options.Headers = param - return options + var rawResponse map[string]json.RawMessage + response, err = iamPolicyManagement.Service.Request(request, &rawResponse) + if err != nil { + core.EnrichHTTPProblem(err, "update_role_assignment", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalRoleAssignment) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + + return } -// CreateActionControlTemplateOptions : The CreateActionControlTemplate options. -type CreateActionControlTemplateOptions struct { - // Required field when creating a new template. Otherwise, this field is optional. If the field is included, it changes - // the name value for all existing versions of the template. - Name *string `json:"name" validate:"required"` +// DeleteRoleAssignment : Remove a role assignment +// Remove a role template assignment by providing a role assignment ID. You can't delete a role assignment if the status +// is "in_progress". +func (iamPolicyManagement *IamPolicyManagementV1) DeleteRoleAssignment(deleteRoleAssignmentOptions *DeleteRoleAssignmentOptions) (response *core.DetailedResponse, err error) { + response, err = iamPolicyManagement.DeleteRoleAssignmentWithContext(context.Background(), deleteRoleAssignmentOptions) + err = core.RepurposeSDKProblem(err, "") + return +} - // Enterprise account ID where this template is created. - AccountID *string `json:"account_id" validate:"required"` +// DeleteRoleAssignmentWithContext is an alternate form of the DeleteRoleAssignment method which supports a Context parameter +func (iamPolicyManagement *IamPolicyManagementV1) DeleteRoleAssignmentWithContext(ctx context.Context, deleteRoleAssignmentOptions *DeleteRoleAssignmentOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteRoleAssignmentOptions, "deleteRoleAssignmentOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(deleteRoleAssignmentOptions, "deleteRoleAssignmentOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } - // Description of the action control template. This is shown to users in the enterprise account. Use this to describe - // the purpose or context of the action control for enterprise users managing IAM templates. - Description *string `json:"description,omitempty"` + pathParamsMap := map[string]string{ + "assignment_id": *deleteRoleAssignmentOptions.AssignmentID, + } - // Committed status of the template. If committed is set to true, then the template version can no longer be updated. - Committed *bool `json:"committed,omitempty"` + builder := core.NewRequestBuilder(core.DELETE) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = iamPolicyManagement.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(iamPolicyManagement.Service.Options.URL, `/v1/role_assignments/{assignment_id}`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } - // The action control properties that are created in an action resource when the template is assigned. - ActionControl *TemplateActionControl `json:"action_control,omitempty"` + sdkHeaders := common.GetSdkHeaders("iam_policy_management", "V1", "DeleteRoleAssignment") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } - // Language code for translations - // * `default` - English - // * `de` - German (Standard) - // * `en` - English - // * `es` - Spanish (Spain) - // * `fr` - French (Standard) - // * `it` - Italian (Standard) - // * `ja` - Japanese - // * `ko` - Korean - // * `pt-br` - Portuguese (Brazil) - // * `zh-cn` - Chinese (Simplified, PRC) - // * `zh-tw` - (Chinese, Taiwan). - AcceptLanguage *string `json:"Accept-Language,omitempty"` + for headerName, headerValue := range deleteRoleAssignmentOptions.Headers { + builder.AddHeader(headerName, headerValue) + } - // Allows users to set headers on API requests. - Headers map[string]string -} + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } -// NewCreateActionControlTemplateOptions : Instantiate CreateActionControlTemplateOptions -func (*IamPolicyManagementV1) NewCreateActionControlTemplateOptions(name string, accountID string) *CreateActionControlTemplateOptions { - return &CreateActionControlTemplateOptions{ - Name: core.StringPtr(name), - AccountID: core.StringPtr(accountID), + response, err = iamPolicyManagement.Service.Request(request, nil) + if err != nil { + core.EnrichHTTPProblem(err, "delete_role_assignment", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return } -} -// SetName : Allow user to set Name -func (_options *CreateActionControlTemplateOptions) SetName(name string) *CreateActionControlTemplateOptions { - _options.Name = core.StringPtr(name) - return _options + return +} +func getServiceComponentInfo() *core.ProblemComponent { + return core.NewProblemComponent(DefaultServiceName, "1.0.1") } -// SetAccountID : Allow user to set AccountID -func (_options *CreateActionControlTemplateOptions) SetAccountID(accountID string) *CreateActionControlTemplateOptions { - _options.AccountID = core.StringPtr(accountID) - return _options +// AccountSettingsAccessManagement : The Access Management Account Settings that are currently set for the requested account. +type AccountSettingsAccessManagement struct { + // How external accounts can interact in relation to the requested account. + ExternalAccountIdentityInteraction *ExternalAccountIdentityInteraction `json:"external_account_identity_interaction" validate:"required"` } -// SetDescription : Allow user to set Description -func (_options *CreateActionControlTemplateOptions) SetDescription(description string) *CreateActionControlTemplateOptions { - _options.Description = core.StringPtr(description) - return _options +// UnmarshalAccountSettingsAccessManagement unmarshals an instance of AccountSettingsAccessManagement from the specified map of raw messages. +func UnmarshalAccountSettingsAccessManagement(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(AccountSettingsAccessManagement) + err = core.UnmarshalModel(m, "external_account_identity_interaction", &obj.ExternalAccountIdentityInteraction, UnmarshalExternalAccountIdentityInteraction) + if err != nil { + err = core.SDKErrorf(err, "", "external_account_identity_interaction-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetCommitted : Allow user to set Committed -func (_options *CreateActionControlTemplateOptions) SetCommitted(committed bool) *CreateActionControlTemplateOptions { - _options.Committed = core.BoolPtr(committed) +// ActionControlAssignment : The set of properties associated with the assigned action control template. +type ActionControlAssignment struct { + // Action control assignment ID. + ID *string `json:"id,omitempty"` + + // The account GUID that the action control assignments belong to. + AccountID *string `json:"account_id,omitempty"` + + // The href URL that links to the action control assignments API by action control assignment ID. + Href *string `json:"href,omitempty"` + + // The UTC timestamp when the action control assignment was created. + CreatedAt *strfmt.DateTime `json:"created_at,omitempty"` + + // The IAM ID of the entity that created the action control assignment. + CreatedByID *string `json:"created_by_id,omitempty"` + + // The UTC timestamp when the action control assignment was last modified. + LastModifiedAt *strfmt.DateTime `json:"last_modified_at,omitempty"` + + // The IAM ID of the entity that last modified the action control assignment. + LastModifiedByID *string `json:"last_modified_by_id,omitempty"` + + // The current operation of the action control assignment. + Operation *string `json:"operation,omitempty"` + + // Resources created when action control template is assigned. + Resources []ActionControlAssignmentResource `json:"resources,omitempty"` + + // The action control template id and version that will be assigned. + Template *ActionControlAssignmentTemplate `json:"template" validate:"required"` + + // assignment target account and type. + Target *AssignmentTargetDetails `json:"target" validate:"required"` + + // The action control assignment status. + Status *string `json:"status,omitempty"` +} + +// Constants associated with the ActionControlAssignment.Operation property. +// The current operation of the action control assignment. +const ( + ActionControlAssignmentOperationApplyConst = "apply" + ActionControlAssignmentOperationCreateConst = "create" + ActionControlAssignmentOperationRemoveConst = "remove" + ActionControlAssignmentOperationUpdateConst = "update" +) + +// Constants associated with the ActionControlAssignment.Status property. +// The action control assignment status. +const ( + ActionControlAssignmentStatusAcceptedConst = "accepted" + ActionControlAssignmentStatusFailureConst = "failure" + ActionControlAssignmentStatusInProgressConst = "in_progress" + ActionControlAssignmentStatusSupersededConst = "superseded" +) + +// UnmarshalActionControlAssignment unmarshals an instance of ActionControlAssignment from the specified map of raw messages. +func UnmarshalActionControlAssignment(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ActionControlAssignment) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "account_id", &obj.AccountID) + if err != nil { + err = core.SDKErrorf(err, "", "account_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) + if err != nil { + err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) + if err != nil { + err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) + if err != nil { + err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "operation", &obj.Operation) + if err != nil { + err = core.SDKErrorf(err, "", "operation-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "resources", &obj.Resources, UnmarshalActionControlAssignmentResource) + if err != nil { + err = core.SDKErrorf(err, "", "resources-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "template", &obj.Template, UnmarshalActionControlAssignmentTemplate) + if err != nil { + err = core.SDKErrorf(err, "", "template-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalAssignmentTargetDetails) + if err != nil { + err = core.SDKErrorf(err, "", "target-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ActionControlAssignmentCollection : A collection of action control assignments. +type ActionControlAssignmentCollection struct { + // The number of documents to include per each page of the collection. + Limit *int64 `json:"limit,omitempty"` + + // Details with linking href to first page of requested collection. + First *First `json:"first,omitempty"` + + // Details with href linking to the following page of requested collection. + Next *Next `json:"next,omitempty"` + + // Details with linking href to previous page of requested collection. + Previous *Previous `json:"previous,omitempty"` + + // List of action control assignments. + Assignments []ActionControlAssignment `json:"assignments" validate:"required"` +} + +// UnmarshalActionControlAssignmentCollection unmarshals an instance of ActionControlAssignmentCollection from the specified map of raw messages. +func UnmarshalActionControlAssignmentCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ActionControlAssignmentCollection) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalFirst) + if err != nil { + err = core.SDKErrorf(err, "", "first-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalNext) + if err != nil { + err = core.SDKErrorf(err, "", "next-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "previous", &obj.Previous, UnmarshalPrevious) + if err != nil { + err = core.SDKErrorf(err, "", "previous-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "assignments", &obj.Assignments, UnmarshalActionControlAssignment) + if err != nil { + err = core.SDKErrorf(err, "", "assignments-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// Retrieve the value to be passed to a request to access the next page of results +func (resp *ActionControlAssignmentCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + return resp.Next.Start, nil +} + +// ActionControlAssignmentResource : The action control assignment resources and target where the template is assigned. +type ActionControlAssignmentResource struct { + // assignment target account and type. + Target *AssignmentTargetDetails `json:"target" validate:"required"` + + // Set of properties of the assigned resource or error message if assignment failed. + ActionControl *ActionControlAssignmentResourceActionControl `json:"action_control,omitempty"` +} + +// UnmarshalActionControlAssignmentResource unmarshals an instance of ActionControlAssignmentResource from the specified map of raw messages. +func UnmarshalActionControlAssignmentResource(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ActionControlAssignmentResource) + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalAssignmentTargetDetails) + if err != nil { + err = core.SDKErrorf(err, "", "target-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "action_control", &obj.ActionControl, UnmarshalActionControlAssignmentResourceActionControl) + if err != nil { + err = core.SDKErrorf(err, "", "action_control-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ActionControlAssignmentResourceActionControl : Set of properties of the assigned resource or error message if assignment failed. +type ActionControlAssignmentResourceActionControl struct { + // On success, it includes the action control assigned. + ResourceCreated *ActionControlAssignmentResourceCreated `json:"resource_created,omitempty"` + + // Body parameters for assignment error. + ErrorMessage *AssignmentResourceError `json:"error_message,omitempty"` +} + +// UnmarshalActionControlAssignmentResourceActionControl unmarshals an instance of ActionControlAssignmentResourceActionControl from the specified map of raw messages. +func UnmarshalActionControlAssignmentResourceActionControl(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ActionControlAssignmentResourceActionControl) + err = core.UnmarshalModel(m, "resource_created", &obj.ResourceCreated, UnmarshalActionControlAssignmentResourceCreated) + if err != nil { + err = core.SDKErrorf(err, "", "resource_created-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "error_message", &obj.ErrorMessage, UnmarshalAssignmentResourceError) + if err != nil { + err = core.SDKErrorf(err, "", "error_message-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ActionControlAssignmentResourceCreated : On success, it includes the action control assigned. +type ActionControlAssignmentResourceCreated struct { + // action control id. + ID *string `json:"id,omitempty"` +} + +// UnmarshalActionControlAssignmentResourceCreated unmarshals an instance of ActionControlAssignmentResourceCreated from the specified map of raw messages. +func UnmarshalActionControlAssignmentResourceCreated(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ActionControlAssignmentResourceCreated) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ActionControlAssignmentTemplate : The action control template id and version that will be assigned. +type ActionControlAssignmentTemplate struct { + // Action control template ID. + ID *string `json:"id" validate:"required"` + + // Action control template version. + Version *string `json:"version" validate:"required"` +} + +// NewActionControlAssignmentTemplate : Instantiate ActionControlAssignmentTemplate (Generic Model Constructor) +func (*IamPolicyManagementV1) NewActionControlAssignmentTemplate(id string, version string) (_model *ActionControlAssignmentTemplate, err error) { + _model = &ActionControlAssignmentTemplate{ + ID: core.StringPtr(id), + Version: core.StringPtr(version), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +// UnmarshalActionControlAssignmentTemplate unmarshals an instance of ActionControlAssignmentTemplate from the specified map of raw messages. +func UnmarshalActionControlAssignmentTemplate(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ActionControlAssignmentTemplate) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "version", &obj.Version) + if err != nil { + err = core.SDKErrorf(err, "", "version-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ActionControlTemplate : The set of properties associated with the action control template. +type ActionControlTemplate struct { + // Required field when creating a new template. Otherwise, this field is optional. If the field is included, it changes + // the name value for all existing versions of the template. + Name *string `json:"name" validate:"required"` + + // Description of the action control template. This is shown to users in the enterprise account. Use this to describe + // the purpose or context of the action control for enterprise users managing IAM templates. + Description *string `json:"description" validate:"required"` + + // Enterprise account ID where this template is created. + AccountID *string `json:"account_id" validate:"required"` + + // Committed status of the template. If committed is set to true, then the template version can no longer be updated. + Committed *bool `json:"committed,omitempty"` + + // The action control properties that are created in an action resource when the template is assigned. + ActionControl *TemplateActionControl `json:"action_control,omitempty"` + + // The action control template ID. + ID *string `json:"id,omitempty"` + + // The href URL that links to the action control templates API by action control template ID. + Href *string `json:"href,omitempty"` + + // The UTC timestamp when the action control template was created. + CreatedAt *strfmt.DateTime `json:"created_at,omitempty"` + + // The IAM ID of the entity that created the action control template. + CreatedByID *string `json:"created_by_id,omitempty"` + + // The UTC timestamp when the action control template was last modified. + LastModifiedAt *strfmt.DateTime `json:"last_modified_at,omitempty"` + + // The IAM ID of the entity that last modified the action control template. + LastModifiedByID *string `json:"last_modified_by_id,omitempty"` + + // The version number of the template used to identify different versions of same template. + Version *string `json:"version" validate:"required"` + + // State of action control template. + State *string `json:"state" validate:"required"` +} + +// Constants associated with the ActionControlTemplate.State property. +// State of action control template. +const ( + ActionControlTemplateStateActiveConst = "active" + ActionControlTemplateStateDeletedConst = "deleted" +) + +// UnmarshalActionControlTemplate unmarshals an instance of ActionControlTemplate from the specified map of raw messages. +func UnmarshalActionControlTemplate(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ActionControlTemplate) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "description", &obj.Description) + if err != nil { + err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "account_id", &obj.AccountID) + if err != nil { + err = core.SDKErrorf(err, "", "account_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "committed", &obj.Committed) + if err != nil { + err = core.SDKErrorf(err, "", "committed-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "action_control", &obj.ActionControl, UnmarshalTemplateActionControl) + if err != nil { + err = core.SDKErrorf(err, "", "action_control-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) + if err != nil { + err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) + if err != nil { + err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) + if err != nil { + err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "version", &obj.Version) + if err != nil { + err = core.SDKErrorf(err, "", "version-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "state", &obj.State) + if err != nil { + err = core.SDKErrorf(err, "", "state-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ActionControlTemplateCollection : A collection of action control templates. +type ActionControlTemplateCollection struct { + // The number of documents to include per each page of the collection. + Limit *int64 `json:"limit,omitempty"` + + // Details with linking href to first page of requested collection. + First *First `json:"first,omitempty"` + + // Details with href linking to the following page of requested collection. + Next *Next `json:"next,omitempty"` + + // Details with linking href to previous page of requested collection. + Previous *Previous `json:"previous,omitempty"` + + // List of action control templates. + ActionControlTemplates []ActionControlTemplate `json:"action_control_templates" validate:"required"` +} + +// UnmarshalActionControlTemplateCollection unmarshals an instance of ActionControlTemplateCollection from the specified map of raw messages. +func UnmarshalActionControlTemplateCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ActionControlTemplateCollection) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalFirst) + if err != nil { + err = core.SDKErrorf(err, "", "first-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalNext) + if err != nil { + err = core.SDKErrorf(err, "", "next-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "previous", &obj.Previous, UnmarshalPrevious) + if err != nil { + err = core.SDKErrorf(err, "", "previous-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "action_control_templates", &obj.ActionControlTemplates, UnmarshalActionControlTemplate) + if err != nil { + err = core.SDKErrorf(err, "", "action_control_templates-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// Retrieve the value to be passed to a request to access the next page of results +func (resp *ActionControlTemplateCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + return resp.Next.Start, nil +} + +// ActionControlTemplateVersionsCollection : A collection of versions for a specific action control template. +type ActionControlTemplateVersionsCollection struct { + // The number of documents to include per each page of the collection. + Limit *int64 `json:"limit,omitempty"` + + // Details with linking href to first page of requested collection. + First *First `json:"first,omitempty"` + + // Details with href linking to the following page of requested collection. + Next *Next `json:"next,omitempty"` + + // Details with linking href to previous page of requested collection. + Previous *Previous `json:"previous,omitempty"` + + // List of action control templates versions. + Versions []ActionControlTemplate `json:"versions" validate:"required"` +} + +// UnmarshalActionControlTemplateVersionsCollection unmarshals an instance of ActionControlTemplateVersionsCollection from the specified map of raw messages. +func UnmarshalActionControlTemplateVersionsCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ActionControlTemplateVersionsCollection) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalFirst) + if err != nil { + err = core.SDKErrorf(err, "", "first-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalNext) + if err != nil { + err = core.SDKErrorf(err, "", "next-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "previous", &obj.Previous, UnmarshalPrevious) + if err != nil { + err = core.SDKErrorf(err, "", "previous-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "versions", &obj.Versions, UnmarshalActionControlTemplate) + if err != nil { + err = core.SDKErrorf(err, "", "versions-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// Retrieve the value to be passed to a request to access the next page of results +func (resp *ActionControlTemplateVersionsCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + return resp.Next.Start, nil +} + +// AssignmentResourceCreated : On success, includes the policy that is assigned. +type AssignmentResourceCreated struct { + // Policy id. + ID *string `json:"id,omitempty"` +} + +// UnmarshalAssignmentResourceCreated unmarshals an instance of AssignmentResourceCreated from the specified map of raw messages. +func UnmarshalAssignmentResourceCreated(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(AssignmentResourceCreated) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AssignmentResourceError : Body parameters for assignment error. +type AssignmentResourceError struct { + // Name of the error. + Name *string `json:"name,omitempty"` + + // error code. + ErrorCode *string `json:"errorCode,omitempty"` + + // Error message detailing the nature of the error. + Message *string `json:"message,omitempty"` + + // Internal status code for the error. + Code *string `json:"code,omitempty"` + + // The errors encountered during the response. + Errors []ErrorObject `json:"errors,omitempty"` +} + +// UnmarshalAssignmentResourceError unmarshals an instance of AssignmentResourceError from the specified map of raw messages. +func UnmarshalAssignmentResourceError(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(AssignmentResourceError) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "errorCode", &obj.ErrorCode) + if err != nil { + err = core.SDKErrorf(err, "", "errorCode-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + err = core.SDKErrorf(err, "", "message-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + err = core.SDKErrorf(err, "", "code-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "errors", &obj.Errors, UnmarshalErrorObject) + if err != nil { + err = core.SDKErrorf(err, "", "errors-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AssignmentTargetDetails : assignment target account and type. +type AssignmentTargetDetails struct { + // Assignment target type. + Type *string `json:"type" validate:"required"` + + // ID of the target account. + ID *string `json:"id" validate:"required"` +} + +// Constants associated with the AssignmentTargetDetails.Type property. +// Assignment target type. +const ( + AssignmentTargetDetailsTypeAccountConst = "Account" +) + +// NewAssignmentTargetDetails : Instantiate AssignmentTargetDetails (Generic Model Constructor) +func (*IamPolicyManagementV1) NewAssignmentTargetDetails(typeVar string, id string) (_model *AssignmentTargetDetails, err error) { + _model = &AssignmentTargetDetails{ + Type: core.StringPtr(typeVar), + ID: core.StringPtr(id), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +// UnmarshalAssignmentTargetDetails unmarshals an instance of AssignmentTargetDetails from the specified map of raw messages. +func UnmarshalAssignmentTargetDetails(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(AssignmentTargetDetails) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AssignmentTemplateDetails : policy template details. +type AssignmentTemplateDetails struct { + // Policy template ID. + ID *string `json:"id,omitempty"` + + // Policy template version. + Version *string `json:"version,omitempty"` +} + +// UnmarshalAssignmentTemplateDetails unmarshals an instance of AssignmentTemplateDetails from the specified map of raw messages. +func UnmarshalAssignmentTemplateDetails(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(AssignmentTemplateDetails) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "version", &obj.Version) + if err != nil { + err = core.SDKErrorf(err, "", "version-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// CommitActionControlTemplateOptions : The CommitActionControlTemplate options. +type CommitActionControlTemplateOptions struct { + // Action control template ID. + ActionControlTemplateID *string `json:"action_control_template_id" validate:"required,ne="` + + // The action control template version. + Version *string `json:"version" validate:"required,ne="` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewCommitActionControlTemplateOptions : Instantiate CommitActionControlTemplateOptions +func (*IamPolicyManagementV1) NewCommitActionControlTemplateOptions(actionControlTemplateID string, version string) *CommitActionControlTemplateOptions { + return &CommitActionControlTemplateOptions{ + ActionControlTemplateID: core.StringPtr(actionControlTemplateID), + Version: core.StringPtr(version), + } +} + +// SetActionControlTemplateID : Allow user to set ActionControlTemplateID +func (_options *CommitActionControlTemplateOptions) SetActionControlTemplateID(actionControlTemplateID string) *CommitActionControlTemplateOptions { + _options.ActionControlTemplateID = core.StringPtr(actionControlTemplateID) + return _options +} + +// SetVersion : Allow user to set Version +func (_options *CommitActionControlTemplateOptions) SetVersion(version string) *CommitActionControlTemplateOptions { + _options.Version = core.StringPtr(version) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *CommitActionControlTemplateOptions) SetHeaders(param map[string]string) *CommitActionControlTemplateOptions { + options.Headers = param + return options +} + +// CommitPolicyTemplateOptions : The CommitPolicyTemplate options. +type CommitPolicyTemplateOptions struct { + // The policy template ID. + PolicyTemplateID *string `json:"policy_template_id" validate:"required,ne="` + + // The policy template version. + Version *string `json:"version" validate:"required,ne="` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewCommitPolicyTemplateOptions : Instantiate CommitPolicyTemplateOptions +func (*IamPolicyManagementV1) NewCommitPolicyTemplateOptions(policyTemplateID string, version string) *CommitPolicyTemplateOptions { + return &CommitPolicyTemplateOptions{ + PolicyTemplateID: core.StringPtr(policyTemplateID), + Version: core.StringPtr(version), + } +} + +// SetPolicyTemplateID : Allow user to set PolicyTemplateID +func (_options *CommitPolicyTemplateOptions) SetPolicyTemplateID(policyTemplateID string) *CommitPolicyTemplateOptions { + _options.PolicyTemplateID = core.StringPtr(policyTemplateID) + return _options +} + +// SetVersion : Allow user to set Version +func (_options *CommitPolicyTemplateOptions) SetVersion(version string) *CommitPolicyTemplateOptions { + _options.Version = core.StringPtr(version) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *CommitPolicyTemplateOptions) SetHeaders(param map[string]string) *CommitPolicyTemplateOptions { + options.Headers = param + return options +} + +// CommitRoleTemplateOptions : The CommitRoleTemplate options. +type CommitRoleTemplateOptions struct { + // Role template ID. + RoleTemplateID *string `json:"role_template_id" validate:"required,ne="` + + // The role template version. + Version *string `json:"version" validate:"required,ne="` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewCommitRoleTemplateOptions : Instantiate CommitRoleTemplateOptions +func (*IamPolicyManagementV1) NewCommitRoleTemplateOptions(roleTemplateID string, version string) *CommitRoleTemplateOptions { + return &CommitRoleTemplateOptions{ + RoleTemplateID: core.StringPtr(roleTemplateID), + Version: core.StringPtr(version), + } +} + +// SetRoleTemplateID : Allow user to set RoleTemplateID +func (_options *CommitRoleTemplateOptions) SetRoleTemplateID(roleTemplateID string) *CommitRoleTemplateOptions { + _options.RoleTemplateID = core.StringPtr(roleTemplateID) + return _options +} + +// SetVersion : Allow user to set Version +func (_options *CommitRoleTemplateOptions) SetVersion(version string) *CommitRoleTemplateOptions { + _options.Version = core.StringPtr(version) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *CommitRoleTemplateOptions) SetHeaders(param map[string]string) *CommitRoleTemplateOptions { + options.Headers = param + return options +} + +// ConflictsWith : Details of conflicting resource. +type ConflictsWith struct { + // The revision number of the resource. + Etag *string `json:"etag,omitempty"` + + // The conflicting role of ID. + Role *string `json:"role,omitempty"` + + // The conflicting policy ID. + Policy *string `json:"policy,omitempty"` +} + +// UnmarshalConflictsWith unmarshals an instance of ConflictsWith from the specified map of raw messages. +func UnmarshalConflictsWith(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ConflictsWith) + err = core.UnmarshalPrimitive(m, "etag", &obj.Etag) + if err != nil { + err = core.SDKErrorf(err, "", "etag-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "role", &obj.Role) + if err != nil { + err = core.SDKErrorf(err, "", "role-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "policy", &obj.Policy) + if err != nil { + err = core.SDKErrorf(err, "", "policy-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// Control : Specifies the type of access that is granted by the policy. +type Control struct { + // Permission is granted by the policy. + Grant *Grant `json:"grant" validate:"required"` +} + +// NewControl : Instantiate Control (Generic Model Constructor) +func (*IamPolicyManagementV1) NewControl(grant *Grant) (_model *Control, err error) { + _model = &Control{ + Grant: grant, + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +// UnmarshalControl unmarshals an instance of Control from the specified map of raw messages. +func UnmarshalControl(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(Control) + err = core.UnmarshalModel(m, "grant", &obj.Grant, UnmarshalGrant) + if err != nil { + err = core.SDKErrorf(err, "", "grant-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ControlResponse : ControlResponse struct +// Models which "extend" this model: +// - ControlResponseControl +// - ControlResponseControlWithEnrichedRoles +type ControlResponse struct { + // Permission is granted by the policy. + Grant *Grant `json:"grant,omitempty"` +} +func (*ControlResponse) isaControlResponse() bool { + return true +} + +type ControlResponseIntf interface { + isaControlResponse() bool +} + +// UnmarshalControlResponse unmarshals an instance of ControlResponse from the specified map of raw messages. +func UnmarshalControlResponse(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ControlResponse) + err = core.UnmarshalModel(m, "grant", &obj.Grant, UnmarshalGrant) + if err != nil { + err = core.SDKErrorf(err, "", "grant-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// CreateActionControlTemplateAssignmentOptions : The CreateActionControlTemplateAssignment options. +type CreateActionControlTemplateAssignmentOptions struct { + // assignment target account and type. + Target *AssignmentTargetDetails `json:"target" validate:"required"` + + // List of action control template details for action control assignment. + Templates []ActionControlAssignmentTemplate `json:"templates" validate:"required"` + + // Language code for translations + // * `default` - English + // * `de` - German (Standard) + // * `en` - English + // * `es` - Spanish (Spain) + // * `fr` - French (Standard) + // * `it` - Italian (Standard) + // * `ja` - Japanese + // * `ko` - Korean + // * `pt-br` - Portuguese (Brazil) + // * `zh-cn` - Chinese (Simplified, PRC) + // * `zh-tw` - (Chinese, Taiwan). + AcceptLanguage *string `json:"Accept-Language,omitempty"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewCreateActionControlTemplateAssignmentOptions : Instantiate CreateActionControlTemplateAssignmentOptions +func (*IamPolicyManagementV1) NewCreateActionControlTemplateAssignmentOptions(target *AssignmentTargetDetails, templates []ActionControlAssignmentTemplate) *CreateActionControlTemplateAssignmentOptions { + return &CreateActionControlTemplateAssignmentOptions{ + Target: target, + Templates: templates, + } +} + +// SetTarget : Allow user to set Target +func (_options *CreateActionControlTemplateAssignmentOptions) SetTarget(target *AssignmentTargetDetails) *CreateActionControlTemplateAssignmentOptions { + _options.Target = target + return _options +} + +// SetTemplates : Allow user to set Templates +func (_options *CreateActionControlTemplateAssignmentOptions) SetTemplates(templates []ActionControlAssignmentTemplate) *CreateActionControlTemplateAssignmentOptions { + _options.Templates = templates + return _options +} + +// SetAcceptLanguage : Allow user to set AcceptLanguage +func (_options *CreateActionControlTemplateAssignmentOptions) SetAcceptLanguage(acceptLanguage string) *CreateActionControlTemplateAssignmentOptions { + _options.AcceptLanguage = core.StringPtr(acceptLanguage) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *CreateActionControlTemplateAssignmentOptions) SetHeaders(param map[string]string) *CreateActionControlTemplateAssignmentOptions { + options.Headers = param + return options +} + +// CreateActionControlTemplateOptions : The CreateActionControlTemplate options. +type CreateActionControlTemplateOptions struct { + // Required field when creating a new template. Otherwise, this field is optional. If the field is included, it changes + // the name value for all existing versions of the template. + Name *string `json:"name" validate:"required"` + + // Enterprise account ID where this template is created. + AccountID *string `json:"account_id" validate:"required"` + + // Description of the action control template. This is shown to users in the enterprise account. Use this to describe + // the purpose or context of the action control for enterprise users managing IAM templates. + Description *string `json:"description,omitempty"` + + // Committed status of the template. If committed is set to true, then the template version can no longer be updated. + Committed *bool `json:"committed,omitempty"` + + // The action control properties that are created in an action resource when the template is assigned. + ActionControl *TemplateActionControl `json:"action_control,omitempty"` + + // Language code for translations + // * `default` - English + // * `de` - German (Standard) + // * `en` - English + // * `es` - Spanish (Spain) + // * `fr` - French (Standard) + // * `it` - Italian (Standard) + // * `ja` - Japanese + // * `ko` - Korean + // * `pt-br` - Portuguese (Brazil) + // * `zh-cn` - Chinese (Simplified, PRC) + // * `zh-tw` - (Chinese, Taiwan). + AcceptLanguage *string `json:"Accept-Language,omitempty"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewCreateActionControlTemplateOptions : Instantiate CreateActionControlTemplateOptions +func (*IamPolicyManagementV1) NewCreateActionControlTemplateOptions(name string, accountID string) *CreateActionControlTemplateOptions { + return &CreateActionControlTemplateOptions{ + Name: core.StringPtr(name), + AccountID: core.StringPtr(accountID), + } +} + +// SetName : Allow user to set Name +func (_options *CreateActionControlTemplateOptions) SetName(name string) *CreateActionControlTemplateOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetAccountID : Allow user to set AccountID +func (_options *CreateActionControlTemplateOptions) SetAccountID(accountID string) *CreateActionControlTemplateOptions { + _options.AccountID = core.StringPtr(accountID) + return _options +} + +// SetDescription : Allow user to set Description +func (_options *CreateActionControlTemplateOptions) SetDescription(description string) *CreateActionControlTemplateOptions { + _options.Description = core.StringPtr(description) + return _options +} + +// SetCommitted : Allow user to set Committed +func (_options *CreateActionControlTemplateOptions) SetCommitted(committed bool) *CreateActionControlTemplateOptions { + _options.Committed = core.BoolPtr(committed) return _options } @@ -5673,51 +6862,205 @@ func (_options *CreatePolicyTemplateVersionOptions) SetPolicy(policy *TemplatePo return _options } -// SetName : Allow user to set Name -func (_options *CreatePolicyTemplateVersionOptions) SetName(name string) *CreatePolicyTemplateVersionOptions { - _options.Name = core.StringPtr(name) +// SetName : Allow user to set Name +func (_options *CreatePolicyTemplateVersionOptions) SetName(name string) *CreatePolicyTemplateVersionOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetDescription : Allow user to set Description +func (_options *CreatePolicyTemplateVersionOptions) SetDescription(description string) *CreatePolicyTemplateVersionOptions { + _options.Description = core.StringPtr(description) + return _options +} + +// SetCommitted : Allow user to set Committed +func (_options *CreatePolicyTemplateVersionOptions) SetCommitted(committed bool) *CreatePolicyTemplateVersionOptions { + _options.Committed = core.BoolPtr(committed) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *CreatePolicyTemplateVersionOptions) SetHeaders(param map[string]string) *CreatePolicyTemplateVersionOptions { + options.Headers = param + return options +} + +// CreateRoleOptions : The CreateRole options. +type CreateRoleOptions struct { + // The display the name of the role that is shown in the console. + DisplayName *string `json:"display_name" validate:"required"` + + // The actions of the role. For more information, see [IAM roles and + // actions](https://cloud.ibm.com/docs/account?topic=account-iam-service-roles-actions). + Actions []string `json:"actions" validate:"required"` + + // The name of the role that is used in the CRN. This must be alphanumeric and capitalized. + Name *string `json:"name" validate:"required"` + + // The account GUID. + AccountID *string `json:"account_id" validate:"required"` + + // The service name. + ServiceName *string `json:"service_name" validate:"required"` + + // The description of the role. + Description *string `json:"description,omitempty"` + + // Language code for translations + // * `default` - English + // * `de` - German (Standard) + // * `en` - English + // * `es` - Spanish (Spain) + // * `fr` - French (Standard) + // * `it` - Italian (Standard) + // * `ja` - Japanese + // * `ko` - Korean + // * `pt-br` - Portuguese (Brazil) + // * `zh-cn` - Chinese (Simplified, PRC) + // * `zh-tw` - (Chinese, Taiwan). + AcceptLanguage *string `json:"Accept-Language,omitempty"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewCreateRoleOptions : Instantiate CreateRoleOptions +func (*IamPolicyManagementV1) NewCreateRoleOptions(displayName string, actions []string, name string, accountID string, serviceName string) *CreateRoleOptions { + return &CreateRoleOptions{ + DisplayName: core.StringPtr(displayName), + Actions: actions, + Name: core.StringPtr(name), + AccountID: core.StringPtr(accountID), + ServiceName: core.StringPtr(serviceName), + } +} + +// SetDisplayName : Allow user to set DisplayName +func (_options *CreateRoleOptions) SetDisplayName(displayName string) *CreateRoleOptions { + _options.DisplayName = core.StringPtr(displayName) + return _options +} + +// SetActions : Allow user to set Actions +func (_options *CreateRoleOptions) SetActions(actions []string) *CreateRoleOptions { + _options.Actions = actions + return _options +} + +// SetName : Allow user to set Name +func (_options *CreateRoleOptions) SetName(name string) *CreateRoleOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetAccountID : Allow user to set AccountID +func (_options *CreateRoleOptions) SetAccountID(accountID string) *CreateRoleOptions { + _options.AccountID = core.StringPtr(accountID) + return _options +} + +// SetServiceName : Allow user to set ServiceName +func (_options *CreateRoleOptions) SetServiceName(serviceName string) *CreateRoleOptions { + _options.ServiceName = core.StringPtr(serviceName) + return _options +} + +// SetDescription : Allow user to set Description +func (_options *CreateRoleOptions) SetDescription(description string) *CreateRoleOptions { + _options.Description = core.StringPtr(description) + return _options +} + +// SetAcceptLanguage : Allow user to set AcceptLanguage +func (_options *CreateRoleOptions) SetAcceptLanguage(acceptLanguage string) *CreateRoleOptions { + _options.AcceptLanguage = core.StringPtr(acceptLanguage) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *CreateRoleOptions) SetHeaders(param map[string]string) *CreateRoleOptions { + options.Headers = param + return options +} + +// CreateRoleTemplateAssignmentOptions : The CreateRoleTemplateAssignment options. +type CreateRoleTemplateAssignmentOptions struct { + // assignment target account and type. + Target *AssignmentTargetDetails `json:"target" validate:"required"` + + // List of role template details for role assignment. + Templates []RoleAssignmentTemplate `json:"templates" validate:"required"` + + // Language code for translations + // * `default` - English + // * `de` - German (Standard) + // * `en` - English + // * `es` - Spanish (Spain) + // * `fr` - French (Standard) + // * `it` - Italian (Standard) + // * `ja` - Japanese + // * `ko` - Korean + // * `pt-br` - Portuguese (Brazil) + // * `zh-cn` - Chinese (Simplified, PRC) + // * `zh-tw` - (Chinese, Taiwan). + AcceptLanguage *string `json:"Accept-Language,omitempty"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewCreateRoleTemplateAssignmentOptions : Instantiate CreateRoleTemplateAssignmentOptions +func (*IamPolicyManagementV1) NewCreateRoleTemplateAssignmentOptions(target *AssignmentTargetDetails, templates []RoleAssignmentTemplate) *CreateRoleTemplateAssignmentOptions { + return &CreateRoleTemplateAssignmentOptions{ + Target: target, + Templates: templates, + } +} + +// SetTarget : Allow user to set Target +func (_options *CreateRoleTemplateAssignmentOptions) SetTarget(target *AssignmentTargetDetails) *CreateRoleTemplateAssignmentOptions { + _options.Target = target return _options } -// SetDescription : Allow user to set Description -func (_options *CreatePolicyTemplateVersionOptions) SetDescription(description string) *CreatePolicyTemplateVersionOptions { - _options.Description = core.StringPtr(description) +// SetTemplates : Allow user to set Templates +func (_options *CreateRoleTemplateAssignmentOptions) SetTemplates(templates []RoleAssignmentTemplate) *CreateRoleTemplateAssignmentOptions { + _options.Templates = templates return _options } -// SetCommitted : Allow user to set Committed -func (_options *CreatePolicyTemplateVersionOptions) SetCommitted(committed bool) *CreatePolicyTemplateVersionOptions { - _options.Committed = core.BoolPtr(committed) +// SetAcceptLanguage : Allow user to set AcceptLanguage +func (_options *CreateRoleTemplateAssignmentOptions) SetAcceptLanguage(acceptLanguage string) *CreateRoleTemplateAssignmentOptions { + _options.AcceptLanguage = core.StringPtr(acceptLanguage) return _options } // SetHeaders : Allow user to set Headers -func (options *CreatePolicyTemplateVersionOptions) SetHeaders(param map[string]string) *CreatePolicyTemplateVersionOptions { +func (options *CreateRoleTemplateAssignmentOptions) SetHeaders(param map[string]string) *CreateRoleTemplateAssignmentOptions { options.Headers = param return options } -// CreateRoleOptions : The CreateRole options. -type CreateRoleOptions struct { - // The display the name of the role that is shown in the console. - DisplayName *string `json:"display_name" validate:"required"` - - // The actions of the role. For more information, see [IAM roles and - // actions](https://cloud.ibm.com/docs/account?topic=account-iam-service-roles-actions). - Actions []string `json:"actions" validate:"required"` - - // The name of the role that is used in the CRN. This must be alphanumeric and capitalized. +// CreateRoleTemplateOptions : The CreateRoleTemplate options. +type CreateRoleTemplateOptions struct { + // Required field when creating a new template. Otherwise, this field is optional. If the field is included, it changes + // the name value for all existing versions of the template. Name *string `json:"name" validate:"required"` - // The account GUID. + // Enterprise account ID where this template is created. AccountID *string `json:"account_id" validate:"required"` - // The service name. - ServiceName *string `json:"service_name" validate:"required"` - - // The description of the role. + // Description of the role template. This is shown to users in the enterprise account. Use this to describe the purpose + // or context of the role for enterprise users managing IAM templates. Description *string `json:"description,omitempty"` + // Committed status of the template. If committed is set to true, then the template version can no longer be updated. + Committed *bool `json:"committed,omitempty"` + + // The role properties that are created in an action resource when the template is assigned. + Role *RoleTemplatePrototypeRole `json:"role,omitempty"` + // Language code for translations // * `default` - English // * `de` - German (Standard) @@ -5736,61 +7079,119 @@ type CreateRoleOptions struct { Headers map[string]string } -// NewCreateRoleOptions : Instantiate CreateRoleOptions -func (*IamPolicyManagementV1) NewCreateRoleOptions(displayName string, actions []string, name string, accountID string, serviceName string) *CreateRoleOptions { - return &CreateRoleOptions{ - DisplayName: core.StringPtr(displayName), - Actions: actions, +// NewCreateRoleTemplateOptions : Instantiate CreateRoleTemplateOptions +func (*IamPolicyManagementV1) NewCreateRoleTemplateOptions(name string, accountID string) *CreateRoleTemplateOptions { + return &CreateRoleTemplateOptions{ Name: core.StringPtr(name), AccountID: core.StringPtr(accountID), - ServiceName: core.StringPtr(serviceName), } } -// SetDisplayName : Allow user to set DisplayName -func (_options *CreateRoleOptions) SetDisplayName(displayName string) *CreateRoleOptions { - _options.DisplayName = core.StringPtr(displayName) +// SetName : Allow user to set Name +func (_options *CreateRoleTemplateOptions) SetName(name string) *CreateRoleTemplateOptions { + _options.Name = core.StringPtr(name) return _options } -// SetActions : Allow user to set Actions -func (_options *CreateRoleOptions) SetActions(actions []string) *CreateRoleOptions { - _options.Actions = actions +// SetAccountID : Allow user to set AccountID +func (_options *CreateRoleTemplateOptions) SetAccountID(accountID string) *CreateRoleTemplateOptions { + _options.AccountID = core.StringPtr(accountID) return _options } -// SetName : Allow user to set Name -func (_options *CreateRoleOptions) SetName(name string) *CreateRoleOptions { - _options.Name = core.StringPtr(name) +// SetDescription : Allow user to set Description +func (_options *CreateRoleTemplateOptions) SetDescription(description string) *CreateRoleTemplateOptions { + _options.Description = core.StringPtr(description) return _options } -// SetAccountID : Allow user to set AccountID -func (_options *CreateRoleOptions) SetAccountID(accountID string) *CreateRoleOptions { - _options.AccountID = core.StringPtr(accountID) +// SetCommitted : Allow user to set Committed +func (_options *CreateRoleTemplateOptions) SetCommitted(committed bool) *CreateRoleTemplateOptions { + _options.Committed = core.BoolPtr(committed) return _options } -// SetServiceName : Allow user to set ServiceName -func (_options *CreateRoleOptions) SetServiceName(serviceName string) *CreateRoleOptions { - _options.ServiceName = core.StringPtr(serviceName) +// SetRole : Allow user to set Role +func (_options *CreateRoleTemplateOptions) SetRole(role *RoleTemplatePrototypeRole) *CreateRoleTemplateOptions { + _options.Role = role + return _options +} + +// SetAcceptLanguage : Allow user to set AcceptLanguage +func (_options *CreateRoleTemplateOptions) SetAcceptLanguage(acceptLanguage string) *CreateRoleTemplateOptions { + _options.AcceptLanguage = core.StringPtr(acceptLanguage) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *CreateRoleTemplateOptions) SetHeaders(param map[string]string) *CreateRoleTemplateOptions { + options.Headers = param + return options +} + +// CreateRoleTemplateVersionOptions : The CreateRoleTemplateVersion options. +type CreateRoleTemplateVersionOptions struct { + // The role template ID. + RoleTemplateID *string `json:"role_template_id" validate:"required,ne="` + + // Required field when creating a new template. Otherwise, this field is optional. If the field is included, it will + // change the name value for all existing versions of the template. + Name *string `json:"name,omitempty"` + + // Description of the role template. This is shown to users in the enterprise account. Use this to describe the purpose + // or context of the role for enterprise users managing IAM templates. + Description *string `json:"description,omitempty"` + + // The role properties that are created in an action resource when the template is assigned. + Role *TemplateRole `json:"role,omitempty"` + + // Committed status of the template version. If committed is set to true, then the template version can no longer be + // updated. + Committed *bool `json:"committed,omitempty"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewCreateRoleTemplateVersionOptions : Instantiate CreateRoleTemplateVersionOptions +func (*IamPolicyManagementV1) NewCreateRoleTemplateVersionOptions(roleTemplateID string) *CreateRoleTemplateVersionOptions { + return &CreateRoleTemplateVersionOptions{ + RoleTemplateID: core.StringPtr(roleTemplateID), + } +} + +// SetRoleTemplateID : Allow user to set RoleTemplateID +func (_options *CreateRoleTemplateVersionOptions) SetRoleTemplateID(roleTemplateID string) *CreateRoleTemplateVersionOptions { + _options.RoleTemplateID = core.StringPtr(roleTemplateID) + return _options +} + +// SetName : Allow user to set Name +func (_options *CreateRoleTemplateVersionOptions) SetName(name string) *CreateRoleTemplateVersionOptions { + _options.Name = core.StringPtr(name) return _options } // SetDescription : Allow user to set Description -func (_options *CreateRoleOptions) SetDescription(description string) *CreateRoleOptions { +func (_options *CreateRoleTemplateVersionOptions) SetDescription(description string) *CreateRoleTemplateVersionOptions { _options.Description = core.StringPtr(description) return _options } -// SetAcceptLanguage : Allow user to set AcceptLanguage -func (_options *CreateRoleOptions) SetAcceptLanguage(acceptLanguage string) *CreateRoleOptions { - _options.AcceptLanguage = core.StringPtr(acceptLanguage) +// SetRole : Allow user to set Role +func (_options *CreateRoleTemplateVersionOptions) SetRole(role *TemplateRole) *CreateRoleTemplateVersionOptions { + _options.Role = role + return _options +} + +// SetCommitted : Allow user to set Committed +func (_options *CreateRoleTemplateVersionOptions) SetCommitted(committed bool) *CreateRoleTemplateVersionOptions { + _options.Committed = core.BoolPtr(committed) return _options } // SetHeaders : Allow user to set Headers -func (options *CreateRoleOptions) SetHeaders(param map[string]string) *CreateRoleOptions { +func (options *CreateRoleTemplateVersionOptions) SetHeaders(param map[string]string) *CreateRoleTemplateVersionOptions { options.Headers = param return options } @@ -6238,6 +7639,34 @@ func (options *DeletePolicyTemplateVersionOptions) SetHeaders(param map[string]s return options } +// DeleteRoleAssignmentOptions : The DeleteRoleAssignment options. +type DeleteRoleAssignmentOptions struct { + // Role template assignment ID. + AssignmentID *string `json:"assignment_id" validate:"required,ne="` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewDeleteRoleAssignmentOptions : Instantiate DeleteRoleAssignmentOptions +func (*IamPolicyManagementV1) NewDeleteRoleAssignmentOptions(assignmentID string) *DeleteRoleAssignmentOptions { + return &DeleteRoleAssignmentOptions{ + AssignmentID: core.StringPtr(assignmentID), + } +} + +// SetAssignmentID : Allow user to set AssignmentID +func (_options *DeleteRoleAssignmentOptions) SetAssignmentID(assignmentID string) *DeleteRoleAssignmentOptions { + _options.AssignmentID = core.StringPtr(assignmentID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *DeleteRoleAssignmentOptions) SetHeaders(param map[string]string) *DeleteRoleAssignmentOptions { + options.Headers = param + return options +} + // DeleteRoleOptions : The DeleteRole options. type DeleteRoleOptions struct { // The role ID. @@ -6266,6 +7695,72 @@ func (options *DeleteRoleOptions) SetHeaders(param map[string]string) *DeleteRol return options } +// DeleteRoleTemplateOptions : The DeleteRoleTemplate options. +type DeleteRoleTemplateOptions struct { + // Role template ID. + RoleTemplateID *string `json:"role_template_id" validate:"required,ne="` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewDeleteRoleTemplateOptions : Instantiate DeleteRoleTemplateOptions +func (*IamPolicyManagementV1) NewDeleteRoleTemplateOptions(roleTemplateID string) *DeleteRoleTemplateOptions { + return &DeleteRoleTemplateOptions{ + RoleTemplateID: core.StringPtr(roleTemplateID), + } +} + +// SetRoleTemplateID : Allow user to set RoleTemplateID +func (_options *DeleteRoleTemplateOptions) SetRoleTemplateID(roleTemplateID string) *DeleteRoleTemplateOptions { + _options.RoleTemplateID = core.StringPtr(roleTemplateID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *DeleteRoleTemplateOptions) SetHeaders(param map[string]string) *DeleteRoleTemplateOptions { + options.Headers = param + return options +} + +// DeleteRoleTemplateVersionOptions : The DeleteRoleTemplateVersion options. +type DeleteRoleTemplateVersionOptions struct { + // Role template ID. + RoleTemplateID *string `json:"role_template_id" validate:"required,ne="` + + // Role template version. + Version *string `json:"version" validate:"required,ne="` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewDeleteRoleTemplateVersionOptions : Instantiate DeleteRoleTemplateVersionOptions +func (*IamPolicyManagementV1) NewDeleteRoleTemplateVersionOptions(roleTemplateID string, version string) *DeleteRoleTemplateVersionOptions { + return &DeleteRoleTemplateVersionOptions{ + RoleTemplateID: core.StringPtr(roleTemplateID), + Version: core.StringPtr(version), + } +} + +// SetRoleTemplateID : Allow user to set RoleTemplateID +func (_options *DeleteRoleTemplateVersionOptions) SetRoleTemplateID(roleTemplateID string) *DeleteRoleTemplateVersionOptions { + _options.RoleTemplateID = core.StringPtr(roleTemplateID) + return _options +} + +// SetVersion : Allow user to set Version +func (_options *DeleteRoleTemplateVersionOptions) SetVersion(version string) *DeleteRoleTemplateVersionOptions { + _options.Version = core.StringPtr(version) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *DeleteRoleTemplateVersionOptions) SetHeaders(param map[string]string) *DeleteRoleTemplateVersionOptions { + options.Headers = param + return options +} + // DeleteV2PolicyOptions : The DeleteV2Policy options. type DeleteV2PolicyOptions struct { // The policy ID. @@ -6389,8 +7884,11 @@ const ( ErrorObjectCodePolicyTemplateNotFoundConst = "policy_template_not_found" ErrorObjectCodeRequestNotProcessedConst = "request_not_processed" ErrorObjectCodeResourceNotFoundConst = "resource_not_found" + ErrorObjectCodeRoleAssignmentNotFoundConst = "role_assignment_not_found" ErrorObjectCodeRoleConflictErrorConst = "role_conflict_error" ErrorObjectCodeRoleNotFoundConst = "role_not_found" + ErrorObjectCodeRoleTemplateConflictErrorConst = "role_template_conflict_error" + ErrorObjectCodeRoleTemplateNotFoundConst = "role_template_not_found" ErrorObjectCodeTooManyRequestsConst = "too_many_requests" ErrorObjectCodeUnableToProcessConst = "unable_to_process" ErrorObjectCodeUnsupportedContentTypeConst = "unsupported_content_type" @@ -6702,63 +8200,173 @@ type GetPolicyTemplateVersionOptions struct { // The policy template ID. PolicyTemplateID *string `json:"policy_template_id" validate:"required,ne="` - // The policy template version. - Version *string `json:"version" validate:"required,ne="` + // The policy template version. + Version *string `json:"version" validate:"required,ne="` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewGetPolicyTemplateVersionOptions : Instantiate GetPolicyTemplateVersionOptions +func (*IamPolicyManagementV1) NewGetPolicyTemplateVersionOptions(policyTemplateID string, version string) *GetPolicyTemplateVersionOptions { + return &GetPolicyTemplateVersionOptions{ + PolicyTemplateID: core.StringPtr(policyTemplateID), + Version: core.StringPtr(version), + } +} + +// SetPolicyTemplateID : Allow user to set PolicyTemplateID +func (_options *GetPolicyTemplateVersionOptions) SetPolicyTemplateID(policyTemplateID string) *GetPolicyTemplateVersionOptions { + _options.PolicyTemplateID = core.StringPtr(policyTemplateID) + return _options +} + +// SetVersion : Allow user to set Version +func (_options *GetPolicyTemplateVersionOptions) SetVersion(version string) *GetPolicyTemplateVersionOptions { + _options.Version = core.StringPtr(version) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetPolicyTemplateVersionOptions) SetHeaders(param map[string]string) *GetPolicyTemplateVersionOptions { + options.Headers = param + return options +} + +// GetRoleAssignmentOptions : The GetRoleAssignment options. +type GetRoleAssignmentOptions struct { + // Role template assignment ID. + AssignmentID *string `json:"assignment_id" validate:"required,ne="` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewGetRoleAssignmentOptions : Instantiate GetRoleAssignmentOptions +func (*IamPolicyManagementV1) NewGetRoleAssignmentOptions(assignmentID string) *GetRoleAssignmentOptions { + return &GetRoleAssignmentOptions{ + AssignmentID: core.StringPtr(assignmentID), + } +} + +// SetAssignmentID : Allow user to set AssignmentID +func (_options *GetRoleAssignmentOptions) SetAssignmentID(assignmentID string) *GetRoleAssignmentOptions { + _options.AssignmentID = core.StringPtr(assignmentID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetRoleAssignmentOptions) SetHeaders(param map[string]string) *GetRoleAssignmentOptions { + options.Headers = param + return options +} + +// GetRoleOptions : The GetRole options. +type GetRoleOptions struct { + // The role ID. + RoleID *string `json:"role_id" validate:"required,ne="` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewGetRoleOptions : Instantiate GetRoleOptions +func (*IamPolicyManagementV1) NewGetRoleOptions(roleID string) *GetRoleOptions { + return &GetRoleOptions{ + RoleID: core.StringPtr(roleID), + } +} + +// SetRoleID : Allow user to set RoleID +func (_options *GetRoleOptions) SetRoleID(roleID string) *GetRoleOptions { + _options.RoleID = core.StringPtr(roleID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetRoleOptions) SetHeaders(param map[string]string) *GetRoleOptions { + options.Headers = param + return options +} + +// GetRoleTemplateOptions : The GetRoleTemplate options. +type GetRoleTemplateOptions struct { + // Role template ID. + RoleTemplateID *string `json:"role_template_id" validate:"required,ne="` + + // The role template state. + State *string `json:"state,omitempty"` // Allows users to set headers on API requests. Headers map[string]string } -// NewGetPolicyTemplateVersionOptions : Instantiate GetPolicyTemplateVersionOptions -func (*IamPolicyManagementV1) NewGetPolicyTemplateVersionOptions(policyTemplateID string, version string) *GetPolicyTemplateVersionOptions { - return &GetPolicyTemplateVersionOptions{ - PolicyTemplateID: core.StringPtr(policyTemplateID), - Version: core.StringPtr(version), +// Constants associated with the GetRoleTemplateOptions.State property. +// The role template state. +const ( + GetRoleTemplateOptionsStateActiveConst = "active" + GetRoleTemplateOptionsStateDeletedConst = "deleted" +) + +// NewGetRoleTemplateOptions : Instantiate GetRoleTemplateOptions +func (*IamPolicyManagementV1) NewGetRoleTemplateOptions(roleTemplateID string) *GetRoleTemplateOptions { + return &GetRoleTemplateOptions{ + RoleTemplateID: core.StringPtr(roleTemplateID), } } -// SetPolicyTemplateID : Allow user to set PolicyTemplateID -func (_options *GetPolicyTemplateVersionOptions) SetPolicyTemplateID(policyTemplateID string) *GetPolicyTemplateVersionOptions { - _options.PolicyTemplateID = core.StringPtr(policyTemplateID) +// SetRoleTemplateID : Allow user to set RoleTemplateID +func (_options *GetRoleTemplateOptions) SetRoleTemplateID(roleTemplateID string) *GetRoleTemplateOptions { + _options.RoleTemplateID = core.StringPtr(roleTemplateID) return _options } -// SetVersion : Allow user to set Version -func (_options *GetPolicyTemplateVersionOptions) SetVersion(version string) *GetPolicyTemplateVersionOptions { - _options.Version = core.StringPtr(version) +// SetState : Allow user to set State +func (_options *GetRoleTemplateOptions) SetState(state string) *GetRoleTemplateOptions { + _options.State = core.StringPtr(state) return _options } // SetHeaders : Allow user to set Headers -func (options *GetPolicyTemplateVersionOptions) SetHeaders(param map[string]string) *GetPolicyTemplateVersionOptions { +func (options *GetRoleTemplateOptions) SetHeaders(param map[string]string) *GetRoleTemplateOptions { options.Headers = param return options } -// GetRoleOptions : The GetRole options. -type GetRoleOptions struct { - // The role ID. - RoleID *string `json:"role_id" validate:"required,ne="` +// GetRoleTemplateVersionOptions : The GetRoleTemplateVersion options. +type GetRoleTemplateVersionOptions struct { + // Role template ID. + RoleTemplateID *string `json:"role_template_id" validate:"required,ne="` + + // Role template version. + Version *string `json:"version" validate:"required,ne="` // Allows users to set headers on API requests. Headers map[string]string } -// NewGetRoleOptions : Instantiate GetRoleOptions -func (*IamPolicyManagementV1) NewGetRoleOptions(roleID string) *GetRoleOptions { - return &GetRoleOptions{ - RoleID: core.StringPtr(roleID), +// NewGetRoleTemplateVersionOptions : Instantiate GetRoleTemplateVersionOptions +func (*IamPolicyManagementV1) NewGetRoleTemplateVersionOptions(roleTemplateID string, version string) *GetRoleTemplateVersionOptions { + return &GetRoleTemplateVersionOptions{ + RoleTemplateID: core.StringPtr(roleTemplateID), + Version: core.StringPtr(version), } } -// SetRoleID : Allow user to set RoleID -func (_options *GetRoleOptions) SetRoleID(roleID string) *GetRoleOptions { - _options.RoleID = core.StringPtr(roleID) +// SetRoleTemplateID : Allow user to set RoleTemplateID +func (_options *GetRoleTemplateVersionOptions) SetRoleTemplateID(roleTemplateID string) *GetRoleTemplateVersionOptions { + _options.RoleTemplateID = core.StringPtr(roleTemplateID) + return _options +} + +// SetVersion : Allow user to set Version +func (_options *GetRoleTemplateVersionOptions) SetVersion(version string) *GetRoleTemplateVersionOptions { + _options.Version = core.StringPtr(version) return _options } // SetHeaders : Allow user to set Headers -func (options *GetRoleOptions) SetHeaders(param map[string]string) *GetRoleOptions { +func (options *GetRoleTemplateVersionOptions) SetHeaders(param map[string]string) *GetRoleTemplateVersionOptions { options.Headers = param return options } @@ -7696,67 +9304,322 @@ func (*IamPolicyManagementV1) NewListPolicyTemplatesOptions(accountID string) *L } // SetAccountID : Allow user to set AccountID -func (_options *ListPolicyTemplatesOptions) SetAccountID(accountID string) *ListPolicyTemplatesOptions { +func (_options *ListPolicyTemplatesOptions) SetAccountID(accountID string) *ListPolicyTemplatesOptions { + _options.AccountID = core.StringPtr(accountID) + return _options +} + +// SetAcceptLanguage : Allow user to set AcceptLanguage +func (_options *ListPolicyTemplatesOptions) SetAcceptLanguage(acceptLanguage string) *ListPolicyTemplatesOptions { + _options.AcceptLanguage = core.StringPtr(acceptLanguage) + return _options +} + +// SetState : Allow user to set State +func (_options *ListPolicyTemplatesOptions) SetState(state string) *ListPolicyTemplatesOptions { + _options.State = core.StringPtr(state) + return _options +} + +// SetName : Allow user to set Name +func (_options *ListPolicyTemplatesOptions) SetName(name string) *ListPolicyTemplatesOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetPolicyServiceType : Allow user to set PolicyServiceType +func (_options *ListPolicyTemplatesOptions) SetPolicyServiceType(policyServiceType string) *ListPolicyTemplatesOptions { + _options.PolicyServiceType = core.StringPtr(policyServiceType) + return _options +} + +// SetPolicyServiceName : Allow user to set PolicyServiceName +func (_options *ListPolicyTemplatesOptions) SetPolicyServiceName(policyServiceName string) *ListPolicyTemplatesOptions { + _options.PolicyServiceName = core.StringPtr(policyServiceName) + return _options +} + +// SetPolicyServiceGroupID : Allow user to set PolicyServiceGroupID +func (_options *ListPolicyTemplatesOptions) SetPolicyServiceGroupID(policyServiceGroupID string) *ListPolicyTemplatesOptions { + _options.PolicyServiceGroupID = core.StringPtr(policyServiceGroupID) + return _options +} + +// SetPolicyType : Allow user to set PolicyType +func (_options *ListPolicyTemplatesOptions) SetPolicyType(policyType string) *ListPolicyTemplatesOptions { + _options.PolicyType = core.StringPtr(policyType) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListPolicyTemplatesOptions) SetLimit(limit int64) *ListPolicyTemplatesOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListPolicyTemplatesOptions) SetStart(start string) *ListPolicyTemplatesOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListPolicyTemplatesOptions) SetHeaders(param map[string]string) *ListPolicyTemplatesOptions { + options.Headers = param + return options +} + +// ListRoleAssignmentsOptions : The ListRoleAssignments options. +type ListRoleAssignmentsOptions struct { + // The account GUID in which the role assignment belongs to. + AccountID *string `json:"account_id" validate:"required"` + + // Language code for translations + // * `default` - English + // * `de` - German (Standard) + // * `en` - English + // * `es` - Spanish (Spain) + // * `fr` - French (Standard) + // * `it` - Italian (Standard) + // * `ja` - Japanese + // * `ko` - Korean + // * `pt-br` - Portuguese (Brazil) + // * `zh-cn` - Chinese (Simplified, PRC) + // * `zh-tw` - (Chinese, Taiwan). + AcceptLanguage *string `json:"Accept-Language,omitempty"` + + // Optional template ID. + TemplateID *string `json:"template_id,omitempty"` + + // Optional role template version. + TemplateVersion *string `json:"template_version,omitempty"` + + // The number of documents to include in the collection. + Limit *int64 `json:"limit,omitempty"` + + // Page token that refers to the page of the collection to return. + Start *string `json:"start,omitempty"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewListRoleAssignmentsOptions : Instantiate ListRoleAssignmentsOptions +func (*IamPolicyManagementV1) NewListRoleAssignmentsOptions(accountID string) *ListRoleAssignmentsOptions { + return &ListRoleAssignmentsOptions{ + AccountID: core.StringPtr(accountID), + } +} + +// SetAccountID : Allow user to set AccountID +func (_options *ListRoleAssignmentsOptions) SetAccountID(accountID string) *ListRoleAssignmentsOptions { + _options.AccountID = core.StringPtr(accountID) + return _options +} + +// SetAcceptLanguage : Allow user to set AcceptLanguage +func (_options *ListRoleAssignmentsOptions) SetAcceptLanguage(acceptLanguage string) *ListRoleAssignmentsOptions { + _options.AcceptLanguage = core.StringPtr(acceptLanguage) + return _options +} + +// SetTemplateID : Allow user to set TemplateID +func (_options *ListRoleAssignmentsOptions) SetTemplateID(templateID string) *ListRoleAssignmentsOptions { + _options.TemplateID = core.StringPtr(templateID) + return _options +} + +// SetTemplateVersion : Allow user to set TemplateVersion +func (_options *ListRoleAssignmentsOptions) SetTemplateVersion(templateVersion string) *ListRoleAssignmentsOptions { + _options.TemplateVersion = core.StringPtr(templateVersion) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListRoleAssignmentsOptions) SetLimit(limit int64) *ListRoleAssignmentsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListRoleAssignmentsOptions) SetStart(start string) *ListRoleAssignmentsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListRoleAssignmentsOptions) SetHeaders(param map[string]string) *ListRoleAssignmentsOptions { + options.Headers = param + return options +} + +// ListRoleTemplateVersionsOptions : The ListRoleTemplateVersions options. +type ListRoleTemplateVersionsOptions struct { + // The role template ID. + RoleTemplateID *string `json:"role_template_id" validate:"required,ne="` + + // Role template state. + State *string `json:"state,omitempty"` + + // The number of documents to include in the collection. + Limit *int64 `json:"limit,omitempty"` + + // Page token that refers to the page of the collection to return. + Start *string `json:"start,omitempty"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// Constants associated with the ListRoleTemplateVersionsOptions.State property. +// Role template state. +const ( + ListRoleTemplateVersionsOptionsStateActiveConst = "active" + ListRoleTemplateVersionsOptionsStateDeletedConst = "deleted" +) + +// NewListRoleTemplateVersionsOptions : Instantiate ListRoleTemplateVersionsOptions +func (*IamPolicyManagementV1) NewListRoleTemplateVersionsOptions(roleTemplateID string) *ListRoleTemplateVersionsOptions { + return &ListRoleTemplateVersionsOptions{ + RoleTemplateID: core.StringPtr(roleTemplateID), + } +} + +// SetRoleTemplateID : Allow user to set RoleTemplateID +func (_options *ListRoleTemplateVersionsOptions) SetRoleTemplateID(roleTemplateID string) *ListRoleTemplateVersionsOptions { + _options.RoleTemplateID = core.StringPtr(roleTemplateID) + return _options +} + +// SetState : Allow user to set State +func (_options *ListRoleTemplateVersionsOptions) SetState(state string) *ListRoleTemplateVersionsOptions { + _options.State = core.StringPtr(state) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListRoleTemplateVersionsOptions) SetLimit(limit int64) *ListRoleTemplateVersionsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListRoleTemplateVersionsOptions) SetStart(start string) *ListRoleTemplateVersionsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListRoleTemplateVersionsOptions) SetHeaders(param map[string]string) *ListRoleTemplateVersionsOptions { + options.Headers = param + return options +} + +// ListRoleTemplatesOptions : The ListRoleTemplates options. +type ListRoleTemplatesOptions struct { + // The account GUID that the role templates belong to. + AccountID *string `json:"account_id" validate:"required"` + + // Language code for translations + // * `default` - English + // * `de` - German (Standard) + // * `en` - English + // * `es` - Spanish (Spain) + // * `fr` - French (Standard) + // * `it` - Italian (Standard) + // * `ja` - Japanese + // * `ko` - Korean + // * `pt-br` - Portuguese (Brazil) + // * `zh-cn` - Chinese (Simplified, PRC) + // * `zh-tw` - (Chinese, Taiwan). + AcceptLanguage *string `json:"Accept-Language,omitempty"` + + // The role template name. + Name *string `json:"name,omitempty"` + + // The template role name. + RoleName *string `json:"role_name,omitempty"` + + // The template role service name. + RoleServiceName *string `json:"role_service_name,omitempty"` + + // The role template state. + State *string `json:"state,omitempty"` + + // The number of documents to include in the collection. + Limit *int64 `json:"limit,omitempty"` + + // Page token that refers to the page of the collection to return. + Start *string `json:"start,omitempty"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// Constants associated with the ListRoleTemplatesOptions.State property. +// The role template state. +const ( + ListRoleTemplatesOptionsStateActiveConst = "active" + ListRoleTemplatesOptionsStateDeletedConst = "deleted" +) + +// NewListRoleTemplatesOptions : Instantiate ListRoleTemplatesOptions +func (*IamPolicyManagementV1) NewListRoleTemplatesOptions(accountID string) *ListRoleTemplatesOptions { + return &ListRoleTemplatesOptions{ + AccountID: core.StringPtr(accountID), + } +} + +// SetAccountID : Allow user to set AccountID +func (_options *ListRoleTemplatesOptions) SetAccountID(accountID string) *ListRoleTemplatesOptions { _options.AccountID = core.StringPtr(accountID) return _options } // SetAcceptLanguage : Allow user to set AcceptLanguage -func (_options *ListPolicyTemplatesOptions) SetAcceptLanguage(acceptLanguage string) *ListPolicyTemplatesOptions { +func (_options *ListRoleTemplatesOptions) SetAcceptLanguage(acceptLanguage string) *ListRoleTemplatesOptions { _options.AcceptLanguage = core.StringPtr(acceptLanguage) return _options } -// SetState : Allow user to set State -func (_options *ListPolicyTemplatesOptions) SetState(state string) *ListPolicyTemplatesOptions { - _options.State = core.StringPtr(state) - return _options -} - // SetName : Allow user to set Name -func (_options *ListPolicyTemplatesOptions) SetName(name string) *ListPolicyTemplatesOptions { +func (_options *ListRoleTemplatesOptions) SetName(name string) *ListRoleTemplatesOptions { _options.Name = core.StringPtr(name) return _options } -// SetPolicyServiceType : Allow user to set PolicyServiceType -func (_options *ListPolicyTemplatesOptions) SetPolicyServiceType(policyServiceType string) *ListPolicyTemplatesOptions { - _options.PolicyServiceType = core.StringPtr(policyServiceType) - return _options -} - -// SetPolicyServiceName : Allow user to set PolicyServiceName -func (_options *ListPolicyTemplatesOptions) SetPolicyServiceName(policyServiceName string) *ListPolicyTemplatesOptions { - _options.PolicyServiceName = core.StringPtr(policyServiceName) +// SetRoleName : Allow user to set RoleName +func (_options *ListRoleTemplatesOptions) SetRoleName(roleName string) *ListRoleTemplatesOptions { + _options.RoleName = core.StringPtr(roleName) return _options } -// SetPolicyServiceGroupID : Allow user to set PolicyServiceGroupID -func (_options *ListPolicyTemplatesOptions) SetPolicyServiceGroupID(policyServiceGroupID string) *ListPolicyTemplatesOptions { - _options.PolicyServiceGroupID = core.StringPtr(policyServiceGroupID) +// SetRoleServiceName : Allow user to set RoleServiceName +func (_options *ListRoleTemplatesOptions) SetRoleServiceName(roleServiceName string) *ListRoleTemplatesOptions { + _options.RoleServiceName = core.StringPtr(roleServiceName) return _options } -// SetPolicyType : Allow user to set PolicyType -func (_options *ListPolicyTemplatesOptions) SetPolicyType(policyType string) *ListPolicyTemplatesOptions { - _options.PolicyType = core.StringPtr(policyType) +// SetState : Allow user to set State +func (_options *ListRoleTemplatesOptions) SetState(state string) *ListRoleTemplatesOptions { + _options.State = core.StringPtr(state) return _options } // SetLimit : Allow user to set Limit -func (_options *ListPolicyTemplatesOptions) SetLimit(limit int64) *ListPolicyTemplatesOptions { +func (_options *ListRoleTemplatesOptions) SetLimit(limit int64) *ListRoleTemplatesOptions { _options.Limit = core.Int64Ptr(limit) return _options } // SetStart : Allow user to set Start -func (_options *ListPolicyTemplatesOptions) SetStart(start string) *ListPolicyTemplatesOptions { +func (_options *ListRoleTemplatesOptions) SetStart(start string) *ListRoleTemplatesOptions { _options.Start = core.StringPtr(start) return _options } // SetHeaders : Allow user to set Headers -func (options *ListPolicyTemplatesOptions) SetHeaders(param map[string]string) *ListPolicyTemplatesOptions { +func (options *ListRoleTemplatesOptions) SetHeaders(param map[string]string) *ListRoleTemplatesOptions { options.Headers = param return options } @@ -9247,21 +11110,317 @@ func UnmarshalPolicyTemplateLimitData(m map[string]json.RawMessage, result inter err = core.SDKErrorf(err, "", "counts-error", common.GetComponentInfo()) return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// PolicyTemplateMetaData : The core set of properties associated with a policy. +type PolicyTemplateMetaData struct { + // The policy ID. + ID *string `json:"id,omitempty"` + + // The policy type; either 'access' or 'authorization'. + Type *string `json:"type" validate:"required"` + + // Customer-defined description. + Description *string `json:"description,omitempty"` + + // The subjects associated with a policy. + Subjects []PolicySubject `json:"subjects" validate:"required"` + + // A set of role Cloud Resource Names (CRNs) granted by the policy. + Roles []PolicyRole `json:"roles" validate:"required"` + + // The resources associated with a policy. + Resources []PolicyResource `json:"resources" validate:"required"` + + // The href links back to the policy. + Href *string `json:"href,omitempty"` + + // The UTC timestamp when the policy was created. + CreatedAt *strfmt.DateTime `json:"created_at,omitempty"` + + // The IAM ID of the entity that created the policy. + CreatedByID *string `json:"created_by_id,omitempty"` + + // The UTC timestamp when the policy was last modified. + LastModifiedAt *strfmt.DateTime `json:"last_modified_at,omitempty"` + + // The IAM ID of the entity that last modified the policy. + LastModifiedByID *string `json:"last_modified_by_id,omitempty"` + + // The policy state. + State *string `json:"state,omitempty"` + + // The details of the IAM template that was used to create an enterprise-managed policy in your account. When returned, + // this indicates that the policy is created from and managed by a template in the root enterprise account. + Template *TemplateMetadata `json:"template,omitempty"` +} + +// Constants associated with the PolicyTemplateMetaData.State property. +// The policy state. +const ( + PolicyTemplateMetaDataStateActiveConst = "active" + PolicyTemplateMetaDataStateDeletedConst = "deleted" +) + +// UnmarshalPolicyTemplateMetaData unmarshals an instance of PolicyTemplateMetaData from the specified map of raw messages. +func UnmarshalPolicyTemplateMetaData(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PolicyTemplateMetaData) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "description", &obj.Description) + if err != nil { + err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "subjects", &obj.Subjects, UnmarshalPolicySubject) + if err != nil { + err = core.SDKErrorf(err, "", "subjects-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "roles", &obj.Roles, UnmarshalPolicyRole) + if err != nil { + err = core.SDKErrorf(err, "", "roles-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "resources", &obj.Resources, UnmarshalPolicyResource) + if err != nil { + err = core.SDKErrorf(err, "", "resources-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) + if err != nil { + err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) + if err != nil { + err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) + if err != nil { + err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "state", &obj.State) + if err != nil { + err = core.SDKErrorf(err, "", "state-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "template", &obj.Template, UnmarshalTemplateMetadata) + if err != nil { + err = core.SDKErrorf(err, "", "template-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// PolicyTemplateVersionsCollection : A collection of versions for a specific policy template. +type PolicyTemplateVersionsCollection struct { + // The number of documents to include per each page of the collection. + Limit *int64 `json:"limit,omitempty"` + + // Details with linking href to first page of requested collection. + First *First `json:"first,omitempty"` + + // Details with href linking to the following page of requested collection. + Next *Next `json:"next,omitempty"` + + // Details with linking href to previous page of requested collection. + Previous *Previous `json:"previous,omitempty"` + + // List of policy templates versions. + Versions []PolicyTemplate `json:"versions" validate:"required"` +} + +// UnmarshalPolicyTemplateVersionsCollection unmarshals an instance of PolicyTemplateVersionsCollection from the specified map of raw messages. +func UnmarshalPolicyTemplateVersionsCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(PolicyTemplateVersionsCollection) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalFirst) + if err != nil { + err = core.SDKErrorf(err, "", "first-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalNext) + if err != nil { + err = core.SDKErrorf(err, "", "next-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "previous", &obj.Previous, UnmarshalPrevious) + if err != nil { + err = core.SDKErrorf(err, "", "previous-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "versions", &obj.Versions, UnmarshalPolicyTemplate) + if err != nil { + err = core.SDKErrorf(err, "", "versions-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// Retrieve the value to be passed to a request to access the next page of results +func (resp *PolicyTemplateVersionsCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + return resp.Next.Start, nil +} + +// Previous : Details with linking href to previous page of requested collection. +type Previous struct { + // The href linking to the page of requested collection. + Href *string `json:"href,omitempty"` + + // Page token that refers to the page of the collection. + Start *string `json:"start,omitempty"` +} + +// UnmarshalPrevious unmarshals an instance of Previous from the specified map of raw messages. +func UnmarshalPrevious(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(Previous) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "start", &obj.Start) + if err != nil { + err = core.SDKErrorf(err, "", "start-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ReplaceActionControlTemplateOptions : The ReplaceActionControlTemplate options. +type ReplaceActionControlTemplateOptions struct { + // Action control template ID. + ActionControlTemplateID *string `json:"action_control_template_id" validate:"required,ne="` + + // Action control template version. + Version *string `json:"version" validate:"required,ne="` + + // The revision number for updating an action control template version must match the Etag value of the existing action + // control template version. The Etag can be retrieved using the GET + // /v1/action_control_templates/{template_id}/versions/{version} API and looking at the Etag response header. + IfMatch *string `json:"If-Match" validate:"required"` + + // Required field when creating a new template. Otherwise, this field is optional. If the field is included, it will + // change the name value for all existing versions of the template. + Name *string `json:"name,omitempty"` + + // Description of the action control template. This is shown to users in the enterprise account. Use this to describe + // the purpose or context of the action control for enterprise users managing IAM templates. + Description *string `json:"description,omitempty"` + + // The action control properties that are created in an action resource when the template is assigned. + ActionControl *TemplateActionControl `json:"action_control,omitempty"` + + // Committed status of the template version. If committed is set to true, then the template version can no longer be + // updated. + Committed *bool `json:"committed,omitempty"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewReplaceActionControlTemplateOptions : Instantiate ReplaceActionControlTemplateOptions +func (*IamPolicyManagementV1) NewReplaceActionControlTemplateOptions(actionControlTemplateID string, version string, ifMatch string) *ReplaceActionControlTemplateOptions { + return &ReplaceActionControlTemplateOptions{ + ActionControlTemplateID: core.StringPtr(actionControlTemplateID), + Version: core.StringPtr(version), + IfMatch: core.StringPtr(ifMatch), + } } -// PolicyTemplateMetaData : The core set of properties associated with a policy. -type PolicyTemplateMetaData struct { +// SetActionControlTemplateID : Allow user to set ActionControlTemplateID +func (_options *ReplaceActionControlTemplateOptions) SetActionControlTemplateID(actionControlTemplateID string) *ReplaceActionControlTemplateOptions { + _options.ActionControlTemplateID = core.StringPtr(actionControlTemplateID) + return _options +} + +// SetVersion : Allow user to set Version +func (_options *ReplaceActionControlTemplateOptions) SetVersion(version string) *ReplaceActionControlTemplateOptions { + _options.Version = core.StringPtr(version) + return _options +} + +// SetIfMatch : Allow user to set IfMatch +func (_options *ReplaceActionControlTemplateOptions) SetIfMatch(ifMatch string) *ReplaceActionControlTemplateOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options +} + +// SetName : Allow user to set Name +func (_options *ReplaceActionControlTemplateOptions) SetName(name string) *ReplaceActionControlTemplateOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetDescription : Allow user to set Description +func (_options *ReplaceActionControlTemplateOptions) SetDescription(description string) *ReplaceActionControlTemplateOptions { + _options.Description = core.StringPtr(description) + return _options +} + +// SetActionControl : Allow user to set ActionControl +func (_options *ReplaceActionControlTemplateOptions) SetActionControl(actionControl *TemplateActionControl) *ReplaceActionControlTemplateOptions { + _options.ActionControl = actionControl + return _options +} + +// SetCommitted : Allow user to set Committed +func (_options *ReplaceActionControlTemplateOptions) SetCommitted(committed bool) *ReplaceActionControlTemplateOptions { + _options.Committed = core.BoolPtr(committed) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ReplaceActionControlTemplateOptions) SetHeaders(param map[string]string) *ReplaceActionControlTemplateOptions { + options.Headers = param + return options +} + +// ReplacePolicyOptions : The ReplacePolicy options. +type ReplacePolicyOptions struct { // The policy ID. - ID *string `json:"id,omitempty"` + PolicyID *string `json:"policy_id" validate:"required,ne="` + + // The revision number for updating a policy and must match the ETag value of the existing policy. The Etag can be + // retrieved using the GET /v1/policies/{policy_id} API and looking at the ETag response header. + IfMatch *string `json:"If-Match" validate:"required"` // The policy type; either 'access' or 'authorization'. Type *string `json:"type" validate:"required"` - // Customer-defined description. - Description *string `json:"description,omitempty"` - // The subjects associated with a policy. Subjects []PolicySubject `json:"subjects" validate:"required"` @@ -9271,215 +11430,254 @@ type PolicyTemplateMetaData struct { // The resources associated with a policy. Resources []PolicyResource `json:"resources" validate:"required"` - // The href links back to the policy. - Href *string `json:"href,omitempty"` + // Customer-defined description. + Description *string `json:"description,omitempty"` - // The UTC timestamp when the policy was created. - CreatedAt *strfmt.DateTime `json:"created_at,omitempty"` + // Allows users to set headers on API requests. + Headers map[string]string +} - // The IAM ID of the entity that created the policy. - CreatedByID *string `json:"created_by_id,omitempty"` +// NewReplacePolicyOptions : Instantiate ReplacePolicyOptions +func (*IamPolicyManagementV1) NewReplacePolicyOptions(policyID string, ifMatch string, typeVar string, subjects []PolicySubject, roles []PolicyRole, resources []PolicyResource) *ReplacePolicyOptions { + return &ReplacePolicyOptions{ + PolicyID: core.StringPtr(policyID), + IfMatch: core.StringPtr(ifMatch), + Type: core.StringPtr(typeVar), + Subjects: subjects, + Roles: roles, + Resources: resources, + } +} - // The UTC timestamp when the policy was last modified. - LastModifiedAt *strfmt.DateTime `json:"last_modified_at,omitempty"` +// SetPolicyID : Allow user to set PolicyID +func (_options *ReplacePolicyOptions) SetPolicyID(policyID string) *ReplacePolicyOptions { + _options.PolicyID = core.StringPtr(policyID) + return _options +} - // The IAM ID of the entity that last modified the policy. - LastModifiedByID *string `json:"last_modified_by_id,omitempty"` +// SetIfMatch : Allow user to set IfMatch +func (_options *ReplacePolicyOptions) SetIfMatch(ifMatch string) *ReplacePolicyOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options +} - // The policy state. - State *string `json:"state,omitempty"` +// SetType : Allow user to set Type +func (_options *ReplacePolicyOptions) SetType(typeVar string) *ReplacePolicyOptions { + _options.Type = core.StringPtr(typeVar) + return _options +} - // The details of the IAM template that was used to create an enterprise-managed policy in your account. When returned, - // this indicates that the policy is created from and managed by a template in the root enterprise account. - Template *TemplateMetadata `json:"template,omitempty"` +// SetSubjects : Allow user to set Subjects +func (_options *ReplacePolicyOptions) SetSubjects(subjects []PolicySubject) *ReplacePolicyOptions { + _options.Subjects = subjects + return _options } -// Constants associated with the PolicyTemplateMetaData.State property. -// The policy state. -const ( - PolicyTemplateMetaDataStateActiveConst = "active" - PolicyTemplateMetaDataStateDeletedConst = "deleted" -) +// SetRoles : Allow user to set Roles +func (_options *ReplacePolicyOptions) SetRoles(roles []PolicyRole) *ReplacePolicyOptions { + _options.Roles = roles + return _options +} -// UnmarshalPolicyTemplateMetaData unmarshals an instance of PolicyTemplateMetaData from the specified map of raw messages. -func UnmarshalPolicyTemplateMetaData(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PolicyTemplateMetaData) - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "type", &obj.Type) - if err != nil { - err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "description", &obj.Description) - if err != nil { - err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "subjects", &obj.Subjects, UnmarshalPolicySubject) - if err != nil { - err = core.SDKErrorf(err, "", "subjects-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "roles", &obj.Roles, UnmarshalPolicyRole) - if err != nil { - err = core.SDKErrorf(err, "", "roles-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "resources", &obj.Resources, UnmarshalPolicyResource) - if err != nil { - err = core.SDKErrorf(err, "", "resources-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) - if err != nil { - err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) - if err != nil { - err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) - if err != nil { - err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "state", &obj.State) - if err != nil { - err = core.SDKErrorf(err, "", "state-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "template", &obj.Template, UnmarshalTemplateMetadata) - if err != nil { - err = core.SDKErrorf(err, "", "template-error", common.GetComponentInfo()) - return +// SetResources : Allow user to set Resources +func (_options *ReplacePolicyOptions) SetResources(resources []PolicyResource) *ReplacePolicyOptions { + _options.Resources = resources + return _options +} + +// SetDescription : Allow user to set Description +func (_options *ReplacePolicyOptions) SetDescription(description string) *ReplacePolicyOptions { + _options.Description = core.StringPtr(description) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ReplacePolicyOptions) SetHeaders(param map[string]string) *ReplacePolicyOptions { + options.Headers = param + return options +} + +// ReplacePolicyTemplateOptions : The ReplacePolicyTemplate options. +type ReplacePolicyTemplateOptions struct { + // The policy template ID. + PolicyTemplateID *string `json:"policy_template_id" validate:"required,ne="` + + // The policy template version. + Version *string `json:"version" validate:"required,ne="` + + // The revision number for updating a policy template version and must match the Etag value of the existing policy + // template version. The Etag can be retrieved using the GET + // /v1/policy_templates/{policy_template_id}/versions/{version} API and looking at the Etag response header. + IfMatch *string `json:"If-Match" validate:"required"` + + // The core set of properties associated with the template's policy object. + Policy *TemplatePolicy `json:"policy" validate:"required"` + + // Required field when creating a new template. Otherwise, this field is optional. If the field is included, it changes + // the name value for all existing versions of the template. + Name *string `json:"name,omitempty"` + + // Description of the policy template. This is shown to users in the enterprise account. Use this to describe the + // purpose or context of the policy for enterprise users managing IAM templates. + Description *string `json:"description,omitempty"` + + // Committed status of the template version. + Committed *bool `json:"committed,omitempty"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewReplacePolicyTemplateOptions : Instantiate ReplacePolicyTemplateOptions +func (*IamPolicyManagementV1) NewReplacePolicyTemplateOptions(policyTemplateID string, version string, ifMatch string, policy *TemplatePolicy) *ReplacePolicyTemplateOptions { + return &ReplacePolicyTemplateOptions{ + PolicyTemplateID: core.StringPtr(policyTemplateID), + Version: core.StringPtr(version), + IfMatch: core.StringPtr(ifMatch), + Policy: policy, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// PolicyTemplateVersionsCollection : A collection of versions for a specific policy template. -type PolicyTemplateVersionsCollection struct { - // The number of documents to include per each page of the collection. - Limit *int64 `json:"limit,omitempty"` +// SetPolicyTemplateID : Allow user to set PolicyTemplateID +func (_options *ReplacePolicyTemplateOptions) SetPolicyTemplateID(policyTemplateID string) *ReplacePolicyTemplateOptions { + _options.PolicyTemplateID = core.StringPtr(policyTemplateID) + return _options +} - // Details with linking href to first page of requested collection. - First *First `json:"first,omitempty"` +// SetVersion : Allow user to set Version +func (_options *ReplacePolicyTemplateOptions) SetVersion(version string) *ReplacePolicyTemplateOptions { + _options.Version = core.StringPtr(version) + return _options +} - // Details with href linking to the following page of requested collection. - Next *Next `json:"next,omitempty"` +// SetIfMatch : Allow user to set IfMatch +func (_options *ReplacePolicyTemplateOptions) SetIfMatch(ifMatch string) *ReplacePolicyTemplateOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options +} - // Details with linking href to previous page of requested collection. - Previous *Previous `json:"previous,omitempty"` +// SetPolicy : Allow user to set Policy +func (_options *ReplacePolicyTemplateOptions) SetPolicy(policy *TemplatePolicy) *ReplacePolicyTemplateOptions { + _options.Policy = policy + return _options +} - // List of policy templates versions. - Versions []PolicyTemplate `json:"versions" validate:"required"` +// SetName : Allow user to set Name +func (_options *ReplacePolicyTemplateOptions) SetName(name string) *ReplacePolicyTemplateOptions { + _options.Name = core.StringPtr(name) + return _options } -// UnmarshalPolicyTemplateVersionsCollection unmarshals an instance of PolicyTemplateVersionsCollection from the specified map of raw messages. -func UnmarshalPolicyTemplateVersionsCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(PolicyTemplateVersionsCollection) - err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) - if err != nil { - err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalFirst) - if err != nil { - err = core.SDKErrorf(err, "", "first-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalNext) - if err != nil { - err = core.SDKErrorf(err, "", "next-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "previous", &obj.Previous, UnmarshalPrevious) - if err != nil { - err = core.SDKErrorf(err, "", "previous-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "versions", &obj.Versions, UnmarshalPolicyTemplate) - if err != nil { - err = core.SDKErrorf(err, "", "versions-error", common.GetComponentInfo()) - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return +// SetDescription : Allow user to set Description +func (_options *ReplacePolicyTemplateOptions) SetDescription(description string) *ReplacePolicyTemplateOptions { + _options.Description = core.StringPtr(description) + return _options } -// Retrieve the value to be passed to a request to access the next page of results -func (resp *PolicyTemplateVersionsCollection) GetNextStart() (*string, error) { - if core.IsNil(resp.Next) { - return nil, nil - } - return resp.Next.Start, nil +// SetCommitted : Allow user to set Committed +func (_options *ReplacePolicyTemplateOptions) SetCommitted(committed bool) *ReplacePolicyTemplateOptions { + _options.Committed = core.BoolPtr(committed) + return _options } -// Previous : Details with linking href to previous page of requested collection. -type Previous struct { - // The href linking to the page of requested collection. - Href *string `json:"href,omitempty"` +// SetHeaders : Allow user to set Headers +func (options *ReplacePolicyTemplateOptions) SetHeaders(param map[string]string) *ReplacePolicyTemplateOptions { + options.Headers = param + return options +} - // Page token that refers to the page of the collection. - Start *string `json:"start,omitempty"` +// ReplaceRoleOptions : The ReplaceRole options. +type ReplaceRoleOptions struct { + // The role ID. + RoleID *string `json:"role_id" validate:"required,ne="` + + // The revision number for updating a role and must match the ETag value of the existing role. The Etag can be + // retrieved using the GET /v2/roles/{role_id} API and looking at the ETag response header. + IfMatch *string `json:"If-Match" validate:"required"` + + // The display the name of the role that is shown in the console. + DisplayName *string `json:"display_name" validate:"required"` + + // The actions of the role. For more information, see [IAM roles and + // actions](https://cloud.ibm.com/docs/account?topic=account-iam-service-roles-actions). + Actions []string `json:"actions" validate:"required"` + + // The description of the role. + Description *string `json:"description,omitempty"` + + // Allows users to set headers on API requests. + Headers map[string]string } -// UnmarshalPrevious unmarshals an instance of Previous from the specified map of raw messages. -func UnmarshalPrevious(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Previous) - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "start", &obj.Start) - if err != nil { - err = core.SDKErrorf(err, "", "start-error", common.GetComponentInfo()) - return +// NewReplaceRoleOptions : Instantiate ReplaceRoleOptions +func (*IamPolicyManagementV1) NewReplaceRoleOptions(roleID string, ifMatch string, displayName string, actions []string) *ReplaceRoleOptions { + return &ReplaceRoleOptions{ + RoleID: core.StringPtr(roleID), + IfMatch: core.StringPtr(ifMatch), + DisplayName: core.StringPtr(displayName), + Actions: actions, } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } -// ReplaceActionControlTemplateOptions : The ReplaceActionControlTemplate options. -type ReplaceActionControlTemplateOptions struct { - // Action control template ID. - ActionControlTemplateID *string `json:"action_control_template_id" validate:"required,ne="` +// SetRoleID : Allow user to set RoleID +func (_options *ReplaceRoleOptions) SetRoleID(roleID string) *ReplaceRoleOptions { + _options.RoleID = core.StringPtr(roleID) + return _options +} - // Action control template version. +// SetIfMatch : Allow user to set IfMatch +func (_options *ReplaceRoleOptions) SetIfMatch(ifMatch string) *ReplaceRoleOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options +} + +// SetDisplayName : Allow user to set DisplayName +func (_options *ReplaceRoleOptions) SetDisplayName(displayName string) *ReplaceRoleOptions { + _options.DisplayName = core.StringPtr(displayName) + return _options +} + +// SetActions : Allow user to set Actions +func (_options *ReplaceRoleOptions) SetActions(actions []string) *ReplaceRoleOptions { + _options.Actions = actions + return _options +} + +// SetDescription : Allow user to set Description +func (_options *ReplaceRoleOptions) SetDescription(description string) *ReplaceRoleOptions { + _options.Description = core.StringPtr(description) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ReplaceRoleOptions) SetHeaders(param map[string]string) *ReplaceRoleOptions { + options.Headers = param + return options +} + +// ReplaceRoleTemplateOptions : The ReplaceRoleTemplate options. +type ReplaceRoleTemplateOptions struct { + // Role template ID. + RoleTemplateID *string `json:"role_template_id" validate:"required,ne="` + + // Role template version. Version *string `json:"version" validate:"required,ne="` - // The revision number for updating an action control template version must match the Etag value of the existing action - // control template version. The Etag can be retrieved using the GET - // /v1/action_control_templates/{template_id}/versions/{version} API and looking at the Etag response header. + // The revision number for updating a role template version must match the Etag value of the existing role template + // version. The Etag can be retrieved using the GET /v1/role_templates/{template_id}/versions/{version} API and looking + // at the Etag response header. IfMatch *string `json:"If-Match" validate:"required"` // Required field when creating a new template. Otherwise, this field is optional. If the field is included, it will // change the name value for all existing versions of the template. Name *string `json:"name,omitempty"` - // Description of the action control template. This is shown to users in the enterprise account. Use this to describe - // the purpose or context of the action control for enterprise users managing IAM templates. + // Description of the role template. This is shown to users in the enterprise account. Use this to describe the purpose + // or context of the role for enterprise users managing IAM templates. Description *string `json:"description,omitempty"` - // The action control properties that are created in an action resource when the template is assigned. - ActionControl *TemplateActionControl `json:"action_control,omitempty"` + // The role properties that are created in an action resource when the template is assigned. + Role *TemplateRole `json:"role,omitempty"` // Committed status of the template version. If committed is set to true, then the template version can no longer be // updated. @@ -9489,438 +11687,626 @@ type ReplaceActionControlTemplateOptions struct { Headers map[string]string } -// NewReplaceActionControlTemplateOptions : Instantiate ReplaceActionControlTemplateOptions -func (*IamPolicyManagementV1) NewReplaceActionControlTemplateOptions(actionControlTemplateID string, version string, ifMatch string) *ReplaceActionControlTemplateOptions { - return &ReplaceActionControlTemplateOptions{ - ActionControlTemplateID: core.StringPtr(actionControlTemplateID), +// NewReplaceRoleTemplateOptions : Instantiate ReplaceRoleTemplateOptions +func (*IamPolicyManagementV1) NewReplaceRoleTemplateOptions(roleTemplateID string, version string, ifMatch string) *ReplaceRoleTemplateOptions { + return &ReplaceRoleTemplateOptions{ + RoleTemplateID: core.StringPtr(roleTemplateID), Version: core.StringPtr(version), IfMatch: core.StringPtr(ifMatch), } } -// SetActionControlTemplateID : Allow user to set ActionControlTemplateID -func (_options *ReplaceActionControlTemplateOptions) SetActionControlTemplateID(actionControlTemplateID string) *ReplaceActionControlTemplateOptions { - _options.ActionControlTemplateID = core.StringPtr(actionControlTemplateID) +// SetRoleTemplateID : Allow user to set RoleTemplateID +func (_options *ReplaceRoleTemplateOptions) SetRoleTemplateID(roleTemplateID string) *ReplaceRoleTemplateOptions { + _options.RoleTemplateID = core.StringPtr(roleTemplateID) return _options } // SetVersion : Allow user to set Version -func (_options *ReplaceActionControlTemplateOptions) SetVersion(version string) *ReplaceActionControlTemplateOptions { +func (_options *ReplaceRoleTemplateOptions) SetVersion(version string) *ReplaceRoleTemplateOptions { _options.Version = core.StringPtr(version) return _options } // SetIfMatch : Allow user to set IfMatch -func (_options *ReplaceActionControlTemplateOptions) SetIfMatch(ifMatch string) *ReplaceActionControlTemplateOptions { +func (_options *ReplaceRoleTemplateOptions) SetIfMatch(ifMatch string) *ReplaceRoleTemplateOptions { _options.IfMatch = core.StringPtr(ifMatch) return _options } // SetName : Allow user to set Name -func (_options *ReplaceActionControlTemplateOptions) SetName(name string) *ReplaceActionControlTemplateOptions { +func (_options *ReplaceRoleTemplateOptions) SetName(name string) *ReplaceRoleTemplateOptions { _options.Name = core.StringPtr(name) return _options } // SetDescription : Allow user to set Description -func (_options *ReplaceActionControlTemplateOptions) SetDescription(description string) *ReplaceActionControlTemplateOptions { +func (_options *ReplaceRoleTemplateOptions) SetDescription(description string) *ReplaceRoleTemplateOptions { _options.Description = core.StringPtr(description) return _options } -// SetActionControl : Allow user to set ActionControl -func (_options *ReplaceActionControlTemplateOptions) SetActionControl(actionControl *TemplateActionControl) *ReplaceActionControlTemplateOptions { - _options.ActionControl = actionControl +// SetRole : Allow user to set Role +func (_options *ReplaceRoleTemplateOptions) SetRole(role *TemplateRole) *ReplaceRoleTemplateOptions { + _options.Role = role return _options } // SetCommitted : Allow user to set Committed -func (_options *ReplaceActionControlTemplateOptions) SetCommitted(committed bool) *ReplaceActionControlTemplateOptions { +func (_options *ReplaceRoleTemplateOptions) SetCommitted(committed bool) *ReplaceRoleTemplateOptions { _options.Committed = core.BoolPtr(committed) return _options } // SetHeaders : Allow user to set Headers -func (options *ReplaceActionControlTemplateOptions) SetHeaders(param map[string]string) *ReplaceActionControlTemplateOptions { +func (options *ReplaceRoleTemplateOptions) SetHeaders(param map[string]string) *ReplaceRoleTemplateOptions { options.Headers = param return options } -// ReplacePolicyOptions : The ReplacePolicy options. -type ReplacePolicyOptions struct { +// ReplaceV2PolicyOptions : The ReplaceV2Policy options. +type ReplaceV2PolicyOptions struct { // The policy ID. - PolicyID *string `json:"policy_id" validate:"required,ne="` + ID *string `json:"id" validate:"required,ne="` // The revision number for updating a policy and must match the ETag value of the existing policy. The Etag can be - // retrieved using the GET /v1/policies/{policy_id} API and looking at the ETag response header. + // retrieved using the GET /v2/policies/{id} API and looking at the ETag response header. IfMatch *string `json:"If-Match" validate:"required"` + // Specifies the type of access that is granted by the policy. + Control *Control `json:"control" validate:"required"` + // The policy type; either 'access' or 'authorization'. Type *string `json:"type" validate:"required"` - // The subjects associated with a policy. - Subjects []PolicySubject `json:"subjects" validate:"required"` + // Description of the policy. + Description *string `json:"description,omitempty"` - // A set of role Cloud Resource Names (CRNs) granted by the policy. - Roles []PolicyRole `json:"roles" validate:"required"` + // The subject attributes for whom the policy grants access. + Subject *V2PolicySubject `json:"subject,omitempty"` - // The resources associated with a policy. - Resources []PolicyResource `json:"resources" validate:"required"` + // The resource attributes to which the policy grants access. + Resource *V2PolicyResource `json:"resource,omitempty"` - // Customer-defined description. - Description *string `json:"description,omitempty"` + // Indicates pattern of rule, either 'time-based-conditions:once', 'time-based-conditions:weekly:all-day', or + // 'time-based-conditions:weekly:custom-hours'. + Pattern *string `json:"pattern,omitempty"` + + // Additional access conditions associated with the policy. + Rule V2PolicyRuleIntf `json:"rule,omitempty"` // Allows users to set headers on API requests. Headers map[string]string } -// NewReplacePolicyOptions : Instantiate ReplacePolicyOptions -func (*IamPolicyManagementV1) NewReplacePolicyOptions(policyID string, ifMatch string, typeVar string, subjects []PolicySubject, roles []PolicyRole, resources []PolicyResource) *ReplacePolicyOptions { - return &ReplacePolicyOptions{ - PolicyID: core.StringPtr(policyID), +// Constants associated with the ReplaceV2PolicyOptions.Type property. +// The policy type; either 'access' or 'authorization'. +const ( + ReplaceV2PolicyOptionsTypeAccessConst = "access" + ReplaceV2PolicyOptionsTypeAuthorizationConst = "authorization" +) + +// NewReplaceV2PolicyOptions : Instantiate ReplaceV2PolicyOptions +func (*IamPolicyManagementV1) NewReplaceV2PolicyOptions(id string, ifMatch string, control *Control, typeVar string) *ReplaceV2PolicyOptions { + return &ReplaceV2PolicyOptions{ + ID: core.StringPtr(id), IfMatch: core.StringPtr(ifMatch), + Control: control, Type: core.StringPtr(typeVar), - Subjects: subjects, - Roles: roles, - Resources: resources, } } -// SetPolicyID : Allow user to set PolicyID -func (_options *ReplacePolicyOptions) SetPolicyID(policyID string) *ReplacePolicyOptions { - _options.PolicyID = core.StringPtr(policyID) +// SetID : Allow user to set ID +func (_options *ReplaceV2PolicyOptions) SetID(id string) *ReplaceV2PolicyOptions { + _options.ID = core.StringPtr(id) return _options } // SetIfMatch : Allow user to set IfMatch -func (_options *ReplacePolicyOptions) SetIfMatch(ifMatch string) *ReplacePolicyOptions { +func (_options *ReplaceV2PolicyOptions) SetIfMatch(ifMatch string) *ReplaceV2PolicyOptions { _options.IfMatch = core.StringPtr(ifMatch) return _options } +// SetControl : Allow user to set Control +func (_options *ReplaceV2PolicyOptions) SetControl(control *Control) *ReplaceV2PolicyOptions { + _options.Control = control + return _options +} + // SetType : Allow user to set Type -func (_options *ReplacePolicyOptions) SetType(typeVar string) *ReplacePolicyOptions { +func (_options *ReplaceV2PolicyOptions) SetType(typeVar string) *ReplaceV2PolicyOptions { _options.Type = core.StringPtr(typeVar) return _options } -// SetSubjects : Allow user to set Subjects -func (_options *ReplacePolicyOptions) SetSubjects(subjects []PolicySubject) *ReplacePolicyOptions { - _options.Subjects = subjects +// SetDescription : Allow user to set Description +func (_options *ReplaceV2PolicyOptions) SetDescription(description string) *ReplaceV2PolicyOptions { + _options.Description = core.StringPtr(description) return _options } -// SetRoles : Allow user to set Roles -func (_options *ReplacePolicyOptions) SetRoles(roles []PolicyRole) *ReplacePolicyOptions { - _options.Roles = roles +// SetSubject : Allow user to set Subject +func (_options *ReplaceV2PolicyOptions) SetSubject(subject *V2PolicySubject) *ReplaceV2PolicyOptions { + _options.Subject = subject return _options } -// SetResources : Allow user to set Resources -func (_options *ReplacePolicyOptions) SetResources(resources []PolicyResource) *ReplacePolicyOptions { - _options.Resources = resources +// SetResource : Allow user to set Resource +func (_options *ReplaceV2PolicyOptions) SetResource(resource *V2PolicyResource) *ReplaceV2PolicyOptions { + _options.Resource = resource return _options } -// SetDescription : Allow user to set Description -func (_options *ReplacePolicyOptions) SetDescription(description string) *ReplacePolicyOptions { - _options.Description = core.StringPtr(description) +// SetPattern : Allow user to set Pattern +func (_options *ReplaceV2PolicyOptions) SetPattern(pattern string) *ReplaceV2PolicyOptions { + _options.Pattern = core.StringPtr(pattern) + return _options +} + +// SetRule : Allow user to set Rule +func (_options *ReplaceV2PolicyOptions) SetRule(rule V2PolicyRuleIntf) *ReplaceV2PolicyOptions { + _options.Rule = rule return _options } // SetHeaders : Allow user to set Headers -func (options *ReplacePolicyOptions) SetHeaders(param map[string]string) *ReplacePolicyOptions { +func (options *ReplaceV2PolicyOptions) SetHeaders(param map[string]string) *ReplaceV2PolicyOptions { options.Headers = param return options } -// ReplacePolicyTemplateOptions : The ReplacePolicyTemplate options. -type ReplacePolicyTemplateOptions struct { - // The policy template ID. - PolicyTemplateID *string `json:"policy_template_id" validate:"required,ne="` - - // The policy template version. - Version *string `json:"version" validate:"required,ne="` - - // The revision number for updating a policy template version and must match the ETag value of the existing policy - // template version. The Etag can be retrieved using the GET - // /v1/policy_templates/{policy_template_id}/versions/{version} API and looking at the ETag response header. - IfMatch *string `json:"If-Match" validate:"required"` - - // The core set of properties associated with the template's policy object. - Policy *TemplatePolicy `json:"policy" validate:"required"` - - // Required field when creating a new template. Otherwise, this field is optional. If the field is included, it changes - // the name value for all existing versions of the template. - Name *string `json:"name,omitempty"` - - // Description of the policy template. This is shown to users in the enterprise account. Use this to describe the - // purpose or context of the policy for enterprise users managing IAM templates. - Description *string `json:"description,omitempty"` +// ResourceAttribute : An attribute associated with a resource. +type ResourceAttribute struct { + // The name of an attribute. + Name *string `json:"name" validate:"required"` - // Committed status of the template version. - Committed *bool `json:"committed,omitempty"` + // The value of an attribute. + Value *string `json:"value" validate:"required"` - // Allows users to set headers on API requests. - Headers map[string]string + // The operator of an attribute. + Operator *string `json:"operator,omitempty"` } -// NewReplacePolicyTemplateOptions : Instantiate ReplacePolicyTemplateOptions -func (*IamPolicyManagementV1) NewReplacePolicyTemplateOptions(policyTemplateID string, version string, ifMatch string, policy *TemplatePolicy) *ReplacePolicyTemplateOptions { - return &ReplacePolicyTemplateOptions{ - PolicyTemplateID: core.StringPtr(policyTemplateID), - Version: core.StringPtr(version), - IfMatch: core.StringPtr(ifMatch), - Policy: policy, +// NewResourceAttribute : Instantiate ResourceAttribute (Generic Model Constructor) +func (*IamPolicyManagementV1) NewResourceAttribute(name string, value string) (_model *ResourceAttribute, err error) { + _model = &ResourceAttribute{ + Name: core.StringPtr(name), + Value: core.StringPtr(value), } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return } -// SetPolicyTemplateID : Allow user to set PolicyTemplateID -func (_options *ReplacePolicyTemplateOptions) SetPolicyTemplateID(policyTemplateID string) *ReplacePolicyTemplateOptions { - _options.PolicyTemplateID = core.StringPtr(policyTemplateID) - return _options -} - -// SetVersion : Allow user to set Version -func (_options *ReplacePolicyTemplateOptions) SetVersion(version string) *ReplacePolicyTemplateOptions { - _options.Version = core.StringPtr(version) - return _options -} - -// SetIfMatch : Allow user to set IfMatch -func (_options *ReplacePolicyTemplateOptions) SetIfMatch(ifMatch string) *ReplacePolicyTemplateOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options +// UnmarshalResourceAttribute unmarshals an instance of ResourceAttribute from the specified map of raw messages. +func UnmarshalResourceAttribute(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ResourceAttribute) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "operator", &obj.Operator) + if err != nil { + err = core.SDKErrorf(err, "", "operator-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetPolicy : Allow user to set Policy -func (_options *ReplacePolicyTemplateOptions) SetPolicy(policy *TemplatePolicy) *ReplacePolicyTemplateOptions { - _options.Policy = policy - return _options -} +// ResourceTag : A tag associated with a resource. +type ResourceTag struct { + // The name of an access management tag. + Name *string `json:"name" validate:"required"` -// SetName : Allow user to set Name -func (_options *ReplacePolicyTemplateOptions) SetName(name string) *ReplacePolicyTemplateOptions { - _options.Name = core.StringPtr(name) - return _options -} + // The value of an access management tag. + Value *string `json:"value" validate:"required"` -// SetDescription : Allow user to set Description -func (_options *ReplacePolicyTemplateOptions) SetDescription(description string) *ReplacePolicyTemplateOptions { - _options.Description = core.StringPtr(description) - return _options + // The operator of an access management tag. + Operator *string `json:"operator,omitempty"` } -// SetCommitted : Allow user to set Committed -func (_options *ReplacePolicyTemplateOptions) SetCommitted(committed bool) *ReplacePolicyTemplateOptions { - _options.Committed = core.BoolPtr(committed) - return _options +// NewResourceTag : Instantiate ResourceTag (Generic Model Constructor) +func (*IamPolicyManagementV1) NewResourceTag(name string, value string) (_model *ResourceTag, err error) { + _model = &ResourceTag{ + Name: core.StringPtr(name), + Value: core.StringPtr(value), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return } -// SetHeaders : Allow user to set Headers -func (options *ReplacePolicyTemplateOptions) SetHeaders(param map[string]string) *ReplacePolicyTemplateOptions { - options.Headers = param - return options +// UnmarshalResourceTag unmarshals an instance of ResourceTag from the specified map of raw messages. +func UnmarshalResourceTag(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ResourceTag) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "operator", &obj.Operator) + if err != nil { + err = core.SDKErrorf(err, "", "operator-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// ReplaceRoleOptions : The ReplaceRole options. -type ReplaceRoleOptions struct { - // The role ID. - RoleID *string `json:"role_id" validate:"required,ne="` - - // The revision number for updating a role and must match the ETag value of the existing role. The Etag can be - // retrieved using the GET /v2/roles/{role_id} API and looking at the ETag response header. - IfMatch *string `json:"If-Match" validate:"required"` - +// Role : A role resource. +type Role struct { // The display the name of the role that is shown in the console. DisplayName *string `json:"display_name" validate:"required"` + // The description of the role. + Description *string `json:"description,omitempty"` + // The actions of the role. For more information, see [IAM roles and // actions](https://cloud.ibm.com/docs/account?topic=account-iam-service-roles-actions). Actions []string `json:"actions" validate:"required"` - // The description of the role. - Description *string `json:"description,omitempty"` - - // Allows users to set headers on API requests. - Headers map[string]string + // The role Cloud Resource Name (CRN). Example CRN: + // 'crn:v1:ibmcloud:public:iam-access-management::a/exampleAccountId::customRole:ExampleRoleName'. + CRN *string `json:"crn,omitempty"` } -// NewReplaceRoleOptions : Instantiate ReplaceRoleOptions -func (*IamPolicyManagementV1) NewReplaceRoleOptions(roleID string, ifMatch string, displayName string, actions []string) *ReplaceRoleOptions { - return &ReplaceRoleOptions{ - RoleID: core.StringPtr(roleID), - IfMatch: core.StringPtr(ifMatch), +// NewRole : Instantiate Role (Generic Model Constructor) +func (*IamPolicyManagementV1) NewRole(displayName string, actions []string) (_model *Role, err error) { + _model = &Role{ DisplayName: core.StringPtr(displayName), Actions: actions, } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +// UnmarshalRole unmarshals an instance of Role from the specified map of raw messages. +func UnmarshalRole(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(Role) + err = core.UnmarshalPrimitive(m, "display_name", &obj.DisplayName) + if err != nil { + err = core.SDKErrorf(err, "", "display_name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "description", &obj.Description) + if err != nil { + err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "actions", &obj.Actions) + if err != nil { + err = core.SDKErrorf(err, "", "actions-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + err = core.SDKErrorf(err, "", "crn-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetRoleID : Allow user to set RoleID -func (_options *ReplaceRoleOptions) SetRoleID(roleID string) *ReplaceRoleOptions { - _options.RoleID = core.StringPtr(roleID) - return _options -} +// RoleAction : An action that can be performed by the policy subject when assigned a role. +type RoleAction struct { + // Unique identifier for action with structure service.resource.action. For example, cbr.rule.read. + ID *string `json:"id" validate:"required"` -// SetIfMatch : Allow user to set IfMatch -func (_options *ReplaceRoleOptions) SetIfMatch(ifMatch string) *ReplaceRoleOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options -} + // Services defined display name for action. + DisplayName *string `json:"display_name" validate:"required"` -// SetDisplayName : Allow user to set DisplayName -func (_options *ReplaceRoleOptions) SetDisplayName(displayName string) *ReplaceRoleOptions { - _options.DisplayName = core.StringPtr(displayName) - return _options + // Service defined description for action. + Description *string `json:"description" validate:"required"` } -// SetActions : Allow user to set Actions -func (_options *ReplaceRoleOptions) SetActions(actions []string) *ReplaceRoleOptions { - _options.Actions = actions - return _options +// UnmarshalRoleAction unmarshals an instance of RoleAction from the specified map of raw messages. +func UnmarshalRoleAction(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoleAction) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "display_name", &obj.DisplayName) + if err != nil { + err = core.SDKErrorf(err, "", "display_name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "description", &obj.Description) + if err != nil { + err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetDescription : Allow user to set Description -func (_options *ReplaceRoleOptions) SetDescription(description string) *ReplaceRoleOptions { - _options.Description = core.StringPtr(description) - return _options -} +// RoleAssignment : The set of properties associated with the assigned role template. +type RoleAssignment struct { + // Action control assignment ID. + ID *string `json:"id,omitempty"` -// SetHeaders : Allow user to set Headers -func (options *ReplaceRoleOptions) SetHeaders(param map[string]string) *ReplaceRoleOptions { - options.Headers = param - return options -} + // The account GUID that the role assignments belong to. + AccountID *string `json:"account_id,omitempty"` -// ReplaceV2PolicyOptions : The ReplaceV2Policy options. -type ReplaceV2PolicyOptions struct { - // The policy ID. - ID *string `json:"id" validate:"required,ne="` + // The href URL that links to the role assignments API by role assignment ID. + Href *string `json:"href,omitempty"` - // The revision number for updating a policy and must match the ETag value of the existing policy. The Etag can be - // retrieved using the GET /v2/policies/{id} API and looking at the ETag response header. - IfMatch *string `json:"If-Match" validate:"required"` + // The UTC timestamp when the role assignment was created. + CreatedAt *strfmt.DateTime `json:"created_at,omitempty"` - // Specifies the type of access that is granted by the policy. - Control *Control `json:"control" validate:"required"` + // The IAM ID of the entity that created the role assignment. + CreatedByID *string `json:"created_by_id,omitempty"` - // The policy type; either 'access' or 'authorization'. - Type *string `json:"type" validate:"required"` + // The UTC timestamp when the role assignment was last modified. + LastModifiedAt *strfmt.DateTime `json:"last_modified_at,omitempty"` - // Description of the policy. - Description *string `json:"description,omitempty"` + // The IAM ID of the entity that last modified the role assignment. + LastModifiedByID *string `json:"last_modified_by_id,omitempty"` - // The subject attributes for whom the policy grants access. - Subject *V2PolicySubject `json:"subject,omitempty"` + // The current operation of the role assignment. + Operation *string `json:"operation,omitempty"` - // The resource attributes to which the policy grants access. - Resource *V2PolicyResource `json:"resource,omitempty"` + // Resources created when role template is assigned. + Resources []RoleAssignmentResource `json:"resources,omitempty"` - // Indicates pattern of rule, either 'time-based-conditions:once', 'time-based-conditions:weekly:all-day', or - // 'time-based-conditions:weekly:custom-hours'. - Pattern *string `json:"pattern,omitempty"` + // The role template id and version that will be assigned. + Template *RoleAssignmentTemplate `json:"template" validate:"required"` - // Additional access conditions associated with the policy. - Rule V2PolicyRuleIntf `json:"rule,omitempty"` + // assignment target account and type. + Target *AssignmentTargetDetails `json:"target" validate:"required"` - // Allows users to set headers on API requests. - Headers map[string]string + // The role assignment status. + Status *string `json:"status,omitempty"` } -// Constants associated with the ReplaceV2PolicyOptions.Type property. -// The policy type; either 'access' or 'authorization'. +// Constants associated with the RoleAssignment.Operation property. +// The current operation of the role assignment. const ( - ReplaceV2PolicyOptionsTypeAccessConst = "access" - ReplaceV2PolicyOptionsTypeAuthorizationConst = "authorization" + RoleAssignmentOperationApplyConst = "apply" + RoleAssignmentOperationCreateConst = "create" + RoleAssignmentOperationRemoveConst = "remove" + RoleAssignmentOperationUpdateConst = "update" ) -// NewReplaceV2PolicyOptions : Instantiate ReplaceV2PolicyOptions -func (*IamPolicyManagementV1) NewReplaceV2PolicyOptions(id string, ifMatch string, control *Control, typeVar string) *ReplaceV2PolicyOptions { - return &ReplaceV2PolicyOptions{ - ID: core.StringPtr(id), - IfMatch: core.StringPtr(ifMatch), - Control: control, - Type: core.StringPtr(typeVar), +// Constants associated with the RoleAssignment.Status property. +// The role assignment status. +const ( + RoleAssignmentStatusAcceptedConst = "accepted" + RoleAssignmentStatusFailureConst = "failure" + RoleAssignmentStatusInProgressConst = "in_progress" + RoleAssignmentStatusSupersededConst = "superseded" +) + +// UnmarshalRoleAssignment unmarshals an instance of RoleAssignment from the specified map of raw messages. +func UnmarshalRoleAssignment(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoleAssignment) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "account_id", &obj.AccountID) + if err != nil { + err = core.SDKErrorf(err, "", "account_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) + if err != nil { + err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) + if err != nil { + err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) + if err != nil { + err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "operation", &obj.Operation) + if err != nil { + err = core.SDKErrorf(err, "", "operation-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "resources", &obj.Resources, UnmarshalRoleAssignmentResource) + if err != nil { + err = core.SDKErrorf(err, "", "resources-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "template", &obj.Template, UnmarshalRoleAssignmentTemplate) + if err != nil { + err = core.SDKErrorf(err, "", "template-error", common.GetComponentInfo()) + return } + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalAssignmentTargetDetails) + if err != nil { + err = core.SDKErrorf(err, "", "target-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetID : Allow user to set ID -func (_options *ReplaceV2PolicyOptions) SetID(id string) *ReplaceV2PolicyOptions { - _options.ID = core.StringPtr(id) - return _options -} +// RoleAssignmentCollection : A collection of role assignments. +type RoleAssignmentCollection struct { + // The number of documents to include per each page of the collection. + Limit *int64 `json:"limit,omitempty"` -// SetIfMatch : Allow user to set IfMatch -func (_options *ReplaceV2PolicyOptions) SetIfMatch(ifMatch string) *ReplaceV2PolicyOptions { - _options.IfMatch = core.StringPtr(ifMatch) - return _options -} + // Details with linking href to first page of requested collection. + First *First `json:"first,omitempty"` -// SetControl : Allow user to set Control -func (_options *ReplaceV2PolicyOptions) SetControl(control *Control) *ReplaceV2PolicyOptions { - _options.Control = control - return _options + // Details with href linking to the following page of requested collection. + Next *Next `json:"next,omitempty"` + + // Details with linking href to previous page of requested collection. + Previous *Previous `json:"previous,omitempty"` + + // List of role assignments. + Assignments []RoleAssignment `json:"assignments" validate:"required"` } -// SetType : Allow user to set Type -func (_options *ReplaceV2PolicyOptions) SetType(typeVar string) *ReplaceV2PolicyOptions { - _options.Type = core.StringPtr(typeVar) - return _options +// UnmarshalRoleAssignmentCollection unmarshals an instance of RoleAssignmentCollection from the specified map of raw messages. +func UnmarshalRoleAssignmentCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoleAssignmentCollection) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalFirst) + if err != nil { + err = core.SDKErrorf(err, "", "first-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalNext) + if err != nil { + err = core.SDKErrorf(err, "", "next-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "previous", &obj.Previous, UnmarshalPrevious) + if err != nil { + err = core.SDKErrorf(err, "", "previous-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "assignments", &obj.Assignments, UnmarshalRoleAssignment) + if err != nil { + err = core.SDKErrorf(err, "", "assignments-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetDescription : Allow user to set Description -func (_options *ReplaceV2PolicyOptions) SetDescription(description string) *ReplaceV2PolicyOptions { - _options.Description = core.StringPtr(description) - return _options +// Retrieve the value to be passed to a request to access the next page of results +func (resp *RoleAssignmentCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + return resp.Next.Start, nil } -// SetSubject : Allow user to set Subject -func (_options *ReplaceV2PolicyOptions) SetSubject(subject *V2PolicySubject) *ReplaceV2PolicyOptions { - _options.Subject = subject - return _options +// RoleAssignmentResource : The role assignment resources and target where the template is assigned. +type RoleAssignmentResource struct { + // assignment target account and type. + Target *AssignmentTargetDetails `json:"target" validate:"required"` + + // Set of properties of the assigned resource or error message if assignment failed. + Role *RoleAssignmentResourceRole `json:"role,omitempty"` } -// SetResource : Allow user to set Resource -func (_options *ReplaceV2PolicyOptions) SetResource(resource *V2PolicyResource) *ReplaceV2PolicyOptions { - _options.Resource = resource - return _options +// UnmarshalRoleAssignmentResource unmarshals an instance of RoleAssignmentResource from the specified map of raw messages. +func UnmarshalRoleAssignmentResource(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoleAssignmentResource) + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalAssignmentTargetDetails) + if err != nil { + err = core.SDKErrorf(err, "", "target-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "role", &obj.Role, UnmarshalRoleAssignmentResourceRole) + if err != nil { + err = core.SDKErrorf(err, "", "role-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetPattern : Allow user to set Pattern -func (_options *ReplaceV2PolicyOptions) SetPattern(pattern string) *ReplaceV2PolicyOptions { - _options.Pattern = core.StringPtr(pattern) - return _options +// RoleAssignmentResourceCreated : On success, it includes the role assigned. +type RoleAssignmentResourceCreated struct { + // role id. + ID *string `json:"id,omitempty"` } -// SetRule : Allow user to set Rule -func (_options *ReplaceV2PolicyOptions) SetRule(rule V2PolicyRuleIntf) *ReplaceV2PolicyOptions { - _options.Rule = rule - return _options +// UnmarshalRoleAssignmentResourceCreated unmarshals an instance of RoleAssignmentResourceCreated from the specified map of raw messages. +func UnmarshalRoleAssignmentResourceCreated(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoleAssignmentResourceCreated) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return } -// SetHeaders : Allow user to set Headers -func (options *ReplaceV2PolicyOptions) SetHeaders(param map[string]string) *ReplaceV2PolicyOptions { - options.Headers = param - return options +// RoleAssignmentResourceRole : Set of properties of the assigned resource or error message if assignment failed. +type RoleAssignmentResourceRole struct { + // On success, it includes the role assigned. + ResourceCreated *RoleAssignmentResourceCreated `json:"resource_created,omitempty"` + + // Body parameters for assignment error. + ErrorMessage *AssignmentResourceError `json:"error_message,omitempty"` } -// ResourceAttribute : An attribute associated with a resource. -type ResourceAttribute struct { - // The name of an attribute. - Name *string `json:"name" validate:"required"` +// UnmarshalRoleAssignmentResourceRole unmarshals an instance of RoleAssignmentResourceRole from the specified map of raw messages. +func UnmarshalRoleAssignmentResourceRole(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoleAssignmentResourceRole) + err = core.UnmarshalModel(m, "resource_created", &obj.ResourceCreated, UnmarshalRoleAssignmentResourceCreated) + if err != nil { + err = core.SDKErrorf(err, "", "resource_created-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "error_message", &obj.ErrorMessage, UnmarshalAssignmentResourceError) + if err != nil { + err = core.SDKErrorf(err, "", "error_message-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} - // The value of an attribute. - Value *string `json:"value" validate:"required"` +// RoleAssignmentTemplate : The role template id and version that will be assigned. +type RoleAssignmentTemplate struct { + // Action control template ID. + ID *string `json:"id" validate:"required"` - // The operator of an attribute. - Operator *string `json:"operator,omitempty"` + // Action control template version. + Version *string `json:"version" validate:"required"` } -// NewResourceAttribute : Instantiate ResourceAttribute (Generic Model Constructor) -func (*IamPolicyManagementV1) NewResourceAttribute(name string, value string) (_model *ResourceAttribute, err error) { - _model = &ResourceAttribute{ - Name: core.StringPtr(name), - Value: core.StringPtr(value), +// NewRoleAssignmentTemplate : Instantiate RoleAssignmentTemplate (Generic Model Constructor) +func (*IamPolicyManagementV1) NewRoleAssignmentTemplate(id string, version string) (_model *RoleAssignmentTemplate, err error) { + _model = &RoleAssignmentTemplate{ + ID: core.StringPtr(id), + Version: core.StringPtr(version), } err = core.ValidateStruct(_model, "required parameters") if err != nil { @@ -9929,95 +12315,260 @@ func (*IamPolicyManagementV1) NewResourceAttribute(name string, value string) (_ return } -// UnmarshalResourceAttribute unmarshals an instance of ResourceAttribute from the specified map of raw messages. -func UnmarshalResourceAttribute(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ResourceAttribute) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// UnmarshalRoleAssignmentTemplate unmarshals an instance of RoleAssignmentTemplate from the specified map of raw messages. +func UnmarshalRoleAssignmentTemplate(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoleAssignmentTemplate) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { - err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalPrimitive(m, "version", &obj.Version) if err != nil { - err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "version-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "operator", &obj.Operator) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// RoleCollection : A collection of roles returned by the 'list roles' operation. +type RoleCollection struct { + // List of custom roles. + CustomRoles []CustomRole `json:"custom_roles" validate:"required"` + + // List of service roles. + ServiceRoles []Role `json:"service_roles" validate:"required"` + + // List of system roles. + SystemRoles []Role `json:"system_roles" validate:"required"` +} + +// UnmarshalRoleCollection unmarshals an instance of RoleCollection from the specified map of raw messages. +func UnmarshalRoleCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoleCollection) + err = core.UnmarshalModel(m, "custom_roles", &obj.CustomRoles, UnmarshalCustomRole) if err != nil { - err = core.SDKErrorf(err, "", "operator-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "custom_roles-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "service_roles", &obj.ServiceRoles, UnmarshalRole) + if err != nil { + err = core.SDKErrorf(err, "", "service_roles-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "system_roles", &obj.SystemRoles, UnmarshalRole) + if err != nil { + err = core.SDKErrorf(err, "", "system_roles-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// ResourceTag : A tag associated with a resource. -type ResourceTag struct { - // The name of an access management tag. +// RoleTemplate : The set of properties associated with the role template. +type RoleTemplate struct { + // Required field when creating a new template. Otherwise, this field is optional. If the field is included, it changes + // the name value for all existing versions of the template. Name *string `json:"name" validate:"required"` - // The value of an access management tag. - Value *string `json:"value" validate:"required"` + // Description of the role template. This is shown to users in the enterprise account. Use this to describe the purpose + // or context of the role for enterprise users managing IAM templates. + Description *string `json:"description" validate:"required"` - // The operator of an access management tag. - Operator *string `json:"operator,omitempty"` + // Enterprise account ID where this template is created. + AccountID *string `json:"account_id" validate:"required"` + + // Committed status of the template. If committed is set to true, then the template version can no longer be updated. + Committed *bool `json:"committed,omitempty"` + + // The role properties that are created in an action resource when the template is assigned. + Role *RoleTemplatePrototypeRole `json:"role,omitempty"` + + // The role template ID. + ID *string `json:"id,omitempty"` + + // The href URL that links to the role templates API by role template ID. + Href *string `json:"href,omitempty"` + + // The UTC timestamp when the role template was created. + CreatedAt *strfmt.DateTime `json:"created_at,omitempty"` + + // The IAM ID of the entity that created the role template. + CreatedByID *string `json:"created_by_id,omitempty"` + + // The UTC timestamp when the role template was last modified. + LastModifiedAt *strfmt.DateTime `json:"last_modified_at,omitempty"` + + // The IAM ID of the entity that last modified the role template. + LastModifiedByID *string `json:"last_modified_by_id,omitempty"` + + // The version number of the template used to identify different versions of same template. + Version *string `json:"version" validate:"required"` + + // State of role template. + State *string `json:"state" validate:"required"` } -// NewResourceTag : Instantiate ResourceTag (Generic Model Constructor) -func (*IamPolicyManagementV1) NewResourceTag(name string, value string) (_model *ResourceTag, err error) { - _model = &ResourceTag{ - Name: core.StringPtr(name), - Value: core.StringPtr(value), +// Constants associated with the RoleTemplate.State property. +// State of role template. +const ( + RoleTemplateStateActiveConst = "active" + RoleTemplateStateDeletedConst = "deleted" +) + +// UnmarshalRoleTemplate unmarshals an instance of RoleTemplate from the specified map of raw messages. +func UnmarshalRoleTemplate(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoleTemplate) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return } - err = core.ValidateStruct(_model, "required parameters") + err = core.UnmarshalPrimitive(m, "description", &obj.Description) if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "account_id", &obj.AccountID) + if err != nil { + err = core.SDKErrorf(err, "", "account_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "committed", &obj.Committed) + if err != nil { + err = core.SDKErrorf(err, "", "committed-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "role", &obj.Role, UnmarshalRoleTemplatePrototypeRole) + if err != nil { + err = core.SDKErrorf(err, "", "role-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "created_by_id", &obj.CreatedByID) + if err != nil { + err = core.SDKErrorf(err, "", "created_by_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "last_modified_at", &obj.LastModifiedAt) + if err != nil { + err = core.SDKErrorf(err, "", "last_modified_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "last_modified_by_id", &obj.LastModifiedByID) + if err != nil { + err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "version", &obj.Version) + if err != nil { + err = core.SDKErrorf(err, "", "version-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "state", &obj.State) + if err != nil { + err = core.SDKErrorf(err, "", "state-error", common.GetComponentInfo()) + return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// UnmarshalResourceTag unmarshals an instance of ResourceTag from the specified map of raw messages. -func UnmarshalResourceTag(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(ResourceTag) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) +// RoleTemplateCollection : A collection of role templates. +type RoleTemplateCollection struct { + // The number of documents to include per each page of the collection. + Limit *int64 `json:"limit,omitempty"` + + // Details with linking href to first page of requested collection. + First *First `json:"first,omitempty"` + + // Details with href linking to the following page of requested collection. + Next *Next `json:"next,omitempty"` + + // Details with linking href to previous page of requested collection. + Previous *Previous `json:"previous,omitempty"` + + // List of role templates. + RoleTemplates []RoleTemplate `json:"role_templates" validate:"required"` +} + +// UnmarshalRoleTemplateCollection unmarshals an instance of RoleTemplateCollection from the specified map of raw messages. +func UnmarshalRoleTemplateCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoleTemplateCollection) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { - err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "value", &obj.Value) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalFirst) if err != nil { - err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "first-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "operator", &obj.Operator) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalNext) if err != nil { - err = core.SDKErrorf(err, "", "operator-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "next-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "previous", &obj.Previous, UnmarshalPrevious) + if err != nil { + err = core.SDKErrorf(err, "", "previous-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "role_templates", &obj.RoleTemplates, UnmarshalRoleTemplate) + if err != nil { + err = core.SDKErrorf(err, "", "role_templates-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// Role : A role resource. -type Role struct { +// Retrieve the value to be passed to a request to access the next page of results +func (resp *RoleTemplateCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + return resp.Next.Start, nil +} + +// RoleTemplatePrototypeRole : The role properties that are created in an action resource when the template is assigned. +type RoleTemplatePrototypeRole struct { + // The name of the role that is used in the CRN. This must be alphanumeric and capitalized. + Name *string `json:"name" validate:"required"` + // The display the name of the role that is shown in the console. DisplayName *string `json:"display_name" validate:"required"` - // The description of the role. + // The service name that the role refers. + ServiceName *string `json:"service_name,omitempty"` + + // Description of the role. Description *string `json:"description,omitempty"` - // The actions of the role. For more information, see [IAM roles and - // actions](https://cloud.ibm.com/docs/account?topic=account-iam-service-roles-actions). + // The actions of the role. Actions []string `json:"actions" validate:"required"` - - // The role Cloud Resource Name (CRN). Example CRN: - // 'crn:v1:ibmcloud:public:iam-access-management::a/exampleAccountId::customRole:ExampleRoleName'. - CRN *string `json:"crn,omitempty"` } -// NewRole : Instantiate Role (Generic Model Constructor) -func (*IamPolicyManagementV1) NewRole(displayName string, actions []string) (_model *Role, err error) { - _model = &Role{ +// NewRoleTemplatePrototypeRole : Instantiate RoleTemplatePrototypeRole (Generic Model Constructor) +func (*IamPolicyManagementV1) NewRoleTemplatePrototypeRole(name string, displayName string, actions []string) (_model *RoleTemplatePrototypeRole, err error) { + _model = &RoleTemplatePrototypeRole{ + Name: core.StringPtr(name), DisplayName: core.StringPtr(displayName), Actions: actions, } @@ -10028,14 +12579,24 @@ func (*IamPolicyManagementV1) NewRole(displayName string, actions []string) (_mo return } -// UnmarshalRole unmarshals an instance of Role from the specified map of raw messages. -func UnmarshalRole(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(Role) +// UnmarshalRoleTemplatePrototypeRole unmarshals an instance of RoleTemplatePrototypeRole from the specified map of raw messages. +func UnmarshalRoleTemplatePrototypeRole(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoleTemplatePrototypeRole) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "display_name", &obj.DisplayName) if err != nil { err = core.SDKErrorf(err, "", "display_name-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "service_name", &obj.ServiceName) + if err != nil { + err = core.SDKErrorf(err, "", "service_name-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "description", &obj.Description) if err != nil { err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) @@ -10046,83 +12607,107 @@ func UnmarshalRole(m map[string]json.RawMessage, result interface{}) (err error) err = core.SDKErrorf(err, "", "actions-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - err = core.SDKErrorf(err, "", "crn-error", common.GetComponentInfo()) - return - } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// RoleAction : An action that can be performed by the policy subject when assigned a role. -type RoleAction struct { - // Unique identifier for action with structure service.resource.action. For example, cbr.rule.read. +// RoleTemplateReferencesItem : A role template reference associated with a policy template. +type RoleTemplateReferencesItem struct { + // The role template ID. ID *string `json:"id" validate:"required"` - // Services defined display name for action. - DisplayName *string `json:"display_name" validate:"required"` + // Role template version. + Version *string `json:"version" validate:"required"` +} - // Service defined description for action. - Description *string `json:"description" validate:"required"` +// NewRoleTemplateReferencesItem : Instantiate RoleTemplateReferencesItem (Generic Model Constructor) +func (*IamPolicyManagementV1) NewRoleTemplateReferencesItem(id string, version string) (_model *RoleTemplateReferencesItem, err error) { + _model = &RoleTemplateReferencesItem{ + ID: core.StringPtr(id), + Version: core.StringPtr(version), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return } -// UnmarshalRoleAction unmarshals an instance of RoleAction from the specified map of raw messages. -func UnmarshalRoleAction(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoleAction) +// UnmarshalRoleTemplateReferencesItem unmarshals an instance of RoleTemplateReferencesItem from the specified map of raw messages. +func UnmarshalRoleTemplateReferencesItem(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoleTemplateReferencesItem) err = core.UnmarshalPrimitive(m, "id", &obj.ID) if err != nil { err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "display_name", &obj.DisplayName) - if err != nil { - err = core.SDKErrorf(err, "", "display_name-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "description", &obj.Description) + err = core.UnmarshalPrimitive(m, "version", &obj.Version) if err != nil { - err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "version-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } -// RoleCollection : A collection of roles returned by the 'list roles' operation. -type RoleCollection struct { - // List of custom roles. - CustomRoles []CustomRole `json:"custom_roles" validate:"required"` +// RoleTemplateVersionsCollection : A collection of versions for a specific role template. +type RoleTemplateVersionsCollection struct { + // The number of documents to include per each page of the collection. + Limit *int64 `json:"limit,omitempty"` - // List of service roles. - ServiceRoles []Role `json:"service_roles" validate:"required"` + // Details with linking href to first page of requested collection. + First *First `json:"first,omitempty"` - // List of system roles. - SystemRoles []Role `json:"system_roles" validate:"required"` + // Details with href linking to the following page of requested collection. + Next *Next `json:"next,omitempty"` + + // Details with linking href to previous page of requested collection. + Previous *Previous `json:"previous,omitempty"` + + // List of role templates versions. + Versions []RoleTemplate `json:"versions" validate:"required"` } -// UnmarshalRoleCollection unmarshals an instance of RoleCollection from the specified map of raw messages. -func UnmarshalRoleCollection(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(RoleCollection) - err = core.UnmarshalModel(m, "custom_roles", &obj.CustomRoles, UnmarshalCustomRole) +// UnmarshalRoleTemplateVersionsCollection unmarshals an instance of RoleTemplateVersionsCollection from the specified map of raw messages. +func UnmarshalRoleTemplateVersionsCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(RoleTemplateVersionsCollection) + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) if err != nil { - err = core.SDKErrorf(err, "", "custom_roles-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "service_roles", &obj.ServiceRoles, UnmarshalRole) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalFirst) if err != nil { - err = core.SDKErrorf(err, "", "service_roles-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "first-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "system_roles", &obj.SystemRoles, UnmarshalRole) + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalNext) if err != nil { - err = core.SDKErrorf(err, "", "system_roles-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "next-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "previous", &obj.Previous, UnmarshalPrevious) + if err != nil { + err = core.SDKErrorf(err, "", "previous-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "versions", &obj.Versions, UnmarshalRoleTemplate) + if err != nil { + err = core.SDKErrorf(err, "", "versions-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } +// Retrieve the value to be passed to a request to access the next page of results +func (resp *RoleTemplateVersionsCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + return resp.Next.Start, nil +} + // Roles : A role associated with a policy. type Roles struct { // The role Cloud Resource Name (CRN) granted by the policy. Example CRN: 'crn:v1:bluemix:public:iam::::role:Editor'. @@ -10312,6 +12897,36 @@ func UnmarshalTemplateActionControl(m map[string]json.RawMessage, result interfa return } +// TemplateControl : Specifies the type of access that is granted by the policy. +type TemplateControl struct { + // Permission is granted by the policy. + Grant TemplateGrantIntf `json:"grant" validate:"required"` +} + +// NewTemplateControl : Instantiate TemplateControl (Generic Model Constructor) +func (*IamPolicyManagementV1) NewTemplateControl(grant TemplateGrantIntf) (_model *TemplateControl, err error) { + _model = &TemplateControl{ + Grant: grant, + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +// UnmarshalTemplateControl unmarshals an instance of TemplateControl from the specified map of raw messages. +func UnmarshalTemplateControl(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(TemplateControl) + err = core.UnmarshalModel(m, "grant", &obj.Grant, UnmarshalTemplateGrant) + if err != nil { + err = core.SDKErrorf(err, "", "grant-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // TemplateCountData : policy template count details. type TemplateCountData struct { // policy template current and limit details with in an account. @@ -10338,6 +12953,42 @@ func UnmarshalTemplateCountData(m map[string]json.RawMessage, result interface{} return } +// TemplateGrant : Permission is granted by the policy. +// Models which "extend" this model: +// - TemplateGrantRoles +// - TemplateGrantRoleReferences +type TemplateGrant struct { + // A set of role Cloud Resource Names (CRNs) granted by the policy. + Roles []Roles `json:"roles,omitempty"` + + // A set of role template reference IDs granted by the policy. + RoleTemplateReferences []RoleTemplateReferencesItem `json:"role_template_references,omitempty"` +} +func (*TemplateGrant) isaTemplateGrant() bool { + return true +} + +type TemplateGrantIntf interface { + isaTemplateGrant() bool +} + +// UnmarshalTemplateGrant unmarshals an instance of TemplateGrant from the specified map of raw messages. +func UnmarshalTemplateGrant(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(TemplateGrant) + err = core.UnmarshalModel(m, "roles", &obj.Roles, UnmarshalRoles) + if err != nil { + err = core.SDKErrorf(err, "", "roles-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "role_template_references", &obj.RoleTemplateReferences, UnmarshalRoleTemplateReferencesItem) + if err != nil { + err = core.SDKErrorf(err, "", "role_template_references-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // TemplateMetadata : The details of the IAM template that was used to create an enterprise-managed policy in your account. When returned, // this indicates that the policy is created from and managed by a template in the root enterprise account. type TemplateMetadata struct { @@ -10412,7 +13063,7 @@ type TemplatePolicy struct { Rule V2PolicyRuleIntf `json:"rule,omitempty"` // Specifies the type of access that is granted by the policy. - Control *Control `json:"control,omitempty"` + Control *TemplateControl `json:"control,omitempty"` } // Constants associated with the TemplatePolicy.Type property. @@ -10467,7 +13118,7 @@ func UnmarshalTemplatePolicy(m map[string]json.RawMessage, result interface{}) ( err = core.SDKErrorf(err, "", "rule-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "control", &obj.Control, UnmarshalControl) + err = core.UnmarshalModel(m, "control", &obj.Control, UnmarshalTemplateControl) if err != nil { err = core.SDKErrorf(err, "", "control-error", common.GetComponentInfo()) return @@ -10476,6 +13127,61 @@ func UnmarshalTemplatePolicy(m map[string]json.RawMessage, result interface{}) ( return } +// TemplateRole : The role properties that are created in an action resource when the template is assigned. +type TemplateRole struct { + // The display the name of the role that is shown in the console. + DisplayName *string `json:"display_name" validate:"required"` + + // The service name that the role refers. + ServiceName *string `json:"service_name,omitempty"` + + // Description of the role. + Description *string `json:"description,omitempty"` + + // The actions of the role. + Actions []string `json:"actions" validate:"required"` +} + +// NewTemplateRole : Instantiate TemplateRole (Generic Model Constructor) +func (*IamPolicyManagementV1) NewTemplateRole(displayName string, actions []string) (_model *TemplateRole, err error) { + _model = &TemplateRole{ + DisplayName: core.StringPtr(displayName), + Actions: actions, + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +// UnmarshalTemplateRole unmarshals an instance of TemplateRole from the specified map of raw messages. +func UnmarshalTemplateRole(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(TemplateRole) + err = core.UnmarshalPrimitive(m, "display_name", &obj.DisplayName) + if err != nil { + err = core.SDKErrorf(err, "", "display_name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "service_name", &obj.ServiceName) + if err != nil { + err = core.SDKErrorf(err, "", "service_name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "description", &obj.Description) + if err != nil { + err = core.SDKErrorf(err, "", "description-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "actions", &obj.Actions) + if err != nil { + err = core.SDKErrorf(err, "", "actions-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // UpdateActionControlAssignmentOptions : The UpdateActionControlAssignment options. type UpdateActionControlAssignmentOptions struct { // Action control template assignment ID. @@ -10641,6 +13347,56 @@ func (options *UpdatePolicyStateOptions) SetHeaders(param map[string]string) *Up return options } +// UpdateRoleAssignmentOptions : The UpdateRoleAssignment options. +type UpdateRoleAssignmentOptions struct { + // Role template assignment ID. + AssignmentID *string `json:"assignment_id" validate:"required,ne="` + + // The revision number for updating a role assignment and must match the Etag value of the existing role assignment. + // The Etag can be retrieved using the GET /v1/role_assignments/{assignment_id} API and looking at the Etag response + // header. + IfMatch *string `json:"If-Match" validate:"required"` + + // The version number of the template used to identify different versions of same template. + TemplateVersion *string `json:"template_version" validate:"required"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewUpdateRoleAssignmentOptions : Instantiate UpdateRoleAssignmentOptions +func (*IamPolicyManagementV1) NewUpdateRoleAssignmentOptions(assignmentID string, ifMatch string, templateVersion string) *UpdateRoleAssignmentOptions { + return &UpdateRoleAssignmentOptions{ + AssignmentID: core.StringPtr(assignmentID), + IfMatch: core.StringPtr(ifMatch), + TemplateVersion: core.StringPtr(templateVersion), + } +} + +// SetAssignmentID : Allow user to set AssignmentID +func (_options *UpdateRoleAssignmentOptions) SetAssignmentID(assignmentID string) *UpdateRoleAssignmentOptions { + _options.AssignmentID = core.StringPtr(assignmentID) + return _options +} + +// SetIfMatch : Allow user to set IfMatch +func (_options *UpdateRoleAssignmentOptions) SetIfMatch(ifMatch string) *UpdateRoleAssignmentOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options +} + +// SetTemplateVersion : Allow user to set TemplateVersion +func (_options *UpdateRoleAssignmentOptions) SetTemplateVersion(templateVersion string) *UpdateRoleAssignmentOptions { + _options.TemplateVersion = core.StringPtr(templateVersion) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *UpdateRoleAssignmentOptions) SetHeaders(param map[string]string) *UpdateRoleAssignmentOptions { + options.Headers = param + return options +} + // UpdateSettingsOptions : The UpdateSettings options. type UpdateSettingsOptions struct { // The account GUID that the settings belong to. @@ -11816,24 +14572,94 @@ func UnmarshalPolicyTemplateAssignmentItemsPolicyAssignmentV1(m map[string]json. err = core.SDKErrorf(err, "", "last_modified_by_id-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "resources", &obj.Resources, UnmarshalPolicyAssignmentV1Resources) + err = core.UnmarshalModel(m, "resources", &obj.Resources, UnmarshalPolicyAssignmentV1Resources) + if err != nil { + err = core.SDKErrorf(err, "", "resources-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "subject", &obj.Subject, UnmarshalPolicyAssignmentV1Subject) + if err != nil { + err = core.SDKErrorf(err, "", "subject-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "template", &obj.Template, UnmarshalAssignmentTemplateDetails) + if err != nil { + err = core.SDKErrorf(err, "", "template-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// TemplateGrantRoleReferences : TemplateGrantRoleReferences struct +// This model "extends" TemplateGrant +type TemplateGrantRoleReferences struct { + // A set of role template reference IDs granted by the policy. + RoleTemplateReferences []RoleTemplateReferencesItem `json:"role_template_references" validate:"required"` +} + +// NewTemplateGrantRoleReferences : Instantiate TemplateGrantRoleReferences (Generic Model Constructor) +func (*IamPolicyManagementV1) NewTemplateGrantRoleReferences(roleTemplateReferences []RoleTemplateReferencesItem) (_model *TemplateGrantRoleReferences, err error) { + _model = &TemplateGrantRoleReferences{ + RoleTemplateReferences: roleTemplateReferences, + } + err = core.ValidateStruct(_model, "required parameters") if err != nil { - err = core.SDKErrorf(err, "", "resources-error", common.GetComponentInfo()) - return + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) } - err = core.UnmarshalModel(m, "subject", &obj.Subject, UnmarshalPolicyAssignmentV1Subject) + return +} + +func (*TemplateGrantRoleReferences) isaTemplateGrant() bool { + return true +} + +// UnmarshalTemplateGrantRoleReferences unmarshals an instance of TemplateGrantRoleReferences from the specified map of raw messages. +func UnmarshalTemplateGrantRoleReferences(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(TemplateGrantRoleReferences) + err = core.UnmarshalModel(m, "role_template_references", &obj.RoleTemplateReferences, UnmarshalRoleTemplateReferencesItem) if err != nil { - err = core.SDKErrorf(err, "", "subject-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "role_template_references-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "template", &obj.Template, UnmarshalAssignmentTemplateDetails) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// TemplateGrantRoles : TemplateGrantRoles struct +// This model "extends" TemplateGrant +type TemplateGrantRoles struct { + // A set of role Cloud Resource Names (CRNs) granted by the policy. + Roles []Roles `json:"roles" validate:"required"` +} + +// NewTemplateGrantRoles : Instantiate TemplateGrantRoles (Generic Model Constructor) +func (*IamPolicyManagementV1) NewTemplateGrantRoles(roles []Roles) (_model *TemplateGrantRoles, err error) { + _model = &TemplateGrantRoles{ + Roles: roles, + } + err = core.ValidateStruct(_model, "required parameters") if err != nil { - err = core.SDKErrorf(err, "", "template-error", common.GetComponentInfo()) - return + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) } - err = core.UnmarshalPrimitive(m, "status", &obj.Status) + return +} + +func (*TemplateGrantRoles) isaTemplateGrant() bool { + return true +} + +// UnmarshalTemplateGrantRoles unmarshals an instance of TemplateGrantRoles from the specified map of raw messages. +func UnmarshalTemplateGrantRoles(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(TemplateGrantRoles) + err = core.UnmarshalModel(m, "roles", &obj.Roles, UnmarshalRoles) if err != nil { - err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "roles-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -12666,3 +15492,264 @@ func (pager *ActionControlAssignmentsPager) GetAll() (allItems []ActionControlAs err = core.RepurposeSDKProblem(err, "") return } + +// +// RoleTemplatesPager can be used to simplify the use of the "ListRoleTemplates" method. +// +type RoleTemplatesPager struct { + hasNext bool + options *ListRoleTemplatesOptions + client *IamPolicyManagementV1 + pageContext struct { + next *string + } +} + +// NewRoleTemplatesPager returns a new RoleTemplatesPager instance. +func (iamPolicyManagement *IamPolicyManagementV1) NewRoleTemplatesPager(options *ListRoleTemplatesOptions) (pager *RoleTemplatesPager, err error) { + if options.Start != nil && *options.Start != "" { + err = core.SDKErrorf(nil, "the 'options.Start' field should not be set", "no-query-setting", common.GetComponentInfo()) + return + } + + var optionsCopy ListRoleTemplatesOptions = *options + pager = &RoleTemplatesPager{ + hasNext: true, + options: &optionsCopy, + client: iamPolicyManagement, + } + return +} + +// HasNext returns true if there are potentially more results to be retrieved. +func (pager *RoleTemplatesPager) HasNext() bool { + return pager.hasNext +} + +// GetNextWithContext returns the next page of results using the specified Context. +func (pager *RoleTemplatesPager) GetNextWithContext(ctx context.Context) (page []RoleTemplate, err error) { + if !pager.HasNext() { + return nil, fmt.Errorf("no more results available") + } + + pager.options.Start = pager.pageContext.next + + result, _, err := pager.client.ListRoleTemplatesWithContext(ctx, pager.options) + if err != nil { + err = core.RepurposeSDKProblem(err, "error-getting-next-page") + return + } + + var next *string + if result.Next != nil { + next = result.Next.Start + } + pager.pageContext.next = next + pager.hasNext = (pager.pageContext.next != nil) + page = result.RoleTemplates + + return +} + +// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly +// until all pages of results have been retrieved. +func (pager *RoleTemplatesPager) GetAllWithContext(ctx context.Context) (allItems []RoleTemplate, err error) { + for pager.HasNext() { + var nextPage []RoleTemplate + nextPage, err = pager.GetNextWithContext(ctx) + if err != nil { + err = core.RepurposeSDKProblem(err, "error-getting-next-page") + return + } + allItems = append(allItems, nextPage...) + } + return +} + +// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. +func (pager *RoleTemplatesPager) GetNext() (page []RoleTemplate, err error) { + page, err = pager.GetNextWithContext(context.Background()) + err = core.RepurposeSDKProblem(err, "") + return +} + +// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. +func (pager *RoleTemplatesPager) GetAll() (allItems []RoleTemplate, err error) { + allItems, err = pager.GetAllWithContext(context.Background()) + err = core.RepurposeSDKProblem(err, "") + return +} + +// +// RoleTemplateVersionsPager can be used to simplify the use of the "ListRoleTemplateVersions" method. +// +type RoleTemplateVersionsPager struct { + hasNext bool + options *ListRoleTemplateVersionsOptions + client *IamPolicyManagementV1 + pageContext struct { + next *string + } +} + +// NewRoleTemplateVersionsPager returns a new RoleTemplateVersionsPager instance. +func (iamPolicyManagement *IamPolicyManagementV1) NewRoleTemplateVersionsPager(options *ListRoleTemplateVersionsOptions) (pager *RoleTemplateVersionsPager, err error) { + if options.Start != nil && *options.Start != "" { + err = core.SDKErrorf(nil, "the 'options.Start' field should not be set", "no-query-setting", common.GetComponentInfo()) + return + } + + var optionsCopy ListRoleTemplateVersionsOptions = *options + pager = &RoleTemplateVersionsPager{ + hasNext: true, + options: &optionsCopy, + client: iamPolicyManagement, + } + return +} + +// HasNext returns true if there are potentially more results to be retrieved. +func (pager *RoleTemplateVersionsPager) HasNext() bool { + return pager.hasNext +} + +// GetNextWithContext returns the next page of results using the specified Context. +func (pager *RoleTemplateVersionsPager) GetNextWithContext(ctx context.Context) (page []RoleTemplate, err error) { + if !pager.HasNext() { + return nil, fmt.Errorf("no more results available") + } + + pager.options.Start = pager.pageContext.next + + result, _, err := pager.client.ListRoleTemplateVersionsWithContext(ctx, pager.options) + if err != nil { + err = core.RepurposeSDKProblem(err, "error-getting-next-page") + return + } + + var next *string + if result.Next != nil { + next = result.Next.Start + } + pager.pageContext.next = next + pager.hasNext = (pager.pageContext.next != nil) + page = result.Versions + + return +} + +// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly +// until all pages of results have been retrieved. +func (pager *RoleTemplateVersionsPager) GetAllWithContext(ctx context.Context) (allItems []RoleTemplate, err error) { + for pager.HasNext() { + var nextPage []RoleTemplate + nextPage, err = pager.GetNextWithContext(ctx) + if err != nil { + err = core.RepurposeSDKProblem(err, "error-getting-next-page") + return + } + allItems = append(allItems, nextPage...) + } + return +} + +// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. +func (pager *RoleTemplateVersionsPager) GetNext() (page []RoleTemplate, err error) { + page, err = pager.GetNextWithContext(context.Background()) + err = core.RepurposeSDKProblem(err, "") + return +} + +// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. +func (pager *RoleTemplateVersionsPager) GetAll() (allItems []RoleTemplate, err error) { + allItems, err = pager.GetAllWithContext(context.Background()) + err = core.RepurposeSDKProblem(err, "") + return +} + +// +// RoleAssignmentsPager can be used to simplify the use of the "ListRoleAssignments" method. +// +type RoleAssignmentsPager struct { + hasNext bool + options *ListRoleAssignmentsOptions + client *IamPolicyManagementV1 + pageContext struct { + next *string + } +} + +// NewRoleAssignmentsPager returns a new RoleAssignmentsPager instance. +func (iamPolicyManagement *IamPolicyManagementV1) NewRoleAssignmentsPager(options *ListRoleAssignmentsOptions) (pager *RoleAssignmentsPager, err error) { + if options.Start != nil && *options.Start != "" { + err = core.SDKErrorf(nil, "the 'options.Start' field should not be set", "no-query-setting", common.GetComponentInfo()) + return + } + + var optionsCopy ListRoleAssignmentsOptions = *options + pager = &RoleAssignmentsPager{ + hasNext: true, + options: &optionsCopy, + client: iamPolicyManagement, + } + return +} + +// HasNext returns true if there are potentially more results to be retrieved. +func (pager *RoleAssignmentsPager) HasNext() bool { + return pager.hasNext +} + +// GetNextWithContext returns the next page of results using the specified Context. +func (pager *RoleAssignmentsPager) GetNextWithContext(ctx context.Context) (page []RoleAssignment, err error) { + if !pager.HasNext() { + return nil, fmt.Errorf("no more results available") + } + + pager.options.Start = pager.pageContext.next + + result, _, err := pager.client.ListRoleAssignmentsWithContext(ctx, pager.options) + if err != nil { + err = core.RepurposeSDKProblem(err, "error-getting-next-page") + return + } + + var next *string + if result.Next != nil { + next = result.Next.Start + } + pager.pageContext.next = next + pager.hasNext = (pager.pageContext.next != nil) + page = result.Assignments + + return +} + +// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly +// until all pages of results have been retrieved. +func (pager *RoleAssignmentsPager) GetAllWithContext(ctx context.Context) (allItems []RoleAssignment, err error) { + for pager.HasNext() { + var nextPage []RoleAssignment + nextPage, err = pager.GetNextWithContext(ctx) + if err != nil { + err = core.RepurposeSDKProblem(err, "error-getting-next-page") + return + } + allItems = append(allItems, nextPage...) + } + return +} + +// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. +func (pager *RoleAssignmentsPager) GetNext() (page []RoleAssignment, err error) { + page, err = pager.GetNextWithContext(context.Background()) + err = core.RepurposeSDKProblem(err, "") + return +} + +// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. +func (pager *RoleAssignmentsPager) GetAll() (allItems []RoleAssignment, err error) { + allItems, err = pager.GetAllWithContext(context.Background()) + err = core.RepurposeSDKProblem(err, "") + return +} diff --git a/vendor/github.com/IBM/vpc-go-sdk/common/version.go b/vendor/github.com/IBM/vpc-go-sdk/common/version.go index f4a88168c83..3c187cbe407 100644 --- a/vendor/github.com/IBM/vpc-go-sdk/common/version.go +++ b/vendor/github.com/IBM/vpc-go-sdk/common/version.go @@ -1,4 +1,4 @@ package common // Version of the SDK -const Version = "0.71.1" +const Version = "0.76.2" diff --git a/vendor/github.com/IBM/vpc-go-sdk/vpcv1/vpc_v1.go b/vendor/github.com/IBM/vpc-go-sdk/vpcv1/vpc_v1.go index ee4742fca3e..cb0425a3bc1 100644 --- a/vendor/github.com/IBM/vpc-go-sdk/vpcv1/vpc_v1.go +++ b/vendor/github.com/IBM/vpc-go-sdk/vpcv1/vpc_v1.go @@ -15,7 +15,7 @@ */ /* - * IBM OpenAPI SDK Code Generator Version: 3.105.1-067d600b-20250616-154447 + * IBM OpenAPI SDK Code Generator Version: 3.107.1-41b0fbd0-20250825-080732 */ // Package vpcv1 : Operations and models for the VpcV1 service @@ -38,7 +38,7 @@ import ( // VpcV1 : The IBM Cloud Virtual Private Cloud (VPC) API can be used to programmatically provision and manage virtual // server instances, along with subnets, volumes, load balancers, and more. // -// API Version: 2025-09-01 +// API Version: 2025-11-17 type VpcV1 struct { Service *core.BaseService @@ -46,8 +46,8 @@ type VpcV1 struct { // `2`. Generation *int64 - // The API version, in format `YYYY-MM-DD`. For the API behavior documented here, specify any date between `2025-08-26` - // and `2025-09-01`. + // The API version, in format `YYYY-MM-DD`. For the API behavior documented here, specify any date between `2025-09-16` + // and `2025-11-17`. Version *string } @@ -67,8 +67,8 @@ type VpcV1Options struct { // `2`. Generation *int64 - // The API version, in format `YYYY-MM-DD`. For the API behavior documented here, specify any date between `2025-08-26` - // and `2025-09-01`. + // The API version, in format `YYYY-MM-DD`. For the API behavior documented here, specify any date between `2025-09-16` + // and `2025-11-17`. Version *string } @@ -133,7 +133,7 @@ func NewVpcV1(options *VpcV1Options) (service *VpcV1, err error) { } if options.Version == nil { - options.Version = core.StringPtr("2025-08-26") + options.Version = core.StringPtr("2025-11-17") } service = &VpcV1{ @@ -159,6 +159,7 @@ func GetServiceURLForRegion(region string) (string, error) { "eu-de": "https://eu-de.iaas.cloud.ibm.com/v1", // Germany (Frankfurt) "eu-es": "https://eu-es.iaas.cloud.ibm.com/v1", // Spain (Madrid) "eu-gb": "https://eu-gb.iaas.cloud.ibm.com/v1", // United Kingdom (London) + "in-che": "https://in-che.iaas.cloud.ibm.com/v1", // India (Chennai) "jp-osa": "https://jp-osa.iaas.cloud.ibm.com/v1", // Japan (Osaka) "jp-tok": "https://jp-tok.iaas.cloud.ibm.com/v1", // Japan (Tokyo) "us-east": "https://us-east.iaas.cloud.ibm.com/v1", // US East (Washington DC) @@ -6692,6 +6693,9 @@ func (vpc *VpcV1) ListEndpointGatewaysWithContext(ctx context.Context, listEndpo builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.Generation)) + if listEndpointGatewaysOptions.AllowResourceBinding != nil { + builder.AddQuery("allow_resource_binding", fmt.Sprint(*listEndpointGatewaysOptions.AllowResourceBinding)) + } if listEndpointGatewaysOptions.Name != nil { builder.AddQuery("name", fmt.Sprint(*listEndpointGatewaysOptions.Name)) } @@ -6801,6 +6805,9 @@ func (vpc *VpcV1) CreateEndpointGatewayWithContext(ctx context.Context, createEn if createEndpointGatewayOptions.AllowDnsResolutionBinding != nil { body["allow_dns_resolution_binding"] = createEndpointGatewayOptions.AllowDnsResolutionBinding } + if createEndpointGatewayOptions.AllowResourceBinding != nil { + body["allow_resource_binding"] = createEndpointGatewayOptions.AllowResourceBinding + } if createEndpointGatewayOptions.Ips != nil { body["ips"] = createEndpointGatewayOptions.Ips } @@ -7138,11 +7145,411 @@ func (vpc *VpcV1) AddEndpointGatewayIPWithContext(ctx context.Context, addEndpoi return } +// ListEndpointGatewayResourceBindings : List resource bindings for an endpoint gateway +// This request lists resource bindings for an endpoint gateway. A resource binding is an association between the +// endpoint gateway and a resource in the endpoint gateway's `target` service. The resource binding provides a fully +// qualified domain name for the +// `service_endpoint` to access the resource from the endpoint gateway's VPC. +// +// The resource bindings will be sorted by their `created_at` property values, with newest resource bindings first. +// Resource bindings with identical `created_at` property values will in turn be sorted by ascending `name` property +// values. +func (vpc *VpcV1) ListEndpointGatewayResourceBindings(listEndpointGatewayResourceBindingsOptions *ListEndpointGatewayResourceBindingsOptions) (result *EndpointGatewayResourceBindingCollection, response *core.DetailedResponse, err error) { + result, response, err = vpc.ListEndpointGatewayResourceBindingsWithContext(context.Background(), listEndpointGatewayResourceBindingsOptions) + err = core.RepurposeSDKProblem(err, "") + return +} + +// ListEndpointGatewayResourceBindingsWithContext is an alternate form of the ListEndpointGatewayResourceBindings method which supports a Context parameter +func (vpc *VpcV1) ListEndpointGatewayResourceBindingsWithContext(ctx context.Context, listEndpointGatewayResourceBindingsOptions *ListEndpointGatewayResourceBindingsOptions) (result *EndpointGatewayResourceBindingCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listEndpointGatewayResourceBindingsOptions, "listEndpointGatewayResourceBindingsOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(listEndpointGatewayResourceBindingsOptions, "listEndpointGatewayResourceBindingsOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } + + pathParamsMap := map[string]string{ + "endpoint_gateway_id": *listEndpointGatewayResourceBindingsOptions.EndpointGatewayID, + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{endpoint_gateway_id}/resource_bindings`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListEndpointGatewayResourceBindings") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range listEndpointGatewayResourceBindingsOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.Generation)) + if listEndpointGatewayResourceBindingsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listEndpointGatewayResourceBindingsOptions.Start)) + } + if listEndpointGatewayResourceBindingsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listEndpointGatewayResourceBindingsOptions.Limit)) + } + + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + core.EnrichHTTPProblem(err, "list_endpoint_gateway_resource_bindings", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalEndpointGatewayResourceBindingCollection) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + + return +} + +// CreateEndpointGatewayResourceBinding : Create a resource binding for an endpoint gateway +// This request creates a new resource binding for an endpoint gateway from an endpoint gateway resource binding +// prototype object. The prototype object is structured in the same way as a retrieved endpoint gateway resource +// binding, and contains the information necessary to create the new resource binding. +// +// For this request to succeed, resource binding must be enabled for this endpoint gateway's +// `target` service and this endpoint gateway resource binding must not conflict with another resource binding in the +// [DNS sharing](/docs/vpc?topic=vpc-vpe-dns-sharing) connected topology. +func (vpc *VpcV1) CreateEndpointGatewayResourceBinding(createEndpointGatewayResourceBindingOptions *CreateEndpointGatewayResourceBindingOptions) (result *EndpointGatewayResourceBinding, response *core.DetailedResponse, err error) { + result, response, err = vpc.CreateEndpointGatewayResourceBindingWithContext(context.Background(), createEndpointGatewayResourceBindingOptions) + err = core.RepurposeSDKProblem(err, "") + return +} + +// CreateEndpointGatewayResourceBindingWithContext is an alternate form of the CreateEndpointGatewayResourceBinding method which supports a Context parameter +func (vpc *VpcV1) CreateEndpointGatewayResourceBindingWithContext(ctx context.Context, createEndpointGatewayResourceBindingOptions *CreateEndpointGatewayResourceBindingOptions) (result *EndpointGatewayResourceBinding, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(createEndpointGatewayResourceBindingOptions, "createEndpointGatewayResourceBindingOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(createEndpointGatewayResourceBindingOptions, "createEndpointGatewayResourceBindingOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } + + pathParamsMap := map[string]string{ + "endpoint_gateway_id": *createEndpointGatewayResourceBindingOptions.EndpointGatewayID, + } + + builder := core.NewRequestBuilder(core.POST) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{endpoint_gateway_id}/resource_bindings`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CreateEndpointGatewayResourceBinding") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range createEndpointGatewayResourceBindingOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.Generation)) + + body := make(map[string]interface{}) + if createEndpointGatewayResourceBindingOptions.Target != nil { + body["target"] = createEndpointGatewayResourceBindingOptions.Target + } + if createEndpointGatewayResourceBindingOptions.Name != nil { + body["name"] = createEndpointGatewayResourceBindingOptions.Name + } + _, err = builder.SetBodyContentJSON(body) + if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) + return + } + + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + core.EnrichHTTPProblem(err, "create_endpoint_gateway_resource_binding", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalEndpointGatewayResourceBinding) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + + return +} + +// DeleteEndpointGatewayResourceBinding : Delete a resource binding from an endpoint gateway +// This request deletes the specified resource binding from the specified endpoint gateway. This operation cannot be +// reversed. +func (vpc *VpcV1) DeleteEndpointGatewayResourceBinding(deleteEndpointGatewayResourceBindingOptions *DeleteEndpointGatewayResourceBindingOptions) (response *core.DetailedResponse, err error) { + response, err = vpc.DeleteEndpointGatewayResourceBindingWithContext(context.Background(), deleteEndpointGatewayResourceBindingOptions) + err = core.RepurposeSDKProblem(err, "") + return +} + +// DeleteEndpointGatewayResourceBindingWithContext is an alternate form of the DeleteEndpointGatewayResourceBinding method which supports a Context parameter +func (vpc *VpcV1) DeleteEndpointGatewayResourceBindingWithContext(ctx context.Context, deleteEndpointGatewayResourceBindingOptions *DeleteEndpointGatewayResourceBindingOptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(deleteEndpointGatewayResourceBindingOptions, "deleteEndpointGatewayResourceBindingOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(deleteEndpointGatewayResourceBindingOptions, "deleteEndpointGatewayResourceBindingOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } + + pathParamsMap := map[string]string{ + "endpoint_gateway_id": *deleteEndpointGatewayResourceBindingOptions.EndpointGatewayID, + "id": *deleteEndpointGatewayResourceBindingOptions.ID, + } + + builder := core.NewRequestBuilder(core.DELETE) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{endpoint_gateway_id}/resource_bindings/{id}`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "DeleteEndpointGatewayResourceBinding") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range deleteEndpointGatewayResourceBindingOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.Generation)) + + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + response, err = vpc.Service.Request(request, nil) + if err != nil { + core.EnrichHTTPProblem(err, "delete_endpoint_gateway_resource_binding", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + + return +} + +// GetEndpointGatewayResourceBinding : Retrieve an endpoint gateway resource binding +// This request retrieves a single endpoint gateway resource binding specified by the identifier in the URL. +func (vpc *VpcV1) GetEndpointGatewayResourceBinding(getEndpointGatewayResourceBindingOptions *GetEndpointGatewayResourceBindingOptions) (result *EndpointGatewayResourceBinding, response *core.DetailedResponse, err error) { + result, response, err = vpc.GetEndpointGatewayResourceBindingWithContext(context.Background(), getEndpointGatewayResourceBindingOptions) + err = core.RepurposeSDKProblem(err, "") + return +} + +// GetEndpointGatewayResourceBindingWithContext is an alternate form of the GetEndpointGatewayResourceBinding method which supports a Context parameter +func (vpc *VpcV1) GetEndpointGatewayResourceBindingWithContext(ctx context.Context, getEndpointGatewayResourceBindingOptions *GetEndpointGatewayResourceBindingOptions) (result *EndpointGatewayResourceBinding, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getEndpointGatewayResourceBindingOptions, "getEndpointGatewayResourceBindingOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(getEndpointGatewayResourceBindingOptions, "getEndpointGatewayResourceBindingOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } + + pathParamsMap := map[string]string{ + "endpoint_gateway_id": *getEndpointGatewayResourceBindingOptions.EndpointGatewayID, + "id": *getEndpointGatewayResourceBindingOptions.ID, + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{endpoint_gateway_id}/resource_bindings/{id}`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetEndpointGatewayResourceBinding") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range getEndpointGatewayResourceBindingOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.Generation)) + + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + core.EnrichHTTPProblem(err, "get_endpoint_gateway_resource_binding", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalEndpointGatewayResourceBinding) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + + return +} + +// UpdateEndpointGatewayResourceBinding : Update an endpoint gateway resource binding +// This request updates an endpoint gateway resource binding with the information in a provided endpoint gateway +// resource binding patch. The endpoint gateway resource binding patch object is structured in the same way as a +// retrieved endpoint gateway resource binding and contains only the information to be updated. +func (vpc *VpcV1) UpdateEndpointGatewayResourceBinding(updateEndpointGatewayResourceBindingOptions *UpdateEndpointGatewayResourceBindingOptions) (result *EndpointGatewayResourceBinding, response *core.DetailedResponse, err error) { + result, response, err = vpc.UpdateEndpointGatewayResourceBindingWithContext(context.Background(), updateEndpointGatewayResourceBindingOptions) + err = core.RepurposeSDKProblem(err, "") + return +} + +// UpdateEndpointGatewayResourceBindingWithContext is an alternate form of the UpdateEndpointGatewayResourceBinding method which supports a Context parameter +func (vpc *VpcV1) UpdateEndpointGatewayResourceBindingWithContext(ctx context.Context, updateEndpointGatewayResourceBindingOptions *UpdateEndpointGatewayResourceBindingOptions) (result *EndpointGatewayResourceBinding, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(updateEndpointGatewayResourceBindingOptions, "updateEndpointGatewayResourceBindingOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(updateEndpointGatewayResourceBindingOptions, "updateEndpointGatewayResourceBindingOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } + + pathParamsMap := map[string]string{ + "endpoint_gateway_id": *updateEndpointGatewayResourceBindingOptions.EndpointGatewayID, + "id": *updateEndpointGatewayResourceBindingOptions.ID, + } + + builder := core.NewRequestBuilder(core.PATCH) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/endpoint_gateways/{endpoint_gateway_id}/resource_bindings/{id}`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "UpdateEndpointGatewayResourceBinding") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range updateEndpointGatewayResourceBindingOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + builder.AddHeader("Content-Type", "application/merge-patch+json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.Generation)) + + _, err = builder.SetBodyContentJSON(updateEndpointGatewayResourceBindingOptions.EndpointGatewayResourceBindingPatch) + if err != nil { + err = core.SDKErrorf(err, "", "set-json-body-error", common.GetComponentInfo()) + return + } + + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + core.EnrichHTTPProblem(err, "update_endpoint_gateway_resource_binding", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalEndpointGatewayResourceBinding) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + + return +} + // DeleteEndpointGateway : Delete an endpoint gateway // This request deletes an endpoint gateway. This operation cannot be reversed. // // Reserved IPs that were bound to the endpoint gateway will be released if their // `auto_delete` property is set to true. +// +// If the VPC this endpoint gateway resides in has `dns.enable_hub` set to `true`, then no other VPC in the [DNS +// sharing](/docs/vpc?topic=vpc-vpe-dns-sharing) topology must contain an endpoint gateway with the same `target` +// service as this endpoint gateway. func (vpc *VpcV1) DeleteEndpointGateway(deleteEndpointGatewayOptions *DeleteEndpointGatewayOptions) (response *core.DetailedResponse, err error) { response, err = vpc.DeleteEndpointGatewayWithContext(context.Background(), deleteEndpointGatewayOptions) err = core.RepurposeSDKProblem(err, "") @@ -12135,6 +12542,12 @@ func (vpc *VpcV1) ListInstancesWithContext(ctx context.Context, listInstancesOpt if listInstancesOptions.DedicatedHostName != nil { builder.AddQuery("dedicated_host.name", fmt.Sprint(*listInstancesOptions.DedicatedHostName)) } + if listInstancesOptions.InstanceGroupMembershipInstanceGroupID != nil { + builder.AddQuery("instance_group_membership.instance_group.id", fmt.Sprint(*listInstancesOptions.InstanceGroupMembershipInstanceGroupID)) + } + if listInstancesOptions.InstanceGroupMembershipInstanceGroupCRN != nil { + builder.AddQuery("instance_group_membership.instance_group.crn", fmt.Sprint(*listInstancesOptions.InstanceGroupMembershipInstanceGroupCRN)) + } if listInstancesOptions.PlacementGroupID != nil { builder.AddQuery("placement_group.id", fmt.Sprint(*listInstancesOptions.PlacementGroupID)) } @@ -24122,7 +24535,8 @@ func (vpc *VpcV1) ListShareSnapshotsWithContext(ctx context.Context, listShareSn // in the same way as a retrieved share snapshot, and contains the information necessary to create the new share // snapshot. // -// The share must have an `access_control_mode` of `security_group` and a `replication_role` of `source` or `none`. +// The share must have an `access_control_mode` of `security_group`, and a +// `replication_role` of `source` or `none`. // // The snapshot will inherit its `resource_group` and encryption settings from the share. // @@ -27377,6 +27791,9 @@ func (vpc *VpcV1) DeleteVirtualNetworkInterfacesWithContext(ctx context.Context, builder.AddHeader(headerName, headerValue) } builder.AddHeader("Accept", "application/json") + if deleteVirtualNetworkInterfacesOptions.IfMatch != nil { + builder.AddHeader("If-Match", fmt.Sprint(*deleteVirtualNetworkInterfacesOptions.IfMatch)) + } builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.Generation)) @@ -27524,6 +27941,9 @@ func (vpc *VpcV1) UpdateVirtualNetworkInterfaceWithContext(ctx context.Context, } builder.AddHeader("Accept", "application/json") builder.AddHeader("Content-Type", "application/merge-patch+json") + if updateVirtualNetworkInterfaceOptions.IfMatch != nil { + builder.AddHeader("If-Match", fmt.Sprint(*updateVirtualNetworkInterfaceOptions.IfMatch)) + } builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.Generation)) @@ -29905,7 +30325,20 @@ func (vpc *VpcV1) ListVPCDnsResolutionBindingsWithContext(ctx context.Context, l // - The VPC specified by the identifier in the URL must have `dns.enable_hub` set to // `false` // - The updated DNS sharing connected topology must not contain more than one endpoint -// gateway with `allow_dns_resolution_binding` set to `true` targeting the same service. +// gateway with `allow_dns_resolution_binding` set to `true` and +// `allow_resource_binding` set to `false` targeting the same service. +// +// Additionally, if the VPC specified by the identifier in the URL has endpoint gateways that have +// `allow_dns_resolution_binding` set to `true`, then those endpoint gateways will participate in [DNS +// sharing](/docs/vpc?topic=vpc-vpe-dns-sharing) with all VPCs in the connected topology. If this VPC contains an +// endpoint gateway targeting a service that has resource binding enabled, then for this request to succeed: +// - The VPC in the topology with `dns.enable_hub` set to `true` must have an endpoint +// gateway with the same `target` as the endpoint gateway in this VPC, and with +// `allow_dns_resolution_binding` set to `true` and `allow_resource_binding` set to +// `false`. +// - No other VPC in the topology can have an endpoint gateway with a resource binding +// using the same `service_endpoint` as a resource binding for the endpoint gateway in +// this VPC. // // See [About DNS sharing for VPE gateways](/docs/vpc?topic=vpc-vpe-dns-sharing) for more information. func (vpc *VpcV1) CreateVPCDnsResolutionBinding(createVPCDnsResolutionBindingOptions *CreateVPCDnsResolutionBindingOptions) (result *VpcdnsResolutionBinding, response *core.DetailedResponse, err error) { @@ -32746,6 +33179,276 @@ func (vpc *VpcV1) UpdateVPNGatewayWithContext(ctx context.Context, updateVPNGate return } +// ListVPNGatewayAdvertisedCIDRs : List advertised CIDRs for a VPN gateway +// This request lists advertised CIDRs for a VPN gateway. +// +// This request is only supported for route mode VPN gateways. +func (vpc *VpcV1) ListVPNGatewayAdvertisedCIDRs(listVPNGatewayAdvertisedCIDRsOptions *ListVPNGatewayAdvertisedCIDRsOptions) (result *VPNGatewayAdvertisedCIDRCollection, response *core.DetailedResponse, err error) { + result, response, err = vpc.ListVPNGatewayAdvertisedCIDRsWithContext(context.Background(), listVPNGatewayAdvertisedCIDRsOptions) + err = core.RepurposeSDKProblem(err, "") + return +} + +// ListVPNGatewayAdvertisedCIDRsWithContext is an alternate form of the ListVPNGatewayAdvertisedCIDRs method which supports a Context parameter +func (vpc *VpcV1) ListVPNGatewayAdvertisedCIDRsWithContext(ctx context.Context, listVPNGatewayAdvertisedCIDRsOptions *ListVPNGatewayAdvertisedCIDRsOptions) (result *VPNGatewayAdvertisedCIDRCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listVPNGatewayAdvertisedCIDRsOptions, "listVPNGatewayAdvertisedCIDRsOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(listVPNGatewayAdvertisedCIDRsOptions, "listVPNGatewayAdvertisedCIDRsOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } + + pathParamsMap := map[string]string{ + "vpn_gateway_id": *listVPNGatewayAdvertisedCIDRsOptions.VPNGatewayID, + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/advertised_cidrs`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPNGatewayAdvertisedCIDRs") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range listVPNGatewayAdvertisedCIDRsOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.Generation)) + + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + core.EnrichHTTPProblem(err, "list_vpn_gateway_advertised_cidrs", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayAdvertisedCIDRCollection) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + + return +} + +// RemoveVPNGatewayAdvertisedCIDR : Remove an advertised CIDR from a VPN gateway +// This request removes a CIDR from a VPN gateway advertised CIDRs. +// +// This request is only supported for route mode VPN gateways. +func (vpc *VpcV1) RemoveVPNGatewayAdvertisedCIDR(removeVPNGatewayAdvertisedCIDROptions *RemoveVPNGatewayAdvertisedCIDROptions) (response *core.DetailedResponse, err error) { + response, err = vpc.RemoveVPNGatewayAdvertisedCIDRWithContext(context.Background(), removeVPNGatewayAdvertisedCIDROptions) + err = core.RepurposeSDKProblem(err, "") + return +} + +// RemoveVPNGatewayAdvertisedCIDRWithContext is an alternate form of the RemoveVPNGatewayAdvertisedCIDR method which supports a Context parameter +func (vpc *VpcV1) RemoveVPNGatewayAdvertisedCIDRWithContext(ctx context.Context, removeVPNGatewayAdvertisedCIDROptions *RemoveVPNGatewayAdvertisedCIDROptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(removeVPNGatewayAdvertisedCIDROptions, "removeVPNGatewayAdvertisedCIDROptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(removeVPNGatewayAdvertisedCIDROptions, "removeVPNGatewayAdvertisedCIDROptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } + + pathParamsMap := map[string]string{ + "vpn_gateway_id": *removeVPNGatewayAdvertisedCIDROptions.VPNGatewayID, + "cidr": *removeVPNGatewayAdvertisedCIDROptions.CIDR, + } + + builder := core.NewRequestBuilder(core.DELETE) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/advertised_cidrs/{cidr}`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "RemoveVPNGatewayAdvertisedCIDR") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range removeVPNGatewayAdvertisedCIDROptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.Generation)) + + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + response, err = vpc.Service.Request(request, nil) + if err != nil { + core.EnrichHTTPProblem(err, "remove_vpn_gateway_advertised_cidr", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + + return +} + +// CheckVPNGatewayAdvertisedCIDR : Check if the specified advertised CIDR exists on a VPN gateway +// This request succeeds if an advertised CIDR exists on the specified VPN gateway, and fails otherwise. +// +// This request is only supported for route mode VPN gateways. +func (vpc *VpcV1) CheckVPNGatewayAdvertisedCIDR(checkVPNGatewayAdvertisedCIDROptions *CheckVPNGatewayAdvertisedCIDROptions) (response *core.DetailedResponse, err error) { + response, err = vpc.CheckVPNGatewayAdvertisedCIDRWithContext(context.Background(), checkVPNGatewayAdvertisedCIDROptions) + err = core.RepurposeSDKProblem(err, "") + return +} + +// CheckVPNGatewayAdvertisedCIDRWithContext is an alternate form of the CheckVPNGatewayAdvertisedCIDR method which supports a Context parameter +func (vpc *VpcV1) CheckVPNGatewayAdvertisedCIDRWithContext(ctx context.Context, checkVPNGatewayAdvertisedCIDROptions *CheckVPNGatewayAdvertisedCIDROptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(checkVPNGatewayAdvertisedCIDROptions, "checkVPNGatewayAdvertisedCIDROptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(checkVPNGatewayAdvertisedCIDROptions, "checkVPNGatewayAdvertisedCIDROptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } + + pathParamsMap := map[string]string{ + "vpn_gateway_id": *checkVPNGatewayAdvertisedCIDROptions.VPNGatewayID, + "cidr": *checkVPNGatewayAdvertisedCIDROptions.CIDR, + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/advertised_cidrs/{cidr}`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "CheckVPNGatewayAdvertisedCIDR") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range checkVPNGatewayAdvertisedCIDROptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.Generation)) + + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + response, err = vpc.Service.Request(request, nil) + if err != nil { + core.EnrichHTTPProblem(err, "check_vpn_gateway_advertised_cidr", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + + return +} + +// AddVPNGatewayAdvertisedCIDR : Set an advertised CIDR on a VPN gateway +// This request adds the specified CIDR to the specified VPN gateway advertised CIDRs. This request succeeds if the +// specified CIDR already exists. A request body is not required, and if provided, is ignored. +// +// This request is only supported for route mode VPN gateways. +func (vpc *VpcV1) AddVPNGatewayAdvertisedCIDR(addVPNGatewayAdvertisedCIDROptions *AddVPNGatewayAdvertisedCIDROptions) (response *core.DetailedResponse, err error) { + response, err = vpc.AddVPNGatewayAdvertisedCIDRWithContext(context.Background(), addVPNGatewayAdvertisedCIDROptions) + err = core.RepurposeSDKProblem(err, "") + return +} + +// AddVPNGatewayAdvertisedCIDRWithContext is an alternate form of the AddVPNGatewayAdvertisedCIDR method which supports a Context parameter +func (vpc *VpcV1) AddVPNGatewayAdvertisedCIDRWithContext(ctx context.Context, addVPNGatewayAdvertisedCIDROptions *AddVPNGatewayAdvertisedCIDROptions) (response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(addVPNGatewayAdvertisedCIDROptions, "addVPNGatewayAdvertisedCIDROptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(addVPNGatewayAdvertisedCIDROptions, "addVPNGatewayAdvertisedCIDROptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } + + pathParamsMap := map[string]string{ + "vpn_gateway_id": *addVPNGatewayAdvertisedCIDROptions.VPNGatewayID, + "cidr": *addVPNGatewayAdvertisedCIDROptions.CIDR, + } + + builder := core.NewRequestBuilder(core.PUT) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/advertised_cidrs/{cidr}`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "AddVPNGatewayAdvertisedCIDR") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range addVPNGatewayAdvertisedCIDROptions.Headers { + builder.AddHeader(headerName, headerValue) + } + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.Generation)) + + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + response, err = vpc.Service.Request(request, nil) + if err != nil { + core.EnrichHTTPProblem(err, "add_vpn_gateway_advertised_cidr", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + + return +} + // ListVPNGatewayConnections : List connections of a VPN gateway // This request lists connections of a VPN gateway. func (vpc *VpcV1) ListVPNGatewayConnections(listVPNGatewayConnectionsOptions *ListVPNGatewayConnectionsOptions) (result *VPNGatewayConnectionCollection, response *core.DetailedResponse, err error) { @@ -32950,6 +33653,9 @@ func (vpc *VpcV1) DeleteVPNGatewayConnectionWithContext(ctx context.Context, del for headerName, headerValue := range deleteVPNGatewayConnectionOptions.Headers { builder.AddHeader(headerName, headerValue) } + if deleteVPNGatewayConnectionOptions.IfMatch != nil { + builder.AddHeader("If-Match", fmt.Sprint(*deleteVPNGatewayConnectionOptions.IfMatch)) + } builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.Generation)) @@ -33088,6 +33794,9 @@ func (vpc *VpcV1) UpdateVPNGatewayConnectionWithContext(ctx context.Context, upd } builder.AddHeader("Accept", "application/json") builder.AddHeader("Content-Type", "application/merge-patch+json") + if updateVPNGatewayConnectionOptions.IfMatch != nil { + builder.AddHeader("If-Match", fmt.Sprint(*updateVPNGatewayConnectionOptions.IfMatch)) + } builder.AddQuery("version", fmt.Sprint(*vpc.Version)) builder.AddQuery("generation", fmt.Sprint(*vpc.Generation)) @@ -33671,6 +34380,160 @@ func (vpc *VpcV1) AddVPNGatewayConnectionsPeerCIDRWithContext(ctx context.Contex return } +// ListVPNGatewayServiceConnections : List VPN gateway service connections +// This request lists service connections on a VPN gateway. The VPN gateway service connections will be sorted by +// ascending `created_at` property values. A VPN gateway service connection connects services such as transit gateway to +// a VPN gateway. This facilitates the propagation of routes learned from VPN gateway peer connections to the connected +// service (for example, a transit gateway). +func (vpc *VpcV1) ListVPNGatewayServiceConnections(listVPNGatewayServiceConnectionsOptions *ListVPNGatewayServiceConnectionsOptions) (result *VPNGatewayServiceConnectionCollection, response *core.DetailedResponse, err error) { + result, response, err = vpc.ListVPNGatewayServiceConnectionsWithContext(context.Background(), listVPNGatewayServiceConnectionsOptions) + err = core.RepurposeSDKProblem(err, "") + return +} + +// ListVPNGatewayServiceConnectionsWithContext is an alternate form of the ListVPNGatewayServiceConnections method which supports a Context parameter +func (vpc *VpcV1) ListVPNGatewayServiceConnectionsWithContext(ctx context.Context, listVPNGatewayServiceConnectionsOptions *ListVPNGatewayServiceConnectionsOptions) (result *VPNGatewayServiceConnectionCollection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(listVPNGatewayServiceConnectionsOptions, "listVPNGatewayServiceConnectionsOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(listVPNGatewayServiceConnectionsOptions, "listVPNGatewayServiceConnectionsOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } + + pathParamsMap := map[string]string{ + "vpn_gateway_id": *listVPNGatewayServiceConnectionsOptions.VPNGatewayID, + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/service_connections`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "ListVPNGatewayServiceConnections") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range listVPNGatewayServiceConnectionsOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.Generation)) + if listVPNGatewayServiceConnectionsOptions.Start != nil { + builder.AddQuery("start", fmt.Sprint(*listVPNGatewayServiceConnectionsOptions.Start)) + } + if listVPNGatewayServiceConnectionsOptions.Limit != nil { + builder.AddQuery("limit", fmt.Sprint(*listVPNGatewayServiceConnectionsOptions.Limit)) + } + + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + core.EnrichHTTPProblem(err, "list_vpn_gateway_service_connections", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayServiceConnectionCollection) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + + return +} + +// GetVPNGatewayServiceConnection : Retrieve a VPN gateway service connection +// This request retrieves VPN gateway service connection specified by the identifier in the URL. +func (vpc *VpcV1) GetVPNGatewayServiceConnection(getVPNGatewayServiceConnectionOptions *GetVPNGatewayServiceConnectionOptions) (result *VPNGatewayServiceConnection, response *core.DetailedResponse, err error) { + result, response, err = vpc.GetVPNGatewayServiceConnectionWithContext(context.Background(), getVPNGatewayServiceConnectionOptions) + err = core.RepurposeSDKProblem(err, "") + return +} + +// GetVPNGatewayServiceConnectionWithContext is an alternate form of the GetVPNGatewayServiceConnection method which supports a Context parameter +func (vpc *VpcV1) GetVPNGatewayServiceConnectionWithContext(ctx context.Context, getVPNGatewayServiceConnectionOptions *GetVPNGatewayServiceConnectionOptions) (result *VPNGatewayServiceConnection, response *core.DetailedResponse, err error) { + err = core.ValidateNotNil(getVPNGatewayServiceConnectionOptions, "getVPNGatewayServiceConnectionOptions cannot be nil") + if err != nil { + err = core.SDKErrorf(err, "", "unexpected-nil-param", common.GetComponentInfo()) + return + } + err = core.ValidateStruct(getVPNGatewayServiceConnectionOptions, "getVPNGatewayServiceConnectionOptions") + if err != nil { + err = core.SDKErrorf(err, "", "struct-validation-error", common.GetComponentInfo()) + return + } + + pathParamsMap := map[string]string{ + "vpn_gateway_id": *getVPNGatewayServiceConnectionOptions.VPNGatewayID, + "id": *getVPNGatewayServiceConnectionOptions.ID, + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(ctx) + builder.EnableGzipCompression = vpc.GetEnableGzipCompression() + _, err = builder.ResolveRequestURL(vpc.Service.Options.URL, `/vpn_gateways/{vpn_gateway_id}/service_connections/{id}`, pathParamsMap) + if err != nil { + err = core.SDKErrorf(err, "", "url-resolve-error", common.GetComponentInfo()) + return + } + + sdkHeaders := common.GetSdkHeaders("vpc", "V1", "GetVPNGatewayServiceConnection") + for headerName, headerValue := range sdkHeaders { + builder.AddHeader(headerName, headerValue) + } + + for headerName, headerValue := range getVPNGatewayServiceConnectionOptions.Headers { + builder.AddHeader(headerName, headerValue) + } + builder.AddHeader("Accept", "application/json") + + builder.AddQuery("version", fmt.Sprint(*vpc.Version)) + builder.AddQuery("generation", fmt.Sprint(*vpc.Generation)) + + request, err := builder.Build() + if err != nil { + err = core.SDKErrorf(err, "", "build-error", common.GetComponentInfo()) + return + } + + var rawResponse map[string]json.RawMessage + response, err = vpc.Service.Request(request, &rawResponse) + if err != nil { + core.EnrichHTTPProblem(err, "get_vpn_gateway_service_connection", getServiceComponentInfo()) + err = core.SDKErrorf(err, "", "http-request-err", common.GetComponentInfo()) + return + } + if rawResponse != nil { + err = core.UnmarshalModel(rawResponse, "", &result, UnmarshalVPNGatewayServiceConnection) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-resp-error", common.GetComponentInfo()) + return + } + response.Result = result + } + + return +} + // ListVPNServers : List VPN servers // This request lists VPN servers. func (vpc *VpcV1) ListVPNServers(listVPNServersOptions *ListVPNServersOptions) (result *VPNServerCollection, response *core.DetailedResponse, err error) { @@ -34821,7 +35684,7 @@ func (vpc *VpcV1) UpdateVPNServerRouteWithContext(ctx context.Context, updateVPN return } func getServiceComponentInfo() *core.ProblemComponent { - return core.NewProblemComponent(DefaultServiceName, "2025-08-26") + return core.NewProblemComponent(DefaultServiceName, "2025-11-17") } // AccountIdentity : Identifies an account by a unique property. @@ -35122,6 +35985,44 @@ func (options *AddVirtualNetworkInterfaceIPOptions) SetHeaders(param map[string] return options } +// AddVPNGatewayAdvertisedCIDROptions : The AddVPNGatewayAdvertisedCIDR options. +type AddVPNGatewayAdvertisedCIDROptions struct { + // The VPN gateway identifier. + VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` + + // The IP address range in CIDR block notation. + CIDR *string `json:"cidr" validate:"required,ne="` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewAddVPNGatewayAdvertisedCIDROptions : Instantiate AddVPNGatewayAdvertisedCIDROptions +func (*VpcV1) NewAddVPNGatewayAdvertisedCIDROptions(vpnGatewayID string, cidr string) *AddVPNGatewayAdvertisedCIDROptions { + return &AddVPNGatewayAdvertisedCIDROptions{ + VPNGatewayID: core.StringPtr(vpnGatewayID), + CIDR: core.StringPtr(cidr), + } +} + +// SetVPNGatewayID : Allow user to set VPNGatewayID +func (_options *AddVPNGatewayAdvertisedCIDROptions) SetVPNGatewayID(vpnGatewayID string) *AddVPNGatewayAdvertisedCIDROptions { + _options.VPNGatewayID = core.StringPtr(vpnGatewayID) + return _options +} + +// SetCIDR : Allow user to set CIDR +func (_options *AddVPNGatewayAdvertisedCIDROptions) SetCIDR(cidr string) *AddVPNGatewayAdvertisedCIDROptions { + _options.CIDR = core.StringPtr(cidr) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *AddVPNGatewayAdvertisedCIDROptions) SetHeaders(param map[string]string) *AddVPNGatewayAdvertisedCIDROptions { + options.Headers = param + return options +} + // AddVPNGatewayConnectionsLocalCIDROptions : The AddVPNGatewayConnectionsLocalCIDR options. type AddVPNGatewayConnectionsLocalCIDROptions struct { // The VPN gateway identifier. @@ -41256,7 +42157,7 @@ func UnmarshalBareMetalServerProfileReservationTerms(m map[string]json.RawMessag // BareMetalServerProfileSupportedTrustedPlatformModuleModes : The supported trusted platform module modes for this bare metal server profile. type BareMetalServerProfileSupportedTrustedPlatformModuleModes struct { // The default trusted platform module for a bare metal server with this profile. - Default *string `json:"default,omitempty"` + Default *string `json:"default" validate:"required"` // The type for this profile field. Type *string `json:"type" validate:"required"` @@ -42060,6 +42961,44 @@ func UnmarshalCertificateInstanceReference(m map[string]json.RawMessage, result return } +// CheckVPNGatewayAdvertisedCIDROptions : The CheckVPNGatewayAdvertisedCIDR options. +type CheckVPNGatewayAdvertisedCIDROptions struct { + // The VPN gateway identifier. + VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` + + // The IP address range in CIDR block notation. + CIDR *string `json:"cidr" validate:"required,ne="` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewCheckVPNGatewayAdvertisedCIDROptions : Instantiate CheckVPNGatewayAdvertisedCIDROptions +func (*VpcV1) NewCheckVPNGatewayAdvertisedCIDROptions(vpnGatewayID string, cidr string) *CheckVPNGatewayAdvertisedCIDROptions { + return &CheckVPNGatewayAdvertisedCIDROptions{ + VPNGatewayID: core.StringPtr(vpnGatewayID), + CIDR: core.StringPtr(cidr), + } +} + +// SetVPNGatewayID : Allow user to set VPNGatewayID +func (_options *CheckVPNGatewayAdvertisedCIDROptions) SetVPNGatewayID(vpnGatewayID string) *CheckVPNGatewayAdvertisedCIDROptions { + _options.VPNGatewayID = core.StringPtr(vpnGatewayID) + return _options +} + +// SetCIDR : Allow user to set CIDR +func (_options *CheckVPNGatewayAdvertisedCIDROptions) SetCIDR(cidr string) *CheckVPNGatewayAdvertisedCIDROptions { + _options.CIDR = core.StringPtr(cidr) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *CheckVPNGatewayAdvertisedCIDROptions) SetHeaders(param map[string]string) *CheckVPNGatewayAdvertisedCIDROptions { + options.Headers = param + return options +} + // CheckVPNGatewayConnectionsLocalCIDROptions : The CheckVPNGatewayConnectionsLocalCIDR options. type CheckVPNGatewayConnectionsLocalCIDROptions struct { // The VPN gateway identifier. @@ -45003,6 +45942,13 @@ type CreateEndpointGatewayOptions struct { // - Has the same `target` as this endpoint gateway // - Has `service_endpoints` that overlap with the `service_endpoints` for this endpoint // gateway. + // + // If `allow_dns_resolution_binding` is `true`, and `allow_resource_binding` is `true`, + // then: + // - The VPC in the topology with `dns.enable_hub` set to `true` must have an endpoint + // gateway with the same `target` as this endpoint gateway. + // - No other VPC in the topology can have an endpoint gateway with a resource binding + // using the same `service_endpoint` as a resource binding for this endpoint gateway. Target EndpointGatewayTargetPrototypeIntf `json:"target" validate:"required"` // The VPC this endpoint gateway will reside in. @@ -45011,17 +45957,28 @@ type CreateEndpointGatewayOptions struct { // Indicates whether to allow DNS resolution for this endpoint gateway when the VPC this endpoint gateway resides in // has a DNS resolution binding to a VPC with `dns.enable_hub` set to `true`. // - // If `true`, then there must not be another endpoint gateway with + // If `true`, and `allow_resource_binding` is `false`, then there must not be another endpoint gateway with // `allow_dns_resolution_binding` set to `true` in the [DNS sharing](/docs/vpc?topic=vpc-vpe-dns-sharing) connected // topology that: // - Has the same `target` as this endpoint gateway // - Has `service_endpoints` that overlap with the `service_endpoints` for this endpoint // gateway. // + // If `true`, and `allow_resource_binding` is `true`, then: + // - The VPC in the topology with `dns.enable_hub` set to `true` must have an endpoint + // gateway with the same `target` as this endpoint gateway. + // - No other VPC in the topology can have an endpoint gateway with a resource binding + // using the same `service_endpoint` as a resource binding for this endpoint gateway. + // // Must be `true` if the VPC this endpoint gateway resides in has `dns.enable_hub` set to // `true`. AllowDnsResolutionBinding *bool `json:"allow_dns_resolution_binding,omitempty"` + // Indicates whether resource binding is allowed for this endpoint gateway when the VPC this endpoint gateway resides + // in has a DNS resolution binding to a VPC with `dns.enable_hub` set to `true`. Resource binding must be enabled for + // the `target` service. + AllowResourceBinding *bool `json:"allow_resource_binding,omitempty"` + // The reserved IPs to bind to this endpoint gateway. At most one reserved IP per zone is allowed. Ips []EndpointGatewayReservedIPIntf `json:"ips,omitempty"` @@ -45066,6 +46023,12 @@ func (_options *CreateEndpointGatewayOptions) SetAllowDnsResolutionBinding(allow return _options } +// SetAllowResourceBinding : Allow user to set AllowResourceBinding +func (_options *CreateEndpointGatewayOptions) SetAllowResourceBinding(allowResourceBinding bool) *CreateEndpointGatewayOptions { + _options.AllowResourceBinding = core.BoolPtr(allowResourceBinding) + return _options +} + // SetIps : Allow user to set Ips func (_options *CreateEndpointGatewayOptions) SetIps(ips []EndpointGatewayReservedIPIntf) *CreateEndpointGatewayOptions { _options.Ips = ips @@ -45096,6 +46059,54 @@ func (options *CreateEndpointGatewayOptions) SetHeaders(param map[string]string) return options } +// CreateEndpointGatewayResourceBindingOptions : The CreateEndpointGatewayResourceBinding options. +type CreateEndpointGatewayResourceBindingOptions struct { + // The endpoint gateway identifier. + EndpointGatewayID *string `json:"endpoint_gateway_id" validate:"required,ne="` + + // The target to use for this resource binding. + Target EndpointGatewayResourceBindingTargetPrototypeIntf `json:"target" validate:"required"` + + // The name for this resource binding. The name must not be used by another resource binding for the endpoint gateway. + // If unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewCreateEndpointGatewayResourceBindingOptions : Instantiate CreateEndpointGatewayResourceBindingOptions +func (*VpcV1) NewCreateEndpointGatewayResourceBindingOptions(endpointGatewayID string, target EndpointGatewayResourceBindingTargetPrototypeIntf) *CreateEndpointGatewayResourceBindingOptions { + return &CreateEndpointGatewayResourceBindingOptions{ + EndpointGatewayID: core.StringPtr(endpointGatewayID), + Target: target, + } +} + +// SetEndpointGatewayID : Allow user to set EndpointGatewayID +func (_options *CreateEndpointGatewayResourceBindingOptions) SetEndpointGatewayID(endpointGatewayID string) *CreateEndpointGatewayResourceBindingOptions { + _options.EndpointGatewayID = core.StringPtr(endpointGatewayID) + return _options +} + +// SetTarget : Allow user to set Target +func (_options *CreateEndpointGatewayResourceBindingOptions) SetTarget(target EndpointGatewayResourceBindingTargetPrototypeIntf) *CreateEndpointGatewayResourceBindingOptions { + _options.Target = target + return _options +} + +// SetName : Allow user to set Name +func (_options *CreateEndpointGatewayResourceBindingOptions) SetName(name string) *CreateEndpointGatewayResourceBindingOptions { + _options.Name = core.StringPtr(name) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *CreateEndpointGatewayResourceBindingOptions) SetHeaders(param map[string]string) *CreateEndpointGatewayResourceBindingOptions { + options.Headers = param + return options +} + // CreateFloatingIPOptions : The CreateFloatingIP options. type CreateFloatingIPOptions struct { // The floating IP prototype object. @@ -45830,10 +46841,11 @@ type CreateInstanceNetworkInterfaceOptions struct { Name *string `json:"name,omitempty"` // The primary IP address to bind to the instance network interface. This can be - // specified using an existing reserved IP, or a prototype object for a new reserved IP. + // specified using an existing reserved IP, or a prototype object for a new reserved + // IP. // - // If an existing reserved IP or a prototype object with an address is specified, it must - // be available on the instance network interface's subnet. Otherwise, an + // If an existing reserved IP or a prototype object with an address is specified, it + // must be available on the instance network interface's subnet. Otherwise, an // available address on the subnet will be automatically selected and reserved. PrimaryIP NetworkInterfaceIPPrototypeIntf `json:"primary_ip,omitempty"` @@ -49689,7 +50701,7 @@ type DedicatedHostDisk struct { InterfaceType *string `json:"interface_type" validate:"required"` // The lifecycle state of this dedicated host disk. - LifecycleState *string `json:"lifecycle_state,omitempty"` + LifecycleState *string `json:"lifecycle_state" validate:"required"` // The name for this dedicated host disk. The name is unique across all disks on the dedicated host. Name *string `json:"name" validate:"required"` @@ -52089,6 +53101,44 @@ func (options *DeleteEndpointGatewayOptions) SetHeaders(param map[string]string) return options } +// DeleteEndpointGatewayResourceBindingOptions : The DeleteEndpointGatewayResourceBinding options. +type DeleteEndpointGatewayResourceBindingOptions struct { + // The endpoint gateway identifier. + EndpointGatewayID *string `json:"endpoint_gateway_id" validate:"required,ne="` + + // The resource binding identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewDeleteEndpointGatewayResourceBindingOptions : Instantiate DeleteEndpointGatewayResourceBindingOptions +func (*VpcV1) NewDeleteEndpointGatewayResourceBindingOptions(endpointGatewayID string, id string) *DeleteEndpointGatewayResourceBindingOptions { + return &DeleteEndpointGatewayResourceBindingOptions{ + EndpointGatewayID: core.StringPtr(endpointGatewayID), + ID: core.StringPtr(id), + } +} + +// SetEndpointGatewayID : Allow user to set EndpointGatewayID +func (_options *DeleteEndpointGatewayResourceBindingOptions) SetEndpointGatewayID(endpointGatewayID string) *DeleteEndpointGatewayResourceBindingOptions { + _options.EndpointGatewayID = core.StringPtr(endpointGatewayID) + return _options +} + +// SetID : Allow user to set ID +func (_options *DeleteEndpointGatewayResourceBindingOptions) SetID(id string) *DeleteEndpointGatewayResourceBindingOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *DeleteEndpointGatewayResourceBindingOptions) SetHeaders(param map[string]string) *DeleteEndpointGatewayResourceBindingOptions { + options.Headers = param + return options +} + // DeleteFloatingIPOptions : The DeleteFloatingIP options. type DeleteFloatingIPOptions struct { // The floating IP identifier. @@ -53764,6 +54814,9 @@ type DeleteVirtualNetworkInterfacesOptions struct { // The virtual network interface identifier. ID *string `json:"id" validate:"required,ne="` + // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + IfMatch *string `json:"If-Match,omitempty"` + // Allows users to set headers on API requests. Headers map[string]string } @@ -53781,6 +54834,12 @@ func (_options *DeleteVirtualNetworkInterfacesOptions) SetID(id string) *DeleteV return _options } +// SetIfMatch : Allow user to set IfMatch +func (_options *DeleteVirtualNetworkInterfacesOptions) SetIfMatch(ifMatch string) *DeleteVirtualNetworkInterfacesOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options +} + // SetHeaders : Allow user to set Headers func (options *DeleteVirtualNetworkInterfacesOptions) SetHeaders(param map[string]string) *DeleteVirtualNetworkInterfacesOptions { options.Headers = param @@ -54078,6 +55137,9 @@ type DeleteVPNGatewayConnectionOptions struct { // The VPN gateway connection identifier. ID *string `json:"id" validate:"required,ne="` + // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + IfMatch *string `json:"If-Match,omitempty"` + // Allows users to set headers on API requests. Headers map[string]string } @@ -54102,6 +55164,12 @@ func (_options *DeleteVPNGatewayConnectionOptions) SetID(id string) *DeleteVPNGa return _options } +// SetIfMatch : Allow user to set IfMatch +func (_options *DeleteVPNGatewayConnectionOptions) SetIfMatch(ifMatch string) *DeleteVPNGatewayConnectionOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options +} + // SetHeaders : Allow user to set Headers func (options *DeleteVPNGatewayConnectionOptions) SetHeaders(param map[string]string) *DeleteVPNGatewayConnectionOptions { options.Headers = param @@ -54458,6 +55526,9 @@ type EndpointGateway struct { // has a DNS resolution binding to a VPC with `dns.enable_hub` set to `true`. AllowDnsResolutionBinding *bool `json:"allow_dns_resolution_binding" validate:"required"` + // Indicates whether resource binding is allowed for this endpoint gateway. + AllowResourceBinding *bool `json:"allow_resource_binding" validate:"required"` + // The date and time that the endpoint gateway was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` @@ -54555,6 +55626,11 @@ func UnmarshalEndpointGateway(m map[string]json.RawMessage, result interface{}) err = core.SDKErrorf(err, "", "allow_dns_resolution_binding-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "allow_resource_binding", &obj.AllowResourceBinding) + if err != nil { + err = core.SDKErrorf(err, "", "allow_resource_binding-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) @@ -54775,17 +55851,28 @@ type EndpointGatewayPatch struct { // Indicates whether to allow DNS resolution for this endpoint gateway when the VPC this endpoint gateway resides in // has a DNS resolution binding to a VPC with `dns.enable_hub` set to `true`. // - // If `true`, then there must not be another endpoint gateway with + // If `true`, and `allow_resource_binding` is `false`, then there must not be another endpoint gateway with // `allow_dns_resolution_binding` set to `true` in the [DNS sharing](/docs/vpc?topic=vpc-vpe-dns-sharing) connected // topology that: // - Has the same `target` as this endpoint gateway // - Has `service_endpoints` that overlap with the `service_endpoints` for this endpoint // gateway. // + // If `true`, and `allow_resource_binding` is `true`, then: + // - The VPC in the topology with `dns.enable_hub` set to `true` must have an endpoint + // gateway with the same `target` as this endpoint gateway. + // - No other VPC in the topology can have an endpoint gateway with a resource binding + // using the same `service_endpoint` as a resource binding for this endpoint gateway. + // // Must be `true` if the VPC this endpoint gateway resides in has `dns.enable_hub` set to // `true`. AllowDnsResolutionBinding *bool `json:"allow_dns_resolution_binding,omitempty"` + // Indicates whether resource binding is allowed for this endpoint gateway when the VPC this endpoint gateway resides + // in has a DNS resolution binding to a VPC with `dns.enable_hub` set to `true`. Resource binding must be enabled for + // the `target` service. + AllowResourceBinding *bool `json:"allow_resource_binding,omitempty"` + // The name for this endpoint gateway. The name must not be used by another endpoint gateway in the VPC. Name *string `json:"name,omitempty"` } @@ -54798,6 +55885,11 @@ func UnmarshalEndpointGatewayPatch(m map[string]json.RawMessage, result interfac err = core.SDKErrorf(err, "", "allow_dns_resolution_binding-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "allow_resource_binding", &obj.AllowResourceBinding) + if err != nil { + err = core.SDKErrorf(err, "", "allow_resource_binding-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) @@ -54813,6 +55905,9 @@ func (endpointGatewayPatch *EndpointGatewayPatch) AsPatch() (_patch map[string]i if !core.IsNil(endpointGatewayPatch.AllowDnsResolutionBinding) { _patch["allow_dns_resolution_binding"] = endpointGatewayPatch.AllowDnsResolutionBinding } + if !core.IsNil(endpointGatewayPatch.AllowResourceBinding) { + _patch["allow_resource_binding"] = endpointGatewayPatch.AllowResourceBinding + } if !core.IsNil(endpointGatewayPatch.Name) { _patch["name"] = endpointGatewayPatch.Name } @@ -54990,6 +56085,329 @@ func UnmarshalEndpointGatewayReservedIP(m map[string]json.RawMessage, result int return } +// EndpointGatewayResourceBinding : EndpointGatewayResourceBinding struct +type EndpointGatewayResourceBinding struct { + // The date and time that the resource binding was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + // The URL for this endpoint gateway resource binding. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this endpoint gateway resource binding. + ID *string `json:"id" validate:"required"` + + // The reasons for the current `lifecycle_state` (if any). + LifecycleReasons []EndpointGatewayResourceBindingLifecycleReason `json:"lifecycle_reasons" validate:"required"` + + // The lifecycle state of the resource binding. + LifecycleState *string `json:"lifecycle_state" validate:"required"` + + // The name for this resource binding. The name is unique across all resource bindings for the endpoint gateway. + Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The fully qualified domain name of the service endpoint for the resource targeted by this resource binding. + ServiceEndpoint *string `json:"service_endpoint" validate:"required"` + + // The target for this endpoint gateway resource binding. + Target EndpointGatewayResourceBindingTargetIntf `json:"target" validate:"required"` + + // The type of resource binding: + // - `weak`: The binding is not dependent on the existence of the target resource. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + Type *string `json:"type" validate:"required"` +} + +// Constants associated with the EndpointGatewayResourceBinding.LifecycleState property. +// The lifecycle state of the resource binding. +const ( + EndpointGatewayResourceBindingLifecycleStateDeletingConst = "deleting" + EndpointGatewayResourceBindingLifecycleStateFailedConst = "failed" + EndpointGatewayResourceBindingLifecycleStatePendingConst = "pending" + EndpointGatewayResourceBindingLifecycleStateStableConst = "stable" + EndpointGatewayResourceBindingLifecycleStateSuspendedConst = "suspended" + EndpointGatewayResourceBindingLifecycleStateUpdatingConst = "updating" + EndpointGatewayResourceBindingLifecycleStateWaitingConst = "waiting" +) + +// Constants associated with the EndpointGatewayResourceBinding.ResourceType property. +// The resource type. +const ( + EndpointGatewayResourceBindingResourceTypeEndpointGatewayResourceBindingConst = "endpoint_gateway_resource_binding" +) + +// Constants associated with the EndpointGatewayResourceBinding.Type property. +// The type of resource binding: +// - `weak`: The binding is not dependent on the existence of the target resource. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. +const ( + EndpointGatewayResourceBindingTypeWeakConst = "weak" +) + +// UnmarshalEndpointGatewayResourceBinding unmarshals an instance of EndpointGatewayResourceBinding from the specified map of raw messages. +func UnmarshalEndpointGatewayResourceBinding(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayResourceBinding) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalEndpointGatewayResourceBindingLifecycleReason) + if err != nil { + err = core.SDKErrorf(err, "", "lifecycle_reasons-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + if err != nil { + err = core.SDKErrorf(err, "", "lifecycle_state-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + err = core.SDKErrorf(err, "", "resource_type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "service_endpoint", &obj.ServiceEndpoint) + if err != nil { + err = core.SDKErrorf(err, "", "service_endpoint-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "target", &obj.Target, UnmarshalEndpointGatewayResourceBindingTarget) + if err != nil { + err = core.SDKErrorf(err, "", "target-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// EndpointGatewayResourceBindingCollection : EndpointGatewayResourceBindingCollection struct +type EndpointGatewayResourceBindingCollection struct { + // A link to the first page of resources. + First *PageLink `json:"first" validate:"required"` + + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` + + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *PageLink `json:"next,omitempty"` + + // A page of resource bindings for the endpoint gateway. + ResourceBindings []EndpointGatewayResourceBinding `json:"resource_bindings" validate:"required"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` +} + +// UnmarshalEndpointGatewayResourceBindingCollection unmarshals an instance of EndpointGatewayResourceBindingCollection from the specified map of raw messages. +func UnmarshalEndpointGatewayResourceBindingCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayResourceBindingCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalPageLink) + if err != nil { + err = core.SDKErrorf(err, "", "first-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalPageLink) + if err != nil { + err = core.SDKErrorf(err, "", "next-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "resource_bindings", &obj.ResourceBindings, UnmarshalEndpointGatewayResourceBinding) + if err != nil { + err = core.SDKErrorf(err, "", "resource_bindings-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + err = core.SDKErrorf(err, "", "total_count-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// Retrieve the value to be passed to a request to access the next page of results +func (resp *EndpointGatewayResourceBindingCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil { + err = core.SDKErrorf(err, "", "read-query-param-error", common.GetComponentInfo()) + return nil, err + } else if start == nil { + return nil, nil + } + return start, nil +} + +// EndpointGatewayResourceBindingLifecycleReason : EndpointGatewayResourceBindingLifecycleReason struct +type EndpointGatewayResourceBindingLifecycleReason struct { + // A reason code for this lifecycle state: + // - `internal_error`: internal error (contact IBM support) + // - `resource_suspended_by_provider`: The resource has been suspended (contact IBM + // support) + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + Code *string `json:"code" validate:"required"` + + // An explanation of the reason for this lifecycle state. + Message *string `json:"message" validate:"required"` + + // A link to documentation about the reason for this lifecycle state. + MoreInfo *string `json:"more_info,omitempty"` +} + +// Constants associated with the EndpointGatewayResourceBindingLifecycleReason.Code property. +// A reason code for this lifecycle state: +// - `internal_error`: internal error (contact IBM support) +// - `resource_suspended_by_provider`: The resource has been suspended (contact IBM +// support) +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. +const ( + EndpointGatewayResourceBindingLifecycleReasonCodeInternalErrorConst = "internal_error" + EndpointGatewayResourceBindingLifecycleReasonCodeResourceSuspendedByProviderConst = "resource_suspended_by_provider" +) + +// UnmarshalEndpointGatewayResourceBindingLifecycleReason unmarshals an instance of EndpointGatewayResourceBindingLifecycleReason from the specified map of raw messages. +func UnmarshalEndpointGatewayResourceBindingLifecycleReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayResourceBindingLifecycleReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + err = core.SDKErrorf(err, "", "code-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + err = core.SDKErrorf(err, "", "message-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + err = core.SDKErrorf(err, "", "more_info-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// EndpointGatewayResourceBindingPatch : EndpointGatewayResourceBindingPatch struct +type EndpointGatewayResourceBindingPatch struct { + // The name for this resource binding. The name must not be used by another resource binding for the endpoint gateway. + Name *string `json:"name,omitempty"` +} + +// UnmarshalEndpointGatewayResourceBindingPatch unmarshals an instance of EndpointGatewayResourceBindingPatch from the specified map of raw messages. +func UnmarshalEndpointGatewayResourceBindingPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayResourceBindingPatch) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// AsPatch returns a generic map representation of the EndpointGatewayResourceBindingPatch +func (endpointGatewayResourceBindingPatch *EndpointGatewayResourceBindingPatch) AsPatch() (_patch map[string]interface{}, err error) { + _patch = map[string]interface{}{} + if !core.IsNil(endpointGatewayResourceBindingPatch.Name) { + _patch["name"] = endpointGatewayResourceBindingPatch.Name + } + + return +} + +// EndpointGatewayResourceBindingTarget : The target for this endpoint gateway resource binding. +// Models which "extend" this model: +// - EndpointGatewayResourceBindingTargetCRN +type EndpointGatewayResourceBindingTarget struct { + CRN *string `json:"crn,omitempty"` +} + +func (*EndpointGatewayResourceBindingTarget) isaEndpointGatewayResourceBindingTarget() bool { + return true +} + +type EndpointGatewayResourceBindingTargetIntf interface { + isaEndpointGatewayResourceBindingTarget() bool +} + +// UnmarshalEndpointGatewayResourceBindingTarget unmarshals an instance of EndpointGatewayResourceBindingTarget from the specified map of raw messages. +func UnmarshalEndpointGatewayResourceBindingTarget(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayResourceBindingTarget) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + err = core.SDKErrorf(err, "", "crn-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// EndpointGatewayResourceBindingTargetPrototype : The target to use for this resource binding. +// Models which "extend" this model: +// - EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN +type EndpointGatewayResourceBindingTargetPrototype struct { + CRN *string `json:"crn,omitempty"` +} + +func (*EndpointGatewayResourceBindingTargetPrototype) isaEndpointGatewayResourceBindingTargetPrototype() bool { + return true +} + +type EndpointGatewayResourceBindingTargetPrototypeIntf interface { + isaEndpointGatewayResourceBindingTargetPrototype() bool +} + +// UnmarshalEndpointGatewayResourceBindingTargetPrototype unmarshals an instance of EndpointGatewayResourceBindingTargetPrototype from the specified map of raw messages. +func UnmarshalEndpointGatewayResourceBindingTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayResourceBindingTargetPrototype) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + err = core.SDKErrorf(err, "", "crn-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // EndpointGatewayTarget : The target for this endpoint gateway. // Models which "extend" this model: // - EndpointGatewayTargetPrivatePathServiceGatewayReference @@ -55091,6 +56509,12 @@ func UnmarshalEndpointGatewayTarget(m map[string]json.RawMessage, result interfa // - Has `service_endpoints` that overlap with the `service_endpoints` for this endpoint // gateway. // +// If `allow_dns_resolution_binding` is `true`, and `allow_resource_binding` is `true`, then: +// - The VPC in the topology with `dns.enable_hub` set to `true` must have an endpoint +// gateway with the same `target` as this endpoint gateway. +// - No other VPC in the topology can have an endpoint gateway with a resource binding +// using the same `service_endpoint` as a resource binding for this endpoint gateway. +// // Models which "extend" this model: // - EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypePrivatePathServiceGatewayPrototype // - EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderInfrastructureServicePrototype @@ -57089,6 +58513,44 @@ func (options *GetEndpointGatewayOptions) SetHeaders(param map[string]string) *G return options } +// GetEndpointGatewayResourceBindingOptions : The GetEndpointGatewayResourceBinding options. +type GetEndpointGatewayResourceBindingOptions struct { + // The endpoint gateway identifier. + EndpointGatewayID *string `json:"endpoint_gateway_id" validate:"required,ne="` + + // The resource binding identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewGetEndpointGatewayResourceBindingOptions : Instantiate GetEndpointGatewayResourceBindingOptions +func (*VpcV1) NewGetEndpointGatewayResourceBindingOptions(endpointGatewayID string, id string) *GetEndpointGatewayResourceBindingOptions { + return &GetEndpointGatewayResourceBindingOptions{ + EndpointGatewayID: core.StringPtr(endpointGatewayID), + ID: core.StringPtr(id), + } +} + +// SetEndpointGatewayID : Allow user to set EndpointGatewayID +func (_options *GetEndpointGatewayResourceBindingOptions) SetEndpointGatewayID(endpointGatewayID string) *GetEndpointGatewayResourceBindingOptions { + _options.EndpointGatewayID = core.StringPtr(endpointGatewayID) + return _options +} + +// SetID : Allow user to set ID +func (_options *GetEndpointGatewayResourceBindingOptions) SetID(id string) *GetEndpointGatewayResourceBindingOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetEndpointGatewayResourceBindingOptions) SetHeaders(param map[string]string) *GetEndpointGatewayResourceBindingOptions { + options.Headers = param + return options +} + // GetFloatingIPOptions : The GetFloatingIP options. type GetFloatingIPOptions struct { // The floating IP identifier. @@ -59667,6 +61129,44 @@ func (options *GetVPNGatewayOptions) SetHeaders(param map[string]string) *GetVPN return options } +// GetVPNGatewayServiceConnectionOptions : The GetVPNGatewayServiceConnection options. +type GetVPNGatewayServiceConnectionOptions struct { + // The VPN gateway identifier. + VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` + + // The VPN gateway service connection identifier. + ID *string `json:"id" validate:"required,ne="` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewGetVPNGatewayServiceConnectionOptions : Instantiate GetVPNGatewayServiceConnectionOptions +func (*VpcV1) NewGetVPNGatewayServiceConnectionOptions(vpnGatewayID string, id string) *GetVPNGatewayServiceConnectionOptions { + return &GetVPNGatewayServiceConnectionOptions{ + VPNGatewayID: core.StringPtr(vpnGatewayID), + ID: core.StringPtr(id), + } +} + +// SetVPNGatewayID : Allow user to set VPNGatewayID +func (_options *GetVPNGatewayServiceConnectionOptions) SetVPNGatewayID(vpnGatewayID string) *GetVPNGatewayServiceConnectionOptions { + _options.VPNGatewayID = core.StringPtr(vpnGatewayID) + return _options +} + +// SetID : Allow user to set ID +func (_options *GetVPNGatewayServiceConnectionOptions) SetID(id string) *GetVPNGatewayServiceConnectionOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *GetVPNGatewayServiceConnectionOptions) SetHeaders(param map[string]string) *GetVPNGatewayServiceConnectionOptions { + options.Headers = param + return options +} + // GetVPNServerClientConfigurationOptions : The GetVPNServerClientConfiguration options. type GetVPNServerClientConfigurationOptions struct { // The VPN server identifier. @@ -62421,6 +63921,9 @@ type Instance struct { // The image the virtual server instance was provisioned from. Image *ImageReference `json:"image,omitempty"` + // The instance group membership for this virtual server instance. + InstanceGroupMembership *InstanceGroupMembershipReferenceInstanceContext `json:"instance_group_membership,omitempty"` + // The reasons for the current `lifecycle_state` (if any). LifecycleReasons []InstanceLifecycleReason `json:"lifecycle_reasons" validate:"required"` @@ -62512,6 +64015,9 @@ type Instance struct { // The volume attachments for this virtual server instance, including the boot volume attachment. VolumeAttachments []VolumeAttachmentReferenceInstanceContext `json:"volume_attachments" validate:"required"` + // The volume bandwidth QoS mode for this virtual server instance. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode" validate:"required"` + // The VPC this virtual server instance resides in. VPC *VPCReference `json:"vpc" validate:"required"` @@ -62576,6 +64082,13 @@ const ( InstanceStatusStoppingConst = "stopping" ) +// Constants associated with the Instance.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode for this virtual server instance. +const ( + InstanceVolumeBandwidthQosModePooledConst = "pooled" + InstanceVolumeBandwidthQosModeWeightedConst = "weighted" +) + // UnmarshalInstance unmarshals an instance of Instance from the specified map of raw messages. func UnmarshalInstance(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(Instance) @@ -62669,6 +64182,11 @@ func UnmarshalInstance(m map[string]json.RawMessage, result interface{}) (err er err = core.SDKErrorf(err, "", "image-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "instance_group_membership", &obj.InstanceGroupMembership, UnmarshalInstanceGroupMembershipReferenceInstanceContext) + if err != nil { + err = core.SDKErrorf(err, "", "instance_group_membership-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalInstanceLifecycleReason) if err != nil { err = core.SDKErrorf(err, "", "lifecycle_reasons-error", common.GetComponentInfo()) @@ -62784,6 +64302,11 @@ func UnmarshalInstance(m map[string]json.RawMessage, result interface{}) (err er err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCReference) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -64812,16 +66335,16 @@ type InstanceGroupManagerActionPrototype struct { // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` - // The date and time the scheduled action will run. - RunAt *strfmt.DateTime `json:"run_at,omitempty"` + // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min + // period. + CronSpec *string `json:"cron_spec,omitempty"` Group *InstanceGroupManagerScheduledActionGroupPrototype `json:"group,omitempty"` Manager InstanceGroupManagerScheduledActionManagerPrototypeIntf `json:"manager,omitempty"` - // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min - // period. - CronSpec *string `json:"cron_spec,omitempty"` + // The date and time the scheduled action will run. + RunAt *strfmt.DateTime `json:"run_at,omitempty"` } func (*InstanceGroupManagerActionPrototype) isaInstanceGroupManagerActionPrototype() bool { @@ -64840,9 +66363,9 @@ func UnmarshalInstanceGroupManagerActionPrototype(m map[string]json.RawMessage, err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "run_at", &obj.RunAt) + err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) if err != nil { - err = core.SDKErrorf(err, "", "run_at-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "cron_spec-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerScheduledActionGroupPrototype) @@ -64855,9 +66378,9 @@ func UnmarshalInstanceGroupManagerActionPrototype(m map[string]json.RawMessage, err = core.SDKErrorf(err, "", "manager-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) + err = core.UnmarshalPrimitive(m, "run_at", &obj.RunAt) if err != nil { - err = core.SDKErrorf(err, "", "cron_spec-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "run_at-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -66002,6 +67525,57 @@ func (instanceGroupMembershipPatch *InstanceGroupMembershipPatch) AsPatch() (_pa return } +// InstanceGroupMembershipReferenceInstanceContext : InstanceGroupMembershipReferenceInstanceContext struct +type InstanceGroupMembershipReferenceInstanceContext struct { + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *Deleted `json:"deleted,omitempty"` + + // The URL for this instance group membership. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this instance group membership. + ID *string `json:"id" validate:"required"` + + // The instance group associated with this membership. + InstanceGroup *InstanceGroupReference `json:"instance_group" validate:"required"` + + // The name for this instance group membership. The name is unique across all memberships for the instance group. + Name *string `json:"name" validate:"required"` +} + +// UnmarshalInstanceGroupMembershipReferenceInstanceContext unmarshals an instance of InstanceGroupMembershipReferenceInstanceContext from the specified map of raw messages. +func UnmarshalInstanceGroupMembershipReferenceInstanceContext(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupMembershipReferenceInstanceContext) + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalDeleted) + if err != nil { + err = core.SDKErrorf(err, "", "deleted-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "instance_group", &obj.InstanceGroup, UnmarshalInstanceGroupReference) + if err != nil { + err = core.SDKErrorf(err, "", "instance_group-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // InstanceGroupPatch : To add or update load balancer specification for an instance group the `membership_count` must first be set to 0. type InstanceGroupPatch struct { // The port to use for new load balancer pool members created by this instance group. @@ -67063,6 +68637,7 @@ type InstancePatch struct { // - Have the same `vcpu.architecture`. // - Support the number of network attachments or network interfaces the instance // currently has. + // - Have the `volume_bandwidth_qos_mode` listed in its `volume_bandwidth_qos_modes`. Profile InstancePatchProfileIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPatch `json:"reservation_affinity,omitempty"` @@ -67071,6 +68646,13 @@ type InstancePatch struct { // this value will result in a corresponding decrease to // `total_network_bandwidth`. TotalVolumeBandwidth *int64 `json:"total_volume_bandwidth,omitempty"` + + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // For this property to be changed, the virtual server instance `status` must be + // `stopping` or `stopped`. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` } // Constants associated with the InstancePatch.ConfidentialComputeMode property. @@ -67084,6 +68666,17 @@ const ( InstancePatchConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstancePatch.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// For this property to be changed, the virtual server instance `status` must be +// `stopping` or `stopped`. +const ( + InstancePatchVolumeBandwidthQosModePooledConst = "pooled" + InstancePatchVolumeBandwidthQosModeWeightedConst = "weighted" +) + // UnmarshalInstancePatch unmarshals an instance of InstancePatch from the specified map of raw messages. func UnmarshalInstancePatch(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(InstancePatch) @@ -67132,6 +68725,11 @@ func UnmarshalInstancePatch(m map[string]json.RawMessage, result interface{}) (e err = core.SDKErrorf(err, "", "total_volume_bandwidth-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -67166,6 +68764,9 @@ func (instancePatch *InstancePatch) AsPatch() (_patch map[string]interface{}, er if !core.IsNil(instancePatch.TotalVolumeBandwidth) { _patch["total_volume_bandwidth"] = instancePatch.TotalVolumeBandwidth } + if !core.IsNil(instancePatch.VolumeBandwidthQosMode) { + _patch["volume_bandwidth_qos_mode"] = instancePatch.VolumeBandwidthQosMode + } return } @@ -67181,6 +68782,7 @@ func (instancePatch *InstancePatch) AsPatch() (_patch map[string]interface{}, er // - Have the same `vcpu.architecture`. // - Support the number of network attachments or network interfaces the instance // currently has. +// - Have the `volume_bandwidth_qos_mode` listed in its `volume_bandwidth_qos_modes`. // // Models which "extend" this model: // - InstancePatchProfileInstanceProfileIdentityByName @@ -67493,6 +69095,8 @@ type InstanceProfile struct { VcpuCount InstanceProfileVcpuIntf `json:"vcpu_count" validate:"required"` VcpuManufacturer InstanceProfileVcpuManufacturerIntf `json:"vcpu_manufacturer" validate:"required"` + + VolumeBandwidthQosModes InstanceProfileVolumeBandwidthQoSModesIntf `json:"volume_bandwidth_qos_modes" validate:"required"` } // Constants associated with the InstanceProfile.ResourceType property. @@ -67651,6 +69255,11 @@ func UnmarshalInstanceProfile(m map[string]json.RawMessage, result interface{}) err = core.SDKErrorf(err, "", "vcpu_manufacturer-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "volume_bandwidth_qos_modes", &obj.VolumeBandwidthQosModes, UnmarshalInstanceProfileVolumeBandwidthQoSModes) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_modes-error", common.GetComponentInfo()) + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -67816,7 +69425,7 @@ func UnmarshalInstanceProfileClusterNetworkAttachmentCount(m map[string]json.Raw // InstanceProfileCollection : InstanceProfileCollection struct type InstanceProfileCollection struct { - // A page of virtual server instance profiles. + // The virtual server instance profiles. Profiles []InstanceProfile `json:"profiles" validate:"required"` } @@ -69131,6 +70740,76 @@ func UnmarshalInstanceProfileVolumeBandwidth(m map[string]json.RawMessage, resul return } +// InstanceProfileVolumeBandwidthQoSModes : InstanceProfileVolumeBandwidthQoSModes struct +// Models which "extend" this model: +// - InstanceProfileVolumeBandwidthQoSModesEnum +// - InstanceProfileVolumeBandwidthQoSModesDependent +type InstanceProfileVolumeBandwidthQoSModes struct { + // The default volume bandwidth QoS mode for this profile. + Default *string `json:"default,omitempty"` + + // The type for this profile field. + Type *string `json:"type,omitempty"` + + // The permitted volume bandwidth QoS modes for an instance using this profile. + Values []string `json:"values,omitempty"` +} + +// Constants associated with the InstanceProfileVolumeBandwidthQoSModes.Default property. +// The default volume bandwidth QoS mode for this profile. +const ( + InstanceProfileVolumeBandwidthQoSModesDefaultPooledConst = "pooled" + InstanceProfileVolumeBandwidthQoSModesDefaultWeightedConst = "weighted" +) + +// Constants associated with the InstanceProfileVolumeBandwidthQoSModes.Type property. +// The type for this profile field. +const ( + InstanceProfileVolumeBandwidthQoSModesTypeEnumConst = "enum" +) + +// Constants associated with the InstanceProfileVolumeBandwidthQoSModes.Values property. +// A volume bandwidth QoS mode: +// - `pooled`: All volumes attached to an instance will pool and share bandwidth. +// - `weighted`: Each volume attached to an instance will have its own bandwidth, weighted according to its IOPS. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. +const ( + InstanceProfileVolumeBandwidthQoSModesValuesPooledConst = "pooled" + InstanceProfileVolumeBandwidthQoSModesValuesWeightedConst = "weighted" +) + +func (*InstanceProfileVolumeBandwidthQoSModes) isaInstanceProfileVolumeBandwidthQoSModes() bool { + return true +} + +type InstanceProfileVolumeBandwidthQoSModesIntf interface { + isaInstanceProfileVolumeBandwidthQoSModes() bool +} + +// UnmarshalInstanceProfileVolumeBandwidthQoSModes unmarshals an instance of InstanceProfileVolumeBandwidthQoSModes from the specified map of raw messages. +func UnmarshalInstanceProfileVolumeBandwidthQoSModes(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileVolumeBandwidthQoSModes) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + err = core.SDKErrorf(err, "", "default-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + err = core.SDKErrorf(err, "", "values-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // InstancePrototype : InstancePrototype struct // Models which "extend" this model: // - InstancePrototypeInstanceByImage @@ -69196,12 +70875,11 @@ type InstancePrototype struct { // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this // virtual server instance. // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change - // in the future. + // If unspecified, `bxf-2x8` will be used, but this default value may change + // in the future without changing the API version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - // The reservation affinity settings for this virtual server instance. If specified, - // `vcpu.tenancy` must be `dedicated`, and `vcpu.percentage` must be `100`. + // The reservation affinity settings for this virtual server instance. ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` // The resource group to use. If unspecified, the account's [default resource @@ -69220,6 +70898,12 @@ type InstancePrototype struct { // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network @@ -69270,6 +70954,16 @@ const ( InstancePrototypeConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstancePrototype.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstancePrototypeVolumeBandwidthQosModePooledConst = "pooled" + InstancePrototypeVolumeBandwidthQosModeWeightedConst = "weighted" +) + func (*InstancePrototype) isaInstancePrototype() bool { return true } @@ -69356,6 +71050,11 @@ func UnmarshalInstancePrototype(m map[string]json.RawMessage, result interface{} err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -69579,8 +71278,7 @@ func (instanceReservationAffinityPatch *InstanceReservationAffinityPatch) asPatc return } -// InstanceReservationAffinityPrototype : The reservation affinity settings for this virtual server instance. If specified, -// `vcpu.tenancy` must be `dedicated`, and `vcpu.percentage` must be `100`. +// InstanceReservationAffinityPrototype : The reservation affinity settings for this virtual server instance. type InstanceReservationAffinityPrototype struct { // The reservation affinity policy to use for this virtual server instance: // - `disabled`: Reservations will not be used @@ -69768,12 +71466,11 @@ type InstanceTemplate struct { // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this // virtual server instance. // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change - // in the future. + // If unspecified, `bxf-2x8` will be used, but this default value may change + // in the future without changing the API version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - // The reservation affinity settings for this virtual server instance. If specified, - // `vcpu.tenancy` must be `dedicated`, and `vcpu.percentage` must be `100`. + // The reservation affinity settings for this virtual server instance. ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` // The resource group for this instance template. @@ -69791,6 +71488,12 @@ type InstanceTemplate struct { // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network @@ -69838,6 +71541,16 @@ const ( InstanceTemplateConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplate.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplateVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplateVolumeBandwidthQosModeWeightedConst = "weighted" +) + func (*InstanceTemplate) isaInstanceTemplate() bool { return true } @@ -69848,149 +71561,177 @@ type InstanceTemplateIntf interface { // UnmarshalInstanceTemplate unmarshals an instance of InstanceTemplate from the specified map of raw messages. func UnmarshalInstanceTemplate(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceTemplate) - err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) - if err != nil { - err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "cluster_network_attachments", &obj.ClusterNetworkAttachments, UnmarshalInstanceClusterNetworkAttachmentPrototypeInstanceContext) - if err != nil { - err = core.SDKErrorf(err, "", "cluster_network_attachments-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "confidential_compute_mode", &obj.ConfidentialComputeMode) - if err != nil { - err = core.SDKErrorf(err, "", "confidential_compute_mode-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) - if err != nil { - err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) - if err != nil { - err = core.SDKErrorf(err, "", "crn-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) - if err != nil { - err = core.SDKErrorf(err, "", "default_trusted_profile-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "enable_secure_boot", &obj.EnableSecureBoot) - if err != nil { - err = core.SDKErrorf(err, "", "enable_secure_boot-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "href", &obj.Href) - if err != nil { - err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "id", &obj.ID) - if err != nil { - err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) - if err != nil { - err = core.SDKErrorf(err, "", "keys-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) - if err != nil { - err = core.SDKErrorf(err, "", "metadata_service-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) - if err != nil { - err = core.SDKErrorf(err, "", "placement_target-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) - if err != nil { - err = core.SDKErrorf(err, "", "profile-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) - if err != nil { - err = core.SDKErrorf(err, "", "reservation_affinity-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) - if err != nil { - err = core.SDKErrorf(err, "", "resource_group-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) - if err != nil { - err = core.SDKErrorf(err, "", "total_volume_bandwidth-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) - if err != nil { - err = core.SDKErrorf(err, "", "user_data-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) - if err != nil { - err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) - if err != nil { - err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) - if err != nil { - err = core.SDKErrorf(err, "", "boot_volume_attachment-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) - if err != nil { - err = core.SDKErrorf(err, "", "image-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) - if err != nil { - err = core.SDKErrorf(err, "", "zone-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - err = core.SDKErrorf(err, "", "network_attachments-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) - if err != nil { - err = core.SDKErrorf(err, "", "primary_network_attachment-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) - if err != nil { - err = core.SDKErrorf(err, "", "network_interfaces-error", common.GetComponentInfo()) - return + // Check for source_snapshot presence to determine object type + var isSourceSnapshot bool + if bootVolumeRaw, exists := m["boot_volume_attachment"]; exists && len(bootVolumeRaw) > 0 && string(bootVolumeRaw) != "null" { + var bootVolumeMap map[string]json.RawMessage + if err = json.Unmarshal(bootVolumeRaw, &bootVolumeMap); err == nil { + if volumeRaw, volumeExists := bootVolumeMap["volume"]; volumeExists && len(volumeRaw) > 0 && string(volumeRaw) != "null" { + var volumeMap map[string]json.RawMessage + if err = json.Unmarshal(volumeRaw, &volumeMap); err == nil { + if _, snapshotExists := volumeMap["source_snapshot"]; snapshotExists { + isSourceSnapshot = true + } + } + } + } } - err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) - if err != nil { - err = core.SDKErrorf(err, "", "primary_network_interface-error", common.GetComponentInfo()) + if isSourceSnapshot { + err = core.UnmarshalModel(m, "", result, UnmarshalInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext-error", common.GetComponentInfo()) + } return - } - err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) - if err != nil { - err = core.SDKErrorf(err, "", "catalog_offering-error", common.GetComponentInfo()) + } else { + obj := new(InstanceTemplate) + err = core.UnmarshalModel(m, "availability_policy", &obj.AvailabilityPolicy, UnmarshalInstanceAvailabilityPolicyPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "availability_policy-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "cluster_network_attachments", &obj.ClusterNetworkAttachments, UnmarshalInstanceClusterNetworkAttachmentPrototypeInstanceContext) + if err != nil { + err = core.SDKErrorf(err, "", "cluster_network_attachments-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "confidential_compute_mode", &obj.ConfidentialComputeMode) + if err != nil { + err = core.SDKErrorf(err, "", "confidential_compute_mode-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + err = core.SDKErrorf(err, "", "crn-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "default_trusted_profile", &obj.DefaultTrustedProfile, UnmarshalInstanceDefaultTrustedProfilePrototype) + if err != nil { + err = core.SDKErrorf(err, "", "default_trusted_profile-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "enable_secure_boot", &obj.EnableSecureBoot) + if err != nil { + err = core.SDKErrorf(err, "", "enable_secure_boot-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "keys", &obj.Keys, UnmarshalKeyIdentity) + if err != nil { + err = core.SDKErrorf(err, "", "keys-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "metadata_service", &obj.MetadataService, UnmarshalInstanceMetadataServicePrototype) + if err != nil { + err = core.SDKErrorf(err, "", "metadata_service-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "placement_target", &obj.PlacementTarget, UnmarshalInstancePlacementTargetPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "placement_target-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "profile", &obj.Profile, UnmarshalInstanceProfileIdentity) + if err != nil { + err = core.SDKErrorf(err, "", "profile-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "reservation_affinity", &obj.ReservationAffinity, UnmarshalInstanceReservationAffinityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "reservation_affinity-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "resource_group", &obj.ResourceGroup, UnmarshalResourceGroupReference) + if err != nil { + err = core.SDKErrorf(err, "", "resource_group-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "total_volume_bandwidth", &obj.TotalVolumeBandwidth) + if err != nil { + err = core.SDKErrorf(err, "", "total_volume_bandwidth-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "user_data", &obj.UserData) + if err != nil { + err = core.SDKErrorf(err, "", "user_data-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "volume_attachments", &obj.VolumeAttachments, UnmarshalVolumeAttachmentPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) + if err != nil { + err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "boot_volume_attachment", &obj.BootVolumeAttachment, UnmarshalVolumeAttachmentPrototypeInstanceByImageContext) + if err != nil { + err = core.SDKErrorf(err, "", "boot_volume_attachment-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "image", &obj.Image, UnmarshalImageIdentity) + if err != nil { + err = core.SDKErrorf(err, "", "image-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "zone", &obj.Zone, UnmarshalZoneIdentity) + if err != nil { + err = core.SDKErrorf(err, "", "zone-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "network_attachments", &obj.NetworkAttachments, UnmarshalInstanceNetworkAttachmentPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "network_attachments-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "primary_network_attachment", &obj.PrimaryNetworkAttachment, UnmarshalInstanceNetworkAttachmentPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "primary_network_attachment-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "network_interfaces", &obj.NetworkInterfaces, UnmarshalNetworkInterfacePrototype) + if err != nil { + err = core.SDKErrorf(err, "", "network_interfaces-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "primary_network_interface", &obj.PrimaryNetworkInterface, UnmarshalNetworkInterfacePrototype) + if err != nil { + err = core.SDKErrorf(err, "", "primary_network_interface-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "catalog_offering", &obj.CatalogOffering, UnmarshalInstanceCatalogOfferingPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "catalog_offering-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return } // InstanceTemplateCollection : InstanceTemplateCollection struct @@ -70197,12 +71938,11 @@ type InstanceTemplatePrototype struct { // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this // virtual server instance. // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change - // in the future. + // If unspecified, `bxf-2x8` will be used, but this default value may change + // in the future without changing the API version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` - // The reservation affinity settings for this virtual server instance. If specified, - // `vcpu.tenancy` must be `dedicated`, and `vcpu.percentage` must be `100`. + // The reservation affinity settings for this virtual server instance. ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` // The resource group to use. If unspecified, the account's [default resource @@ -70221,6 +71961,12 @@ type InstanceTemplatePrototype struct { // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network @@ -70273,6 +72019,16 @@ const ( InstanceTemplatePrototypeConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplatePrototype.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplatePrototypeVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplatePrototypeVolumeBandwidthQosModeWeightedConst = "weighted" +) + func (*InstanceTemplatePrototype) isaInstanceTemplatePrototype() bool { return true } @@ -70359,6 +72115,11 @@ func UnmarshalInstanceTemplatePrototype(m map[string]json.RawMessage, result int err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -70475,7 +72236,8 @@ type InstanceVcpu struct { // The number of VCPUs assigned. Count *int64 `json:"count" validate:"required"` - // The VCPU manufacturer. + // The VCPU manufacturer for this instance. It may be `unassigned` when instance `status` is `failed`, `pending`, or + // `stopped`. // // The enumerated values for this property may // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. @@ -70493,14 +72255,16 @@ const ( ) // Constants associated with the InstanceVcpu.Manufacturer property. -// The VCPU manufacturer. +// The VCPU manufacturer for this instance. It may be `unassigned` when instance `status` is `failed`, `pending`, or +// `stopped`. // // The enumerated values for this property may // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. const ( - InstanceVcpuManufacturerAmdConst = "amd" - InstanceVcpuManufacturerIBMConst = "ibm" - InstanceVcpuManufacturerIntelConst = "intel" + InstanceVcpuManufacturerAmdConst = "amd" + InstanceVcpuManufacturerIBMConst = "ibm" + InstanceVcpuManufacturerIntelConst = "intel" + InstanceVcpuManufacturerUnassignedConst = "unassigned" ) // UnmarshalInstanceVcpu unmarshals an instance of InstanceVcpu from the specified map of raw messages. @@ -72088,8 +73852,57 @@ func (options *ListEndpointGatewayIpsOptions) SetHeaders(param map[string]string return options } +// ListEndpointGatewayResourceBindingsOptions : The ListEndpointGatewayResourceBindings options. +type ListEndpointGatewayResourceBindingsOptions struct { + // The endpoint gateway identifier. + EndpointGatewayID *string `json:"endpoint_gateway_id" validate:"required,ne="` + + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewListEndpointGatewayResourceBindingsOptions : Instantiate ListEndpointGatewayResourceBindingsOptions +func (*VpcV1) NewListEndpointGatewayResourceBindingsOptions(endpointGatewayID string) *ListEndpointGatewayResourceBindingsOptions { + return &ListEndpointGatewayResourceBindingsOptions{ + EndpointGatewayID: core.StringPtr(endpointGatewayID), + } +} + +// SetEndpointGatewayID : Allow user to set EndpointGatewayID +func (_options *ListEndpointGatewayResourceBindingsOptions) SetEndpointGatewayID(endpointGatewayID string) *ListEndpointGatewayResourceBindingsOptions { + _options.EndpointGatewayID = core.StringPtr(endpointGatewayID) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListEndpointGatewayResourceBindingsOptions) SetStart(start string) *ListEndpointGatewayResourceBindingsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListEndpointGatewayResourceBindingsOptions) SetLimit(limit int64) *ListEndpointGatewayResourceBindingsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListEndpointGatewayResourceBindingsOptions) SetHeaders(param map[string]string) *ListEndpointGatewayResourceBindingsOptions { + options.Headers = param + return options +} + // ListEndpointGatewaysOptions : The ListEndpointGateways options. type ListEndpointGatewaysOptions struct { + // Filters the collection to endpoint gateways with an `allow_resource_binding` property matching the specified value. + AllowResourceBinding *bool `json:"allow_resource_binding,omitempty"` + // Filters the collection to resources with a `name` property matching the exact specified name. Name *string `json:"name,omitempty"` @@ -72139,6 +73952,12 @@ func (*VpcV1) NewListEndpointGatewaysOptions() *ListEndpointGatewaysOptions { return &ListEndpointGatewaysOptions{} } +// SetAllowResourceBinding : Allow user to set AllowResourceBinding +func (_options *ListEndpointGatewaysOptions) SetAllowResourceBinding(allowResourceBinding bool) *ListEndpointGatewaysOptions { + _options.AllowResourceBinding = core.BoolPtr(allowResourceBinding) + return _options +} + // SetName : Allow user to set Name func (_options *ListEndpointGatewaysOptions) SetName(name string) *ListEndpointGatewaysOptions { _options.Name = core.StringPtr(name) @@ -73284,6 +75103,14 @@ type ListInstancesOptions struct { // Filters the collection to resources with a `dedicated_host.name` property matching the exact specified name. DedicatedHostName *string `json:"dedicated_host.name,omitempty"` + // Filters the collection to instances with an `instance_group_membership.instance_group.id` property matching the + // specified instance group identifier. + InstanceGroupMembershipInstanceGroupID *string `json:"instance_group_membership.instance_group.id,omitempty"` + + // Filters the collection to instances with an `instance_group_membership.instance_group.crn` property matching the + // specified instance group CRN. + InstanceGroupMembershipInstanceGroupCRN *string `json:"instance_group_membership.instance_group.crn,omitempty"` + // Filters the collection to resources with a `placement_target.id` property matching the specified placement group // identifier. PlacementGroupID *string `json:"placement_group.id,omitempty"` @@ -73394,6 +75221,18 @@ func (_options *ListInstancesOptions) SetDedicatedHostName(dedicatedHostName str return _options } +// SetInstanceGroupMembershipInstanceGroupID : Allow user to set InstanceGroupMembershipInstanceGroupID +func (_options *ListInstancesOptions) SetInstanceGroupMembershipInstanceGroupID(instanceGroupMembershipInstanceGroupID string) *ListInstancesOptions { + _options.InstanceGroupMembershipInstanceGroupID = core.StringPtr(instanceGroupMembershipInstanceGroupID) + return _options +} + +// SetInstanceGroupMembershipInstanceGroupCRN : Allow user to set InstanceGroupMembershipInstanceGroupCRN +func (_options *ListInstancesOptions) SetInstanceGroupMembershipInstanceGroupCRN(instanceGroupMembershipInstanceGroupCRN string) *ListInstancesOptions { + _options.InstanceGroupMembershipInstanceGroupCRN = core.StringPtr(instanceGroupMembershipInstanceGroupCRN) + return _options +} + // SetPlacementGroupID : Allow user to set PlacementGroupID func (_options *ListInstancesOptions) SetPlacementGroupID(placementGroupID string) *ListInstancesOptions { _options.PlacementGroupID = core.StringPtr(placementGroupID) @@ -76232,6 +78071,34 @@ func (options *ListVpcsOptions) SetHeaders(param map[string]string) *ListVpcsOpt return options } +// ListVPNGatewayAdvertisedCIDRsOptions : The ListVPNGatewayAdvertisedCIDRs options. +type ListVPNGatewayAdvertisedCIDRsOptions struct { + // The VPN gateway identifier. + VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewListVPNGatewayAdvertisedCIDRsOptions : Instantiate ListVPNGatewayAdvertisedCIDRsOptions +func (*VpcV1) NewListVPNGatewayAdvertisedCIDRsOptions(vpnGatewayID string) *ListVPNGatewayAdvertisedCIDRsOptions { + return &ListVPNGatewayAdvertisedCIDRsOptions{ + VPNGatewayID: core.StringPtr(vpnGatewayID), + } +} + +// SetVPNGatewayID : Allow user to set VPNGatewayID +func (_options *ListVPNGatewayAdvertisedCIDRsOptions) SetVPNGatewayID(vpnGatewayID string) *ListVPNGatewayAdvertisedCIDRsOptions { + _options.VPNGatewayID = core.StringPtr(vpnGatewayID) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListVPNGatewayAdvertisedCIDRsOptions) SetHeaders(param map[string]string) *ListVPNGatewayAdvertisedCIDRsOptions { + options.Headers = param + return options +} + // ListVPNGatewayConnectionsLocalCIDRsOptions : The ListVPNGatewayConnectionsLocalCIDRs options. type ListVPNGatewayConnectionsLocalCIDRsOptions struct { // The VPN gateway identifier. @@ -76370,6 +78237,52 @@ func (options *ListVPNGatewayConnectionsPeerCIDRsOptions) SetHeaders(param map[s return options } +// ListVPNGatewayServiceConnectionsOptions : The ListVPNGatewayServiceConnections options. +type ListVPNGatewayServiceConnectionsOptions struct { + // The VPN gateway identifier. + VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` + + // A server-provided token determining what resource to start the page on. + Start *string `json:"start,omitempty"` + + // The number of resources to return on a page. + Limit *int64 `json:"limit,omitempty"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewListVPNGatewayServiceConnectionsOptions : Instantiate ListVPNGatewayServiceConnectionsOptions +func (*VpcV1) NewListVPNGatewayServiceConnectionsOptions(vpnGatewayID string) *ListVPNGatewayServiceConnectionsOptions { + return &ListVPNGatewayServiceConnectionsOptions{ + VPNGatewayID: core.StringPtr(vpnGatewayID), + } +} + +// SetVPNGatewayID : Allow user to set VPNGatewayID +func (_options *ListVPNGatewayServiceConnectionsOptions) SetVPNGatewayID(vpnGatewayID string) *ListVPNGatewayServiceConnectionsOptions { + _options.VPNGatewayID = core.StringPtr(vpnGatewayID) + return _options +} + +// SetStart : Allow user to set Start +func (_options *ListVPNGatewayServiceConnectionsOptions) SetStart(start string) *ListVPNGatewayServiceConnectionsOptions { + _options.Start = core.StringPtr(start) + return _options +} + +// SetLimit : Allow user to set Limit +func (_options *ListVPNGatewayServiceConnectionsOptions) SetLimit(limit int64) *ListVPNGatewayServiceConnectionsOptions { + _options.Limit = core.Int64Ptr(limit) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *ListVPNGatewayServiceConnectionsOptions) SetHeaders(param map[string]string) *ListVPNGatewayServiceConnectionsOptions { + options.Headers = param + return options +} + // ListVPNGatewaysOptions : The ListVPNGateways options. type ListVPNGatewaysOptions struct { // A server-provided token determining what resource to start the page on. @@ -80563,7 +82476,8 @@ func UnmarshalLoadBalancerPoolMemberReference(m map[string]json.RawMessage, resu // LoadBalancerPoolMemberTarget : The pool member target. // Models which "extend" this model: // - LoadBalancerPoolMemberTargetInstanceReference -// - LoadBalancerPoolMemberTargetIP +// - LoadBalancerPoolMemberTargetByReservedIP +// - LoadBalancerPoolMemberTargetIPNotReservedIP // - LoadBalancerPoolMemberTargetLoadBalancerReference type LoadBalancerPoolMemberTarget struct { // The CRN for this virtual server instance. @@ -80584,6 +82498,8 @@ type LoadBalancerPoolMemberTarget struct { // The IP address. // + // If the address has not yet been selected, the value will be `0.0.0.0`. + // // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 addresses in // the future. Address *string `json:"address,omitempty"` @@ -80595,7 +82511,7 @@ type LoadBalancerPoolMemberTarget struct { // Constants associated with the LoadBalancerPoolMemberTarget.ResourceType property. // The resource type. const ( - LoadBalancerPoolMemberTargetResourceTypeLoadBalancerConst = "load_balancer" + LoadBalancerPoolMemberTargetResourceTypeSubnetReservedIPConst = "subnet_reserved_ip" ) func (*LoadBalancerPoolMemberTarget) isaLoadBalancerPoolMemberTarget() bool { @@ -80656,6 +82572,7 @@ func UnmarshalLoadBalancerPoolMemberTarget(m map[string]json.RawMessage, result // any other load balancer in the same VPC. // Models which "extend" this model: // - LoadBalancerPoolMemberTargetPrototypeInstanceIdentity +// - LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity // - LoadBalancerPoolMemberTargetPrototypeIP // - LoadBalancerPoolMemberTargetPrototypeLoadBalancerIdentity type LoadBalancerPoolMemberTargetPrototype struct { @@ -81256,6 +83173,8 @@ type LoadBalancerProfile struct { // The load balancer profiles that load balancers with this profile can target. TargetableLoadBalancerProfiles []LoadBalancerProfileReference `json:"targetable_load_balancer_profiles" validate:"required"` + TargetableResourceTypes *LoadBalancerProfileTargetableResourceTypes `json:"targetable_resource_types" validate:"required"` + UDPSupported LoadBalancerProfileUDPSupportedIntf `json:"udp_supported" validate:"required"` } @@ -81332,6 +83251,11 @@ func UnmarshalLoadBalancerProfile(m map[string]json.RawMessage, result interface err = core.SDKErrorf(err, "", "targetable_load_balancer_profiles-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "targetable_resource_types", &obj.TargetableResourceTypes, UnmarshalLoadBalancerProfileTargetableResourceTypes) + if err != nil { + err = core.SDKErrorf(err, "", "targetable_resource_types-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "udp_supported", &obj.UDPSupported, UnmarshalLoadBalancerProfileUDPSupported) if err != nil { err = core.SDKErrorf(err, "", "udp_supported-error", common.GetComponentInfo()) @@ -81879,6 +83803,53 @@ func UnmarshalLoadBalancerProfileSourceIPSessionPersistenceSupported(m map[strin return } +// LoadBalancerProfileTargetableResourceTypes : LoadBalancerProfileTargetableResourceTypes struct +type LoadBalancerProfileTargetableResourceTypes struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The resource types that pool members of load balancers with this profile can target. + Values []string `json:"values" validate:"required"` +} + +// Constants associated with the LoadBalancerProfileTargetableResourceTypes.Type property. +// The type for this profile field. +const ( + LoadBalancerProfileTargetableResourceTypesTypeEnumConst = "enum" +) + +// Constants associated with the LoadBalancerProfileTargetableResourceTypes.Values property. +// The [resource types](https://cloud.ibm.com/docs/vpc?topic=vpc-nlb-vs-elb&interface=ui#lb-comparison-chart) that can +// be targeted by the load balancer pool member: +// - 'instance': Traffic is forwarded to the primary IP address for the instance's +// 'primary_network_interface' or 'primary_network_attachment'. +// - 'subnet_reserved_ip': Traffic is forwarded to the reserved IP address. +// - `load_balancer`: Traffic is forwarded to the load balancer. +// - `ip`: Traffic is forwarded to the IP address. +const ( + LoadBalancerProfileTargetableResourceTypesValuesIPConst = "ip" + LoadBalancerProfileTargetableResourceTypesValuesInstanceConst = "instance" + LoadBalancerProfileTargetableResourceTypesValuesLoadBalancerConst = "load_balancer" + LoadBalancerProfileTargetableResourceTypesValuesSubnetReservedIPConst = "subnet_reserved_ip" +) + +// UnmarshalLoadBalancerProfileTargetableResourceTypes unmarshals an instance of LoadBalancerProfileTargetableResourceTypes from the specified map of raw messages. +func UnmarshalLoadBalancerProfileTargetableResourceTypes(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerProfileTargetableResourceTypes) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + err = core.SDKErrorf(err, "", "values-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // LoadBalancerProfileUDPSupported : LoadBalancerProfileUDPSupported struct // Models which "extend" this model: // - LoadBalancerProfileUDPSupportedFixed @@ -83890,10 +85861,11 @@ type NetworkInterfacePrototype struct { Name *string `json:"name,omitempty"` // The primary IP address to bind to the instance network interface. This can be - // specified using an existing reserved IP, or a prototype object for a new reserved IP. + // specified using an existing reserved IP, or a prototype object for a new reserved + // IP. // - // If an existing reserved IP or a prototype object with an address is specified, it must - // be available on the instance network interface's subnet. Otherwise, an + // If an existing reserved IP or a prototype object with an address is specified, it + // must be available on the instance network interface's subnet. Otherwise, an // available address on the subnet will be automatically selected and reserved. PrimaryIP NetworkInterfaceIPPrototypeIntf `json:"primary_ip,omitempty"` @@ -86499,6 +88471,44 @@ func (options *RemoveVirtualNetworkInterfaceIPOptions) SetHeaders(param map[stri return options } +// RemoveVPNGatewayAdvertisedCIDROptions : The RemoveVPNGatewayAdvertisedCIDR options. +type RemoveVPNGatewayAdvertisedCIDROptions struct { + // The VPN gateway identifier. + VPNGatewayID *string `json:"vpn_gateway_id" validate:"required,ne="` + + // The IP address range in CIDR block notation. + CIDR *string `json:"cidr" validate:"required,ne="` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewRemoveVPNGatewayAdvertisedCIDROptions : Instantiate RemoveVPNGatewayAdvertisedCIDROptions +func (*VpcV1) NewRemoveVPNGatewayAdvertisedCIDROptions(vpnGatewayID string, cidr string) *RemoveVPNGatewayAdvertisedCIDROptions { + return &RemoveVPNGatewayAdvertisedCIDROptions{ + VPNGatewayID: core.StringPtr(vpnGatewayID), + CIDR: core.StringPtr(cidr), + } +} + +// SetVPNGatewayID : Allow user to set VPNGatewayID +func (_options *RemoveVPNGatewayAdvertisedCIDROptions) SetVPNGatewayID(vpnGatewayID string) *RemoveVPNGatewayAdvertisedCIDROptions { + _options.VPNGatewayID = core.StringPtr(vpnGatewayID) + return _options +} + +// SetCIDR : Allow user to set CIDR +func (_options *RemoveVPNGatewayAdvertisedCIDROptions) SetCIDR(cidr string) *RemoveVPNGatewayAdvertisedCIDROptions { + _options.CIDR = core.StringPtr(cidr) + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *RemoveVPNGatewayAdvertisedCIDROptions) SetHeaders(param map[string]string) *RemoveVPNGatewayAdvertisedCIDROptions { + options.Headers = param + return options +} + // RemoveVPNGatewayConnectionsLocalCIDROptions : The RemoveVPNGatewayConnectionsLocalCIDR options. type RemoveVPNGatewayConnectionsLocalCIDROptions struct { // The VPN gateway identifier. @@ -91365,14 +93375,37 @@ type Share struct { // with access to this file share's data and its snapshots. AccessorBindings []ShareAccessorBindingReference `json:"accessor_bindings" validate:"required"` + // The access protocols to allow for this share: + // - `nfs4`: NFSv4 is used to access this share via its associated share mount target. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + AllowedAccessProtocols []string `json:"allowed_access_protocols" validate:"required"` + // The transit encryption modes allowed for this share: // - `none`: Not encrypted in transit. - // - `user_managed`: Encrypted in transit using an instance identity certificate. + // - `ipsec`: Encrypted in transit using an instance identity certificate. + // - `stunnel`: Encrypted in transit using a connection via the installed stunnel + // client. // // The enumerated values for this property may // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. AllowedTransitEncryptionModes []string `json:"allowed_transit_encryption_modes" validate:"required"` + // The data availability mode of the share: + // - `zonal`: The share's data will be available provided the `zone` of the share is + // available. Additionally, disasters affecting the zone may lead to data loss. + // - `regional`: The share's data will be available provided at least one zone in the + // region is available. Additionally, disasters affecting the entire region may lead + // to data loss. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + AvailabilityMode *string `json:"availability_mode" validate:"required"` + + // The maximum bandwidth (in megabits per second) for the share. + Bandwidth *int64 `json:"bandwidth" validate:"required"` + // The date and time that the file share is created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` @@ -91396,10 +93429,9 @@ type Share struct { // The owner assigned to the file share at creation. InitialOwner *ShareInitialOwner `json:"initial_owner" validate:"required"` - // The maximum input/output operations per second (IOPS) for the file share. In addition, each client accessing the - // share will be restricted to 48,000 IOPS. + // The maximum input/output operations per second (IOPS) for the file share. // - // The maximum IOPS for a share may increase in the future. + // The maximum IOPS for a share as defined by the share's profile may increase in the future. Iops *int64 `json:"iops" validate:"required"` // The latest job associated with this file share. @@ -91499,11 +93531,22 @@ type Share struct { // future. SourceSnapshot ShareSourceSnapshotIntf `json:"source_snapshot,omitempty"` + // The [storage + // generation](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles&interface=api#using-api-iops-profiles): + // - `1`: The first storage generation + // - `2`: The second storage generation + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + StorageGeneration *int64 `json:"storage_generation" validate:"required"` + // The tags for this resource. UserTags []string `json:"user_tags" validate:"required"` // The zone this file share resides in. - Zone *ZoneReference `json:"zone" validate:"required"` + // + // This property will be absent for shares with an `availability_mode` of `regional`. + Zone *ZoneReference `json:"zone,omitempty"` } // Constants associated with the Share.AccessControlMode property. @@ -91533,10 +93576,31 @@ const ( ShareAccessorBindingRoleOriginConst = "origin" ) +// Constants associated with the Share.AllowedAccessProtocols property. +const ( + ShareAllowedAccessProtocolsNfs4Const = "nfs4" +) + // Constants associated with the Share.AllowedTransitEncryptionModes property. const ( - ShareAllowedTransitEncryptionModesNoneConst = "none" - ShareAllowedTransitEncryptionModesUserManagedConst = "user_managed" + ShareAllowedTransitEncryptionModesIpsecConst = "ipsec" + ShareAllowedTransitEncryptionModesNoneConst = "none" + ShareAllowedTransitEncryptionModesStunnelConst = "stunnel" +) + +// Constants associated with the Share.AvailabilityMode property. +// The data availability mode of the share: +// - `zonal`: The share's data will be available provided the `zone` of the share is +// available. Additionally, disasters affecting the zone may lead to data loss. +// - `regional`: The share's data will be available provided at least one zone in the +// region is available. Additionally, disasters affecting the entire region may lead +// to data loss. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. +const ( + ShareAvailabilityModeRegionalConst = "regional" + ShareAvailabilityModeZonalConst = "zonal" ) // Constants associated with the Share.Encryption property. @@ -91618,11 +93682,26 @@ func UnmarshalShare(m map[string]json.RawMessage, result interface{}) (err error err = core.SDKErrorf(err, "", "accessor_bindings-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "allowed_access_protocols", &obj.AllowedAccessProtocols) + if err != nil { + err = core.SDKErrorf(err, "", "allowed_access_protocols-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "allowed_transit_encryption_modes", &obj.AllowedTransitEncryptionModes) if err != nil { err = core.SDKErrorf(err, "", "allowed_transit_encryption_modes-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "availability_mode", &obj.AvailabilityMode) + if err != nil { + err = core.SDKErrorf(err, "", "availability_mode-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "bandwidth", &obj.Bandwidth) + if err != nil { + err = core.SDKErrorf(err, "", "bandwidth-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) @@ -91763,6 +93842,11 @@ func UnmarshalShare(m map[string]json.RawMessage, result interface{}) (err error err = core.SDKErrorf(err, "", "source_snapshot-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "storage_generation", &obj.StorageGeneration) + if err != nil { + err = core.SDKErrorf(err, "", "storage_generation-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "user_tags", &obj.UserTags) if err != nil { err = core.SDKErrorf(err, "", "user_tags-error", common.GetComponentInfo()) @@ -92423,6 +94507,13 @@ type ShareMountTarget struct { // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. AccessControlMode *string `json:"access_control_mode" validate:"required"` + // The protocol used to access the share for this share mount target: + // - `nfs4`: NFSv4 will be used. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + AccessProtocol *string `json:"access_protocol" validate:"required"` + // The date and time that the share mount target was created. CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` @@ -92466,8 +94557,10 @@ type ShareMountTarget struct { Subnet *SubnetReference `json:"subnet,omitempty"` // The transit encryption mode for this share mount target: - // - `none`: Not encrypted in transit - // - `user_managed`: Encrypted in transit using an instance identity certificate + // - `none`: Not encrypted in transit. + // - `ipsec`: Encrypted in transit using an instance identity certificate. + // - `stunnel`: Encrypted in transit using a connection via the installed stunnel + // client. // // The enumerated values for this property may // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. @@ -92501,6 +94594,16 @@ const ( ShareMountTargetAccessControlModeVPCConst = "vpc" ) +// Constants associated with the ShareMountTarget.AccessProtocol property. +// The protocol used to access the share for this share mount target: +// - `nfs4`: NFSv4 will be used. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. +const ( + ShareMountTargetAccessProtocolNfs4Const = "nfs4" +) + // Constants associated with the ShareMountTarget.LifecycleState property. // The lifecycle state of the mount target. const ( @@ -92521,14 +94624,17 @@ const ( // Constants associated with the ShareMountTarget.TransitEncryption property. // The transit encryption mode for this share mount target: -// - `none`: Not encrypted in transit -// - `user_managed`: Encrypted in transit using an instance identity certificate +// - `none`: Not encrypted in transit. +// - `ipsec`: Encrypted in transit using an instance identity certificate. +// - `stunnel`: Encrypted in transit using a connection via the installed stunnel +// client. // // The enumerated values for this property may // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. const ( - ShareMountTargetTransitEncryptionNoneConst = "none" - ShareMountTargetTransitEncryptionUserManagedConst = "user_managed" + ShareMountTargetTransitEncryptionIpsecConst = "ipsec" + ShareMountTargetTransitEncryptionNoneConst = "none" + ShareMountTargetTransitEncryptionStunnelConst = "stunnel" ) // UnmarshalShareMountTarget unmarshals an instance of ShareMountTarget from the specified map of raw messages. @@ -92539,6 +94645,11 @@ func UnmarshalShareMountTarget(m map[string]json.RawMessage, result interface{}) err = core.SDKErrorf(err, "", "access_control_mode-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "access_protocol", &obj.AccessProtocol) + if err != nil { + err = core.SDKErrorf(err, "", "access_protocol-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) if err != nil { err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) @@ -92702,18 +94813,26 @@ func (shareMountTargetPatch *ShareMountTargetPatch) AsPatch() (_patch map[string // - ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup // - ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC type ShareMountTargetPrototype struct { + // The protocol to use to access the share for this share mount target: + // - `nfs4`: NFSv4 will be used. + // + // The specified value must be listed in the share's `allowed_access_protocols`. + AccessProtocol *string `json:"access_protocol" validate:"required"` + // The name for this share mount target. The name must not be used by another mount target for the file share. If // unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` // The transit encryption mode to use for this share mount target: // - `none`: Not encrypted in transit. - // - `user_managed`: Encrypted in transit using an instance identity certificate. The - // `access_control_mode` for the share must be `security_group`. + // - `ipsec`: Encrypted in transit using an instance identity certificate. The + // `access_control_mode` for the share must be `security_group`. + // - `stunnel`: Encrypted in transit using an stunnel connection. The + // `access_control_mode` for the share must be `security_group`. // // The specified value must be listed in the share's // `allowed_transit_encryption_modes`. - TransitEncryption *string `json:"transit_encryption,omitempty"` + TransitEncryption *string `json:"transit_encryption" validate:"required"` VirtualNetworkInterface ShareMountTargetVirtualNetworkInterfacePrototypeIntf `json:"virtual_network_interface,omitempty"` @@ -92721,17 +94840,29 @@ type ShareMountTargetPrototype struct { VPC VPCIdentityIntf `json:"vpc,omitempty"` } +// Constants associated with the ShareMountTargetPrototype.AccessProtocol property. +// The protocol to use to access the share for this share mount target: +// - `nfs4`: NFSv4 will be used. +// +// The specified value must be listed in the share's `allowed_access_protocols`. +const ( + ShareMountTargetPrototypeAccessProtocolNfs4Const = "nfs4" +) + // Constants associated with the ShareMountTargetPrototype.TransitEncryption property. // The transit encryption mode to use for this share mount target: // - `none`: Not encrypted in transit. -// - `user_managed`: Encrypted in transit using an instance identity certificate. The +// - `ipsec`: Encrypted in transit using an instance identity certificate. The +// `access_control_mode` for the share must be `security_group`. +// - `stunnel`: Encrypted in transit using an stunnel connection. The // `access_control_mode` for the share must be `security_group`. // // The specified value must be listed in the share's // `allowed_transit_encryption_modes`. const ( - ShareMountTargetPrototypeTransitEncryptionNoneConst = "none" - ShareMountTargetPrototypeTransitEncryptionUserManagedConst = "user_managed" + ShareMountTargetPrototypeTransitEncryptionIpsecConst = "ipsec" + ShareMountTargetPrototypeTransitEncryptionNoneConst = "none" + ShareMountTargetPrototypeTransitEncryptionStunnelConst = "stunnel" ) func (*ShareMountTargetPrototype) isaShareMountTargetPrototype() bool { @@ -92745,6 +94876,11 @@ type ShareMountTargetPrototypeIntf interface { // UnmarshalShareMountTargetPrototype unmarshals an instance of ShareMountTargetPrototype from the specified map of raw messages. func UnmarshalShareMountTargetPrototype(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(ShareMountTargetPrototype) + err = core.UnmarshalPrimitive(m, "access_protocol", &obj.AccessProtocol) + if err != nil { + err = core.SDKErrorf(err, "", "access_protocol-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) @@ -93022,6 +95158,14 @@ type SharePatch struct { // `replication_role` must be `none` and `accessor_binding_role` must not be `accessor`. AccessControlMode *string `json:"access_control_mode,omitempty"` + // The access protocols to allow for this share (replacing any existing access protocols). + // + // If the share has existing mount targets, the set of allowed access protocols must contain all `access_protocol` + // modes specified by existing mount targets. + // + // For this property to be updated, the `accessor_binding_role` must be `none`. + AllowedAccessProtocols []string `json:"allowed_access_protocols,omitempty"` + // The transit encryption modes to allow for this share // (replacing the existing allowed transit encryption modes). The specified transit encryption modes must contain all // transit_encryption modes specified by existing mount targets. @@ -93029,6 +95173,13 @@ type SharePatch struct { // For this property to be updated, the `accessor_binding_role` must be `none`. AllowedTransitEncryptionModes []string `json:"allowed_transit_encryption_modes,omitempty"` + // The maximum bandwidth (in megabits per second) for the share. + // + // For this property to be changed, the share `accessor_binding_role` must not be + // `accessor`, the share profile must not have a `bandwidth.type` of `dependent` or + // `fixed`, and the specified value must be within the `bandwidth` range of the share's profile. + Bandwidth *int64 `json:"bandwidth,omitempty"` + // The maximum input/output operations per second (IOPS) for the file share. // // The maximum IOPS for a share may increase in the future. For this property to be changed, the share @@ -93079,10 +95230,16 @@ const ( SharePatchAccessControlModeVPCConst = "vpc" ) +// Constants associated with the SharePatch.AllowedAccessProtocols property. +const ( + SharePatchAllowedAccessProtocolsNfs4Const = "nfs4" +) + // Constants associated with the SharePatch.AllowedTransitEncryptionModes property. const ( - SharePatchAllowedTransitEncryptionModesNoneConst = "none" - SharePatchAllowedTransitEncryptionModesUserManagedConst = "user_managed" + SharePatchAllowedTransitEncryptionModesIpsecConst = "ipsec" + SharePatchAllowedTransitEncryptionModesNoneConst = "none" + SharePatchAllowedTransitEncryptionModesStunnelConst = "stunnel" ) // UnmarshalSharePatch unmarshals an instance of SharePatch from the specified map of raw messages. @@ -93093,11 +95250,21 @@ func UnmarshalSharePatch(m map[string]json.RawMessage, result interface{}) (err err = core.SDKErrorf(err, "", "access_control_mode-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "allowed_access_protocols", &obj.AllowedAccessProtocols) + if err != nil { + err = core.SDKErrorf(err, "", "allowed_access_protocols-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "allowed_transit_encryption_modes", &obj.AllowedTransitEncryptionModes) if err != nil { err = core.SDKErrorf(err, "", "allowed_transit_encryption_modes-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "bandwidth", &obj.Bandwidth) + if err != nil { + err = core.SDKErrorf(err, "", "bandwidth-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "iops", &obj.Iops) if err != nil { err = core.SDKErrorf(err, "", "iops-error", common.GetComponentInfo()) @@ -93138,9 +95305,15 @@ func (sharePatch *SharePatch) AsPatch() (_patch map[string]interface{}, err erro if !core.IsNil(sharePatch.AccessControlMode) { _patch["access_control_mode"] = sharePatch.AccessControlMode } + if !core.IsNil(sharePatch.AllowedAccessProtocols) { + _patch["allowed_access_protocols"] = sharePatch.AllowedAccessProtocols + } if !core.IsNil(sharePatch.AllowedTransitEncryptionModes) { _patch["allowed_transit_encryption_modes"] = sharePatch.AllowedTransitEncryptionModes } + if !core.IsNil(sharePatch.Bandwidth) { + _patch["bandwidth"] = sharePatch.Bandwidth + } if !core.IsNil(sharePatch.Iops) { _patch["iops"] = sharePatch.Iops } @@ -93165,6 +95338,18 @@ func (sharePatch *SharePatch) AsPatch() (_patch map[string]interface{}, err erro // ShareProfile : ShareProfile struct type ShareProfile struct { + // The possible allowed access protocols for a share with this profile. + AllowedAccessProtocols ShareProfileAllowedAccessProtocolsIntf `json:"allowed_access_protocols" validate:"required"` + + // The possible allowed transit encryption modes for a share with this profile. + AllowedTransitEncryptionModes ShareProfileAllowedTransitEncryptionModesIntf `json:"allowed_transit_encryption_modes" validate:"required"` + + // The data availability mode of a share with this profile. + AvailabilityModes ShareProfileAvailabilityModesIntf `json:"availability_modes" validate:"required"` + + // The permitted bandwidth (in megabits per second) for a share with this profile. + Bandwidth ShareProfileBandwidthIntf `json:"bandwidth" validate:"required"` + // The permitted capacity range (in gigabytes) for a share with this profile. Capacity ShareProfileCapacityIntf `json:"capacity" validate:"required"` @@ -93185,6 +95370,9 @@ type ShareProfile struct { // The resource type. ResourceType *string `json:"resource_type" validate:"required"` + + // The storage generation for a share with this profile. + StorageGeneration ShareProfileStorageGenerationIntf `json:"storage_generation" validate:"required"` } // Constants associated with the ShareProfile.Family property. @@ -93205,6 +95393,26 @@ const ( // UnmarshalShareProfile unmarshals an instance of ShareProfile from the specified map of raw messages. func UnmarshalShareProfile(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(ShareProfile) + err = core.UnmarshalModel(m, "allowed_access_protocols", &obj.AllowedAccessProtocols, UnmarshalShareProfileAllowedAccessProtocols) + if err != nil { + err = core.SDKErrorf(err, "", "allowed_access_protocols-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "allowed_transit_encryption_modes", &obj.AllowedTransitEncryptionModes, UnmarshalShareProfileAllowedTransitEncryptionModes) + if err != nil { + err = core.SDKErrorf(err, "", "allowed_transit_encryption_modes-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "availability_modes", &obj.AvailabilityModes, UnmarshalShareProfileAvailabilityModes) + if err != nil { + err = core.SDKErrorf(err, "", "availability_modes-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "bandwidth", &obj.Bandwidth, UnmarshalShareProfileBandwidth) + if err != nil { + err = core.SDKErrorf(err, "", "bandwidth-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "capacity", &obj.Capacity, UnmarshalShareProfileCapacity) if err != nil { err = core.SDKErrorf(err, "", "capacity-error", common.GetComponentInfo()) @@ -93235,6 +95443,318 @@ func UnmarshalShareProfile(m map[string]json.RawMessage, result interface{}) (er err = core.SDKErrorf(err, "", "resource_type-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "storage_generation", &obj.StorageGeneration, UnmarshalShareProfileStorageGeneration) + if err != nil { + err = core.SDKErrorf(err, "", "storage_generation-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ShareProfileAllowedAccessProtocols : ShareProfileAllowedAccessProtocols struct +// Models which "extend" this model: +// - ShareProfileAllowedAccessProtocolsSubset +type ShareProfileAllowedAccessProtocols struct { + // The default allowed access protocol modes for shares with this profile. + Default []string `json:"default,omitempty"` + + // The type for this profile field. + Type *string `json:"type,omitempty"` + + // The possible allowed access protocols for shares with this profile: + // - `nfs4`: NFSv4 will be used. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + Values []string `json:"values,omitempty"` +} + +// Constants associated with the ShareProfileAllowedAccessProtocols.Default property. +const ( + ShareProfileAllowedAccessProtocolsDefaultNfs4Const = "nfs4" +) + +// Constants associated with the ShareProfileAllowedAccessProtocols.Type property. +// The type for this profile field. +const ( + ShareProfileAllowedAccessProtocolsTypeSubsetConst = "subset" +) + +// Constants associated with the ShareProfileAllowedAccessProtocols.Values property. +const ( + ShareProfileAllowedAccessProtocolsValuesNfs4Const = "nfs4" +) + +func (*ShareProfileAllowedAccessProtocols) isaShareProfileAllowedAccessProtocols() bool { + return true +} + +type ShareProfileAllowedAccessProtocolsIntf interface { + isaShareProfileAllowedAccessProtocols() bool +} + +// UnmarshalShareProfileAllowedAccessProtocols unmarshals an instance of ShareProfileAllowedAccessProtocols from the specified map of raw messages. +func UnmarshalShareProfileAllowedAccessProtocols(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileAllowedAccessProtocols) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + err = core.SDKErrorf(err, "", "default-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + err = core.SDKErrorf(err, "", "values-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ShareProfileAllowedTransitEncryptionModes : ShareProfileAllowedTransitEncryptionModes struct +// Models which "extend" this model: +// - ShareProfileAllowedTransitEncryptionModesSubset +type ShareProfileAllowedTransitEncryptionModes struct { + // The default allowed transit encryption modes for shares with this profile. + Default []string `json:"default,omitempty"` + + // The type for this profile field. + Type *string `json:"type,omitempty"` + + // The allowed [transit encryption + // modes](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-vpc-about&interface=ui#fs-eit) for a share with this + // profile: + // - `none`: Not encrypted in transit. + // - `ipsec`: Encrypted in transit using an instance identity certificate. + // - `stunnel`: Encrypted in transit using a connection via an stunnel connection. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + Values []string `json:"values,omitempty"` +} + +// Constants associated with the ShareProfileAllowedTransitEncryptionModes.Default property. +const ( + ShareProfileAllowedTransitEncryptionModesDefaultIpsecConst = "ipsec" + ShareProfileAllowedTransitEncryptionModesDefaultNoneConst = "none" + ShareProfileAllowedTransitEncryptionModesDefaultStunnelConst = "stunnel" +) + +// Constants associated with the ShareProfileAllowedTransitEncryptionModes.Type property. +// The type for this profile field. +const ( + ShareProfileAllowedTransitEncryptionModesTypeSubsetConst = "subset" +) + +// Constants associated with the ShareProfileAllowedTransitEncryptionModes.Values property. +const ( + ShareProfileAllowedTransitEncryptionModesValuesIpsecConst = "ipsec" + ShareProfileAllowedTransitEncryptionModesValuesNoneConst = "none" + ShareProfileAllowedTransitEncryptionModesValuesStunnelConst = "stunnel" +) + +func (*ShareProfileAllowedTransitEncryptionModes) isaShareProfileAllowedTransitEncryptionModes() bool { + return true +} + +type ShareProfileAllowedTransitEncryptionModesIntf interface { + isaShareProfileAllowedTransitEncryptionModes() bool +} + +// UnmarshalShareProfileAllowedTransitEncryptionModes unmarshals an instance of ShareProfileAllowedTransitEncryptionModes from the specified map of raw messages. +func UnmarshalShareProfileAllowedTransitEncryptionModes(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileAllowedTransitEncryptionModes) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + err = core.SDKErrorf(err, "", "default-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + err = core.SDKErrorf(err, "", "values-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ShareProfileAvailabilityModes : ShareProfileAvailabilityModes struct +// Models which "extend" this model: +// - ShareProfileAvailabilityModesEnum +// - ShareProfileAvailabilityModesFixed +type ShareProfileAvailabilityModes struct { + // The default data availability mode for this profile. + Default *string `json:"default,omitempty"` + + // The type for this profile field. + Type *string `json:"type,omitempty"` + + // The data availability mode of the share: + // - `zonal`: The data availability of this share is limited only to a single zone of a + // given region as provided by the `zone` of the share. + // - `regional`: The data availability of this share covers all zones in the region where + // the share is created. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + Values []string `json:"values,omitempty"` + + // The value for this profile field. + Value *string `json:"value,omitempty"` +} + +// Constants associated with the ShareProfileAvailabilityModes.Default property. +// The default data availability mode for this profile. +const ( + ShareProfileAvailabilityModesDefaultRegionalConst = "regional" + ShareProfileAvailabilityModesDefaultZonalConst = "zonal" +) + +// Constants associated with the ShareProfileAvailabilityModes.Type property. +// The type for this profile field. +const ( + ShareProfileAvailabilityModesTypeEnumConst = "enum" +) + +// Constants associated with the ShareProfileAvailabilityModes.Values property. +const ( + ShareProfileAvailabilityModesValuesRegionalConst = "regional" + ShareProfileAvailabilityModesValuesZonalConst = "zonal" +) + +// Constants associated with the ShareProfileAvailabilityModes.Value property. +// The value for this profile field. +const ( + ShareProfileAvailabilityModesValueRegionalConst = "regional" + ShareProfileAvailabilityModesValueZonalConst = "zonal" +) + +func (*ShareProfileAvailabilityModes) isaShareProfileAvailabilityModes() bool { + return true +} + +type ShareProfileAvailabilityModesIntf interface { + isaShareProfileAvailabilityModes() bool +} + +// UnmarshalShareProfileAvailabilityModes unmarshals an instance of ShareProfileAvailabilityModes from the specified map of raw messages. +func UnmarshalShareProfileAvailabilityModes(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileAvailabilityModes) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + err = core.SDKErrorf(err, "", "default-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + err = core.SDKErrorf(err, "", "values-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ShareProfileBandwidth : ShareProfileBandwidth struct +// Models which "extend" this model: +// - ShareProfileBandwidthRange +// - ShareProfileBandwidthDependent +// - ShareProfileBandwidthFixed +// - ShareProfileBandwidthEnum +// - ShareProfileBandwidthDependentRange +type ShareProfileBandwidth struct { + // The default value for this profile field. + Default *int64 `json:"default,omitempty"` + + // The maximum value for this profile field. + Max *int64 `json:"max,omitempty"` + + // The minimum value for this profile field. + Min *int64 `json:"min,omitempty"` + + // The increment step value for this profile field. + Step *int64 `json:"step,omitempty"` + + // The type for this profile field. + Type *string `json:"type,omitempty"` + + Value *int64 `json:"value,omitempty"` + + // The permitted values for this profile field. + Values []int64 `json:"values,omitempty"` +} + +// Constants associated with the ShareProfileBandwidth.Type property. +// The type for this profile field. +const ( + ShareProfileBandwidthTypeRangeConst = "range" +) + +func (*ShareProfileBandwidth) isaShareProfileBandwidth() bool { + return true +} + +type ShareProfileBandwidthIntf interface { + isaShareProfileBandwidth() bool +} + +// UnmarshalShareProfileBandwidth unmarshals an instance of ShareProfileBandwidth from the specified map of raw messages. +func UnmarshalShareProfileBandwidth(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileBandwidth) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + err = core.SDKErrorf(err, "", "default-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + err = core.SDKErrorf(err, "", "max-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + err = core.SDKErrorf(err, "", "min-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + err = core.SDKErrorf(err, "", "step-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + err = core.SDKErrorf(err, "", "values-error", common.GetComponentInfo()) + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -93567,6 +96087,48 @@ func UnmarshalShareProfileReference(m map[string]json.RawMessage, result interfa return } +// ShareProfileStorageGeneration : ShareProfileStorageGeneration struct +// Models which "extend" this model: +// - ShareProfileStorageGenerationFixed +type ShareProfileStorageGeneration struct { + // The type for this profile field. + Type *string `json:"type,omitempty"` + + // The value for this profile field. + Value *int64 `json:"value,omitempty"` +} + +// Constants associated with the ShareProfileStorageGeneration.Type property. +// The type for this profile field. +const ( + ShareProfileStorageGenerationTypeFixedConst = "fixed" +) + +func (*ShareProfileStorageGeneration) isaShareProfileStorageGeneration() bool { + return true +} + +type ShareProfileStorageGenerationIntf interface { + isaShareProfileStorageGeneration() bool +} + +// UnmarshalShareProfileStorageGeneration unmarshals an instance of ShareProfileStorageGeneration from the specified map of raw messages. +func UnmarshalShareProfileStorageGeneration(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileStorageGeneration) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // SharePrototype : SharePrototype struct // Models which "extend" this model: // - SharePrototypeShareBySize @@ -93575,9 +96137,10 @@ func UnmarshalShareProfileReference(m map[string]json.RawMessage, result interfa // - SharePrototypeShareBySourceSnapshot type SharePrototype struct { // The transit encryption modes to allow for this share. If unspecified: - // - If share mount targets are specified, and those share mount targets all specify a - // `transit_encryption` of `user_managed`, then only `user_managed` will be allowed. - // - Otherwise, all `transit_encryption` modes will be allowed. + // - If share mount targets are specified, then only transit encryption modes + // specified by those share mount target will be allowed. + // - Otherwise, the default allowed transit encryption modes from the profile will be + // used. AllowedTransitEncryptionModes []string `json:"allowed_transit_encryption_modes,omitempty"` // The mount targets for the file share. Each mount target must be in a unique VPC. @@ -93590,6 +96153,9 @@ type SharePrototype struct { // Configuration for a replica file share to create and associate with this file share. If // unspecified, a replica may be subsequently added by creating a new file share with a // `source_share` referencing this file share. + // + // Replica file shares can only be created for shares with an `availability_mode` of + // `zonal`. ReplicaShare *SharePrototypeShareContext `json:"replica_share,omitempty"` // The tags for this resource. @@ -93604,6 +96170,22 @@ type SharePrototype struct { // Mount targets for this share require a VPC. AccessControlMode *string `json:"access_control_mode,omitempty"` + // The access protocols to allow for this share. If unspecified: + // - If share mount targets are specified, only the access protocols specified by those + // share mount target will be allowed. + // - Otherwise, the default access protocols from the profile will be used. + AllowedAccessProtocols []string `json:"allowed_access_protocols,omitempty"` + + // The maximum bandwidth (in megabits per second) for the file share. + // + // If the share profile has a `bandwidth.type` of `dependent` or `fixed`, this property is system-managed and must not + // be specified. Otherwise, the specified value must be within the `bandwidth` range of the share's profile. + // + // Provided the property is user-managed, if it is unspecified, its value will be set based on the specified [`size` + // and + // `iops`](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles&interface=api). + Bandwidth *int64 `json:"bandwidth,omitempty"` + // The root key to use to wrap the data encryption key for the share. // // If unspecified, the `encryption` type for the share will be `provider_managed`. @@ -93638,6 +96220,9 @@ type SharePrototype struct { // The zone this file share will reside in. For a replica share in the same region as // the source share, this must be a different zone from the source share. + // + // This property must be specified if the share profile `availability_mode` is `zonal`, + // and must not be specified otherwise. Zone ZoneIdentityIntf `json:"zone,omitempty"` // The cron specification for the file share replication schedule. @@ -93648,9 +96233,12 @@ type SharePrototype struct { // [increase](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. ReplicationCronSpec *string `json:"replication_cron_spec,omitempty"` - // The source file share for this replica file share. The specified file share must not - // already have a replica, and must not be a replica. If source file share is specified - // by CRN, it may be in an [associated partner + // The source file share for this replica file share. The specified file share must: + // - Not already have a replica. + // - Not be a replica. + // - Have a `storage_generation` of `1`. + // + // If source file share is specified by CRN, it may be in an [associated partner // region](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-replication). SourceShare ShareIdentityIntf `json:"source_share,omitempty"` @@ -93671,8 +96259,9 @@ type SharePrototype struct { // Constants associated with the SharePrototype.AllowedTransitEncryptionModes property. const ( - SharePrototypeAllowedTransitEncryptionModesNoneConst = "none" - SharePrototypeAllowedTransitEncryptionModesUserManagedConst = "user_managed" + SharePrototypeAllowedTransitEncryptionModesIpsecConst = "ipsec" + SharePrototypeAllowedTransitEncryptionModesNoneConst = "none" + SharePrototypeAllowedTransitEncryptionModesStunnelConst = "stunnel" ) // Constants associated with the SharePrototype.AccessControlMode property. @@ -93688,6 +96277,11 @@ const ( SharePrototypeAccessControlModeVPCConst = "vpc" ) +// Constants associated with the SharePrototype.AllowedAccessProtocols property. +const ( + SharePrototypeAllowedAccessProtocolsNfs4Const = "nfs4" +) + func (*SharePrototype) isaSharePrototype() bool { return true } @@ -93729,6 +96323,16 @@ func UnmarshalSharePrototype(m map[string]json.RawMessage, result interface{}) ( err = core.SDKErrorf(err, "", "access_control_mode-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "allowed_access_protocols", &obj.AllowedAccessProtocols) + if err != nil { + err = core.SDKErrorf(err, "", "allowed_access_protocols-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "bandwidth", &obj.Bandwidth) + if err != nil { + err = core.SDKErrorf(err, "", "bandwidth-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) if err != nil { err = core.SDKErrorf(err, "", "encryption_key-error", common.GetComponentInfo()) @@ -93791,11 +96395,15 @@ func UnmarshalSharePrototype(m map[string]json.RawMessage, result interface{}) ( // SharePrototypeShareContext : Configuration for a replica file share to create and associate with this file share. If unspecified, a replica may be // subsequently added by creating a new file share with a // `source_share` referencing this file share. +// +// Replica file shares can only be created for shares with an `availability_mode` of +// `zonal`. type SharePrototypeShareContext struct { // The transit encryption modes to allow for this share. If unspecified: - // - If share mount targets are specified, and those share mount targets all specify a - // `transit_encryption` of `user_managed`, then only `user_managed` will be allowed. - // - Otherwise, all `transit_encryption` modes will be allowed. + // - If share mount targets are specified, then only transit encryption modes + // specified by those share mount target will be allowed. + // - Otherwise, the default allowed transit encryption modes from the profile will be + // used. AllowedTransitEncryptionModes []string `json:"allowed_transit_encryption_modes,omitempty"` // The maximum input/output operations per second (IOPS) for the file share. @@ -93815,7 +96423,9 @@ type SharePrototypeShareContext struct { Name *string `json:"name,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) to use - // for this file share. The profile must support the share's specified IOPS and size. + // for this file share. The profile must: + // - support the share's specified IOPS and size, and + // - have the same `storage_generation` as the share. Profile ShareProfileIdentityIntf `json:"profile" validate:"required"` // The cron specification for the file share replication schedule. @@ -93832,21 +96442,21 @@ type SharePrototypeShareContext struct { // The zone this replica file share will reside in. For a replica share in the same // region as the source share, this must be a different zone from the source share. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` + Zone ZoneIdentityIntf `json:"zone,omitempty"` } // Constants associated with the SharePrototypeShareContext.AllowedTransitEncryptionModes property. const ( - SharePrototypeShareContextAllowedTransitEncryptionModesNoneConst = "none" - SharePrototypeShareContextAllowedTransitEncryptionModesUserManagedConst = "user_managed" + SharePrototypeShareContextAllowedTransitEncryptionModesIpsecConst = "ipsec" + SharePrototypeShareContextAllowedTransitEncryptionModesNoneConst = "none" + SharePrototypeShareContextAllowedTransitEncryptionModesStunnelConst = "stunnel" ) // NewSharePrototypeShareContext : Instantiate SharePrototypeShareContext (Generic Model Constructor) -func (*VpcV1) NewSharePrototypeShareContext(profile ShareProfileIdentityIntf, replicationCronSpec string, zone ZoneIdentityIntf) (_model *SharePrototypeShareContext, err error) { +func (*VpcV1) NewSharePrototypeShareContext(profile ShareProfileIdentityIntf, replicationCronSpec string) (_model *SharePrototypeShareContext, err error) { _model = &SharePrototypeShareContext{ Profile: profile, ReplicationCronSpec: core.StringPtr(replicationCronSpec), - Zone: zone, } err = core.ValidateStruct(_model, "required parameters") if err != nil { @@ -94130,8 +96740,9 @@ type ShareSnapshot struct { // The [user tags](https://cloud.ibm.com/apidocs/tagging#types-of-tags) associated with this share snapshot. UserTags []string `json:"user_tags" validate:"required"` - // The zone this share snapshot resides in. - Zone *ZoneReference `json:"zone" validate:"required"` + // The zone this share snapshot resides in. For shares with `availability_mode` of + // `regional`, this property will be absent. + Zone *ZoneReference `json:"zone,omitempty"` } // Constants associated with the ShareSnapshot.LifecycleState property. @@ -97679,6 +100290,54 @@ func (options *UpdateEndpointGatewayOptions) SetHeaders(param map[string]string) return options } +// UpdateEndpointGatewayResourceBindingOptions : The UpdateEndpointGatewayResourceBinding options. +type UpdateEndpointGatewayResourceBindingOptions struct { + // The endpoint gateway identifier. + EndpointGatewayID *string `json:"endpoint_gateway_id" validate:"required,ne="` + + // The resource binding identifier. + ID *string `json:"id" validate:"required,ne="` + + // The endpoint gateway resource binding patch. + EndpointGatewayResourceBindingPatch map[string]interface{} `json:"EndpointGatewayResourceBinding_patch" validate:"required"` + + // Allows users to set headers on API requests. + Headers map[string]string +} + +// NewUpdateEndpointGatewayResourceBindingOptions : Instantiate UpdateEndpointGatewayResourceBindingOptions +func (*VpcV1) NewUpdateEndpointGatewayResourceBindingOptions(endpointGatewayID string, id string, endpointGatewayResourceBindingPatch map[string]interface{}) *UpdateEndpointGatewayResourceBindingOptions { + return &UpdateEndpointGatewayResourceBindingOptions{ + EndpointGatewayID: core.StringPtr(endpointGatewayID), + ID: core.StringPtr(id), + EndpointGatewayResourceBindingPatch: endpointGatewayResourceBindingPatch, + } +} + +// SetEndpointGatewayID : Allow user to set EndpointGatewayID +func (_options *UpdateEndpointGatewayResourceBindingOptions) SetEndpointGatewayID(endpointGatewayID string) *UpdateEndpointGatewayResourceBindingOptions { + _options.EndpointGatewayID = core.StringPtr(endpointGatewayID) + return _options +} + +// SetID : Allow user to set ID +func (_options *UpdateEndpointGatewayResourceBindingOptions) SetID(id string) *UpdateEndpointGatewayResourceBindingOptions { + _options.ID = core.StringPtr(id) + return _options +} + +// SetEndpointGatewayResourceBindingPatch : Allow user to set EndpointGatewayResourceBindingPatch +func (_options *UpdateEndpointGatewayResourceBindingOptions) SetEndpointGatewayResourceBindingPatch(endpointGatewayResourceBindingPatch map[string]interface{}) *UpdateEndpointGatewayResourceBindingOptions { + _options.EndpointGatewayResourceBindingPatch = endpointGatewayResourceBindingPatch + return _options +} + +// SetHeaders : Allow user to set Headers +func (options *UpdateEndpointGatewayResourceBindingOptions) SetHeaders(param map[string]string) *UpdateEndpointGatewayResourceBindingOptions { + options.Headers = param + return options +} + // UpdateFirmwareForBareMetalServerOptions : The UpdateFirmwareForBareMetalServer options. type UpdateFirmwareForBareMetalServerOptions struct { // The bare metal server identifier. @@ -99650,6 +102309,10 @@ type UpdateVirtualNetworkInterfaceOptions struct { // The virtual network interface patch. VirtualNetworkInterfacePatch map[string]interface{} `json:"VirtualNetworkInterface_patch" validate:"required"` + // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + // Required if the request body includes an array. + IfMatch *string `json:"If-Match,omitempty"` + // Allows users to set headers on API requests. Headers map[string]string } @@ -99674,6 +102337,12 @@ func (_options *UpdateVirtualNetworkInterfaceOptions) SetVirtualNetworkInterface return _options } +// SetIfMatch : Allow user to set IfMatch +func (_options *UpdateVirtualNetworkInterfaceOptions) SetIfMatch(ifMatch string) *UpdateVirtualNetworkInterfaceOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options +} + // SetHeaders : Allow user to set Headers func (options *UpdateVirtualNetworkInterfaceOptions) SetHeaders(param map[string]string) *UpdateVirtualNetworkInterfaceOptions { options.Headers = param @@ -100047,6 +102716,10 @@ type UpdateVPNGatewayConnectionOptions struct { // The VPN gateway connection patch. VPNGatewayConnectionPatch map[string]interface{} `json:"VPNGatewayConnection_patch" validate:"required"` + // If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + // Required if the request body includes an array. + IfMatch *string `json:"If-Match,omitempty"` + // Allows users to set headers on API requests. Headers map[string]string } @@ -100078,6 +102751,12 @@ func (_options *UpdateVPNGatewayConnectionOptions) SetVPNGatewayConnectionPatch( return _options } +// SetIfMatch : Allow user to set IfMatch +func (_options *UpdateVPNGatewayConnectionOptions) SetIfMatch(ifMatch string) *UpdateVPNGatewayConnectionOptions { + _options.IfMatch = core.StringPtr(ifMatch) + return _options +} + // SetHeaders : Allow user to set Headers func (options *UpdateVPNGatewayConnectionOptions) SetHeaders(param map[string]string) *UpdateVPNGatewayConnectionOptions { options.Headers = param @@ -100296,7 +102975,7 @@ type VPC struct { // // The maximum number of items for this property may // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. - CseSourceIps []VpccseSourceIP `json:"cse_source_ips,omitempty"` + CseSourceIps []VpccseSourceIP `json:"cse_source_ips" validate:"required"` // The default network ACL to use for subnets created in this VPC. DefaultNetworkACL *NetworkACLReference `json:"default_network_acl" validate:"required"` @@ -101763,6 +104442,13 @@ type VPNGateway struct { // The mode for this VPN gateway. Mode *string `json:"mode,omitempty"` + + // The static CIDRs advertised through any enabled routing protocol (for example, BGP). The routing protocol will + // advertise routes with these CIDRs as route destinations. + AdvertisedCIDRs []string `json:"advertised_cidrs,omitempty"` + + // The local autonomous system number (ASN) for this VPN gateway and its connections. + LocalAsn *int64 `json:"local_asn,omitempty"` } // Constants associated with the VPNGateway.HealthState property. @@ -101895,6 +104581,35 @@ func UnmarshalVPNGateway(m map[string]json.RawMessage, result interface{}) (err err = core.SDKErrorf(err, "", "mode-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "advertised_cidrs", &obj.AdvertisedCIDRs) + if err != nil { + err = core.SDKErrorf(err, "", "advertised_cidrs-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "local_asn", &obj.LocalAsn) + if err != nil { + err = core.SDKErrorf(err, "", "local_asn-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayAdvertisedCIDRCollection : VPNGatewayAdvertisedCIDRCollection struct +type VPNGatewayAdvertisedCIDRCollection struct { + // The static CIDRs advertised through any enabled routing protocol (for example, BGP). The routing protocol will + // advertise routes with these CIDRs as route destinations. + AdvertisedCIDRs []string `json:"advertised_cidrs" validate:"required"` +} + +// UnmarshalVPNGatewayAdvertisedCIDRCollection unmarshals an instance of VPNGatewayAdvertisedCIDRCollection from the specified map of raw messages. +func UnmarshalVPNGatewayAdvertisedCIDRCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayAdvertisedCIDRCollection) + err = core.UnmarshalPrimitive(m, "advertised_cidrs", &obj.AdvertisedCIDRs) + if err != nil { + err = core.SDKErrorf(err, "", "advertised_cidrs-error", common.GetComponentInfo()) + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -102364,6 +105079,269 @@ func UnmarshalVPNGatewayConnectionDpdPrototype(m map[string]json.RawMessage, res return } +// VPNGatewayConnectionDynamicRouteModeLocal : VPNGatewayConnectionDynamicRouteModeLocal struct +type VPNGatewayConnectionDynamicRouteModeLocal struct { + // The local IKE identities. + // + // A VPN gateway in dynamic route mode consists of two members in active-active mode. The first identity applies to the + // first member, and the second identity applies to the second member. + IkeIdentities []VPNGatewayConnectionIkeIdentityIntf `json:"ike_identities" validate:"required"` +} + +// UnmarshalVPNGatewayConnectionDynamicRouteModeLocal unmarshals an instance of VPNGatewayConnectionDynamicRouteModeLocal from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionDynamicRouteModeLocal(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionDynamicRouteModeLocal) + err = core.UnmarshalModel(m, "ike_identities", &obj.IkeIdentities, UnmarshalVPNGatewayConnectionIkeIdentity) + if err != nil { + err = core.SDKErrorf(err, "", "ike_identities-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayConnectionDynamicRouteModeLocalPrototype : VPNGatewayConnectionDynamicRouteModeLocalPrototype struct +type VPNGatewayConnectionDynamicRouteModeLocalPrototype struct { + // The local IKE identities to use. + // + // A VPN gateway in dynamic route mode consists of two members in active-active mode. The first specified identity will + // be applied to the first member, and the second specified identity will be applied to the second member. + // + // If unspecified, then `type` will be `ipv4_address` and `value` will be the public IP address of the member's VPN + // connection tunnel. + IkeIdentities []VPNGatewayConnectionIkeIdentityPrototypeIntf `json:"ike_identities,omitempty"` +} + +// UnmarshalVPNGatewayConnectionDynamicRouteModeLocalPrototype unmarshals an instance of VPNGatewayConnectionDynamicRouteModeLocalPrototype from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionDynamicRouteModeLocalPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionDynamicRouteModeLocalPrototype) + err = core.UnmarshalModel(m, "ike_identities", &obj.IkeIdentities, UnmarshalVPNGatewayConnectionIkeIdentityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "ike_identities-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayConnectionDynamicRouteModePeer : VPNGatewayConnectionDynamicRouteModePeer struct +// Models which "extend" this model: +// - VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddress +// - VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFqdn +type VPNGatewayConnectionDynamicRouteModePeer struct { + // The peer autonomous system number (ASN) for this VPN gateway connection. + Asn *int64 `json:"asn" validate:"required"` + + // The peer IKE identity. + IkeIdentity VPNGatewayConnectionIkeIdentityIntf `json:"ike_identity" validate:"required"` + + // Indicates whether `peer.address` or `peer.fqdn` is used. + Type *string `json:"type" validate:"required"` + + // The IP address of the peer VPN gateway for this connection. + Address *string `json:"address,omitempty"` + + // The FQDN of the peer VPN gateway for this connection. + Fqdn *string `json:"fqdn,omitempty"` +} + +// Constants associated with the VPNGatewayConnectionDynamicRouteModePeer.Type property. +// Indicates whether `peer.address` or `peer.fqdn` is used. +const ( + VPNGatewayConnectionDynamicRouteModePeerTypeAddressConst = "address" + VPNGatewayConnectionDynamicRouteModePeerTypeFqdnConst = "fqdn" +) + +func (*VPNGatewayConnectionDynamicRouteModePeer) isaVPNGatewayConnectionDynamicRouteModePeer() bool { + return true +} + +type VPNGatewayConnectionDynamicRouteModePeerIntf interface { + isaVPNGatewayConnectionDynamicRouteModePeer() bool +} + +// UnmarshalVPNGatewayConnectionDynamicRouteModePeer unmarshals an instance of VPNGatewayConnectionDynamicRouteModePeer from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionDynamicRouteModePeer(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionDynamicRouteModePeer) + err = core.UnmarshalPrimitive(m, "asn", &obj.Asn) + if err != nil { + err = core.SDKErrorf(err, "", "asn-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "ike_identity", &obj.IkeIdentity, UnmarshalVPNGatewayConnectionIkeIdentity) + if err != nil { + err = core.SDKErrorf(err, "", "ike_identity-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "address", &obj.Address) + if err != nil { + err = core.SDKErrorf(err, "", "address-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "fqdn", &obj.Fqdn) + if err != nil { + err = core.SDKErrorf(err, "", "fqdn-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayConnectionDynamicRouteModePeerPrototype : VPNGatewayConnectionDynamicRouteModePeerPrototype struct +// Models which "extend" this model: +// - VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress +// - VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn +type VPNGatewayConnectionDynamicRouteModePeerPrototype struct { + // The peer autonomous system number (ASN) for this VPN gateway connection. The ASN values in the + // [restricted ASN list]( + // https://cloud.ibm.com/docs/vpc?topic=vpc-planning-considerations-vpn#dynamic-route-based-considerations) are + // reserved and unavailable. + Asn *int64 `json:"asn" validate:"required"` + + // The peer IKE identity to use. + // + // If unspecified: + // - If `peer.address` is specified, the `type` will be `ipv4_address`, and + // the `value` will be `peer.address`. + // - If `peer.fqdn` is specified, the `type` will be `fqdn`, and the `value` + // will be `peer.fqdn`. + IkeIdentity VPNGatewayConnectionIkeIdentityPrototypeIntf `json:"ike_identity,omitempty"` + + // The IP address of the peer VPN gateway for this connection. + Address *string `json:"address,omitempty"` + + // The FQDN of the peer VPN gateway for this connection. + Fqdn *string `json:"fqdn,omitempty"` +} + +func (*VPNGatewayConnectionDynamicRouteModePeerPrototype) isaVPNGatewayConnectionDynamicRouteModePeerPrototype() bool { + return true +} + +type VPNGatewayConnectionDynamicRouteModePeerPrototypeIntf interface { + isaVPNGatewayConnectionDynamicRouteModePeerPrototype() bool +} + +// UnmarshalVPNGatewayConnectionDynamicRouteModePeerPrototype unmarshals an instance of VPNGatewayConnectionDynamicRouteModePeerPrototype from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionDynamicRouteModePeerPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionDynamicRouteModePeerPrototype) + err = core.UnmarshalPrimitive(m, "asn", &obj.Asn) + if err != nil { + err = core.SDKErrorf(err, "", "asn-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "ike_identity", &obj.IkeIdentity, UnmarshalVPNGatewayConnectionIkeIdentityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "ike_identity-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "address", &obj.Address) + if err != nil { + err = core.SDKErrorf(err, "", "address-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "fqdn", &obj.Fqdn) + if err != nil { + err = core.SDKErrorf(err, "", "fqdn-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayConnectionDynamicRouteModeTunnel : VPNGatewayConnectionDynamicRouteModeTunnel struct +type VPNGatewayConnectionDynamicRouteModeTunnel struct { + // The IP address of the neighbor on the virtual tunnel interface. + // This serves as the destination address for BGP peering sessions on the peer gateway + // within the tunnel. + NeighborIP *IP `json:"neighbor_ip" validate:"required"` + + // BGP routing protocol state as defined in + // [RFC 4721](https://www.rfc-editor.org/rfc/rfc4271#section-8.2.2). + ProtocolState *string `json:"protocol_state" validate:"required"` + + // The IP address of the VPN gateway member in which the tunnel resides. + PublicIP *IP `json:"public_ip" validate:"required"` + + // The status of the VPN Tunnel. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + Status *string `json:"status" validate:"required"` + + // The reasons for the current status (if any). + StatusReasons []VPNGatewayConnectionTunnelStatusReason `json:"status_reasons" validate:"required"` + + // The IP address assigned to the VPN gateway's virtual tunnel interface. + // This serves as the source address for BGP peering sessions initiated from the VPN + // gateway towards the peer gateway within the tunnel. + TunnelInterfaceIP *IP `json:"tunnel_interface_ip" validate:"required"` +} + +// Constants associated with the VPNGatewayConnectionDynamicRouteModeTunnel.ProtocolState property. +// BGP routing protocol state as defined in +// [RFC 4721](https://www.rfc-editor.org/rfc/rfc4271#section-8.2.2). +const ( + VPNGatewayConnectionDynamicRouteModeTunnelProtocolStateActiveConst = "active" + VPNGatewayConnectionDynamicRouteModeTunnelProtocolStateConnectConst = "connect" + VPNGatewayConnectionDynamicRouteModeTunnelProtocolStateEstablishedConst = "established" + VPNGatewayConnectionDynamicRouteModeTunnelProtocolStateIdleConst = "idle" + VPNGatewayConnectionDynamicRouteModeTunnelProtocolStateOpenConfirmConst = "open_confirm" + VPNGatewayConnectionDynamicRouteModeTunnelProtocolStateOpenSentConst = "open_sent" +) + +// Constants associated with the VPNGatewayConnectionDynamicRouteModeTunnel.Status property. +// The status of the VPN Tunnel. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. +const ( + VPNGatewayConnectionDynamicRouteModeTunnelStatusDownConst = "down" + VPNGatewayConnectionDynamicRouteModeTunnelStatusUpConst = "up" +) + +// UnmarshalVPNGatewayConnectionDynamicRouteModeTunnel unmarshals an instance of VPNGatewayConnectionDynamicRouteModeTunnel from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionDynamicRouteModeTunnel(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionDynamicRouteModeTunnel) + err = core.UnmarshalModel(m, "neighbor_ip", &obj.NeighborIP, UnmarshalIP) + if err != nil { + err = core.SDKErrorf(err, "", "neighbor_ip-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "protocol_state", &obj.ProtocolState) + if err != nil { + err = core.SDKErrorf(err, "", "protocol_state-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "public_ip", &obj.PublicIP, UnmarshalIP) + if err != nil { + err = core.SDKErrorf(err, "", "public_ip-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalVPNGatewayConnectionTunnelStatusReason) + if err != nil { + err = core.SDKErrorf(err, "", "status_reasons-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "tunnel_interface_ip", &obj.TunnelInterfaceIP, UnmarshalIP) + if err != nil { + err = core.SDKErrorf(err, "", "tunnel_interface_ip-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // VPNGatewayConnectionIkeIdentity : VPNGatewayConnectionIkeIdentity struct // Models which "extend" this model: // - VPNGatewayConnectionIkeIdentityVPNGatewayConnectionIkeIdentityFqdn @@ -102687,6 +105665,16 @@ type VPNGatewayConnectionPatch struct { // The pre-shared key. Psk *string `json:"psk,omitempty"` + + // The routing protocol for this VPN gateway connection. For this property to be specified, `mode` must be `route`. + // + // - `none`: No routing protocol will be used. + // - `bgp`: The BGP routing protocol will be used. + RoutingProtocol *string `json:"routing_protocol,omitempty"` + + // The VPN tunnel configuration to use for this VPN gateway connection + // (in dynamic route mode). + Tunnels []VPNGatewayConnectionTunnel `json:"tunnels,omitempty"` } // Constants associated with the VPNGatewayConnectionPatch.EstablishMode property. @@ -102702,6 +105690,16 @@ const ( VPNGatewayConnectionPatchEstablishModePeerOnlyConst = "peer_only" ) +// Constants associated with the VPNGatewayConnectionPatch.RoutingProtocol property. +// The routing protocol for this VPN gateway connection. For this property to be specified, `mode` must be `route`. +// +// - `none`: No routing protocol will be used. +// - `bgp`: The BGP routing protocol will be used. +const ( + VPNGatewayConnectionPatchRoutingProtocolBgpConst = "bgp" + VPNGatewayConnectionPatchRoutingProtocolNoneConst = "none" +) + // UnmarshalVPNGatewayConnectionPatch unmarshals an instance of VPNGatewayConnectionPatch from the specified map of raw messages. func UnmarshalVPNGatewayConnectionPatch(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(VPNGatewayConnectionPatch) @@ -102750,6 +105748,16 @@ func UnmarshalVPNGatewayConnectionPatch(m map[string]json.RawMessage, result int err = core.SDKErrorf(err, "", "psk-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "routing_protocol", &obj.RoutingProtocol) + if err != nil { + err = core.SDKErrorf(err, "", "routing_protocol-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "tunnels", &obj.Tunnels, UnmarshalVPNGatewayConnectionTunnel) + if err != nil { + err = core.SDKErrorf(err, "", "tunnels-error", common.GetComponentInfo()) + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -102784,6 +105792,16 @@ func (vpnGatewayConnectionPatch *VPNGatewayConnectionPatch) AsPatch() (_patch ma if !core.IsNil(vpnGatewayConnectionPatch.Psk) { _patch["psk"] = vpnGatewayConnectionPatch.Psk } + if !core.IsNil(vpnGatewayConnectionPatch.RoutingProtocol) { + _patch["routing_protocol"] = vpnGatewayConnectionPatch.RoutingProtocol + } + if !core.IsNil(vpnGatewayConnectionPatch.Tunnels) { + var tunnelsPatches []map[string]interface{} + for _, tunnels := range vpnGatewayConnectionPatch.Tunnels { + tunnelsPatches = append(tunnelsPatches, tunnels.asPatch()) + } + _patch["tunnels"] = tunnelsPatches + } return } @@ -102792,12 +105810,19 @@ func (vpnGatewayConnectionPatch *VPNGatewayConnectionPatch) AsPatch() (_patch ma // Models which "extend" this model: // - VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch // - VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatch +// - VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch type VPNGatewayConnectionPeerPatch struct { // The IP address of the peer VPN gateway for this connection. Address *string `json:"address,omitempty"` // The FQDN of the peer VPN gateway for this connection. Fqdn *string `json:"fqdn,omitempty"` + + // The peer autonomous system number (ASN) for this VPN gateway connection. The ASN values in the + // [restricted ASN list]( + // https://cloud.ibm.com/docs/vpc?topic=vpc-planning-considerations-vpn#dynamic-route-based-considerations) are + // reserved and unavailable. + Asn *int64 `json:"asn,omitempty"` } func (*VPNGatewayConnectionPeerPatch) isaVPNGatewayConnectionPeerPatch() bool { @@ -102822,6 +105847,11 @@ func UnmarshalVPNGatewayConnectionPeerPatch(m map[string]json.RawMessage, result err = core.SDKErrorf(err, "", "fqdn-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "asn", &obj.Asn) + if err != nil { + err = core.SDKErrorf(err, "", "asn-error", common.GetComponentInfo()) + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -102835,6 +105865,9 @@ func (vpnGatewayConnectionPeerPatch *VPNGatewayConnectionPeerPatch) asPatch() (_ if !core.IsNil(vpnGatewayConnectionPeerPatch.Fqdn) { _patch["fqdn"] = vpnGatewayConnectionPeerPatch.Fqdn } + if !core.IsNil(vpnGatewayConnectionPeerPatch.Asn) { + _patch["asn"] = vpnGatewayConnectionPeerPatch.Asn + } return } @@ -103041,6 +106074,7 @@ func UnmarshalVPNGatewayConnectionPolicyModePeerPrototype(m map[string]json.RawM // VPNGatewayConnectionPrototype : VPNGatewayConnectionPrototype struct // Models which "extend" this model: // - VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype +// - VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype // - VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype type VPNGatewayConnectionPrototype struct { // If set to false, the VPN gateway connection is shut down. @@ -103086,6 +106120,10 @@ type VPNGatewayConnectionPrototype struct { // The routing protocol for this VPN gateway connection. RoutingProtocol *string `json:"routing_protocol,omitempty"` + + // The VPN tunnel configuration to use for this VPN gateway connection + // (in dynamic route mode). + Tunnels []VPNGatewayConnectionTunnelPrototype `json:"tunnels,omitempty"` } // Constants associated with the VPNGatewayConnectionPrototype.EstablishMode property. @@ -103173,6 +106211,11 @@ func UnmarshalVPNGatewayConnectionPrototype(m map[string]json.RawMessage, result err = core.SDKErrorf(err, "", "routing_protocol-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "tunnels", &obj.Tunnels, UnmarshalVPNGatewayConnectionTunnelPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "tunnels-error", common.GetComponentInfo()) + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -103489,6 +106532,92 @@ func UnmarshalVPNGatewayConnectionStatusReason(m map[string]json.RawMessage, res return } +// VPNGatewayConnectionTunnel : VPNGatewayConnectionTunnel struct +type VPNGatewayConnectionTunnel struct { + // The IP address of the neighbor on the virtual tunnel interface. + // This serves as the destination address for BGP peering sessions on the peer gateway + // within the tunnel. + NeighborIP *IP `json:"neighbor_ip,omitempty"` + + // The IP address assigned to the VPN gateway's virtual tunnel interface. + // This serves as the source address for BGP peering sessions initiated from the VPN + // gateway towards the peer gateway within the tunnel. + TunnelInterfaceIP *IP `json:"tunnel_interface_ip,omitempty"` +} + +// UnmarshalVPNGatewayConnectionTunnel unmarshals an instance of VPNGatewayConnectionTunnel from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionTunnel(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionTunnel) + err = core.UnmarshalModel(m, "neighbor_ip", &obj.NeighborIP, UnmarshalIP) + if err != nil { + err = core.SDKErrorf(err, "", "neighbor_ip-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "tunnel_interface_ip", &obj.TunnelInterfaceIP, UnmarshalIP) + if err != nil { + err = core.SDKErrorf(err, "", "tunnel_interface_ip-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// asPatch returns a generic map representation of the VPNGatewayConnectionTunnel +func (vpnGatewayConnectionTunnel *VPNGatewayConnectionTunnel) asPatch() (_patch map[string]interface{}) { + _patch = map[string]interface{}{} + if !core.IsNil(vpnGatewayConnectionTunnel.NeighborIP) { + _patch["neighbor_ip"] = vpnGatewayConnectionTunnel.NeighborIP.asPatch() + } + if !core.IsNil(vpnGatewayConnectionTunnel.TunnelInterfaceIP) { + _patch["tunnel_interface_ip"] = vpnGatewayConnectionTunnel.TunnelInterfaceIP.asPatch() + } + + return +} + +// VPNGatewayConnectionTunnelPrototype : VPNGatewayConnectionTunnelPrototype struct +type VPNGatewayConnectionTunnelPrototype struct { + // The IP address of the neighbor on the virtual tunnel interface. + // This serves as the destination address for BGP peering sessions on the peer gateway + // within the tunnel. + NeighborIP *IP `json:"neighbor_ip" validate:"required"` + + // The IP address assigned to the VPN gateway's virtual tunnel interface. + // This serves as the source address for BGP peering sessions initiated from the VPN + // gateway towards the peer gateway within the tunnel. + TunnelInterfaceIP *IP `json:"tunnel_interface_ip" validate:"required"` +} + +// NewVPNGatewayConnectionTunnelPrototype : Instantiate VPNGatewayConnectionTunnelPrototype (Generic Model Constructor) +func (*VpcV1) NewVPNGatewayConnectionTunnelPrototype(neighborIP *IP, tunnelInterfaceIP *IP) (_model *VPNGatewayConnectionTunnelPrototype, err error) { + _model = &VPNGatewayConnectionTunnelPrototype{ + NeighborIP: neighborIP, + TunnelInterfaceIP: tunnelInterfaceIP, + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +// UnmarshalVPNGatewayConnectionTunnelPrototype unmarshals an instance of VPNGatewayConnectionTunnelPrototype from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionTunnelPrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionTunnelPrototype) + err = core.UnmarshalModel(m, "neighbor_ip", &obj.NeighborIP, UnmarshalIP) + if err != nil { + err = core.SDKErrorf(err, "", "neighbor_ip-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "tunnel_interface_ip", &obj.TunnelInterfaceIP, UnmarshalIP) + if err != nil { + err = core.SDKErrorf(err, "", "tunnel_interface_ip-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // VPNGatewayConnectionTunnelStatusReason : VPNGatewayConnectionTunnelStatusReason struct type VPNGatewayConnectionTunnelStatusReason struct { // A reason code for this status: @@ -103900,6 +107029,12 @@ func UnmarshalVPNGatewayMemberLifecycleReason(m map[string]json.RawMessage, resu // VPNGatewayPatch : VPNGatewayPatch struct type VPNGatewayPatch struct { + // The local autonomous system number (ASN) for this VPN gateway and its connections. The ASN values in the + // [restricted ASN list]( + // https://cloud.ibm.com/docs/vpc?topic=vpc-planning-considerations-vpn#dynamic-route-based-considerations) are + // reserved and unavailable. + LocalAsn *int64 `json:"local_asn,omitempty"` + // The name for this VPN gateway. The name must not be used by another VPN gateway in the VPC. Name *string `json:"name,omitempty"` } @@ -103907,6 +107042,11 @@ type VPNGatewayPatch struct { // UnmarshalVPNGatewayPatch unmarshals an instance of VPNGatewayPatch from the specified map of raw messages. func UnmarshalVPNGatewayPatch(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(VPNGatewayPatch) + err = core.UnmarshalPrimitive(m, "local_asn", &obj.LocalAsn) + if err != nil { + err = core.SDKErrorf(err, "", "local_asn-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) @@ -103919,6 +107059,9 @@ func UnmarshalVPNGatewayPatch(m map[string]json.RawMessage, result interface{}) // AsPatch returns a generic map representation of the VPNGatewayPatch func (vpnGatewayPatch *VPNGatewayPatch) AsPatch() (_patch map[string]interface{}, err error) { _patch = map[string]interface{}{} + if !core.IsNil(vpnGatewayPatch.LocalAsn) { + _patch["local_asn"] = vpnGatewayPatch.LocalAsn + } if !core.IsNil(vpnGatewayPatch.Name) { _patch["name"] = vpnGatewayPatch.Name } @@ -103942,6 +107085,16 @@ type VPNGatewayPrototype struct { // Identifies a subnet by a unique property. Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` + // The static CIDRs advertised through any enabled routing protocol (for example, BGP). The routing protocol will + // advertise routes with these CIDRs as route destinations. + AdvertisedCIDRs []string `json:"advertised_cidrs,omitempty"` + + // The local autonomous system number (ASN) for this VPN gateway and its connections. The ASN values in the + // [restricted ASN list]( + // https://cloud.ibm.com/docs/vpc?topic=vpc-planning-considerations-vpn#dynamic-route-based-considerations) are + // reserved and unavailable. + LocalAsn *int64 `json:"local_asn,omitempty"` + // The mode for this VPN gateway. Mode *string `json:"mode,omitempty"` } @@ -103978,6 +107131,16 @@ func UnmarshalVPNGatewayPrototype(m map[string]json.RawMessage, result interface err = core.SDKErrorf(err, "", "subnet-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "advertised_cidrs", &obj.AdvertisedCIDRs) + if err != nil { + err = core.SDKErrorf(err, "", "advertised_cidrs-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "local_asn", &obj.LocalAsn) + if err != nil { + err = core.SDKErrorf(err, "", "local_asn-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) if err != nil { err = core.SDKErrorf(err, "", "mode-error", common.GetComponentInfo()) @@ -103987,6 +107150,311 @@ func UnmarshalVPNGatewayPrototype(m map[string]json.RawMessage, result interface return } +// VPNGatewayServiceConnection : VPNGatewayServiceConnection struct +type VPNGatewayServiceConnection struct { + // The date and time that this VPN gateway service connection was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + Creator VPNGatewayServiceConnectionCreatorIntf `json:"creator" validate:"required"` + + // The unique identifier for this VPN gateway service connection. + ID *string `json:"id" validate:"required"` + + // The reasons for the current `lifecycle_state` (if any). + LifecycleReasons []VPNGatewayServiceConnectionLifecycleReason `json:"lifecycle_reasons" validate:"required"` + + // The lifecycle state of the VPN gateway service connection. + LifecycleState *string `json:"lifecycle_state" validate:"required"` + + // The status of this VPN gateway service connection: + // - `degraded`: operating with compromised performance. + // - `down`: not operational. + // - `up`: operating normally. + Status *string `json:"status" validate:"required"` + + // The reasons for the current VPN gateway service connection status (if any). + StatusReasons []VPNGatewayServiceConnectionStatusReason `json:"status_reasons" validate:"required"` +} + +// Constants associated with the VPNGatewayServiceConnection.LifecycleState property. +// The lifecycle state of the VPN gateway service connection. +const ( + VPNGatewayServiceConnectionLifecycleStateDeletingConst = "deleting" + VPNGatewayServiceConnectionLifecycleStateFailedConst = "failed" + VPNGatewayServiceConnectionLifecycleStatePendingConst = "pending" + VPNGatewayServiceConnectionLifecycleStateStableConst = "stable" + VPNGatewayServiceConnectionLifecycleStateSuspendedConst = "suspended" + VPNGatewayServiceConnectionLifecycleStateUpdatingConst = "updating" + VPNGatewayServiceConnectionLifecycleStateWaitingConst = "waiting" +) + +// Constants associated with the VPNGatewayServiceConnection.Status property. +// The status of this VPN gateway service connection: +// - `degraded`: operating with compromised performance. +// - `down`: not operational. +// - `up`: operating normally. +const ( + VPNGatewayServiceConnectionStatusDegradedConst = "degraded" + VPNGatewayServiceConnectionStatusDownConst = "down" + VPNGatewayServiceConnectionStatusUpConst = "up" +) + +// UnmarshalVPNGatewayServiceConnection unmarshals an instance of VPNGatewayServiceConnection from the specified map of raw messages. +func UnmarshalVPNGatewayServiceConnection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayServiceConnection) + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "creator", &obj.Creator, UnmarshalVPNGatewayServiceConnectionCreator) + if err != nil { + err = core.SDKErrorf(err, "", "creator-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "lifecycle_reasons", &obj.LifecycleReasons, UnmarshalVPNGatewayServiceConnectionLifecycleReason) + if err != nil { + err = core.SDKErrorf(err, "", "lifecycle_reasons-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "lifecycle_state", &obj.LifecycleState) + if err != nil { + err = core.SDKErrorf(err, "", "lifecycle_state-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalVPNGatewayServiceConnectionStatusReason) + if err != nil { + err = core.SDKErrorf(err, "", "status_reasons-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayServiceConnectionCollection : VPNGatewayServiceConnectionCollection struct +type VPNGatewayServiceConnectionCollection struct { + // A link to the first page of resources. + First *PageLink `json:"first" validate:"required"` + + // The maximum number of resources that can be returned by the request. + Limit *int64 `json:"limit" validate:"required"` + + // A link to the next page of resources. This property is present for all pages + // except the last page. + Next *PageLink `json:"next,omitempty"` + + // A page of service connections for the VPN gateway. + ServiceConnections []VPNGatewayServiceConnection `json:"service_connections" validate:"required"` + + // The total number of resources across all pages. + TotalCount *int64 `json:"total_count" validate:"required"` +} + +// UnmarshalVPNGatewayServiceConnectionCollection unmarshals an instance of VPNGatewayServiceConnectionCollection from the specified map of raw messages. +func UnmarshalVPNGatewayServiceConnectionCollection(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayServiceConnectionCollection) + err = core.UnmarshalModel(m, "first", &obj.First, UnmarshalPageLink) + if err != nil { + err = core.SDKErrorf(err, "", "first-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "limit", &obj.Limit) + if err != nil { + err = core.SDKErrorf(err, "", "limit-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "next", &obj.Next, UnmarshalPageLink) + if err != nil { + err = core.SDKErrorf(err, "", "next-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "service_connections", &obj.ServiceConnections, UnmarshalVPNGatewayServiceConnection) + if err != nil { + err = core.SDKErrorf(err, "", "service_connections-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "total_count", &obj.TotalCount) + if err != nil { + err = core.SDKErrorf(err, "", "total_count-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// Retrieve the value to be passed to a request to access the next page of results +func (resp *VPNGatewayServiceConnectionCollection) GetNextStart() (*string, error) { + if core.IsNil(resp.Next) { + return nil, nil + } + start, err := core.GetQueryParam(resp.Next.Href, "start") + if err != nil { + err = core.SDKErrorf(err, "", "read-query-param-error", common.GetComponentInfo()) + return nil, err + } else if start == nil { + return nil, nil + } + return start, nil +} + +// VPNGatewayServiceConnectionCreator : VPNGatewayServiceConnectionCreator struct +// Models which "extend" this model: +// - VPNGatewayServiceConnectionCreatorTransitGatewayReference +type VPNGatewayServiceConnectionCreator struct { + // The CRN for this transit gateway. + CRN *string `json:"crn,omitempty"` + + // The unique identifier for this transit gateway. + ID *string `json:"id,omitempty"` + + // The resource type. + ResourceType *string `json:"resource_type,omitempty"` +} + +// Constants associated with the VPNGatewayServiceConnectionCreator.ResourceType property. +// The resource type. +const ( + VPNGatewayServiceConnectionCreatorResourceTypeTransitGatewayConst = "transit_gateway" +) + +func (*VPNGatewayServiceConnectionCreator) isaVPNGatewayServiceConnectionCreator() bool { + return true +} + +type VPNGatewayServiceConnectionCreatorIntf interface { + isaVPNGatewayServiceConnectionCreator() bool +} + +// UnmarshalVPNGatewayServiceConnectionCreator unmarshals an instance of VPNGatewayServiceConnectionCreator from the specified map of raw messages. +func UnmarshalVPNGatewayServiceConnectionCreator(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayServiceConnectionCreator) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + err = core.SDKErrorf(err, "", "crn-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + err = core.SDKErrorf(err, "", "resource_type-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayServiceConnectionLifecycleReason : VPNGatewayServiceConnectionLifecycleReason struct +type VPNGatewayServiceConnectionLifecycleReason struct { + // A reason code for this lifecycle state: + // - `internal_error`: internal error (contact IBM support) + // - `resource_suspended_by_provider`: The resource has been suspended (contact IBM + // support) + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + Code *string `json:"code" validate:"required"` + + // An explanation of the reason for this lifecycle state. + Message *string `json:"message" validate:"required"` + + // A link to documentation about the reason for this lifecycle state. + MoreInfo *string `json:"more_info,omitempty"` +} + +// Constants associated with the VPNGatewayServiceConnectionLifecycleReason.Code property. +// A reason code for this lifecycle state: +// - `internal_error`: internal error (contact IBM support) +// - `resource_suspended_by_provider`: The resource has been suspended (contact IBM +// support) +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. +const ( + VPNGatewayServiceConnectionLifecycleReasonCodeInternalErrorConst = "internal_error" + VPNGatewayServiceConnectionLifecycleReasonCodeResourceSuspendedByProviderConst = "resource_suspended_by_provider" +) + +// UnmarshalVPNGatewayServiceConnectionLifecycleReason unmarshals an instance of VPNGatewayServiceConnectionLifecycleReason from the specified map of raw messages. +func UnmarshalVPNGatewayServiceConnectionLifecycleReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayServiceConnectionLifecycleReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + err = core.SDKErrorf(err, "", "code-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + err = core.SDKErrorf(err, "", "message-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + err = core.SDKErrorf(err, "", "more_info-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayServiceConnectionStatusReason : VPNGatewayServiceConnectionStatusReason struct +type VPNGatewayServiceConnectionStatusReason struct { + // The reasons for the current VPN gateway service connection status (if any). + // - `internal_error` + // - `peer_not_responding`. + Code *string `json:"code" validate:"required"` + + // An explanation of the reason for this VPN gateway service connection's status. + Message *string `json:"message" validate:"required"` + + // A link to documentation about this status reason. + MoreInfo *string `json:"more_info,omitempty"` +} + +// Constants associated with the VPNGatewayServiceConnectionStatusReason.Code property. +// The reasons for the current VPN gateway service connection status (if any). +// - `internal_error` +// - `peer_not_responding`. +const ( + VPNGatewayServiceConnectionStatusReasonCodeInternalErrorConst = "internal_error" + VPNGatewayServiceConnectionStatusReasonCodePeerNotRespondingConst = "peer_not_responding" +) + +// UnmarshalVPNGatewayServiceConnectionStatusReason unmarshals an instance of VPNGatewayServiceConnectionStatusReason from the specified map of raw messages. +func UnmarshalVPNGatewayServiceConnectionStatusReason(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayServiceConnectionStatusReason) + err = core.UnmarshalPrimitive(m, "code", &obj.Code) + if err != nil { + err = core.SDKErrorf(err, "", "code-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "message", &obj.Message) + if err != nil { + err = core.SDKErrorf(err, "", "message-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "more_info", &obj.MoreInfo) + if err != nil { + err = core.SDKErrorf(err, "", "more_info-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // VPNServer : VPNServer struct type VPNServer struct { // The certificate instance for this VPN server. @@ -115830,6 +119298,62 @@ func UnmarshalEndpointGatewayReservedIPReservedIPPrototypeTargetContext(m map[st return } +// EndpointGatewayResourceBindingTargetCRN : The CRN for the resource targeted by this resource binding. +// This model "extends" EndpointGatewayResourceBindingTarget +type EndpointGatewayResourceBindingTargetCRN struct { + CRN *string `json:"crn" validate:"required"` +} + +func (*EndpointGatewayResourceBindingTargetCRN) isaEndpointGatewayResourceBindingTarget() bool { + return true +} + +// UnmarshalEndpointGatewayResourceBindingTargetCRN unmarshals an instance of EndpointGatewayResourceBindingTargetCRN from the specified map of raw messages. +func UnmarshalEndpointGatewayResourceBindingTargetCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayResourceBindingTargetCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + err = core.SDKErrorf(err, "", "crn-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN : The resource to bind to the endpoint gateway. +// This model "extends" EndpointGatewayResourceBindingTargetPrototype +type EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN struct { + CRN *string `json:"crn" validate:"required"` +} + +// NewEndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN : Instantiate EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN (Generic Model Constructor) +func (*VpcV1) NewEndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN(crn string) (_model *EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN, err error) { + _model = &EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN{ + CRN: core.StringPtr(crn), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +func (*EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN) isaEndpointGatewayResourceBindingTargetPrototype() bool { + return true +} + +// UnmarshalEndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN unmarshals an instance of EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN from the specified map of raw messages. +func UnmarshalEndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + err = core.SDKErrorf(err, "", "crn-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypePrivatePathServiceGatewayPrototype : EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypePrivatePathServiceGatewayPrototype struct // This model "extends" EndpointGatewayTargetPrototype type EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypePrivatePathServiceGatewayPrototype struct { @@ -118243,24 +121767,26 @@ func UnmarshalInstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceIn // InstanceGroupManagerActionPrototypeScheduledActionPrototype : InstanceGroupManagerActionPrototypeScheduledActionPrototype struct // Models which "extend" this model: -// - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt -// - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec +// - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup +// - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager +// - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup +// - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager // This model "extends" InstanceGroupManagerActionPrototype type InstanceGroupManagerActionPrototypeScheduledActionPrototype struct { // The name for this instance group manager action. The name must not be used by another action for the instance group // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` - // The date and time the scheduled action will run. - RunAt *strfmt.DateTime `json:"run_at,omitempty"` + // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min + // period. + CronSpec *string `json:"cron_spec,omitempty"` Group *InstanceGroupManagerScheduledActionGroupPrototype `json:"group,omitempty"` Manager InstanceGroupManagerScheduledActionManagerPrototypeIntf `json:"manager,omitempty"` - // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min - // period. - CronSpec *string `json:"cron_spec,omitempty"` + // The date and time the scheduled action will run. + RunAt *strfmt.DateTime `json:"run_at,omitempty"` } func (*InstanceGroupManagerActionPrototypeScheduledActionPrototype) isaInstanceGroupManagerActionPrototypeScheduledActionPrototype() bool { @@ -118284,9 +121810,9 @@ func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototype(m map[ err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "run_at", &obj.RunAt) + err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) if err != nil { - err = core.SDKErrorf(err, "", "run_at-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "cron_spec-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerScheduledActionGroupPrototype) @@ -118299,9 +121825,9 @@ func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototype(m map[ err = core.SDKErrorf(err, "", "manager-error", common.GetComponentInfo()) return } - err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) + err = core.UnmarshalPrimitive(m, "run_at", &obj.RunAt) if err != nil { - err = core.SDKErrorf(err, "", "cron_spec-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "run_at-error", common.GetComponentInfo()) return } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) @@ -121828,6 +125354,99 @@ func UnmarshalInstanceProfileVolumeBandwidthFixed(m map[string]json.RawMessage, return } +// InstanceProfileVolumeBandwidthQoSModesDependent : The volume bandwidth QoS modes for an instance with this profile depends on its configuration. +// This model "extends" InstanceProfileVolumeBandwidthQoSModes +type InstanceProfileVolumeBandwidthQoSModesDependent struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` +} + +// Constants associated with the InstanceProfileVolumeBandwidthQoSModesDependent.Type property. +// The type for this profile field. +const ( + InstanceProfileVolumeBandwidthQoSModesDependentTypeDependentConst = "dependent" +) + +func (*InstanceProfileVolumeBandwidthQoSModesDependent) isaInstanceProfileVolumeBandwidthQoSModes() bool { + return true +} + +// UnmarshalInstanceProfileVolumeBandwidthQoSModesDependent unmarshals an instance of InstanceProfileVolumeBandwidthQoSModesDependent from the specified map of raw messages. +func UnmarshalInstanceProfileVolumeBandwidthQoSModesDependent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileVolumeBandwidthQoSModesDependent) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceProfileVolumeBandwidthQoSModesEnum : InstanceProfileVolumeBandwidthQoSModesEnum struct +// This model "extends" InstanceProfileVolumeBandwidthQoSModes +type InstanceProfileVolumeBandwidthQoSModesEnum struct { + // The default volume bandwidth QoS mode for this profile. + Default *string `json:"default" validate:"required"` + + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The permitted volume bandwidth QoS modes for an instance using this profile. + Values []string `json:"values" validate:"required"` +} + +// Constants associated with the InstanceProfileVolumeBandwidthQoSModesEnum.Default property. +// The default volume bandwidth QoS mode for this profile. +const ( + InstanceProfileVolumeBandwidthQoSModesEnumDefaultPooledConst = "pooled" + InstanceProfileVolumeBandwidthQoSModesEnumDefaultWeightedConst = "weighted" +) + +// Constants associated with the InstanceProfileVolumeBandwidthQoSModesEnum.Type property. +// The type for this profile field. +const ( + InstanceProfileVolumeBandwidthQoSModesEnumTypeEnumConst = "enum" +) + +// Constants associated with the InstanceProfileVolumeBandwidthQoSModesEnum.Values property. +// A volume bandwidth QoS mode: +// - `pooled`: All volumes attached to an instance will pool and share bandwidth. +// - `weighted`: Each volume attached to an instance will have its own bandwidth, weighted according to its IOPS. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. +const ( + InstanceProfileVolumeBandwidthQoSModesEnumValuesPooledConst = "pooled" + InstanceProfileVolumeBandwidthQoSModesEnumValuesWeightedConst = "weighted" +) + +func (*InstanceProfileVolumeBandwidthQoSModesEnum) isaInstanceProfileVolumeBandwidthQoSModes() bool { + return true +} + +// UnmarshalInstanceProfileVolumeBandwidthQoSModesEnum unmarshals an instance of InstanceProfileVolumeBandwidthQoSModesEnum from the specified map of raw messages. +func UnmarshalInstanceProfileVolumeBandwidthQoSModesEnum(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceProfileVolumeBandwidthQoSModesEnum) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + err = core.SDKErrorf(err, "", "default-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + err = core.SDKErrorf(err, "", "values-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // InstanceProfileVolumeBandwidthRange : The permitted storage bandwidth range (in megabits per second) shared across the storage volumes of an instance with // this profile. // This model "extends" InstanceProfileVolumeBandwidth @@ -121946,7 +125565,8 @@ type InstancePrototypeInstanceByCatalogOffering struct { // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -121965,6 +125585,12 @@ type InstancePrototypeInstanceByCatalogOffering struct { // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -122009,6 +125635,16 @@ const ( InstancePrototypeInstanceByCatalogOfferingConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstancePrototypeInstanceByCatalogOffering.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstancePrototypeInstanceByCatalogOfferingVolumeBandwidthQosModePooledConst = "pooled" + InstancePrototypeInstanceByCatalogOfferingVolumeBandwidthQosModeWeightedConst = "weighted" +) + func (*InstancePrototypeInstanceByCatalogOffering) isaInstancePrototypeInstanceByCatalogOffering() bool { return true } @@ -122100,6 +125736,11 @@ func UnmarshalInstancePrototypeInstanceByCatalogOffering(m map[string]json.RawMe err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -122202,7 +125843,8 @@ type InstancePrototypeInstanceByImage struct { // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -122221,6 +125863,12 @@ type InstancePrototypeInstanceByImage struct { // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -122259,6 +125907,16 @@ const ( InstancePrototypeInstanceByImageConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstancePrototypeInstanceByImage.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstancePrototypeInstanceByImageVolumeBandwidthQosModePooledConst = "pooled" + InstancePrototypeInstanceByImageVolumeBandwidthQosModeWeightedConst = "weighted" +) + func (*InstancePrototypeInstanceByImage) isaInstancePrototypeInstanceByImage() bool { return true } @@ -122350,6 +126008,11 @@ func UnmarshalInstancePrototypeInstanceByImage(m map[string]json.RawMessage, res err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -122450,7 +126113,8 @@ type InstancePrototypeInstanceBySourceSnapshot struct { // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -122469,6 +126133,12 @@ type InstancePrototypeInstanceBySourceSnapshot struct { // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -122504,6 +126174,16 @@ const ( InstancePrototypeInstanceBySourceSnapshotConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstancePrototypeInstanceBySourceSnapshot.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstancePrototypeInstanceBySourceSnapshotVolumeBandwidthQosModePooledConst = "pooled" + InstancePrototypeInstanceBySourceSnapshotVolumeBandwidthQosModeWeightedConst = "weighted" +) + func (*InstancePrototypeInstanceBySourceSnapshot) isaInstancePrototypeInstanceBySourceSnapshot() bool { return true } @@ -122595,6 +126275,11 @@ func UnmarshalInstancePrototypeInstanceBySourceSnapshot(m map[string]json.RawMes err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -122693,7 +126378,8 @@ type InstancePrototypeInstanceBySourceTemplate struct { // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -122712,6 +126398,12 @@ type InstancePrototypeInstanceBySourceTemplate struct { // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -122764,6 +126456,16 @@ const ( InstancePrototypeInstanceBySourceTemplateConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstancePrototypeInstanceBySourceTemplate.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstancePrototypeInstanceBySourceTemplateVolumeBandwidthQosModePooledConst = "pooled" + InstancePrototypeInstanceBySourceTemplateVolumeBandwidthQosModeWeightedConst = "weighted" +) + // NewInstancePrototypeInstanceBySourceTemplate : Instantiate InstancePrototypeInstanceBySourceTemplate (Generic Model Constructor) func (*VpcV1) NewInstancePrototypeInstanceBySourceTemplate(sourceTemplate InstanceTemplateIdentityIntf) (_model *InstancePrototypeInstanceBySourceTemplate, err error) { _model = &InstancePrototypeInstanceBySourceTemplate{ @@ -122858,6 +126560,11 @@ func UnmarshalInstancePrototypeInstanceBySourceTemplate(m map[string]json.RawMes err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -122968,7 +126675,8 @@ type InstancePrototypeInstanceByVolume struct { // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -122987,6 +126695,12 @@ type InstancePrototypeInstanceByVolume struct { // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -123022,6 +126736,16 @@ const ( InstancePrototypeInstanceByVolumeConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstancePrototypeInstanceByVolume.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstancePrototypeInstanceByVolumeVolumeBandwidthQosModePooledConst = "pooled" + InstancePrototypeInstanceByVolumeVolumeBandwidthQosModeWeightedConst = "weighted" +) + func (*InstancePrototypeInstanceByVolume) isaInstancePrototypeInstanceByVolume() bool { return true } @@ -123113,6 +126837,11 @@ func UnmarshalInstancePrototypeInstanceByVolume(m map[string]json.RawMessage, re err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -123341,7 +127070,8 @@ type InstanceTemplatePrototypeInstanceTemplateByCatalogOffering struct { // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -123360,6 +127090,12 @@ type InstanceTemplatePrototypeInstanceTemplateByCatalogOffering struct { // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -123404,6 +127140,16 @@ const ( InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplatePrototypeInstanceTemplateByCatalogOffering.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingVolumeBandwidthQosModeWeightedConst = "weighted" +) + func (*InstanceTemplatePrototypeInstanceTemplateByCatalogOffering) isaInstanceTemplatePrototypeInstanceTemplateByCatalogOffering() bool { return true } @@ -123495,6 +127241,11 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOffering(m map[s err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -123595,7 +127346,8 @@ type InstanceTemplatePrototypeInstanceTemplateByImage struct { // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -123614,6 +127366,12 @@ type InstanceTemplatePrototypeInstanceTemplateByImage struct { // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -123652,6 +127410,16 @@ const ( InstanceTemplatePrototypeInstanceTemplateByImageConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplatePrototypeInstanceTemplateByImage.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplatePrototypeInstanceTemplateByImageVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplatePrototypeInstanceTemplateByImageVolumeBandwidthQosModeWeightedConst = "weighted" +) + func (*InstanceTemplatePrototypeInstanceTemplateByImage) isaInstanceTemplatePrototypeInstanceTemplateByImage() bool { return true } @@ -123743,6 +127511,11 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateByImage(m map[string]json err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -123841,7 +127614,8 @@ type InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot struct { // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -123860,6 +127634,12 @@ type InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot struct { // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -123895,6 +127675,16 @@ const ( InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotVolumeBandwidthQosModeWeightedConst = "weighted" +) + func (*InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot) isaInstanceTemplatePrototypeInstanceTemplateBySourceSnapshot() bool { return true } @@ -123986,6 +127776,11 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshot(m map[st err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -124082,7 +127877,8 @@ type InstanceTemplatePrototypeInstanceTemplateBySourceTemplate struct { // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -124101,6 +127897,12 @@ type InstanceTemplatePrototypeInstanceTemplateBySourceTemplate struct { // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -124153,6 +127955,16 @@ const ( InstanceTemplatePrototypeInstanceTemplateBySourceTemplateConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplatePrototypeInstanceTemplateBySourceTemplate.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplatePrototypeInstanceTemplateBySourceTemplateVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplatePrototypeInstanceTemplateBySourceTemplateVolumeBandwidthQosModeWeightedConst = "weighted" +) + // NewInstanceTemplatePrototypeInstanceTemplateBySourceTemplate : Instantiate InstanceTemplatePrototypeInstanceTemplateBySourceTemplate (Generic Model Constructor) func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateBySourceTemplate(sourceTemplate InstanceTemplateIdentityIntf) (_model *InstanceTemplatePrototypeInstanceTemplateBySourceTemplate, err error) { _model = &InstanceTemplatePrototypeInstanceTemplateBySourceTemplate{ @@ -124247,6 +128059,11 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceTemplate(m map[st err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -124366,7 +128183,8 @@ type InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext struct { // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -124386,6 +128204,12 @@ type InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext struct { // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -124430,6 +128254,16 @@ const ( InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextVolumeBandwidthQosModeWeightedConst = "weighted" +) + func (*InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext) isaInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext() bool { return true } @@ -124541,6 +128375,11 @@ func UnmarshalInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext(m err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -124650,7 +128489,8 @@ type InstanceTemplateInstanceByImageInstanceTemplateContext struct { // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -124670,6 +128510,12 @@ type InstanceTemplateInstanceByImageInstanceTemplateContext struct { // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -124708,6 +128554,16 @@ const ( InstanceTemplateInstanceByImageInstanceTemplateContextConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplateInstanceByImageInstanceTemplateContext.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplateInstanceByImageInstanceTemplateContextVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplateInstanceByImageInstanceTemplateContextVolumeBandwidthQosModeWeightedConst = "weighted" +) + func (*InstanceTemplateInstanceByImageInstanceTemplateContext) isaInstanceTemplateInstanceByImageInstanceTemplateContext() bool { return true } @@ -124819,6 +128675,11 @@ func UnmarshalInstanceTemplateInstanceByImageInstanceTemplateContext(m map[strin err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -124928,7 +128789,8 @@ type InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext struct { // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -124948,6 +128810,12 @@ type InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext struct { // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -124983,6 +128851,16 @@ const ( InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextVolumeBandwidthQosModeWeightedConst = "weighted" +) + func (*InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext) isaInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext() bool { return true } @@ -125094,6 +128972,11 @@ func UnmarshalInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext(m err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -126714,6 +130597,81 @@ func (loadBalancerPoolIdentityLoadBalancerPoolIdentityByID *LoadBalancerPoolIden return } +// LoadBalancerPoolMemberTargetByReservedIP : LoadBalancerPoolMemberTargetByReservedIP struct +// This model "extends" LoadBalancerPoolMemberTarget +type LoadBalancerPoolMemberTargetByReservedIP struct { + // The IP address. + // + // If the address has not yet been selected, the value will be `0.0.0.0`. + // + // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 addresses in + // the future. + Address *string `json:"address" validate:"required"` + + // If present, this property indicates the referenced resource has been deleted, and provides + // some supplementary information. + Deleted *Deleted `json:"deleted,omitempty"` + + // The URL for this reserved IP. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this reserved IP. + ID *string `json:"id" validate:"required"` + + // The name for this reserved IP. The name is unique across all reserved IPs in a subnet. + Name *string `json:"name" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` +} + +// Constants associated with the LoadBalancerPoolMemberTargetByReservedIP.ResourceType property. +// The resource type. +const ( + LoadBalancerPoolMemberTargetByReservedIPResourceTypeSubnetReservedIPConst = "subnet_reserved_ip" +) + +func (*LoadBalancerPoolMemberTargetByReservedIP) isaLoadBalancerPoolMemberTarget() bool { + return true +} + +// UnmarshalLoadBalancerPoolMemberTargetByReservedIP unmarshals an instance of LoadBalancerPoolMemberTargetByReservedIP from the specified map of raw messages. +func UnmarshalLoadBalancerPoolMemberTargetByReservedIP(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolMemberTargetByReservedIP) + err = core.UnmarshalPrimitive(m, "address", &obj.Address) + if err != nil { + err = core.SDKErrorf(err, "", "address-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "deleted", &obj.Deleted, UnmarshalDeleted) + if err != nil { + err = core.SDKErrorf(err, "", "deleted-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + err = core.SDKErrorf(err, "", "resource_type-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // LoadBalancerPoolMemberTargetPrototypeIP : LoadBalancerPoolMemberTargetPrototypeIP struct // This model "extends" LoadBalancerPoolMemberTargetPrototype type LoadBalancerPoolMemberTargetPrototypeIP struct { @@ -126898,9 +130856,65 @@ func (loadBalancerPoolMemberTargetPrototypeLoadBalancerIdentity *LoadBalancerPoo return } -// LoadBalancerPoolMemberTargetIP : LoadBalancerPoolMemberTargetIP struct +// LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity : Identifies a reserved IP by a unique property. +// Models which "extend" this model: +// - LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID +// - LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref +// This model "extends" LoadBalancerPoolMemberTargetPrototype +type LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity struct { + // The unique identifier for this reserved IP. + ID *string `json:"id,omitempty"` + + // The URL for this reserved IP. + Href *string `json:"href,omitempty"` +} + +func (*LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity) isaLoadBalancerPoolMemberTargetPrototypeReservedIPIdentity() bool { + return true +} + +type LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityIntf interface { + LoadBalancerPoolMemberTargetPrototypeIntf + isaLoadBalancerPoolMemberTargetPrototypeReservedIPIdentity() bool +} + +func (*LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity) isaLoadBalancerPoolMemberTargetPrototype() bool { + return true +} + +// UnmarshalLoadBalancerPoolMemberTargetPrototypeReservedIPIdentity unmarshals an instance of LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity from the specified map of raw messages. +func UnmarshalLoadBalancerPoolMemberTargetPrototypeReservedIPIdentity(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// asPatch returns a generic map representation of the LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity +func (loadBalancerPoolMemberTargetPrototypeReservedIPIdentity *LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity) asPatch() (_patch map[string]interface{}) { + _patch = map[string]interface{}{} + if !core.IsNil(loadBalancerPoolMemberTargetPrototypeReservedIPIdentity.ID) { + _patch["id"] = loadBalancerPoolMemberTargetPrototypeReservedIPIdentity.ID + } + if !core.IsNil(loadBalancerPoolMemberTargetPrototypeReservedIPIdentity.Href) { + _patch["href"] = loadBalancerPoolMemberTargetPrototypeReservedIPIdentity.Href + } + + return +} + +// LoadBalancerPoolMemberTargetIPNotReservedIP : LoadBalancerPoolMemberTargetIPNotReservedIP struct // This model "extends" LoadBalancerPoolMemberTarget -type LoadBalancerPoolMemberTargetIP struct { +type LoadBalancerPoolMemberTargetIPNotReservedIP struct { // The IP address. // // This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 addresses in @@ -126908,13 +130922,13 @@ type LoadBalancerPoolMemberTargetIP struct { Address *string `json:"address" validate:"required"` } -func (*LoadBalancerPoolMemberTargetIP) isaLoadBalancerPoolMemberTarget() bool { +func (*LoadBalancerPoolMemberTargetIPNotReservedIP) isaLoadBalancerPoolMemberTarget() bool { return true } -// UnmarshalLoadBalancerPoolMemberTargetIP unmarshals an instance of LoadBalancerPoolMemberTargetIP from the specified map of raw messages. -func UnmarshalLoadBalancerPoolMemberTargetIP(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(LoadBalancerPoolMemberTargetIP) +// UnmarshalLoadBalancerPoolMemberTargetIPNotReservedIP unmarshals an instance of LoadBalancerPoolMemberTargetIPNotReservedIP from the specified map of raw messages. +func UnmarshalLoadBalancerPoolMemberTargetIPNotReservedIP(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolMemberTargetIPNotReservedIP) err = core.UnmarshalPrimitive(m, "address", &obj.Address) if err != nil { err = core.SDKErrorf(err, "", "address-error", common.GetComponentInfo()) @@ -133704,38 +137718,60 @@ func UnmarshalShareIdentityByID(m map[string]json.RawMessage, result interface{} // Required if the share's `access_control_mode` is `security_group`. // This model "extends" ShareMountTargetPrototype type ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup struct { + // The protocol to use to access the share for this share mount target: + // - `nfs4`: NFSv4 will be used. + // + // The specified value must be listed in the share's `allowed_access_protocols`. + AccessProtocol *string `json:"access_protocol" validate:"required"` + // The name for this share mount target. The name must not be used by another mount target for the file share. If // unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` // The transit encryption mode to use for this share mount target: // - `none`: Not encrypted in transit. - // - `user_managed`: Encrypted in transit using an instance identity certificate. The - // `access_control_mode` for the share must be `security_group`. + // - `ipsec`: Encrypted in transit using an instance identity certificate. The + // `access_control_mode` for the share must be `security_group`. + // - `stunnel`: Encrypted in transit using an stunnel connection. The + // `access_control_mode` for the share must be `security_group`. // // The specified value must be listed in the share's // `allowed_transit_encryption_modes`. - TransitEncryption *string `json:"transit_encryption,omitempty"` + TransitEncryption *string `json:"transit_encryption" validate:"required"` VirtualNetworkInterface ShareMountTargetVirtualNetworkInterfacePrototypeIntf `json:"virtual_network_interface" validate:"required"` } +// Constants associated with the ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup.AccessProtocol property. +// The protocol to use to access the share for this share mount target: +// - `nfs4`: NFSv4 will be used. +// +// The specified value must be listed in the share's `allowed_access_protocols`. +const ( + ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroupAccessProtocolNfs4Const = "nfs4" +) + // Constants associated with the ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup.TransitEncryption property. // The transit encryption mode to use for this share mount target: // - `none`: Not encrypted in transit. -// - `user_managed`: Encrypted in transit using an instance identity certificate. The +// - `ipsec`: Encrypted in transit using an instance identity certificate. The +// `access_control_mode` for the share must be `security_group`. +// - `stunnel`: Encrypted in transit using an stunnel connection. The // `access_control_mode` for the share must be `security_group`. // // The specified value must be listed in the share's // `allowed_transit_encryption_modes`. const ( - ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroupTransitEncryptionNoneConst = "none" - ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroupTransitEncryptionUserManagedConst = "user_managed" + ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroupTransitEncryptionIpsecConst = "ipsec" + ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroupTransitEncryptionNoneConst = "none" + ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroupTransitEncryptionStunnelConst = "stunnel" ) // NewShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup : Instantiate ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup (Generic Model Constructor) -func (*VpcV1) NewShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup(virtualNetworkInterface ShareMountTargetVirtualNetworkInterfacePrototypeIntf) (_model *ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup, err error) { +func (*VpcV1) NewShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup(accessProtocol string, transitEncryption string, virtualNetworkInterface ShareMountTargetVirtualNetworkInterfacePrototypeIntf) (_model *ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup, err error) { _model = &ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup{ + AccessProtocol: core.StringPtr(accessProtocol), + TransitEncryption: core.StringPtr(transitEncryption), VirtualNetworkInterface: virtualNetworkInterface, } err = core.ValidateStruct(_model, "required parameters") @@ -133752,6 +137788,11 @@ func (*ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup // UnmarshalShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup unmarshals an instance of ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup from the specified map of raw messages. func UnmarshalShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup) + err = core.UnmarshalPrimitive(m, "access_protocol", &obj.AccessProtocol) + if err != nil { + err = core.SDKErrorf(err, "", "access_protocol-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) @@ -133777,40 +137818,62 @@ func UnmarshalShareMountTargetPrototypeShareMountTargetByAccessControlModeSecuri // Required if the share's `access_control_mode` is `vpc`. // This model "extends" ShareMountTargetPrototype type ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC struct { + // The protocol to use to access the share for this share mount target: + // - `nfs4`: NFSv4 will be used. + // + // The specified value must be listed in the share's `allowed_access_protocols`. + AccessProtocol *string `json:"access_protocol" validate:"required"` + // The name for this share mount target. The name must not be used by another mount target for the file share. If // unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` // The transit encryption mode to use for this share mount target: // - `none`: Not encrypted in transit. - // - `user_managed`: Encrypted in transit using an instance identity certificate. The - // `access_control_mode` for the share must be `security_group`. + // - `ipsec`: Encrypted in transit using an instance identity certificate. The + // `access_control_mode` for the share must be `security_group`. + // - `stunnel`: Encrypted in transit using an stunnel connection. The + // `access_control_mode` for the share must be `security_group`. // // The specified value must be listed in the share's // `allowed_transit_encryption_modes`. - TransitEncryption *string `json:"transit_encryption,omitempty"` + TransitEncryption *string `json:"transit_encryption" validate:"required"` // Identifies a VPC by a unique property. VPC VPCIdentityIntf `json:"vpc" validate:"required"` } +// Constants associated with the ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC.AccessProtocol property. +// The protocol to use to access the share for this share mount target: +// - `nfs4`: NFSv4 will be used. +// +// The specified value must be listed in the share's `allowed_access_protocols`. +const ( + ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPCAccessProtocolNfs4Const = "nfs4" +) + // Constants associated with the ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC.TransitEncryption property. // The transit encryption mode to use for this share mount target: // - `none`: Not encrypted in transit. -// - `user_managed`: Encrypted in transit using an instance identity certificate. The +// - `ipsec`: Encrypted in transit using an instance identity certificate. The +// `access_control_mode` for the share must be `security_group`. +// - `stunnel`: Encrypted in transit using an stunnel connection. The // `access_control_mode` for the share must be `security_group`. // // The specified value must be listed in the share's // `allowed_transit_encryption_modes`. const ( - ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPCTransitEncryptionNoneConst = "none" - ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPCTransitEncryptionUserManagedConst = "user_managed" + ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPCTransitEncryptionIpsecConst = "ipsec" + ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPCTransitEncryptionNoneConst = "none" + ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPCTransitEncryptionStunnelConst = "stunnel" ) // NewShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC : Instantiate ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC (Generic Model Constructor) -func (*VpcV1) NewShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC(vpc VPCIdentityIntf) (_model *ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC, err error) { +func (*VpcV1) NewShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC(accessProtocol string, transitEncryption string, vpc VPCIdentityIntf) (_model *ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC, err error) { _model = &ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC{ - VPC: vpc, + AccessProtocol: core.StringPtr(accessProtocol), + TransitEncryption: core.StringPtr(transitEncryption), + VPC: vpc, } err = core.ValidateStruct(_model, "required parameters") if err != nil { @@ -133826,6 +137889,11 @@ func (*ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC) isaShare // UnmarshalShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC unmarshals an instance of ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC from the specified map of raw messages. func UnmarshalShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC(m map[string]json.RawMessage, result interface{}) (err error) { obj := new(ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC) + err = core.UnmarshalPrimitive(m, "access_protocol", &obj.AccessProtocol) + if err != nil { + err = core.SDKErrorf(err, "", "access_protocol-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) @@ -134051,6 +138119,473 @@ func UnmarshalShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInte return } +// ShareProfileAllowedAccessProtocolsSubset : ShareProfileAllowedAccessProtocolsSubset struct +// This model "extends" ShareProfileAllowedAccessProtocols +type ShareProfileAllowedAccessProtocolsSubset struct { + // The default allowed access protocol modes for shares with this profile. + Default []string `json:"default" validate:"required"` + + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The possible allowed access protocols for shares with this profile: + // - `nfs4`: NFSv4 will be used. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + Values []string `json:"values" validate:"required"` +} + +// Constants associated with the ShareProfileAllowedAccessProtocolsSubset.Default property. +const ( + ShareProfileAllowedAccessProtocolsSubsetDefaultNfs4Const = "nfs4" +) + +// Constants associated with the ShareProfileAllowedAccessProtocolsSubset.Type property. +// The type for this profile field. +const ( + ShareProfileAllowedAccessProtocolsSubsetTypeSubsetConst = "subset" +) + +// Constants associated with the ShareProfileAllowedAccessProtocolsSubset.Values property. +const ( + ShareProfileAllowedAccessProtocolsSubsetValuesNfs4Const = "nfs4" +) + +func (*ShareProfileAllowedAccessProtocolsSubset) isaShareProfileAllowedAccessProtocols() bool { + return true +} + +// UnmarshalShareProfileAllowedAccessProtocolsSubset unmarshals an instance of ShareProfileAllowedAccessProtocolsSubset from the specified map of raw messages. +func UnmarshalShareProfileAllowedAccessProtocolsSubset(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileAllowedAccessProtocolsSubset) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + err = core.SDKErrorf(err, "", "default-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + err = core.SDKErrorf(err, "", "values-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ShareProfileAllowedTransitEncryptionModesSubset : ShareProfileAllowedTransitEncryptionModesSubset struct +// This model "extends" ShareProfileAllowedTransitEncryptionModes +type ShareProfileAllowedTransitEncryptionModesSubset struct { + // The default allowed transit encryption modes for shares with this profile. + Default []string `json:"default" validate:"required"` + + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The allowed [transit encryption + // modes](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-vpc-about&interface=ui#fs-eit) for a share with this + // profile: + // - `none`: Not encrypted in transit. + // - `ipsec`: Encrypted in transit using an instance identity certificate. + // - `stunnel`: Encrypted in transit using a connection via an stunnel connection. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + Values []string `json:"values" validate:"required"` +} + +// Constants associated with the ShareProfileAllowedTransitEncryptionModesSubset.Default property. +const ( + ShareProfileAllowedTransitEncryptionModesSubsetDefaultIpsecConst = "ipsec" + ShareProfileAllowedTransitEncryptionModesSubsetDefaultNoneConst = "none" + ShareProfileAllowedTransitEncryptionModesSubsetDefaultStunnelConst = "stunnel" +) + +// Constants associated with the ShareProfileAllowedTransitEncryptionModesSubset.Type property. +// The type for this profile field. +const ( + ShareProfileAllowedTransitEncryptionModesSubsetTypeSubsetConst = "subset" +) + +// Constants associated with the ShareProfileAllowedTransitEncryptionModesSubset.Values property. +const ( + ShareProfileAllowedTransitEncryptionModesSubsetValuesIpsecConst = "ipsec" + ShareProfileAllowedTransitEncryptionModesSubsetValuesNoneConst = "none" + ShareProfileAllowedTransitEncryptionModesSubsetValuesStunnelConst = "stunnel" +) + +func (*ShareProfileAllowedTransitEncryptionModesSubset) isaShareProfileAllowedTransitEncryptionModes() bool { + return true +} + +// UnmarshalShareProfileAllowedTransitEncryptionModesSubset unmarshals an instance of ShareProfileAllowedTransitEncryptionModesSubset from the specified map of raw messages. +func UnmarshalShareProfileAllowedTransitEncryptionModesSubset(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileAllowedTransitEncryptionModesSubset) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + err = core.SDKErrorf(err, "", "default-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + err = core.SDKErrorf(err, "", "values-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ShareProfileAvailabilityModesEnum : The permitted data availability modes for a share with this profile. +// This model "extends" ShareProfileAvailabilityModes +type ShareProfileAvailabilityModesEnum struct { + // The default data availability mode for this profile. + Default *string `json:"default" validate:"required"` + + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The data availability mode of the share: + // - `zonal`: The data availability of this share is limited only to a single zone of a + // given region as provided by the `zone` of the share. + // - `regional`: The data availability of this share covers all zones in the region where + // the share is created. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + Values []string `json:"values" validate:"required"` +} + +// Constants associated with the ShareProfileAvailabilityModesEnum.Default property. +// The default data availability mode for this profile. +const ( + ShareProfileAvailabilityModesEnumDefaultRegionalConst = "regional" + ShareProfileAvailabilityModesEnumDefaultZonalConst = "zonal" +) + +// Constants associated with the ShareProfileAvailabilityModesEnum.Type property. +// The type for this profile field. +const ( + ShareProfileAvailabilityModesEnumTypeEnumConst = "enum" +) + +// Constants associated with the ShareProfileAvailabilityModesEnum.Values property. +const ( + ShareProfileAvailabilityModesEnumValuesRegionalConst = "regional" + ShareProfileAvailabilityModesEnumValuesZonalConst = "zonal" +) + +func (*ShareProfileAvailabilityModesEnum) isaShareProfileAvailabilityModes() bool { + return true +} + +// UnmarshalShareProfileAvailabilityModesEnum unmarshals an instance of ShareProfileAvailabilityModesEnum from the specified map of raw messages. +func UnmarshalShareProfileAvailabilityModesEnum(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileAvailabilityModesEnum) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + err = core.SDKErrorf(err, "", "default-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + err = core.SDKErrorf(err, "", "values-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ShareProfileAvailabilityModesFixed : The data availability mode for a share with this profile is fixed. +// This model "extends" ShareProfileAvailabilityModes +type ShareProfileAvailabilityModesFixed struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The value for this profile field. + Value *string `json:"value" validate:"required"` +} + +// Constants associated with the ShareProfileAvailabilityModesFixed.Type property. +// The type for this profile field. +const ( + ShareProfileAvailabilityModesFixedTypeFixedConst = "fixed" +) + +// Constants associated with the ShareProfileAvailabilityModesFixed.Value property. +// The value for this profile field. +const ( + ShareProfileAvailabilityModesFixedValueRegionalConst = "regional" + ShareProfileAvailabilityModesFixedValueZonalConst = "zonal" +) + +func (*ShareProfileAvailabilityModesFixed) isaShareProfileAvailabilityModes() bool { + return true +} + +// UnmarshalShareProfileAvailabilityModesFixed unmarshals an instance of ShareProfileAvailabilityModesFixed from the specified map of raw messages. +func UnmarshalShareProfileAvailabilityModesFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileAvailabilityModesFixed) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ShareProfileBandwidthDependent : The permitted bandwidth for a share with this profile depends on its configuration. +// This model "extends" ShareProfileBandwidth +type ShareProfileBandwidthDependent struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` +} + +// Constants associated with the ShareProfileBandwidthDependent.Type property. +// The type for this profile field. +const ( + ShareProfileBandwidthDependentTypeDependentConst = "dependent" +) + +func (*ShareProfileBandwidthDependent) isaShareProfileBandwidth() bool { + return true +} + +// UnmarshalShareProfileBandwidthDependent unmarshals an instance of ShareProfileBandwidthDependent from the specified map of raw messages. +func UnmarshalShareProfileBandwidthDependent(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileBandwidthDependent) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ShareProfileBandwidthDependentRange : The permitted bandwidth range of a share with this profile depends on its configuration. +// This model "extends" ShareProfileBandwidth +type ShareProfileBandwidthDependentRange struct { + // The maximum value for this profile field. + Max *int64 `json:"max" validate:"required"` + + // The minimum value for this profile field. + Min *int64 `json:"min" validate:"required"` + + // The increment step value for this profile field. + Step *int64 `json:"step" validate:"required"` + + // The type for this profile field. + Type *string `json:"type" validate:"required"` +} + +// Constants associated with the ShareProfileBandwidthDependentRange.Type property. +// The type for this profile field. +const ( + ShareProfileBandwidthDependentRangeTypeDependentRangeConst = "dependent_range" +) + +func (*ShareProfileBandwidthDependentRange) isaShareProfileBandwidth() bool { + return true +} + +// UnmarshalShareProfileBandwidthDependentRange unmarshals an instance of ShareProfileBandwidthDependentRange from the specified map of raw messages. +func UnmarshalShareProfileBandwidthDependentRange(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileBandwidthDependentRange) + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + err = core.SDKErrorf(err, "", "max-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + err = core.SDKErrorf(err, "", "min-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + err = core.SDKErrorf(err, "", "step-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ShareProfileBandwidthEnum : The permitted bandwidth values of a share with this profile. +// This model "extends" ShareProfileBandwidth +type ShareProfileBandwidthEnum struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` + + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The permitted values for this profile field. + Values []int64 `json:"values" validate:"required"` +} + +// Constants associated with the ShareProfileBandwidthEnum.Type property. +// The type for this profile field. +const ( + ShareProfileBandwidthEnumTypeEnumConst = "enum" +) + +func (*ShareProfileBandwidthEnum) isaShareProfileBandwidth() bool { + return true +} + +// UnmarshalShareProfileBandwidthEnum unmarshals an instance of ShareProfileBandwidthEnum from the specified map of raw messages. +func UnmarshalShareProfileBandwidthEnum(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileBandwidthEnum) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + err = core.SDKErrorf(err, "", "default-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "values", &obj.Values) + if err != nil { + err = core.SDKErrorf(err, "", "values-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ShareProfileBandwidthFixed : The permitted bandwidth of a share with this profile is fixed. +// This model "extends" ShareProfileBandwidth +type ShareProfileBandwidthFixed struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The value for this profile field. + Value *int64 `json:"value" validate:"required"` +} + +// Constants associated with the ShareProfileBandwidthFixed.Type property. +// The type for this profile field. +const ( + ShareProfileBandwidthFixedTypeFixedConst = "fixed" +) + +func (*ShareProfileBandwidthFixed) isaShareProfileBandwidth() bool { + return true +} + +// UnmarshalShareProfileBandwidthFixed unmarshals an instance of ShareProfileBandwidthFixed from the specified map of raw messages. +func UnmarshalShareProfileBandwidthFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileBandwidthFixed) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// ShareProfileBandwidthRange : The permitted bandwidth range (in megabits per second) of a share with this profile. +// This model "extends" ShareProfileBandwidth +type ShareProfileBandwidthRange struct { + // The default value for this profile field. + Default *int64 `json:"default" validate:"required"` + + // The maximum value for this profile field. + Max *int64 `json:"max" validate:"required"` + + // The minimum value for this profile field. + Min *int64 `json:"min" validate:"required"` + + // The increment step value for this profile field. + Step *int64 `json:"step" validate:"required"` + + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + Value *int64 `json:"value,omitempty"` +} + +// Constants associated with the ShareProfileBandwidthRange.Type property. +// The type for this profile field. +const ( + ShareProfileBandwidthRangeTypeRangeConst = "range" +) + +func (*ShareProfileBandwidthRange) isaShareProfileBandwidth() bool { + return true +} + +// UnmarshalShareProfileBandwidthRange unmarshals an instance of ShareProfileBandwidthRange from the specified map of raw messages. +func UnmarshalShareProfileBandwidthRange(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileBandwidthRange) + err = core.UnmarshalPrimitive(m, "default", &obj.Default) + if err != nil { + err = core.SDKErrorf(err, "", "default-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "max", &obj.Max) + if err != nil { + err = core.SDKErrorf(err, "", "max-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "min", &obj.Min) + if err != nil { + err = core.SDKErrorf(err, "", "min-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "step", &obj.Step) + if err != nil { + err = core.SDKErrorf(err, "", "step-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // ShareProfileCapacityDependentRange : The permitted total capacity (in gigabytes) of a share with this profile depends on its configuration. // This model "extends" ShareProfileCapacity type ShareProfileCapacityDependentRange struct { @@ -134554,15 +139089,56 @@ func (shareProfileIdentityByName *ShareProfileIdentityByName) asPatch() (_patch return } +// ShareProfileStorageGenerationFixed : The storage generation value of a share with this profile is fixed. +// This model "extends" ShareProfileStorageGeneration +type ShareProfileStorageGenerationFixed struct { + // The type for this profile field. + Type *string `json:"type" validate:"required"` + + // The value for this profile field. + Value *int64 `json:"value" validate:"required"` +} + +// Constants associated with the ShareProfileStorageGenerationFixed.Type property. +// The type for this profile field. +const ( + ShareProfileStorageGenerationFixedTypeFixedConst = "fixed" +) + +func (*ShareProfileStorageGenerationFixed) isaShareProfileStorageGeneration() bool { + return true +} + +// UnmarshalShareProfileStorageGenerationFixed unmarshals an instance of ShareProfileStorageGenerationFixed from the specified map of raw messages. +func UnmarshalShareProfileStorageGenerationFixed(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(ShareProfileStorageGenerationFixed) + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "value", &obj.Value) + if err != nil { + err = core.SDKErrorf(err, "", "value-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // SharePrototypeShareByOriginShare : Create an accessor file share for an existing file share. The values for -// `access_control_mode`, `encryption_key`, `initial_owner`, `iops`, `profile`, `size`, and -// `zone` will be inherited from `origin_share`. +// `access_control_mode`, `allowed_access_protocols`, `bandwidth`, `encryption_key`, +// `initial_owner`, `iops`, `profile`, `size`, and `zone` will be inherited from +// `origin_share`. +// +// Accessor file shares can only be created for shares with a `storage_generation` of `1`. // This model "extends" SharePrototype type SharePrototypeShareByOriginShare struct { // The transit encryption modes to allow for this share. If unspecified: - // - If share mount targets are specified, and those share mount targets all specify a - // `transit_encryption` of `user_managed`, then only `user_managed` will be allowed. - // - Otherwise, all `transit_encryption` modes will be allowed. + // - If share mount targets are specified, then only transit encryption modes + // specified by those share mount target will be allowed. + // - Otherwise, the default allowed transit encryption modes from the profile will be + // used. AllowedTransitEncryptionModes []string `json:"allowed_transit_encryption_modes,omitempty"` // The mount targets for the file share. Each mount target must be in a unique VPC. @@ -134591,8 +139167,9 @@ type SharePrototypeShareByOriginShare struct { // Constants associated with the SharePrototypeShareByOriginShare.AllowedTransitEncryptionModes property. const ( - SharePrototypeShareByOriginShareAllowedTransitEncryptionModesNoneConst = "none" - SharePrototypeShareByOriginShareAllowedTransitEncryptionModesUserManagedConst = "user_managed" + SharePrototypeShareByOriginShareAllowedTransitEncryptionModesIpsecConst = "ipsec" + SharePrototypeShareByOriginShareAllowedTransitEncryptionModesNoneConst = "none" + SharePrototypeShareByOriginShareAllowedTransitEncryptionModesStunnelConst = "stunnel" ) // NewSharePrototypeShareByOriginShare : Instantiate SharePrototypeShareByOriginShare (Generic Model Constructor) @@ -134657,9 +139234,10 @@ func UnmarshalSharePrototypeShareByOriginShare(m map[string]json.RawMessage, res // This model "extends" SharePrototype type SharePrototypeShareBySize struct { // The transit encryption modes to allow for this share. If unspecified: - // - If share mount targets are specified, and those share mount targets all specify a - // `transit_encryption` of `user_managed`, then only `user_managed` will be allowed. - // - Otherwise, all `transit_encryption` modes will be allowed. + // - If share mount targets are specified, then only transit encryption modes + // specified by those share mount target will be allowed. + // - Otherwise, the default allowed transit encryption modes from the profile will be + // used. AllowedTransitEncryptionModes []string `json:"allowed_transit_encryption_modes,omitempty"` // The mount targets for the file share. Each mount target must be in a unique VPC. @@ -134683,6 +139261,22 @@ type SharePrototypeShareBySize struct { // Mount targets for this share require a VPC. AccessControlMode *string `json:"access_control_mode,omitempty"` + // The access protocols to allow for this share. If unspecified: + // - If share mount targets are specified, only the access protocols specified by those + // share mount target will be allowed. + // - Otherwise, the default access protocols from the profile will be used. + AllowedAccessProtocols []string `json:"allowed_access_protocols,omitempty"` + + // The maximum bandwidth (in megabits per second) for the file share. + // + // If the share profile has a `bandwidth.type` of `dependent` or `fixed`, this property is system-managed and must not + // be specified. Otherwise, the specified value must be within the `bandwidth` range of the share's profile. + // + // Provided the property is user-managed, if it is unspecified, its value will be set based on the specified [`size` + // and + // `iops`](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles&interface=api). + Bandwidth *int64 `json:"bandwidth,omitempty"` + // The root key to use to wrap the data encryption key for the share. // // If unspecified, the `encryption` type for the share will be `provider_managed`. @@ -134717,13 +139311,17 @@ type SharePrototypeShareBySize struct { // The zone this file share will reside in. For a replica share in the same region as // the source share, this must be a different zone from the source share. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` + // + // This property must be specified if the share profile `availability_mode` is `zonal`, + // and must not be specified otherwise. + Zone ZoneIdentityIntf `json:"zone,omitempty"` } // Constants associated with the SharePrototypeShareBySize.AllowedTransitEncryptionModes property. const ( - SharePrototypeShareBySizeAllowedTransitEncryptionModesNoneConst = "none" - SharePrototypeShareBySizeAllowedTransitEncryptionModesUserManagedConst = "user_managed" + SharePrototypeShareBySizeAllowedTransitEncryptionModesIpsecConst = "ipsec" + SharePrototypeShareBySizeAllowedTransitEncryptionModesNoneConst = "none" + SharePrototypeShareBySizeAllowedTransitEncryptionModesStunnelConst = "stunnel" ) // Constants associated with the SharePrototypeShareBySize.AccessControlMode property. @@ -134739,12 +139337,16 @@ const ( SharePrototypeShareBySizeAccessControlModeVPCConst = "vpc" ) +// Constants associated with the SharePrototypeShareBySize.AllowedAccessProtocols property. +const ( + SharePrototypeShareBySizeAllowedAccessProtocolsNfs4Const = "nfs4" +) + // NewSharePrototypeShareBySize : Instantiate SharePrototypeShareBySize (Generic Model Constructor) -func (*VpcV1) NewSharePrototypeShareBySize(profile ShareProfileIdentityIntf, size int64, zone ZoneIdentityIntf) (_model *SharePrototypeShareBySize, err error) { +func (*VpcV1) NewSharePrototypeShareBySize(profile ShareProfileIdentityIntf, size int64) (_model *SharePrototypeShareBySize, err error) { _model = &SharePrototypeShareBySize{ Profile: profile, Size: core.Int64Ptr(size), - Zone: zone, } err = core.ValidateStruct(_model, "required parameters") if err != nil { @@ -134790,6 +139392,16 @@ func UnmarshalSharePrototypeShareBySize(m map[string]json.RawMessage, result int err = core.SDKErrorf(err, "", "access_control_mode-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "allowed_access_protocols", &obj.AllowedAccessProtocols) + if err != nil { + err = core.SDKErrorf(err, "", "allowed_access_protocols-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "bandwidth", &obj.Bandwidth) + if err != nil { + err = core.SDKErrorf(err, "", "bandwidth-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) if err != nil { err = core.SDKErrorf(err, "", "encryption_key-error", common.GetComponentInfo()) @@ -134830,13 +139442,18 @@ func UnmarshalSharePrototypeShareBySize(m map[string]json.RawMessage, result int } // SharePrototypeShareBySourceShare : Create a replica file share for an existing file share. The values for -// `access_control_mode`, `encryption_key`, `initial_owner`, and `size` will be inherited from `source_share`. +// `access_control_mode`, `allowed_access_protocols`, `bandwidth`, `encryption_key`, +// `initial_owner`, and `size` will be inherited from the `source_share`. +// +// Replica file shares can only be created if the source share has a `storage_generation` of +// `1`. // This model "extends" SharePrototype type SharePrototypeShareBySourceShare struct { // The transit encryption modes to allow for this share. If unspecified: - // - If share mount targets are specified, and those share mount targets all specify a - // `transit_encryption` of `user_managed`, then only `user_managed` will be allowed. - // - Otherwise, all `transit_encryption` modes will be allowed. + // - If share mount targets are specified, then only transit encryption modes + // specified by those share mount target will be allowed. + // - Otherwise, the default allowed transit encryption modes from the profile will be + // used. AllowedTransitEncryptionModes []string `json:"allowed_transit_encryption_modes,omitempty"` // The mount targets for the file share. Each mount target must be in a unique VPC. @@ -134866,7 +139483,9 @@ type SharePrototypeShareBySourceShare struct { Iops *int64 `json:"iops,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) to use - // for this file share. The profile must support the share's specified IOPS and size. + // for this file share. The profile must: + // - support the share's specified IOPS and size, and + // - have the same `storage_generation` as the source share. Profile ShareProfileIdentityIntf `json:"profile" validate:"required"` // The cron specification for the file share replication schedule. @@ -134881,30 +139500,36 @@ type SharePrototypeShareBySourceShare struct { // the source share will be used. ResourceGroup ResourceGroupIdentityIntf `json:"resource_group,omitempty"` - // The source file share for this replica file share. The specified file share must not - // already have a replica, and must not be a replica. If source file share is specified - // by CRN, it may be in an [associated partner + // The source file share for this replica file share. The specified file share must: + // - Not already have a replica. + // - Not be a replica. + // - Have a `storage_generation` of `1`. + // + // If source file share is specified by CRN, it may be in an [associated partner // region](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-replication). SourceShare ShareIdentityIntf `json:"source_share" validate:"required"` // The zone this file share will reside in. For a replica share in the same region as // the source share, this must be a different zone from the source share. - Zone ZoneIdentityIntf `json:"zone" validate:"required"` + // + // This property must be specified if the share profile `availability_mode` is `zonal`, + // and must not be specified otherwise. + Zone ZoneIdentityIntf `json:"zone,omitempty"` } // Constants associated with the SharePrototypeShareBySourceShare.AllowedTransitEncryptionModes property. const ( - SharePrototypeShareBySourceShareAllowedTransitEncryptionModesNoneConst = "none" - SharePrototypeShareBySourceShareAllowedTransitEncryptionModesUserManagedConst = "user_managed" + SharePrototypeShareBySourceShareAllowedTransitEncryptionModesIpsecConst = "ipsec" + SharePrototypeShareBySourceShareAllowedTransitEncryptionModesNoneConst = "none" + SharePrototypeShareBySourceShareAllowedTransitEncryptionModesStunnelConst = "stunnel" ) // NewSharePrototypeShareBySourceShare : Instantiate SharePrototypeShareBySourceShare (Generic Model Constructor) -func (*VpcV1) NewSharePrototypeShareBySourceShare(profile ShareProfileIdentityIntf, replicationCronSpec string, sourceShare ShareIdentityIntf, zone ZoneIdentityIntf) (_model *SharePrototypeShareBySourceShare, err error) { +func (*VpcV1) NewSharePrototypeShareBySourceShare(profile ShareProfileIdentityIntf, replicationCronSpec string, sourceShare ShareIdentityIntf) (_model *SharePrototypeShareBySourceShare, err error) { _model = &SharePrototypeShareBySourceShare{ Profile: profile, ReplicationCronSpec: core.StringPtr(replicationCronSpec), SourceShare: sourceShare, - Zone: zone, } err = core.ValidateStruct(_model, "required parameters") if err != nil { @@ -134984,14 +139609,15 @@ func UnmarshalSharePrototypeShareBySourceShare(m map[string]json.RawMessage, res return } -// SharePrototypeShareBySourceSnapshot : Create a file share from a source snapshot. The initial value for `access_control_mode`, and the zone the file share -// resides in will be inherited from `source_snapshot`. +// SharePrototypeShareBySourceSnapshot : Create a file share from a source snapshot. The initial value for `access_control_mode`, +// `initial_owner` and `zone` will be inherited from `source_snapshot`. // This model "extends" SharePrototype type SharePrototypeShareBySourceSnapshot struct { // The transit encryption modes to allow for this share. If unspecified: - // - If share mount targets are specified, and those share mount targets all specify a - // `transit_encryption` of `user_managed`, then only `user_managed` will be allowed. - // - Otherwise, all `transit_encryption` modes will be allowed. + // - If share mount targets are specified, then only transit encryption modes + // specified by those share mount target will be allowed. + // - Otherwise, the default allowed transit encryption modes from the profile will be + // used. AllowedTransitEncryptionModes []string `json:"allowed_transit_encryption_modes,omitempty"` // The mount targets for the file share. Each mount target must be in a unique VPC. @@ -135006,15 +139632,37 @@ type SharePrototypeShareBySourceSnapshot struct { // The tags for this resource. UserTags []string `json:"user_tags,omitempty"` + // The access protocols to allow for this share. If unspecified: + // - If share mount targets are specified, only the access protocols specified by those + // share mount target will be allowed. + // - Otherwise, the default access protocols from the profile will be used. + AllowedAccessProtocols []string `json:"allowed_access_protocols,omitempty"` + + // The maximum bandwidth (in megabits per second) for the file share. + // + // If the share profile has a `bandwidth.type` of `dependent` or `fixed`, this property is system-managed and must not + // be specified. Otherwise, the specified value must be within the `bandwidth` range of the share's profile. + // + // Provided the property is user-managed, if it is unspecified, its value will be set based on the specified [`size` + // and + // `iops`](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles&interface=api). + Bandwidth *int64 `json:"bandwidth,omitempty"` + // The root key to use to wrap the data encryption key for the share. // // The specified key may be in a different account, subject to IAM policies. // - // If unspecified, the source snapshot's `encryption_key` will be used. + // If unspecified, the source share's `encryption_key` will be used. + // + // For snapshots of shares with `storage_generation` of `2`, an encryption key may only + // be specified if the source share's `encryption` is `user_managed`. EncryptionKey EncryptionKeyIdentityIntf `json:"encryption_key,omitempty"` // The owner assigned to the file share at creation. Subsequent changes to the owner // must be performed by a client that has mounted the file share. + // + // `initial_owner` for a share created from a source snapshot can only be specified for + // snapshots of shares with `storage_generation` of `1`. InitialOwner *ShareInitialOwner `json:"initial_owner,omitempty"` // The maximum input/output operations per second (IOPS) for the file share. @@ -135025,7 +139673,9 @@ type SharePrototypeShareBySourceSnapshot struct { Iops *int64 `json:"iops,omitempty"` // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) to use - // for this file share. The profile must support the share's specified IOPS and size. + // for this file share. The profile must: + // - support the share's specified IOPS and size, and + // - have the same `storage_generation` as the source snapshot. Profile ShareProfileIdentityIntf `json:"profile" validate:"required"` // The resource group to use. If unspecified, the account's [default resource @@ -135048,8 +139698,14 @@ type SharePrototypeShareBySourceSnapshot struct { // Constants associated with the SharePrototypeShareBySourceSnapshot.AllowedTransitEncryptionModes property. const ( - SharePrototypeShareBySourceSnapshotAllowedTransitEncryptionModesNoneConst = "none" - SharePrototypeShareBySourceSnapshotAllowedTransitEncryptionModesUserManagedConst = "user_managed" + SharePrototypeShareBySourceSnapshotAllowedTransitEncryptionModesIpsecConst = "ipsec" + SharePrototypeShareBySourceSnapshotAllowedTransitEncryptionModesNoneConst = "none" + SharePrototypeShareBySourceSnapshotAllowedTransitEncryptionModesStunnelConst = "stunnel" +) + +// Constants associated with the SharePrototypeShareBySourceSnapshot.AllowedAccessProtocols property. +const ( + SharePrototypeShareBySourceSnapshotAllowedAccessProtocolsNfs4Const = "nfs4" ) // NewSharePrototypeShareBySourceSnapshot : Instantiate SharePrototypeShareBySourceSnapshot (Generic Model Constructor) @@ -135097,6 +139753,16 @@ func UnmarshalSharePrototypeShareBySourceSnapshot(m map[string]json.RawMessage, err = core.SDKErrorf(err, "", "user_tags-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "allowed_access_protocols", &obj.AllowedAccessProtocols) + if err != nil { + err = core.SDKErrorf(err, "", "allowed_access_protocols-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "bandwidth", &obj.Bandwidth) + if err != nil { + err = core.SDKErrorf(err, "", "bandwidth-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "encryption_key", &obj.EncryptionKey, UnmarshalEncryptionKeyIdentity) if err != nil { err = core.SDKErrorf(err, "", "encryption_key-error", common.GetComponentInfo()) @@ -136737,6 +141403,232 @@ func (vpcIdentityByID *VPCIdentityByID) asPatch() (_patch map[string]interface{} return } +// VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress : VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress struct +// This model "extends" VPNGatewayConnectionDynamicRouteModePeerPrototype +type VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress struct { + // The peer autonomous system number (ASN) for this VPN gateway connection. The ASN values in the + // [restricted ASN list]( + // https://cloud.ibm.com/docs/vpc?topic=vpc-planning-considerations-vpn#dynamic-route-based-considerations) are + // reserved and unavailable. + Asn *int64 `json:"asn" validate:"required"` + + // The peer IKE identity to use. + // + // If unspecified: + // - If `peer.address` is specified, the `type` will be `ipv4_address`, and the `value` will be `peer.address`. + // - If `peer.fqdn` is specified, the `type` will be `fqdn`, and the `value` will be `peer.fqdn`. + IkeIdentity VPNGatewayConnectionIkeIdentityPrototypeIntf `json:"ike_identity,omitempty"` + + // The IP address of the peer VPN gateway for this connection. + Address *string `json:"address" validate:"required"` +} + +// NewVPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress : Instantiate VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress (Generic Model Constructor) +func (*VpcV1) NewVPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress(asn int64, address string) (_model *VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress, err error) { + _model = &VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress{ + Asn: core.Int64Ptr(asn), + Address: core.StringPtr(address), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +func (*VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress) isaVPNGatewayConnectionDynamicRouteModePeerPrototype() bool { + return true +} + +// UnmarshalVPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress unmarshals an instance of VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress) + err = core.UnmarshalPrimitive(m, "asn", &obj.Asn) + if err != nil { + err = core.SDKErrorf(err, "", "asn-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "ike_identity", &obj.IkeIdentity, UnmarshalVPNGatewayConnectionIkeIdentityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "ike_identity-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "address", &obj.Address) + if err != nil { + err = core.SDKErrorf(err, "", "address-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn : VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn struct +// This model "extends" VPNGatewayConnectionDynamicRouteModePeerPrototype +type VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn struct { + // The peer autonomous system number (ASN) for this VPN gateway connection. The ASN values in the + // [restricted ASN list]( + // https://cloud.ibm.com/docs/vpc?topic=vpc-planning-considerations-vpn#dynamic-route-based-considerations) are + // reserved and unavailable. + Asn *int64 `json:"asn" validate:"required"` + + // The peer IKE identity to use. + // + // If unspecified: + // - If `peer.address` is specified, the `type` will be `ipv4_address`, and the `value` will be `peer.address`. + // - If `peer.fqdn` is specified, the `type` will be `fqdn`, and the `value` will be `peer.fqdn`. + IkeIdentity VPNGatewayConnectionIkeIdentityPrototypeIntf `json:"ike_identity,omitempty"` + + // The FQDN of the peer VPN gateway for this connection. + Fqdn *string `json:"fqdn" validate:"required"` +} + +// NewVPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn : Instantiate VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn (Generic Model Constructor) +func (*VpcV1) NewVPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn(asn int64, fqdn string) (_model *VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn, err error) { + _model = &VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn{ + Asn: core.Int64Ptr(asn), + Fqdn: core.StringPtr(fqdn), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +func (*VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn) isaVPNGatewayConnectionDynamicRouteModePeerPrototype() bool { + return true +} + +// UnmarshalVPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn unmarshals an instance of VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFqdn) + err = core.UnmarshalPrimitive(m, "asn", &obj.Asn) + if err != nil { + err = core.SDKErrorf(err, "", "asn-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "ike_identity", &obj.IkeIdentity, UnmarshalVPNGatewayConnectionIkeIdentityPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "ike_identity-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "fqdn", &obj.Fqdn) + if err != nil { + err = core.SDKErrorf(err, "", "fqdn-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddress : VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddress struct +// This model "extends" VPNGatewayConnectionDynamicRouteModePeer +type VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddress struct { + // The peer autonomous system number (ASN) for this VPN gateway connection. + Asn *int64 `json:"asn" validate:"required"` + + // The peer IKE identity. + IkeIdentity VPNGatewayConnectionIkeIdentityIntf `json:"ike_identity" validate:"required"` + + // Indicates whether `peer.address` or `peer.fqdn` is used. + Type *string `json:"type" validate:"required"` + + // The IP address of the peer VPN gateway for this connection. + Address *string `json:"address" validate:"required"` +} + +// Constants associated with the VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddress.Type property. +// Indicates whether `peer.address` or `peer.fqdn` is used. +const ( + VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddressTypeAddressConst = "address" + VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddressTypeFqdnConst = "fqdn" +) + +func (*VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddress) isaVPNGatewayConnectionDynamicRouteModePeer() bool { + return true +} + +// UnmarshalVPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddress unmarshals an instance of VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddress from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddress(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddress) + err = core.UnmarshalPrimitive(m, "asn", &obj.Asn) + if err != nil { + err = core.SDKErrorf(err, "", "asn-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "ike_identity", &obj.IkeIdentity, UnmarshalVPNGatewayConnectionIkeIdentity) + if err != nil { + err = core.SDKErrorf(err, "", "ike_identity-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "address", &obj.Address) + if err != nil { + err = core.SDKErrorf(err, "", "address-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFqdn : VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFqdn struct +// This model "extends" VPNGatewayConnectionDynamicRouteModePeer +type VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFqdn struct { + // The peer autonomous system number (ASN) for this VPN gateway connection. + Asn *int64 `json:"asn" validate:"required"` + + // The peer IKE identity. + IkeIdentity VPNGatewayConnectionIkeIdentityIntf `json:"ike_identity" validate:"required"` + + // Indicates whether `peer.address` or `peer.fqdn` is used. + Type *string `json:"type" validate:"required"` + + // The FQDN of the peer VPN gateway for this connection. + Fqdn *string `json:"fqdn" validate:"required"` +} + +// Constants associated with the VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFqdn.Type property. +// Indicates whether `peer.address` or `peer.fqdn` is used. +const ( + VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFqdnTypeAddressConst = "address" + VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFqdnTypeFqdnConst = "fqdn" +) + +func (*VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFqdn) isaVPNGatewayConnectionDynamicRouteModePeer() bool { + return true +} + +// UnmarshalVPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFqdn unmarshals an instance of VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFqdn from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFqdn(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFqdn) + err = core.UnmarshalPrimitive(m, "asn", &obj.Asn) + if err != nil { + err = core.SDKErrorf(err, "", "asn-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "ike_identity", &obj.IkeIdentity, UnmarshalVPNGatewayConnectionIkeIdentity) + if err != nil { + err = core.SDKErrorf(err, "", "ike_identity-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "type", &obj.Type) + if err != nil { + err = core.SDKErrorf(err, "", "type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "fqdn", &obj.Fqdn) + if err != nil { + err = core.SDKErrorf(err, "", "fqdn-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // VPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityFqdn : VPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityFqdn struct // This model "extends" VPNGatewayConnectionIkeIdentityPrototype type VPNGatewayConnectionIkeIdentityPrototypeVPNGatewayConnectionIkeIdentityFqdn struct { @@ -137453,6 +142345,77 @@ func UnmarshalVPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByID(m return } +// VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch : The peer VPN gateway for this connection. If `peer.type` is `ipv4_address`, only `peer.address` may be specified. If +// `peer.type` is fqdn, only `peer.fqdn` may be specified. +// Models which "extend" this model: +// - VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch +// - VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch +// This model "extends" VPNGatewayConnectionPeerPatch +type VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch struct { + // The peer autonomous system number (ASN) for this VPN gateway connection. The ASN values in the + // [restricted ASN list]( + // https://cloud.ibm.com/docs/vpc?topic=vpc-planning-considerations-vpn#dynamic-route-based-considerations) are + // reserved and unavailable. + Asn *int64 `json:"asn,omitempty"` + + // The IP address of the peer VPN gateway for this connection. + Address *string `json:"address,omitempty"` + + // The FQDN of the peer VPN gateway for this connection. + Fqdn *string `json:"fqdn,omitempty"` +} + +func (*VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch) isaVPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch() bool { + return true +} + +type VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchIntf interface { + VPNGatewayConnectionPeerPatchIntf + isaVPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch() bool +} + +func (*VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch) isaVPNGatewayConnectionPeerPatch() bool { + return true +} + +// UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch unmarshals an instance of VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch) + err = core.UnmarshalPrimitive(m, "asn", &obj.Asn) + if err != nil { + err = core.SDKErrorf(err, "", "asn-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "address", &obj.Address) + if err != nil { + err = core.SDKErrorf(err, "", "address-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "fqdn", &obj.Fqdn) + if err != nil { + err = core.SDKErrorf(err, "", "fqdn-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// asPatch returns a generic map representation of the VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch +func (vpnGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch *VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch) asPatch() (_patch map[string]interface{}) { + _patch = map[string]interface{}{} + if !core.IsNil(vpnGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch.Asn) { + _patch["asn"] = vpnGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch.Asn + } + if !core.IsNil(vpnGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch.Address) { + _patch["address"] = vpnGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch.Address + } + if !core.IsNil(vpnGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch.Fqdn) { + _patch["fqdn"] = vpnGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch.Fqdn + } + + return +} + // VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch : The peer VPN gateway for this connection. If `peer.type` is `ipv4_address`, only `peer.address` may be specified. If // `peer.type` is fqdn, only `peer.fqdn` may be specified. // Models which "extend" this model: @@ -137994,6 +142957,158 @@ func UnmarshalVPNGatewayConnectionPolicyModePeerVPNGatewayConnectionPeerByFqdn(m return } +// VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype : VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype struct +// This model "extends" VPNGatewayConnectionPrototype +type VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype struct { + // If set to false, the VPN gateway connection is shut down. + AdminStateUp *bool `json:"admin_state_up,omitempty"` + + DeadPeerDetection *VPNGatewayConnectionDpdPrototype `json:"dead_peer_detection,omitempty"` + + // The establish mode of the VPN gateway connection: + // - `bidirectional`: Either side of the VPN gateway can initiate IKE protocol + // negotiations or rekeying processes. + // - `peer_only`: Only the peer can initiate IKE protocol negotiations for this VPN gateway + // connection. Additionally, the peer is responsible for initiating the rekeying process + // after the connection is established. If rekeying does not occur, the VPN gateway + // connection will be brought down after its lifetime expires. + EstablishMode *string `json:"establish_mode,omitempty"` + + IkePolicy VPNGatewayConnectionIkePolicyPrototypeIntf `json:"ike_policy,omitempty"` + + IpsecPolicy VPNGatewayConnectionIPsecPolicyPrototypeIntf `json:"ipsec_policy,omitempty"` + + // The name for this VPN gateway connection. The name must not be used by another connection for the VPN gateway. If + // unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + // The pre-shared key. + Psk *string `json:"psk" validate:"required"` + + // Indicates whether the traffic is distributed between the `up` tunnels of the VPN gateway connection when the VPC + // route's next hop is a VPN connection. If `false`, the traffic is only routed through the `up` tunnel with the lower + // `public_ip` address. Before enabling it on VPN connections to on-prem private networks, review + // [distributing traffic + // restrictions](https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-limitations#distributing-traffic-restrictions). + DistributeTraffic *bool `json:"distribute_traffic,omitempty"` + + Local *VPNGatewayConnectionDynamicRouteModeLocalPrototype `json:"local,omitempty"` + + Peer VPNGatewayConnectionDynamicRouteModePeerPrototypeIntf `json:"peer" validate:"required"` + + // The routing protocol for this VPN gateway connection. + RoutingProtocol *string `json:"routing_protocol" validate:"required"` + + // The VPN tunnel configuration to use for this VPN gateway connection + // (in dynamic route mode). + Tunnels []VPNGatewayConnectionTunnelPrototype `json:"tunnels" validate:"required"` +} + +// Constants associated with the VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype.EstablishMode property. +// The establish mode of the VPN gateway connection: +// - `bidirectional`: Either side of the VPN gateway can initiate IKE protocol +// negotiations or rekeying processes. +// - `peer_only`: Only the peer can initiate IKE protocol negotiations for this VPN gateway +// connection. Additionally, the peer is responsible for initiating the rekeying process +// after the connection is established. If rekeying does not occur, the VPN gateway +// connection will be brought down after its lifetime expires. +const ( + VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototypeEstablishModeBidirectionalConst = "bidirectional" + VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototypeEstablishModePeerOnlyConst = "peer_only" +) + +// Constants associated with the VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype.RoutingProtocol property. +// The routing protocol for this VPN gateway connection. +const ( + VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototypeRoutingProtocolBgpConst = "bgp" +) + +// NewVPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype : Instantiate VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype (Generic Model Constructor) +func (*VpcV1) NewVPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype(psk string, peer VPNGatewayConnectionDynamicRouteModePeerPrototypeIntf, routingProtocol string, tunnels []VPNGatewayConnectionTunnelPrototype) (_model *VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype, err error) { + _model = &VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype{ + Psk: core.StringPtr(psk), + Peer: peer, + RoutingProtocol: core.StringPtr(routingProtocol), + Tunnels: tunnels, + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +func (*VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype) isaVPNGatewayConnectionPrototype() bool { + return true +} + +// UnmarshalVPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype unmarshals an instance of VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype) + err = core.UnmarshalPrimitive(m, "admin_state_up", &obj.AdminStateUp) + if err != nil { + err = core.SDKErrorf(err, "", "admin_state_up-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "dead_peer_detection", &obj.DeadPeerDetection, UnmarshalVPNGatewayConnectionDpdPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "dead_peer_detection-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "establish_mode", &obj.EstablishMode) + if err != nil { + err = core.SDKErrorf(err, "", "establish_mode-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "ike_policy", &obj.IkePolicy, UnmarshalVPNGatewayConnectionIkePolicyPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "ike_policy-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "ipsec_policy", &obj.IpsecPolicy, UnmarshalVPNGatewayConnectionIPsecPolicyPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "ipsec_policy-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "psk", &obj.Psk) + if err != nil { + err = core.SDKErrorf(err, "", "psk-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "distribute_traffic", &obj.DistributeTraffic) + if err != nil { + err = core.SDKErrorf(err, "", "distribute_traffic-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "local", &obj.Local, UnmarshalVPNGatewayConnectionDynamicRouteModeLocalPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "local-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "peer", &obj.Peer, UnmarshalVPNGatewayConnectionDynamicRouteModePeerPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "peer-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "routing_protocol", &obj.RoutingProtocol) + if err != nil { + err = core.SDKErrorf(err, "", "routing_protocol-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "tunnels", &obj.Tunnels, UnmarshalVPNGatewayConnectionTunnelPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "tunnels-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype : VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype struct // This model "extends" VPNGatewayConnectionPrototype type VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype struct { @@ -138254,6 +143369,7 @@ func UnmarshalVPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePr // VPNGatewayConnectionRouteMode : VPNGatewayConnectionRouteMode struct // Models which "extend" this model: // - VPNGatewayConnectionRouteModeVPNGatewayConnectionStaticRouteMode +// - VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode // This model "extends" VPNGatewayConnection type VPNGatewayConnectionRouteMode struct { // If set to false, the VPN gateway connection is shut down. @@ -138408,7 +143524,12 @@ func UnmarshalVPNGatewayConnectionRouteMode(m map[string]json.RawMessage, result err = core.SDKErrorf(err, "required discriminator property 'routing_protocol' not found in JSON object", "missing-discriminator", common.GetComponentInfo()) return } - if discValue == "none" { + if discValue == "bgp" { + err = core.UnmarshalModel(m, "", result, UnmarshalVPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode) + if err != nil { + err = core.SDKErrorf(err, "", "unmarshal-VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode-error", common.GetComponentInfo()) + } + } else if discValue == "none" { err = core.UnmarshalModel(m, "", result, UnmarshalVPNGatewayConnectionRouteModeVPNGatewayConnectionStaticRouteMode) if err != nil { err = core.SDKErrorf(err, "", "unmarshal-VPNGatewayConnectionRouteModeVPNGatewayConnectionStaticRouteMode-error", common.GetComponentInfo()) @@ -138869,6 +143990,16 @@ type VPNGatewayPrototypeVPNGatewayRouteModePrototype struct { Subnet SubnetIdentityIntf `json:"subnet" validate:"required"` + // The static CIDRs advertised through any enabled routing protocol (for example, BGP). The routing protocol will + // advertise routes with these CIDRs as route destinations. + AdvertisedCIDRs []string `json:"advertised_cidrs,omitempty"` + + // The local autonomous system number (ASN) for this VPN gateway and its connections. The ASN values in the + // [restricted ASN list]( + // https://cloud.ibm.com/docs/vpc?topic=vpc-planning-considerations-vpn#dynamic-route-based-considerations) are + // reserved and unavailable. + LocalAsn *int64 `json:"local_asn,omitempty"` + // The mode for this VPN gateway. Mode *string `json:"mode,omitempty"` } @@ -138913,6 +144044,16 @@ func UnmarshalVPNGatewayPrototypeVPNGatewayRouteModePrototype(m map[string]json. err = core.SDKErrorf(err, "", "subnet-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "advertised_cidrs", &obj.AdvertisedCIDRs) + if err != nil { + err = core.SDKErrorf(err, "", "advertised_cidrs-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "local_asn", &obj.LocalAsn) + if err != nil { + err = core.SDKErrorf(err, "", "local_asn-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) if err != nil { err = core.SDKErrorf(err, "", "mode-error", common.GetComponentInfo()) @@ -138975,6 +144116,13 @@ type VPNGatewayRouteMode struct { // The VPC this VPN gateway resides in. VPC *VPCReference `json:"vpc" validate:"required"` + // The static CIDRs advertised through any enabled routing protocol (for example, BGP). The routing protocol will + // advertise routes with these CIDRs as route destinations. + AdvertisedCIDRs []string `json:"advertised_cidrs" validate:"required"` + + // The local autonomous system number (ASN) for this VPN gateway and its connections. + LocalAsn *int64 `json:"local_asn" validate:"required"` + // The mode for this VPN gateway. Mode *string `json:"mode" validate:"required"` } @@ -139100,6 +144248,16 @@ func UnmarshalVPNGatewayRouteMode(m map[string]json.RawMessage, result interface err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "advertised_cidrs", &obj.AdvertisedCIDRs) + if err != nil { + err = core.SDKErrorf(err, "", "advertised_cidrs-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "local_asn", &obj.LocalAsn) + if err != nil { + err = core.SDKErrorf(err, "", "local_asn-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) if err != nil { err = core.SDKErrorf(err, "", "mode-error", common.GetComponentInfo()) @@ -139109,6 +144267,51 @@ func UnmarshalVPNGatewayRouteMode(m map[string]json.RawMessage, result interface return } +// VPNGatewayServiceConnectionCreatorTransitGatewayReference : VPNGatewayServiceConnectionCreatorTransitGatewayReference struct +// This model "extends" VPNGatewayServiceConnectionCreator +type VPNGatewayServiceConnectionCreatorTransitGatewayReference struct { + // The CRN for this transit gateway. + CRN *string `json:"crn" validate:"required"` + + // The unique identifier for this transit gateway. + ID *string `json:"id" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` +} + +// Constants associated with the VPNGatewayServiceConnectionCreatorTransitGatewayReference.ResourceType property. +// The resource type. +const ( + VPNGatewayServiceConnectionCreatorTransitGatewayReferenceResourceTypeTransitGatewayConst = "transit_gateway" +) + +func (*VPNGatewayServiceConnectionCreatorTransitGatewayReference) isaVPNGatewayServiceConnectionCreator() bool { + return true +} + +// UnmarshalVPNGatewayServiceConnectionCreatorTransitGatewayReference unmarshals an instance of VPNGatewayServiceConnectionCreatorTransitGatewayReference from the specified map of raw messages. +func UnmarshalVPNGatewayServiceConnectionCreatorTransitGatewayReference(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayServiceConnectionCreatorTransitGatewayReference) + err = core.UnmarshalPrimitive(m, "crn", &obj.CRN) + if err != nil { + err = core.SDKErrorf(err, "", "crn-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + err = core.SDKErrorf(err, "", "resource_type-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // VPNServerAuthenticationByCertificate : VPNServerAuthenticationByCertificate struct // This model "extends" VPNServerAuthentication type VPNServerAuthenticationByCertificate struct { @@ -142966,45 +148169,44 @@ func UnmarshalInstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceCl return } -// InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec : InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec struct -// Models which "extend" this model: -// - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup -// - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager +// InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup : InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup struct // This model "extends" InstanceGroupManagerActionPrototypeScheduledActionPrototype -type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec struct { +type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup struct { // The name for this instance group manager action. The name must not be used by another action for the instance group // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min // period. - CronSpec *string `json:"cron_spec,omitempty"` - - Group *InstanceGroupManagerScheduledActionGroupPrototype `json:"group,omitempty"` - - Manager InstanceGroupManagerScheduledActionManagerPrototypeIntf `json:"manager,omitempty"` -} + CronSpec *string `json:"cron_spec" validate:"required"` -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec) isaInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec() bool { - return true + Group *InstanceGroupManagerScheduledActionGroupPrototype `json:"group" validate:"required"` } -type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecIntf interface { - InstanceGroupManagerActionPrototypeScheduledActionPrototypeIntf - isaInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec() bool +// NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup : Instantiate InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup (Generic Model Constructor) +func (*VpcV1) NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup(cronSpec string, group *InstanceGroupManagerScheduledActionGroupPrototype) (_model *InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup, err error) { + _model = &InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup{ + CronSpec: core.StringPtr(cronSpec), + Group: group, + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return } -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec) isaInstanceGroupManagerActionPrototypeScheduledActionPrototype() bool { +func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup) isaInstanceGroupManagerActionPrototypeScheduledActionPrototype() bool { return true } -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec) isaInstanceGroupManagerActionPrototype() bool { +func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup) isaInstanceGroupManagerActionPrototype() bool { return true } -// UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec unmarshals an instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec) +// UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup unmarshals an instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup from the specified map of raw messages. +func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) @@ -143020,6 +148222,58 @@ func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronS err = core.SDKErrorf(err, "", "group-error", common.GetComponentInfo()) return } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager : InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager struct +// This model "extends" InstanceGroupManagerActionPrototypeScheduledActionPrototype +type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager struct { + // The name for this instance group manager action. The name must not be used by another action for the instance group + // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min + // period. + CronSpec *string `json:"cron_spec" validate:"required"` + + Manager InstanceGroupManagerScheduledActionManagerPrototypeIntf `json:"manager" validate:"required"` +} + +// NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager : Instantiate InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager (Generic Model Constructor) +func (*VpcV1) NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager(cronSpec string, manager InstanceGroupManagerScheduledActionManagerPrototypeIntf) (_model *InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager, err error) { + _model = &InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager{ + CronSpec: core.StringPtr(cronSpec), + Manager: manager, + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager) isaInstanceGroupManagerActionPrototypeScheduledActionPrototype() bool { + return true +} + +func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager) isaInstanceGroupManagerActionPrototype() bool { + return true +} + +// UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager unmarshals an instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager from the specified map of raw messages. +func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) + if err != nil { + err = core.SDKErrorf(err, "", "cron_spec-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerScheduledActionManagerPrototype) if err != nil { err = core.SDKErrorf(err, "", "manager-error", common.GetComponentInfo()) @@ -143029,57 +148283,102 @@ func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronS return } -// InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt : InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt struct -// Models which "extend" this model: -// - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup -// - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager +// InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup : InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup struct // This model "extends" InstanceGroupManagerActionPrototypeScheduledActionPrototype -type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt struct { +type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup struct { // The name for this instance group manager action. The name must not be used by another action for the instance group // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. Name *string `json:"name,omitempty"` - // The date and time the scheduled action will run. - RunAt *strfmt.DateTime `json:"run_at,omitempty"` - - Group *InstanceGroupManagerScheduledActionGroupPrototype `json:"group,omitempty"` - - Manager InstanceGroupManagerScheduledActionManagerPrototypeIntf `json:"manager,omitempty"` -} + Group *InstanceGroupManagerScheduledActionGroupPrototype `json:"group" validate:"required"` -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt) isaInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt() bool { - return true + // The date and time the scheduled action will run. + RunAt *strfmt.DateTime `json:"run_at" validate:"required"` } -type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtIntf interface { - InstanceGroupManagerActionPrototypeScheduledActionPrototypeIntf - isaInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt() bool +// NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup : Instantiate InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup (Generic Model Constructor) +func (*VpcV1) NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup(group *InstanceGroupManagerScheduledActionGroupPrototype, runAt *strfmt.DateTime) (_model *InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup, err error) { + _model = &InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup{ + Group: group, + RunAt: runAt, + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return } -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt) isaInstanceGroupManagerActionPrototypeScheduledActionPrototype() bool { +func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup) isaInstanceGroupManagerActionPrototypeScheduledActionPrototype() bool { return true } -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt) isaInstanceGroupManagerActionPrototype() bool { +func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup) isaInstanceGroupManagerActionPrototype() bool { return true } -// UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt unmarshals an instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt) +// UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup unmarshals an instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup from the specified map of raw messages. +func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup) err = core.UnmarshalPrimitive(m, "name", &obj.Name) if err != nil { err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } + err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerScheduledActionGroupPrototype) + if err != nil { + err = core.SDKErrorf(err, "", "group-error", common.GetComponentInfo()) + return + } err = core.UnmarshalPrimitive(m, "run_at", &obj.RunAt) if err != nil { err = core.SDKErrorf(err, "", "run_at-error", common.GetComponentInfo()) return } - err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerScheduledActionGroupPrototype) + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager : InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager struct +// This model "extends" InstanceGroupManagerActionPrototypeScheduledActionPrototype +type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager struct { + // The name for this instance group manager action. The name must not be used by another action for the instance group + // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. + Name *string `json:"name,omitempty"` + + Manager InstanceGroupManagerScheduledActionManagerPrototypeIntf `json:"manager" validate:"required"` + + // The date and time the scheduled action will run. + RunAt *strfmt.DateTime `json:"run_at" validate:"required"` +} + +// NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager : Instantiate InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager (Generic Model Constructor) +func (*VpcV1) NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager(manager InstanceGroupManagerScheduledActionManagerPrototypeIntf, runAt *strfmt.DateTime) (_model *InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager, err error) { + _model = &InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager{ + Manager: manager, + RunAt: runAt, + } + err = core.ValidateStruct(_model, "required parameters") if err != nil { - err = core.SDKErrorf(err, "", "group-error", common.GetComponentInfo()) + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager) isaInstanceGroupManagerActionPrototypeScheduledActionPrototype() bool { + return true +} + +func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager) isaInstanceGroupManagerActionPrototype() bool { + return true +} + +// UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager unmarshals an instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager from the specified map of raw messages. +func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager) + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) return } err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerScheduledActionManagerPrototype) @@ -143087,6 +148386,11 @@ func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt err = core.SDKErrorf(err, "", "manager-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "run_at", &obj.RunAt) + if err != nil { + err = core.SDKErrorf(err, "", "run_at-error", common.GetComponentInfo()) + return + } reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) return } @@ -144362,7 +149666,8 @@ type InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstance // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -144381,6 +149686,12 @@ type InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstance // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -144412,6 +149723,16 @@ const ( InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachmentConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachmentVolumeBandwidthQosModePooledConst = "pooled" + InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachmentVolumeBandwidthQosModeWeightedConst = "weighted" +) + // NewInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment : Instantiate InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment (Generic Model Constructor) func (*VpcV1) NewInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment(catalogOffering InstanceCatalogOfferingPrototypeIntf, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment, err error) { _model = &InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment{ @@ -144512,6 +149833,11 @@ func UnmarshalInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferin err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -144599,7 +149925,8 @@ type InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstance // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -144618,6 +149945,12 @@ type InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstance // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -144649,6 +149982,16 @@ const ( InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterfaceConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterfaceVolumeBandwidthQosModePooledConst = "pooled" + InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterfaceVolumeBandwidthQosModeWeightedConst = "weighted" +) + // NewInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface : Instantiate InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface (Generic Model Constructor) func (*VpcV1) NewInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface(catalogOffering InstanceCatalogOfferingPrototypeIntf, zone ZoneIdentityIntf, primaryNetworkInterface *NetworkInterfacePrototype) (_model *InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface, err error) { _model = &InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface{ @@ -144749,6 +150092,11 @@ func UnmarshalInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferin err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -144836,7 +150184,8 @@ type InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -144855,6 +150204,12 @@ type InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -144887,6 +150242,16 @@ const ( InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachmentConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachmentVolumeBandwidthQosModePooledConst = "pooled" + InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachmentVolumeBandwidthQosModeWeightedConst = "weighted" +) + // NewInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment : Instantiate InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment (Generic Model Constructor) func (*VpcV1) NewInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment(image ImageIdentityIntf, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment, err error) { _model = &InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment{ @@ -144987,6 +150352,11 @@ func UnmarshalInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAt err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -145074,7 +150444,8 @@ type InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface s // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -145093,6 +150464,12 @@ type InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface s // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -145125,6 +150502,16 @@ const ( InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterfaceConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterfaceVolumeBandwidthQosModePooledConst = "pooled" + InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterfaceVolumeBandwidthQosModeWeightedConst = "weighted" +) + // NewInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface : Instantiate InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface (Generic Model Constructor) func (*VpcV1) NewInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface(image ImageIdentityIntf, zone ZoneIdentityIntf, primaryNetworkInterface *NetworkInterfacePrototype) (_model *InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface, err error) { _model = &InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface{ @@ -145225,6 +150612,11 @@ func UnmarshalInstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkIn err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -145312,7 +150704,8 @@ type InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceBy // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -145331,6 +150724,12 @@ type InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceBy // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -145360,6 +150759,16 @@ const ( InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachmentConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachmentVolumeBandwidthQosModePooledConst = "pooled" + InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachmentVolumeBandwidthQosModeWeightedConst = "weighted" +) + // NewInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment : Instantiate InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment (Generic Model Constructor) func (*VpcV1) NewInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment, err error) { _model = &InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment{ @@ -145460,6 +150869,11 @@ func UnmarshalInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotI err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -145542,7 +150956,8 @@ type InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceBy // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -145561,6 +150976,12 @@ type InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceBy // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -145590,6 +151011,16 @@ const ( InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterfaceConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterfaceVolumeBandwidthQosModePooledConst = "pooled" + InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterfaceVolumeBandwidthQosModeWeightedConst = "weighted" +) + // NewInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface : Instantiate InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface (Generic Model Constructor) func (*VpcV1) NewInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext, zone ZoneIdentityIntf, primaryNetworkInterface *NetworkInterfacePrototype) (_model *InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface, err error) { _model = &InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface{ @@ -145690,6 +151121,11 @@ func UnmarshalInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotI err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -145772,7 +151208,8 @@ type InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachmen // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -145791,6 +151228,12 @@ type InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachmen // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -145820,6 +151263,16 @@ const ( InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachmentConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachmentVolumeBandwidthQosModePooledConst = "pooled" + InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachmentVolumeBandwidthQosModeWeightedConst = "weighted" +) + // NewInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment : Instantiate InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment (Generic Model Constructor) func (*VpcV1) NewInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceByVolumeContext, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment, err error) { _model = &InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment{ @@ -145920,6 +151373,11 @@ func UnmarshalInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetwork err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -146002,7 +151460,8 @@ type InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -146021,6 +151480,12 @@ type InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -146050,6 +151515,16 @@ const ( InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterfaceConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterfaceVolumeBandwidthQosModePooledConst = "pooled" + InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterfaceVolumeBandwidthQosModeWeightedConst = "weighted" +) + // NewInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface : Instantiate InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface (Generic Model Constructor) func (*VpcV1) NewInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceByVolumeContext, zone ZoneIdentityIntf, primaryNetworkInterface *NetworkInterfacePrototype) (_model *InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface, err error) { _model = &InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface{ @@ -146150,6 +151625,11 @@ func UnmarshalInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetwork err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -146230,7 +151710,8 @@ type InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateB // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -146249,6 +151730,12 @@ type InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateB // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -146280,6 +151767,16 @@ const ( InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachmentConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachmentVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachmentVolumeBandwidthQosModeWeightedConst = "weighted" +) + // NewInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment : Instantiate InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment (Generic Model Constructor) func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment(catalogOffering InstanceCatalogOfferingPrototypeIntf, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment, err error) { _model = &InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment{ @@ -146380,6 +151877,11 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstance err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -146465,7 +151967,8 @@ type InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateB // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -146484,6 +151987,12 @@ type InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateB // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -146515,6 +152024,16 @@ const ( InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterfaceConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterfaceVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterfaceVolumeBandwidthQosModeWeightedConst = "weighted" +) + // NewInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface : Instantiate InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface (Generic Model Constructor) func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface(catalogOffering InstanceCatalogOfferingPrototypeIntf, zone ZoneIdentityIntf, primaryNetworkInterface *NetworkInterfacePrototype) (_model *InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface, err error) { _model = &InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface{ @@ -146615,6 +152134,11 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstance err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -146700,7 +152224,8 @@ type InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInst // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -146719,6 +152244,12 @@ type InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInst // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -146751,6 +152282,16 @@ const ( InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachmentConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachmentVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachmentVolumeBandwidthQosModeWeightedConst = "weighted" +) + // NewInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment : Instantiate InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment (Generic Model Constructor) func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment(image ImageIdentityIntf, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment, err error) { _model = &InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment{ @@ -146851,6 +152392,11 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateBy err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -146936,7 +152482,8 @@ type InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInst // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -146955,6 +152502,12 @@ type InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInst // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -146987,6 +152540,16 @@ const ( InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterfaceConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterfaceVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterfaceVolumeBandwidthQosModeWeightedConst = "weighted" +) + // NewInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface : Instantiate InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface (Generic Model Constructor) func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface(image ImageIdentityIntf, zone ZoneIdentityIntf, primaryNetworkInterface *NetworkInterfacePrototype) (_model *InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface, err error) { _model = &InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface{ @@ -147087,6 +152650,11 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateBy err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -147172,7 +152740,8 @@ type InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBy // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -147191,6 +152760,12 @@ type InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBy // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -147220,6 +152795,16 @@ const ( InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachmentConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachmentVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachmentVolumeBandwidthQosModeWeightedConst = "weighted" +) + // NewInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment : Instantiate InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment (Generic Model Constructor) func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext, zone ZoneIdentityIntf, primaryNetworkAttachment *InstanceNetworkAttachmentPrototype) (_model *InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment, err error) { _model = &InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment{ @@ -147320,6 +152905,11 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceT err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -147400,7 +152990,8 @@ type InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBy // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -147419,6 +153010,12 @@ type InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBy // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -147448,6 +153045,16 @@ const ( InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterfaceConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterfaceVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterfaceVolumeBandwidthQosModeWeightedConst = "weighted" +) + // NewInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface : Instantiate InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface (Generic Model Constructor) func (*VpcV1) NewInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface(bootVolumeAttachment *VolumeAttachmentPrototypeInstanceBySourceSnapshotContext, zone ZoneIdentityIntf, primaryNetworkInterface *NetworkInterfacePrototype) (_model *InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface, err error) { _model = &InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface{ @@ -147548,6 +153155,11 @@ func UnmarshalInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceT err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -147639,7 +153251,8 @@ type InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByC // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -147659,6 +153272,12 @@ type InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByC // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -147690,6 +153309,16 @@ const ( InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachmentConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachmentVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachmentVolumeBandwidthQosModeWeightedConst = "weighted" +) + func (*InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment) isaInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext() bool { return true } @@ -147796,6 +153425,11 @@ func UnmarshalInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextIn err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -147892,7 +153526,8 @@ type InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByC // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -147912,6 +153547,12 @@ type InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByC // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -147943,6 +153584,16 @@ const ( InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterfaceConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterfaceVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterfaceVolumeBandwidthQosModeWeightedConst = "weighted" +) + func (*InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface) isaInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext() bool { return true } @@ -148049,6 +153700,11 @@ func UnmarshalInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextIn err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -148145,7 +153801,8 @@ type InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstan // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -148165,6 +153822,12 @@ type InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstan // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -148197,6 +153860,16 @@ const ( InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachmentConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachmentVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachmentVolumeBandwidthQosModeWeightedConst = "weighted" +) + func (*InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment) isaInstanceTemplateInstanceByImageInstanceTemplateContext() bool { return true } @@ -148303,6 +153976,11 @@ func UnmarshalInstanceTemplateInstanceByImageInstanceTemplateContextInstanceByIm err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -148399,7 +154077,8 @@ type InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstan // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -148419,6 +154098,12 @@ type InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstan // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -148451,6 +154136,16 @@ const ( InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterfaceConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterfaceVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterfaceVolumeBandwidthQosModeWeightedConst = "weighted" +) + func (*InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface) isaInstanceTemplateInstanceByImageInstanceTemplateContext() bool { return true } @@ -148557,6 +154252,11 @@ func UnmarshalInstanceTemplateInstanceByImageInstanceTemplateContextInstanceByIm err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -148653,7 +154353,8 @@ type InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySo // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -148673,6 +154374,12 @@ type InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySo // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -148705,6 +154412,16 @@ const ( InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachmentConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachmentVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachmentVolumeBandwidthQosModeWeightedConst = "weighted" +) + func (*InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment) isaInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext() bool { return true } @@ -148811,6 +154528,11 @@ func UnmarshalInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextIns err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -148907,7 +154629,8 @@ type InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySo // The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this virtual server instance. // - // If unspecified, `bx2-2x8` will be used, but this default value is expected to change in the future. + // If unspecified, `bxf-2x8` will be used, but this default value may change in the future without changing the API + // version. Profile InstanceProfileIdentityIntf `json:"profile,omitempty"` ReservationAffinity *InstanceReservationAffinityPrototype `json:"reservation_affinity,omitempty"` @@ -148927,6 +154650,12 @@ type InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySo // The additional volume attachments to create for the virtual server instance. VolumeAttachments []VolumeAttachmentPrototype `json:"volume_attachments,omitempty"` + // The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + // instance profile's `volume_bandwidth_qos_modes`. + // + // If unspecified, the default volume bandwidth QoS mode from the profile will be used. + VolumeBandwidthQosMode *string `json:"volume_bandwidth_qos_mode,omitempty"` + // The VPC this virtual server instance will reside in. // // If specified, it must match the VPC for the subnets of the instance network attachments or instance network @@ -148962,6 +154691,16 @@ const ( InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterfaceConfidentialComputeModeTdxConst = "tdx" ) +// Constants associated with the InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface.VolumeBandwidthQosMode property. +// The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the +// instance profile's `volume_bandwidth_qos_modes`. +// +// If unspecified, the default volume bandwidth QoS mode from the profile will be used. +const ( + InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterfaceVolumeBandwidthQosModePooledConst = "pooled" + InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterfaceVolumeBandwidthQosModeWeightedConst = "weighted" +) + func (*InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface) isaInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext() bool { return true } @@ -149068,6 +154807,11 @@ func UnmarshalInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextIns err = core.SDKErrorf(err, "", "volume_attachments-error", common.GetComponentInfo()) return } + err = core.UnmarshalPrimitive(m, "volume_bandwidth_qos_mode", &obj.VolumeBandwidthQosMode) + if err != nil { + err = core.SDKErrorf(err, "", "volume_bandwidth_qos_mode-error", common.GetComponentInfo()) + return + } err = core.UnmarshalModel(m, "vpc", &obj.VPC, UnmarshalVPCIdentity) if err != nil { err = core.SDKErrorf(err, "", "vpc-error", common.GetComponentInfo()) @@ -149753,6 +155497,104 @@ func (loadBalancerPoolMemberTargetPrototypeLoadBalancerIdentityLoadBalancerIdent return } +// LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref : LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref struct +// This model "extends" LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity +type LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref struct { + // The URL for this reserved IP. + Href *string `json:"href" validate:"required"` +} + +// NewLoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref : Instantiate LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref (Generic Model Constructor) +func (*VpcV1) NewLoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref(href string) (_model *LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref, err error) { + _model = &LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref{ + Href: core.StringPtr(href), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +func (*LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref) isaLoadBalancerPoolMemberTargetPrototypeReservedIPIdentity() bool { + return true +} + +func (*LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref) isaLoadBalancerPoolMemberTargetPrototype() bool { + return true +} + +// UnmarshalLoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref unmarshals an instance of LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref from the specified map of raw messages. +func UnmarshalLoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref) + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// asPatch returns a generic map representation of the LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref +func (loadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref *LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref) asPatch() (_patch map[string]interface{}) { + _patch = map[string]interface{}{} + if !core.IsNil(loadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref.Href) { + _patch["href"] = loadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref.Href + } + + return +} + +// LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID : LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID struct +// This model "extends" LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity +type LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID struct { + // The unique identifier for this reserved IP. + ID *string `json:"id" validate:"required"` +} + +// NewLoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID : Instantiate LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID (Generic Model Constructor) +func (*VpcV1) NewLoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID(id string) (_model *LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID, err error) { + _model = &LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID{ + ID: core.StringPtr(id), + } + err = core.ValidateStruct(_model, "required parameters") + if err != nil { + err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) + } + return +} + +func (*LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID) isaLoadBalancerPoolMemberTargetPrototypeReservedIPIdentity() bool { + return true +} + +func (*LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID) isaLoadBalancerPoolMemberTargetPrototype() bool { + return true +} + +// UnmarshalLoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID unmarshals an instance of LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID from the specified map of raw messages. +func UnmarshalLoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID) + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// asPatch returns a generic map representation of the LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID +func (loadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID *LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID) asPatch() (_patch map[string]interface{}) { + _patch = map[string]interface{}{} + if !core.IsNil(loadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID.ID) { + _patch["id"] = loadBalancerPoolMemberTargetPrototypeReservedIPIdentityByID.ID + } + + return +} + // NetworkInterfaceIPPrototypeReservedIPIdentityByHref : NetworkInterfaceIPPrototypeReservedIPIdentityByHref struct // This model "extends" NetworkInterfaceIPPrototypeReservedIPIdentity type NetworkInterfaceIPPrototypeReservedIPIdentityByHref struct { @@ -151091,6 +156933,108 @@ func UnmarshalShareSourceSnapshotPrototypeShareSnapshotIdentityShareSnapshotIden return } +// VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch : VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch struct +// This model "extends" VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch +type VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch struct { + // The peer autonomous system number (ASN) for this VPN gateway connection. The ASN values in the + // [restricted ASN list]( + // https://cloud.ibm.com/docs/vpc?topic=vpc-planning-considerations-vpn#dynamic-route-based-considerations) are + // reserved and unavailable. + Asn *int64 `json:"asn,omitempty"` + + // The IP address of the peer VPN gateway for this connection. + Address *string `json:"address,omitempty"` +} + +func (*VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch) isaVPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch() bool { + return true +} + +func (*VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch) isaVPNGatewayConnectionPeerPatch() bool { + return true +} + +// UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch unmarshals an instance of VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch) + err = core.UnmarshalPrimitive(m, "asn", &obj.Asn) + if err != nil { + err = core.SDKErrorf(err, "", "asn-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "address", &obj.Address) + if err != nil { + err = core.SDKErrorf(err, "", "address-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// asPatch returns a generic map representation of the VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch +func (vpnGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch *VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch) asPatch() (_patch map[string]interface{}) { + _patch = map[string]interface{}{} + if !core.IsNil(vpnGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch.Asn) { + _patch["asn"] = vpnGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch.Asn + } + if !core.IsNil(vpnGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch.Address) { + _patch["address"] = vpnGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch.Address + } + + return +} + +// VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch : VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch struct +// This model "extends" VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch +type VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch struct { + // The peer autonomous system number (ASN) for this VPN gateway connection. The ASN values in the + // [restricted ASN list]( + // https://cloud.ibm.com/docs/vpc?topic=vpc-planning-considerations-vpn#dynamic-route-based-considerations) are + // reserved and unavailable. + Asn *int64 `json:"asn,omitempty"` + + // The FQDN of the peer VPN gateway for this connection. + Fqdn *string `json:"fqdn,omitempty"` +} + +func (*VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch) isaVPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch() bool { + return true +} + +func (*VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch) isaVPNGatewayConnectionPeerPatch() bool { + return true +} + +// UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch unmarshals an instance of VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch) + err = core.UnmarshalPrimitive(m, "asn", &obj.Asn) + if err != nil { + err = core.SDKErrorf(err, "", "asn-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "fqdn", &obj.Fqdn) + if err != nil { + err = core.SDKErrorf(err, "", "fqdn-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + +// asPatch returns a generic map representation of the VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch +func (vpnGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch *VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch) asPatch() (_patch map[string]interface{}) { + _patch = map[string]interface{}{} + if !core.IsNil(vpnGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch.Asn) { + _patch["asn"] = vpnGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch.Asn + } + if !core.IsNil(vpnGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch.Fqdn) { + _patch["fqdn"] = vpnGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFqdnPatch.Fqdn + } + + return +} + // VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch : VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch struct // This model "extends" VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch type VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch struct { @@ -151239,6 +157183,249 @@ func (vpnGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatchV return } +// VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode : VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode struct +// This model "extends" VPNGatewayConnectionRouteMode +type VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode struct { + // If set to false, the VPN gateway connection is shut down. + AdminStateUp *bool `json:"admin_state_up" validate:"required"` + + // The authentication mode. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + AuthenticationMode *string `json:"authentication_mode" validate:"required"` + + // The date and time that this VPN gateway connection was created. + CreatedAt *strfmt.DateTime `json:"created_at" validate:"required"` + + DeadPeerDetection *VPNGatewayConnectionDpd `json:"dead_peer_detection" validate:"required"` + + // The establish mode of the VPN gateway connection: + // - `bidirectional`: Either side of the VPN gateway can initiate IKE protocol + // negotiations or rekeying processes. + // - `peer_only`: Only the peer can initiate IKE protocol negotiations for this VPN gateway + // connection. Additionally, the peer is responsible for initiating the rekeying process + // after the connection is established. If rekeying does not occur, the VPN gateway + // connection will be brought down after its lifetime expires. + EstablishMode *string `json:"establish_mode" validate:"required"` + + // The URL for this VPN gateway connection. + Href *string `json:"href" validate:"required"` + + // The unique identifier for this VPN gateway connection. + ID *string `json:"id" validate:"required"` + + // The IKE policy. If absent, [auto-negotiation is + // used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ike-auto-negotiation-phase-1). + IkePolicy *IkePolicyReference `json:"ike_policy,omitempty"` + + // The IPsec policy. If absent, [auto-negotiation is + // used](https://cloud.ibm.com/docs/vpc?topic=vpc-using-vpn&interface=ui#ipsec-auto-negotiation-phase-2). + IpsecPolicy *IPsecPolicyReference `json:"ipsec_policy,omitempty"` + + // The mode of the VPN gateway. + // + // The enumerated values for this property may + // [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + Mode *string `json:"mode" validate:"required"` + + // The name for this VPN gateway connection. The name is unique across all connections for the VPN gateway. + Name *string `json:"name" validate:"required"` + + // The pre-shared key. + Psk *string `json:"psk" validate:"required"` + + // The resource type. + ResourceType *string `json:"resource_type" validate:"required"` + + // The status of a VPN gateway connection. + Status *string `json:"status" validate:"required"` + + // The reasons for the current VPN gateway connection status (if any). + StatusReasons []VPNGatewayConnectionStatusReason `json:"status_reasons" validate:"required"` + + // Indicates whether the traffic is distributed between the `up` tunnels of the VPN gateway connection when the VPC + // route's next hop is a VPN connection. If `false`, the traffic is only routed through the `up` tunnel with the lower + // `public_ip` address. + DistributeTraffic *bool `json:"distribute_traffic" validate:"required"` + + Local *VPNGatewayConnectionDynamicRouteModeLocal `json:"local" validate:"required"` + + Peer VPNGatewayConnectionDynamicRouteModePeerIntf `json:"peer" validate:"required"` + + // The routing protocol for this VPN gateway connection. + RoutingProtocol *string `json:"routing_protocol" validate:"required"` + + // The VPN tunnel configuration for this VPN gateway connection (in dynamic route mode). + Tunnels []VPNGatewayConnectionDynamicRouteModeTunnel `json:"tunnels" validate:"required"` +} + +// Constants associated with the VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode.AuthenticationMode property. +// The authentication mode. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. +const ( + VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteModeAuthenticationModePskConst = "psk" +) + +// Constants associated with the VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode.EstablishMode property. +// The establish mode of the VPN gateway connection: +// - `bidirectional`: Either side of the VPN gateway can initiate IKE protocol +// negotiations or rekeying processes. +// - `peer_only`: Only the peer can initiate IKE protocol negotiations for this VPN gateway +// connection. Additionally, the peer is responsible for initiating the rekeying process +// after the connection is established. If rekeying does not occur, the VPN gateway +// connection will be brought down after its lifetime expires. +const ( + VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteModeEstablishModeBidirectionalConst = "bidirectional" + VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteModeEstablishModePeerOnlyConst = "peer_only" +) + +// Constants associated with the VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode.Mode property. +// The mode of the VPN gateway. +// +// The enumerated values for this property may +// [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. +const ( + VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteModeModePolicyConst = "policy" + VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteModeModeRouteConst = "route" +) + +// Constants associated with the VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode.ResourceType property. +// The resource type. +const ( + VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteModeResourceTypeVPNGatewayConnectionConst = "vpn_gateway_connection" +) + +// Constants associated with the VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode.Status property. +// The status of a VPN gateway connection. +const ( + VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteModeStatusDownConst = "down" + VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteModeStatusUpConst = "up" +) + +// Constants associated with the VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode.RoutingProtocol property. +// The routing protocol for this VPN gateway connection. +const ( + VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteModeRoutingProtocolBgpConst = "bgp" +) + +func (*VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode) isaVPNGatewayConnectionRouteMode() bool { + return true +} + +func (*VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode) isaVPNGatewayConnection() bool { + return true +} + +// UnmarshalVPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode unmarshals an instance of VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode from the specified map of raw messages. +func UnmarshalVPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode(m map[string]json.RawMessage, result interface{}) (err error) { + obj := new(VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode) + err = core.UnmarshalPrimitive(m, "admin_state_up", &obj.AdminStateUp) + if err != nil { + err = core.SDKErrorf(err, "", "admin_state_up-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "authentication_mode", &obj.AuthenticationMode) + if err != nil { + err = core.SDKErrorf(err, "", "authentication_mode-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "created_at", &obj.CreatedAt) + if err != nil { + err = core.SDKErrorf(err, "", "created_at-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "dead_peer_detection", &obj.DeadPeerDetection, UnmarshalVPNGatewayConnectionDpd) + if err != nil { + err = core.SDKErrorf(err, "", "dead_peer_detection-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "establish_mode", &obj.EstablishMode) + if err != nil { + err = core.SDKErrorf(err, "", "establish_mode-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "href", &obj.Href) + if err != nil { + err = core.SDKErrorf(err, "", "href-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "id", &obj.ID) + if err != nil { + err = core.SDKErrorf(err, "", "id-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "ike_policy", &obj.IkePolicy, UnmarshalIkePolicyReference) + if err != nil { + err = core.SDKErrorf(err, "", "ike_policy-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "ipsec_policy", &obj.IpsecPolicy, UnmarshalIPsecPolicyReference) + if err != nil { + err = core.SDKErrorf(err, "", "ipsec_policy-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "mode", &obj.Mode) + if err != nil { + err = core.SDKErrorf(err, "", "mode-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "name", &obj.Name) + if err != nil { + err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "psk", &obj.Psk) + if err != nil { + err = core.SDKErrorf(err, "", "psk-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "resource_type", &obj.ResourceType) + if err != nil { + err = core.SDKErrorf(err, "", "resource_type-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "status", &obj.Status) + if err != nil { + err = core.SDKErrorf(err, "", "status-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "status_reasons", &obj.StatusReasons, UnmarshalVPNGatewayConnectionStatusReason) + if err != nil { + err = core.SDKErrorf(err, "", "status_reasons-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "distribute_traffic", &obj.DistributeTraffic) + if err != nil { + err = core.SDKErrorf(err, "", "distribute_traffic-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "local", &obj.Local, UnmarshalVPNGatewayConnectionDynamicRouteModeLocal) + if err != nil { + err = core.SDKErrorf(err, "", "local-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "peer", &obj.Peer, UnmarshalVPNGatewayConnectionDynamicRouteModePeer) + if err != nil { + err = core.SDKErrorf(err, "", "peer-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalPrimitive(m, "routing_protocol", &obj.RoutingProtocol) + if err != nil { + err = core.SDKErrorf(err, "", "routing_protocol-error", common.GetComponentInfo()) + return + } + err = core.UnmarshalModel(m, "tunnels", &obj.Tunnels, UnmarshalVPNGatewayConnectionDynamicRouteModeTunnel) + if err != nil { + err = core.SDKErrorf(err, "", "tunnels-error", common.GetComponentInfo()) + return + } + reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) + return +} + // VPNGatewayConnectionRouteModeVPNGatewayConnectionStaticRouteMode : VPNGatewayConnectionRouteModeVPNGatewayConnectionStaticRouteMode struct // This model "extends" VPNGatewayConnectionRouteMode type VPNGatewayConnectionRouteModeVPNGatewayConnectionStaticRouteMode struct { @@ -152006,244 +158193,6 @@ func UnmarshalVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolum return } -// InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup : InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup struct -// This model "extends" InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec -type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup struct { - // The name for this instance group manager action. The name must not be used by another action for the instance group - // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min - // period. - CronSpec *string `json:"cron_spec,omitempty"` - - Group *InstanceGroupManagerScheduledActionGroupPrototype `json:"group" validate:"required"` -} - -// NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup : Instantiate InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup (Generic Model Constructor) -func (*VpcV1) NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup(group *InstanceGroupManagerScheduledActionGroupPrototype) (_model *InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup, err error) { - _model = &InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup{ - Group: group, - } - err = core.ValidateStruct(_model, "required parameters") - if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) - } - return -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup) isaInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec() bool { - return true -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup) isaInstanceGroupManagerActionPrototypeScheduledActionPrototype() bool { - return true -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup) isaInstanceGroupManagerActionPrototype() bool { - return true -} - -// UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup unmarshals an instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) - if err != nil { - err = core.SDKErrorf(err, "", "cron_spec-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerScheduledActionGroupPrototype) - if err != nil { - err = core.SDKErrorf(err, "", "group-error", common.GetComponentInfo()) - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager : InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager struct -// This model "extends" InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec -type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager struct { - // The name for this instance group manager action. The name must not be used by another action for the instance group - // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 min - // period. - CronSpec *string `json:"cron_spec,omitempty"` - - Manager InstanceGroupManagerScheduledActionManagerPrototypeIntf `json:"manager" validate:"required"` -} - -// NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager : Instantiate InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager (Generic Model Constructor) -func (*VpcV1) NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager(manager InstanceGroupManagerScheduledActionManagerPrototypeIntf) (_model *InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager, err error) { - _model = &InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager{ - Manager: manager, - } - err = core.ValidateStruct(_model, "required parameters") - if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) - } - return -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager) isaInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec() bool { - return true -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager) isaInstanceGroupManagerActionPrototypeScheduledActionPrototype() bool { - return true -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager) isaInstanceGroupManagerActionPrototype() bool { - return true -} - -// UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager unmarshals an instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "cron_spec", &obj.CronSpec) - if err != nil { - err = core.SDKErrorf(err, "", "cron_spec-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerScheduledActionManagerPrototype) - if err != nil { - err = core.SDKErrorf(err, "", "manager-error", common.GetComponentInfo()) - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup : InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup struct -// This model "extends" InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt -type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup struct { - // The name for this instance group manager action. The name must not be used by another action for the instance group - // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The date and time the scheduled action will run. - RunAt *strfmt.DateTime `json:"run_at,omitempty"` - - Group *InstanceGroupManagerScheduledActionGroupPrototype `json:"group" validate:"required"` -} - -// NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup : Instantiate InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup (Generic Model Constructor) -func (*VpcV1) NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup(group *InstanceGroupManagerScheduledActionGroupPrototype) (_model *InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup, err error) { - _model = &InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup{ - Group: group, - } - err = core.ValidateStruct(_model, "required parameters") - if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) - } - return -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup) isaInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt() bool { - return true -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup) isaInstanceGroupManagerActionPrototypeScheduledActionPrototype() bool { - return true -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup) isaInstanceGroupManagerActionPrototype() bool { - return true -} - -// UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup unmarshals an instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "run_at", &obj.RunAt) - if err != nil { - err = core.SDKErrorf(err, "", "run_at-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "group", &obj.Group, UnmarshalInstanceGroupManagerScheduledActionGroupPrototype) - if err != nil { - err = core.SDKErrorf(err, "", "group-error", common.GetComponentInfo()) - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - -// InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager : InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager struct -// This model "extends" InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt -type InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager struct { - // The name for this instance group manager action. The name must not be used by another action for the instance group - // manager. If unspecified, the name will be a hyphenated list of randomly-selected words. - Name *string `json:"name,omitempty"` - - // The date and time the scheduled action will run. - RunAt *strfmt.DateTime `json:"run_at,omitempty"` - - Manager InstanceGroupManagerScheduledActionManagerPrototypeIntf `json:"manager" validate:"required"` -} - -// NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager : Instantiate InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager (Generic Model Constructor) -func (*VpcV1) NewInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager(manager InstanceGroupManagerScheduledActionManagerPrototypeIntf) (_model *InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager, err error) { - _model = &InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager{ - Manager: manager, - } - err = core.ValidateStruct(_model, "required parameters") - if err != nil { - err = core.SDKErrorf(err, "", "model-missing-required", common.GetComponentInfo()) - } - return -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager) isaInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt() bool { - return true -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager) isaInstanceGroupManagerActionPrototypeScheduledActionPrototype() bool { - return true -} - -func (*InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager) isaInstanceGroupManagerActionPrototype() bool { - return true -} - -// UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager unmarshals an instance of InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager from the specified map of raw messages. -func UnmarshalInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager(m map[string]json.RawMessage, result interface{}) (err error) { - obj := new(InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager) - err = core.UnmarshalPrimitive(m, "name", &obj.Name) - if err != nil { - err = core.SDKErrorf(err, "", "name-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalPrimitive(m, "run_at", &obj.RunAt) - if err != nil { - err = core.SDKErrorf(err, "", "run_at-error", common.GetComponentInfo()) - return - } - err = core.UnmarshalModel(m, "manager", &obj.Manager, UnmarshalInstanceGroupManagerScheduledActionManagerPrototype) - if err != nil { - err = core.SDKErrorf(err, "", "manager-error", common.GetComponentInfo()) - return - } - reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj)) - return -} - // BackupPoliciesPager can be used to simplify the use of the "ListBackupPolicies" method. type BackupPoliciesPager struct { hasNext bool @@ -153716,6 +159665,98 @@ func (pager *EndpointGatewayIpsPager) GetAll() (allItems []ReservedIP, err error return } +// EndpointGatewayResourceBindingsPager can be used to simplify the use of the "ListEndpointGatewayResourceBindings" method. +type EndpointGatewayResourceBindingsPager struct { + hasNext bool + options *ListEndpointGatewayResourceBindingsOptions + client *VpcV1 + pageContext struct { + next *string + } +} + +// NewEndpointGatewayResourceBindingsPager returns a new EndpointGatewayResourceBindingsPager instance. +func (vpc *VpcV1) NewEndpointGatewayResourceBindingsPager(options *ListEndpointGatewayResourceBindingsOptions) (pager *EndpointGatewayResourceBindingsPager, err error) { + if options.Start != nil && *options.Start != "" { + err = core.SDKErrorf(nil, "the 'options.Start' field should not be set", "no-query-setting", common.GetComponentInfo()) + return + } + + var optionsCopy ListEndpointGatewayResourceBindingsOptions = *options + pager = &EndpointGatewayResourceBindingsPager{ + hasNext: true, + options: &optionsCopy, + client: vpc, + } + return +} + +// HasNext returns true if there are potentially more results to be retrieved. +func (pager *EndpointGatewayResourceBindingsPager) HasNext() bool { + return pager.hasNext +} + +// GetNextWithContext returns the next page of results using the specified Context. +func (pager *EndpointGatewayResourceBindingsPager) GetNextWithContext(ctx context.Context) (page []EndpointGatewayResourceBinding, err error) { + if !pager.HasNext() { + return nil, fmt.Errorf("no more results available") + } + + pager.options.Start = pager.pageContext.next + + result, _, err := pager.client.ListEndpointGatewayResourceBindingsWithContext(ctx, pager.options) + if err != nil { + err = core.RepurposeSDKProblem(err, "error-getting-next-page") + return + } + + var next *string + if result.Next != nil { + var start *string + start, err = core.GetQueryParam(result.Next.Href, "start") + if err != nil { + errMsg := fmt.Sprintf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) + err = core.SDKErrorf(err, errMsg, "get-query-error", common.GetComponentInfo()) + return + } + next = start + } + pager.pageContext.next = next + pager.hasNext = (pager.pageContext.next != nil) + page = result.ResourceBindings + + return +} + +// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly +// until all pages of results have been retrieved. +func (pager *EndpointGatewayResourceBindingsPager) GetAllWithContext(ctx context.Context) (allItems []EndpointGatewayResourceBinding, err error) { + for pager.HasNext() { + var nextPage []EndpointGatewayResourceBinding + nextPage, err = pager.GetNextWithContext(ctx) + if err != nil { + err = core.RepurposeSDKProblem(err, "error-getting-next-page") + return + } + allItems = append(allItems, nextPage...) + } + return +} + +// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. +func (pager *EndpointGatewayResourceBindingsPager) GetNext() (page []EndpointGatewayResourceBinding, err error) { + page, err = pager.GetNextWithContext(context.Background()) + err = core.RepurposeSDKProblem(err, "") + return +} + +// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. +func (pager *EndpointGatewayResourceBindingsPager) GetAll() (allItems []EndpointGatewayResourceBinding, err error) { + allItems, err = pager.GetAllWithContext(context.Background()) + err = core.RepurposeSDKProblem(err, "") + return +} + // FloatingIpsPager can be used to simplify the use of the "ListFloatingIps" method. type FloatingIpsPager struct { hasNext bool @@ -158868,6 +164909,98 @@ func (pager *VPNGatewayConnectionsPager) GetAll() (allItems []VPNGatewayConnecti return } +// VPNGatewayServiceConnectionsPager can be used to simplify the use of the "ListVPNGatewayServiceConnections" method. +type VPNGatewayServiceConnectionsPager struct { + hasNext bool + options *ListVPNGatewayServiceConnectionsOptions + client *VpcV1 + pageContext struct { + next *string + } +} + +// NewVPNGatewayServiceConnectionsPager returns a new VPNGatewayServiceConnectionsPager instance. +func (vpc *VpcV1) NewVPNGatewayServiceConnectionsPager(options *ListVPNGatewayServiceConnectionsOptions) (pager *VPNGatewayServiceConnectionsPager, err error) { + if options.Start != nil && *options.Start != "" { + err = core.SDKErrorf(nil, "the 'options.Start' field should not be set", "no-query-setting", common.GetComponentInfo()) + return + } + + var optionsCopy ListVPNGatewayServiceConnectionsOptions = *options + pager = &VPNGatewayServiceConnectionsPager{ + hasNext: true, + options: &optionsCopy, + client: vpc, + } + return +} + +// HasNext returns true if there are potentially more results to be retrieved. +func (pager *VPNGatewayServiceConnectionsPager) HasNext() bool { + return pager.hasNext +} + +// GetNextWithContext returns the next page of results using the specified Context. +func (pager *VPNGatewayServiceConnectionsPager) GetNextWithContext(ctx context.Context) (page []VPNGatewayServiceConnection, err error) { + if !pager.HasNext() { + return nil, fmt.Errorf("no more results available") + } + + pager.options.Start = pager.pageContext.next + + result, _, err := pager.client.ListVPNGatewayServiceConnectionsWithContext(ctx, pager.options) + if err != nil { + err = core.RepurposeSDKProblem(err, "error-getting-next-page") + return + } + + var next *string + if result.Next != nil { + var start *string + start, err = core.GetQueryParam(result.Next.Href, "start") + if err != nil { + errMsg := fmt.Sprintf("error retrieving 'start' query parameter from URL '%s': %s", *result.Next.Href, err.Error()) + err = core.SDKErrorf(err, errMsg, "get-query-error", common.GetComponentInfo()) + return + } + next = start + } + pager.pageContext.next = next + pager.hasNext = (pager.pageContext.next != nil) + page = result.ServiceConnections + + return +} + +// GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly +// until all pages of results have been retrieved. +func (pager *VPNGatewayServiceConnectionsPager) GetAllWithContext(ctx context.Context) (allItems []VPNGatewayServiceConnection, err error) { + for pager.HasNext() { + var nextPage []VPNGatewayServiceConnection + nextPage, err = pager.GetNextWithContext(ctx) + if err != nil { + err = core.RepurposeSDKProblem(err, "error-getting-next-page") + return + } + allItems = append(allItems, nextPage...) + } + return +} + +// GetNext invokes GetNextWithContext() using context.Background() as the Context parameter. +func (pager *VPNGatewayServiceConnectionsPager) GetNext() (page []VPNGatewayServiceConnection, err error) { + page, err = pager.GetNextWithContext(context.Background()) + err = core.RepurposeSDKProblem(err, "") + return +} + +// GetAll invokes GetAllWithContext() using context.Background() as the Context parameter. +func (pager *VPNGatewayServiceConnectionsPager) GetAll() (allItems []VPNGatewayServiceConnection, err error) { + allItems, err = pager.GetAllWithContext(context.Background()) + err = core.RepurposeSDKProblem(err, "") + return +} + // VPNServersPager can be used to simplify the use of the "ListVPNServers" method. type VPNServersPager struct { hasNext bool diff --git a/vendor/github.com/asaskevich/govalidator/.gitignore b/vendor/github.com/asaskevich/govalidator/.gitignore deleted file mode 100644 index 8d69a9418aa..00000000000 --- a/vendor/github.com/asaskevich/govalidator/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -bin/ -.idea/ -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib - -# Test binary, built with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - diff --git a/vendor/github.com/asaskevich/govalidator/.travis.yml b/vendor/github.com/asaskevich/govalidator/.travis.yml deleted file mode 100644 index bb83c6670df..00000000000 --- a/vendor/github.com/asaskevich/govalidator/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: go -dist: xenial -go: - - '1.10' - - '1.11' - - '1.12' - - '1.13' - - 'tip' - -script: - - go test -coverpkg=./... -coverprofile=coverage.info -timeout=5s - - bash <(curl -s https://codecov.io/bash) diff --git a/vendor/github.com/asaskevich/govalidator/CODE_OF_CONDUCT.md b/vendor/github.com/asaskevich/govalidator/CODE_OF_CONDUCT.md deleted file mode 100644 index 4b462b0d81b..00000000000 --- a/vendor/github.com/asaskevich/govalidator/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,43 +0,0 @@ -# Contributor Code of Conduct - -This project adheres to [The Code Manifesto](http://codemanifesto.com) -as its guidelines for contributor interactions. - -## The Code Manifesto - -We want to work in an ecosystem that empowers developers to reach their -potential — one that encourages growth and effective collaboration. A space -that is safe for all. - -A space such as this benefits everyone that participates in it. It encourages -new developers to enter our field. It is through discussion and collaboration -that we grow, and through growth that we improve. - -In the effort to create such a place, we hold to these values: - -1. **Discrimination limits us.** This includes discrimination on the basis of - race, gender, sexual orientation, gender identity, age, nationality, - technology and any other arbitrary exclusion of a group of people. -2. **Boundaries honor us.** Your comfort levels are not everyone’s comfort - levels. Remember that, and if brought to your attention, heed it. -3. **We are our biggest assets.** None of us were born masters of our trade. - Each of us has been helped along the way. Return that favor, when and where - you can. -4. **We are resources for the future.** As an extension of #3, share what you - know. Make yourself a resource to help those that come after you. -5. **Respect defines us.** Treat others as you wish to be treated. Make your - discussions, criticisms and debates from a position of respectfulness. Ask - yourself, is it true? Is it necessary? Is it constructive? Anything less is - unacceptable. -6. **Reactions require grace.** Angry responses are valid, but abusive language - and vindictive actions are toxic. When something happens that offends you, - handle it assertively, but be respectful. Escalate reasonably, and try to - allow the offender an opportunity to explain themselves, and possibly - correct the issue. -7. **Opinions are just that: opinions.** Each and every one of us, due to our - background and upbringing, have varying opinions. That is perfectly - acceptable. Remember this: if you respect your own opinions, you should - respect the opinions of others. -8. **To err is human.** You might not intend it, but mistakes do happen and - contribute to build experience. Tolerate honest mistakes, and don't - hesitate to apologize if you make one yourself. diff --git a/vendor/github.com/asaskevich/govalidator/CONTRIBUTING.md b/vendor/github.com/asaskevich/govalidator/CONTRIBUTING.md deleted file mode 100644 index 7ed268a1edd..00000000000 --- a/vendor/github.com/asaskevich/govalidator/CONTRIBUTING.md +++ /dev/null @@ -1,63 +0,0 @@ -#### Support -If you do have a contribution to the package, feel free to create a Pull Request or an Issue. - -#### What to contribute -If you don't know what to do, there are some features and functions that need to be done - -- [ ] Refactor code -- [ ] Edit docs and [README](https://github.com/asaskevich/govalidator/README.md): spellcheck, grammar and typo check -- [ ] Create actual list of contributors and projects that currently using this package -- [ ] Resolve [issues and bugs](https://github.com/asaskevich/govalidator/issues) -- [ ] Update actual [list of functions](https://github.com/asaskevich/govalidator#list-of-functions) -- [ ] Update [list of validators](https://github.com/asaskevich/govalidator#validatestruct-2) that available for `ValidateStruct` and add new -- [ ] Implement new validators: `IsFQDN`, `IsIMEI`, `IsPostalCode`, `IsISIN`, `IsISRC` etc -- [x] Implement [validation by maps](https://github.com/asaskevich/govalidator/issues/224) -- [ ] Implement fuzzing testing -- [ ] Implement some struct/map/array utilities -- [ ] Implement map/array validation -- [ ] Implement benchmarking -- [ ] Implement batch of examples -- [ ] Look at forks for new features and fixes - -#### Advice -Feel free to create what you want, but keep in mind when you implement new features: -- Code must be clear and readable, names of variables/constants clearly describes what they are doing -- Public functions must be documented and described in source file and added to README.md to the list of available functions -- There are must be unit-tests for any new functions and improvements - -## Financial contributions - -We also welcome financial contributions in full transparency on our [open collective](https://opencollective.com/govalidator). -Anyone can file an expense. If the expense makes sense for the development of the community, it will be "merged" in the ledger of our open collective by the core contributors and the person who filed the expense will be reimbursed. - - -## Credits - - -### Contributors - -Thank you to all the people who have already contributed to govalidator! - - - -### Backers - -Thank you to all our backers! [[Become a backer](https://opencollective.com/govalidator#backer)] - - - - -### Sponsors - -Thank you to all our sponsors! (please ask your company to also support this open source project by [becoming a sponsor](https://opencollective.com/govalidator#sponsor)) - - - - - - - - - - - \ No newline at end of file diff --git a/vendor/github.com/asaskevich/govalidator/LICENSE b/vendor/github.com/asaskevich/govalidator/LICENSE deleted file mode 100644 index cacba910240..00000000000 --- a/vendor/github.com/asaskevich/govalidator/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2020 Alex Saskevich - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/vendor/github.com/asaskevich/govalidator/README.md b/vendor/github.com/asaskevich/govalidator/README.md deleted file mode 100644 index 2c3fc35eb64..00000000000 --- a/vendor/github.com/asaskevich/govalidator/README.md +++ /dev/null @@ -1,622 +0,0 @@ -govalidator -=========== -[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/asaskevich/govalidator?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![GoDoc](https://godoc.org/github.com/asaskevich/govalidator?status.png)](https://godoc.org/github.com/asaskevich/govalidator) -[![Build Status](https://travis-ci.org/asaskevich/govalidator.svg?branch=master)](https://travis-ci.org/asaskevich/govalidator) -[![Coverage](https://codecov.io/gh/asaskevich/govalidator/branch/master/graph/badge.svg)](https://codecov.io/gh/asaskevich/govalidator) [![Go Report Card](https://goreportcard.com/badge/github.com/asaskevich/govalidator)](https://goreportcard.com/report/github.com/asaskevich/govalidator) [![GoSearch](http://go-search.org/badge?id=github.com%2Fasaskevich%2Fgovalidator)](http://go-search.org/view?id=github.com%2Fasaskevich%2Fgovalidator) [![Backers on Open Collective](https://opencollective.com/govalidator/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/govalidator/sponsors/badge.svg)](#sponsors) [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator?ref=badge_shield) - -A package of validators and sanitizers for strings, structs and collections. Based on [validator.js](https://github.com/chriso/validator.js). - -#### Installation -Make sure that Go is installed on your computer. -Type the following command in your terminal: - - go get github.com/asaskevich/govalidator - -or you can get specified release of the package with `gopkg.in`: - - go get gopkg.in/asaskevich/govalidator.v10 - -After it the package is ready to use. - - -#### Import package in your project -Add following line in your `*.go` file: -```go -import "github.com/asaskevich/govalidator" -``` -If you are unhappy to use long `govalidator`, you can do something like this: -```go -import ( - valid "github.com/asaskevich/govalidator" -) -``` - -#### Activate behavior to require all fields have a validation tag by default -`SetFieldsRequiredByDefault` causes validation to fail when struct fields do not include validations or are not explicitly marked as exempt (using `valid:"-"` or `valid:"email,optional"`). A good place to activate this is a package init function or the main() function. - -`SetNilPtrAllowedByRequired` causes validation to pass when struct fields marked by `required` are set to nil. This is disabled by default for consistency, but some packages that need to be able to determine between `nil` and `zero value` state can use this. If disabled, both `nil` and `zero` values cause validation errors. - -```go -import "github.com/asaskevich/govalidator" - -func init() { - govalidator.SetFieldsRequiredByDefault(true) -} -``` - -Here's some code to explain it: -```go -// this struct definition will fail govalidator.ValidateStruct() (and the field values do not matter): -type exampleStruct struct { - Name string `` - Email string `valid:"email"` -} - -// this, however, will only fail when Email is empty or an invalid email address: -type exampleStruct2 struct { - Name string `valid:"-"` - Email string `valid:"email"` -} - -// lastly, this will only fail when Email is an invalid email address but not when it's empty: -type exampleStruct2 struct { - Name string `valid:"-"` - Email string `valid:"email,optional"` -} -``` - -#### Recent breaking changes (see [#123](https://github.com/asaskevich/govalidator/pull/123)) -##### Custom validator function signature -A context was added as the second parameter, for structs this is the object being validated – this makes dependent validation possible. -```go -import "github.com/asaskevich/govalidator" - -// old signature -func(i interface{}) bool - -// new signature -func(i interface{}, o interface{}) bool -``` - -##### Adding a custom validator -This was changed to prevent data races when accessing custom validators. -```go -import "github.com/asaskevich/govalidator" - -// before -govalidator.CustomTypeTagMap["customByteArrayValidator"] = func(i interface{}, o interface{}) bool { - // ... -} - -// after -govalidator.CustomTypeTagMap.Set("customByteArrayValidator", func(i interface{}, o interface{}) bool { - // ... -}) -``` - -#### List of functions: -```go -func Abs(value float64) float64 -func BlackList(str, chars string) string -func ByteLength(str string, params ...string) bool -func CamelCaseToUnderscore(str string) string -func Contains(str, substring string) bool -func Count(array []interface{}, iterator ConditionIterator) int -func Each(array []interface{}, iterator Iterator) -func ErrorByField(e error, field string) string -func ErrorsByField(e error) map[string]string -func Filter(array []interface{}, iterator ConditionIterator) []interface{} -func Find(array []interface{}, iterator ConditionIterator) interface{} -func GetLine(s string, index int) (string, error) -func GetLines(s string) []string -func HasLowerCase(str string) bool -func HasUpperCase(str string) bool -func HasWhitespace(str string) bool -func HasWhitespaceOnly(str string) bool -func InRange(value interface{}, left interface{}, right interface{}) bool -func InRangeFloat32(value, left, right float32) bool -func InRangeFloat64(value, left, right float64) bool -func InRangeInt(value, left, right interface{}) bool -func IsASCII(str string) bool -func IsAlpha(str string) bool -func IsAlphanumeric(str string) bool -func IsBase64(str string) bool -func IsByteLength(str string, min, max int) bool -func IsCIDR(str string) bool -func IsCRC32(str string) bool -func IsCRC32b(str string) bool -func IsCreditCard(str string) bool -func IsDNSName(str string) bool -func IsDataURI(str string) bool -func IsDialString(str string) bool -func IsDivisibleBy(str, num string) bool -func IsEmail(str string) bool -func IsExistingEmail(email string) bool -func IsFilePath(str string) (bool, int) -func IsFloat(str string) bool -func IsFullWidth(str string) bool -func IsHalfWidth(str string) bool -func IsHash(str string, algorithm string) bool -func IsHexadecimal(str string) bool -func IsHexcolor(str string) bool -func IsHost(str string) bool -func IsIP(str string) bool -func IsIPv4(str string) bool -func IsIPv6(str string) bool -func IsISBN(str string, version int) bool -func IsISBN10(str string) bool -func IsISBN13(str string) bool -func IsISO3166Alpha2(str string) bool -func IsISO3166Alpha3(str string) bool -func IsISO4217(str string) bool -func IsISO693Alpha2(str string) bool -func IsISO693Alpha3b(str string) bool -func IsIn(str string, params ...string) bool -func IsInRaw(str string, params ...string) bool -func IsInt(str string) bool -func IsJSON(str string) bool -func IsLatitude(str string) bool -func IsLongitude(str string) bool -func IsLowerCase(str string) bool -func IsMAC(str string) bool -func IsMD4(str string) bool -func IsMD5(str string) bool -func IsMagnetURI(str string) bool -func IsMongoID(str string) bool -func IsMultibyte(str string) bool -func IsNatural(value float64) bool -func IsNegative(value float64) bool -func IsNonNegative(value float64) bool -func IsNonPositive(value float64) bool -func IsNotNull(str string) bool -func IsNull(str string) bool -func IsNumeric(str string) bool -func IsPort(str string) bool -func IsPositive(value float64) bool -func IsPrintableASCII(str string) bool -func IsRFC3339(str string) bool -func IsRFC3339WithoutZone(str string) bool -func IsRGBcolor(str string) bool -func IsRegex(str string) bool -func IsRequestURI(rawurl string) bool -func IsRequestURL(rawurl string) bool -func IsRipeMD128(str string) bool -func IsRipeMD160(str string) bool -func IsRsaPub(str string, params ...string) bool -func IsRsaPublicKey(str string, keylen int) bool -func IsSHA1(str string) bool -func IsSHA256(str string) bool -func IsSHA384(str string) bool -func IsSHA512(str string) bool -func IsSSN(str string) bool -func IsSemver(str string) bool -func IsTiger128(str string) bool -func IsTiger160(str string) bool -func IsTiger192(str string) bool -func IsTime(str string, format string) bool -func IsType(v interface{}, params ...string) bool -func IsURL(str string) bool -func IsUTFDigit(str string) bool -func IsUTFLetter(str string) bool -func IsUTFLetterNumeric(str string) bool -func IsUTFNumeric(str string) bool -func IsUUID(str string) bool -func IsUUIDv3(str string) bool -func IsUUIDv4(str string) bool -func IsUUIDv5(str string) bool -func IsULID(str string) bool -func IsUnixTime(str string) bool -func IsUpperCase(str string) bool -func IsVariableWidth(str string) bool -func IsWhole(value float64) bool -func LeftTrim(str, chars string) string -func Map(array []interface{}, iterator ResultIterator) []interface{} -func Matches(str, pattern string) bool -func MaxStringLength(str string, params ...string) bool -func MinStringLength(str string, params ...string) bool -func NormalizeEmail(str string) (string, error) -func PadBoth(str string, padStr string, padLen int) string -func PadLeft(str string, padStr string, padLen int) string -func PadRight(str string, padStr string, padLen int) string -func PrependPathToErrors(err error, path string) error -func Range(str string, params ...string) bool -func RemoveTags(s string) string -func ReplacePattern(str, pattern, replace string) string -func Reverse(s string) string -func RightTrim(str, chars string) string -func RuneLength(str string, params ...string) bool -func SafeFileName(str string) string -func SetFieldsRequiredByDefault(value bool) -func SetNilPtrAllowedByRequired(value bool) -func Sign(value float64) float64 -func StringLength(str string, params ...string) bool -func StringMatches(s string, params ...string) bool -func StripLow(str string, keepNewLines bool) string -func ToBoolean(str string) (bool, error) -func ToFloat(str string) (float64, error) -func ToInt(value interface{}) (res int64, err error) -func ToJSON(obj interface{}) (string, error) -func ToString(obj interface{}) string -func Trim(str, chars string) string -func Truncate(str string, length int, ending string) string -func TruncatingErrorf(str string, args ...interface{}) error -func UnderscoreToCamelCase(s string) string -func ValidateMap(inputMap map[string]interface{}, validationMap map[string]interface{}) (bool, error) -func ValidateStruct(s interface{}) (bool, error) -func WhiteList(str, chars string) string -type ConditionIterator -type CustomTypeValidator -type Error -func (e Error) Error() string -type Errors -func (es Errors) Error() string -func (es Errors) Errors() []error -type ISO3166Entry -type ISO693Entry -type InterfaceParamValidator -type Iterator -type ParamValidator -type ResultIterator -type UnsupportedTypeError -func (e *UnsupportedTypeError) Error() string -type Validator -``` - -#### Examples -###### IsURL -```go -println(govalidator.IsURL(`http://user@pass:domain.com/path/page`)) -``` -###### IsType -```go -println(govalidator.IsType("Bob", "string")) -println(govalidator.IsType(1, "int")) -i := 1 -println(govalidator.IsType(&i, "*int")) -``` - -IsType can be used through the tag `type` which is essential for map validation: -```go -type User struct { - Name string `valid:"type(string)"` - Age int `valid:"type(int)"` - Meta interface{} `valid:"type(string)"` -} -result, err := govalidator.ValidateStruct(User{"Bob", 20, "meta"}) -if err != nil { - println("error: " + err.Error()) -} -println(result) -``` -###### ToString -```go -type User struct { - FirstName string - LastName string -} - -str := govalidator.ToString(&User{"John", "Juan"}) -println(str) -``` -###### Each, Map, Filter, Count for slices -Each iterates over the slice/array and calls Iterator for every item -```go -data := []interface{}{1, 2, 3, 4, 5} -var fn govalidator.Iterator = func(value interface{}, index int) { - println(value.(int)) -} -govalidator.Each(data, fn) -``` -```go -data := []interface{}{1, 2, 3, 4, 5} -var fn govalidator.ResultIterator = func(value interface{}, index int) interface{} { - return value.(int) * 3 -} -_ = govalidator.Map(data, fn) // result = []interface{}{1, 6, 9, 12, 15} -``` -```go -data := []interface{}{1, 2, 3, 4, 5, 6, 7, 8, 9, 10} -var fn govalidator.ConditionIterator = func(value interface{}, index int) bool { - return value.(int)%2 == 0 -} -_ = govalidator.Filter(data, fn) // result = []interface{}{2, 4, 6, 8, 10} -_ = govalidator.Count(data, fn) // result = 5 -``` -###### ValidateStruct [#2](https://github.com/asaskevich/govalidator/pull/2) -If you want to validate structs, you can use tag `valid` for any field in your structure. All validators used with this field in one tag are separated by comma. If you want to skip validation, place `-` in your tag. If you need a validator that is not on the list below, you can add it like this: -```go -govalidator.TagMap["duck"] = govalidator.Validator(func(str string) bool { - return str == "duck" -}) -``` -For completely custom validators (interface-based), see below. - -Here is a list of available validators for struct fields (validator - used function): -```go -"email": IsEmail, -"url": IsURL, -"dialstring": IsDialString, -"requrl": IsRequestURL, -"requri": IsRequestURI, -"alpha": IsAlpha, -"utfletter": IsUTFLetter, -"alphanum": IsAlphanumeric, -"utfletternum": IsUTFLetterNumeric, -"numeric": IsNumeric, -"utfnumeric": IsUTFNumeric, -"utfdigit": IsUTFDigit, -"hexadecimal": IsHexadecimal, -"hexcolor": IsHexcolor, -"rgbcolor": IsRGBcolor, -"lowercase": IsLowerCase, -"uppercase": IsUpperCase, -"int": IsInt, -"float": IsFloat, -"null": IsNull, -"uuid": IsUUID, -"uuidv3": IsUUIDv3, -"uuidv4": IsUUIDv4, -"uuidv5": IsUUIDv5, -"creditcard": IsCreditCard, -"isbn10": IsISBN10, -"isbn13": IsISBN13, -"json": IsJSON, -"multibyte": IsMultibyte, -"ascii": IsASCII, -"printableascii": IsPrintableASCII, -"fullwidth": IsFullWidth, -"halfwidth": IsHalfWidth, -"variablewidth": IsVariableWidth, -"base64": IsBase64, -"datauri": IsDataURI, -"ip": IsIP, -"port": IsPort, -"ipv4": IsIPv4, -"ipv6": IsIPv6, -"dns": IsDNSName, -"host": IsHost, -"mac": IsMAC, -"latitude": IsLatitude, -"longitude": IsLongitude, -"ssn": IsSSN, -"semver": IsSemver, -"rfc3339": IsRFC3339, -"rfc3339WithoutZone": IsRFC3339WithoutZone, -"ISO3166Alpha2": IsISO3166Alpha2, -"ISO3166Alpha3": IsISO3166Alpha3, -"ulid": IsULID, -``` -Validators with parameters - -```go -"range(min|max)": Range, -"length(min|max)": ByteLength, -"runelength(min|max)": RuneLength, -"stringlength(min|max)": StringLength, -"matches(pattern)": StringMatches, -"in(string1|string2|...|stringN)": IsIn, -"rsapub(keylength)" : IsRsaPub, -"minstringlength(int): MinStringLength, -"maxstringlength(int): MaxStringLength, -``` -Validators with parameters for any type - -```go -"type(type)": IsType, -``` - -And here is small example of usage: -```go -type Post struct { - Title string `valid:"alphanum,required"` - Message string `valid:"duck,ascii"` - Message2 string `valid:"animal(dog)"` - AuthorIP string `valid:"ipv4"` - Date string `valid:"-"` -} -post := &Post{ - Title: "My Example Post", - Message: "duck", - Message2: "dog", - AuthorIP: "123.234.54.3", -} - -// Add your own struct validation tags -govalidator.TagMap["duck"] = govalidator.Validator(func(str string) bool { - return str == "duck" -}) - -// Add your own struct validation tags with parameter -govalidator.ParamTagMap["animal"] = govalidator.ParamValidator(func(str string, params ...string) bool { - species := params[0] - return str == species -}) -govalidator.ParamTagRegexMap["animal"] = regexp.MustCompile("^animal\\((\\w+)\\)$") - -result, err := govalidator.ValidateStruct(post) -if err != nil { - println("error: " + err.Error()) -} -println(result) -``` -###### ValidateMap [#2](https://github.com/asaskevich/govalidator/pull/338) -If you want to validate maps, you can use the map to be validated and a validation map that contain the same tags used in ValidateStruct, both maps have to be in the form `map[string]interface{}` - -So here is small example of usage: -```go -var mapTemplate = map[string]interface{}{ - "name":"required,alpha", - "family":"required,alpha", - "email":"required,email", - "cell-phone":"numeric", - "address":map[string]interface{}{ - "line1":"required,alphanum", - "line2":"alphanum", - "postal-code":"numeric", - }, -} - -var inputMap = map[string]interface{}{ - "name":"Bob", - "family":"Smith", - "email":"foo@bar.baz", - "address":map[string]interface{}{ - "line1":"", - "line2":"", - "postal-code":"", - }, -} - -result, err := govalidator.ValidateMap(inputMap, mapTemplate) -if err != nil { - println("error: " + err.Error()) -} -println(result) -``` - -###### WhiteList -```go -// Remove all characters from string ignoring characters between "a" and "z" -println(govalidator.WhiteList("a3a43a5a4a3a2a23a4a5a4a3a4", "a-z") == "aaaaaaaaaaaa") -``` - -###### Custom validation functions -Custom validation using your own domain specific validators is also available - here's an example of how to use it: -```go -import "github.com/asaskevich/govalidator" - -type CustomByteArray [6]byte // custom types are supported and can be validated - -type StructWithCustomByteArray struct { - ID CustomByteArray `valid:"customByteArrayValidator,customMinLengthValidator"` // multiple custom validators are possible as well and will be evaluated in sequence - Email string `valid:"email"` - CustomMinLength int `valid:"-"` -} - -govalidator.CustomTypeTagMap.Set("customByteArrayValidator", func(i interface{}, context interface{}) bool { - switch v := context.(type) { // you can type switch on the context interface being validated - case StructWithCustomByteArray: - // you can check and validate against some other field in the context, - // return early or not validate against the context at all – your choice - case SomeOtherType: - // ... - default: - // expecting some other type? Throw/panic here or continue - } - - switch v := i.(type) { // type switch on the struct field being validated - case CustomByteArray: - for _, e := range v { // this validator checks that the byte array is not empty, i.e. not all zeroes - if e != 0 { - return true - } - } - } - return false -}) -govalidator.CustomTypeTagMap.Set("customMinLengthValidator", func(i interface{}, context interface{}) bool { - switch v := context.(type) { // this validates a field against the value in another field, i.e. dependent validation - case StructWithCustomByteArray: - return len(v.ID) >= v.CustomMinLength - } - return false -}) -``` - -###### Loop over Error() -By default .Error() returns all errors in a single String. To access each error you can do this: -```go - if err != nil { - errs := err.(govalidator.Errors).Errors() - for _, e := range errs { - fmt.Println(e.Error()) - } - } -``` - -###### Custom error messages -Custom error messages are supported via annotations by adding the `~` separator - here's an example of how to use it: -```go -type Ticket struct { - Id int64 `json:"id"` - FirstName string `json:"firstname" valid:"required~First name is blank"` -} -``` - -#### Notes -Documentation is available here: [godoc.org](https://godoc.org/github.com/asaskevich/govalidator). -Full information about code coverage is also available here: [govalidator on gocover.io](http://gocover.io/github.com/asaskevich/govalidator). - -#### Support -If you do have a contribution to the package, feel free to create a Pull Request or an Issue. - -#### What to contribute -If you don't know what to do, there are some features and functions that need to be done - -- [ ] Refactor code -- [ ] Edit docs and [README](https://github.com/asaskevich/govalidator/README.md): spellcheck, grammar and typo check -- [ ] Create actual list of contributors and projects that currently using this package -- [ ] Resolve [issues and bugs](https://github.com/asaskevich/govalidator/issues) -- [ ] Update actual [list of functions](https://github.com/asaskevich/govalidator#list-of-functions) -- [ ] Update [list of validators](https://github.com/asaskevich/govalidator#validatestruct-2) that available for `ValidateStruct` and add new -- [ ] Implement new validators: `IsFQDN`, `IsIMEI`, `IsPostalCode`, `IsISIN`, `IsISRC` etc -- [x] Implement [validation by maps](https://github.com/asaskevich/govalidator/issues/224) -- [ ] Implement fuzzing testing -- [ ] Implement some struct/map/array utilities -- [ ] Implement map/array validation -- [ ] Implement benchmarking -- [ ] Implement batch of examples -- [ ] Look at forks for new features and fixes - -#### Advice -Feel free to create what you want, but keep in mind when you implement new features: -- Code must be clear and readable, names of variables/constants clearly describes what they are doing -- Public functions must be documented and described in source file and added to README.md to the list of available functions -- There are must be unit-tests for any new functions and improvements - -## Credits -### Contributors - -This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)]. - -#### Special thanks to [contributors](https://github.com/asaskevich/govalidator/graphs/contributors) -* [Daniel Lohse](https://github.com/annismckenzie) -* [Attila Oláh](https://github.com/attilaolah) -* [Daniel Korner](https://github.com/Dadie) -* [Steven Wilkin](https://github.com/stevenwilkin) -* [Deiwin Sarjas](https://github.com/deiwin) -* [Noah Shibley](https://github.com/slugmobile) -* [Nathan Davies](https://github.com/nathj07) -* [Matt Sanford](https://github.com/mzsanford) -* [Simon ccl1115](https://github.com/ccl1115) - - - - -### Backers - -Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/govalidator#backer)] - - - - -### Sponsors - -Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/govalidator#sponsor)] - - - - - - - - - - - - - - - -## License -[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator?ref=badge_large) diff --git a/vendor/github.com/asaskevich/govalidator/arrays.go b/vendor/github.com/asaskevich/govalidator/arrays.go deleted file mode 100644 index 3e1da7cb480..00000000000 --- a/vendor/github.com/asaskevich/govalidator/arrays.go +++ /dev/null @@ -1,87 +0,0 @@ -package govalidator - -// Iterator is the function that accepts element of slice/array and its index -type Iterator func(interface{}, int) - -// ResultIterator is the function that accepts element of slice/array and its index and returns any result -type ResultIterator func(interface{}, int) interface{} - -// ConditionIterator is the function that accepts element of slice/array and its index and returns boolean -type ConditionIterator func(interface{}, int) bool - -// ReduceIterator is the function that accepts two element of slice/array and returns result of merging those values -type ReduceIterator func(interface{}, interface{}) interface{} - -// Some validates that any item of array corresponds to ConditionIterator. Returns boolean. -func Some(array []interface{}, iterator ConditionIterator) bool { - res := false - for index, data := range array { - res = res || iterator(data, index) - } - return res -} - -// Every validates that every item of array corresponds to ConditionIterator. Returns boolean. -func Every(array []interface{}, iterator ConditionIterator) bool { - res := true - for index, data := range array { - res = res && iterator(data, index) - } - return res -} - -// Reduce boils down a list of values into a single value by ReduceIterator -func Reduce(array []interface{}, iterator ReduceIterator, initialValue interface{}) interface{} { - for _, data := range array { - initialValue = iterator(initialValue, data) - } - return initialValue -} - -// Each iterates over the slice and apply Iterator to every item -func Each(array []interface{}, iterator Iterator) { - for index, data := range array { - iterator(data, index) - } -} - -// Map iterates over the slice and apply ResultIterator to every item. Returns new slice as a result. -func Map(array []interface{}, iterator ResultIterator) []interface{} { - var result = make([]interface{}, len(array)) - for index, data := range array { - result[index] = iterator(data, index) - } - return result -} - -// Find iterates over the slice and apply ConditionIterator to every item. Returns first item that meet ConditionIterator or nil otherwise. -func Find(array []interface{}, iterator ConditionIterator) interface{} { - for index, data := range array { - if iterator(data, index) { - return data - } - } - return nil -} - -// Filter iterates over the slice and apply ConditionIterator to every item. Returns new slice. -func Filter(array []interface{}, iterator ConditionIterator) []interface{} { - var result = make([]interface{}, 0) - for index, data := range array { - if iterator(data, index) { - result = append(result, data) - } - } - return result -} - -// Count iterates over the slice and apply ConditionIterator to every item. Returns count of items that meets ConditionIterator. -func Count(array []interface{}, iterator ConditionIterator) int { - count := 0 - for index, data := range array { - if iterator(data, index) { - count = count + 1 - } - } - return count -} diff --git a/vendor/github.com/asaskevich/govalidator/converter.go b/vendor/github.com/asaskevich/govalidator/converter.go deleted file mode 100644 index d68e990fc25..00000000000 --- a/vendor/github.com/asaskevich/govalidator/converter.go +++ /dev/null @@ -1,81 +0,0 @@ -package govalidator - -import ( - "encoding/json" - "fmt" - "reflect" - "strconv" -) - -// ToString convert the input to a string. -func ToString(obj interface{}) string { - res := fmt.Sprintf("%v", obj) - return res -} - -// ToJSON convert the input to a valid JSON string -func ToJSON(obj interface{}) (string, error) { - res, err := json.Marshal(obj) - if err != nil { - res = []byte("") - } - return string(res), err -} - -// ToFloat convert the input string to a float, or 0.0 if the input is not a float. -func ToFloat(value interface{}) (res float64, err error) { - val := reflect.ValueOf(value) - - switch value.(type) { - case int, int8, int16, int32, int64: - res = float64(val.Int()) - case uint, uint8, uint16, uint32, uint64: - res = float64(val.Uint()) - case float32, float64: - res = val.Float() - case string: - res, err = strconv.ParseFloat(val.String(), 64) - if err != nil { - res = 0 - } - default: - err = fmt.Errorf("ToInt: unknown interface type %T", value) - res = 0 - } - - return -} - -// ToInt convert the input string or any int type to an integer type 64, or 0 if the input is not an integer. -func ToInt(value interface{}) (res int64, err error) { - val := reflect.ValueOf(value) - - switch value.(type) { - case int, int8, int16, int32, int64: - res = val.Int() - case uint, uint8, uint16, uint32, uint64: - res = int64(val.Uint()) - case float32, float64: - res = int64(val.Float()) - case string: - if IsInt(val.String()) { - res, err = strconv.ParseInt(val.String(), 0, 64) - if err != nil { - res = 0 - } - } else { - err = fmt.Errorf("ToInt: invalid numeric format %g", value) - res = 0 - } - default: - err = fmt.Errorf("ToInt: unknown interface type %T", value) - res = 0 - } - - return -} - -// ToBoolean convert the input string to a boolean. -func ToBoolean(str string) (bool, error) { - return strconv.ParseBool(str) -} diff --git a/vendor/github.com/asaskevich/govalidator/doc.go b/vendor/github.com/asaskevich/govalidator/doc.go deleted file mode 100644 index 55dce62dc8c..00000000000 --- a/vendor/github.com/asaskevich/govalidator/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -package govalidator - -// A package of validators and sanitizers for strings, structures and collections. diff --git a/vendor/github.com/asaskevich/govalidator/error.go b/vendor/github.com/asaskevich/govalidator/error.go deleted file mode 100644 index 1da2336f47e..00000000000 --- a/vendor/github.com/asaskevich/govalidator/error.go +++ /dev/null @@ -1,47 +0,0 @@ -package govalidator - -import ( - "sort" - "strings" -) - -// Errors is an array of multiple errors and conforms to the error interface. -type Errors []error - -// Errors returns itself. -func (es Errors) Errors() []error { - return es -} - -func (es Errors) Error() string { - var errs []string - for _, e := range es { - errs = append(errs, e.Error()) - } - sort.Strings(errs) - return strings.Join(errs, ";") -} - -// Error encapsulates a name, an error and whether there's a custom error message or not. -type Error struct { - Name string - Err error - CustomErrorMessageExists bool - - // Validator indicates the name of the validator that failed - Validator string - Path []string -} - -func (e Error) Error() string { - if e.CustomErrorMessageExists { - return e.Err.Error() - } - - errName := e.Name - if len(e.Path) > 0 { - errName = strings.Join(append(e.Path, e.Name), ".") - } - - return errName + ": " + e.Err.Error() -} diff --git a/vendor/github.com/asaskevich/govalidator/numerics.go b/vendor/github.com/asaskevich/govalidator/numerics.go deleted file mode 100644 index 5041d9e8684..00000000000 --- a/vendor/github.com/asaskevich/govalidator/numerics.go +++ /dev/null @@ -1,100 +0,0 @@ -package govalidator - -import ( - "math" -) - -// Abs returns absolute value of number -func Abs(value float64) float64 { - return math.Abs(value) -} - -// Sign returns signum of number: 1 in case of value > 0, -1 in case of value < 0, 0 otherwise -func Sign(value float64) float64 { - if value > 0 { - return 1 - } else if value < 0 { - return -1 - } else { - return 0 - } -} - -// IsNegative returns true if value < 0 -func IsNegative(value float64) bool { - return value < 0 -} - -// IsPositive returns true if value > 0 -func IsPositive(value float64) bool { - return value > 0 -} - -// IsNonNegative returns true if value >= 0 -func IsNonNegative(value float64) bool { - return value >= 0 -} - -// IsNonPositive returns true if value <= 0 -func IsNonPositive(value float64) bool { - return value <= 0 -} - -// InRangeInt returns true if value lies between left and right border -func InRangeInt(value, left, right interface{}) bool { - value64, _ := ToInt(value) - left64, _ := ToInt(left) - right64, _ := ToInt(right) - if left64 > right64 { - left64, right64 = right64, left64 - } - return value64 >= left64 && value64 <= right64 -} - -// InRangeFloat32 returns true if value lies between left and right border -func InRangeFloat32(value, left, right float32) bool { - if left > right { - left, right = right, left - } - return value >= left && value <= right -} - -// InRangeFloat64 returns true if value lies between left and right border -func InRangeFloat64(value, left, right float64) bool { - if left > right { - left, right = right, left - } - return value >= left && value <= right -} - -// InRange returns true if value lies between left and right border, generic type to handle int, float32, float64 and string. -// All types must the same type. -// False if value doesn't lie in range or if it incompatible or not comparable -func InRange(value interface{}, left interface{}, right interface{}) bool { - switch value.(type) { - case int: - intValue, _ := ToInt(value) - intLeft, _ := ToInt(left) - intRight, _ := ToInt(right) - return InRangeInt(intValue, intLeft, intRight) - case float32, float64: - intValue, _ := ToFloat(value) - intLeft, _ := ToFloat(left) - intRight, _ := ToFloat(right) - return InRangeFloat64(intValue, intLeft, intRight) - case string: - return value.(string) >= left.(string) && value.(string) <= right.(string) - default: - return false - } -} - -// IsWhole returns true if value is whole number -func IsWhole(value float64) bool { - return math.Remainder(value, 1) == 0 -} - -// IsNatural returns true if value is natural number (positive and whole) -func IsNatural(value float64) bool { - return IsWhole(value) && IsPositive(value) -} diff --git a/vendor/github.com/asaskevich/govalidator/patterns.go b/vendor/github.com/asaskevich/govalidator/patterns.go deleted file mode 100644 index bafc3765ea1..00000000000 --- a/vendor/github.com/asaskevich/govalidator/patterns.go +++ /dev/null @@ -1,113 +0,0 @@ -package govalidator - -import "regexp" - -// Basic regular expressions for validating strings -const ( - Email string = "^(((([a-zA-Z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])+(\\.([a-zA-Z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])|(\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-zA-Z]|\\d|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])|(([a-zA-Z]|\\d|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])([a-zA-Z]|\\d|-|\\.|_|~|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])*([a-zA-Z]|\\d|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])))\\.)+(([a-zA-Z]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])|(([a-zA-Z]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])([a-zA-Z]|\\d|-|_|~|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])*([a-zA-Z]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])))\\.?$" - CreditCard string = "^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\\d{3})\\d{11}|6[27][0-9]{14})$" - ISBN10 string = "^(?:[0-9]{9}X|[0-9]{10})$" - ISBN13 string = "^(?:[0-9]{13})$" - UUID3 string = "^[0-9a-f]{8}-[0-9a-f]{4}-3[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}$" - UUID4 string = "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" - UUID5 string = "^[0-9a-f]{8}-[0-9a-f]{4}-5[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" - UUID string = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" - Alpha string = "^[a-zA-Z]+$" - Alphanumeric string = "^[a-zA-Z0-9]+$" - Numeric string = "^[0-9]+$" - Int string = "^(?:[-+]?(?:0|[1-9][0-9]*))$" - Float string = "^(?:[-+]?(?:[0-9]+))?(?:\\.[0-9]*)?(?:[eE][\\+\\-]?(?:[0-9]+))?$" - Hexadecimal string = "^[0-9a-fA-F]+$" - Hexcolor string = "^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$" - RGBcolor string = "^rgb\\(\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*,\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*,\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*\\)$" - ASCII string = "^[\x00-\x7F]+$" - Multibyte string = "[^\x00-\x7F]" - FullWidth string = "[^\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]" - HalfWidth string = "[\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]" - Base64 string = "^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=|[A-Za-z0-9+\\/]{4})$" - PrintableASCII string = "^[\x20-\x7E]+$" - DataURI string = "^data:.+\\/(.+);base64$" - MagnetURI string = "^magnet:\\?xt=urn:[a-zA-Z0-9]+:[a-zA-Z0-9]{32,40}&dn=.+&tr=.+$" - Latitude string = "^[-+]?([1-8]?\\d(\\.\\d+)?|90(\\.0+)?)$" - Longitude string = "^[-+]?(180(\\.0+)?|((1[0-7]\\d)|([1-9]?\\d))(\\.\\d+)?)$" - DNSName string = `^([a-zA-Z0-9_]{1}[a-zA-Z0-9_-]{0,62}){1}(\.[a-zA-Z0-9_]{1}[a-zA-Z0-9_-]{0,62})*[\._]?$` - IP string = `(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))` - URLSchema string = `((ftp|tcp|udp|wss?|https?):\/\/)` - URLUsername string = `(\S+(:\S*)?@)` - URLPath string = `((\/|\?|#)[^\s]*)` - URLPort string = `(:(\d{1,5}))` - URLIP string = `([1-9]\d?|1\d\d|2[01]\d|22[0-3]|24\d|25[0-5])(\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])){2}(?:\.([0-9]\d?|1\d\d|2[0-4]\d|25[0-5]))` - URLSubdomain string = `((www\.)|([a-zA-Z0-9]+([-_\.]?[a-zA-Z0-9])*[a-zA-Z0-9]\.[a-zA-Z0-9]+))` - URL = `^` + URLSchema + `?` + URLUsername + `?` + `((` + URLIP + `|(\[` + IP + `\])|(([a-zA-Z0-9]([a-zA-Z0-9-_]+)?[a-zA-Z0-9]([-\.][a-zA-Z0-9]+)*)|(` + URLSubdomain + `?))?(([a-zA-Z\x{00a1}-\x{ffff}0-9]+-?-?)*[a-zA-Z\x{00a1}-\x{ffff}0-9]+)(?:\.([a-zA-Z\x{00a1}-\x{ffff}]{1,}))?))\.?` + URLPort + `?` + URLPath + `?$` - SSN string = `^\d{3}[- ]?\d{2}[- ]?\d{4}$` - WinPath string = `^[a-zA-Z]:\\(?:[^\\/:*?"<>|\r\n]+\\)*[^\\/:*?"<>|\r\n]*$` - UnixPath string = `^(/[^/\x00]*)+/?$` - WinARPath string = `^(?:(?:[a-zA-Z]:|\\\\[a-z0-9_.$●-]+\\[a-z0-9_.$●-]+)\\|\\?[^\\/:*?"<>|\r\n]+\\?)(?:[^\\/:*?"<>|\r\n]+\\)*[^\\/:*?"<>|\r\n]*$` - UnixARPath string = `^((\.{0,2}/)?([^/\x00]*))+/?$` - Semver string = "^v?(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(-(0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(\\.(0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\\+[0-9a-zA-Z-]+(\\.[0-9a-zA-Z-]+)*)?$" - tagName string = "valid" - hasLowerCase string = ".*[[:lower:]]" - hasUpperCase string = ".*[[:upper:]]" - hasWhitespace string = ".*[[:space:]]" - hasWhitespaceOnly string = "^[[:space:]]+$" - IMEI string = "^[0-9a-f]{14}$|^\\d{15}$|^\\d{18}$" - IMSI string = "^\\d{14,15}$" - E164 string = `^\+?[1-9]\d{1,14}$` -) - -// Used by IsFilePath func -const ( - // Unknown is unresolved OS type - Unknown = iota - // Win is Windows type - Win - // Unix is *nix OS types - Unix -) - -var ( - userRegexp = regexp.MustCompile("^[a-zA-Z0-9!#$%&'*+/=?^_`{|}~.-]+$") - hostRegexp = regexp.MustCompile("^[^\\s]+\\.[^\\s]+$") - userDotRegexp = regexp.MustCompile("(^[.]{1})|([.]{1}$)|([.]{2,})") - rxEmail = regexp.MustCompile(Email) - rxCreditCard = regexp.MustCompile(CreditCard) - rxISBN10 = regexp.MustCompile(ISBN10) - rxISBN13 = regexp.MustCompile(ISBN13) - rxUUID3 = regexp.MustCompile(UUID3) - rxUUID4 = regexp.MustCompile(UUID4) - rxUUID5 = regexp.MustCompile(UUID5) - rxUUID = regexp.MustCompile(UUID) - rxAlpha = regexp.MustCompile(Alpha) - rxAlphanumeric = regexp.MustCompile(Alphanumeric) - rxNumeric = regexp.MustCompile(Numeric) - rxInt = regexp.MustCompile(Int) - rxFloat = regexp.MustCompile(Float) - rxHexadecimal = regexp.MustCompile(Hexadecimal) - rxHexcolor = regexp.MustCompile(Hexcolor) - rxRGBcolor = regexp.MustCompile(RGBcolor) - rxASCII = regexp.MustCompile(ASCII) - rxPrintableASCII = regexp.MustCompile(PrintableASCII) - rxMultibyte = regexp.MustCompile(Multibyte) - rxFullWidth = regexp.MustCompile(FullWidth) - rxHalfWidth = regexp.MustCompile(HalfWidth) - rxBase64 = regexp.MustCompile(Base64) - rxDataURI = regexp.MustCompile(DataURI) - rxMagnetURI = regexp.MustCompile(MagnetURI) - rxLatitude = regexp.MustCompile(Latitude) - rxLongitude = regexp.MustCompile(Longitude) - rxDNSName = regexp.MustCompile(DNSName) - rxURL = regexp.MustCompile(URL) - rxSSN = regexp.MustCompile(SSN) - rxWinPath = regexp.MustCompile(WinPath) - rxUnixPath = regexp.MustCompile(UnixPath) - rxARWinPath = regexp.MustCompile(WinARPath) - rxARUnixPath = regexp.MustCompile(UnixARPath) - rxSemver = regexp.MustCompile(Semver) - rxHasLowerCase = regexp.MustCompile(hasLowerCase) - rxHasUpperCase = regexp.MustCompile(hasUpperCase) - rxHasWhitespace = regexp.MustCompile(hasWhitespace) - rxHasWhitespaceOnly = regexp.MustCompile(hasWhitespaceOnly) - rxIMEI = regexp.MustCompile(IMEI) - rxIMSI = regexp.MustCompile(IMSI) - rxE164 = regexp.MustCompile(E164) -) diff --git a/vendor/github.com/asaskevich/govalidator/types.go b/vendor/github.com/asaskevich/govalidator/types.go deleted file mode 100644 index c573abb51af..00000000000 --- a/vendor/github.com/asaskevich/govalidator/types.go +++ /dev/null @@ -1,656 +0,0 @@ -package govalidator - -import ( - "reflect" - "regexp" - "sort" - "sync" -) - -// Validator is a wrapper for a validator function that returns bool and accepts string. -type Validator func(str string) bool - -// CustomTypeValidator is a wrapper for validator functions that returns bool and accepts any type. -// The second parameter should be the context (in the case of validating a struct: the whole object being validated). -type CustomTypeValidator func(i interface{}, o interface{}) bool - -// ParamValidator is a wrapper for validator functions that accept additional parameters. -type ParamValidator func(str string, params ...string) bool - -// InterfaceParamValidator is a wrapper for functions that accept variants parameters for an interface value -type InterfaceParamValidator func(in interface{}, params ...string) bool -type tagOptionsMap map[string]tagOption - -func (t tagOptionsMap) orderedKeys() []string { - var keys []string - for k := range t { - keys = append(keys, k) - } - - sort.Slice(keys, func(a, b int) bool { - return t[keys[a]].order < t[keys[b]].order - }) - - return keys -} - -type tagOption struct { - name string - customErrorMessage string - order int -} - -// UnsupportedTypeError is a wrapper for reflect.Type -type UnsupportedTypeError struct { - Type reflect.Type -} - -// stringValues is a slice of reflect.Value holding *reflect.StringValue. -// It implements the methods to sort by string. -type stringValues []reflect.Value - -// InterfaceParamTagMap is a map of functions accept variants parameters for an interface value -var InterfaceParamTagMap = map[string]InterfaceParamValidator{ - "type": IsType, -} - -// InterfaceParamTagRegexMap maps interface param tags to their respective regexes. -var InterfaceParamTagRegexMap = map[string]*regexp.Regexp{ - "type": regexp.MustCompile(`^type\((.*)\)$`), -} - -// ParamTagMap is a map of functions accept variants parameters -var ParamTagMap = map[string]ParamValidator{ - "length": ByteLength, - "range": Range, - "runelength": RuneLength, - "stringlength": StringLength, - "matches": StringMatches, - "in": IsInRaw, - "rsapub": IsRsaPub, - "minstringlength": MinStringLength, - "maxstringlength": MaxStringLength, -} - -// ParamTagRegexMap maps param tags to their respective regexes. -var ParamTagRegexMap = map[string]*regexp.Regexp{ - "range": regexp.MustCompile("^range\\((\\d+)\\|(\\d+)\\)$"), - "length": regexp.MustCompile("^length\\((\\d+)\\|(\\d+)\\)$"), - "runelength": regexp.MustCompile("^runelength\\((\\d+)\\|(\\d+)\\)$"), - "stringlength": regexp.MustCompile("^stringlength\\((\\d+)\\|(\\d+)\\)$"), - "in": regexp.MustCompile(`^in\((.*)\)`), - "matches": regexp.MustCompile(`^matches\((.+)\)$`), - "rsapub": regexp.MustCompile("^rsapub\\((\\d+)\\)$"), - "minstringlength": regexp.MustCompile("^minstringlength\\((\\d+)\\)$"), - "maxstringlength": regexp.MustCompile("^maxstringlength\\((\\d+)\\)$"), -} - -type customTypeTagMap struct { - validators map[string]CustomTypeValidator - - sync.RWMutex -} - -func (tm *customTypeTagMap) Get(name string) (CustomTypeValidator, bool) { - tm.RLock() - defer tm.RUnlock() - v, ok := tm.validators[name] - return v, ok -} - -func (tm *customTypeTagMap) Set(name string, ctv CustomTypeValidator) { - tm.Lock() - defer tm.Unlock() - tm.validators[name] = ctv -} - -// CustomTypeTagMap is a map of functions that can be used as tags for ValidateStruct function. -// Use this to validate compound or custom types that need to be handled as a whole, e.g. -// `type UUID [16]byte` (this would be handled as an array of bytes). -var CustomTypeTagMap = &customTypeTagMap{validators: make(map[string]CustomTypeValidator)} - -// TagMap is a map of functions, that can be used as tags for ValidateStruct function. -var TagMap = map[string]Validator{ - "email": IsEmail, - "url": IsURL, - "dialstring": IsDialString, - "requrl": IsRequestURL, - "requri": IsRequestURI, - "alpha": IsAlpha, - "utfletter": IsUTFLetter, - "alphanum": IsAlphanumeric, - "utfletternum": IsUTFLetterNumeric, - "numeric": IsNumeric, - "utfnumeric": IsUTFNumeric, - "utfdigit": IsUTFDigit, - "hexadecimal": IsHexadecimal, - "hexcolor": IsHexcolor, - "rgbcolor": IsRGBcolor, - "lowercase": IsLowerCase, - "uppercase": IsUpperCase, - "int": IsInt, - "float": IsFloat, - "null": IsNull, - "notnull": IsNotNull, - "uuid": IsUUID, - "uuidv3": IsUUIDv3, - "uuidv4": IsUUIDv4, - "uuidv5": IsUUIDv5, - "creditcard": IsCreditCard, - "isbn10": IsISBN10, - "isbn13": IsISBN13, - "json": IsJSON, - "multibyte": IsMultibyte, - "ascii": IsASCII, - "printableascii": IsPrintableASCII, - "fullwidth": IsFullWidth, - "halfwidth": IsHalfWidth, - "variablewidth": IsVariableWidth, - "base64": IsBase64, - "datauri": IsDataURI, - "ip": IsIP, - "port": IsPort, - "ipv4": IsIPv4, - "ipv6": IsIPv6, - "dns": IsDNSName, - "host": IsHost, - "mac": IsMAC, - "latitude": IsLatitude, - "longitude": IsLongitude, - "ssn": IsSSN, - "semver": IsSemver, - "rfc3339": IsRFC3339, - "rfc3339WithoutZone": IsRFC3339WithoutZone, - "ISO3166Alpha2": IsISO3166Alpha2, - "ISO3166Alpha3": IsISO3166Alpha3, - "ISO4217": IsISO4217, - "IMEI": IsIMEI, - "ulid": IsULID, -} - -// ISO3166Entry stores country codes -type ISO3166Entry struct { - EnglishShortName string - FrenchShortName string - Alpha2Code string - Alpha3Code string - Numeric string -} - -//ISO3166List based on https://www.iso.org/obp/ui/#search/code/ Code Type "Officially Assigned Codes" -var ISO3166List = []ISO3166Entry{ - {"Afghanistan", "Afghanistan (l')", "AF", "AFG", "004"}, - {"Albania", "Albanie (l')", "AL", "ALB", "008"}, - {"Antarctica", "Antarctique (l')", "AQ", "ATA", "010"}, - {"Algeria", "Algérie (l')", "DZ", "DZA", "012"}, - {"American Samoa", "Samoa américaines (les)", "AS", "ASM", "016"}, - {"Andorra", "Andorre (l')", "AD", "AND", "020"}, - {"Angola", "Angola (l')", "AO", "AGO", "024"}, - {"Antigua and Barbuda", "Antigua-et-Barbuda", "AG", "ATG", "028"}, - {"Azerbaijan", "Azerbaïdjan (l')", "AZ", "AZE", "031"}, - {"Argentina", "Argentine (l')", "AR", "ARG", "032"}, - {"Australia", "Australie (l')", "AU", "AUS", "036"}, - {"Austria", "Autriche (l')", "AT", "AUT", "040"}, - {"Bahamas (the)", "Bahamas (les)", "BS", "BHS", "044"}, - {"Bahrain", "Bahreïn", "BH", "BHR", "048"}, - {"Bangladesh", "Bangladesh (le)", "BD", "BGD", "050"}, - {"Armenia", "Arménie (l')", "AM", "ARM", "051"}, - {"Barbados", "Barbade (la)", "BB", "BRB", "052"}, - {"Belgium", "Belgique (la)", "BE", "BEL", "056"}, - {"Bermuda", "Bermudes (les)", "BM", "BMU", "060"}, - {"Bhutan", "Bhoutan (le)", "BT", "BTN", "064"}, - {"Bolivia (Plurinational State of)", "Bolivie (État plurinational de)", "BO", "BOL", "068"}, - {"Bosnia and Herzegovina", "Bosnie-Herzégovine (la)", "BA", "BIH", "070"}, - {"Botswana", "Botswana (le)", "BW", "BWA", "072"}, - {"Bouvet Island", "Bouvet (l'Île)", "BV", "BVT", "074"}, - {"Brazil", "Brésil (le)", "BR", "BRA", "076"}, - {"Belize", "Belize (le)", "BZ", "BLZ", "084"}, - {"British Indian Ocean Territory (the)", "Indien (le Territoire britannique de l'océan)", "IO", "IOT", "086"}, - {"Solomon Islands", "Salomon (Îles)", "SB", "SLB", "090"}, - {"Virgin Islands (British)", "Vierges britanniques (les Îles)", "VG", "VGB", "092"}, - {"Brunei Darussalam", "Brunéi Darussalam (le)", "BN", "BRN", "096"}, - {"Bulgaria", "Bulgarie (la)", "BG", "BGR", "100"}, - {"Myanmar", "Myanmar (le)", "MM", "MMR", "104"}, - {"Burundi", "Burundi (le)", "BI", "BDI", "108"}, - {"Belarus", "Bélarus (le)", "BY", "BLR", "112"}, - {"Cambodia", "Cambodge (le)", "KH", "KHM", "116"}, - {"Cameroon", "Cameroun (le)", "CM", "CMR", "120"}, - {"Canada", "Canada (le)", "CA", "CAN", "124"}, - {"Cabo Verde", "Cabo Verde", "CV", "CPV", "132"}, - {"Cayman Islands (the)", "Caïmans (les Îles)", "KY", "CYM", "136"}, - {"Central African Republic (the)", "République centrafricaine (la)", "CF", "CAF", "140"}, - {"Sri Lanka", "Sri Lanka", "LK", "LKA", "144"}, - {"Chad", "Tchad (le)", "TD", "TCD", "148"}, - {"Chile", "Chili (le)", "CL", "CHL", "152"}, - {"China", "Chine (la)", "CN", "CHN", "156"}, - {"Taiwan (Province of China)", "Taïwan (Province de Chine)", "TW", "TWN", "158"}, - {"Christmas Island", "Christmas (l'Île)", "CX", "CXR", "162"}, - {"Cocos (Keeling) Islands (the)", "Cocos (les Îles)/ Keeling (les Îles)", "CC", "CCK", "166"}, - {"Colombia", "Colombie (la)", "CO", "COL", "170"}, - {"Comoros (the)", "Comores (les)", "KM", "COM", "174"}, - {"Mayotte", "Mayotte", "YT", "MYT", "175"}, - {"Congo (the)", "Congo (le)", "CG", "COG", "178"}, - {"Congo (the Democratic Republic of the)", "Congo (la République démocratique du)", "CD", "COD", "180"}, - {"Cook Islands (the)", "Cook (les Îles)", "CK", "COK", "184"}, - {"Costa Rica", "Costa Rica (le)", "CR", "CRI", "188"}, - {"Croatia", "Croatie (la)", "HR", "HRV", "191"}, - {"Cuba", "Cuba", "CU", "CUB", "192"}, - {"Cyprus", "Chypre", "CY", "CYP", "196"}, - {"Czech Republic (the)", "tchèque (la République)", "CZ", "CZE", "203"}, - {"Benin", "Bénin (le)", "BJ", "BEN", "204"}, - {"Denmark", "Danemark (le)", "DK", "DNK", "208"}, - {"Dominica", "Dominique (la)", "DM", "DMA", "212"}, - {"Dominican Republic (the)", "dominicaine (la République)", "DO", "DOM", "214"}, - {"Ecuador", "Équateur (l')", "EC", "ECU", "218"}, - {"El Salvador", "El Salvador", "SV", "SLV", "222"}, - {"Equatorial Guinea", "Guinée équatoriale (la)", "GQ", "GNQ", "226"}, - {"Ethiopia", "Éthiopie (l')", "ET", "ETH", "231"}, - {"Eritrea", "Érythrée (l')", "ER", "ERI", "232"}, - {"Estonia", "Estonie (l')", "EE", "EST", "233"}, - {"Faroe Islands (the)", "Féroé (les Îles)", "FO", "FRO", "234"}, - {"Falkland Islands (the) [Malvinas]", "Falkland (les Îles)/Malouines (les Îles)", "FK", "FLK", "238"}, - {"South Georgia and the South Sandwich Islands", "Géorgie du Sud-et-les Îles Sandwich du Sud (la)", "GS", "SGS", "239"}, - {"Fiji", "Fidji (les)", "FJ", "FJI", "242"}, - {"Finland", "Finlande (la)", "FI", "FIN", "246"}, - {"Åland Islands", "Åland(les Îles)", "AX", "ALA", "248"}, - {"France", "France (la)", "FR", "FRA", "250"}, - {"French Guiana", "Guyane française (la )", "GF", "GUF", "254"}, - {"French Polynesia", "Polynésie française (la)", "PF", "PYF", "258"}, - {"French Southern Territories (the)", "Terres australes françaises (les)", "TF", "ATF", "260"}, - {"Djibouti", "Djibouti", "DJ", "DJI", "262"}, - {"Gabon", "Gabon (le)", "GA", "GAB", "266"}, - {"Georgia", "Géorgie (la)", "GE", "GEO", "268"}, - {"Gambia (the)", "Gambie (la)", "GM", "GMB", "270"}, - {"Palestine, State of", "Palestine, État de", "PS", "PSE", "275"}, - {"Germany", "Allemagne (l')", "DE", "DEU", "276"}, - {"Ghana", "Ghana (le)", "GH", "GHA", "288"}, - {"Gibraltar", "Gibraltar", "GI", "GIB", "292"}, - {"Kiribati", "Kiribati", "KI", "KIR", "296"}, - {"Greece", "Grèce (la)", "GR", "GRC", "300"}, - {"Greenland", "Groenland (le)", "GL", "GRL", "304"}, - {"Grenada", "Grenade (la)", "GD", "GRD", "308"}, - {"Guadeloupe", "Guadeloupe (la)", "GP", "GLP", "312"}, - {"Guam", "Guam", "GU", "GUM", "316"}, - {"Guatemala", "Guatemala (le)", "GT", "GTM", "320"}, - {"Guinea", "Guinée (la)", "GN", "GIN", "324"}, - {"Guyana", "Guyana (le)", "GY", "GUY", "328"}, - {"Haiti", "Haïti", "HT", "HTI", "332"}, - {"Heard Island and McDonald Islands", "Heard-et-Îles MacDonald (l'Île)", "HM", "HMD", "334"}, - {"Holy See (the)", "Saint-Siège (le)", "VA", "VAT", "336"}, - {"Honduras", "Honduras (le)", "HN", "HND", "340"}, - {"Hong Kong", "Hong Kong", "HK", "HKG", "344"}, - {"Hungary", "Hongrie (la)", "HU", "HUN", "348"}, - {"Iceland", "Islande (l')", "IS", "ISL", "352"}, - {"India", "Inde (l')", "IN", "IND", "356"}, - {"Indonesia", "Indonésie (l')", "ID", "IDN", "360"}, - {"Iran (Islamic Republic of)", "Iran (République Islamique d')", "IR", "IRN", "364"}, - {"Iraq", "Iraq (l')", "IQ", "IRQ", "368"}, - {"Ireland", "Irlande (l')", "IE", "IRL", "372"}, - {"Israel", "Israël", "IL", "ISR", "376"}, - {"Italy", "Italie (l')", "IT", "ITA", "380"}, - {"Côte d'Ivoire", "Côte d'Ivoire (la)", "CI", "CIV", "384"}, - {"Jamaica", "Jamaïque (la)", "JM", "JAM", "388"}, - {"Japan", "Japon (le)", "JP", "JPN", "392"}, - {"Kazakhstan", "Kazakhstan (le)", "KZ", "KAZ", "398"}, - {"Jordan", "Jordanie (la)", "JO", "JOR", "400"}, - {"Kenya", "Kenya (le)", "KE", "KEN", "404"}, - {"Korea (the Democratic People's Republic of)", "Corée (la République populaire démocratique de)", "KP", "PRK", "408"}, - {"Korea (the Republic of)", "Corée (la République de)", "KR", "KOR", "410"}, - {"Kuwait", "Koweït (le)", "KW", "KWT", "414"}, - {"Kyrgyzstan", "Kirghizistan (le)", "KG", "KGZ", "417"}, - {"Lao People's Democratic Republic (the)", "Lao, République démocratique populaire", "LA", "LAO", "418"}, - {"Lebanon", "Liban (le)", "LB", "LBN", "422"}, - {"Lesotho", "Lesotho (le)", "LS", "LSO", "426"}, - {"Latvia", "Lettonie (la)", "LV", "LVA", "428"}, - {"Liberia", "Libéria (le)", "LR", "LBR", "430"}, - {"Libya", "Libye (la)", "LY", "LBY", "434"}, - {"Liechtenstein", "Liechtenstein (le)", "LI", "LIE", "438"}, - {"Lithuania", "Lituanie (la)", "LT", "LTU", "440"}, - {"Luxembourg", "Luxembourg (le)", "LU", "LUX", "442"}, - {"Macao", "Macao", "MO", "MAC", "446"}, - {"Madagascar", "Madagascar", "MG", "MDG", "450"}, - {"Malawi", "Malawi (le)", "MW", "MWI", "454"}, - {"Malaysia", "Malaisie (la)", "MY", "MYS", "458"}, - {"Maldives", "Maldives (les)", "MV", "MDV", "462"}, - {"Mali", "Mali (le)", "ML", "MLI", "466"}, - {"Malta", "Malte", "MT", "MLT", "470"}, - {"Martinique", "Martinique (la)", "MQ", "MTQ", "474"}, - {"Mauritania", "Mauritanie (la)", "MR", "MRT", "478"}, - {"Mauritius", "Maurice", "MU", "MUS", "480"}, - {"Mexico", "Mexique (le)", "MX", "MEX", "484"}, - {"Monaco", "Monaco", "MC", "MCO", "492"}, - {"Mongolia", "Mongolie (la)", "MN", "MNG", "496"}, - {"Moldova (the Republic of)", "Moldova , République de", "MD", "MDA", "498"}, - {"Montenegro", "Monténégro (le)", "ME", "MNE", "499"}, - {"Montserrat", "Montserrat", "MS", "MSR", "500"}, - {"Morocco", "Maroc (le)", "MA", "MAR", "504"}, - {"Mozambique", "Mozambique (le)", "MZ", "MOZ", "508"}, - {"Oman", "Oman", "OM", "OMN", "512"}, - {"Namibia", "Namibie (la)", "NA", "NAM", "516"}, - {"Nauru", "Nauru", "NR", "NRU", "520"}, - {"Nepal", "Népal (le)", "NP", "NPL", "524"}, - {"Netherlands (the)", "Pays-Bas (les)", "NL", "NLD", "528"}, - {"Curaçao", "Curaçao", "CW", "CUW", "531"}, - {"Aruba", "Aruba", "AW", "ABW", "533"}, - {"Sint Maarten (Dutch part)", "Saint-Martin (partie néerlandaise)", "SX", "SXM", "534"}, - {"Bonaire, Sint Eustatius and Saba", "Bonaire, Saint-Eustache et Saba", "BQ", "BES", "535"}, - {"New Caledonia", "Nouvelle-Calédonie (la)", "NC", "NCL", "540"}, - {"Vanuatu", "Vanuatu (le)", "VU", "VUT", "548"}, - {"New Zealand", "Nouvelle-Zélande (la)", "NZ", "NZL", "554"}, - {"Nicaragua", "Nicaragua (le)", "NI", "NIC", "558"}, - {"Niger (the)", "Niger (le)", "NE", "NER", "562"}, - {"Nigeria", "Nigéria (le)", "NG", "NGA", "566"}, - {"Niue", "Niue", "NU", "NIU", "570"}, - {"Norfolk Island", "Norfolk (l'Île)", "NF", "NFK", "574"}, - {"Norway", "Norvège (la)", "NO", "NOR", "578"}, - {"Northern Mariana Islands (the)", "Mariannes du Nord (les Îles)", "MP", "MNP", "580"}, - {"United States Minor Outlying Islands (the)", "Îles mineures éloignées des États-Unis (les)", "UM", "UMI", "581"}, - {"Micronesia (Federated States of)", "Micronésie (États fédérés de)", "FM", "FSM", "583"}, - {"Marshall Islands (the)", "Marshall (Îles)", "MH", "MHL", "584"}, - {"Palau", "Palaos (les)", "PW", "PLW", "585"}, - {"Pakistan", "Pakistan (le)", "PK", "PAK", "586"}, - {"Panama", "Panama (le)", "PA", "PAN", "591"}, - {"Papua New Guinea", "Papouasie-Nouvelle-Guinée (la)", "PG", "PNG", "598"}, - {"Paraguay", "Paraguay (le)", "PY", "PRY", "600"}, - {"Peru", "Pérou (le)", "PE", "PER", "604"}, - {"Philippines (the)", "Philippines (les)", "PH", "PHL", "608"}, - {"Pitcairn", "Pitcairn", "PN", "PCN", "612"}, - {"Poland", "Pologne (la)", "PL", "POL", "616"}, - {"Portugal", "Portugal (le)", "PT", "PRT", "620"}, - {"Guinea-Bissau", "Guinée-Bissau (la)", "GW", "GNB", "624"}, - {"Timor-Leste", "Timor-Leste (le)", "TL", "TLS", "626"}, - {"Puerto Rico", "Porto Rico", "PR", "PRI", "630"}, - {"Qatar", "Qatar (le)", "QA", "QAT", "634"}, - {"Réunion", "Réunion (La)", "RE", "REU", "638"}, - {"Romania", "Roumanie (la)", "RO", "ROU", "642"}, - {"Russian Federation (the)", "Russie (la Fédération de)", "RU", "RUS", "643"}, - {"Rwanda", "Rwanda (le)", "RW", "RWA", "646"}, - {"Saint Barthélemy", "Saint-Barthélemy", "BL", "BLM", "652"}, - {"Saint Helena, Ascension and Tristan da Cunha", "Sainte-Hélène, Ascension et Tristan da Cunha", "SH", "SHN", "654"}, - {"Saint Kitts and Nevis", "Saint-Kitts-et-Nevis", "KN", "KNA", "659"}, - {"Anguilla", "Anguilla", "AI", "AIA", "660"}, - {"Saint Lucia", "Sainte-Lucie", "LC", "LCA", "662"}, - {"Saint Martin (French part)", "Saint-Martin (partie française)", "MF", "MAF", "663"}, - {"Saint Pierre and Miquelon", "Saint-Pierre-et-Miquelon", "PM", "SPM", "666"}, - {"Saint Vincent and the Grenadines", "Saint-Vincent-et-les Grenadines", "VC", "VCT", "670"}, - {"San Marino", "Saint-Marin", "SM", "SMR", "674"}, - {"Sao Tome and Principe", "Sao Tomé-et-Principe", "ST", "STP", "678"}, - {"Saudi Arabia", "Arabie saoudite (l')", "SA", "SAU", "682"}, - {"Senegal", "Sénégal (le)", "SN", "SEN", "686"}, - {"Serbia", "Serbie (la)", "RS", "SRB", "688"}, - {"Seychelles", "Seychelles (les)", "SC", "SYC", "690"}, - {"Sierra Leone", "Sierra Leone (la)", "SL", "SLE", "694"}, - {"Singapore", "Singapour", "SG", "SGP", "702"}, - {"Slovakia", "Slovaquie (la)", "SK", "SVK", "703"}, - {"Viet Nam", "Viet Nam (le)", "VN", "VNM", "704"}, - {"Slovenia", "Slovénie (la)", "SI", "SVN", "705"}, - {"Somalia", "Somalie (la)", "SO", "SOM", "706"}, - {"South Africa", "Afrique du Sud (l')", "ZA", "ZAF", "710"}, - {"Zimbabwe", "Zimbabwe (le)", "ZW", "ZWE", "716"}, - {"Spain", "Espagne (l')", "ES", "ESP", "724"}, - {"South Sudan", "Soudan du Sud (le)", "SS", "SSD", "728"}, - {"Sudan (the)", "Soudan (le)", "SD", "SDN", "729"}, - {"Western Sahara*", "Sahara occidental (le)*", "EH", "ESH", "732"}, - {"Suriname", "Suriname (le)", "SR", "SUR", "740"}, - {"Svalbard and Jan Mayen", "Svalbard et l'Île Jan Mayen (le)", "SJ", "SJM", "744"}, - {"Swaziland", "Swaziland (le)", "SZ", "SWZ", "748"}, - {"Sweden", "Suède (la)", "SE", "SWE", "752"}, - {"Switzerland", "Suisse (la)", "CH", "CHE", "756"}, - {"Syrian Arab Republic", "République arabe syrienne (la)", "SY", "SYR", "760"}, - {"Tajikistan", "Tadjikistan (le)", "TJ", "TJK", "762"}, - {"Thailand", "Thaïlande (la)", "TH", "THA", "764"}, - {"Togo", "Togo (le)", "TG", "TGO", "768"}, - {"Tokelau", "Tokelau (les)", "TK", "TKL", "772"}, - {"Tonga", "Tonga (les)", "TO", "TON", "776"}, - {"Trinidad and Tobago", "Trinité-et-Tobago (la)", "TT", "TTO", "780"}, - {"United Arab Emirates (the)", "Émirats arabes unis (les)", "AE", "ARE", "784"}, - {"Tunisia", "Tunisie (la)", "TN", "TUN", "788"}, - {"Turkey", "Turquie (la)", "TR", "TUR", "792"}, - {"Turkmenistan", "Turkménistan (le)", "TM", "TKM", "795"}, - {"Turks and Caicos Islands (the)", "Turks-et-Caïcos (les Îles)", "TC", "TCA", "796"}, - {"Tuvalu", "Tuvalu (les)", "TV", "TUV", "798"}, - {"Uganda", "Ouganda (l')", "UG", "UGA", "800"}, - {"Ukraine", "Ukraine (l')", "UA", "UKR", "804"}, - {"Macedonia (the former Yugoslav Republic of)", "Macédoine (l'ex‑République yougoslave de)", "MK", "MKD", "807"}, - {"Egypt", "Égypte (l')", "EG", "EGY", "818"}, - {"United Kingdom of Great Britain and Northern Ireland (the)", "Royaume-Uni de Grande-Bretagne et d'Irlande du Nord (le)", "GB", "GBR", "826"}, - {"Guernsey", "Guernesey", "GG", "GGY", "831"}, - {"Jersey", "Jersey", "JE", "JEY", "832"}, - {"Isle of Man", "Île de Man", "IM", "IMN", "833"}, - {"Tanzania, United Republic of", "Tanzanie, République-Unie de", "TZ", "TZA", "834"}, - {"United States of America (the)", "États-Unis d'Amérique (les)", "US", "USA", "840"}, - {"Virgin Islands (U.S.)", "Vierges des États-Unis (les Îles)", "VI", "VIR", "850"}, - {"Burkina Faso", "Burkina Faso (le)", "BF", "BFA", "854"}, - {"Uruguay", "Uruguay (l')", "UY", "URY", "858"}, - {"Uzbekistan", "Ouzbékistan (l')", "UZ", "UZB", "860"}, - {"Venezuela (Bolivarian Republic of)", "Venezuela (République bolivarienne du)", "VE", "VEN", "862"}, - {"Wallis and Futuna", "Wallis-et-Futuna", "WF", "WLF", "876"}, - {"Samoa", "Samoa (le)", "WS", "WSM", "882"}, - {"Yemen", "Yémen (le)", "YE", "YEM", "887"}, - {"Zambia", "Zambie (la)", "ZM", "ZMB", "894"}, -} - -// ISO4217List is the list of ISO currency codes -var ISO4217List = []string{ - "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", - "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", - "CAD", "CDF", "CHE", "CHF", "CHW", "CLF", "CLP", "CNY", "COP", "COU", "CRC", "CUC", "CUP", "CVE", "CZK", - "DJF", "DKK", "DOP", "DZD", - "EGP", "ERN", "ETB", "EUR", - "FJD", "FKP", - "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", - "HKD", "HNL", "HRK", "HTG", "HUF", - "IDR", "ILS", "INR", "IQD", "IRR", "ISK", - "JMD", "JOD", "JPY", - "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", - "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", - "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRO", "MUR", "MVR", "MWK", "MXN", "MXV", "MYR", "MZN", - "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", - "OMR", - "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", - "QAR", - "RON", "RSD", "RUB", "RWF", - "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "SSP", "STD", "STN", "SVC", "SYP", "SZL", - "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", - "UAH", "UGX", "USD", "USN", "UYI", "UYU", "UYW", "UZS", - "VEF", "VES", "VND", "VUV", - "WST", - "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XOF", "XPD", "XPF", "XPT", "XSU", "XTS", "XUA", "XXX", - "YER", - "ZAR", "ZMW", "ZWL", -} - -// ISO693Entry stores ISO language codes -type ISO693Entry struct { - Alpha3bCode string - Alpha2Code string - English string -} - -//ISO693List based on http://data.okfn.org/data/core/language-codes/r/language-codes-3b2.json -var ISO693List = []ISO693Entry{ - {Alpha3bCode: "aar", Alpha2Code: "aa", English: "Afar"}, - {Alpha3bCode: "abk", Alpha2Code: "ab", English: "Abkhazian"}, - {Alpha3bCode: "afr", Alpha2Code: "af", English: "Afrikaans"}, - {Alpha3bCode: "aka", Alpha2Code: "ak", English: "Akan"}, - {Alpha3bCode: "alb", Alpha2Code: "sq", English: "Albanian"}, - {Alpha3bCode: "amh", Alpha2Code: "am", English: "Amharic"}, - {Alpha3bCode: "ara", Alpha2Code: "ar", English: "Arabic"}, - {Alpha3bCode: "arg", Alpha2Code: "an", English: "Aragonese"}, - {Alpha3bCode: "arm", Alpha2Code: "hy", English: "Armenian"}, - {Alpha3bCode: "asm", Alpha2Code: "as", English: "Assamese"}, - {Alpha3bCode: "ava", Alpha2Code: "av", English: "Avaric"}, - {Alpha3bCode: "ave", Alpha2Code: "ae", English: "Avestan"}, - {Alpha3bCode: "aym", Alpha2Code: "ay", English: "Aymara"}, - {Alpha3bCode: "aze", Alpha2Code: "az", English: "Azerbaijani"}, - {Alpha3bCode: "bak", Alpha2Code: "ba", English: "Bashkir"}, - {Alpha3bCode: "bam", Alpha2Code: "bm", English: "Bambara"}, - {Alpha3bCode: "baq", Alpha2Code: "eu", English: "Basque"}, - {Alpha3bCode: "bel", Alpha2Code: "be", English: "Belarusian"}, - {Alpha3bCode: "ben", Alpha2Code: "bn", English: "Bengali"}, - {Alpha3bCode: "bih", Alpha2Code: "bh", English: "Bihari languages"}, - {Alpha3bCode: "bis", Alpha2Code: "bi", English: "Bislama"}, - {Alpha3bCode: "bos", Alpha2Code: "bs", English: "Bosnian"}, - {Alpha3bCode: "bre", Alpha2Code: "br", English: "Breton"}, - {Alpha3bCode: "bul", Alpha2Code: "bg", English: "Bulgarian"}, - {Alpha3bCode: "bur", Alpha2Code: "my", English: "Burmese"}, - {Alpha3bCode: "cat", Alpha2Code: "ca", English: "Catalan; Valencian"}, - {Alpha3bCode: "cha", Alpha2Code: "ch", English: "Chamorro"}, - {Alpha3bCode: "che", Alpha2Code: "ce", English: "Chechen"}, - {Alpha3bCode: "chi", Alpha2Code: "zh", English: "Chinese"}, - {Alpha3bCode: "chu", Alpha2Code: "cu", English: "Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic"}, - {Alpha3bCode: "chv", Alpha2Code: "cv", English: "Chuvash"}, - {Alpha3bCode: "cor", Alpha2Code: "kw", English: "Cornish"}, - {Alpha3bCode: "cos", Alpha2Code: "co", English: "Corsican"}, - {Alpha3bCode: "cre", Alpha2Code: "cr", English: "Cree"}, - {Alpha3bCode: "cze", Alpha2Code: "cs", English: "Czech"}, - {Alpha3bCode: "dan", Alpha2Code: "da", English: "Danish"}, - {Alpha3bCode: "div", Alpha2Code: "dv", English: "Divehi; Dhivehi; Maldivian"}, - {Alpha3bCode: "dut", Alpha2Code: "nl", English: "Dutch; Flemish"}, - {Alpha3bCode: "dzo", Alpha2Code: "dz", English: "Dzongkha"}, - {Alpha3bCode: "eng", Alpha2Code: "en", English: "English"}, - {Alpha3bCode: "epo", Alpha2Code: "eo", English: "Esperanto"}, - {Alpha3bCode: "est", Alpha2Code: "et", English: "Estonian"}, - {Alpha3bCode: "ewe", Alpha2Code: "ee", English: "Ewe"}, - {Alpha3bCode: "fao", Alpha2Code: "fo", English: "Faroese"}, - {Alpha3bCode: "fij", Alpha2Code: "fj", English: "Fijian"}, - {Alpha3bCode: "fin", Alpha2Code: "fi", English: "Finnish"}, - {Alpha3bCode: "fre", Alpha2Code: "fr", English: "French"}, - {Alpha3bCode: "fry", Alpha2Code: "fy", English: "Western Frisian"}, - {Alpha3bCode: "ful", Alpha2Code: "ff", English: "Fulah"}, - {Alpha3bCode: "geo", Alpha2Code: "ka", English: "Georgian"}, - {Alpha3bCode: "ger", Alpha2Code: "de", English: "German"}, - {Alpha3bCode: "gla", Alpha2Code: "gd", English: "Gaelic; Scottish Gaelic"}, - {Alpha3bCode: "gle", Alpha2Code: "ga", English: "Irish"}, - {Alpha3bCode: "glg", Alpha2Code: "gl", English: "Galician"}, - {Alpha3bCode: "glv", Alpha2Code: "gv", English: "Manx"}, - {Alpha3bCode: "gre", Alpha2Code: "el", English: "Greek, Modern (1453-)"}, - {Alpha3bCode: "grn", Alpha2Code: "gn", English: "Guarani"}, - {Alpha3bCode: "guj", Alpha2Code: "gu", English: "Gujarati"}, - {Alpha3bCode: "hat", Alpha2Code: "ht", English: "Haitian; Haitian Creole"}, - {Alpha3bCode: "hau", Alpha2Code: "ha", English: "Hausa"}, - {Alpha3bCode: "heb", Alpha2Code: "he", English: "Hebrew"}, - {Alpha3bCode: "her", Alpha2Code: "hz", English: "Herero"}, - {Alpha3bCode: "hin", Alpha2Code: "hi", English: "Hindi"}, - {Alpha3bCode: "hmo", Alpha2Code: "ho", English: "Hiri Motu"}, - {Alpha3bCode: "hrv", Alpha2Code: "hr", English: "Croatian"}, - {Alpha3bCode: "hun", Alpha2Code: "hu", English: "Hungarian"}, - {Alpha3bCode: "ibo", Alpha2Code: "ig", English: "Igbo"}, - {Alpha3bCode: "ice", Alpha2Code: "is", English: "Icelandic"}, - {Alpha3bCode: "ido", Alpha2Code: "io", English: "Ido"}, - {Alpha3bCode: "iii", Alpha2Code: "ii", English: "Sichuan Yi; Nuosu"}, - {Alpha3bCode: "iku", Alpha2Code: "iu", English: "Inuktitut"}, - {Alpha3bCode: "ile", Alpha2Code: "ie", English: "Interlingue; Occidental"}, - {Alpha3bCode: "ina", Alpha2Code: "ia", English: "Interlingua (International Auxiliary Language Association)"}, - {Alpha3bCode: "ind", Alpha2Code: "id", English: "Indonesian"}, - {Alpha3bCode: "ipk", Alpha2Code: "ik", English: "Inupiaq"}, - {Alpha3bCode: "ita", Alpha2Code: "it", English: "Italian"}, - {Alpha3bCode: "jav", Alpha2Code: "jv", English: "Javanese"}, - {Alpha3bCode: "jpn", Alpha2Code: "ja", English: "Japanese"}, - {Alpha3bCode: "kal", Alpha2Code: "kl", English: "Kalaallisut; Greenlandic"}, - {Alpha3bCode: "kan", Alpha2Code: "kn", English: "Kannada"}, - {Alpha3bCode: "kas", Alpha2Code: "ks", English: "Kashmiri"}, - {Alpha3bCode: "kau", Alpha2Code: "kr", English: "Kanuri"}, - {Alpha3bCode: "kaz", Alpha2Code: "kk", English: "Kazakh"}, - {Alpha3bCode: "khm", Alpha2Code: "km", English: "Central Khmer"}, - {Alpha3bCode: "kik", Alpha2Code: "ki", English: "Kikuyu; Gikuyu"}, - {Alpha3bCode: "kin", Alpha2Code: "rw", English: "Kinyarwanda"}, - {Alpha3bCode: "kir", Alpha2Code: "ky", English: "Kirghiz; Kyrgyz"}, - {Alpha3bCode: "kom", Alpha2Code: "kv", English: "Komi"}, - {Alpha3bCode: "kon", Alpha2Code: "kg", English: "Kongo"}, - {Alpha3bCode: "kor", Alpha2Code: "ko", English: "Korean"}, - {Alpha3bCode: "kua", Alpha2Code: "kj", English: "Kuanyama; Kwanyama"}, - {Alpha3bCode: "kur", Alpha2Code: "ku", English: "Kurdish"}, - {Alpha3bCode: "lao", Alpha2Code: "lo", English: "Lao"}, - {Alpha3bCode: "lat", Alpha2Code: "la", English: "Latin"}, - {Alpha3bCode: "lav", Alpha2Code: "lv", English: "Latvian"}, - {Alpha3bCode: "lim", Alpha2Code: "li", English: "Limburgan; Limburger; Limburgish"}, - {Alpha3bCode: "lin", Alpha2Code: "ln", English: "Lingala"}, - {Alpha3bCode: "lit", Alpha2Code: "lt", English: "Lithuanian"}, - {Alpha3bCode: "ltz", Alpha2Code: "lb", English: "Luxembourgish; Letzeburgesch"}, - {Alpha3bCode: "lub", Alpha2Code: "lu", English: "Luba-Katanga"}, - {Alpha3bCode: "lug", Alpha2Code: "lg", English: "Ganda"}, - {Alpha3bCode: "mac", Alpha2Code: "mk", English: "Macedonian"}, - {Alpha3bCode: "mah", Alpha2Code: "mh", English: "Marshallese"}, - {Alpha3bCode: "mal", Alpha2Code: "ml", English: "Malayalam"}, - {Alpha3bCode: "mao", Alpha2Code: "mi", English: "Maori"}, - {Alpha3bCode: "mar", Alpha2Code: "mr", English: "Marathi"}, - {Alpha3bCode: "may", Alpha2Code: "ms", English: "Malay"}, - {Alpha3bCode: "mlg", Alpha2Code: "mg", English: "Malagasy"}, - {Alpha3bCode: "mlt", Alpha2Code: "mt", English: "Maltese"}, - {Alpha3bCode: "mon", Alpha2Code: "mn", English: "Mongolian"}, - {Alpha3bCode: "nau", Alpha2Code: "na", English: "Nauru"}, - {Alpha3bCode: "nav", Alpha2Code: "nv", English: "Navajo; Navaho"}, - {Alpha3bCode: "nbl", Alpha2Code: "nr", English: "Ndebele, South; South Ndebele"}, - {Alpha3bCode: "nde", Alpha2Code: "nd", English: "Ndebele, North; North Ndebele"}, - {Alpha3bCode: "ndo", Alpha2Code: "ng", English: "Ndonga"}, - {Alpha3bCode: "nep", Alpha2Code: "ne", English: "Nepali"}, - {Alpha3bCode: "nno", Alpha2Code: "nn", English: "Norwegian Nynorsk; Nynorsk, Norwegian"}, - {Alpha3bCode: "nob", Alpha2Code: "nb", English: "Bokmål, Norwegian; Norwegian Bokmål"}, - {Alpha3bCode: "nor", Alpha2Code: "no", English: "Norwegian"}, - {Alpha3bCode: "nya", Alpha2Code: "ny", English: "Chichewa; Chewa; Nyanja"}, - {Alpha3bCode: "oci", Alpha2Code: "oc", English: "Occitan (post 1500); Provençal"}, - {Alpha3bCode: "oji", Alpha2Code: "oj", English: "Ojibwa"}, - {Alpha3bCode: "ori", Alpha2Code: "or", English: "Oriya"}, - {Alpha3bCode: "orm", Alpha2Code: "om", English: "Oromo"}, - {Alpha3bCode: "oss", Alpha2Code: "os", English: "Ossetian; Ossetic"}, - {Alpha3bCode: "pan", Alpha2Code: "pa", English: "Panjabi; Punjabi"}, - {Alpha3bCode: "per", Alpha2Code: "fa", English: "Persian"}, - {Alpha3bCode: "pli", Alpha2Code: "pi", English: "Pali"}, - {Alpha3bCode: "pol", Alpha2Code: "pl", English: "Polish"}, - {Alpha3bCode: "por", Alpha2Code: "pt", English: "Portuguese"}, - {Alpha3bCode: "pus", Alpha2Code: "ps", English: "Pushto; Pashto"}, - {Alpha3bCode: "que", Alpha2Code: "qu", English: "Quechua"}, - {Alpha3bCode: "roh", Alpha2Code: "rm", English: "Romansh"}, - {Alpha3bCode: "rum", Alpha2Code: "ro", English: "Romanian; Moldavian; Moldovan"}, - {Alpha3bCode: "run", Alpha2Code: "rn", English: "Rundi"}, - {Alpha3bCode: "rus", Alpha2Code: "ru", English: "Russian"}, - {Alpha3bCode: "sag", Alpha2Code: "sg", English: "Sango"}, - {Alpha3bCode: "san", Alpha2Code: "sa", English: "Sanskrit"}, - {Alpha3bCode: "sin", Alpha2Code: "si", English: "Sinhala; Sinhalese"}, - {Alpha3bCode: "slo", Alpha2Code: "sk", English: "Slovak"}, - {Alpha3bCode: "slv", Alpha2Code: "sl", English: "Slovenian"}, - {Alpha3bCode: "sme", Alpha2Code: "se", English: "Northern Sami"}, - {Alpha3bCode: "smo", Alpha2Code: "sm", English: "Samoan"}, - {Alpha3bCode: "sna", Alpha2Code: "sn", English: "Shona"}, - {Alpha3bCode: "snd", Alpha2Code: "sd", English: "Sindhi"}, - {Alpha3bCode: "som", Alpha2Code: "so", English: "Somali"}, - {Alpha3bCode: "sot", Alpha2Code: "st", English: "Sotho, Southern"}, - {Alpha3bCode: "spa", Alpha2Code: "es", English: "Spanish; Castilian"}, - {Alpha3bCode: "srd", Alpha2Code: "sc", English: "Sardinian"}, - {Alpha3bCode: "srp", Alpha2Code: "sr", English: "Serbian"}, - {Alpha3bCode: "ssw", Alpha2Code: "ss", English: "Swati"}, - {Alpha3bCode: "sun", Alpha2Code: "su", English: "Sundanese"}, - {Alpha3bCode: "swa", Alpha2Code: "sw", English: "Swahili"}, - {Alpha3bCode: "swe", Alpha2Code: "sv", English: "Swedish"}, - {Alpha3bCode: "tah", Alpha2Code: "ty", English: "Tahitian"}, - {Alpha3bCode: "tam", Alpha2Code: "ta", English: "Tamil"}, - {Alpha3bCode: "tat", Alpha2Code: "tt", English: "Tatar"}, - {Alpha3bCode: "tel", Alpha2Code: "te", English: "Telugu"}, - {Alpha3bCode: "tgk", Alpha2Code: "tg", English: "Tajik"}, - {Alpha3bCode: "tgl", Alpha2Code: "tl", English: "Tagalog"}, - {Alpha3bCode: "tha", Alpha2Code: "th", English: "Thai"}, - {Alpha3bCode: "tib", Alpha2Code: "bo", English: "Tibetan"}, - {Alpha3bCode: "tir", Alpha2Code: "ti", English: "Tigrinya"}, - {Alpha3bCode: "ton", Alpha2Code: "to", English: "Tonga (Tonga Islands)"}, - {Alpha3bCode: "tsn", Alpha2Code: "tn", English: "Tswana"}, - {Alpha3bCode: "tso", Alpha2Code: "ts", English: "Tsonga"}, - {Alpha3bCode: "tuk", Alpha2Code: "tk", English: "Turkmen"}, - {Alpha3bCode: "tur", Alpha2Code: "tr", English: "Turkish"}, - {Alpha3bCode: "twi", Alpha2Code: "tw", English: "Twi"}, - {Alpha3bCode: "uig", Alpha2Code: "ug", English: "Uighur; Uyghur"}, - {Alpha3bCode: "ukr", Alpha2Code: "uk", English: "Ukrainian"}, - {Alpha3bCode: "urd", Alpha2Code: "ur", English: "Urdu"}, - {Alpha3bCode: "uzb", Alpha2Code: "uz", English: "Uzbek"}, - {Alpha3bCode: "ven", Alpha2Code: "ve", English: "Venda"}, - {Alpha3bCode: "vie", Alpha2Code: "vi", English: "Vietnamese"}, - {Alpha3bCode: "vol", Alpha2Code: "vo", English: "Volapük"}, - {Alpha3bCode: "wel", Alpha2Code: "cy", English: "Welsh"}, - {Alpha3bCode: "wln", Alpha2Code: "wa", English: "Walloon"}, - {Alpha3bCode: "wol", Alpha2Code: "wo", English: "Wolof"}, - {Alpha3bCode: "xho", Alpha2Code: "xh", English: "Xhosa"}, - {Alpha3bCode: "yid", Alpha2Code: "yi", English: "Yiddish"}, - {Alpha3bCode: "yor", Alpha2Code: "yo", English: "Yoruba"}, - {Alpha3bCode: "zha", Alpha2Code: "za", English: "Zhuang; Chuang"}, - {Alpha3bCode: "zul", Alpha2Code: "zu", English: "Zulu"}, -} diff --git a/vendor/github.com/asaskevich/govalidator/utils.go b/vendor/github.com/asaskevich/govalidator/utils.go deleted file mode 100644 index f4c30f824a2..00000000000 --- a/vendor/github.com/asaskevich/govalidator/utils.go +++ /dev/null @@ -1,270 +0,0 @@ -package govalidator - -import ( - "errors" - "fmt" - "html" - "math" - "path" - "regexp" - "strings" - "unicode" - "unicode/utf8" -) - -// Contains checks if the string contains the substring. -func Contains(str, substring string) bool { - return strings.Contains(str, substring) -} - -// Matches checks if string matches the pattern (pattern is regular expression) -// In case of error return false -func Matches(str, pattern string) bool { - match, _ := regexp.MatchString(pattern, str) - return match -} - -// LeftTrim trims characters from the left side of the input. -// If second argument is empty, it will remove leading spaces. -func LeftTrim(str, chars string) string { - if chars == "" { - return strings.TrimLeftFunc(str, unicode.IsSpace) - } - r, _ := regexp.Compile("^[" + chars + "]+") - return r.ReplaceAllString(str, "") -} - -// RightTrim trims characters from the right side of the input. -// If second argument is empty, it will remove trailing spaces. -func RightTrim(str, chars string) string { - if chars == "" { - return strings.TrimRightFunc(str, unicode.IsSpace) - } - r, _ := regexp.Compile("[" + chars + "]+$") - return r.ReplaceAllString(str, "") -} - -// Trim trims characters from both sides of the input. -// If second argument is empty, it will remove spaces. -func Trim(str, chars string) string { - return LeftTrim(RightTrim(str, chars), chars) -} - -// WhiteList removes characters that do not appear in the whitelist. -func WhiteList(str, chars string) string { - pattern := "[^" + chars + "]+" - r, _ := regexp.Compile(pattern) - return r.ReplaceAllString(str, "") -} - -// BlackList removes characters that appear in the blacklist. -func BlackList(str, chars string) string { - pattern := "[" + chars + "]+" - r, _ := regexp.Compile(pattern) - return r.ReplaceAllString(str, "") -} - -// StripLow removes characters with a numerical value < 32 and 127, mostly control characters. -// If keep_new_lines is true, newline characters are preserved (\n and \r, hex 0xA and 0xD). -func StripLow(str string, keepNewLines bool) string { - chars := "" - if keepNewLines { - chars = "\x00-\x09\x0B\x0C\x0E-\x1F\x7F" - } else { - chars = "\x00-\x1F\x7F" - } - return BlackList(str, chars) -} - -// ReplacePattern replaces regular expression pattern in string -func ReplacePattern(str, pattern, replace string) string { - r, _ := regexp.Compile(pattern) - return r.ReplaceAllString(str, replace) -} - -// Escape replaces <, >, & and " with HTML entities. -var Escape = html.EscapeString - -func addSegment(inrune, segment []rune) []rune { - if len(segment) == 0 { - return inrune - } - if len(inrune) != 0 { - inrune = append(inrune, '_') - } - inrune = append(inrune, segment...) - return inrune -} - -// UnderscoreToCamelCase converts from underscore separated form to camel case form. -// Ex.: my_func => MyFunc -func UnderscoreToCamelCase(s string) string { - return strings.Replace(strings.Title(strings.Replace(strings.ToLower(s), "_", " ", -1)), " ", "", -1) -} - -// CamelCaseToUnderscore converts from camel case form to underscore separated form. -// Ex.: MyFunc => my_func -func CamelCaseToUnderscore(str string) string { - var output []rune - var segment []rune - for _, r := range str { - - // not treat number as separate segment - if !unicode.IsLower(r) && string(r) != "_" && !unicode.IsNumber(r) { - output = addSegment(output, segment) - segment = nil - } - segment = append(segment, unicode.ToLower(r)) - } - output = addSegment(output, segment) - return string(output) -} - -// Reverse returns reversed string -func Reverse(s string) string { - r := []rune(s) - for i, j := 0, len(r)-1; i < j; i, j = i+1, j-1 { - r[i], r[j] = r[j], r[i] - } - return string(r) -} - -// GetLines splits string by "\n" and return array of lines -func GetLines(s string) []string { - return strings.Split(s, "\n") -} - -// GetLine returns specified line of multiline string -func GetLine(s string, index int) (string, error) { - lines := GetLines(s) - if index < 0 || index >= len(lines) { - return "", errors.New("line index out of bounds") - } - return lines[index], nil -} - -// RemoveTags removes all tags from HTML string -func RemoveTags(s string) string { - return ReplacePattern(s, "<[^>]*>", "") -} - -// SafeFileName returns safe string that can be used in file names -func SafeFileName(str string) string { - name := strings.ToLower(str) - name = path.Clean(path.Base(name)) - name = strings.Trim(name, " ") - separators, err := regexp.Compile(`[ &_=+:]`) - if err == nil { - name = separators.ReplaceAllString(name, "-") - } - legal, err := regexp.Compile(`[^[:alnum:]-.]`) - if err == nil { - name = legal.ReplaceAllString(name, "") - } - for strings.Contains(name, "--") { - name = strings.Replace(name, "--", "-", -1) - } - return name -} - -// NormalizeEmail canonicalize an email address. -// The local part of the email address is lowercased for all domains; the hostname is always lowercased and -// the local part of the email address is always lowercased for hosts that are known to be case-insensitive (currently only GMail). -// Normalization follows special rules for known providers: currently, GMail addresses have dots removed in the local part and -// are stripped of tags (e.g. some.one+tag@gmail.com becomes someone@gmail.com) and all @googlemail.com addresses are -// normalized to @gmail.com. -func NormalizeEmail(str string) (string, error) { - if !IsEmail(str) { - return "", fmt.Errorf("%s is not an email", str) - } - parts := strings.Split(str, "@") - parts[0] = strings.ToLower(parts[0]) - parts[1] = strings.ToLower(parts[1]) - if parts[1] == "gmail.com" || parts[1] == "googlemail.com" { - parts[1] = "gmail.com" - parts[0] = strings.Split(ReplacePattern(parts[0], `\.`, ""), "+")[0] - } - return strings.Join(parts, "@"), nil -} - -// Truncate a string to the closest length without breaking words. -func Truncate(str string, length int, ending string) string { - var aftstr, befstr string - if len(str) > length { - words := strings.Fields(str) - before, present := 0, 0 - for i := range words { - befstr = aftstr - before = present - aftstr = aftstr + words[i] + " " - present = len(aftstr) - if present > length && i != 0 { - if (length - before) < (present - length) { - return Trim(befstr, " /\\.,\"'#!?&@+-") + ending - } - return Trim(aftstr, " /\\.,\"'#!?&@+-") + ending - } - } - } - - return str -} - -// PadLeft pads left side of a string if size of string is less then indicated pad length -func PadLeft(str string, padStr string, padLen int) string { - return buildPadStr(str, padStr, padLen, true, false) -} - -// PadRight pads right side of a string if size of string is less then indicated pad length -func PadRight(str string, padStr string, padLen int) string { - return buildPadStr(str, padStr, padLen, false, true) -} - -// PadBoth pads both sides of a string if size of string is less then indicated pad length -func PadBoth(str string, padStr string, padLen int) string { - return buildPadStr(str, padStr, padLen, true, true) -} - -// PadString either left, right or both sides. -// Note that padding string can be unicode and more then one character -func buildPadStr(str string, padStr string, padLen int, padLeft bool, padRight bool) string { - - // When padded length is less then the current string size - if padLen < utf8.RuneCountInString(str) { - return str - } - - padLen -= utf8.RuneCountInString(str) - - targetLen := padLen - - targetLenLeft := targetLen - targetLenRight := targetLen - if padLeft && padRight { - targetLenLeft = padLen / 2 - targetLenRight = padLen - targetLenLeft - } - - strToRepeatLen := utf8.RuneCountInString(padStr) - - repeatTimes := int(math.Ceil(float64(targetLen) / float64(strToRepeatLen))) - repeatedString := strings.Repeat(padStr, repeatTimes) - - leftSide := "" - if padLeft { - leftSide = repeatedString[0:targetLenLeft] - } - - rightSide := "" - if padRight { - rightSide = repeatedString[0:targetLenRight] - } - - return leftSide + str + rightSide -} - -// TruncatingErrorf removes extra args from fmt.Errorf if not formatted in the str object -func TruncatingErrorf(str string, args ...interface{}) error { - n := strings.Count(str, "%s") - return fmt.Errorf(str, args[:n]...) -} diff --git a/vendor/github.com/asaskevich/govalidator/v11/.gitignore b/vendor/github.com/asaskevich/govalidator/v11/.gitignore deleted file mode 100644 index 8d69a9418aa..00000000000 --- a/vendor/github.com/asaskevich/govalidator/v11/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -bin/ -.idea/ -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib - -# Test binary, built with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - diff --git a/vendor/github.com/asaskevich/govalidator/v11/.travis.yml b/vendor/github.com/asaskevich/govalidator/v11/.travis.yml deleted file mode 100644 index bb83c6670df..00000000000 --- a/vendor/github.com/asaskevich/govalidator/v11/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: go -dist: xenial -go: - - '1.10' - - '1.11' - - '1.12' - - '1.13' - - 'tip' - -script: - - go test -coverpkg=./... -coverprofile=coverage.info -timeout=5s - - bash <(curl -s https://codecov.io/bash) diff --git a/vendor/github.com/asaskevich/govalidator/v11/CODE_OF_CONDUCT.md b/vendor/github.com/asaskevich/govalidator/v11/CODE_OF_CONDUCT.md deleted file mode 100644 index 4b462b0d81b..00000000000 --- a/vendor/github.com/asaskevich/govalidator/v11/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,43 +0,0 @@ -# Contributor Code of Conduct - -This project adheres to [The Code Manifesto](http://codemanifesto.com) -as its guidelines for contributor interactions. - -## The Code Manifesto - -We want to work in an ecosystem that empowers developers to reach their -potential — one that encourages growth and effective collaboration. A space -that is safe for all. - -A space such as this benefits everyone that participates in it. It encourages -new developers to enter our field. It is through discussion and collaboration -that we grow, and through growth that we improve. - -In the effort to create such a place, we hold to these values: - -1. **Discrimination limits us.** This includes discrimination on the basis of - race, gender, sexual orientation, gender identity, age, nationality, - technology and any other arbitrary exclusion of a group of people. -2. **Boundaries honor us.** Your comfort levels are not everyone’s comfort - levels. Remember that, and if brought to your attention, heed it. -3. **We are our biggest assets.** None of us were born masters of our trade. - Each of us has been helped along the way. Return that favor, when and where - you can. -4. **We are resources for the future.** As an extension of #3, share what you - know. Make yourself a resource to help those that come after you. -5. **Respect defines us.** Treat others as you wish to be treated. Make your - discussions, criticisms and debates from a position of respectfulness. Ask - yourself, is it true? Is it necessary? Is it constructive? Anything less is - unacceptable. -6. **Reactions require grace.** Angry responses are valid, but abusive language - and vindictive actions are toxic. When something happens that offends you, - handle it assertively, but be respectful. Escalate reasonably, and try to - allow the offender an opportunity to explain themselves, and possibly - correct the issue. -7. **Opinions are just that: opinions.** Each and every one of us, due to our - background and upbringing, have varying opinions. That is perfectly - acceptable. Remember this: if you respect your own opinions, you should - respect the opinions of others. -8. **To err is human.** You might not intend it, but mistakes do happen and - contribute to build experience. Tolerate honest mistakes, and don't - hesitate to apologize if you make one yourself. diff --git a/vendor/github.com/asaskevich/govalidator/v11/CONTRIBUTING.md b/vendor/github.com/asaskevich/govalidator/v11/CONTRIBUTING.md deleted file mode 100644 index 7ed268a1edd..00000000000 --- a/vendor/github.com/asaskevich/govalidator/v11/CONTRIBUTING.md +++ /dev/null @@ -1,63 +0,0 @@ -#### Support -If you do have a contribution to the package, feel free to create a Pull Request or an Issue. - -#### What to contribute -If you don't know what to do, there are some features and functions that need to be done - -- [ ] Refactor code -- [ ] Edit docs and [README](https://github.com/asaskevich/govalidator/README.md): spellcheck, grammar and typo check -- [ ] Create actual list of contributors and projects that currently using this package -- [ ] Resolve [issues and bugs](https://github.com/asaskevich/govalidator/issues) -- [ ] Update actual [list of functions](https://github.com/asaskevich/govalidator#list-of-functions) -- [ ] Update [list of validators](https://github.com/asaskevich/govalidator#validatestruct-2) that available for `ValidateStruct` and add new -- [ ] Implement new validators: `IsFQDN`, `IsIMEI`, `IsPostalCode`, `IsISIN`, `IsISRC` etc -- [x] Implement [validation by maps](https://github.com/asaskevich/govalidator/issues/224) -- [ ] Implement fuzzing testing -- [ ] Implement some struct/map/array utilities -- [ ] Implement map/array validation -- [ ] Implement benchmarking -- [ ] Implement batch of examples -- [ ] Look at forks for new features and fixes - -#### Advice -Feel free to create what you want, but keep in mind when you implement new features: -- Code must be clear and readable, names of variables/constants clearly describes what they are doing -- Public functions must be documented and described in source file and added to README.md to the list of available functions -- There are must be unit-tests for any new functions and improvements - -## Financial contributions - -We also welcome financial contributions in full transparency on our [open collective](https://opencollective.com/govalidator). -Anyone can file an expense. If the expense makes sense for the development of the community, it will be "merged" in the ledger of our open collective by the core contributors and the person who filed the expense will be reimbursed. - - -## Credits - - -### Contributors - -Thank you to all the people who have already contributed to govalidator! - - - -### Backers - -Thank you to all our backers! [[Become a backer](https://opencollective.com/govalidator#backer)] - - - - -### Sponsors - -Thank you to all our sponsors! (please ask your company to also support this open source project by [becoming a sponsor](https://opencollective.com/govalidator#sponsor)) - - - - - - - - - - - \ No newline at end of file diff --git a/vendor/github.com/asaskevich/govalidator/v11/LICENSE b/vendor/github.com/asaskevich/govalidator/v11/LICENSE deleted file mode 100644 index cacba910240..00000000000 --- a/vendor/github.com/asaskevich/govalidator/v11/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2020 Alex Saskevich - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/vendor/github.com/asaskevich/govalidator/v11/README.md b/vendor/github.com/asaskevich/govalidator/v11/README.md deleted file mode 100644 index fa56e3c4c89..00000000000 --- a/vendor/github.com/asaskevich/govalidator/v11/README.md +++ /dev/null @@ -1,624 +0,0 @@ -govalidator -=========== -[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/asaskevich/govalidator?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![GoDoc](https://godoc.org/github.com/asaskevich/govalidator?status.png)](https://godoc.org/github.com/asaskevich/govalidator) -[![Build Status](https://travis-ci.org/asaskevich/govalidator.svg?branch=master)](https://travis-ci.org/asaskevich/govalidator) -[![Coverage](https://codecov.io/gh/asaskevich/govalidator/branch/master/graph/badge.svg)](https://codecov.io/gh/asaskevich/govalidator) [![Go Report Card](https://goreportcard.com/badge/github.com/asaskevich/govalidator)](https://goreportcard.com/report/github.com/asaskevich/govalidator) [![GoSearch](http://go-search.org/badge?id=github.com%2Fasaskevich%2Fgovalidator)](http://go-search.org/view?id=github.com%2Fasaskevich%2Fgovalidator) [![Backers on Open Collective](https://opencollective.com/govalidator/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/govalidator/sponsors/badge.svg)](#sponsors) [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator?ref=badge_shield) - -A package of validators and sanitizers for strings, structs and collections. Based on [validator.js](https://github.com/chriso/validator.js). - -#### Installation -Make sure that Go is installed on your computer. -Type the following command in your terminal: - - go get github.com/asaskevich/govalidator/v11 - -or you can get specified release of the package with `gopkg.in`: - - go get gopkg.in/asaskevich/govalidator.v10 - -After it the package is ready to use. - - -#### Import package in your project -Add following line in your `*.go` file: -```go -import "github.com/asaskevich/govalidator/v11" -``` -If you are unhappy to use long `govalidator`, you can do something like this: -```go -import ( - valid "github.com/asaskevich/govalidator/v11" -) -``` - -#### Activate behavior to require all fields have a validation tag by default -`SetFieldsRequiredByDefault` causes validation to fail when struct fields do not include validations or are not explicitly marked as exempt (using `valid:"-"` or `valid:"email,optional"`). A good place to activate this is a package init function or the main() function. - -`SetNilPtrAllowedByRequired` causes validation to pass when struct fields marked by `required` are set to nil. This is disabled by default for consistency, but some packages that need to be able to determine between `nil` and `zero value` state can use this. If disabled, both `nil` and `zero` values cause validation errors. - -```go -import "github.com/asaskevich/govalidator/v11" - -func init() { - govalidator.SetFieldsRequiredByDefault(true) -} -``` - -Here's some code to explain it: -```go -// this struct definition will fail govalidator.ValidateStruct() (and the field values do not matter): -type exampleStruct struct { - Name string `` - Email string `valid:"email"` -} - -// this, however, will only fail when Email is empty or an invalid email address: -type exampleStruct2 struct { - Name string `valid:"-"` - Email string `valid:"email"` -} - -// lastly, this will only fail when Email is an invalid email address but not when it's empty: -type exampleStruct2 struct { - Name string `valid:"-"` - Email string `valid:"email,optional"` -} -``` - -#### Recent breaking changes (see [#123](https://github.com/asaskevich/govalidator/pull/123)) -##### Custom validator function signature -A context was added as the second parameter, for structs this is the object being validated – this makes dependent validation possible. -```go -import "github.com/asaskevich/govalidator/v11" - -// old signature -func(i interface{}) bool - -// new signature -func(i interface{}, o interface{}) bool -``` - -##### Adding a custom validator -This was changed to prevent data races when accessing custom validators. -```go -import "github.com/asaskevich/govalidator/v11" - -// before -govalidator.CustomTypeTagMap["customByteArrayValidator"] = func(i interface{}, o interface{}) bool { - // ... -} - -// after -govalidator.CustomTypeTagMap.Set("customByteArrayValidator", func(i interface{}, o interface{}) bool { - // ... -}) -``` - -#### List of functions: -```go -func Abs(value float64) float64 -func BlackList(str, chars string) string -func ByteLength(str string, params ...string) bool -func CamelCaseToUnderscore(str string) string -func Contains(str, substring string) bool -func Count(array []interface{}, iterator ConditionIterator) int -func Each(array []interface{}, iterator Iterator) -func ErrorByField(e error, field string) string -func ErrorsByField(e error) map[string]string -func Filter(array []interface{}, iterator ConditionIterator) []interface{} -func Find(array []interface{}, iterator ConditionIterator) interface{} -func GetLine(s string, index int) (string, error) -func GetLines(s string) []string -func HasLowerCase(str string) bool -func HasUpperCase(str string) bool -func HasWhitespace(str string) bool -func HasWhitespaceOnly(str string) bool -func InRange(value interface{}, left interface{}, right interface{}) bool -func InRangeFloat32(value, left, right float32) bool -func InRangeFloat64(value, left, right float64) bool -func InRangeInt(value, left, right interface{}) bool -func IsASCII(str string) bool -func IsAlpha(str string) bool -func IsAlphanumeric(str string) bool -func IsBase64(str string) bool -func IsByteLength(str string, min, max int) bool -func IsCIDR(str string) bool -func IsCRC32(str string) bool -func IsCRC32b(str string) bool -func IsCreditCard(str string) bool -func IsDNSName(str string) bool -func IsDataURI(str string) bool -func IsDialString(str string) bool -func IsDivisibleBy(str, num string) bool -func IsEmail(str string) bool -func IsExistingEmail(email string) bool -func IsFilePath(str string) (bool, int) -func IsFloat(str string) bool -func IsFullWidth(str string) bool -func IsHalfWidth(str string) bool -func IsHash(str string, algorithm string) bool -func IsHexadecimal(str string) bool -func IsHexcolor(str string) bool -func IsHost(str string) bool -func IsIP(str string) bool -func IsIPv4(str string) bool -func IsIPv6(str string) bool -func IsISBN(str string, version int) bool -func IsISBN10(str string) bool -func IsISBN13(str string) bool -func IsISO3166Alpha2(str string) bool -func IsISO3166Alpha3(str string) bool -func IsISO4217(str string) bool -func IsISO693Alpha2(str string) bool -func IsISO693Alpha3b(str string) bool -func IsIn(str string, params ...string) bool -func IsInRaw(str string, params ...string) bool -func IsInt(str string) bool -func IsJSON(str string) bool -func IsLatitude(str string) bool -func IsLongitude(str string) bool -func IsLowerCase(str string) bool -func IsMAC(str string) bool -func IsMD4(str string) bool -func IsMD5(str string) bool -func IsMagnetURI(str string) bool -func IsMongoID(str string) bool -func IsMultibyte(str string) bool -func IsNatural(value float64) bool -func IsNegative(value float64) bool -func IsNonNegative(value float64) bool -func IsNonPositive(value float64) bool -func IsNotNull(str string) bool -func IsNull(str string) bool -func IsNumeric(str string) bool -func IsPort(str string) bool -func IsPositive(value float64) bool -func IsPrintableASCII(str string) bool -func IsRFC3339(str string) bool -func IsRFC3339WithoutZone(str string) bool -func IsRGBcolor(str string) bool -func IsRegex(str string) bool -func IsRequestURI(rawurl string) bool -func IsRequestURL(rawurl string) bool -func IsRipeMD128(str string) bool -func IsRipeMD160(str string) bool -func IsRsaPub(str string, params ...string) bool -func IsRsaPublicKey(str string, keylen int) bool -func IsSHA1(str string) bool -func IsSHA256(str string) bool -func IsSHA384(str string) bool -func IsSHA512(str string) bool -func IsSSN(str string) bool -func IsSemver(str string) bool -func IsTiger128(str string) bool -func IsTiger160(str string) bool -func IsTiger192(str string) bool -func IsTime(str string, format string) bool -func IsType(v interface{}, params ...string) bool -func IsURL(str string) bool -func IsUTFDigit(str string) bool -func IsUTFLetter(str string) bool -func IsUTFLetterNumeric(str string) bool -func IsUTFNumeric(str string) bool -func IsUUID(str string) bool -func IsUUIDv3(str string) bool -func IsUUIDv4(str string) bool -func IsUUIDv5(str string) bool -func IsULID(str string) bool -func IsUnixTime(str string) bool -func IsUpperCase(str string) bool -func IsVariableWidth(str string) bool -func IsYYYYMMDD(str string) bool -func IsWhole(value float64) bool -func LeftTrim(str, chars string) string -func Map(array []interface{}, iterator ResultIterator) []interface{} -func Matches(str, pattern string) bool -func MaxStringLength(str string, params ...string) bool -func MinStringLength(str string, params ...string) bool -func NormalizeEmail(str string) (string, error) -func PadBoth(str string, padStr string, padLen int) string -func PadLeft(str string, padStr string, padLen int) string -func PadRight(str string, padStr string, padLen int) string -func PrependPathToErrors(err error, path string) error -func Range(str string, params ...string) bool -func RemoveTags(s string) string -func ReplacePattern(str, pattern, replace string) string -func Reverse(s string) string -func RightTrim(str, chars string) string -func RuneLength(str string, params ...string) bool -func SafeFileName(str string) string -func SetFieldsRequiredByDefault(value bool) -func SetNilPtrAllowedByRequired(value bool) -func Sign(value float64) float64 -func StringLength(str string, params ...string) bool -func StringMatches(s string, params ...string) bool -func StripLow(str string, keepNewLines bool) string -func ToBoolean(str string) (bool, error) -func ToFloat(str string) (float64, error) -func ToInt(value interface{}) (res int64, err error) -func ToJSON(obj interface{}) (string, error) -func ToString(obj interface{}) string -func Trim(str, chars string) string -func Truncate(str string, length int, ending string) string -func TruncatingErrorf(str string, args ...interface{}) error -func UnderscoreToCamelCase(s string) string -func ValidateMap(inputMap map[string]interface{}, validationMap map[string]interface{}) (bool, error) -func ValidateStruct(s interface{}) (bool, error) -func WhiteList(str, chars string) string -type ConditionIterator -type CustomTypeValidator -type Error -func (e Error) Error() string -type Errors -func (es Errors) Error() string -func (es Errors) Errors() []error -type ISO3166Entry -type ISO693Entry -type InterfaceParamValidator -type Iterator -type ParamValidator -type ResultIterator -type UnsupportedTypeError -func (e *UnsupportedTypeError) Error() string -type Validator -``` - -#### Examples -###### IsURL -```go -println(govalidator.IsURL(`http://user@pass:domain.com/path/page`)) -``` -###### IsType -```go -println(govalidator.IsType("Bob", "string")) -println(govalidator.IsType(1, "int")) -i := 1 -println(govalidator.IsType(&i, "*int")) -``` - -IsType can be used through the tag `type` which is essential for map validation: -```go -type User struct { - Name string `valid:"type(string)"` - Age int `valid:"type(int)"` - Meta interface{} `valid:"type(string)"` -} -result, err := govalidator.ValidateStruct(User{"Bob", 20, "meta"}) -if err != nil { - println("error: " + err.Error()) -} -println(result) -``` -###### ToString -```go -type User struct { - FirstName string - LastName string -} - -str := govalidator.ToString(&User{"John", "Juan"}) -println(str) -``` -###### Each, Map, Filter, Count for slices -Each iterates over the slice/array and calls Iterator for every item -```go -data := []interface{}{1, 2, 3, 4, 5} -var fn govalidator.Iterator = func(value interface{}, index int) { - println(value.(int)) -} -govalidator.Each(data, fn) -``` -```go -data := []interface{}{1, 2, 3, 4, 5} -var fn govalidator.ResultIterator = func(value interface{}, index int) interface{} { - return value.(int) * 3 -} -_ = govalidator.Map(data, fn) // result = []interface{}{1, 6, 9, 12, 15} -``` -```go -data := []interface{}{1, 2, 3, 4, 5, 6, 7, 8, 9, 10} -var fn govalidator.ConditionIterator = func(value interface{}, index int) bool { - return value.(int)%2 == 0 -} -_ = govalidator.Filter(data, fn) // result = []interface{}{2, 4, 6, 8, 10} -_ = govalidator.Count(data, fn) // result = 5 -``` -###### ValidateStruct [#2](https://github.com/asaskevich/govalidator/pull/2) -If you want to validate structs, you can use tag `valid` for any field in your structure. All validators used with this field in one tag are separated by comma. If you want to skip validation, place `-` in your tag. If you need a validator that is not on the list below, you can add it like this: -```go -govalidator.TagMap["duck"] = govalidator.Validator(func(str string) bool { - return str == "duck" -}) -``` -For completely custom validators (interface-based), see below. - -Here is a list of available validators for struct fields (validator - used function): -```go -"email": IsEmail, -"url": IsURL, -"dialstring": IsDialString, -"requrl": IsRequestURL, -"requri": IsRequestURI, -"alpha": IsAlpha, -"utfletter": IsUTFLetter, -"alphanum": IsAlphanumeric, -"utfletternum": IsUTFLetterNumeric, -"numeric": IsNumeric, -"utfnumeric": IsUTFNumeric, -"utfdigit": IsUTFDigit, -"hexadecimal": IsHexadecimal, -"hexcolor": IsHexcolor, -"rgbcolor": IsRGBcolor, -"lowercase": IsLowerCase, -"uppercase": IsUpperCase, -"int": IsInt, -"float": IsFloat, -"null": IsNull, -"uuid": IsUUID, -"uuidv3": IsUUIDv3, -"uuidv4": IsUUIDv4, -"uuidv5": IsUUIDv5, -"creditcard": IsCreditCard, -"isbn10": IsISBN10, -"isbn13": IsISBN13, -"json": IsJSON, -"multibyte": IsMultibyte, -"ascii": IsASCII, -"printableascii": IsPrintableASCII, -"fullwidth": IsFullWidth, -"halfwidth": IsHalfWidth, -"variablewidth": IsVariableWidth, -"base64": IsBase64, -"datauri": IsDataURI, -"ip": IsIP, -"port": IsPort, -"ipv4": IsIPv4, -"ipv6": IsIPv6, -"dns": IsDNSName, -"host": IsHost, -"mac": IsMAC, -"latitude": IsLatitude, -"longitude": IsLongitude, -"ssn": IsSSN, -"semver": IsSemver, -"rfc3339": IsRFC3339, -"rfc3339WithoutZone": IsRFC3339WithoutZone, -"ISO3166Alpha2": IsISO3166Alpha2, -"ISO3166Alpha3": IsISO3166Alpha3, -"ulid": IsULID, -"yyyymmdd": IsYYYYMMDD, -``` -Validators with parameters - -```go -"range(min|max)": Range, -"length(min|max)": ByteLength, -"runelength(min|max)": RuneLength, -"stringlength(min|max)": StringLength, -"matches(pattern)": StringMatches, -"in(string1|string2|...|stringN)": IsIn, -"rsapub(keylength)" : IsRsaPub, -"minstringlength(int): MinStringLength, -"maxstringlength(int): MaxStringLength, -``` -Validators with parameters for any type - -```go -"type(type)": IsType, -``` - -And here is small example of usage: -```go -type Post struct { - Title string `valid:"alphanum,required"` - Message string `valid:"duck,ascii"` - Message2 string `valid:"animal(dog)"` - AuthorIP string `valid:"ipv4"` - Date string `valid:"-"` -} -post := &Post{ - Title: "My Example Post", - Message: "duck", - Message2: "dog", - AuthorIP: "123.234.54.3", -} - -// Add your own struct validation tags -govalidator.TagMap["duck"] = govalidator.Validator(func(str string) bool { - return str == "duck" -}) - -// Add your own struct validation tags with parameter -govalidator.ParamTagMap["animal"] = govalidator.ParamValidator(func(str string, params ...string) bool { - species := params[0] - return str == species -}) -govalidator.ParamTagRegexMap["animal"] = regexp.MustCompile("^animal\\((\\w+)\\)$") - -result, err := govalidator.ValidateStruct(post) -if err != nil { - println("error: " + err.Error()) -} -println(result) -``` -###### ValidateMap [#2](https://github.com/asaskevich/govalidator/pull/338) -If you want to validate maps, you can use the map to be validated and a validation map that contain the same tags used in ValidateStruct, both maps have to be in the form `map[string]interface{}` - -So here is small example of usage: -```go -var mapTemplate = map[string]interface{}{ - "name":"required,alpha", - "family":"required,alpha", - "email":"required,email", - "cell-phone":"numeric", - "address":map[string]interface{}{ - "line1":"required,alphanum", - "line2":"alphanum", - "postal-code":"numeric", - }, -} - -var inputMap = map[string]interface{}{ - "name":"Bob", - "family":"Smith", - "email":"foo@bar.baz", - "address":map[string]interface{}{ - "line1":"", - "line2":"", - "postal-code":"", - }, -} - -result, err := govalidator.ValidateMap(inputMap, mapTemplate) -if err != nil { - println("error: " + err.Error()) -} -println(result) -``` - -###### WhiteList -```go -// Remove all characters from string ignoring characters between "a" and "z" -println(govalidator.WhiteList("a3a43a5a4a3a2a23a4a5a4a3a4", "a-z") == "aaaaaaaaaaaa") -``` - -###### Custom validation functions -Custom validation using your own domain specific validators is also available - here's an example of how to use it: -```go -import "github.com/asaskevich/govalidator/v11" - -type CustomByteArray [6]byte // custom types are supported and can be validated - -type StructWithCustomByteArray struct { - ID CustomByteArray `valid:"customByteArrayValidator,customMinLengthValidator"` // multiple custom validators are possible as well and will be evaluated in sequence - Email string `valid:"email"` - CustomMinLength int `valid:"-"` -} - -govalidator.CustomTypeTagMap.Set("customByteArrayValidator", func(i interface{}, context interface{}) bool { - switch v := context.(type) { // you can type switch on the context interface being validated - case StructWithCustomByteArray: - // you can check and validate against some other field in the context, - // return early or not validate against the context at all – your choice - case SomeOtherType: - // ... - default: - // expecting some other type? Throw/panic here or continue - } - - switch v := i.(type) { // type switch on the struct field being validated - case CustomByteArray: - for _, e := range v { // this validator checks that the byte array is not empty, i.e. not all zeroes - if e != 0 { - return true - } - } - } - return false -}) -govalidator.CustomTypeTagMap.Set("customMinLengthValidator", func(i interface{}, context interface{}) bool { - switch v := context.(type) { // this validates a field against the value in another field, i.e. dependent validation - case StructWithCustomByteArray: - return len(v.ID) >= v.CustomMinLength - } - return false -}) -``` - -###### Loop over Error() -By default .Error() returns all errors in a single String. To access each error you can do this: -```go - if err != nil { - errs := err.(govalidator.Errors).Errors() - for _, e := range errs { - fmt.Println(e.Error()) - } - } -``` - -###### Custom error messages -Custom error messages are supported via annotations by adding the `~` separator - here's an example of how to use it: -```go -type Ticket struct { - Id int64 `json:"id"` - FirstName string `json:"firstname" valid:"required~First name is blank"` -} -``` - -#### Notes -Documentation is available here: [godoc.org](https://godoc.org/github.com/asaskevich/govalidator). -Full information about code coverage is also available here: [govalidator on gocover.io](http://gocover.io/github.com/asaskevich/govalidator). - -#### Support -If you do have a contribution to the package, feel free to create a Pull Request or an Issue. - -#### What to contribute -If you don't know what to do, there are some features and functions that need to be done - -- [ ] Refactor code -- [ ] Edit docs and [README](https://github.com/asaskevich/govalidator/README.md): spellcheck, grammar and typo check -- [ ] Create actual list of contributors and projects that currently using this package -- [ ] Resolve [issues and bugs](https://github.com/asaskevich/govalidator/issues) -- [ ] Update actual [list of functions](https://github.com/asaskevich/govalidator#list-of-functions) -- [ ] Update [list of validators](https://github.com/asaskevich/govalidator#validatestruct-2) that available for `ValidateStruct` and add new -- [ ] Implement new validators: `IsFQDN`, `IsIMEI`, `IsPostalCode`, `IsISIN`, `IsISRC` etc -- [x] Implement [validation by maps](https://github.com/asaskevich/govalidator/issues/224) -- [ ] Implement fuzzing testing -- [ ] Implement some struct/map/array utilities -- [ ] Implement map/array validation -- [ ] Implement benchmarking -- [ ] Implement batch of examples -- [ ] Look at forks for new features and fixes - -#### Advice -Feel free to create what you want, but keep in mind when you implement new features: -- Code must be clear and readable, names of variables/constants clearly describes what they are doing -- Public functions must be documented and described in source file and added to README.md to the list of available functions -- There are must be unit-tests for any new functions and improvements - -## Credits -### Contributors - -This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)]. - -#### Special thanks to [contributors](https://github.com/asaskevich/govalidator/graphs/contributors) -* [Daniel Lohse](https://github.com/annismckenzie) -* [Attila Oláh](https://github.com/attilaolah) -* [Daniel Korner](https://github.com/Dadie) -* [Steven Wilkin](https://github.com/stevenwilkin) -* [Deiwin Sarjas](https://github.com/deiwin) -* [Noah Shibley](https://github.com/slugmobile) -* [Nathan Davies](https://github.com/nathj07) -* [Matt Sanford](https://github.com/mzsanford) -* [Simon ccl1115](https://github.com/ccl1115) - - - - -### Backers - -Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/govalidator#backer)] - - - - -### Sponsors - -Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/govalidator#sponsor)] - - - - - - - - - - - - - - - -## License -[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator?ref=badge_large) diff --git a/vendor/github.com/asaskevich/govalidator/v11/arrays.go b/vendor/github.com/asaskevich/govalidator/v11/arrays.go deleted file mode 100644 index 3e1da7cb480..00000000000 --- a/vendor/github.com/asaskevich/govalidator/v11/arrays.go +++ /dev/null @@ -1,87 +0,0 @@ -package govalidator - -// Iterator is the function that accepts element of slice/array and its index -type Iterator func(interface{}, int) - -// ResultIterator is the function that accepts element of slice/array and its index and returns any result -type ResultIterator func(interface{}, int) interface{} - -// ConditionIterator is the function that accepts element of slice/array and its index and returns boolean -type ConditionIterator func(interface{}, int) bool - -// ReduceIterator is the function that accepts two element of slice/array and returns result of merging those values -type ReduceIterator func(interface{}, interface{}) interface{} - -// Some validates that any item of array corresponds to ConditionIterator. Returns boolean. -func Some(array []interface{}, iterator ConditionIterator) bool { - res := false - for index, data := range array { - res = res || iterator(data, index) - } - return res -} - -// Every validates that every item of array corresponds to ConditionIterator. Returns boolean. -func Every(array []interface{}, iterator ConditionIterator) bool { - res := true - for index, data := range array { - res = res && iterator(data, index) - } - return res -} - -// Reduce boils down a list of values into a single value by ReduceIterator -func Reduce(array []interface{}, iterator ReduceIterator, initialValue interface{}) interface{} { - for _, data := range array { - initialValue = iterator(initialValue, data) - } - return initialValue -} - -// Each iterates over the slice and apply Iterator to every item -func Each(array []interface{}, iterator Iterator) { - for index, data := range array { - iterator(data, index) - } -} - -// Map iterates over the slice and apply ResultIterator to every item. Returns new slice as a result. -func Map(array []interface{}, iterator ResultIterator) []interface{} { - var result = make([]interface{}, len(array)) - for index, data := range array { - result[index] = iterator(data, index) - } - return result -} - -// Find iterates over the slice and apply ConditionIterator to every item. Returns first item that meet ConditionIterator or nil otherwise. -func Find(array []interface{}, iterator ConditionIterator) interface{} { - for index, data := range array { - if iterator(data, index) { - return data - } - } - return nil -} - -// Filter iterates over the slice and apply ConditionIterator to every item. Returns new slice. -func Filter(array []interface{}, iterator ConditionIterator) []interface{} { - var result = make([]interface{}, 0) - for index, data := range array { - if iterator(data, index) { - result = append(result, data) - } - } - return result -} - -// Count iterates over the slice and apply ConditionIterator to every item. Returns count of items that meets ConditionIterator. -func Count(array []interface{}, iterator ConditionIterator) int { - count := 0 - for index, data := range array { - if iterator(data, index) { - count = count + 1 - } - } - return count -} diff --git a/vendor/github.com/asaskevich/govalidator/v11/converter.go b/vendor/github.com/asaskevich/govalidator/v11/converter.go deleted file mode 100644 index d68e990fc25..00000000000 --- a/vendor/github.com/asaskevich/govalidator/v11/converter.go +++ /dev/null @@ -1,81 +0,0 @@ -package govalidator - -import ( - "encoding/json" - "fmt" - "reflect" - "strconv" -) - -// ToString convert the input to a string. -func ToString(obj interface{}) string { - res := fmt.Sprintf("%v", obj) - return res -} - -// ToJSON convert the input to a valid JSON string -func ToJSON(obj interface{}) (string, error) { - res, err := json.Marshal(obj) - if err != nil { - res = []byte("") - } - return string(res), err -} - -// ToFloat convert the input string to a float, or 0.0 if the input is not a float. -func ToFloat(value interface{}) (res float64, err error) { - val := reflect.ValueOf(value) - - switch value.(type) { - case int, int8, int16, int32, int64: - res = float64(val.Int()) - case uint, uint8, uint16, uint32, uint64: - res = float64(val.Uint()) - case float32, float64: - res = val.Float() - case string: - res, err = strconv.ParseFloat(val.String(), 64) - if err != nil { - res = 0 - } - default: - err = fmt.Errorf("ToInt: unknown interface type %T", value) - res = 0 - } - - return -} - -// ToInt convert the input string or any int type to an integer type 64, or 0 if the input is not an integer. -func ToInt(value interface{}) (res int64, err error) { - val := reflect.ValueOf(value) - - switch value.(type) { - case int, int8, int16, int32, int64: - res = val.Int() - case uint, uint8, uint16, uint32, uint64: - res = int64(val.Uint()) - case float32, float64: - res = int64(val.Float()) - case string: - if IsInt(val.String()) { - res, err = strconv.ParseInt(val.String(), 0, 64) - if err != nil { - res = 0 - } - } else { - err = fmt.Errorf("ToInt: invalid numeric format %g", value) - res = 0 - } - default: - err = fmt.Errorf("ToInt: unknown interface type %T", value) - res = 0 - } - - return -} - -// ToBoolean convert the input string to a boolean. -func ToBoolean(str string) (bool, error) { - return strconv.ParseBool(str) -} diff --git a/vendor/github.com/asaskevich/govalidator/v11/doc.go b/vendor/github.com/asaskevich/govalidator/v11/doc.go deleted file mode 100644 index 55dce62dc8c..00000000000 --- a/vendor/github.com/asaskevich/govalidator/v11/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -package govalidator - -// A package of validators and sanitizers for strings, structures and collections. diff --git a/vendor/github.com/asaskevich/govalidator/v11/error.go b/vendor/github.com/asaskevich/govalidator/v11/error.go deleted file mode 100644 index 1da2336f47e..00000000000 --- a/vendor/github.com/asaskevich/govalidator/v11/error.go +++ /dev/null @@ -1,47 +0,0 @@ -package govalidator - -import ( - "sort" - "strings" -) - -// Errors is an array of multiple errors and conforms to the error interface. -type Errors []error - -// Errors returns itself. -func (es Errors) Errors() []error { - return es -} - -func (es Errors) Error() string { - var errs []string - for _, e := range es { - errs = append(errs, e.Error()) - } - sort.Strings(errs) - return strings.Join(errs, ";") -} - -// Error encapsulates a name, an error and whether there's a custom error message or not. -type Error struct { - Name string - Err error - CustomErrorMessageExists bool - - // Validator indicates the name of the validator that failed - Validator string - Path []string -} - -func (e Error) Error() string { - if e.CustomErrorMessageExists { - return e.Err.Error() - } - - errName := e.Name - if len(e.Path) > 0 { - errName = strings.Join(append(e.Path, e.Name), ".") - } - - return errName + ": " + e.Err.Error() -} diff --git a/vendor/github.com/asaskevich/govalidator/v11/numerics.go b/vendor/github.com/asaskevich/govalidator/v11/numerics.go deleted file mode 100644 index 5041d9e8684..00000000000 --- a/vendor/github.com/asaskevich/govalidator/v11/numerics.go +++ /dev/null @@ -1,100 +0,0 @@ -package govalidator - -import ( - "math" -) - -// Abs returns absolute value of number -func Abs(value float64) float64 { - return math.Abs(value) -} - -// Sign returns signum of number: 1 in case of value > 0, -1 in case of value < 0, 0 otherwise -func Sign(value float64) float64 { - if value > 0 { - return 1 - } else if value < 0 { - return -1 - } else { - return 0 - } -} - -// IsNegative returns true if value < 0 -func IsNegative(value float64) bool { - return value < 0 -} - -// IsPositive returns true if value > 0 -func IsPositive(value float64) bool { - return value > 0 -} - -// IsNonNegative returns true if value >= 0 -func IsNonNegative(value float64) bool { - return value >= 0 -} - -// IsNonPositive returns true if value <= 0 -func IsNonPositive(value float64) bool { - return value <= 0 -} - -// InRangeInt returns true if value lies between left and right border -func InRangeInt(value, left, right interface{}) bool { - value64, _ := ToInt(value) - left64, _ := ToInt(left) - right64, _ := ToInt(right) - if left64 > right64 { - left64, right64 = right64, left64 - } - return value64 >= left64 && value64 <= right64 -} - -// InRangeFloat32 returns true if value lies between left and right border -func InRangeFloat32(value, left, right float32) bool { - if left > right { - left, right = right, left - } - return value >= left && value <= right -} - -// InRangeFloat64 returns true if value lies between left and right border -func InRangeFloat64(value, left, right float64) bool { - if left > right { - left, right = right, left - } - return value >= left && value <= right -} - -// InRange returns true if value lies between left and right border, generic type to handle int, float32, float64 and string. -// All types must the same type. -// False if value doesn't lie in range or if it incompatible or not comparable -func InRange(value interface{}, left interface{}, right interface{}) bool { - switch value.(type) { - case int: - intValue, _ := ToInt(value) - intLeft, _ := ToInt(left) - intRight, _ := ToInt(right) - return InRangeInt(intValue, intLeft, intRight) - case float32, float64: - intValue, _ := ToFloat(value) - intLeft, _ := ToFloat(left) - intRight, _ := ToFloat(right) - return InRangeFloat64(intValue, intLeft, intRight) - case string: - return value.(string) >= left.(string) && value.(string) <= right.(string) - default: - return false - } -} - -// IsWhole returns true if value is whole number -func IsWhole(value float64) bool { - return math.Remainder(value, 1) == 0 -} - -// IsNatural returns true if value is natural number (positive and whole) -func IsNatural(value float64) bool { - return IsWhole(value) && IsPositive(value) -} diff --git a/vendor/github.com/asaskevich/govalidator/v11/patterns.go b/vendor/github.com/asaskevich/govalidator/v11/patterns.go deleted file mode 100644 index bafc3765ea1..00000000000 --- a/vendor/github.com/asaskevich/govalidator/v11/patterns.go +++ /dev/null @@ -1,113 +0,0 @@ -package govalidator - -import "regexp" - -// Basic regular expressions for validating strings -const ( - Email string = "^(((([a-zA-Z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])+(\\.([a-zA-Z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])|(\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-zA-Z]|\\d|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])|(([a-zA-Z]|\\d|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])([a-zA-Z]|\\d|-|\\.|_|~|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])*([a-zA-Z]|\\d|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])))\\.)+(([a-zA-Z]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])|(([a-zA-Z]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])([a-zA-Z]|\\d|-|_|~|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])*([a-zA-Z]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])))\\.?$" - CreditCard string = "^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\\d{3})\\d{11}|6[27][0-9]{14})$" - ISBN10 string = "^(?:[0-9]{9}X|[0-9]{10})$" - ISBN13 string = "^(?:[0-9]{13})$" - UUID3 string = "^[0-9a-f]{8}-[0-9a-f]{4}-3[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}$" - UUID4 string = "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" - UUID5 string = "^[0-9a-f]{8}-[0-9a-f]{4}-5[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" - UUID string = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" - Alpha string = "^[a-zA-Z]+$" - Alphanumeric string = "^[a-zA-Z0-9]+$" - Numeric string = "^[0-9]+$" - Int string = "^(?:[-+]?(?:0|[1-9][0-9]*))$" - Float string = "^(?:[-+]?(?:[0-9]+))?(?:\\.[0-9]*)?(?:[eE][\\+\\-]?(?:[0-9]+))?$" - Hexadecimal string = "^[0-9a-fA-F]+$" - Hexcolor string = "^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$" - RGBcolor string = "^rgb\\(\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*,\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*,\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*\\)$" - ASCII string = "^[\x00-\x7F]+$" - Multibyte string = "[^\x00-\x7F]" - FullWidth string = "[^\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]" - HalfWidth string = "[\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]" - Base64 string = "^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=|[A-Za-z0-9+\\/]{4})$" - PrintableASCII string = "^[\x20-\x7E]+$" - DataURI string = "^data:.+\\/(.+);base64$" - MagnetURI string = "^magnet:\\?xt=urn:[a-zA-Z0-9]+:[a-zA-Z0-9]{32,40}&dn=.+&tr=.+$" - Latitude string = "^[-+]?([1-8]?\\d(\\.\\d+)?|90(\\.0+)?)$" - Longitude string = "^[-+]?(180(\\.0+)?|((1[0-7]\\d)|([1-9]?\\d))(\\.\\d+)?)$" - DNSName string = `^([a-zA-Z0-9_]{1}[a-zA-Z0-9_-]{0,62}){1}(\.[a-zA-Z0-9_]{1}[a-zA-Z0-9_-]{0,62})*[\._]?$` - IP string = `(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))` - URLSchema string = `((ftp|tcp|udp|wss?|https?):\/\/)` - URLUsername string = `(\S+(:\S*)?@)` - URLPath string = `((\/|\?|#)[^\s]*)` - URLPort string = `(:(\d{1,5}))` - URLIP string = `([1-9]\d?|1\d\d|2[01]\d|22[0-3]|24\d|25[0-5])(\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])){2}(?:\.([0-9]\d?|1\d\d|2[0-4]\d|25[0-5]))` - URLSubdomain string = `((www\.)|([a-zA-Z0-9]+([-_\.]?[a-zA-Z0-9])*[a-zA-Z0-9]\.[a-zA-Z0-9]+))` - URL = `^` + URLSchema + `?` + URLUsername + `?` + `((` + URLIP + `|(\[` + IP + `\])|(([a-zA-Z0-9]([a-zA-Z0-9-_]+)?[a-zA-Z0-9]([-\.][a-zA-Z0-9]+)*)|(` + URLSubdomain + `?))?(([a-zA-Z\x{00a1}-\x{ffff}0-9]+-?-?)*[a-zA-Z\x{00a1}-\x{ffff}0-9]+)(?:\.([a-zA-Z\x{00a1}-\x{ffff}]{1,}))?))\.?` + URLPort + `?` + URLPath + `?$` - SSN string = `^\d{3}[- ]?\d{2}[- ]?\d{4}$` - WinPath string = `^[a-zA-Z]:\\(?:[^\\/:*?"<>|\r\n]+\\)*[^\\/:*?"<>|\r\n]*$` - UnixPath string = `^(/[^/\x00]*)+/?$` - WinARPath string = `^(?:(?:[a-zA-Z]:|\\\\[a-z0-9_.$●-]+\\[a-z0-9_.$●-]+)\\|\\?[^\\/:*?"<>|\r\n]+\\?)(?:[^\\/:*?"<>|\r\n]+\\)*[^\\/:*?"<>|\r\n]*$` - UnixARPath string = `^((\.{0,2}/)?([^/\x00]*))+/?$` - Semver string = "^v?(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(-(0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(\\.(0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\\+[0-9a-zA-Z-]+(\\.[0-9a-zA-Z-]+)*)?$" - tagName string = "valid" - hasLowerCase string = ".*[[:lower:]]" - hasUpperCase string = ".*[[:upper:]]" - hasWhitespace string = ".*[[:space:]]" - hasWhitespaceOnly string = "^[[:space:]]+$" - IMEI string = "^[0-9a-f]{14}$|^\\d{15}$|^\\d{18}$" - IMSI string = "^\\d{14,15}$" - E164 string = `^\+?[1-9]\d{1,14}$` -) - -// Used by IsFilePath func -const ( - // Unknown is unresolved OS type - Unknown = iota - // Win is Windows type - Win - // Unix is *nix OS types - Unix -) - -var ( - userRegexp = regexp.MustCompile("^[a-zA-Z0-9!#$%&'*+/=?^_`{|}~.-]+$") - hostRegexp = regexp.MustCompile("^[^\\s]+\\.[^\\s]+$") - userDotRegexp = regexp.MustCompile("(^[.]{1})|([.]{1}$)|([.]{2,})") - rxEmail = regexp.MustCompile(Email) - rxCreditCard = regexp.MustCompile(CreditCard) - rxISBN10 = regexp.MustCompile(ISBN10) - rxISBN13 = regexp.MustCompile(ISBN13) - rxUUID3 = regexp.MustCompile(UUID3) - rxUUID4 = regexp.MustCompile(UUID4) - rxUUID5 = regexp.MustCompile(UUID5) - rxUUID = regexp.MustCompile(UUID) - rxAlpha = regexp.MustCompile(Alpha) - rxAlphanumeric = regexp.MustCompile(Alphanumeric) - rxNumeric = regexp.MustCompile(Numeric) - rxInt = regexp.MustCompile(Int) - rxFloat = regexp.MustCompile(Float) - rxHexadecimal = regexp.MustCompile(Hexadecimal) - rxHexcolor = regexp.MustCompile(Hexcolor) - rxRGBcolor = regexp.MustCompile(RGBcolor) - rxASCII = regexp.MustCompile(ASCII) - rxPrintableASCII = regexp.MustCompile(PrintableASCII) - rxMultibyte = regexp.MustCompile(Multibyte) - rxFullWidth = regexp.MustCompile(FullWidth) - rxHalfWidth = regexp.MustCompile(HalfWidth) - rxBase64 = regexp.MustCompile(Base64) - rxDataURI = regexp.MustCompile(DataURI) - rxMagnetURI = regexp.MustCompile(MagnetURI) - rxLatitude = regexp.MustCompile(Latitude) - rxLongitude = regexp.MustCompile(Longitude) - rxDNSName = regexp.MustCompile(DNSName) - rxURL = regexp.MustCompile(URL) - rxSSN = regexp.MustCompile(SSN) - rxWinPath = regexp.MustCompile(WinPath) - rxUnixPath = regexp.MustCompile(UnixPath) - rxARWinPath = regexp.MustCompile(WinARPath) - rxARUnixPath = regexp.MustCompile(UnixARPath) - rxSemver = regexp.MustCompile(Semver) - rxHasLowerCase = regexp.MustCompile(hasLowerCase) - rxHasUpperCase = regexp.MustCompile(hasUpperCase) - rxHasWhitespace = regexp.MustCompile(hasWhitespace) - rxHasWhitespaceOnly = regexp.MustCompile(hasWhitespaceOnly) - rxIMEI = regexp.MustCompile(IMEI) - rxIMSI = regexp.MustCompile(IMSI) - rxE164 = regexp.MustCompile(E164) -) diff --git a/vendor/github.com/asaskevich/govalidator/v11/types.go b/vendor/github.com/asaskevich/govalidator/v11/types.go deleted file mode 100644 index 6347d5fa6e6..00000000000 --- a/vendor/github.com/asaskevich/govalidator/v11/types.go +++ /dev/null @@ -1,657 +0,0 @@ -package govalidator - -import ( - "reflect" - "regexp" - "sort" - "sync" -) - -// Validator is a wrapper for a validator function that returns bool and accepts string. -type Validator func(str string) bool - -// CustomTypeValidator is a wrapper for validator functions that returns bool and accepts any type. -// The second parameter should be the context (in the case of validating a struct: the whole object being validated). -type CustomTypeValidator func(i interface{}, o interface{}) bool - -// ParamValidator is a wrapper for validator functions that accept additional parameters. -type ParamValidator func(str string, params ...string) bool - -// InterfaceParamValidator is a wrapper for functions that accept variants parameters for an interface value -type InterfaceParamValidator func(in interface{}, params ...string) bool -type tagOptionsMap map[string]tagOption - -func (t tagOptionsMap) orderedKeys() []string { - var keys []string - for k := range t { - keys = append(keys, k) - } - - sort.Slice(keys, func(a, b int) bool { - return t[keys[a]].order < t[keys[b]].order - }) - - return keys -} - -type tagOption struct { - name string - customErrorMessage string - order int -} - -// UnsupportedTypeError is a wrapper for reflect.Type -type UnsupportedTypeError struct { - Type reflect.Type -} - -// stringValues is a slice of reflect.Value holding *reflect.StringValue. -// It implements the methods to sort by string. -type stringValues []reflect.Value - -// InterfaceParamTagMap is a map of functions accept variants parameters for an interface value -var InterfaceParamTagMap = map[string]InterfaceParamValidator{ - "type": IsType, -} - -// InterfaceParamTagRegexMap maps interface param tags to their respective regexes. -var InterfaceParamTagRegexMap = map[string]*regexp.Regexp{ - "type": regexp.MustCompile(`^type\((.*)\)$`), -} - -// ParamTagMap is a map of functions accept variants parameters -var ParamTagMap = map[string]ParamValidator{ - "length": ByteLength, - "range": Range, - "runelength": RuneLength, - "stringlength": StringLength, - "matches": StringMatches, - "in": IsInRaw, - "rsapub": IsRsaPub, - "minstringlength": MinStringLength, - "maxstringlength": MaxStringLength, -} - -// ParamTagRegexMap maps param tags to their respective regexes. -var ParamTagRegexMap = map[string]*regexp.Regexp{ - "range": regexp.MustCompile("^range\\((\\d+)\\|(\\d+)\\)$"), - "length": regexp.MustCompile("^length\\((\\d+)\\|(\\d+)\\)$"), - "runelength": regexp.MustCompile("^runelength\\((\\d+)\\|(\\d+)\\)$"), - "stringlength": regexp.MustCompile("^stringlength\\((\\d+)\\|(\\d+)\\)$"), - "in": regexp.MustCompile(`^in\((.*)\)`), - "matches": regexp.MustCompile(`^matches\((.+)\)$`), - "rsapub": regexp.MustCompile("^rsapub\\((\\d+)\\)$"), - "minstringlength": regexp.MustCompile("^minstringlength\\((\\d+)\\)$"), - "maxstringlength": regexp.MustCompile("^maxstringlength\\((\\d+)\\)$"), -} - -type customTypeTagMap struct { - validators map[string]CustomTypeValidator - - sync.RWMutex -} - -func (tm *customTypeTagMap) Get(name string) (CustomTypeValidator, bool) { - tm.RLock() - defer tm.RUnlock() - v, ok := tm.validators[name] - return v, ok -} - -func (tm *customTypeTagMap) Set(name string, ctv CustomTypeValidator) { - tm.Lock() - defer tm.Unlock() - tm.validators[name] = ctv -} - -// CustomTypeTagMap is a map of functions that can be used as tags for ValidateStruct function. -// Use this to validate compound or custom types that need to be handled as a whole, e.g. -// `type UUID [16]byte` (this would be handled as an array of bytes). -var CustomTypeTagMap = &customTypeTagMap{validators: make(map[string]CustomTypeValidator)} - -// TagMap is a map of functions, that can be used as tags for ValidateStruct function. -var TagMap = map[string]Validator{ - "email": IsEmail, - "url": IsURL, - "dialstring": IsDialString, - "requrl": IsRequestURL, - "requri": IsRequestURI, - "alpha": IsAlpha, - "utfletter": IsUTFLetter, - "alphanum": IsAlphanumeric, - "utfletternum": IsUTFLetterNumeric, - "numeric": IsNumeric, - "utfnumeric": IsUTFNumeric, - "utfdigit": IsUTFDigit, - "hexadecimal": IsHexadecimal, - "hexcolor": IsHexcolor, - "rgbcolor": IsRGBcolor, - "lowercase": IsLowerCase, - "uppercase": IsUpperCase, - "int": IsInt, - "float": IsFloat, - "null": IsNull, - "notnull": IsNotNull, - "uuid": IsUUID, - "uuidv3": IsUUIDv3, - "uuidv4": IsUUIDv4, - "uuidv5": IsUUIDv5, - "creditcard": IsCreditCard, - "isbn10": IsISBN10, - "isbn13": IsISBN13, - "json": IsJSON, - "multibyte": IsMultibyte, - "ascii": IsASCII, - "printableascii": IsPrintableASCII, - "fullwidth": IsFullWidth, - "halfwidth": IsHalfWidth, - "variablewidth": IsVariableWidth, - "base64": IsBase64, - "datauri": IsDataURI, - "ip": IsIP, - "port": IsPort, - "ipv4": IsIPv4, - "ipv6": IsIPv6, - "dns": IsDNSName, - "host": IsHost, - "mac": IsMAC, - "latitude": IsLatitude, - "longitude": IsLongitude, - "ssn": IsSSN, - "semver": IsSemver, - "rfc3339": IsRFC3339, - "rfc3339WithoutZone": IsRFC3339WithoutZone, - "ISO3166Alpha2": IsISO3166Alpha2, - "ISO3166Alpha3": IsISO3166Alpha3, - "ISO4217": IsISO4217, - "IMEI": IsIMEI, - "ulid": IsULID, - "yyyymmdd": IsYYYYMMDD, -} - -// ISO3166Entry stores country codes -type ISO3166Entry struct { - EnglishShortName string - FrenchShortName string - Alpha2Code string - Alpha3Code string - Numeric string -} - -//ISO3166List based on https://www.iso.org/obp/ui/#search/code/ Code Type "Officially Assigned Codes" -var ISO3166List = []ISO3166Entry{ - {"Afghanistan", "Afghanistan (l')", "AF", "AFG", "004"}, - {"Albania", "Albanie (l')", "AL", "ALB", "008"}, - {"Antarctica", "Antarctique (l')", "AQ", "ATA", "010"}, - {"Algeria", "Algérie (l')", "DZ", "DZA", "012"}, - {"American Samoa", "Samoa américaines (les)", "AS", "ASM", "016"}, - {"Andorra", "Andorre (l')", "AD", "AND", "020"}, - {"Angola", "Angola (l')", "AO", "AGO", "024"}, - {"Antigua and Barbuda", "Antigua-et-Barbuda", "AG", "ATG", "028"}, - {"Azerbaijan", "Azerbaïdjan (l')", "AZ", "AZE", "031"}, - {"Argentina", "Argentine (l')", "AR", "ARG", "032"}, - {"Australia", "Australie (l')", "AU", "AUS", "036"}, - {"Austria", "Autriche (l')", "AT", "AUT", "040"}, - {"Bahamas (the)", "Bahamas (les)", "BS", "BHS", "044"}, - {"Bahrain", "Bahreïn", "BH", "BHR", "048"}, - {"Bangladesh", "Bangladesh (le)", "BD", "BGD", "050"}, - {"Armenia", "Arménie (l')", "AM", "ARM", "051"}, - {"Barbados", "Barbade (la)", "BB", "BRB", "052"}, - {"Belgium", "Belgique (la)", "BE", "BEL", "056"}, - {"Bermuda", "Bermudes (les)", "BM", "BMU", "060"}, - {"Bhutan", "Bhoutan (le)", "BT", "BTN", "064"}, - {"Bolivia (Plurinational State of)", "Bolivie (État plurinational de)", "BO", "BOL", "068"}, - {"Bosnia and Herzegovina", "Bosnie-Herzégovine (la)", "BA", "BIH", "070"}, - {"Botswana", "Botswana (le)", "BW", "BWA", "072"}, - {"Bouvet Island", "Bouvet (l'Île)", "BV", "BVT", "074"}, - {"Brazil", "Brésil (le)", "BR", "BRA", "076"}, - {"Belize", "Belize (le)", "BZ", "BLZ", "084"}, - {"British Indian Ocean Territory (the)", "Indien (le Territoire britannique de l'océan)", "IO", "IOT", "086"}, - {"Solomon Islands", "Salomon (Îles)", "SB", "SLB", "090"}, - {"Virgin Islands (British)", "Vierges britanniques (les Îles)", "VG", "VGB", "092"}, - {"Brunei Darussalam", "Brunéi Darussalam (le)", "BN", "BRN", "096"}, - {"Bulgaria", "Bulgarie (la)", "BG", "BGR", "100"}, - {"Myanmar", "Myanmar (le)", "MM", "MMR", "104"}, - {"Burundi", "Burundi (le)", "BI", "BDI", "108"}, - {"Belarus", "Bélarus (le)", "BY", "BLR", "112"}, - {"Cambodia", "Cambodge (le)", "KH", "KHM", "116"}, - {"Cameroon", "Cameroun (le)", "CM", "CMR", "120"}, - {"Canada", "Canada (le)", "CA", "CAN", "124"}, - {"Cabo Verde", "Cabo Verde", "CV", "CPV", "132"}, - {"Cayman Islands (the)", "Caïmans (les Îles)", "KY", "CYM", "136"}, - {"Central African Republic (the)", "République centrafricaine (la)", "CF", "CAF", "140"}, - {"Sri Lanka", "Sri Lanka", "LK", "LKA", "144"}, - {"Chad", "Tchad (le)", "TD", "TCD", "148"}, - {"Chile", "Chili (le)", "CL", "CHL", "152"}, - {"China", "Chine (la)", "CN", "CHN", "156"}, - {"Taiwan (Province of China)", "Taïwan (Province de Chine)", "TW", "TWN", "158"}, - {"Christmas Island", "Christmas (l'Île)", "CX", "CXR", "162"}, - {"Cocos (Keeling) Islands (the)", "Cocos (les Îles)/ Keeling (les Îles)", "CC", "CCK", "166"}, - {"Colombia", "Colombie (la)", "CO", "COL", "170"}, - {"Comoros (the)", "Comores (les)", "KM", "COM", "174"}, - {"Mayotte", "Mayotte", "YT", "MYT", "175"}, - {"Congo (the)", "Congo (le)", "CG", "COG", "178"}, - {"Congo (the Democratic Republic of the)", "Congo (la République démocratique du)", "CD", "COD", "180"}, - {"Cook Islands (the)", "Cook (les Îles)", "CK", "COK", "184"}, - {"Costa Rica", "Costa Rica (le)", "CR", "CRI", "188"}, - {"Croatia", "Croatie (la)", "HR", "HRV", "191"}, - {"Cuba", "Cuba", "CU", "CUB", "192"}, - {"Cyprus", "Chypre", "CY", "CYP", "196"}, - {"Czech Republic (the)", "tchèque (la République)", "CZ", "CZE", "203"}, - {"Benin", "Bénin (le)", "BJ", "BEN", "204"}, - {"Denmark", "Danemark (le)", "DK", "DNK", "208"}, - {"Dominica", "Dominique (la)", "DM", "DMA", "212"}, - {"Dominican Republic (the)", "dominicaine (la République)", "DO", "DOM", "214"}, - {"Ecuador", "Équateur (l')", "EC", "ECU", "218"}, - {"El Salvador", "El Salvador", "SV", "SLV", "222"}, - {"Equatorial Guinea", "Guinée équatoriale (la)", "GQ", "GNQ", "226"}, - {"Ethiopia", "Éthiopie (l')", "ET", "ETH", "231"}, - {"Eritrea", "Érythrée (l')", "ER", "ERI", "232"}, - {"Estonia", "Estonie (l')", "EE", "EST", "233"}, - {"Faroe Islands (the)", "Féroé (les Îles)", "FO", "FRO", "234"}, - {"Falkland Islands (the) [Malvinas]", "Falkland (les Îles)/Malouines (les Îles)", "FK", "FLK", "238"}, - {"South Georgia and the South Sandwich Islands", "Géorgie du Sud-et-les Îles Sandwich du Sud (la)", "GS", "SGS", "239"}, - {"Fiji", "Fidji (les)", "FJ", "FJI", "242"}, - {"Finland", "Finlande (la)", "FI", "FIN", "246"}, - {"Åland Islands", "Åland(les Îles)", "AX", "ALA", "248"}, - {"France", "France (la)", "FR", "FRA", "250"}, - {"French Guiana", "Guyane française (la )", "GF", "GUF", "254"}, - {"French Polynesia", "Polynésie française (la)", "PF", "PYF", "258"}, - {"French Southern Territories (the)", "Terres australes françaises (les)", "TF", "ATF", "260"}, - {"Djibouti", "Djibouti", "DJ", "DJI", "262"}, - {"Gabon", "Gabon (le)", "GA", "GAB", "266"}, - {"Georgia", "Géorgie (la)", "GE", "GEO", "268"}, - {"Gambia (the)", "Gambie (la)", "GM", "GMB", "270"}, - {"Palestine, State of", "Palestine, État de", "PS", "PSE", "275"}, - {"Germany", "Allemagne (l')", "DE", "DEU", "276"}, - {"Ghana", "Ghana (le)", "GH", "GHA", "288"}, - {"Gibraltar", "Gibraltar", "GI", "GIB", "292"}, - {"Kiribati", "Kiribati", "KI", "KIR", "296"}, - {"Greece", "Grèce (la)", "GR", "GRC", "300"}, - {"Greenland", "Groenland (le)", "GL", "GRL", "304"}, - {"Grenada", "Grenade (la)", "GD", "GRD", "308"}, - {"Guadeloupe", "Guadeloupe (la)", "GP", "GLP", "312"}, - {"Guam", "Guam", "GU", "GUM", "316"}, - {"Guatemala", "Guatemala (le)", "GT", "GTM", "320"}, - {"Guinea", "Guinée (la)", "GN", "GIN", "324"}, - {"Guyana", "Guyana (le)", "GY", "GUY", "328"}, - {"Haiti", "Haïti", "HT", "HTI", "332"}, - {"Heard Island and McDonald Islands", "Heard-et-Îles MacDonald (l'Île)", "HM", "HMD", "334"}, - {"Holy See (the)", "Saint-Siège (le)", "VA", "VAT", "336"}, - {"Honduras", "Honduras (le)", "HN", "HND", "340"}, - {"Hong Kong", "Hong Kong", "HK", "HKG", "344"}, - {"Hungary", "Hongrie (la)", "HU", "HUN", "348"}, - {"Iceland", "Islande (l')", "IS", "ISL", "352"}, - {"India", "Inde (l')", "IN", "IND", "356"}, - {"Indonesia", "Indonésie (l')", "ID", "IDN", "360"}, - {"Iran (Islamic Republic of)", "Iran (République Islamique d')", "IR", "IRN", "364"}, - {"Iraq", "Iraq (l')", "IQ", "IRQ", "368"}, - {"Ireland", "Irlande (l')", "IE", "IRL", "372"}, - {"Israel", "Israël", "IL", "ISR", "376"}, - {"Italy", "Italie (l')", "IT", "ITA", "380"}, - {"Côte d'Ivoire", "Côte d'Ivoire (la)", "CI", "CIV", "384"}, - {"Jamaica", "Jamaïque (la)", "JM", "JAM", "388"}, - {"Japan", "Japon (le)", "JP", "JPN", "392"}, - {"Kazakhstan", "Kazakhstan (le)", "KZ", "KAZ", "398"}, - {"Jordan", "Jordanie (la)", "JO", "JOR", "400"}, - {"Kenya", "Kenya (le)", "KE", "KEN", "404"}, - {"Korea (the Democratic People's Republic of)", "Corée (la République populaire démocratique de)", "KP", "PRK", "408"}, - {"Korea (the Republic of)", "Corée (la République de)", "KR", "KOR", "410"}, - {"Kuwait", "Koweït (le)", "KW", "KWT", "414"}, - {"Kyrgyzstan", "Kirghizistan (le)", "KG", "KGZ", "417"}, - {"Lao People's Democratic Republic (the)", "Lao, République démocratique populaire", "LA", "LAO", "418"}, - {"Lebanon", "Liban (le)", "LB", "LBN", "422"}, - {"Lesotho", "Lesotho (le)", "LS", "LSO", "426"}, - {"Latvia", "Lettonie (la)", "LV", "LVA", "428"}, - {"Liberia", "Libéria (le)", "LR", "LBR", "430"}, - {"Libya", "Libye (la)", "LY", "LBY", "434"}, - {"Liechtenstein", "Liechtenstein (le)", "LI", "LIE", "438"}, - {"Lithuania", "Lituanie (la)", "LT", "LTU", "440"}, - {"Luxembourg", "Luxembourg (le)", "LU", "LUX", "442"}, - {"Macao", "Macao", "MO", "MAC", "446"}, - {"Madagascar", "Madagascar", "MG", "MDG", "450"}, - {"Malawi", "Malawi (le)", "MW", "MWI", "454"}, - {"Malaysia", "Malaisie (la)", "MY", "MYS", "458"}, - {"Maldives", "Maldives (les)", "MV", "MDV", "462"}, - {"Mali", "Mali (le)", "ML", "MLI", "466"}, - {"Malta", "Malte", "MT", "MLT", "470"}, - {"Martinique", "Martinique (la)", "MQ", "MTQ", "474"}, - {"Mauritania", "Mauritanie (la)", "MR", "MRT", "478"}, - {"Mauritius", "Maurice", "MU", "MUS", "480"}, - {"Mexico", "Mexique (le)", "MX", "MEX", "484"}, - {"Monaco", "Monaco", "MC", "MCO", "492"}, - {"Mongolia", "Mongolie (la)", "MN", "MNG", "496"}, - {"Moldova (the Republic of)", "Moldova , République de", "MD", "MDA", "498"}, - {"Montenegro", "Monténégro (le)", "ME", "MNE", "499"}, - {"Montserrat", "Montserrat", "MS", "MSR", "500"}, - {"Morocco", "Maroc (le)", "MA", "MAR", "504"}, - {"Mozambique", "Mozambique (le)", "MZ", "MOZ", "508"}, - {"Oman", "Oman", "OM", "OMN", "512"}, - {"Namibia", "Namibie (la)", "NA", "NAM", "516"}, - {"Nauru", "Nauru", "NR", "NRU", "520"}, - {"Nepal", "Népal (le)", "NP", "NPL", "524"}, - {"Netherlands (the)", "Pays-Bas (les)", "NL", "NLD", "528"}, - {"Curaçao", "Curaçao", "CW", "CUW", "531"}, - {"Aruba", "Aruba", "AW", "ABW", "533"}, - {"Sint Maarten (Dutch part)", "Saint-Martin (partie néerlandaise)", "SX", "SXM", "534"}, - {"Bonaire, Sint Eustatius and Saba", "Bonaire, Saint-Eustache et Saba", "BQ", "BES", "535"}, - {"New Caledonia", "Nouvelle-Calédonie (la)", "NC", "NCL", "540"}, - {"Vanuatu", "Vanuatu (le)", "VU", "VUT", "548"}, - {"New Zealand", "Nouvelle-Zélande (la)", "NZ", "NZL", "554"}, - {"Nicaragua", "Nicaragua (le)", "NI", "NIC", "558"}, - {"Niger (the)", "Niger (le)", "NE", "NER", "562"}, - {"Nigeria", "Nigéria (le)", "NG", "NGA", "566"}, - {"Niue", "Niue", "NU", "NIU", "570"}, - {"Norfolk Island", "Norfolk (l'Île)", "NF", "NFK", "574"}, - {"Norway", "Norvège (la)", "NO", "NOR", "578"}, - {"Northern Mariana Islands (the)", "Mariannes du Nord (les Îles)", "MP", "MNP", "580"}, - {"United States Minor Outlying Islands (the)", "Îles mineures éloignées des États-Unis (les)", "UM", "UMI", "581"}, - {"Micronesia (Federated States of)", "Micronésie (États fédérés de)", "FM", "FSM", "583"}, - {"Marshall Islands (the)", "Marshall (Îles)", "MH", "MHL", "584"}, - {"Palau", "Palaos (les)", "PW", "PLW", "585"}, - {"Pakistan", "Pakistan (le)", "PK", "PAK", "586"}, - {"Panama", "Panama (le)", "PA", "PAN", "591"}, - {"Papua New Guinea", "Papouasie-Nouvelle-Guinée (la)", "PG", "PNG", "598"}, - {"Paraguay", "Paraguay (le)", "PY", "PRY", "600"}, - {"Peru", "Pérou (le)", "PE", "PER", "604"}, - {"Philippines (the)", "Philippines (les)", "PH", "PHL", "608"}, - {"Pitcairn", "Pitcairn", "PN", "PCN", "612"}, - {"Poland", "Pologne (la)", "PL", "POL", "616"}, - {"Portugal", "Portugal (le)", "PT", "PRT", "620"}, - {"Guinea-Bissau", "Guinée-Bissau (la)", "GW", "GNB", "624"}, - {"Timor-Leste", "Timor-Leste (le)", "TL", "TLS", "626"}, - {"Puerto Rico", "Porto Rico", "PR", "PRI", "630"}, - {"Qatar", "Qatar (le)", "QA", "QAT", "634"}, - {"Réunion", "Réunion (La)", "RE", "REU", "638"}, - {"Romania", "Roumanie (la)", "RO", "ROU", "642"}, - {"Russian Federation (the)", "Russie (la Fédération de)", "RU", "RUS", "643"}, - {"Rwanda", "Rwanda (le)", "RW", "RWA", "646"}, - {"Saint Barthélemy", "Saint-Barthélemy", "BL", "BLM", "652"}, - {"Saint Helena, Ascension and Tristan da Cunha", "Sainte-Hélène, Ascension et Tristan da Cunha", "SH", "SHN", "654"}, - {"Saint Kitts and Nevis", "Saint-Kitts-et-Nevis", "KN", "KNA", "659"}, - {"Anguilla", "Anguilla", "AI", "AIA", "660"}, - {"Saint Lucia", "Sainte-Lucie", "LC", "LCA", "662"}, - {"Saint Martin (French part)", "Saint-Martin (partie française)", "MF", "MAF", "663"}, - {"Saint Pierre and Miquelon", "Saint-Pierre-et-Miquelon", "PM", "SPM", "666"}, - {"Saint Vincent and the Grenadines", "Saint-Vincent-et-les Grenadines", "VC", "VCT", "670"}, - {"San Marino", "Saint-Marin", "SM", "SMR", "674"}, - {"Sao Tome and Principe", "Sao Tomé-et-Principe", "ST", "STP", "678"}, - {"Saudi Arabia", "Arabie saoudite (l')", "SA", "SAU", "682"}, - {"Senegal", "Sénégal (le)", "SN", "SEN", "686"}, - {"Serbia", "Serbie (la)", "RS", "SRB", "688"}, - {"Seychelles", "Seychelles (les)", "SC", "SYC", "690"}, - {"Sierra Leone", "Sierra Leone (la)", "SL", "SLE", "694"}, - {"Singapore", "Singapour", "SG", "SGP", "702"}, - {"Slovakia", "Slovaquie (la)", "SK", "SVK", "703"}, - {"Viet Nam", "Viet Nam (le)", "VN", "VNM", "704"}, - {"Slovenia", "Slovénie (la)", "SI", "SVN", "705"}, - {"Somalia", "Somalie (la)", "SO", "SOM", "706"}, - {"South Africa", "Afrique du Sud (l')", "ZA", "ZAF", "710"}, - {"Zimbabwe", "Zimbabwe (le)", "ZW", "ZWE", "716"}, - {"Spain", "Espagne (l')", "ES", "ESP", "724"}, - {"South Sudan", "Soudan du Sud (le)", "SS", "SSD", "728"}, - {"Sudan (the)", "Soudan (le)", "SD", "SDN", "729"}, - {"Western Sahara*", "Sahara occidental (le)*", "EH", "ESH", "732"}, - {"Suriname", "Suriname (le)", "SR", "SUR", "740"}, - {"Svalbard and Jan Mayen", "Svalbard et l'Île Jan Mayen (le)", "SJ", "SJM", "744"}, - {"Swaziland", "Swaziland (le)", "SZ", "SWZ", "748"}, - {"Sweden", "Suède (la)", "SE", "SWE", "752"}, - {"Switzerland", "Suisse (la)", "CH", "CHE", "756"}, - {"Syrian Arab Republic", "République arabe syrienne (la)", "SY", "SYR", "760"}, - {"Tajikistan", "Tadjikistan (le)", "TJ", "TJK", "762"}, - {"Thailand", "Thaïlande (la)", "TH", "THA", "764"}, - {"Togo", "Togo (le)", "TG", "TGO", "768"}, - {"Tokelau", "Tokelau (les)", "TK", "TKL", "772"}, - {"Tonga", "Tonga (les)", "TO", "TON", "776"}, - {"Trinidad and Tobago", "Trinité-et-Tobago (la)", "TT", "TTO", "780"}, - {"United Arab Emirates (the)", "Émirats arabes unis (les)", "AE", "ARE", "784"}, - {"Tunisia", "Tunisie (la)", "TN", "TUN", "788"}, - {"Turkey", "Turquie (la)", "TR", "TUR", "792"}, - {"Turkmenistan", "Turkménistan (le)", "TM", "TKM", "795"}, - {"Turks and Caicos Islands (the)", "Turks-et-Caïcos (les Îles)", "TC", "TCA", "796"}, - {"Tuvalu", "Tuvalu (les)", "TV", "TUV", "798"}, - {"Uganda", "Ouganda (l')", "UG", "UGA", "800"}, - {"Ukraine", "Ukraine (l')", "UA", "UKR", "804"}, - {"Macedonia (the former Yugoslav Republic of)", "Macédoine (l'ex‑République yougoslave de)", "MK", "MKD", "807"}, - {"Egypt", "Égypte (l')", "EG", "EGY", "818"}, - {"United Kingdom of Great Britain and Northern Ireland (the)", "Royaume-Uni de Grande-Bretagne et d'Irlande du Nord (le)", "GB", "GBR", "826"}, - {"Guernsey", "Guernesey", "GG", "GGY", "831"}, - {"Jersey", "Jersey", "JE", "JEY", "832"}, - {"Isle of Man", "Île de Man", "IM", "IMN", "833"}, - {"Tanzania, United Republic of", "Tanzanie, République-Unie de", "TZ", "TZA", "834"}, - {"United States of America (the)", "États-Unis d'Amérique (les)", "US", "USA", "840"}, - {"Virgin Islands (U.S.)", "Vierges des États-Unis (les Îles)", "VI", "VIR", "850"}, - {"Burkina Faso", "Burkina Faso (le)", "BF", "BFA", "854"}, - {"Uruguay", "Uruguay (l')", "UY", "URY", "858"}, - {"Uzbekistan", "Ouzbékistan (l')", "UZ", "UZB", "860"}, - {"Venezuela (Bolivarian Republic of)", "Venezuela (République bolivarienne du)", "VE", "VEN", "862"}, - {"Wallis and Futuna", "Wallis-et-Futuna", "WF", "WLF", "876"}, - {"Samoa", "Samoa (le)", "WS", "WSM", "882"}, - {"Yemen", "Yémen (le)", "YE", "YEM", "887"}, - {"Zambia", "Zambie (la)", "ZM", "ZMB", "894"}, -} - -// ISO4217List is the list of ISO currency codes -var ISO4217List = []string{ - "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", - "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", - "CAD", "CDF", "CHE", "CHF", "CHW", "CLF", "CLP", "CNY", "COP", "COU", "CRC", "CUC", "CUP", "CVE", "CZK", - "DJF", "DKK", "DOP", "DZD", - "EGP", "ERN", "ETB", "EUR", - "FJD", "FKP", - "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", - "HKD", "HNL", "HRK", "HTG", "HUF", - "IDR", "ILS", "INR", "IQD", "IRR", "ISK", - "JMD", "JOD", "JPY", - "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", - "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", - "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRO", "MUR", "MVR", "MWK", "MXN", "MXV", "MYR", "MZN", - "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", - "OMR", - "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", - "QAR", - "RON", "RSD", "RUB", "RWF", - "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "SSP", "STD", "STN", "SVC", "SYP", "SZL", - "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", - "UAH", "UGX", "USD", "USN", "UYI", "UYU", "UYW", "UZS", - "VEF", "VES", "VND", "VUV", - "WST", - "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XOF", "XPD", "XPF", "XPT", "XSU", "XTS", "XUA", "XXX", - "YER", - "ZAR", "ZMW", "ZWL", -} - -// ISO693Entry stores ISO language codes -type ISO693Entry struct { - Alpha3bCode string - Alpha2Code string - English string -} - -//ISO693List based on http://data.okfn.org/data/core/language-codes/r/language-codes-3b2.json -var ISO693List = []ISO693Entry{ - {Alpha3bCode: "aar", Alpha2Code: "aa", English: "Afar"}, - {Alpha3bCode: "abk", Alpha2Code: "ab", English: "Abkhazian"}, - {Alpha3bCode: "afr", Alpha2Code: "af", English: "Afrikaans"}, - {Alpha3bCode: "aka", Alpha2Code: "ak", English: "Akan"}, - {Alpha3bCode: "alb", Alpha2Code: "sq", English: "Albanian"}, - {Alpha3bCode: "amh", Alpha2Code: "am", English: "Amharic"}, - {Alpha3bCode: "ara", Alpha2Code: "ar", English: "Arabic"}, - {Alpha3bCode: "arg", Alpha2Code: "an", English: "Aragonese"}, - {Alpha3bCode: "arm", Alpha2Code: "hy", English: "Armenian"}, - {Alpha3bCode: "asm", Alpha2Code: "as", English: "Assamese"}, - {Alpha3bCode: "ava", Alpha2Code: "av", English: "Avaric"}, - {Alpha3bCode: "ave", Alpha2Code: "ae", English: "Avestan"}, - {Alpha3bCode: "aym", Alpha2Code: "ay", English: "Aymara"}, - {Alpha3bCode: "aze", Alpha2Code: "az", English: "Azerbaijani"}, - {Alpha3bCode: "bak", Alpha2Code: "ba", English: "Bashkir"}, - {Alpha3bCode: "bam", Alpha2Code: "bm", English: "Bambara"}, - {Alpha3bCode: "baq", Alpha2Code: "eu", English: "Basque"}, - {Alpha3bCode: "bel", Alpha2Code: "be", English: "Belarusian"}, - {Alpha3bCode: "ben", Alpha2Code: "bn", English: "Bengali"}, - {Alpha3bCode: "bih", Alpha2Code: "bh", English: "Bihari languages"}, - {Alpha3bCode: "bis", Alpha2Code: "bi", English: "Bislama"}, - {Alpha3bCode: "bos", Alpha2Code: "bs", English: "Bosnian"}, - {Alpha3bCode: "bre", Alpha2Code: "br", English: "Breton"}, - {Alpha3bCode: "bul", Alpha2Code: "bg", English: "Bulgarian"}, - {Alpha3bCode: "bur", Alpha2Code: "my", English: "Burmese"}, - {Alpha3bCode: "cat", Alpha2Code: "ca", English: "Catalan; Valencian"}, - {Alpha3bCode: "cha", Alpha2Code: "ch", English: "Chamorro"}, - {Alpha3bCode: "che", Alpha2Code: "ce", English: "Chechen"}, - {Alpha3bCode: "chi", Alpha2Code: "zh", English: "Chinese"}, - {Alpha3bCode: "chu", Alpha2Code: "cu", English: "Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic"}, - {Alpha3bCode: "chv", Alpha2Code: "cv", English: "Chuvash"}, - {Alpha3bCode: "cor", Alpha2Code: "kw", English: "Cornish"}, - {Alpha3bCode: "cos", Alpha2Code: "co", English: "Corsican"}, - {Alpha3bCode: "cre", Alpha2Code: "cr", English: "Cree"}, - {Alpha3bCode: "cze", Alpha2Code: "cs", English: "Czech"}, - {Alpha3bCode: "dan", Alpha2Code: "da", English: "Danish"}, - {Alpha3bCode: "div", Alpha2Code: "dv", English: "Divehi; Dhivehi; Maldivian"}, - {Alpha3bCode: "dut", Alpha2Code: "nl", English: "Dutch; Flemish"}, - {Alpha3bCode: "dzo", Alpha2Code: "dz", English: "Dzongkha"}, - {Alpha3bCode: "eng", Alpha2Code: "en", English: "English"}, - {Alpha3bCode: "epo", Alpha2Code: "eo", English: "Esperanto"}, - {Alpha3bCode: "est", Alpha2Code: "et", English: "Estonian"}, - {Alpha3bCode: "ewe", Alpha2Code: "ee", English: "Ewe"}, - {Alpha3bCode: "fao", Alpha2Code: "fo", English: "Faroese"}, - {Alpha3bCode: "fij", Alpha2Code: "fj", English: "Fijian"}, - {Alpha3bCode: "fin", Alpha2Code: "fi", English: "Finnish"}, - {Alpha3bCode: "fre", Alpha2Code: "fr", English: "French"}, - {Alpha3bCode: "fry", Alpha2Code: "fy", English: "Western Frisian"}, - {Alpha3bCode: "ful", Alpha2Code: "ff", English: "Fulah"}, - {Alpha3bCode: "geo", Alpha2Code: "ka", English: "Georgian"}, - {Alpha3bCode: "ger", Alpha2Code: "de", English: "German"}, - {Alpha3bCode: "gla", Alpha2Code: "gd", English: "Gaelic; Scottish Gaelic"}, - {Alpha3bCode: "gle", Alpha2Code: "ga", English: "Irish"}, - {Alpha3bCode: "glg", Alpha2Code: "gl", English: "Galician"}, - {Alpha3bCode: "glv", Alpha2Code: "gv", English: "Manx"}, - {Alpha3bCode: "gre", Alpha2Code: "el", English: "Greek, Modern (1453-)"}, - {Alpha3bCode: "grn", Alpha2Code: "gn", English: "Guarani"}, - {Alpha3bCode: "guj", Alpha2Code: "gu", English: "Gujarati"}, - {Alpha3bCode: "hat", Alpha2Code: "ht", English: "Haitian; Haitian Creole"}, - {Alpha3bCode: "hau", Alpha2Code: "ha", English: "Hausa"}, - {Alpha3bCode: "heb", Alpha2Code: "he", English: "Hebrew"}, - {Alpha3bCode: "her", Alpha2Code: "hz", English: "Herero"}, - {Alpha3bCode: "hin", Alpha2Code: "hi", English: "Hindi"}, - {Alpha3bCode: "hmo", Alpha2Code: "ho", English: "Hiri Motu"}, - {Alpha3bCode: "hrv", Alpha2Code: "hr", English: "Croatian"}, - {Alpha3bCode: "hun", Alpha2Code: "hu", English: "Hungarian"}, - {Alpha3bCode: "ibo", Alpha2Code: "ig", English: "Igbo"}, - {Alpha3bCode: "ice", Alpha2Code: "is", English: "Icelandic"}, - {Alpha3bCode: "ido", Alpha2Code: "io", English: "Ido"}, - {Alpha3bCode: "iii", Alpha2Code: "ii", English: "Sichuan Yi; Nuosu"}, - {Alpha3bCode: "iku", Alpha2Code: "iu", English: "Inuktitut"}, - {Alpha3bCode: "ile", Alpha2Code: "ie", English: "Interlingue; Occidental"}, - {Alpha3bCode: "ina", Alpha2Code: "ia", English: "Interlingua (International Auxiliary Language Association)"}, - {Alpha3bCode: "ind", Alpha2Code: "id", English: "Indonesian"}, - {Alpha3bCode: "ipk", Alpha2Code: "ik", English: "Inupiaq"}, - {Alpha3bCode: "ita", Alpha2Code: "it", English: "Italian"}, - {Alpha3bCode: "jav", Alpha2Code: "jv", English: "Javanese"}, - {Alpha3bCode: "jpn", Alpha2Code: "ja", English: "Japanese"}, - {Alpha3bCode: "kal", Alpha2Code: "kl", English: "Kalaallisut; Greenlandic"}, - {Alpha3bCode: "kan", Alpha2Code: "kn", English: "Kannada"}, - {Alpha3bCode: "kas", Alpha2Code: "ks", English: "Kashmiri"}, - {Alpha3bCode: "kau", Alpha2Code: "kr", English: "Kanuri"}, - {Alpha3bCode: "kaz", Alpha2Code: "kk", English: "Kazakh"}, - {Alpha3bCode: "khm", Alpha2Code: "km", English: "Central Khmer"}, - {Alpha3bCode: "kik", Alpha2Code: "ki", English: "Kikuyu; Gikuyu"}, - {Alpha3bCode: "kin", Alpha2Code: "rw", English: "Kinyarwanda"}, - {Alpha3bCode: "kir", Alpha2Code: "ky", English: "Kirghiz; Kyrgyz"}, - {Alpha3bCode: "kom", Alpha2Code: "kv", English: "Komi"}, - {Alpha3bCode: "kon", Alpha2Code: "kg", English: "Kongo"}, - {Alpha3bCode: "kor", Alpha2Code: "ko", English: "Korean"}, - {Alpha3bCode: "kua", Alpha2Code: "kj", English: "Kuanyama; Kwanyama"}, - {Alpha3bCode: "kur", Alpha2Code: "ku", English: "Kurdish"}, - {Alpha3bCode: "lao", Alpha2Code: "lo", English: "Lao"}, - {Alpha3bCode: "lat", Alpha2Code: "la", English: "Latin"}, - {Alpha3bCode: "lav", Alpha2Code: "lv", English: "Latvian"}, - {Alpha3bCode: "lim", Alpha2Code: "li", English: "Limburgan; Limburger; Limburgish"}, - {Alpha3bCode: "lin", Alpha2Code: "ln", English: "Lingala"}, - {Alpha3bCode: "lit", Alpha2Code: "lt", English: "Lithuanian"}, - {Alpha3bCode: "ltz", Alpha2Code: "lb", English: "Luxembourgish; Letzeburgesch"}, - {Alpha3bCode: "lub", Alpha2Code: "lu", English: "Luba-Katanga"}, - {Alpha3bCode: "lug", Alpha2Code: "lg", English: "Ganda"}, - {Alpha3bCode: "mac", Alpha2Code: "mk", English: "Macedonian"}, - {Alpha3bCode: "mah", Alpha2Code: "mh", English: "Marshallese"}, - {Alpha3bCode: "mal", Alpha2Code: "ml", English: "Malayalam"}, - {Alpha3bCode: "mao", Alpha2Code: "mi", English: "Maori"}, - {Alpha3bCode: "mar", Alpha2Code: "mr", English: "Marathi"}, - {Alpha3bCode: "may", Alpha2Code: "ms", English: "Malay"}, - {Alpha3bCode: "mlg", Alpha2Code: "mg", English: "Malagasy"}, - {Alpha3bCode: "mlt", Alpha2Code: "mt", English: "Maltese"}, - {Alpha3bCode: "mon", Alpha2Code: "mn", English: "Mongolian"}, - {Alpha3bCode: "nau", Alpha2Code: "na", English: "Nauru"}, - {Alpha3bCode: "nav", Alpha2Code: "nv", English: "Navajo; Navaho"}, - {Alpha3bCode: "nbl", Alpha2Code: "nr", English: "Ndebele, South; South Ndebele"}, - {Alpha3bCode: "nde", Alpha2Code: "nd", English: "Ndebele, North; North Ndebele"}, - {Alpha3bCode: "ndo", Alpha2Code: "ng", English: "Ndonga"}, - {Alpha3bCode: "nep", Alpha2Code: "ne", English: "Nepali"}, - {Alpha3bCode: "nno", Alpha2Code: "nn", English: "Norwegian Nynorsk; Nynorsk, Norwegian"}, - {Alpha3bCode: "nob", Alpha2Code: "nb", English: "Bokmål, Norwegian; Norwegian Bokmål"}, - {Alpha3bCode: "nor", Alpha2Code: "no", English: "Norwegian"}, - {Alpha3bCode: "nya", Alpha2Code: "ny", English: "Chichewa; Chewa; Nyanja"}, - {Alpha3bCode: "oci", Alpha2Code: "oc", English: "Occitan (post 1500); Provençal"}, - {Alpha3bCode: "oji", Alpha2Code: "oj", English: "Ojibwa"}, - {Alpha3bCode: "ori", Alpha2Code: "or", English: "Oriya"}, - {Alpha3bCode: "orm", Alpha2Code: "om", English: "Oromo"}, - {Alpha3bCode: "oss", Alpha2Code: "os", English: "Ossetian; Ossetic"}, - {Alpha3bCode: "pan", Alpha2Code: "pa", English: "Panjabi; Punjabi"}, - {Alpha3bCode: "per", Alpha2Code: "fa", English: "Persian"}, - {Alpha3bCode: "pli", Alpha2Code: "pi", English: "Pali"}, - {Alpha3bCode: "pol", Alpha2Code: "pl", English: "Polish"}, - {Alpha3bCode: "por", Alpha2Code: "pt", English: "Portuguese"}, - {Alpha3bCode: "pus", Alpha2Code: "ps", English: "Pushto; Pashto"}, - {Alpha3bCode: "que", Alpha2Code: "qu", English: "Quechua"}, - {Alpha3bCode: "roh", Alpha2Code: "rm", English: "Romansh"}, - {Alpha3bCode: "rum", Alpha2Code: "ro", English: "Romanian; Moldavian; Moldovan"}, - {Alpha3bCode: "run", Alpha2Code: "rn", English: "Rundi"}, - {Alpha3bCode: "rus", Alpha2Code: "ru", English: "Russian"}, - {Alpha3bCode: "sag", Alpha2Code: "sg", English: "Sango"}, - {Alpha3bCode: "san", Alpha2Code: "sa", English: "Sanskrit"}, - {Alpha3bCode: "sin", Alpha2Code: "si", English: "Sinhala; Sinhalese"}, - {Alpha3bCode: "slo", Alpha2Code: "sk", English: "Slovak"}, - {Alpha3bCode: "slv", Alpha2Code: "sl", English: "Slovenian"}, - {Alpha3bCode: "sme", Alpha2Code: "se", English: "Northern Sami"}, - {Alpha3bCode: "smo", Alpha2Code: "sm", English: "Samoan"}, - {Alpha3bCode: "sna", Alpha2Code: "sn", English: "Shona"}, - {Alpha3bCode: "snd", Alpha2Code: "sd", English: "Sindhi"}, - {Alpha3bCode: "som", Alpha2Code: "so", English: "Somali"}, - {Alpha3bCode: "sot", Alpha2Code: "st", English: "Sotho, Southern"}, - {Alpha3bCode: "spa", Alpha2Code: "es", English: "Spanish; Castilian"}, - {Alpha3bCode: "srd", Alpha2Code: "sc", English: "Sardinian"}, - {Alpha3bCode: "srp", Alpha2Code: "sr", English: "Serbian"}, - {Alpha3bCode: "ssw", Alpha2Code: "ss", English: "Swati"}, - {Alpha3bCode: "sun", Alpha2Code: "su", English: "Sundanese"}, - {Alpha3bCode: "swa", Alpha2Code: "sw", English: "Swahili"}, - {Alpha3bCode: "swe", Alpha2Code: "sv", English: "Swedish"}, - {Alpha3bCode: "tah", Alpha2Code: "ty", English: "Tahitian"}, - {Alpha3bCode: "tam", Alpha2Code: "ta", English: "Tamil"}, - {Alpha3bCode: "tat", Alpha2Code: "tt", English: "Tatar"}, - {Alpha3bCode: "tel", Alpha2Code: "te", English: "Telugu"}, - {Alpha3bCode: "tgk", Alpha2Code: "tg", English: "Tajik"}, - {Alpha3bCode: "tgl", Alpha2Code: "tl", English: "Tagalog"}, - {Alpha3bCode: "tha", Alpha2Code: "th", English: "Thai"}, - {Alpha3bCode: "tib", Alpha2Code: "bo", English: "Tibetan"}, - {Alpha3bCode: "tir", Alpha2Code: "ti", English: "Tigrinya"}, - {Alpha3bCode: "ton", Alpha2Code: "to", English: "Tonga (Tonga Islands)"}, - {Alpha3bCode: "tsn", Alpha2Code: "tn", English: "Tswana"}, - {Alpha3bCode: "tso", Alpha2Code: "ts", English: "Tsonga"}, - {Alpha3bCode: "tuk", Alpha2Code: "tk", English: "Turkmen"}, - {Alpha3bCode: "tur", Alpha2Code: "tr", English: "Turkish"}, - {Alpha3bCode: "twi", Alpha2Code: "tw", English: "Twi"}, - {Alpha3bCode: "uig", Alpha2Code: "ug", English: "Uighur; Uyghur"}, - {Alpha3bCode: "ukr", Alpha2Code: "uk", English: "Ukrainian"}, - {Alpha3bCode: "urd", Alpha2Code: "ur", English: "Urdu"}, - {Alpha3bCode: "uzb", Alpha2Code: "uz", English: "Uzbek"}, - {Alpha3bCode: "ven", Alpha2Code: "ve", English: "Venda"}, - {Alpha3bCode: "vie", Alpha2Code: "vi", English: "Vietnamese"}, - {Alpha3bCode: "vol", Alpha2Code: "vo", English: "Volapük"}, - {Alpha3bCode: "wel", Alpha2Code: "cy", English: "Welsh"}, - {Alpha3bCode: "wln", Alpha2Code: "wa", English: "Walloon"}, - {Alpha3bCode: "wol", Alpha2Code: "wo", English: "Wolof"}, - {Alpha3bCode: "xho", Alpha2Code: "xh", English: "Xhosa"}, - {Alpha3bCode: "yid", Alpha2Code: "yi", English: "Yiddish"}, - {Alpha3bCode: "yor", Alpha2Code: "yo", English: "Yoruba"}, - {Alpha3bCode: "zha", Alpha2Code: "za", English: "Zhuang; Chuang"}, - {Alpha3bCode: "zul", Alpha2Code: "zu", English: "Zulu"}, -} diff --git a/vendor/github.com/asaskevich/govalidator/v11/utils.go b/vendor/github.com/asaskevich/govalidator/v11/utils.go deleted file mode 100644 index f4c30f824a2..00000000000 --- a/vendor/github.com/asaskevich/govalidator/v11/utils.go +++ /dev/null @@ -1,270 +0,0 @@ -package govalidator - -import ( - "errors" - "fmt" - "html" - "math" - "path" - "regexp" - "strings" - "unicode" - "unicode/utf8" -) - -// Contains checks if the string contains the substring. -func Contains(str, substring string) bool { - return strings.Contains(str, substring) -} - -// Matches checks if string matches the pattern (pattern is regular expression) -// In case of error return false -func Matches(str, pattern string) bool { - match, _ := regexp.MatchString(pattern, str) - return match -} - -// LeftTrim trims characters from the left side of the input. -// If second argument is empty, it will remove leading spaces. -func LeftTrim(str, chars string) string { - if chars == "" { - return strings.TrimLeftFunc(str, unicode.IsSpace) - } - r, _ := regexp.Compile("^[" + chars + "]+") - return r.ReplaceAllString(str, "") -} - -// RightTrim trims characters from the right side of the input. -// If second argument is empty, it will remove trailing spaces. -func RightTrim(str, chars string) string { - if chars == "" { - return strings.TrimRightFunc(str, unicode.IsSpace) - } - r, _ := regexp.Compile("[" + chars + "]+$") - return r.ReplaceAllString(str, "") -} - -// Trim trims characters from both sides of the input. -// If second argument is empty, it will remove spaces. -func Trim(str, chars string) string { - return LeftTrim(RightTrim(str, chars), chars) -} - -// WhiteList removes characters that do not appear in the whitelist. -func WhiteList(str, chars string) string { - pattern := "[^" + chars + "]+" - r, _ := regexp.Compile(pattern) - return r.ReplaceAllString(str, "") -} - -// BlackList removes characters that appear in the blacklist. -func BlackList(str, chars string) string { - pattern := "[" + chars + "]+" - r, _ := regexp.Compile(pattern) - return r.ReplaceAllString(str, "") -} - -// StripLow removes characters with a numerical value < 32 and 127, mostly control characters. -// If keep_new_lines is true, newline characters are preserved (\n and \r, hex 0xA and 0xD). -func StripLow(str string, keepNewLines bool) string { - chars := "" - if keepNewLines { - chars = "\x00-\x09\x0B\x0C\x0E-\x1F\x7F" - } else { - chars = "\x00-\x1F\x7F" - } - return BlackList(str, chars) -} - -// ReplacePattern replaces regular expression pattern in string -func ReplacePattern(str, pattern, replace string) string { - r, _ := regexp.Compile(pattern) - return r.ReplaceAllString(str, replace) -} - -// Escape replaces <, >, & and " with HTML entities. -var Escape = html.EscapeString - -func addSegment(inrune, segment []rune) []rune { - if len(segment) == 0 { - return inrune - } - if len(inrune) != 0 { - inrune = append(inrune, '_') - } - inrune = append(inrune, segment...) - return inrune -} - -// UnderscoreToCamelCase converts from underscore separated form to camel case form. -// Ex.: my_func => MyFunc -func UnderscoreToCamelCase(s string) string { - return strings.Replace(strings.Title(strings.Replace(strings.ToLower(s), "_", " ", -1)), " ", "", -1) -} - -// CamelCaseToUnderscore converts from camel case form to underscore separated form. -// Ex.: MyFunc => my_func -func CamelCaseToUnderscore(str string) string { - var output []rune - var segment []rune - for _, r := range str { - - // not treat number as separate segment - if !unicode.IsLower(r) && string(r) != "_" && !unicode.IsNumber(r) { - output = addSegment(output, segment) - segment = nil - } - segment = append(segment, unicode.ToLower(r)) - } - output = addSegment(output, segment) - return string(output) -} - -// Reverse returns reversed string -func Reverse(s string) string { - r := []rune(s) - for i, j := 0, len(r)-1; i < j; i, j = i+1, j-1 { - r[i], r[j] = r[j], r[i] - } - return string(r) -} - -// GetLines splits string by "\n" and return array of lines -func GetLines(s string) []string { - return strings.Split(s, "\n") -} - -// GetLine returns specified line of multiline string -func GetLine(s string, index int) (string, error) { - lines := GetLines(s) - if index < 0 || index >= len(lines) { - return "", errors.New("line index out of bounds") - } - return lines[index], nil -} - -// RemoveTags removes all tags from HTML string -func RemoveTags(s string) string { - return ReplacePattern(s, "<[^>]*>", "") -} - -// SafeFileName returns safe string that can be used in file names -func SafeFileName(str string) string { - name := strings.ToLower(str) - name = path.Clean(path.Base(name)) - name = strings.Trim(name, " ") - separators, err := regexp.Compile(`[ &_=+:]`) - if err == nil { - name = separators.ReplaceAllString(name, "-") - } - legal, err := regexp.Compile(`[^[:alnum:]-.]`) - if err == nil { - name = legal.ReplaceAllString(name, "") - } - for strings.Contains(name, "--") { - name = strings.Replace(name, "--", "-", -1) - } - return name -} - -// NormalizeEmail canonicalize an email address. -// The local part of the email address is lowercased for all domains; the hostname is always lowercased and -// the local part of the email address is always lowercased for hosts that are known to be case-insensitive (currently only GMail). -// Normalization follows special rules for known providers: currently, GMail addresses have dots removed in the local part and -// are stripped of tags (e.g. some.one+tag@gmail.com becomes someone@gmail.com) and all @googlemail.com addresses are -// normalized to @gmail.com. -func NormalizeEmail(str string) (string, error) { - if !IsEmail(str) { - return "", fmt.Errorf("%s is not an email", str) - } - parts := strings.Split(str, "@") - parts[0] = strings.ToLower(parts[0]) - parts[1] = strings.ToLower(parts[1]) - if parts[1] == "gmail.com" || parts[1] == "googlemail.com" { - parts[1] = "gmail.com" - parts[0] = strings.Split(ReplacePattern(parts[0], `\.`, ""), "+")[0] - } - return strings.Join(parts, "@"), nil -} - -// Truncate a string to the closest length without breaking words. -func Truncate(str string, length int, ending string) string { - var aftstr, befstr string - if len(str) > length { - words := strings.Fields(str) - before, present := 0, 0 - for i := range words { - befstr = aftstr - before = present - aftstr = aftstr + words[i] + " " - present = len(aftstr) - if present > length && i != 0 { - if (length - before) < (present - length) { - return Trim(befstr, " /\\.,\"'#!?&@+-") + ending - } - return Trim(aftstr, " /\\.,\"'#!?&@+-") + ending - } - } - } - - return str -} - -// PadLeft pads left side of a string if size of string is less then indicated pad length -func PadLeft(str string, padStr string, padLen int) string { - return buildPadStr(str, padStr, padLen, true, false) -} - -// PadRight pads right side of a string if size of string is less then indicated pad length -func PadRight(str string, padStr string, padLen int) string { - return buildPadStr(str, padStr, padLen, false, true) -} - -// PadBoth pads both sides of a string if size of string is less then indicated pad length -func PadBoth(str string, padStr string, padLen int) string { - return buildPadStr(str, padStr, padLen, true, true) -} - -// PadString either left, right or both sides. -// Note that padding string can be unicode and more then one character -func buildPadStr(str string, padStr string, padLen int, padLeft bool, padRight bool) string { - - // When padded length is less then the current string size - if padLen < utf8.RuneCountInString(str) { - return str - } - - padLen -= utf8.RuneCountInString(str) - - targetLen := padLen - - targetLenLeft := targetLen - targetLenRight := targetLen - if padLeft && padRight { - targetLenLeft = padLen / 2 - targetLenRight = padLen - targetLenLeft - } - - strToRepeatLen := utf8.RuneCountInString(padStr) - - repeatTimes := int(math.Ceil(float64(targetLen) / float64(strToRepeatLen))) - repeatedString := strings.Repeat(padStr, repeatTimes) - - leftSide := "" - if padLeft { - leftSide = repeatedString[0:targetLenLeft] - } - - rightSide := "" - if padRight { - rightSide = repeatedString[0:targetLenRight] - } - - return leftSide + str + rightSide -} - -// TruncatingErrorf removes extra args from fmt.Errorf if not formatted in the str object -func TruncatingErrorf(str string, args ...interface{}) error { - n := strings.Count(str, "%s") - return fmt.Errorf(str, args[:n]...) -} diff --git a/vendor/github.com/asaskevich/govalidator/v11/validator.go b/vendor/github.com/asaskevich/govalidator/v11/validator.go deleted file mode 100644 index 740be790e6d..00000000000 --- a/vendor/github.com/asaskevich/govalidator/v11/validator.go +++ /dev/null @@ -1,1775 +0,0 @@ -// Package govalidator is package of validators and sanitizers for strings, structs and collections. -package govalidator - -import ( - "bytes" - "crypto/rsa" - "crypto/x509" - "encoding/base64" - "encoding/json" - "encoding/pem" - "fmt" - "io/ioutil" - "net" - "net/url" - "reflect" - "regexp" - "sort" - "strconv" - "strings" - "time" - "unicode" - "unicode/utf8" -) - -var ( - fieldsRequiredByDefault bool - nilPtrAllowedByRequired = false - notNumberRegexp = regexp.MustCompile("[^0-9]+") - whiteSpacesAndMinus = regexp.MustCompile(`[\s-]+`) - paramsRegexp = regexp.MustCompile(`\(.*\)$`) -) - -const maxURLRuneCount = 2083 -const minURLRuneCount = 3 -const rfc3339WithoutZone = "2006-01-02T15:04:05" - -// SetFieldsRequiredByDefault causes validation to fail when struct fields -// do not include validations or are not explicitly marked as exempt (using `valid:"-"` or `valid:"email,optional"`). -// This struct definition will fail govalidator.ValidateStruct() (and the field values do not matter): -// type exampleStruct struct { -// Name string `` -// Email string `valid:"email"` -// This, however, will only fail when Email is empty or an invalid email address: -// type exampleStruct2 struct { -// Name string `valid:"-"` -// Email string `valid:"email"` -// Lastly, this will only fail when Email is an invalid email address but not when it's empty: -// type exampleStruct2 struct { -// Name string `valid:"-"` -// Email string `valid:"email,optional"` -func SetFieldsRequiredByDefault(value bool) { - fieldsRequiredByDefault = value -} - -// SetNilPtrAllowedByRequired causes validation to pass for nil ptrs when a field is set to required. -// The validation will still reject ptr fields in their zero value state. Example with this enabled: -// type exampleStruct struct { -// Name *string `valid:"required"` -// With `Name` set to "", this will be considered invalid input and will cause a validation error. -// With `Name` set to nil, this will be considered valid by validation. -// By default this is disabled. -func SetNilPtrAllowedByRequired(value bool) { - nilPtrAllowedByRequired = value -} - -// IsEmail checks if the string is an email. -func IsEmail(str string) bool { - // TODO uppercase letters are not supported - return rxEmail.MatchString(str) -} - -// IsExistingEmail checks if the string is an email of existing domain -func IsExistingEmail(email string) bool { - - if len(email) < 6 || len(email) > 254 { - return false - } - at := strings.LastIndex(email, "@") - if at <= 0 || at > len(email)-3 { - return false - } - user := email[:at] - host := email[at+1:] - if len(user) > 64 { - return false - } - switch host { - case "localhost", "example.com": - return true - } - if userDotRegexp.MatchString(user) || !userRegexp.MatchString(user) || !hostRegexp.MatchString(host) { - return false - } - if _, err := net.LookupMX(host); err != nil { - if _, err := net.LookupIP(host); err != nil { - return false - } - } - - return true -} - -// IsURL checks if the string is an URL. -func IsURL(str string) bool { - if str == "" || utf8.RuneCountInString(str) >= maxURLRuneCount || len(str) <= minURLRuneCount || strings.HasPrefix(str, ".") { - return false - } - strTemp := str - if strings.Contains(str, ":") && !strings.Contains(str, "://") { - // support no indicated urlscheme but with colon for port number - // http:// is appended so url.Parse will succeed, strTemp used so it does not impact rxURL.MatchString - strTemp = "http://" + str - } - u, err := url.Parse(strTemp) - if err != nil { - return false - } - if strings.HasPrefix(u.Host, ".") { - return false - } - if u.Host == "" && (u.Path != "" && !strings.Contains(u.Path, ".")) { - return false - } - return rxURL.MatchString(str) -} - -// IsRequestURL checks if the string rawurl, assuming -// it was received in an HTTP request, is a valid -// URL confirm to RFC 3986 -func IsRequestURL(rawurl string) bool { - url, err := url.ParseRequestURI(rawurl) - if err != nil { - return false //Couldn't even parse the rawurl - } - if len(url.Scheme) == 0 { - return false //No Scheme found - } - return true -} - -// IsRequestURI checks if the string rawurl, assuming -// it was received in an HTTP request, is an -// absolute URI or an absolute path. -func IsRequestURI(rawurl string) bool { - _, err := url.ParseRequestURI(rawurl) - return err == nil -} - -// IsAlpha checks if the string contains only letters (a-zA-Z). Empty string is valid. -func IsAlpha(str string) bool { - if IsNull(str) { - return true - } - return rxAlpha.MatchString(str) -} - -//IsUTFLetter checks if the string contains only unicode letter characters. -//Similar to IsAlpha but for all languages. Empty string is valid. -func IsUTFLetter(str string) bool { - if IsNull(str) { - return true - } - - for _, c := range str { - if !unicode.IsLetter(c) { - return false - } - } - return true - -} - -// IsAlphanumeric checks if the string contains only letters and numbers. Empty string is valid. -func IsAlphanumeric(str string) bool { - if IsNull(str) { - return true - } - return rxAlphanumeric.MatchString(str) -} - -// IsUTFLetterNumeric checks if the string contains only unicode letters and numbers. Empty string is valid. -func IsUTFLetterNumeric(str string) bool { - if IsNull(str) { - return true - } - for _, c := range str { - if !unicode.IsLetter(c) && !unicode.IsNumber(c) { //letters && numbers are ok - return false - } - } - return true - -} - -// IsNumeric checks if the string contains only numbers. Empty string is valid. -func IsNumeric(str string) bool { - if IsNull(str) { - return true - } - return rxNumeric.MatchString(str) -} - -// IsUTFNumeric checks if the string contains only unicode numbers of any kind. -// Numbers can be 0-9 but also Fractions ¾,Roman Ⅸ and Hangzhou 〩. Empty string is valid. -func IsUTFNumeric(str string) bool { - if IsNull(str) { - return true - } - if strings.IndexAny(str, "+-") > 0 { - return false - } - if len(str) > 1 { - str = strings.TrimPrefix(str, "-") - str = strings.TrimPrefix(str, "+") - } - for _, c := range str { - if !unicode.IsNumber(c) { //numbers && minus sign are ok - return false - } - } - return true - -} - -// IsUTFDigit checks if the string contains only unicode radix-10 decimal digits. Empty string is valid. -func IsUTFDigit(str string) bool { - if IsNull(str) { - return true - } - if strings.IndexAny(str, "+-") > 0 { - return false - } - if len(str) > 1 { - str = strings.TrimPrefix(str, "-") - str = strings.TrimPrefix(str, "+") - } - for _, c := range str { - if !unicode.IsDigit(c) { //digits && minus sign are ok - return false - } - } - return true - -} - -// IsHexadecimal checks if the string is a hexadecimal number. -func IsHexadecimal(str string) bool { - return rxHexadecimal.MatchString(str) -} - -// IsHexcolor checks if the string is a hexadecimal color. -func IsHexcolor(str string) bool { - return rxHexcolor.MatchString(str) -} - -// IsRGBcolor checks if the string is a valid RGB color in form rgb(RRR, GGG, BBB). -func IsRGBcolor(str string) bool { - return rxRGBcolor.MatchString(str) -} - -// IsLowerCase checks if the string is lowercase. Empty string is valid. -func IsLowerCase(str string) bool { - if IsNull(str) { - return true - } - return str == strings.ToLower(str) -} - -// IsUpperCase checks if the string is uppercase. Empty string is valid. -func IsUpperCase(str string) bool { - if IsNull(str) { - return true - } - return str == strings.ToUpper(str) -} - -// HasLowerCase checks if the string contains at least 1 lowercase. Empty string is valid. -func HasLowerCase(str string) bool { - if IsNull(str) { - return true - } - return rxHasLowerCase.MatchString(str) -} - -// HasUpperCase checks if the string contains as least 1 uppercase. Empty string is valid. -func HasUpperCase(str string) bool { - if IsNull(str) { - return true - } - return rxHasUpperCase.MatchString(str) -} - -// IsInt checks if the string is an integer. Empty string is valid. -func IsInt(str string) bool { - if IsNull(str) { - return true - } - return rxInt.MatchString(str) -} - -// IsFloat checks if the string is a float. -func IsFloat(str string) bool { - return str != "" && rxFloat.MatchString(str) -} - -// IsDivisibleBy checks if the string is a number that's divisible by another. -// If second argument is not valid integer or zero, it's return false. -// Otherwise, if first argument is not valid integer or zero, it's return true (Invalid string converts to zero). -func IsDivisibleBy(str, num string) bool { - f, _ := ToFloat(str) - p := int64(f) - q, _ := ToInt(num) - if q == 0 { - return false - } - return (p == 0) || (p%q == 0) -} - -// IsNull checks if the string is null. -func IsNull(str string) bool { - return len(str) == 0 -} - -// IsNotNull checks if the string is not null. -func IsNotNull(str string) bool { - return !IsNull(str) -} - -// HasWhitespaceOnly checks the string only contains whitespace -func HasWhitespaceOnly(str string) bool { - return len(str) > 0 && rxHasWhitespaceOnly.MatchString(str) -} - -// HasWhitespace checks if the string contains any whitespace -func HasWhitespace(str string) bool { - return len(str) > 0 && rxHasWhitespace.MatchString(str) -} - -// IsByteLength checks if the string's length (in bytes) falls in a range. -func IsByteLength(str string, min, max int) bool { - return len(str) >= min && len(str) <= max -} - -// IsUUIDv3 checks if the string is a UUID version 3. -func IsUUIDv3(str string) bool { - return rxUUID3.MatchString(str) -} - -// IsUUIDv4 checks if the string is a UUID version 4. -func IsUUIDv4(str string) bool { - return rxUUID4.MatchString(str) -} - -// IsUUIDv5 checks if the string is a UUID version 5. -func IsUUIDv5(str string) bool { - return rxUUID5.MatchString(str) -} - -// IsUUID checks if the string is a UUID (version 3, 4 or 5). -func IsUUID(str string) bool { - return rxUUID.MatchString(str) -} - -// Byte to index table for O(1) lookups when unmarshaling. -// We use 0xFF as sentinel value for invalid indexes. -var ulidDec = [...]byte{ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x01, - 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, - 0x0F, 0x10, 0x11, 0xFF, 0x12, 0x13, 0xFF, 0x14, 0x15, 0xFF, - 0x16, 0x17, 0x18, 0x19, 0x1A, 0xFF, 0x1B, 0x1C, 0x1D, 0x1E, - 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0A, 0x0B, 0x0C, - 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0xFF, 0x12, 0x13, 0xFF, 0x14, - 0x15, 0xFF, 0x16, 0x17, 0x18, 0x19, 0x1A, 0xFF, 0x1B, 0x1C, - 0x1D, 0x1E, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, -} - -// EncodedSize is the length of a text encoded ULID. -const ulidEncodedSize = 26 - -// IsULID checks if the string is a ULID. -// -// Implementation got from: -// https://github.com/oklog/ulid (Apache-2.0 License) -// -func IsULID(str string) bool { - // Check if a base32 encoded ULID is the right length. - if len(str) != ulidEncodedSize { - return false - } - - // Check if all the characters in a base32 encoded ULID are part of the - // expected base32 character set. - if ulidDec[str[0]] == 0xFF || - ulidDec[str[1]] == 0xFF || - ulidDec[str[2]] == 0xFF || - ulidDec[str[3]] == 0xFF || - ulidDec[str[4]] == 0xFF || - ulidDec[str[5]] == 0xFF || - ulidDec[str[6]] == 0xFF || - ulidDec[str[7]] == 0xFF || - ulidDec[str[8]] == 0xFF || - ulidDec[str[9]] == 0xFF || - ulidDec[str[10]] == 0xFF || - ulidDec[str[11]] == 0xFF || - ulidDec[str[12]] == 0xFF || - ulidDec[str[13]] == 0xFF || - ulidDec[str[14]] == 0xFF || - ulidDec[str[15]] == 0xFF || - ulidDec[str[16]] == 0xFF || - ulidDec[str[17]] == 0xFF || - ulidDec[str[18]] == 0xFF || - ulidDec[str[19]] == 0xFF || - ulidDec[str[20]] == 0xFF || - ulidDec[str[21]] == 0xFF || - ulidDec[str[22]] == 0xFF || - ulidDec[str[23]] == 0xFF || - ulidDec[str[24]] == 0xFF || - ulidDec[str[25]] == 0xFF { - return false - } - - // Check if the first character in a base32 encoded ULID will overflow. This - // happens because the base32 representation encodes 130 bits, while the - // ULID is only 128 bits. - // - // See https://github.com/oklog/ulid/issues/9 for details. - if str[0] > '7' { - return false - } - return true -} - -// IsCreditCard checks if the string is a credit card. -func IsCreditCard(str string) bool { - sanitized := whiteSpacesAndMinus.ReplaceAllString(str, "") - if !rxCreditCard.MatchString(sanitized) { - return false - } - - number, _ := ToInt(sanitized) - number, lastDigit := number/10, number%10 - - var sum int64 - for i := 0; number > 0; i++ { - digit := number % 10 - - if i%2 == 0 { - digit *= 2 - if digit > 9 { - digit -= 9 - } - } - - sum += digit - number = number / 10 - } - - return (sum+lastDigit)%10 == 0 -} - -// IsISBN10 checks if the string is an ISBN version 10. -func IsISBN10(str string) bool { - return IsISBN(str, 10) -} - -// IsISBN13 checks if the string is an ISBN version 13. -func IsISBN13(str string) bool { - return IsISBN(str, 13) -} - -// IsISBN checks if the string is an ISBN (version 10 or 13). -// If version value is not equal to 10 or 13, it will be checks both variants. -func IsISBN(str string, version int) bool { - sanitized := whiteSpacesAndMinus.ReplaceAllString(str, "") - var checksum int32 - var i int32 - if version == 10 { - if !rxISBN10.MatchString(sanitized) { - return false - } - for i = 0; i < 9; i++ { - checksum += (i + 1) * int32(sanitized[i]-'0') - } - if sanitized[9] == 'X' { - checksum += 10 * 10 - } else { - checksum += 10 * int32(sanitized[9]-'0') - } - if checksum%11 == 0 { - return true - } - return false - } else if version == 13 { - if !rxISBN13.MatchString(sanitized) { - return false - } - factor := []int32{1, 3} - for i = 0; i < 12; i++ { - checksum += factor[i%2] * int32(sanitized[i]-'0') - } - return (int32(sanitized[12]-'0'))-((10-(checksum%10))%10) == 0 - } - return IsISBN(str, 10) || IsISBN(str, 13) -} - -// IsJSON checks if the string is valid JSON (note: uses json.Unmarshal). -func IsJSON(str string) bool { - var js json.RawMessage - return json.Unmarshal([]byte(str), &js) == nil -} - -// IsMultibyte checks if the string contains one or more multibyte chars. Empty string is valid. -func IsMultibyte(str string) bool { - if IsNull(str) { - return true - } - return rxMultibyte.MatchString(str) -} - -// IsASCII checks if the string contains ASCII chars only. Empty string is valid. -func IsASCII(str string) bool { - if IsNull(str) { - return true - } - return rxASCII.MatchString(str) -} - -// IsPrintableASCII checks if the string contains printable ASCII chars only. Empty string is valid. -func IsPrintableASCII(str string) bool { - if IsNull(str) { - return true - } - return rxPrintableASCII.MatchString(str) -} - -// IsFullWidth checks if the string contains any full-width chars. Empty string is valid. -func IsFullWidth(str string) bool { - if IsNull(str) { - return true - } - return rxFullWidth.MatchString(str) -} - -// IsHalfWidth checks if the string contains any half-width chars. Empty string is valid. -func IsHalfWidth(str string) bool { - if IsNull(str) { - return true - } - return rxHalfWidth.MatchString(str) -} - -// IsVariableWidth checks if the string contains a mixture of full and half-width chars. Empty string is valid. -func IsVariableWidth(str string) bool { - if IsNull(str) { - return true - } - return rxHalfWidth.MatchString(str) && rxFullWidth.MatchString(str) -} - -// IsBase64 checks if a string is base64 encoded. -func IsBase64(str string) bool { - return rxBase64.MatchString(str) -} - -// IsFilePath checks is a string is Win or Unix file path and returns it's type. -func IsFilePath(str string) (bool, int) { - if rxWinPath.MatchString(str) { - //check windows path limit see: - // http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#maxpath - if len(str[3:]) > 32767 { - return false, Win - } - return true, Win - } else if rxUnixPath.MatchString(str) { - return true, Unix - } - return false, Unknown -} - -//IsWinFilePath checks both relative & absolute paths in Windows -func IsWinFilePath(str string) bool { - if rxARWinPath.MatchString(str) { - //check windows path limit see: - // http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#maxpath - if len(str[3:]) > 32767 { - return false - } - return true - } - return false -} - -//IsUnixFilePath checks both relative & absolute paths in Unix -func IsUnixFilePath(str string) bool { - if rxARUnixPath.MatchString(str) { - return true - } - return false -} - -// IsDataURI checks if a string is base64 encoded data URI such as an image -func IsDataURI(str string) bool { - dataURI := strings.Split(str, ",") - if !rxDataURI.MatchString(dataURI[0]) { - return false - } - return IsBase64(dataURI[1]) -} - -// IsMagnetURI checks if a string is valid magnet URI -func IsMagnetURI(str string) bool { - return rxMagnetURI.MatchString(str) -} - -// IsISO3166Alpha2 checks if a string is valid two-letter country code -func IsISO3166Alpha2(str string) bool { - for _, entry := range ISO3166List { - if str == entry.Alpha2Code { - return true - } - } - return false -} - -// IsISO3166Alpha3 checks if a string is valid three-letter country code -func IsISO3166Alpha3(str string) bool { - for _, entry := range ISO3166List { - if str == entry.Alpha3Code { - return true - } - } - return false -} - -// IsISO693Alpha2 checks if a string is valid two-letter language code -func IsISO693Alpha2(str string) bool { - for _, entry := range ISO693List { - if str == entry.Alpha2Code { - return true - } - } - return false -} - -// IsISO693Alpha3b checks if a string is valid three-letter language code -func IsISO693Alpha3b(str string) bool { - for _, entry := range ISO693List { - if str == entry.Alpha3bCode { - return true - } - } - return false -} - -// IsDNSName will validate the given string as a DNS name -func IsDNSName(str string) bool { - if str == "" || len(strings.Replace(str, ".", "", -1)) > 255 { - // constraints already violated - return false - } - return !IsIP(str) && rxDNSName.MatchString(str) -} - -// IsHash checks if a string is a hash of type algorithm. -// Algorithm is one of ['md4', 'md5', 'sha1', 'sha256', 'sha384', 'sha512', 'ripemd128', 'ripemd160', 'tiger128', 'tiger160', 'tiger192', 'crc32', 'crc32b'] -func IsHash(str string, algorithm string) bool { - var len string - algo := strings.ToLower(algorithm) - - if algo == "crc32" || algo == "crc32b" { - len = "8" - } else if algo == "md5" || algo == "md4" || algo == "ripemd128" || algo == "tiger128" { - len = "32" - } else if algo == "sha1" || algo == "ripemd160" || algo == "tiger160" { - len = "40" - } else if algo == "tiger192" { - len = "48" - } else if algo == "sha3-224" { - len = "56" - } else if algo == "sha256" || algo == "sha3-256" { - len = "64" - } else if algo == "sha384" || algo == "sha3-384" { - len = "96" - } else if algo == "sha512" || algo == "sha3-512" { - len = "128" - } else { - return false - } - - return Matches(str, "^[a-f0-9]{"+len+"}$") -} - -// IsSHA3224 checks is a string is a SHA3-224 hash. Alias for `IsHash(str, "sha3-224")` -func IsSHA3224(str string) bool { - return IsHash(str, "sha3-224") -} - -// IsSHA3256 checks is a string is a SHA3-256 hash. Alias for `IsHash(str, "sha3-256")` -func IsSHA3256(str string) bool { - return IsHash(str, "sha3-256") -} - -// IsSHA3384 checks is a string is a SHA3-384 hash. Alias for `IsHash(str, "sha3-384")` -func IsSHA3384(str string) bool { - return IsHash(str, "sha3-384") -} - -// IsSHA3512 checks is a string is a SHA3-512 hash. Alias for `IsHash(str, "sha3-512")` -func IsSHA3512(str string) bool { - return IsHash(str, "sha3-512") -} - -// IsSHA512 checks is a string is a SHA512 hash. Alias for `IsHash(str, "sha512")` -func IsSHA512(str string) bool { - return IsHash(str, "sha512") -} - -// IsSHA384 checks is a string is a SHA384 hash. Alias for `IsHash(str, "sha384")` -func IsSHA384(str string) bool { - return IsHash(str, "sha384") -} - -// IsSHA256 checks is a string is a SHA256 hash. Alias for `IsHash(str, "sha256")` -func IsSHA256(str string) bool { - return IsHash(str, "sha256") -} - -// IsTiger192 checks is a string is a Tiger192 hash. Alias for `IsHash(str, "tiger192")` -func IsTiger192(str string) bool { - return IsHash(str, "tiger192") -} - -// IsTiger160 checks is a string is a Tiger160 hash. Alias for `IsHash(str, "tiger160")` -func IsTiger160(str string) bool { - return IsHash(str, "tiger160") -} - -// IsRipeMD160 checks is a string is a RipeMD160 hash. Alias for `IsHash(str, "ripemd160")` -func IsRipeMD160(str string) bool { - return IsHash(str, "ripemd160") -} - -// IsSHA1 checks is a string is a SHA-1 hash. Alias for `IsHash(str, "sha1")` -func IsSHA1(str string) bool { - return IsHash(str, "sha1") -} - -// IsTiger128 checks is a string is a Tiger128 hash. Alias for `IsHash(str, "tiger128")` -func IsTiger128(str string) bool { - return IsHash(str, "tiger128") -} - -// IsRipeMD128 checks is a string is a RipeMD128 hash. Alias for `IsHash(str, "ripemd128")` -func IsRipeMD128(str string) bool { - return IsHash(str, "ripemd128") -} - -// IsCRC32 checks is a string is a CRC32 hash. Alias for `IsHash(str, "crc32")` -func IsCRC32(str string) bool { - return IsHash(str, "crc32") -} - -// IsCRC32b checks is a string is a CRC32b hash. Alias for `IsHash(str, "crc32b")` -func IsCRC32b(str string) bool { - return IsHash(str, "crc32b") -} - -// IsMD5 checks is a string is a MD5 hash. Alias for `IsHash(str, "md5")` -func IsMD5(str string) bool { - return IsHash(str, "md5") -} - -// IsMD4 checks is a string is a MD4 hash. Alias for `IsHash(str, "md4")` -func IsMD4(str string) bool { - return IsHash(str, "md4") -} - -// IsDialString validates the given string for usage with the various Dial() functions -func IsDialString(str string) bool { - if h, p, err := net.SplitHostPort(str); err == nil && h != "" && p != "" && (IsDNSName(h) || IsIP(h)) && IsPort(p) { - return true - } - - return false -} - -// IsIP checks if a string is either IP version 4 or 6. Alias for `net.ParseIP` -func IsIP(str string) bool { - return net.ParseIP(str) != nil -} - -// IsPort checks if a string represents a valid port -func IsPort(str string) bool { - if i, err := strconv.Atoi(str); err == nil && i > 0 && i < 65536 { - return true - } - return false -} - -// IsIPv4 checks if the string is an IP version 4. -func IsIPv4(str string) bool { - ip := net.ParseIP(str) - return ip != nil && strings.Contains(str, ".") -} - -// IsIPv6 checks if the string is an IP version 6. -func IsIPv6(str string) bool { - ip := net.ParseIP(str) - return ip != nil && strings.Contains(str, ":") -} - -// IsCIDR checks if the string is an valid CIDR notiation (IPV4 & IPV6) -func IsCIDR(str string) bool { - _, _, err := net.ParseCIDR(str) - return err == nil -} - -// IsMAC checks if a string is valid MAC address. -// Possible MAC formats: -// 01:23:45:67:89:ab -// 01:23:45:67:89:ab:cd:ef -// 01-23-45-67-89-ab -// 01-23-45-67-89-ab-cd-ef -// 0123.4567.89ab -// 0123.4567.89ab.cdef -func IsMAC(str string) bool { - _, err := net.ParseMAC(str) - return err == nil -} - -// IsHost checks if the string is a valid IP (both v4 and v6) or a valid DNS name -func IsHost(str string) bool { - return IsIP(str) || IsDNSName(str) -} - -// IsMongoID checks if the string is a valid hex-encoded representation of a MongoDB ObjectId. -func IsMongoID(str string) bool { - return rxHexadecimal.MatchString(str) && (len(str) == 24) -} - -// IsLatitude checks if a string is valid latitude. -func IsLatitude(str string) bool { - return rxLatitude.MatchString(str) -} - -// IsLongitude checks if a string is valid longitude. -func IsLongitude(str string) bool { - return rxLongitude.MatchString(str) -} - -// IsIMEI checks if a string is valid IMEI -func IsIMEI(str string) bool { - return rxIMEI.MatchString(str) -} - -// IsIMSI checks if a string is valid IMSI -func IsIMSI(str string) bool { - if !rxIMSI.MatchString(str) { - return false - } - - mcc, err := strconv.ParseInt(str[0:3], 10, 32) - if err != nil { - return false - } - - switch mcc { - case 202, 204, 206, 208, 212, 213, 214, 216, 218, 219: - case 220, 221, 222, 226, 228, 230, 231, 232, 234, 235: - case 238, 240, 242, 244, 246, 247, 248, 250, 255, 257: - case 259, 260, 262, 266, 268, 270, 272, 274, 276, 278: - case 280, 282, 283, 284, 286, 288, 289, 290, 292, 293: - case 294, 295, 297, 302, 308, 310, 311, 312, 313, 314: - case 315, 316, 330, 332, 334, 338, 340, 342, 344, 346: - case 348, 350, 352, 354, 356, 358, 360, 362, 363, 364: - case 365, 366, 368, 370, 372, 374, 376, 400, 401, 402: - case 404, 405, 406, 410, 412, 413, 414, 415, 416, 417: - case 418, 419, 420, 421, 422, 424, 425, 426, 427, 428: - case 429, 430, 431, 432, 434, 436, 437, 438, 440, 441: - case 450, 452, 454, 455, 456, 457, 460, 461, 466, 467: - case 470, 472, 502, 505, 510, 514, 515, 520, 525, 528: - case 530, 536, 537, 539, 540, 541, 542, 543, 544, 545: - case 546, 547, 548, 549, 550, 551, 552, 553, 554, 555: - case 602, 603, 604, 605, 606, 607, 608, 609, 610, 611: - case 612, 613, 614, 615, 616, 617, 618, 619, 620, 621: - case 622, 623, 624, 625, 626, 627, 628, 629, 630, 631: - case 632, 633, 634, 635, 636, 637, 638, 639, 640, 641: - case 642, 643, 645, 646, 647, 648, 649, 650, 651, 652: - case 653, 654, 655, 657, 658, 659, 702, 704, 706, 708: - case 710, 712, 714, 716, 722, 724, 730, 732, 734, 736: - case 738, 740, 742, 744, 746, 748, 750, 995: - return true - default: - return false - } - return true -} - -// IsRsaPublicKey checks if a string is valid public key with provided length -func IsRsaPublicKey(str string, keylen int) bool { - bb := bytes.NewBufferString(str) - pemBytes, err := ioutil.ReadAll(bb) - if err != nil { - return false - } - block, _ := pem.Decode(pemBytes) - if block != nil && block.Type != "PUBLIC KEY" { - return false - } - var der []byte - - if block != nil { - der = block.Bytes - } else { - der, err = base64.StdEncoding.DecodeString(str) - if err != nil { - return false - } - } - - key, err := x509.ParsePKIXPublicKey(der) - if err != nil { - return false - } - pubkey, ok := key.(*rsa.PublicKey) - if !ok { - return false - } - bitlen := len(pubkey.N.Bytes()) * 8 - return bitlen == int(keylen) -} - -// IsRegex checks if a give string is a valid regex with RE2 syntax or not -func IsRegex(str string) bool { - if _, err := regexp.Compile(str); err == nil { - return true - } - return false -} - -func toJSONName(tag string) string { - if tag == "" { - return "" - } - - // JSON name always comes first. If there's no options then split[0] is - // JSON name, if JSON name is not set, then split[0] is an empty string. - split := strings.SplitN(tag, ",", 2) - - name := split[0] - - // However it is possible that the field is skipped when - // (de-)serializing from/to JSON, in which case assume that there is no - // tag name to use - if name == "-" { - return "" - } - return name -} - -func prependPathToErrors(err error, path string) error { - switch err2 := err.(type) { - case Error: - err2.Path = append([]string{path}, err2.Path...) - return err2 - case Errors: - errors := err2.Errors() - for i, err3 := range errors { - errors[i] = prependPathToErrors(err3, path) - } - return err2 - } - return err -} - -// ValidateArray performs validation according to condition iterator that validates every element of the array -func ValidateArray(array []interface{}, iterator ConditionIterator) bool { - return Every(array, iterator) -} - -// ValidateMap use validation map for fields. -// result will be equal to `false` if there are any errors. -// s is the map containing the data to be validated. -// m is the validation map in the form: -// map[string]interface{}{"name":"required,alpha","address":map[string]interface{}{"line1":"required,alphanum"}} -func ValidateMap(s map[string]interface{}, m map[string]interface{}) (bool, error) { - if s == nil { - return true, nil - } - result := true - var err error - var errs Errors - var index int - val := reflect.ValueOf(s) - for key, value := range s { - presentResult := true - validator, ok := m[key] - if !ok { - presentResult = false - var err error - err = fmt.Errorf("all map keys has to be present in the validation map; got %s", key) - err = prependPathToErrors(err, key) - errs = append(errs, err) - } - valueField := reflect.ValueOf(value) - mapResult := true - typeResult := true - structResult := true - resultField := true - switch subValidator := validator.(type) { - case map[string]interface{}: - var err error - if v, ok := value.(map[string]interface{}); !ok { - mapResult = false - err = fmt.Errorf("map validator has to be for the map type only; got %s", valueField.Type().String()) - err = prependPathToErrors(err, key) - errs = append(errs, err) - } else { - mapResult, err = ValidateMap(v, subValidator) - if err != nil { - mapResult = false - err = prependPathToErrors(err, key) - errs = append(errs, err) - } - } - case string: - if (valueField.Kind() == reflect.Struct || - (valueField.Kind() == reflect.Ptr && valueField.Elem().Kind() == reflect.Struct)) && - subValidator != "-" { - var err error - structResult, err = ValidateStruct(valueField.Interface()) - if err != nil { - err = prependPathToErrors(err, key) - errs = append(errs, err) - } - } - resultField, err = typeCheck(valueField, reflect.StructField{ - Name: key, - PkgPath: "", - Type: val.Type(), - Tag: reflect.StructTag(fmt.Sprintf("%s:%q", tagName, subValidator)), - Offset: 0, - Index: []int{index}, - Anonymous: false, - }, val, nil) - if err != nil { - errs = append(errs, err) - } - case nil: - // already handlerd when checked before - default: - typeResult = false - err = fmt.Errorf("map validator has to be either map[string]interface{} or string; got %s", valueField.Type().String()) - err = prependPathToErrors(err, key) - errs = append(errs, err) - } - result = result && presentResult && typeResult && resultField && structResult && mapResult - index++ - } - // checks required keys - requiredResult := true - for key, value := range m { - if schema, ok := value.(string); ok { - tags := parseTagIntoMap(schema) - if required, ok := tags["required"]; ok { - if _, ok := s[key]; !ok { - requiredResult = false - if required.customErrorMessage != "" { - err = Error{key, fmt.Errorf(required.customErrorMessage), true, "required", []string{}} - } else { - err = Error{key, fmt.Errorf("required field missing"), false, "required", []string{}} - } - errs = append(errs, err) - } - } - } - } - - if len(errs) > 0 { - err = errs - } - return result && requiredResult, err -} - -// ValidateStruct use tags for fields. -// result will be equal to `false` if there are any errors. -// todo currently there is no guarantee that errors will be returned in predictable order (tests may to fail) -func ValidateStruct(s interface{}) (bool, error) { - if s == nil { - return true, nil - } - result := true - var err error - val := reflect.ValueOf(s) - if val.Kind() == reflect.Interface || val.Kind() == reflect.Ptr { - val = val.Elem() - } - // we only accept structs - if val.Kind() != reflect.Struct { - return false, fmt.Errorf("function only accepts structs; got %s", val.Kind()) - } - var errs Errors - for i := 0; i < val.NumField(); i++ { - valueField := val.Field(i) - typeField := val.Type().Field(i) - if typeField.PkgPath != "" { - continue // Private field - } - structResult := true - if valueField.Kind() == reflect.Interface { - valueField = valueField.Elem() - } - if (valueField.Kind() == reflect.Struct || - (valueField.Kind() == reflect.Ptr && valueField.Elem().Kind() == reflect.Struct)) && - typeField.Tag.Get(tagName) != "-" { - var err error - structResult, err = ValidateStruct(valueField.Interface()) - if err != nil { - err = prependPathToErrors(err, typeField.Name) - errs = append(errs, err) - } - } - resultField, err2 := typeCheck(valueField, typeField, val, nil) - if err2 != nil { - - // Replace structure name with JSON name if there is a tag on the variable - jsonTag := toJSONName(typeField.Tag.Get("json")) - if jsonTag != "" { - switch jsonError := err2.(type) { - case Error: - jsonError.Name = jsonTag - err2 = jsonError - case Errors: - for i2, err3 := range jsonError { - switch customErr := err3.(type) { - case Error: - customErr.Name = jsonTag - jsonError[i2] = customErr - } - } - - err2 = jsonError - } - } - - errs = append(errs, err2) - } - result = result && resultField && structResult - } - if len(errs) > 0 { - err = errs - } - return result, err -} - -// ValidateStructAsync performs async validation of the struct and returns results through the channels -func ValidateStructAsync(s interface{}) (<-chan bool, <-chan error) { - res := make(chan bool) - errors := make(chan error) - - go func() { - defer close(res) - defer close(errors) - - isValid, isFailed := ValidateStruct(s) - - res <- isValid - errors <- isFailed - }() - - return res, errors -} - -// ValidateMapAsync performs async validation of the map and returns results through the channels -func ValidateMapAsync(s map[string]interface{}, m map[string]interface{}) (<-chan bool, <-chan error) { - res := make(chan bool) - errors := make(chan error) - - go func() { - defer close(res) - defer close(errors) - - isValid, isFailed := ValidateMap(s, m) - - res <- isValid - errors <- isFailed - }() - - return res, errors -} - -// parseTagIntoMap parses a struct tag `valid:required~Some error message,length(2|3)` into map[string]string{"required": "Some error message", "length(2|3)": ""} -func parseTagIntoMap(tag string) tagOptionsMap { - optionsMap := make(tagOptionsMap) - options := strings.Split(tag, ",") - - for i, option := range options { - option = strings.TrimSpace(option) - - validationOptions := strings.Split(option, "~") - if !isValidTag(validationOptions[0]) { - continue - } - if len(validationOptions) == 2 { - optionsMap[validationOptions[0]] = tagOption{validationOptions[0], validationOptions[1], i} - } else { - optionsMap[validationOptions[0]] = tagOption{validationOptions[0], "", i} - } - } - return optionsMap -} - -func isValidTag(s string) bool { - if s == "" { - return false - } - for _, c := range s { - switch { - case strings.ContainsRune("\\'\"!#$%&()*+-./:<=>?@[]^_{|}~ ", c): - // Backslash and quote chars are reserved, but - // otherwise any punctuation chars are allowed - // in a tag name. - default: - if !unicode.IsLetter(c) && !unicode.IsDigit(c) { - return false - } - } - } - return true -} - -// IsSSN will validate the given string as a U.S. Social Security Number -func IsSSN(str string) bool { - if str == "" || len(str) != 11 { - return false - } - return rxSSN.MatchString(str) -} - -// IsSemver checks if string is valid semantic version -func IsSemver(str string) bool { - return rxSemver.MatchString(str) -} - -// IsType checks if interface is of some type -func IsType(v interface{}, params ...string) bool { - if len(params) == 1 { - typ := params[0] - return strings.Replace(reflect.TypeOf(v).String(), " ", "", -1) == strings.Replace(typ, " ", "", -1) - } - return false -} - -// IsTime checks if string is valid according to given format -func IsTime(str string, format string) bool { - _, err := time.Parse(format, str) - return err == nil -} - -// IsUnixTime checks if string is valid unix timestamp value -func IsUnixTime(str string) bool { - if _, err := strconv.Atoi(str); err == nil { - return true - } - return false -} - -// IsRFC3339 checks if string is valid timestamp value according to RFC3339 -func IsRFC3339(str string) bool { - return IsTime(str, time.RFC3339) -} - -// IsRFC3339WithoutZone checks if string is valid timestamp value according to RFC3339 which excludes the timezone. -func IsRFC3339WithoutZone(str string) bool { - return IsTime(str, rfc3339WithoutZone) -} - -// IsISO4217 checks if string is valid ISO currency code -func IsISO4217(str string) bool { - for _, currency := range ISO4217List { - if str == currency { - return true - } - } - - return false -} - -// ByteLength checks string's length -func ByteLength(str string, params ...string) bool { - if len(params) == 2 { - min, _ := ToInt(params[0]) - max, _ := ToInt(params[1]) - return len(str) >= int(min) && len(str) <= int(max) - } - - return false -} - -// RuneLength checks string's length -// Alias for StringLength -func RuneLength(str string, params ...string) bool { - return StringLength(str, params...) -} - -// IsRsaPub checks whether string is valid RSA key -// Alias for IsRsaPublicKey -func IsRsaPub(str string, params ...string) bool { - if len(params) == 1 { - len, _ := ToInt(params[0]) - return IsRsaPublicKey(str, int(len)) - } - - return false -} - -// StringMatches checks if a string matches a given pattern. -func StringMatches(s string, params ...string) bool { - if len(params) == 1 { - pattern := params[0] - return Matches(s, pattern) - } - return false -} - -// StringLength checks string's length (including multi byte strings) -func StringLength(str string, params ...string) bool { - - if len(params) == 2 { - strLength := utf8.RuneCountInString(str) - min, _ := ToInt(params[0]) - max, _ := ToInt(params[1]) - return strLength >= int(min) && strLength <= int(max) - } - - return false -} - -// MinStringLength checks string's minimum length (including multi byte strings) -func MinStringLength(str string, params ...string) bool { - - if len(params) == 1 { - strLength := utf8.RuneCountInString(str) - min, _ := ToInt(params[0]) - return strLength >= int(min) - } - - return false -} - -// MaxStringLength checks string's maximum length (including multi byte strings) -func MaxStringLength(str string, params ...string) bool { - - if len(params) == 1 { - strLength := utf8.RuneCountInString(str) - max, _ := ToInt(params[0]) - return strLength <= int(max) - } - - return false -} - -// Range checks string's length -func Range(str string, params ...string) bool { - if len(params) == 2 { - value, _ := ToFloat(str) - min, _ := ToFloat(params[0]) - max, _ := ToFloat(params[1]) - return InRange(value, min, max) - } - - return false -} - -// IsInRaw checks if string is in list of allowed values -func IsInRaw(str string, params ...string) bool { - if len(params) == 1 { - rawParams := params[0] - - parsedParams := strings.Split(rawParams, "|") - - return IsIn(str, parsedParams...) - } - - return false -} - -// IsIn checks if string str is a member of the set of strings params -func IsIn(str string, params ...string) bool { - for _, param := range params { - if str == param { - return true - } - } - - return false -} - -func checkRequired(v reflect.Value, t reflect.StructField, options tagOptionsMap) (bool, error) { - if nilPtrAllowedByRequired { - k := v.Kind() - if (k == reflect.Ptr || k == reflect.Interface) && v.IsNil() { - return true, nil - } - } - - if requiredOption, isRequired := options["required"]; isRequired { - if len(requiredOption.customErrorMessage) > 0 { - return false, Error{t.Name, fmt.Errorf(requiredOption.customErrorMessage), true, "required", []string{}} - } - return false, Error{t.Name, fmt.Errorf("non zero value required"), false, "required", []string{}} - } else if _, isOptional := options["optional"]; fieldsRequiredByDefault && !isOptional { - return false, Error{t.Name, fmt.Errorf("Missing required field"), false, "required", []string{}} - } - // not required and empty is valid - return true, nil -} - -func typeCheck(v reflect.Value, t reflect.StructField, o reflect.Value, options tagOptionsMap) (isValid bool, resultErr error) { - if !v.IsValid() { - return false, nil - } - - tag := t.Tag.Get(tagName) - - // checks if the field should be ignored - switch tag { - case "": - if v.Kind() != reflect.Slice && v.Kind() != reflect.Map { - if !fieldsRequiredByDefault { - return true, nil - } - return false, Error{t.Name, fmt.Errorf("All fields are required to at least have one validation defined"), false, "required", []string{}} - } - case "-": - return true, nil - } - - isRootType := false - if options == nil { - isRootType = true - options = parseTagIntoMap(tag) - } - - if isEmptyValue(v) { - // an empty value is not validated, checks only required - isValid, resultErr = checkRequired(v, t, options) - for key := range options { - delete(options, key) - } - return isValid, resultErr - } - - var customTypeErrors Errors - optionsOrder := options.orderedKeys() - for _, validatorName := range optionsOrder { - validatorStruct := options[validatorName] - if validatefunc, ok := CustomTypeTagMap.Get(validatorName); ok { - delete(options, validatorName) - - if result := validatefunc(v.Interface(), o.Interface()); !result { - if len(validatorStruct.customErrorMessage) > 0 { - customTypeErrors = append(customTypeErrors, Error{Name: t.Name, Err: TruncatingErrorf(validatorStruct.customErrorMessage, fmt.Sprint(v), validatorName), CustomErrorMessageExists: true, Validator: stripParams(validatorName)}) - continue - } - customTypeErrors = append(customTypeErrors, Error{Name: t.Name, Err: fmt.Errorf("%s does not validate as %s", fmt.Sprint(v), validatorName), CustomErrorMessageExists: false, Validator: stripParams(validatorName)}) - } - } - } - - if len(customTypeErrors.Errors()) > 0 { - return false, customTypeErrors - } - - if isRootType { - // Ensure that we've checked the value by all specified validators before report that the value is valid - defer func() { - delete(options, "optional") - delete(options, "required") - - if isValid && resultErr == nil && len(options) != 0 { - optionsOrder := options.orderedKeys() - for _, validator := range optionsOrder { - isValid = false - resultErr = Error{t.Name, fmt.Errorf( - "The following validator is invalid or can't be applied to the field: %q", validator), false, stripParams(validator), []string{}} - return - } - } - }() - } - - for _, validatorSpec := range optionsOrder { - validatorStruct := options[validatorSpec] - var negate bool - validator := validatorSpec - customMsgExists := len(validatorStruct.customErrorMessage) > 0 - - // checks whether the tag looks like '!something' or 'something' - if validator[0] == '!' { - validator = validator[1:] - negate = true - } - - // checks for interface param validators - for key, value := range InterfaceParamTagRegexMap { - ps := value.FindStringSubmatch(validator) - if len(ps) == 0 { - continue - } - - validatefunc, ok := InterfaceParamTagMap[key] - if !ok { - continue - } - - delete(options, validatorSpec) - - field := fmt.Sprint(v) - if result := validatefunc(v.Interface(), ps[1:]...); (!result && !negate) || (result && negate) { - if customMsgExists { - return false, Error{t.Name, TruncatingErrorf(validatorStruct.customErrorMessage, field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - if negate { - return false, Error{t.Name, fmt.Errorf("%s does validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - return false, Error{t.Name, fmt.Errorf("%s does not validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - } - } - - switch v.Kind() { - case reflect.Bool, - reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, - reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr, - reflect.Float32, reflect.Float64, - reflect.String: - // for each tag option checks the map of validator functions - for _, validatorSpec := range optionsOrder { - validatorStruct := options[validatorSpec] - var negate bool - validator := validatorSpec - customMsgExists := len(validatorStruct.customErrorMessage) > 0 - - // checks whether the tag looks like '!something' or 'something' - if validator[0] == '!' { - validator = validator[1:] - negate = true - } - - // checks for param validators - for key, value := range ParamTagRegexMap { - ps := value.FindStringSubmatch(validator) - if len(ps) == 0 { - continue - } - - validatefunc, ok := ParamTagMap[key] - if !ok { - continue - } - - delete(options, validatorSpec) - - switch v.Kind() { - case reflect.String, - reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, - reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, - reflect.Float32, reflect.Float64: - - field := fmt.Sprint(v) // make value into string, then validate with regex - if result := validatefunc(field, ps[1:]...); (!result && !negate) || (result && negate) { - if customMsgExists { - return false, Error{t.Name, TruncatingErrorf(validatorStruct.customErrorMessage, field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - if negate { - return false, Error{t.Name, fmt.Errorf("%s does validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - return false, Error{t.Name, fmt.Errorf("%s does not validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - default: - // type not yet supported, fail - return false, Error{t.Name, fmt.Errorf("Validator %s doesn't support kind %s", validator, v.Kind()), false, stripParams(validatorSpec), []string{}} - } - } - - if validatefunc, ok := TagMap[validator]; ok { - delete(options, validatorSpec) - - switch v.Kind() { - case reflect.String, - reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, - reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, - reflect.Float32, reflect.Float64: - field := fmt.Sprint(v) // make value into string, then validate with regex - if result := validatefunc(field); !result && !negate || result && negate { - if customMsgExists { - return false, Error{t.Name, TruncatingErrorf(validatorStruct.customErrorMessage, field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - if negate { - return false, Error{t.Name, fmt.Errorf("%s does validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - return false, Error{t.Name, fmt.Errorf("%s does not validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - default: - //Not Yet Supported Types (Fail here!) - err := fmt.Errorf("Validator %s doesn't support kind %s for value %v", validator, v.Kind(), v) - return false, Error{t.Name, err, false, stripParams(validatorSpec), []string{}} - } - } - } - return true, nil - case reflect.Map: - if v.Type().Key().Kind() != reflect.String { - return false, &UnsupportedTypeError{v.Type()} - } - var sv stringValues - sv = v.MapKeys() - sort.Sort(sv) - result := true - for i, k := range sv { - var resultItem bool - var err error - if v.MapIndex(k).Kind() != reflect.Struct { - resultItem, err = typeCheck(v.MapIndex(k), t, o, options) - if err != nil { - return false, err - } - } else { - resultItem, err = ValidateStruct(v.MapIndex(k).Interface()) - if err != nil { - err = prependPathToErrors(err, t.Name+"."+sv[i].Interface().(string)) - return false, err - } - } - result = result && resultItem - } - return result, nil - case reflect.Slice, reflect.Array: - result := true - for i := 0; i < v.Len(); i++ { - var resultItem bool - var err error - if v.Index(i).Kind() != reflect.Struct { - resultItem, err = typeCheck(v.Index(i), t, o, options) - if err != nil { - return false, err - } - } else { - resultItem, err = ValidateStruct(v.Index(i).Interface()) - if err != nil { - err = prependPathToErrors(err, t.Name+"."+strconv.Itoa(i)) - return false, err - } - } - result = result && resultItem - } - return result, nil - case reflect.Interface: - // If the value is an interface then encode its element - if v.IsNil() { - return true, nil - } - return ValidateStruct(v.Interface()) - case reflect.Ptr: - // If the value is a pointer then checks its element - if v.IsNil() { - return true, nil - } - return typeCheck(v.Elem(), t, o, options) - case reflect.Struct: - return true, nil - default: - return false, &UnsupportedTypeError{v.Type()} - } -} - -func stripParams(validatorString string) string { - return paramsRegexp.ReplaceAllString(validatorString, "") -} - -// isEmptyValue checks whether value empty or not -func isEmptyValue(v reflect.Value) bool { - switch v.Kind() { - case reflect.String, reflect.Array: - return v.Len() == 0 - case reflect.Map, reflect.Slice: - return v.Len() == 0 || v.IsNil() - case reflect.Bool: - return !v.Bool() - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return v.Int() == 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return v.Uint() == 0 - case reflect.Float32, reflect.Float64: - return v.Float() == 0 - case reflect.Interface, reflect.Ptr: - return v.IsNil() - } - - return reflect.DeepEqual(v.Interface(), reflect.Zero(v.Type()).Interface()) -} - -// ErrorByField returns error for specified field of the struct -// validated by ValidateStruct or empty string if there are no errors -// or this field doesn't exists or doesn't have any errors. -func ErrorByField(e error, field string) string { - if e == nil { - return "" - } - return ErrorsByField(e)[field] -} - -// ErrorsByField returns map of errors of the struct validated -// by ValidateStruct or empty map if there are no errors. -func ErrorsByField(e error) map[string]string { - m := make(map[string]string) - if e == nil { - return m - } - // prototype for ValidateStruct - - switch e := e.(type) { - case Error: - m[e.Name] = e.Err.Error() - case Errors: - for _, item := range e.Errors() { - n := ErrorsByField(item) - for k, v := range n { - m[k] = v - } - } - } - - return m -} - -// Error returns string equivalent for reflect.Type -func (e *UnsupportedTypeError) Error() string { - return "validator: unsupported type: " + e.Type.String() -} - -func (sv stringValues) Len() int { return len(sv) } -func (sv stringValues) Swap(i, j int) { sv[i], sv[j] = sv[j], sv[i] } -func (sv stringValues) Less(i, j int) bool { return sv.get(i) < sv.get(j) } -func (sv stringValues) get(i int) string { return sv[i].String() } - -func IsE164(str string) bool { - return rxE164.MatchString(str) -} - -// IsYYYYMMDD checks if a string is in the "YYYY-MM-DD" date format and returns true if valid. -func IsYYYYMMDD(str string) bool { - layout := "2006-01-02" - _, err := time.Parse(layout, str) - return err == nil -} diff --git a/vendor/github.com/asaskevich/govalidator/v11/wercker.yml b/vendor/github.com/asaskevich/govalidator/v11/wercker.yml deleted file mode 100644 index bc5f7b0864b..00000000000 --- a/vendor/github.com/asaskevich/govalidator/v11/wercker.yml +++ /dev/null @@ -1,15 +0,0 @@ -box: golang -build: - steps: - - setup-go-workspace - - - script: - name: go get - code: | - go version - go get -t ./... - - - script: - name: go test - code: | - go test -race -v ./... diff --git a/vendor/github.com/asaskevich/govalidator/validator.go b/vendor/github.com/asaskevich/govalidator/validator.go deleted file mode 100644 index c9c4fac0655..00000000000 --- a/vendor/github.com/asaskevich/govalidator/validator.go +++ /dev/null @@ -1,1768 +0,0 @@ -// Package govalidator is package of validators and sanitizers for strings, structs and collections. -package govalidator - -import ( - "bytes" - "crypto/rsa" - "crypto/x509" - "encoding/base64" - "encoding/json" - "encoding/pem" - "fmt" - "io/ioutil" - "net" - "net/url" - "reflect" - "regexp" - "sort" - "strconv" - "strings" - "time" - "unicode" - "unicode/utf8" -) - -var ( - fieldsRequiredByDefault bool - nilPtrAllowedByRequired = false - notNumberRegexp = regexp.MustCompile("[^0-9]+") - whiteSpacesAndMinus = regexp.MustCompile(`[\s-]+`) - paramsRegexp = regexp.MustCompile(`\(.*\)$`) -) - -const maxURLRuneCount = 2083 -const minURLRuneCount = 3 -const rfc3339WithoutZone = "2006-01-02T15:04:05" - -// SetFieldsRequiredByDefault causes validation to fail when struct fields -// do not include validations or are not explicitly marked as exempt (using `valid:"-"` or `valid:"email,optional"`). -// This struct definition will fail govalidator.ValidateStruct() (and the field values do not matter): -// type exampleStruct struct { -// Name string `` -// Email string `valid:"email"` -// This, however, will only fail when Email is empty or an invalid email address: -// type exampleStruct2 struct { -// Name string `valid:"-"` -// Email string `valid:"email"` -// Lastly, this will only fail when Email is an invalid email address but not when it's empty: -// type exampleStruct2 struct { -// Name string `valid:"-"` -// Email string `valid:"email,optional"` -func SetFieldsRequiredByDefault(value bool) { - fieldsRequiredByDefault = value -} - -// SetNilPtrAllowedByRequired causes validation to pass for nil ptrs when a field is set to required. -// The validation will still reject ptr fields in their zero value state. Example with this enabled: -// type exampleStruct struct { -// Name *string `valid:"required"` -// With `Name` set to "", this will be considered invalid input and will cause a validation error. -// With `Name` set to nil, this will be considered valid by validation. -// By default this is disabled. -func SetNilPtrAllowedByRequired(value bool) { - nilPtrAllowedByRequired = value -} - -// IsEmail checks if the string is an email. -func IsEmail(str string) bool { - // TODO uppercase letters are not supported - return rxEmail.MatchString(str) -} - -// IsExistingEmail checks if the string is an email of existing domain -func IsExistingEmail(email string) bool { - - if len(email) < 6 || len(email) > 254 { - return false - } - at := strings.LastIndex(email, "@") - if at <= 0 || at > len(email)-3 { - return false - } - user := email[:at] - host := email[at+1:] - if len(user) > 64 { - return false - } - switch host { - case "localhost", "example.com": - return true - } - if userDotRegexp.MatchString(user) || !userRegexp.MatchString(user) || !hostRegexp.MatchString(host) { - return false - } - if _, err := net.LookupMX(host); err != nil { - if _, err := net.LookupIP(host); err != nil { - return false - } - } - - return true -} - -// IsURL checks if the string is an URL. -func IsURL(str string) bool { - if str == "" || utf8.RuneCountInString(str) >= maxURLRuneCount || len(str) <= minURLRuneCount || strings.HasPrefix(str, ".") { - return false - } - strTemp := str - if strings.Contains(str, ":") && !strings.Contains(str, "://") { - // support no indicated urlscheme but with colon for port number - // http:// is appended so url.Parse will succeed, strTemp used so it does not impact rxURL.MatchString - strTemp = "http://" + str - } - u, err := url.Parse(strTemp) - if err != nil { - return false - } - if strings.HasPrefix(u.Host, ".") { - return false - } - if u.Host == "" && (u.Path != "" && !strings.Contains(u.Path, ".")) { - return false - } - return rxURL.MatchString(str) -} - -// IsRequestURL checks if the string rawurl, assuming -// it was received in an HTTP request, is a valid -// URL confirm to RFC 3986 -func IsRequestURL(rawurl string) bool { - url, err := url.ParseRequestURI(rawurl) - if err != nil { - return false //Couldn't even parse the rawurl - } - if len(url.Scheme) == 0 { - return false //No Scheme found - } - return true -} - -// IsRequestURI checks if the string rawurl, assuming -// it was received in an HTTP request, is an -// absolute URI or an absolute path. -func IsRequestURI(rawurl string) bool { - _, err := url.ParseRequestURI(rawurl) - return err == nil -} - -// IsAlpha checks if the string contains only letters (a-zA-Z). Empty string is valid. -func IsAlpha(str string) bool { - if IsNull(str) { - return true - } - return rxAlpha.MatchString(str) -} - -//IsUTFLetter checks if the string contains only unicode letter characters. -//Similar to IsAlpha but for all languages. Empty string is valid. -func IsUTFLetter(str string) bool { - if IsNull(str) { - return true - } - - for _, c := range str { - if !unicode.IsLetter(c) { - return false - } - } - return true - -} - -// IsAlphanumeric checks if the string contains only letters and numbers. Empty string is valid. -func IsAlphanumeric(str string) bool { - if IsNull(str) { - return true - } - return rxAlphanumeric.MatchString(str) -} - -// IsUTFLetterNumeric checks if the string contains only unicode letters and numbers. Empty string is valid. -func IsUTFLetterNumeric(str string) bool { - if IsNull(str) { - return true - } - for _, c := range str { - if !unicode.IsLetter(c) && !unicode.IsNumber(c) { //letters && numbers are ok - return false - } - } - return true - -} - -// IsNumeric checks if the string contains only numbers. Empty string is valid. -func IsNumeric(str string) bool { - if IsNull(str) { - return true - } - return rxNumeric.MatchString(str) -} - -// IsUTFNumeric checks if the string contains only unicode numbers of any kind. -// Numbers can be 0-9 but also Fractions ¾,Roman Ⅸ and Hangzhou 〩. Empty string is valid. -func IsUTFNumeric(str string) bool { - if IsNull(str) { - return true - } - if strings.IndexAny(str, "+-") > 0 { - return false - } - if len(str) > 1 { - str = strings.TrimPrefix(str, "-") - str = strings.TrimPrefix(str, "+") - } - for _, c := range str { - if !unicode.IsNumber(c) { //numbers && minus sign are ok - return false - } - } - return true - -} - -// IsUTFDigit checks if the string contains only unicode radix-10 decimal digits. Empty string is valid. -func IsUTFDigit(str string) bool { - if IsNull(str) { - return true - } - if strings.IndexAny(str, "+-") > 0 { - return false - } - if len(str) > 1 { - str = strings.TrimPrefix(str, "-") - str = strings.TrimPrefix(str, "+") - } - for _, c := range str { - if !unicode.IsDigit(c) { //digits && minus sign are ok - return false - } - } - return true - -} - -// IsHexadecimal checks if the string is a hexadecimal number. -func IsHexadecimal(str string) bool { - return rxHexadecimal.MatchString(str) -} - -// IsHexcolor checks if the string is a hexadecimal color. -func IsHexcolor(str string) bool { - return rxHexcolor.MatchString(str) -} - -// IsRGBcolor checks if the string is a valid RGB color in form rgb(RRR, GGG, BBB). -func IsRGBcolor(str string) bool { - return rxRGBcolor.MatchString(str) -} - -// IsLowerCase checks if the string is lowercase. Empty string is valid. -func IsLowerCase(str string) bool { - if IsNull(str) { - return true - } - return str == strings.ToLower(str) -} - -// IsUpperCase checks if the string is uppercase. Empty string is valid. -func IsUpperCase(str string) bool { - if IsNull(str) { - return true - } - return str == strings.ToUpper(str) -} - -// HasLowerCase checks if the string contains at least 1 lowercase. Empty string is valid. -func HasLowerCase(str string) bool { - if IsNull(str) { - return true - } - return rxHasLowerCase.MatchString(str) -} - -// HasUpperCase checks if the string contains as least 1 uppercase. Empty string is valid. -func HasUpperCase(str string) bool { - if IsNull(str) { - return true - } - return rxHasUpperCase.MatchString(str) -} - -// IsInt checks if the string is an integer. Empty string is valid. -func IsInt(str string) bool { - if IsNull(str) { - return true - } - return rxInt.MatchString(str) -} - -// IsFloat checks if the string is a float. -func IsFloat(str string) bool { - return str != "" && rxFloat.MatchString(str) -} - -// IsDivisibleBy checks if the string is a number that's divisible by another. -// If second argument is not valid integer or zero, it's return false. -// Otherwise, if first argument is not valid integer or zero, it's return true (Invalid string converts to zero). -func IsDivisibleBy(str, num string) bool { - f, _ := ToFloat(str) - p := int64(f) - q, _ := ToInt(num) - if q == 0 { - return false - } - return (p == 0) || (p%q == 0) -} - -// IsNull checks if the string is null. -func IsNull(str string) bool { - return len(str) == 0 -} - -// IsNotNull checks if the string is not null. -func IsNotNull(str string) bool { - return !IsNull(str) -} - -// HasWhitespaceOnly checks the string only contains whitespace -func HasWhitespaceOnly(str string) bool { - return len(str) > 0 && rxHasWhitespaceOnly.MatchString(str) -} - -// HasWhitespace checks if the string contains any whitespace -func HasWhitespace(str string) bool { - return len(str) > 0 && rxHasWhitespace.MatchString(str) -} - -// IsByteLength checks if the string's length (in bytes) falls in a range. -func IsByteLength(str string, min, max int) bool { - return len(str) >= min && len(str) <= max -} - -// IsUUIDv3 checks if the string is a UUID version 3. -func IsUUIDv3(str string) bool { - return rxUUID3.MatchString(str) -} - -// IsUUIDv4 checks if the string is a UUID version 4. -func IsUUIDv4(str string) bool { - return rxUUID4.MatchString(str) -} - -// IsUUIDv5 checks if the string is a UUID version 5. -func IsUUIDv5(str string) bool { - return rxUUID5.MatchString(str) -} - -// IsUUID checks if the string is a UUID (version 3, 4 or 5). -func IsUUID(str string) bool { - return rxUUID.MatchString(str) -} - -// Byte to index table for O(1) lookups when unmarshaling. -// We use 0xFF as sentinel value for invalid indexes. -var ulidDec = [...]byte{ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x01, - 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, - 0x0F, 0x10, 0x11, 0xFF, 0x12, 0x13, 0xFF, 0x14, 0x15, 0xFF, - 0x16, 0x17, 0x18, 0x19, 0x1A, 0xFF, 0x1B, 0x1C, 0x1D, 0x1E, - 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0A, 0x0B, 0x0C, - 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0xFF, 0x12, 0x13, 0xFF, 0x14, - 0x15, 0xFF, 0x16, 0x17, 0x18, 0x19, 0x1A, 0xFF, 0x1B, 0x1C, - 0x1D, 0x1E, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, -} - -// EncodedSize is the length of a text encoded ULID. -const ulidEncodedSize = 26 - -// IsULID checks if the string is a ULID. -// -// Implementation got from: -// https://github.com/oklog/ulid (Apache-2.0 License) -// -func IsULID(str string) bool { - // Check if a base32 encoded ULID is the right length. - if len(str) != ulidEncodedSize { - return false - } - - // Check if all the characters in a base32 encoded ULID are part of the - // expected base32 character set. - if ulidDec[str[0]] == 0xFF || - ulidDec[str[1]] == 0xFF || - ulidDec[str[2]] == 0xFF || - ulidDec[str[3]] == 0xFF || - ulidDec[str[4]] == 0xFF || - ulidDec[str[5]] == 0xFF || - ulidDec[str[6]] == 0xFF || - ulidDec[str[7]] == 0xFF || - ulidDec[str[8]] == 0xFF || - ulidDec[str[9]] == 0xFF || - ulidDec[str[10]] == 0xFF || - ulidDec[str[11]] == 0xFF || - ulidDec[str[12]] == 0xFF || - ulidDec[str[13]] == 0xFF || - ulidDec[str[14]] == 0xFF || - ulidDec[str[15]] == 0xFF || - ulidDec[str[16]] == 0xFF || - ulidDec[str[17]] == 0xFF || - ulidDec[str[18]] == 0xFF || - ulidDec[str[19]] == 0xFF || - ulidDec[str[20]] == 0xFF || - ulidDec[str[21]] == 0xFF || - ulidDec[str[22]] == 0xFF || - ulidDec[str[23]] == 0xFF || - ulidDec[str[24]] == 0xFF || - ulidDec[str[25]] == 0xFF { - return false - } - - // Check if the first character in a base32 encoded ULID will overflow. This - // happens because the base32 representation encodes 130 bits, while the - // ULID is only 128 bits. - // - // See https://github.com/oklog/ulid/issues/9 for details. - if str[0] > '7' { - return false - } - return true -} - -// IsCreditCard checks if the string is a credit card. -func IsCreditCard(str string) bool { - sanitized := whiteSpacesAndMinus.ReplaceAllString(str, "") - if !rxCreditCard.MatchString(sanitized) { - return false - } - - number, _ := ToInt(sanitized) - number, lastDigit := number / 10, number % 10 - - var sum int64 - for i:=0; number > 0; i++ { - digit := number % 10 - - if i % 2 == 0 { - digit *= 2 - if digit > 9 { - digit -= 9 - } - } - - sum += digit - number = number / 10 - } - - return (sum + lastDigit) % 10 == 0 -} - -// IsISBN10 checks if the string is an ISBN version 10. -func IsISBN10(str string) bool { - return IsISBN(str, 10) -} - -// IsISBN13 checks if the string is an ISBN version 13. -func IsISBN13(str string) bool { - return IsISBN(str, 13) -} - -// IsISBN checks if the string is an ISBN (version 10 or 13). -// If version value is not equal to 10 or 13, it will be checks both variants. -func IsISBN(str string, version int) bool { - sanitized := whiteSpacesAndMinus.ReplaceAllString(str, "") - var checksum int32 - var i int32 - if version == 10 { - if !rxISBN10.MatchString(sanitized) { - return false - } - for i = 0; i < 9; i++ { - checksum += (i + 1) * int32(sanitized[i]-'0') - } - if sanitized[9] == 'X' { - checksum += 10 * 10 - } else { - checksum += 10 * int32(sanitized[9]-'0') - } - if checksum%11 == 0 { - return true - } - return false - } else if version == 13 { - if !rxISBN13.MatchString(sanitized) { - return false - } - factor := []int32{1, 3} - for i = 0; i < 12; i++ { - checksum += factor[i%2] * int32(sanitized[i]-'0') - } - return (int32(sanitized[12]-'0'))-((10-(checksum%10))%10) == 0 - } - return IsISBN(str, 10) || IsISBN(str, 13) -} - -// IsJSON checks if the string is valid JSON (note: uses json.Unmarshal). -func IsJSON(str string) bool { - var js json.RawMessage - return json.Unmarshal([]byte(str), &js) == nil -} - -// IsMultibyte checks if the string contains one or more multibyte chars. Empty string is valid. -func IsMultibyte(str string) bool { - if IsNull(str) { - return true - } - return rxMultibyte.MatchString(str) -} - -// IsASCII checks if the string contains ASCII chars only. Empty string is valid. -func IsASCII(str string) bool { - if IsNull(str) { - return true - } - return rxASCII.MatchString(str) -} - -// IsPrintableASCII checks if the string contains printable ASCII chars only. Empty string is valid. -func IsPrintableASCII(str string) bool { - if IsNull(str) { - return true - } - return rxPrintableASCII.MatchString(str) -} - -// IsFullWidth checks if the string contains any full-width chars. Empty string is valid. -func IsFullWidth(str string) bool { - if IsNull(str) { - return true - } - return rxFullWidth.MatchString(str) -} - -// IsHalfWidth checks if the string contains any half-width chars. Empty string is valid. -func IsHalfWidth(str string) bool { - if IsNull(str) { - return true - } - return rxHalfWidth.MatchString(str) -} - -// IsVariableWidth checks if the string contains a mixture of full and half-width chars. Empty string is valid. -func IsVariableWidth(str string) bool { - if IsNull(str) { - return true - } - return rxHalfWidth.MatchString(str) && rxFullWidth.MatchString(str) -} - -// IsBase64 checks if a string is base64 encoded. -func IsBase64(str string) bool { - return rxBase64.MatchString(str) -} - -// IsFilePath checks is a string is Win or Unix file path and returns it's type. -func IsFilePath(str string) (bool, int) { - if rxWinPath.MatchString(str) { - //check windows path limit see: - // http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#maxpath - if len(str[3:]) > 32767 { - return false, Win - } - return true, Win - } else if rxUnixPath.MatchString(str) { - return true, Unix - } - return false, Unknown -} - -//IsWinFilePath checks both relative & absolute paths in Windows -func IsWinFilePath(str string) bool { - if rxARWinPath.MatchString(str) { - //check windows path limit see: - // http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#maxpath - if len(str[3:]) > 32767 { - return false - } - return true - } - return false -} - -//IsUnixFilePath checks both relative & absolute paths in Unix -func IsUnixFilePath(str string) bool { - if rxARUnixPath.MatchString(str) { - return true - } - return false -} - -// IsDataURI checks if a string is base64 encoded data URI such as an image -func IsDataURI(str string) bool { - dataURI := strings.Split(str, ",") - if !rxDataURI.MatchString(dataURI[0]) { - return false - } - return IsBase64(dataURI[1]) -} - -// IsMagnetURI checks if a string is valid magnet URI -func IsMagnetURI(str string) bool { - return rxMagnetURI.MatchString(str) -} - -// IsISO3166Alpha2 checks if a string is valid two-letter country code -func IsISO3166Alpha2(str string) bool { - for _, entry := range ISO3166List { - if str == entry.Alpha2Code { - return true - } - } - return false -} - -// IsISO3166Alpha3 checks if a string is valid three-letter country code -func IsISO3166Alpha3(str string) bool { - for _, entry := range ISO3166List { - if str == entry.Alpha3Code { - return true - } - } - return false -} - -// IsISO693Alpha2 checks if a string is valid two-letter language code -func IsISO693Alpha2(str string) bool { - for _, entry := range ISO693List { - if str == entry.Alpha2Code { - return true - } - } - return false -} - -// IsISO693Alpha3b checks if a string is valid three-letter language code -func IsISO693Alpha3b(str string) bool { - for _, entry := range ISO693List { - if str == entry.Alpha3bCode { - return true - } - } - return false -} - -// IsDNSName will validate the given string as a DNS name -func IsDNSName(str string) bool { - if str == "" || len(strings.Replace(str, ".", "", -1)) > 255 { - // constraints already violated - return false - } - return !IsIP(str) && rxDNSName.MatchString(str) -} - -// IsHash checks if a string is a hash of type algorithm. -// Algorithm is one of ['md4', 'md5', 'sha1', 'sha256', 'sha384', 'sha512', 'ripemd128', 'ripemd160', 'tiger128', 'tiger160', 'tiger192', 'crc32', 'crc32b'] -func IsHash(str string, algorithm string) bool { - var len string - algo := strings.ToLower(algorithm) - - if algo == "crc32" || algo == "crc32b" { - len = "8" - } else if algo == "md5" || algo == "md4" || algo == "ripemd128" || algo == "tiger128" { - len = "32" - } else if algo == "sha1" || algo == "ripemd160" || algo == "tiger160" { - len = "40" - } else if algo == "tiger192" { - len = "48" - } else if algo == "sha3-224" { - len = "56" - } else if algo == "sha256" || algo == "sha3-256" { - len = "64" - } else if algo == "sha384" || algo == "sha3-384" { - len = "96" - } else if algo == "sha512" || algo == "sha3-512" { - len = "128" - } else { - return false - } - - return Matches(str, "^[a-f0-9]{"+len+"}$") -} - -// IsSHA3224 checks is a string is a SHA3-224 hash. Alias for `IsHash(str, "sha3-224")` -func IsSHA3224(str string) bool { - return IsHash(str, "sha3-224") -} - -// IsSHA3256 checks is a string is a SHA3-256 hash. Alias for `IsHash(str, "sha3-256")` -func IsSHA3256(str string) bool { - return IsHash(str, "sha3-256") -} - -// IsSHA3384 checks is a string is a SHA3-384 hash. Alias for `IsHash(str, "sha3-384")` -func IsSHA3384(str string) bool { - return IsHash(str, "sha3-384") -} - -// IsSHA3512 checks is a string is a SHA3-512 hash. Alias for `IsHash(str, "sha3-512")` -func IsSHA3512(str string) bool { - return IsHash(str, "sha3-512") -} - -// IsSHA512 checks is a string is a SHA512 hash. Alias for `IsHash(str, "sha512")` -func IsSHA512(str string) bool { - return IsHash(str, "sha512") -} - -// IsSHA384 checks is a string is a SHA384 hash. Alias for `IsHash(str, "sha384")` -func IsSHA384(str string) bool { - return IsHash(str, "sha384") -} - -// IsSHA256 checks is a string is a SHA256 hash. Alias for `IsHash(str, "sha256")` -func IsSHA256(str string) bool { - return IsHash(str, "sha256") -} - -// IsTiger192 checks is a string is a Tiger192 hash. Alias for `IsHash(str, "tiger192")` -func IsTiger192(str string) bool { - return IsHash(str, "tiger192") -} - -// IsTiger160 checks is a string is a Tiger160 hash. Alias for `IsHash(str, "tiger160")` -func IsTiger160(str string) bool { - return IsHash(str, "tiger160") -} - -// IsRipeMD160 checks is a string is a RipeMD160 hash. Alias for `IsHash(str, "ripemd160")` -func IsRipeMD160(str string) bool { - return IsHash(str, "ripemd160") -} - -// IsSHA1 checks is a string is a SHA-1 hash. Alias for `IsHash(str, "sha1")` -func IsSHA1(str string) bool { - return IsHash(str, "sha1") -} - -// IsTiger128 checks is a string is a Tiger128 hash. Alias for `IsHash(str, "tiger128")` -func IsTiger128(str string) bool { - return IsHash(str, "tiger128") -} - -// IsRipeMD128 checks is a string is a RipeMD128 hash. Alias for `IsHash(str, "ripemd128")` -func IsRipeMD128(str string) bool { - return IsHash(str, "ripemd128") -} - -// IsCRC32 checks is a string is a CRC32 hash. Alias for `IsHash(str, "crc32")` -func IsCRC32(str string) bool { - return IsHash(str, "crc32") -} - -// IsCRC32b checks is a string is a CRC32b hash. Alias for `IsHash(str, "crc32b")` -func IsCRC32b(str string) bool { - return IsHash(str, "crc32b") -} - -// IsMD5 checks is a string is a MD5 hash. Alias for `IsHash(str, "md5")` -func IsMD5(str string) bool { - return IsHash(str, "md5") -} - -// IsMD4 checks is a string is a MD4 hash. Alias for `IsHash(str, "md4")` -func IsMD4(str string) bool { - return IsHash(str, "md4") -} - -// IsDialString validates the given string for usage with the various Dial() functions -func IsDialString(str string) bool { - if h, p, err := net.SplitHostPort(str); err == nil && h != "" && p != "" && (IsDNSName(h) || IsIP(h)) && IsPort(p) { - return true - } - - return false -} - -// IsIP checks if a string is either IP version 4 or 6. Alias for `net.ParseIP` -func IsIP(str string) bool { - return net.ParseIP(str) != nil -} - -// IsPort checks if a string represents a valid port -func IsPort(str string) bool { - if i, err := strconv.Atoi(str); err == nil && i > 0 && i < 65536 { - return true - } - return false -} - -// IsIPv4 checks if the string is an IP version 4. -func IsIPv4(str string) bool { - ip := net.ParseIP(str) - return ip != nil && strings.Contains(str, ".") -} - -// IsIPv6 checks if the string is an IP version 6. -func IsIPv6(str string) bool { - ip := net.ParseIP(str) - return ip != nil && strings.Contains(str, ":") -} - -// IsCIDR checks if the string is an valid CIDR notiation (IPV4 & IPV6) -func IsCIDR(str string) bool { - _, _, err := net.ParseCIDR(str) - return err == nil -} - -// IsMAC checks if a string is valid MAC address. -// Possible MAC formats: -// 01:23:45:67:89:ab -// 01:23:45:67:89:ab:cd:ef -// 01-23-45-67-89-ab -// 01-23-45-67-89-ab-cd-ef -// 0123.4567.89ab -// 0123.4567.89ab.cdef -func IsMAC(str string) bool { - _, err := net.ParseMAC(str) - return err == nil -} - -// IsHost checks if the string is a valid IP (both v4 and v6) or a valid DNS name -func IsHost(str string) bool { - return IsIP(str) || IsDNSName(str) -} - -// IsMongoID checks if the string is a valid hex-encoded representation of a MongoDB ObjectId. -func IsMongoID(str string) bool { - return rxHexadecimal.MatchString(str) && (len(str) == 24) -} - -// IsLatitude checks if a string is valid latitude. -func IsLatitude(str string) bool { - return rxLatitude.MatchString(str) -} - -// IsLongitude checks if a string is valid longitude. -func IsLongitude(str string) bool { - return rxLongitude.MatchString(str) -} - -// IsIMEI checks if a string is valid IMEI -func IsIMEI(str string) bool { - return rxIMEI.MatchString(str) -} - -// IsIMSI checks if a string is valid IMSI -func IsIMSI(str string) bool { - if !rxIMSI.MatchString(str) { - return false - } - - mcc, err := strconv.ParseInt(str[0:3], 10, 32) - if err != nil { - return false - } - - switch mcc { - case 202, 204, 206, 208, 212, 213, 214, 216, 218, 219: - case 220, 221, 222, 226, 228, 230, 231, 232, 234, 235: - case 238, 240, 242, 244, 246, 247, 248, 250, 255, 257: - case 259, 260, 262, 266, 268, 270, 272, 274, 276, 278: - case 280, 282, 283, 284, 286, 288, 289, 290, 292, 293: - case 294, 295, 297, 302, 308, 310, 311, 312, 313, 314: - case 315, 316, 330, 332, 334, 338, 340, 342, 344, 346: - case 348, 350, 352, 354, 356, 358, 360, 362, 363, 364: - case 365, 366, 368, 370, 372, 374, 376, 400, 401, 402: - case 404, 405, 406, 410, 412, 413, 414, 415, 416, 417: - case 418, 419, 420, 421, 422, 424, 425, 426, 427, 428: - case 429, 430, 431, 432, 434, 436, 437, 438, 440, 441: - case 450, 452, 454, 455, 456, 457, 460, 461, 466, 467: - case 470, 472, 502, 505, 510, 514, 515, 520, 525, 528: - case 530, 536, 537, 539, 540, 541, 542, 543, 544, 545: - case 546, 547, 548, 549, 550, 551, 552, 553, 554, 555: - case 602, 603, 604, 605, 606, 607, 608, 609, 610, 611: - case 612, 613, 614, 615, 616, 617, 618, 619, 620, 621: - case 622, 623, 624, 625, 626, 627, 628, 629, 630, 631: - case 632, 633, 634, 635, 636, 637, 638, 639, 640, 641: - case 642, 643, 645, 646, 647, 648, 649, 650, 651, 652: - case 653, 654, 655, 657, 658, 659, 702, 704, 706, 708: - case 710, 712, 714, 716, 722, 724, 730, 732, 734, 736: - case 738, 740, 742, 744, 746, 748, 750, 995: - return true - default: - return false - } - return true -} - -// IsRsaPublicKey checks if a string is valid public key with provided length -func IsRsaPublicKey(str string, keylen int) bool { - bb := bytes.NewBufferString(str) - pemBytes, err := ioutil.ReadAll(bb) - if err != nil { - return false - } - block, _ := pem.Decode(pemBytes) - if block != nil && block.Type != "PUBLIC KEY" { - return false - } - var der []byte - - if block != nil { - der = block.Bytes - } else { - der, err = base64.StdEncoding.DecodeString(str) - if err != nil { - return false - } - } - - key, err := x509.ParsePKIXPublicKey(der) - if err != nil { - return false - } - pubkey, ok := key.(*rsa.PublicKey) - if !ok { - return false - } - bitlen := len(pubkey.N.Bytes()) * 8 - return bitlen == int(keylen) -} - -// IsRegex checks if a give string is a valid regex with RE2 syntax or not -func IsRegex(str string) bool { - if _, err := regexp.Compile(str); err == nil { - return true - } - return false -} - -func toJSONName(tag string) string { - if tag == "" { - return "" - } - - // JSON name always comes first. If there's no options then split[0] is - // JSON name, if JSON name is not set, then split[0] is an empty string. - split := strings.SplitN(tag, ",", 2) - - name := split[0] - - // However it is possible that the field is skipped when - // (de-)serializing from/to JSON, in which case assume that there is no - // tag name to use - if name == "-" { - return "" - } - return name -} - -func prependPathToErrors(err error, path string) error { - switch err2 := err.(type) { - case Error: - err2.Path = append([]string{path}, err2.Path...) - return err2 - case Errors: - errors := err2.Errors() - for i, err3 := range errors { - errors[i] = prependPathToErrors(err3, path) - } - return err2 - } - return err -} - -// ValidateArray performs validation according to condition iterator that validates every element of the array -func ValidateArray(array []interface{}, iterator ConditionIterator) bool { - return Every(array, iterator) -} - -// ValidateMap use validation map for fields. -// result will be equal to `false` if there are any errors. -// s is the map containing the data to be validated. -// m is the validation map in the form: -// map[string]interface{}{"name":"required,alpha","address":map[string]interface{}{"line1":"required,alphanum"}} -func ValidateMap(s map[string]interface{}, m map[string]interface{}) (bool, error) { - if s == nil { - return true, nil - } - result := true - var err error - var errs Errors - var index int - val := reflect.ValueOf(s) - for key, value := range s { - presentResult := true - validator, ok := m[key] - if !ok { - presentResult = false - var err error - err = fmt.Errorf("all map keys has to be present in the validation map; got %s", key) - err = prependPathToErrors(err, key) - errs = append(errs, err) - } - valueField := reflect.ValueOf(value) - mapResult := true - typeResult := true - structResult := true - resultField := true - switch subValidator := validator.(type) { - case map[string]interface{}: - var err error - if v, ok := value.(map[string]interface{}); !ok { - mapResult = false - err = fmt.Errorf("map validator has to be for the map type only; got %s", valueField.Type().String()) - err = prependPathToErrors(err, key) - errs = append(errs, err) - } else { - mapResult, err = ValidateMap(v, subValidator) - if err != nil { - mapResult = false - err = prependPathToErrors(err, key) - errs = append(errs, err) - } - } - case string: - if (valueField.Kind() == reflect.Struct || - (valueField.Kind() == reflect.Ptr && valueField.Elem().Kind() == reflect.Struct)) && - subValidator != "-" { - var err error - structResult, err = ValidateStruct(valueField.Interface()) - if err != nil { - err = prependPathToErrors(err, key) - errs = append(errs, err) - } - } - resultField, err = typeCheck(valueField, reflect.StructField{ - Name: key, - PkgPath: "", - Type: val.Type(), - Tag: reflect.StructTag(fmt.Sprintf("%s:%q", tagName, subValidator)), - Offset: 0, - Index: []int{index}, - Anonymous: false, - }, val, nil) - if err != nil { - errs = append(errs, err) - } - case nil: - // already handlerd when checked before - default: - typeResult = false - err = fmt.Errorf("map validator has to be either map[string]interface{} or string; got %s", valueField.Type().String()) - err = prependPathToErrors(err, key) - errs = append(errs, err) - } - result = result && presentResult && typeResult && resultField && structResult && mapResult - index++ - } - // checks required keys - requiredResult := true - for key, value := range m { - if schema, ok := value.(string); ok { - tags := parseTagIntoMap(schema) - if required, ok := tags["required"]; ok { - if _, ok := s[key]; !ok { - requiredResult = false - if required.customErrorMessage != "" { - err = Error{key, fmt.Errorf(required.customErrorMessage), true, "required", []string{}} - } else { - err = Error{key, fmt.Errorf("required field missing"), false, "required", []string{}} - } - errs = append(errs, err) - } - } - } - } - - if len(errs) > 0 { - err = errs - } - return result && requiredResult, err -} - -// ValidateStruct use tags for fields. -// result will be equal to `false` if there are any errors. -// todo currently there is no guarantee that errors will be returned in predictable order (tests may to fail) -func ValidateStruct(s interface{}) (bool, error) { - if s == nil { - return true, nil - } - result := true - var err error - val := reflect.ValueOf(s) - if val.Kind() == reflect.Interface || val.Kind() == reflect.Ptr { - val = val.Elem() - } - // we only accept structs - if val.Kind() != reflect.Struct { - return false, fmt.Errorf("function only accepts structs; got %s", val.Kind()) - } - var errs Errors - for i := 0; i < val.NumField(); i++ { - valueField := val.Field(i) - typeField := val.Type().Field(i) - if typeField.PkgPath != "" { - continue // Private field - } - structResult := true - if valueField.Kind() == reflect.Interface { - valueField = valueField.Elem() - } - if (valueField.Kind() == reflect.Struct || - (valueField.Kind() == reflect.Ptr && valueField.Elem().Kind() == reflect.Struct)) && - typeField.Tag.Get(tagName) != "-" { - var err error - structResult, err = ValidateStruct(valueField.Interface()) - if err != nil { - err = prependPathToErrors(err, typeField.Name) - errs = append(errs, err) - } - } - resultField, err2 := typeCheck(valueField, typeField, val, nil) - if err2 != nil { - - // Replace structure name with JSON name if there is a tag on the variable - jsonTag := toJSONName(typeField.Tag.Get("json")) - if jsonTag != "" { - switch jsonError := err2.(type) { - case Error: - jsonError.Name = jsonTag - err2 = jsonError - case Errors: - for i2, err3 := range jsonError { - switch customErr := err3.(type) { - case Error: - customErr.Name = jsonTag - jsonError[i2] = customErr - } - } - - err2 = jsonError - } - } - - errs = append(errs, err2) - } - result = result && resultField && structResult - } - if len(errs) > 0 { - err = errs - } - return result, err -} - -// ValidateStructAsync performs async validation of the struct and returns results through the channels -func ValidateStructAsync(s interface{}) (<-chan bool, <-chan error) { - res := make(chan bool) - errors := make(chan error) - - go func() { - defer close(res) - defer close(errors) - - isValid, isFailed := ValidateStruct(s) - - res <- isValid - errors <- isFailed - }() - - return res, errors -} - -// ValidateMapAsync performs async validation of the map and returns results through the channels -func ValidateMapAsync(s map[string]interface{}, m map[string]interface{}) (<-chan bool, <-chan error) { - res := make(chan bool) - errors := make(chan error) - - go func() { - defer close(res) - defer close(errors) - - isValid, isFailed := ValidateMap(s, m) - - res <- isValid - errors <- isFailed - }() - - return res, errors -} - -// parseTagIntoMap parses a struct tag `valid:required~Some error message,length(2|3)` into map[string]string{"required": "Some error message", "length(2|3)": ""} -func parseTagIntoMap(tag string) tagOptionsMap { - optionsMap := make(tagOptionsMap) - options := strings.Split(tag, ",") - - for i, option := range options { - option = strings.TrimSpace(option) - - validationOptions := strings.Split(option, "~") - if !isValidTag(validationOptions[0]) { - continue - } - if len(validationOptions) == 2 { - optionsMap[validationOptions[0]] = tagOption{validationOptions[0], validationOptions[1], i} - } else { - optionsMap[validationOptions[0]] = tagOption{validationOptions[0], "", i} - } - } - return optionsMap -} - -func isValidTag(s string) bool { - if s == "" { - return false - } - for _, c := range s { - switch { - case strings.ContainsRune("\\'\"!#$%&()*+-./:<=>?@[]^_{|}~ ", c): - // Backslash and quote chars are reserved, but - // otherwise any punctuation chars are allowed - // in a tag name. - default: - if !unicode.IsLetter(c) && !unicode.IsDigit(c) { - return false - } - } - } - return true -} - -// IsSSN will validate the given string as a U.S. Social Security Number -func IsSSN(str string) bool { - if str == "" || len(str) != 11 { - return false - } - return rxSSN.MatchString(str) -} - -// IsSemver checks if string is valid semantic version -func IsSemver(str string) bool { - return rxSemver.MatchString(str) -} - -// IsType checks if interface is of some type -func IsType(v interface{}, params ...string) bool { - if len(params) == 1 { - typ := params[0] - return strings.Replace(reflect.TypeOf(v).String(), " ", "", -1) == strings.Replace(typ, " ", "", -1) - } - return false -} - -// IsTime checks if string is valid according to given format -func IsTime(str string, format string) bool { - _, err := time.Parse(format, str) - return err == nil -} - -// IsUnixTime checks if string is valid unix timestamp value -func IsUnixTime(str string) bool { - if _, err := strconv.Atoi(str); err == nil { - return true - } - return false -} - -// IsRFC3339 checks if string is valid timestamp value according to RFC3339 -func IsRFC3339(str string) bool { - return IsTime(str, time.RFC3339) -} - -// IsRFC3339WithoutZone checks if string is valid timestamp value according to RFC3339 which excludes the timezone. -func IsRFC3339WithoutZone(str string) bool { - return IsTime(str, rfc3339WithoutZone) -} - -// IsISO4217 checks if string is valid ISO currency code -func IsISO4217(str string) bool { - for _, currency := range ISO4217List { - if str == currency { - return true - } - } - - return false -} - -// ByteLength checks string's length -func ByteLength(str string, params ...string) bool { - if len(params) == 2 { - min, _ := ToInt(params[0]) - max, _ := ToInt(params[1]) - return len(str) >= int(min) && len(str) <= int(max) - } - - return false -} - -// RuneLength checks string's length -// Alias for StringLength -func RuneLength(str string, params ...string) bool { - return StringLength(str, params...) -} - -// IsRsaPub checks whether string is valid RSA key -// Alias for IsRsaPublicKey -func IsRsaPub(str string, params ...string) bool { - if len(params) == 1 { - len, _ := ToInt(params[0]) - return IsRsaPublicKey(str, int(len)) - } - - return false -} - -// StringMatches checks if a string matches a given pattern. -func StringMatches(s string, params ...string) bool { - if len(params) == 1 { - pattern := params[0] - return Matches(s, pattern) - } - return false -} - -// StringLength checks string's length (including multi byte strings) -func StringLength(str string, params ...string) bool { - - if len(params) == 2 { - strLength := utf8.RuneCountInString(str) - min, _ := ToInt(params[0]) - max, _ := ToInt(params[1]) - return strLength >= int(min) && strLength <= int(max) - } - - return false -} - -// MinStringLength checks string's minimum length (including multi byte strings) -func MinStringLength(str string, params ...string) bool { - - if len(params) == 1 { - strLength := utf8.RuneCountInString(str) - min, _ := ToInt(params[0]) - return strLength >= int(min) - } - - return false -} - -// MaxStringLength checks string's maximum length (including multi byte strings) -func MaxStringLength(str string, params ...string) bool { - - if len(params) == 1 { - strLength := utf8.RuneCountInString(str) - max, _ := ToInt(params[0]) - return strLength <= int(max) - } - - return false -} - -// Range checks string's length -func Range(str string, params ...string) bool { - if len(params) == 2 { - value, _ := ToFloat(str) - min, _ := ToFloat(params[0]) - max, _ := ToFloat(params[1]) - return InRange(value, min, max) - } - - return false -} - -// IsInRaw checks if string is in list of allowed values -func IsInRaw(str string, params ...string) bool { - if len(params) == 1 { - rawParams := params[0] - - parsedParams := strings.Split(rawParams, "|") - - return IsIn(str, parsedParams...) - } - - return false -} - -// IsIn checks if string str is a member of the set of strings params -func IsIn(str string, params ...string) bool { - for _, param := range params { - if str == param { - return true - } - } - - return false -} - -func checkRequired(v reflect.Value, t reflect.StructField, options tagOptionsMap) (bool, error) { - if nilPtrAllowedByRequired { - k := v.Kind() - if (k == reflect.Ptr || k == reflect.Interface) && v.IsNil() { - return true, nil - } - } - - if requiredOption, isRequired := options["required"]; isRequired { - if len(requiredOption.customErrorMessage) > 0 { - return false, Error{t.Name, fmt.Errorf(requiredOption.customErrorMessage), true, "required", []string{}} - } - return false, Error{t.Name, fmt.Errorf("non zero value required"), false, "required", []string{}} - } else if _, isOptional := options["optional"]; fieldsRequiredByDefault && !isOptional { - return false, Error{t.Name, fmt.Errorf("Missing required field"), false, "required", []string{}} - } - // not required and empty is valid - return true, nil -} - -func typeCheck(v reflect.Value, t reflect.StructField, o reflect.Value, options tagOptionsMap) (isValid bool, resultErr error) { - if !v.IsValid() { - return false, nil - } - - tag := t.Tag.Get(tagName) - - // checks if the field should be ignored - switch tag { - case "": - if v.Kind() != reflect.Slice && v.Kind() != reflect.Map { - if !fieldsRequiredByDefault { - return true, nil - } - return false, Error{t.Name, fmt.Errorf("All fields are required to at least have one validation defined"), false, "required", []string{}} - } - case "-": - return true, nil - } - - isRootType := false - if options == nil { - isRootType = true - options = parseTagIntoMap(tag) - } - - if isEmptyValue(v) { - // an empty value is not validated, checks only required - isValid, resultErr = checkRequired(v, t, options) - for key := range options { - delete(options, key) - } - return isValid, resultErr - } - - var customTypeErrors Errors - optionsOrder := options.orderedKeys() - for _, validatorName := range optionsOrder { - validatorStruct := options[validatorName] - if validatefunc, ok := CustomTypeTagMap.Get(validatorName); ok { - delete(options, validatorName) - - if result := validatefunc(v.Interface(), o.Interface()); !result { - if len(validatorStruct.customErrorMessage) > 0 { - customTypeErrors = append(customTypeErrors, Error{Name: t.Name, Err: TruncatingErrorf(validatorStruct.customErrorMessage, fmt.Sprint(v), validatorName), CustomErrorMessageExists: true, Validator: stripParams(validatorName)}) - continue - } - customTypeErrors = append(customTypeErrors, Error{Name: t.Name, Err: fmt.Errorf("%s does not validate as %s", fmt.Sprint(v), validatorName), CustomErrorMessageExists: false, Validator: stripParams(validatorName)}) - } - } - } - - if len(customTypeErrors.Errors()) > 0 { - return false, customTypeErrors - } - - if isRootType { - // Ensure that we've checked the value by all specified validators before report that the value is valid - defer func() { - delete(options, "optional") - delete(options, "required") - - if isValid && resultErr == nil && len(options) != 0 { - optionsOrder := options.orderedKeys() - for _, validator := range optionsOrder { - isValid = false - resultErr = Error{t.Name, fmt.Errorf( - "The following validator is invalid or can't be applied to the field: %q", validator), false, stripParams(validator), []string{}} - return - } - } - }() - } - - for _, validatorSpec := range optionsOrder { - validatorStruct := options[validatorSpec] - var negate bool - validator := validatorSpec - customMsgExists := len(validatorStruct.customErrorMessage) > 0 - - // checks whether the tag looks like '!something' or 'something' - if validator[0] == '!' { - validator = validator[1:] - negate = true - } - - // checks for interface param validators - for key, value := range InterfaceParamTagRegexMap { - ps := value.FindStringSubmatch(validator) - if len(ps) == 0 { - continue - } - - validatefunc, ok := InterfaceParamTagMap[key] - if !ok { - continue - } - - delete(options, validatorSpec) - - field := fmt.Sprint(v) - if result := validatefunc(v.Interface(), ps[1:]...); (!result && !negate) || (result && negate) { - if customMsgExists { - return false, Error{t.Name, TruncatingErrorf(validatorStruct.customErrorMessage, field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - if negate { - return false, Error{t.Name, fmt.Errorf("%s does validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - return false, Error{t.Name, fmt.Errorf("%s does not validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - } - } - - switch v.Kind() { - case reflect.Bool, - reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, - reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr, - reflect.Float32, reflect.Float64, - reflect.String: - // for each tag option checks the map of validator functions - for _, validatorSpec := range optionsOrder { - validatorStruct := options[validatorSpec] - var negate bool - validator := validatorSpec - customMsgExists := len(validatorStruct.customErrorMessage) > 0 - - // checks whether the tag looks like '!something' or 'something' - if validator[0] == '!' { - validator = validator[1:] - negate = true - } - - // checks for param validators - for key, value := range ParamTagRegexMap { - ps := value.FindStringSubmatch(validator) - if len(ps) == 0 { - continue - } - - validatefunc, ok := ParamTagMap[key] - if !ok { - continue - } - - delete(options, validatorSpec) - - switch v.Kind() { - case reflect.String, - reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, - reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, - reflect.Float32, reflect.Float64: - - field := fmt.Sprint(v) // make value into string, then validate with regex - if result := validatefunc(field, ps[1:]...); (!result && !negate) || (result && negate) { - if customMsgExists { - return false, Error{t.Name, TruncatingErrorf(validatorStruct.customErrorMessage, field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - if negate { - return false, Error{t.Name, fmt.Errorf("%s does validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - return false, Error{t.Name, fmt.Errorf("%s does not validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - default: - // type not yet supported, fail - return false, Error{t.Name, fmt.Errorf("Validator %s doesn't support kind %s", validator, v.Kind()), false, stripParams(validatorSpec), []string{}} - } - } - - if validatefunc, ok := TagMap[validator]; ok { - delete(options, validatorSpec) - - switch v.Kind() { - case reflect.String, - reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, - reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, - reflect.Float32, reflect.Float64: - field := fmt.Sprint(v) // make value into string, then validate with regex - if result := validatefunc(field); !result && !negate || result && negate { - if customMsgExists { - return false, Error{t.Name, TruncatingErrorf(validatorStruct.customErrorMessage, field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - if negate { - return false, Error{t.Name, fmt.Errorf("%s does validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - return false, Error{t.Name, fmt.Errorf("%s does not validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - default: - //Not Yet Supported Types (Fail here!) - err := fmt.Errorf("Validator %s doesn't support kind %s for value %v", validator, v.Kind(), v) - return false, Error{t.Name, err, false, stripParams(validatorSpec), []string{}} - } - } - } - return true, nil - case reflect.Map: - if v.Type().Key().Kind() != reflect.String { - return false, &UnsupportedTypeError{v.Type()} - } - var sv stringValues - sv = v.MapKeys() - sort.Sort(sv) - result := true - for i, k := range sv { - var resultItem bool - var err error - if v.MapIndex(k).Kind() != reflect.Struct { - resultItem, err = typeCheck(v.MapIndex(k), t, o, options) - if err != nil { - return false, err - } - } else { - resultItem, err = ValidateStruct(v.MapIndex(k).Interface()) - if err != nil { - err = prependPathToErrors(err, t.Name+"."+sv[i].Interface().(string)) - return false, err - } - } - result = result && resultItem - } - return result, nil - case reflect.Slice, reflect.Array: - result := true - for i := 0; i < v.Len(); i++ { - var resultItem bool - var err error - if v.Index(i).Kind() != reflect.Struct { - resultItem, err = typeCheck(v.Index(i), t, o, options) - if err != nil { - return false, err - } - } else { - resultItem, err = ValidateStruct(v.Index(i).Interface()) - if err != nil { - err = prependPathToErrors(err, t.Name+"."+strconv.Itoa(i)) - return false, err - } - } - result = result && resultItem - } - return result, nil - case reflect.Interface: - // If the value is an interface then encode its element - if v.IsNil() { - return true, nil - } - return ValidateStruct(v.Interface()) - case reflect.Ptr: - // If the value is a pointer then checks its element - if v.IsNil() { - return true, nil - } - return typeCheck(v.Elem(), t, o, options) - case reflect.Struct: - return true, nil - default: - return false, &UnsupportedTypeError{v.Type()} - } -} - -func stripParams(validatorString string) string { - return paramsRegexp.ReplaceAllString(validatorString, "") -} - -// isEmptyValue checks whether value empty or not -func isEmptyValue(v reflect.Value) bool { - switch v.Kind() { - case reflect.String, reflect.Array: - return v.Len() == 0 - case reflect.Map, reflect.Slice: - return v.Len() == 0 || v.IsNil() - case reflect.Bool: - return !v.Bool() - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return v.Int() == 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return v.Uint() == 0 - case reflect.Float32, reflect.Float64: - return v.Float() == 0 - case reflect.Interface, reflect.Ptr: - return v.IsNil() - } - - return reflect.DeepEqual(v.Interface(), reflect.Zero(v.Type()).Interface()) -} - -// ErrorByField returns error for specified field of the struct -// validated by ValidateStruct or empty string if there are no errors -// or this field doesn't exists or doesn't have any errors. -func ErrorByField(e error, field string) string { - if e == nil { - return "" - } - return ErrorsByField(e)[field] -} - -// ErrorsByField returns map of errors of the struct validated -// by ValidateStruct or empty map if there are no errors. -func ErrorsByField(e error) map[string]string { - m := make(map[string]string) - if e == nil { - return m - } - // prototype for ValidateStruct - - switch e := e.(type) { - case Error: - m[e.Name] = e.Err.Error() - case Errors: - for _, item := range e.Errors() { - n := ErrorsByField(item) - for k, v := range n { - m[k] = v - } - } - } - - return m -} - -// Error returns string equivalent for reflect.Type -func (e *UnsupportedTypeError) Error() string { - return "validator: unsupported type: " + e.Type.String() -} - -func (sv stringValues) Len() int { return len(sv) } -func (sv stringValues) Swap(i, j int) { sv[i], sv[j] = sv[j], sv[i] } -func (sv stringValues) Less(i, j int) bool { return sv.get(i) < sv.get(j) } -func (sv stringValues) get(i int) string { return sv[i].String() } - -func IsE164(str string) bool { - return rxE164.MatchString(str) -} diff --git a/vendor/github.com/asaskevich/govalidator/wercker.yml b/vendor/github.com/asaskevich/govalidator/wercker.yml deleted file mode 100644 index bc5f7b0864b..00000000000 --- a/vendor/github.com/asaskevich/govalidator/wercker.yml +++ /dev/null @@ -1,15 +0,0 @@ -box: golang -build: - steps: - - setup-go-workspace - - - script: - name: go get - code: | - go version - go get -t ./... - - - script: - name: go test - code: | - go test -race -v ./... diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/CHANGELOG.md index f24cec61996..4192e391b96 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/CHANGELOG.md @@ -1,3 +1,74 @@ +# v1.20.13 (2025-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.24.0. Notably this version of the library reduces the allocation footprint of the middleware system. We observe a ~10% reduction in allocations per SDK call with this change. + +# v1.20.12 (2025-11-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.11 (2025-11-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.10 (2025-11-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.9 (2025-11-19.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.8 (2025-11-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.7 (2025-11-12) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.6 (2025-11-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.5 (2025-11-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.4 (2025-11-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.3 (2025-11-04) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.23.2 which should convey some passive reduction of overall allocations, especially when not using the metrics system. + +# v1.20.2 (2025-10-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.1 (2025-10-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.0 (2025-10-27) + +* **Feature**: Add durability checks to validate part count and range for upload/download. You can disable this with `DisableValidateParts` in upload/download options, though doing so is not recommended because it damages the durability posture of your application. + +# v1.19.15 (2025-10-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.14 (2025-10-22) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.13 (2025-10-16) + +* **Dependency Update**: Bump minimum Go version to 1.23. +* **Dependency Update**: Updated to the latest SDK module versions + # v1.19.12 (2025-10-07) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/download.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/download.go index 8acd9a27aea..8e3b6a309fb 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/download.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/download.go @@ -77,6 +77,14 @@ type Downloader struct { // operation requests made by the downloader. ClientOptions []func(*s3.Options) + // By default, the downloader verifies that individual part ranges align + // based on the configured part size. + // + // You can disable that with this flag, however, Amazon S3 recommends + // against doing so because it damages the durability posture of object + // downloads. + DisableValidateParts bool + // Defines the buffer strategy used when downloading a part. // // If a WriterReadFromProvider is given the Download manager @@ -404,6 +412,15 @@ func (d *downloader) tryDownloadChunk(params *s3.GetObjectInput, w io.Writer) (i if err != nil { return 0, err } + + if !d.cfg.DisableValidateParts && params.Range != nil && resp.ContentRange != nil { + expectStart, expectEnd := parseContentRange(*params.Range) + actualStart, actualEnd := parseContentRange(*resp.ContentRange) + if isRangeMismatch(expectStart, expectEnd, actualStart, actualEnd) { + return 0, fmt.Errorf("invalid content range: expect %d-%d, got %d-%d", expectStart, expectEnd, actualStart, actualEnd) + } + } + d.setTotalBytes(resp) // Set total if not yet set. d.once.Do(func() { d.etag = aws.ToString(resp.ETag) @@ -422,6 +439,46 @@ func (d *downloader) tryDownloadChunk(params *s3.GetObjectInput, w io.Writer) (i return n, nil } +func parseContentRange(v string) (int, int) { + parts := strings.Split(v, "/") // chop the total off, if it's there + + // we send "bytes=" but S3 appears to return "bytes ", handle both + trimmed := strings.TrimPrefix(parts[0], "bytes ") + trimmed = strings.TrimPrefix(trimmed, "bytes=") + + parts = strings.Split(trimmed, "-") + if len(parts) != 2 { + return -1, -1 + } + + start, err := strconv.Atoi(parts[0]) + if err != nil { + return -1, -1 + } + + end, err := strconv.Atoi(parts[1]) + if err != nil { + return -1, -1 + } + + return start, end +} + +func isRangeMismatch(expectStart, expectEnd, actualStart, actualEnd int) bool { + if expectStart == -1 || expectEnd == -1 || actualStart == -1 || actualEnd == -1 { + return false // we don't know, one of the ranges was missing or unparseable + } + + // for the final chunk (or the first chunk if it's smaller) we still + // request a full chunk but we get back the actual final part of the + // object, which will be smaller + if expectStart == actualStart && actualEnd < expectEnd { + return false + } + + return expectStart != actualStart || expectEnd != actualEnd +} + // getTotalBytes is a thread-safe getter for retrieving the total byte status. func (d *downloader) getTotalBytes() int64 { d.m.Lock() diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/go_module_metadata.go index 6c415fd013c..7679050283a 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/go_module_metadata.go @@ -3,4 +3,4 @@ package manager // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.19.12" +const goModuleVersion = "1.20.13" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/upload.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/upload.go index 6f513f537cf..dcc439c9d78 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/upload.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/upload.go @@ -269,6 +269,14 @@ type Uploader struct { // Note: S3 Express buckets always require CRC32 checksums regardless of this setting. RequestChecksumCalculation aws.RequestChecksumCalculation + // By default, the uploader verifies that the number of expected uploaded + // parts matches the actual count at the end of an upload. + // + // You can disable that with this flag, however, Amazon S3 recommends + // against doing so because it damages the durability posture of object + // uploads. + DisableValidateParts bool + // partPool allows for the re-usage of streaming payload part buffers between upload calls partPool byteSlicePool } @@ -362,8 +370,9 @@ type uploader struct { in *s3.PutObjectInput - readerPos int64 // current reader position - totalSize int64 // set to -1 if the size is not known + readerPos int64 // current reader position + totalSize int64 // set to -1 if the size is not known + expectParts int64 } // internal logic for deciding whether to upload a single part or use a @@ -446,6 +455,11 @@ func (u *uploader) initSize() error { // during the size calculation. e.g odd number of bytes. u.cfg.PartSize = (u.totalSize / int64(u.cfg.MaxUploadParts)) + 1 } + + u.expectParts = u.totalSize / u.cfg.PartSize + if u.totalSize%u.cfg.PartSize != 0 { + u.expectParts++ + } } return nil @@ -877,6 +891,17 @@ func (u *multiuploader) complete() *s3.CompleteMultipartUploadOutput { u.fail() } + // expectParts == 0 means we didn't know the content length upfront and + // therefore we can't validate this at all + if u.expectParts == 0 || u.cfg.DisableValidateParts { + return resp + } + + if len(u.parts) != int(u.expectParts) { + u.seterr(fmt.Errorf("uploaded part count mismatch: expected %d, got %d", u.expectParts, len(u.parts))) + u.fail() + } + return resp } diff --git a/vendor/github.com/chavacava/garif/README.md b/vendor/github.com/chavacava/garif/README.md deleted file mode 100644 index 6a19c61473a..00000000000 --- a/vendor/github.com/chavacava/garif/README.md +++ /dev/null @@ -1,52 +0,0 @@ -# garif - -A GO package to create and manipulate SARIF logs. - -SARIF, from _Static Analysis Results Interchange Format_, is a standard JSON-based format for the output of static analysis tools defined and promoted by [OASIS](https://www.oasis-open.org/). - -Current supported version of the standard is [SARIF-v2.1.0](https://docs.oasis-open.org/sarif/sarif/v2.1.0/csprd01/sarif-v2.1.0-csprd01.html -). - -## Usage - -The package provides access to every element of the SARIF model, therefore you are free to manipulate it at every detail. - -The package also provides constructors functions (`New...`) and decorators methods (`With...`) that simplify the creation of SARIF files for common use cases. - -Using these constructors and decorators we can easily create the example SARIF file of the [Microsoft SARIF pages](https://github.com/microsoft/sarif-tutorials/blob/master/docs/1-Introduction.md) - - -```go -import to `github.com/chavacava/garif` - -// ... - -rule := garif.NewRule("no-unused-vars"). - WithHelpUri("https://eslint.org/docs/rules/no-unused-vars"). - WithShortDescription("disallow unused variables"). - WithProperties("category", "Variables") - -driver := garif.NewDriver("ESLint"). - WithInformationUri("https://eslint.org"). - WithRules(rule) - -run := garif.NewRun(NewTool(driver)). - WithArtifactsURIs("file:///C:/dev/sarif/sarif-tutorials/samples/Introduction/simple-example.js") - -run.WithResult(rule.Id, "'x' is assigned a value but never used.", "file:///C:/dev/sarif/sarif-tutorials/samples/Introduction/simple-example.js", 1, 5) - -logFile := garif.NewLogFile([]*Run{run}, Version210) - -logFile.Write(os.Stdout) -``` - -## Why this package? -This package was initiated during my works on adding to [`revive`](https://github.com/mgechev/revive) a SARIF output formatter. -I've tried to use [go-sarif](https://github.com/owenrumney/go-sarif) by [Owen Rumney](https://github.com/owenrumney) but it is too focused in the use case of the static analyzer [tfsec](https://tfsec.dev) so I've decided to create a package flexible enough to generate SARIF files in broader cases. - -## More information about SARIF -For more information about SARIF, you can visit the [Oasis Open](https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=sarif) site. - - -## Contributing -Of course, contributions are welcome! \ No newline at end of file diff --git a/vendor/github.com/chavacava/garif/doc.go b/vendor/github.com/chavacava/garif/doc.go deleted file mode 100644 index 50fa6dfe5b4..00000000000 --- a/vendor/github.com/chavacava/garif/doc.go +++ /dev/null @@ -1,11 +0,0 @@ -// Package garif defines all the GO structures required to model a SARIF log file. -// These structures were created using the JSON-schema sarif-schema-2.1.0.json of SARIF logfiles -// available at https://github.com/oasis-tcs/sarif-spec/tree/master/Schemata. -// -// The package provides constructors for all structures (see constructors.go) These constructors -// ensure that the returned structure instantiation is valid with respect to the JSON schema and -// should be used in place of plain structure instantiation. -// The root structure is LogFile. -// -// The package provides utility decorators for the most commonly used structures (see decorators.go) -package garif diff --git a/vendor/github.com/chavacava/garif/models.go b/vendor/github.com/chavacava/garif/models.go deleted file mode 100644 index f16a86136e5..00000000000 --- a/vendor/github.com/chavacava/garif/models.go +++ /dev/null @@ -1,1486 +0,0 @@ -package garif - -// Address A physical or virtual address, or a range of addresses, in an 'addressable region' (memory or a binary file). -type Address struct { - - // The address expressed as a byte offset from the start of the addressable region. - AbsoluteAddress int `json:"absoluteAddress,omitempty"` - - // A human-readable fully qualified name that is associated with the address. - FullyQualifiedName string `json:"fullyQualifiedName,omitempty"` - - // The index within run.addresses of the cached object for this address. - Index int `json:"index,omitempty"` - - // An open-ended string that identifies the address kind. - // 'data', 'function', 'header','instruction', 'module', 'page', 'section', - // 'segment', 'stack', 'stackFrame', 'table' are well-known values. - Kind string `json:"kind,omitempty"` - - // The number of bytes in this range of addresses. - Length int `json:"length,omitempty"` - - // A name that is associated with the address, e.g., '.text'. - Name string `json:"name,omitempty"` - - // The byte offset of this address from the absolute or relative address of the parent object. - OffsetFromParent int `json:"offsetFromParent,omitempty"` - - // The index within run.addresses of the parent object. - ParentIndex int `json:"parentIndex,omitempty"` - - // Key/value pairs that provide additional information about the address. - Properties *PropertyBag `json:"properties,omitempty"` - - // The address expressed as a byte offset from the absolute address of the top-most parent object. - RelativeAddress int `json:"relativeAddress,omitempty"` -} - -// Artifact A single artifact. In some cases, this artifact might be nested within another artifact. -type Artifact struct { - - // The contents of the artifact. - Contents *ArtifactContent `json:"contents,omitempty"` - - // A short description of the artifact. - Description *Message `json:"description,omitempty"` - - // Specifies the encoding for an artifact object that refers to a text file. - Encoding string `json:"encoding,omitempty"` - - // A dictionary, each of whose keys is the name of a hash function and each of whose values is - // the hashed value of the artifact produced by the specified hash function. - Hashes map[string]string `json:"hashes,omitempty"` - - // The Coordinated Universal Time (UTC) date and time at which the artifact was most recently modified. - // See "Date/time properties" in the SARIF spec for the required format. - LastModifiedTimeUtc string `json:"lastModifiedTimeUtc,omitempty"` - - // The length of the artifact in bytes. - Length int `json:"length,omitempty"` - - // The location of the artifact. - Location *ArtifactLocation `json:"location,omitempty"` - - // The MIME type (RFC 2045) of the artifact. - MimeType string `json:"mimeType,omitempty"` - - // The offset in bytes of the artifact within its containing artifact. - Offset int `json:"offset,omitempty"` - - // Identifies the index of the immediate parent of the artifact, if this artifact is nested. - ParentIndex int `json:"parentIndex,omitempty"` - - // Key/value pairs that provide additional information about the artifact. - Properties *PropertyBag `json:"properties,omitempty"` - - // The role or roles played by the artifact in the analysis. - Roles []interface{} `json:"roles,omitempty"` - - // Specifies the source language for any artifact object that refers to a text file that contains source code. - SourceLanguage string `json:"sourceLanguage,omitempty"` -} - -// ArtifactChange A change to a single artifact. -type ArtifactChange struct { - - // The location of the artifact to change. - ArtifactLocation *ArtifactLocation `json:"artifactLocation"` - - // Key/value pairs that provide additional information about the change. - Properties *PropertyBag `json:"properties,omitempty"` - - // An array of replacement objects, each of which represents the replacement of a single region in a - // single artifact specified by 'artifactLocation'. - Replacements []*Replacement `json:"replacements"` -} - -// ArtifactContent Represents the contents of an artifact. -type ArtifactContent struct { - - // MIME Base64-encoded content from a binary artifact, or from a text artifact in its original encoding. - Binary string `json:"binary,omitempty"` - - // Key/value pairs that provide additional information about the artifact content. - Properties *PropertyBag `json:"properties,omitempty"` - - // An alternate rendered representation of the artifact (e.g., a decompiled representation of a binary region). - Rendered *MultiformatMessageString `json:"rendered,omitempty"` - - // UTF-8-encoded content from a text artifact. - Text string `json:"text,omitempty"` -} - -// ArtifactLocation Specifies the location of an artifact. -type ArtifactLocation struct { - - // A short description of the artifact location. - Description *Message `json:"description,omitempty"` - - // The index within the run artifacts array of the artifact object associated with the artifact location. - Index int `json:"index,omitempty"` - - // Key/value pairs that provide additional information about the artifact location. - Properties *PropertyBag `json:"properties,omitempty"` - - // A string containing a valid relative or absolute URI. - Uri string `json:"uri,omitempty"` - - // A string which indirectly specifies the absolute URI with respect to which a relative URI in the "uri" property is interpreted. - UriBaseId string `json:"uriBaseId,omitempty"` -} - -// Attachment An artifact relevant to a result. -type Attachment struct { - - // The location of the attachment. - ArtifactLocation *ArtifactLocation `json:"artifactLocation"` - - // A message describing the role played by the attachment. - Description *Message `json:"description,omitempty"` - - // Key/value pairs that provide additional information about the attachment. - Properties *PropertyBag `json:"properties,omitempty"` - - // An array of rectangles specifying areas of interest within the image. - Rectangles []*Rectangle `json:"rectangles,omitempty"` - - // An array of regions of interest within the attachment. - Regions []*Region `json:"regions,omitempty"` -} - -// CodeFlow A set of threadFlows which together describe a pattern of code execution relevant to detecting a result. -type CodeFlow struct { - - // A message relevant to the code flow. - Message *Message `json:"message,omitempty"` - - // Key/value pairs that provide additional information about the code flow. - Properties *PropertyBag `json:"properties,omitempty"` - - // An array of one or more unique threadFlow objects, each of which describes the progress of a program - // through a thread of execution. - ThreadFlows []*ThreadFlow `json:"threadFlows"` -} - -// ConfigurationOverride Information about how a specific rule or notification was reconfigured at runtime. -type ConfigurationOverride struct { - - // Specifies how the rule or notification was configured during the scan. - Configuration *ReportingConfiguration `json:"configuration"` - - // A reference used to locate the descriptor whose configuration was overridden. - Descriptor *ReportingDescriptorReference `json:"descriptor"` - - // Key/value pairs that provide additional information about the configuration override. - Properties *PropertyBag `json:"properties,omitempty"` -} - -// Conversion Describes how a converter transformed the output of a static analysis tool from the analysis tool's native output format into the SARIF format. -type Conversion struct { - - // The locations of the analysis tool's per-run log files. - AnalysisToolLogFiles []*ArtifactLocation `json:"analysisToolLogFiles,omitempty"` - - // An invocation object that describes the invocation of the converter. - Invocation *Invocation `json:"invocation,omitempty"` - - // Key/value pairs that provide additional information about the conversion. - Properties *PropertyBag `json:"properties,omitempty"` - - // A tool object that describes the converter. - Tool *Tool `json:"tool"` -} - -// Edge Represents a directed edge in a graph. -type Edge struct { - - // A string that uniquely identifies the edge within its graph. - Id string `json:"id"` - - // A short description of the edge. - Label *Message `json:"label,omitempty"` - - // Key/value pairs that provide additional information about the edge. - Properties *PropertyBag `json:"properties,omitempty"` - - // Identifies the source node (the node at which the edge starts). - SourceNodeId string `json:"sourceNodeId"` - - // Identifies the target node (the node at which the edge ends). - TargetNodeId string `json:"targetNodeId"` -} - -// EdgeTraversal Represents the traversal of a single edge during a graph traversal. -type EdgeTraversal struct { - - // Identifies the edge being traversed. - EdgeId string `json:"edgeId"` - - // The values of relevant expressions after the edge has been traversed. - FinalState map[string]*MultiformatMessageString `json:"finalState,omitempty"` - - // A message to display to the user as the edge is traversed. - Message *Message `json:"message,omitempty"` - - // Key/value pairs that provide additional information about the edge traversal. - Properties *PropertyBag `json:"properties,omitempty"` - - // The number of edge traversals necessary to return from a nested graph. - StepOverEdgeCount int `json:"stepOverEdgeCount,omitempty"` -} - -// Exception Describes a runtime exception encountered during the execution of an analysis tool. -type Exception struct { - - // An array of exception objects each of which is considered a cause of this exception. - InnerExceptions []*Exception `json:"innerExceptions,omitempty"` - - // A string that identifies the kind of exception, for example, the fully qualified type name of an object that was thrown, or the symbolic name of a signal. - Kind string `json:"kind,omitempty"` - - // A message that describes the exception. - Message string `json:"message,omitempty"` - - // Key/value pairs that provide additional information about the exception. - Properties *PropertyBag `json:"properties,omitempty"` - - // The sequence of function calls leading to the exception. - Stack *Stack `json:"stack,omitempty"` -} - -// ExternalProperties The top-level element of an external property file. -type ExternalProperties struct { - - // Addresses that will be merged with a separate run. - Addresses []*Address `json:"addresses,omitempty"` - - // An array of artifact objects that will be merged with a separate run. - Artifacts []*Artifact `json:"artifacts,omitempty"` - - // A conversion object that will be merged with a separate run. - Conversion *Conversion `json:"conversion,omitempty"` - - // The analysis tool object that will be merged with a separate run. - Driver *ToolComponent `json:"driver,omitempty"` - - // Tool extensions that will be merged with a separate run. - Extensions []*ToolComponent `json:"extensions,omitempty"` - - // Key/value pairs that provide additional information that will be merged with a separate run. - ExternalizedProperties *PropertyBag `json:"externalizedProperties,omitempty"` - - // An array of graph objects that will be merged with a separate run. - Graphs []*Graph `json:"graphs,omitempty"` - - // A stable, unique identifer for this external properties object, in the form of a GUID. - Guid string `json:"guid,omitempty"` - - // Describes the invocation of the analysis tool that will be merged with a separate run. - Invocations []*Invocation `json:"invocations,omitempty"` - - // An array of logical locations such as namespaces, types or functions that will be merged with a separate run. - LogicalLocations []*LogicalLocation `json:"logicalLocations,omitempty"` - - // Tool policies that will be merged with a separate run. - Policies []*ToolComponent `json:"policies,omitempty"` - - // Key/value pairs that provide additional information about the external properties. - Properties *PropertyBag `json:"properties,omitempty"` - - // An array of result objects that will be merged with a separate run. - Results []*Result `json:"results,omitempty"` - - // A stable, unique identifer for the run associated with this external properties object, in the form of a GUID. - RunGuid string `json:"runGuid,omitempty"` - - // The URI of the JSON schema corresponding to the version of the external property file format. - Schema string `json:"schema,omitempty"` - - // Tool taxonomies that will be merged with a separate run. - Taxonomies []*ToolComponent `json:"taxonomies,omitempty"` - - // An array of threadFlowLocation objects that will be merged with a separate run. - ThreadFlowLocations []*ThreadFlowLocation `json:"threadFlowLocations,omitempty"` - - // Tool translations that will be merged with a separate run. - Translations []*ToolComponent `json:"translations,omitempty"` - - // The SARIF format version of this external properties object. - Version interface{} `json:"version,omitempty"` - - // Requests that will be merged with a separate run. - WebRequests []*WebRequest `json:"webRequests,omitempty"` - - // Responses that will be merged with a separate run. - WebResponses []*WebResponse `json:"webResponses,omitempty"` -} - -// ExternalPropertyFileReference Contains information that enables a SARIF consumer to locate the external property file that contains the value of an externalized property associated with the run. -type ExternalPropertyFileReference struct { - - // A stable, unique identifer for the external property file in the form of a GUID. - Guid string `json:"guid,omitempty"` - - // A non-negative integer specifying the number of items contained in the external property file. - ItemCount int `json:"itemCount,omitempty"` - - // The location of the external property file. - Location *ArtifactLocation `json:"location,omitempty"` - - // Key/value pairs that provide additional information about the external property file. - Properties *PropertyBag `json:"properties,omitempty"` -} - -// ExternalPropertyFileReferences References to external property files that should be inlined with the content of a root log file. -type ExternalPropertyFileReferences struct { - - // An array of external property files containing run.addresses arrays to be merged with the root log file. - Addresses []*ExternalPropertyFileReference `json:"addresses,omitempty"` - - // An array of external property files containing run.artifacts arrays to be merged with the root log file. - Artifacts []*ExternalPropertyFileReference `json:"artifacts,omitempty"` - - // An external property file containing a run.conversion object to be merged with the root log file. - Conversion *ExternalPropertyFileReference `json:"conversion,omitempty"` - - // An external property file containing a run.driver object to be merged with the root log file. - Driver *ExternalPropertyFileReference `json:"driver,omitempty"` - - // An array of external property files containing run.extensions arrays to be merged with the root log file. - Extensions []*ExternalPropertyFileReference `json:"extensions,omitempty"` - - // An external property file containing a run.properties object to be merged with the root log file. - ExternalizedProperties *ExternalPropertyFileReference `json:"externalizedProperties,omitempty"` - - // An array of external property files containing a run.graphs object to be merged with the root log file. - Graphs []*ExternalPropertyFileReference `json:"graphs,omitempty"` - - // An array of external property files containing run.invocations arrays to be merged with the root log file. - Invocations []*ExternalPropertyFileReference `json:"invocations,omitempty"` - - // An array of external property files containing run.logicalLocations arrays to be merged with the root log file. - LogicalLocations []*ExternalPropertyFileReference `json:"logicalLocations,omitempty"` - - // An array of external property files containing run.policies arrays to be merged with the root log file. - Policies []*ExternalPropertyFileReference `json:"policies,omitempty"` - - // Key/value pairs that provide additional information about the external property files. - Properties *PropertyBag `json:"properties,omitempty"` - - // An array of external property files containing run.results arrays to be merged with the root log file. - Results []*ExternalPropertyFileReference `json:"results,omitempty"` - - // An array of external property files containing run.taxonomies arrays to be merged with the root log file. - Taxonomies []*ExternalPropertyFileReference `json:"taxonomies,omitempty"` - - // An array of external property files containing run.threadFlowLocations arrays to be merged with the root log file. - ThreadFlowLocations []*ExternalPropertyFileReference `json:"threadFlowLocations,omitempty"` - - // An array of external property files containing run.translations arrays to be merged with the root log file. - Translations []*ExternalPropertyFileReference `json:"translations,omitempty"` - - // An array of external property files containing run.requests arrays to be merged with the root log file. - WebRequests []*ExternalPropertyFileReference `json:"webRequests,omitempty"` - - // An array of external property files containing run.responses arrays to be merged with the root log file. - WebResponses []*ExternalPropertyFileReference `json:"webResponses,omitempty"` -} - -// Fix A proposed fix for the problem represented by a result object. -// A fix specifies a set of artifacts to modify. For each artifact, -// it specifies a set of bytes to remove, and provides a set of new bytes to replace them. -type Fix struct { - - // One or more artifact changes that comprise a fix for a result. - ArtifactChanges []*ArtifactChange `json:"artifactChanges"` - - // A message that describes the proposed fix, enabling viewers to present the proposed change to an end user. - Description *Message `json:"description,omitempty"` - - // Key/value pairs that provide additional information about the fix. - Properties *PropertyBag `json:"properties,omitempty"` -} - -// Graph A network of nodes and directed edges that describes some aspect of the -// structure of the code (for example, a call graph). -type Graph struct { - - // A description of the graph. - Description *Message `json:"description,omitempty"` - - // An array of edge objects representing the edges of the graph. - Edges []*Edge `json:"edges,omitempty"` - - // An array of node objects representing the nodes of the graph. - Nodes []*Node `json:"nodes,omitempty"` - - // Key/value pairs that provide additional information about the graph. - Properties *PropertyBag `json:"properties,omitempty"` -} - -// GraphTraversal Represents a path through a graph. -type GraphTraversal struct { - - // A description of this graph traversal. - Description *Message `json:"description,omitempty"` - - // The sequences of edges traversed by this graph traversal. - EdgeTraversals []*EdgeTraversal `json:"edgeTraversals,omitempty"` - - // Values of relevant expressions at the start of the graph traversal that remain constant for the graph traversal. - ImmutableState map[string]*MultiformatMessageString `json:"immutableState,omitempty"` - - // Values of relevant expressions at the start of the graph traversal that may change during graph traversal. - InitialState map[string]*MultiformatMessageString `json:"initialState,omitempty"` - - // Key/value pairs that provide additional information about the graph traversal. - Properties *PropertyBag `json:"properties,omitempty"` - - // The index within the result.graphs to be associated with the result. - ResultGraphIndex int `json:"resultGraphIndex,omitempty"` - - // The index within the run.graphs to be associated with the result. - RunGraphIndex int `json:"runGraphIndex,omitempty"` -} - -// Invocation The runtime environment of the analysis tool run. -type Invocation struct { - - // The account under which the invocation occurred. - Account string `json:"account,omitempty"` - - // An array of strings, containing in order the command line arguments passed to the tool from the operating system. - Arguments []string `json:"arguments,omitempty"` - - // The command line used to invoke the tool. - CommandLine string `json:"commandLine,omitempty"` - - // The Coordinated Universal Time (UTC) date and time at which the invocation ended. See "Date/time properties" in the SARIF spec for the required format. - EndTimeUtc string `json:"endTimeUtc,omitempty"` - - // The environment variables associated with the analysis tool process, expressed as key/value pairs. - EnvironmentVariables map[string]string `json:"environmentVariables,omitempty"` - - // An absolute URI specifying the location of the executable that was invoked. - ExecutableLocation *ArtifactLocation `json:"executableLocation,omitempty"` - - // Specifies whether the tool's execution completed successfully. - ExecutionSuccessful bool `json:"executionSuccessful"` - - // The process exit code. - ExitCode int `json:"exitCode,omitempty"` - - // The reason for the process exit. - ExitCodeDescription string `json:"exitCodeDescription,omitempty"` - - // The name of the signal that caused the process to exit. - ExitSignalName string `json:"exitSignalName,omitempty"` - - // The numeric value of the signal that caused the process to exit. - ExitSignalNumber int `json:"exitSignalNumber,omitempty"` - - // The machine on which the invocation occurred. - Machine string `json:"machine,omitempty"` - - // An array of configurationOverride objects that describe notifications related runtime overrides. - NotificationConfigurationOverrides []*ConfigurationOverride `json:"notificationConfigurationOverrides,omitempty"` - - // The id of the process in which the invocation occurred. - ProcessId int `json:"processId,omitempty"` - - // The reason given by the operating system that the process failed to start. - ProcessStartFailureMessage string `json:"processStartFailureMessage,omitempty"` - - // Key/value pairs that provide additional information about the invocation. - Properties *PropertyBag `json:"properties,omitempty"` - - // The locations of any response files specified on the tool's command line. - ResponseFiles []*ArtifactLocation `json:"responseFiles,omitempty"` - - // An array of configurationOverride objects that describe rules related runtime overrides. - RuleConfigurationOverrides []*ConfigurationOverride `json:"ruleConfigurationOverrides,omitempty"` - - // The Coordinated Universal Time (UTC) date and time at which the invocation started. See "Date/time properties" in the SARIF spec for the required format. - StartTimeUtc string `json:"startTimeUtc,omitempty"` - - // A file containing the standard error stream from the process that was invoked. - Stderr *ArtifactLocation `json:"stderr,omitempty"` - - // A file containing the standard input stream to the process that was invoked. - Stdin *ArtifactLocation `json:"stdin,omitempty"` - - // A file containing the standard output stream from the process that was invoked. - Stdout *ArtifactLocation `json:"stdout,omitempty"` - - // A file containing the interleaved standard output and standard error stream from the process that was invoked. - StdoutStderr *ArtifactLocation `json:"stdoutStderr,omitempty"` - - // A list of conditions detected by the tool that are relevant to the tool's configuration. - ToolConfigurationNotifications []*Notification `json:"toolConfigurationNotifications,omitempty"` - - // A list of runtime conditions detected by the tool during the analysis. - ToolExecutionNotifications []*Notification `json:"toolExecutionNotifications,omitempty"` - - // The working directory for the invocation. - WorkingDirectory *ArtifactLocation `json:"workingDirectory,omitempty"` -} - -// Location A location within a programming artifact. -type Location struct { - - // A set of regions relevant to the location. - Annotations []*Region `json:"annotations,omitempty"` - - // Value that distinguishes this location from all other locations within a single result object. - Id int `json:"id,omitempty"` - - // The logical locations associated with the result. - LogicalLocations []*LogicalLocation `json:"logicalLocations,omitempty"` - - // A message relevant to the location. - Message *Message `json:"message,omitempty"` - - // Identifies the artifact and region. - PhysicalLocation *PhysicalLocation `json:"physicalLocation,omitempty"` - - // Key/value pairs that provide additional information about the location. - Properties *PropertyBag `json:"properties,omitempty"` - - // An array of objects that describe relationships between this location and others. - Relationships []*LocationRelationship `json:"relationships,omitempty"` -} - -// LocationRelationship Information about the relation of one location to another. -type LocationRelationship struct { - - // A description of the location relationship. - Description *Message `json:"description,omitempty"` - - // A set of distinct strings that categorize the relationship. Well-known kinds include 'includes', 'isIncludedBy' and 'relevant'. - Kinds []string `json:"kinds,omitempty"` - - // Key/value pairs that provide additional information about the location relationship. - Properties *PropertyBag `json:"properties,omitempty"` - - // A reference to the related location. - Target int `json:"target"` -} - -// LogFile Static Analysis Results Format (SARIF) Version 2.1.0 JSON Schema. -type LogFile struct { - - // References to external property files that share data between runs. - InlineExternalProperties []*ExternalProperties `json:"inlineExternalProperties,omitempty"` - - // Key/value pairs that provide additional information about the log file. - Properties *PropertyBag `json:"properties,omitempty"` - - // The set of runs contained in this log file. - Runs []*Run `json:"runs"` - - // The URI of the JSON schema corresponding to the version. - Schema string `json:"$schema,omitempty"` - - // The SARIF format version of this log file. - Version interface{} `json:"version"` -} - -// LogicalLocation A logical location of a construct that produced a result. -type LogicalLocation struct { - - // The machine-readable name for the logical location, such as a mangled function name provided by a C++ compiler that encodes calling convention, return type and other details along with the function name. - DecoratedName string `json:"decoratedName,omitempty"` - - // The human-readable fully qualified name of the logical location. - FullyQualifiedName string `json:"fullyQualifiedName,omitempty"` - - // The index within the logical locations array. - Index int `json:"index,omitempty"` - - // The type of construct this logical location component refers to. Should be one of 'function', 'member', 'module', 'namespace', 'parameter', 'resource', 'returnType', 'type', 'variable', 'object', 'array', 'property', 'value', 'element', 'text', 'attribute', 'comment', 'declaration', 'dtd' or 'processingInstruction', if any of those accurately describe the construct. - Kind string `json:"kind,omitempty"` - - // Identifies the construct in which the result occurred. For example, this property might contain the name of a class or a method. - Name string `json:"name,omitempty"` - - // Identifies the index of the immediate parent of the construct in which the result was detected. For example, this property might point to a logical location that represents the namespace that holds a type. - ParentIndex int `json:"parentIndex,omitempty"` - - // Key/value pairs that provide additional information about the logical location. - Properties *PropertyBag `json:"properties,omitempty"` -} - -// Message Encapsulates a message intended to be read by the end user. -type Message struct { - - // An array of strings to substitute into the message string. - Arguments []string `json:"arguments,omitempty"` - - // The identifier for this message. - Id string `json:"id,omitempty"` - - // A Markdown message string. - Markdown string `json:"markdown,omitempty"` - - // Key/value pairs that provide additional information about the message. - Properties *PropertyBag `json:"properties,omitempty"` - - // A plain text message string. - Text string `json:"text,omitempty"` -} - -// MultiformatMessageString A message string or message format string rendered in multiple formats. -type MultiformatMessageString struct { - - // A Markdown message string or format string. - Markdown string `json:"markdown,omitempty"` - - // Key/value pairs that provide additional information about the message. - Properties *PropertyBag `json:"properties,omitempty"` - - // A plain text message string or format string. - Text string `json:"text"` -} - -// Node Represents a node in a graph. -type Node struct { - - // Array of child nodes. - Children []*Node `json:"children,omitempty"` - - // A string that uniquely identifies the node within its graph. - Id string `json:"id"` - - // A short description of the node. - Label *Message `json:"label,omitempty"` - - // A code location associated with the node. - Location *Location `json:"location,omitempty"` - - // Key/value pairs that provide additional information about the node. - Properties *PropertyBag `json:"properties,omitempty"` -} - -// Notification Describes a condition relevant to the tool itself, as opposed to being relevant to a target being analyzed by the tool. -type Notification struct { - - // A reference used to locate the rule descriptor associated with this notification. - AssociatedRule *ReportingDescriptorReference `json:"associatedRule,omitempty"` - - // A reference used to locate the descriptor relevant to this notification. - Descriptor *ReportingDescriptorReference `json:"descriptor,omitempty"` - - // The runtime exception, if any, relevant to this notification. - Exception *Exception `json:"exception,omitempty"` - - // A value specifying the severity level of the notification. - Level interface{} `json:"level,omitempty"` - - // The locations relevant to this notification. - Locations []*Location `json:"locations,omitempty"` - - // A message that describes the condition that was encountered. - Message *Message `json:"message"` - - // Key/value pairs that provide additional information about the notification. - Properties *PropertyBag `json:"properties,omitempty"` - - // The thread identifier of the code that generated the notification. - ThreadId int `json:"threadId,omitempty"` - - // The Coordinated Universal Time (UTC) date and time at which the analysis tool generated the notification. - TimeUtc string `json:"timeUtc,omitempty"` -} - -// PhysicalLocation A physical location relevant to a result. Specifies a reference to a programming artifact together with a range of bytes or characters within that artifact. -type PhysicalLocation struct { - - // The address of the location. - Address *Address `json:"address,omitempty"` - - // The location of the artifact. - ArtifactLocation *ArtifactLocation `json:"artifactLocation,omitempty"` - - // Specifies a portion of the artifact that encloses the region. Allows a viewer to display additional context around the region. - ContextRegion *Region `json:"contextRegion,omitempty"` - - // Key/value pairs that provide additional information about the physical location. - Properties *PropertyBag `json:"properties,omitempty"` - - // Specifies a portion of the artifact. - Region *Region `json:"region,omitempty"` -} - -type PropertyBag map[string]interface{} - -/* -// PropertyBag Key/value pairs that provide additional information about the object. -type PropertyBag struct { - AdditionalProperties map[string]interface{} `json:"-,omitempty"` - - // A set of distinct strings that provide additional information. - Tags []string `json:"tags,omitempty"` -} -*/ -// Rectangle An area within an image. -type Rectangle struct { - - // The Y coordinate of the bottom edge of the rectangle, measured in the image's natural units. - Bottom float64 `json:"bottom,omitempty"` - - // The X coordinate of the left edge of the rectangle, measured in the image's natural units. - Left float64 `json:"left,omitempty"` - - // A message relevant to the rectangle. - Message *Message `json:"message,omitempty"` - - // Key/value pairs that provide additional information about the rectangle. - Properties *PropertyBag `json:"properties,omitempty"` - - // The X coordinate of the right edge of the rectangle, measured in the image's natural units. - Right float64 `json:"right,omitempty"` - - // The Y coordinate of the top edge of the rectangle, measured in the image's natural units. - Top float64 `json:"top,omitempty"` -} - -// Region A region within an artifact where a result was detected. -type Region struct { - - // The length of the region in bytes. - ByteLength int `json:"byteLength,omitempty"` - - // The zero-based offset from the beginning of the artifact of the first byte in the region. - ByteOffset int `json:"byteOffset,omitempty"` - - // The length of the region in characters. - CharLength int `json:"charLength,omitempty"` - - // The zero-based offset from the beginning of the artifact of the first character in the region. - CharOffset int `json:"charOffset,omitempty"` - - // The column number of the character following the end of the region. - EndColumn int `json:"endColumn,omitempty"` - - // The line number of the last character in the region. - EndLine int `json:"endLine,omitempty"` - - // A message relevant to the region. - Message *Message `json:"message,omitempty"` - - // Key/value pairs that provide additional information about the region. - Properties *PropertyBag `json:"properties,omitempty"` - - // The portion of the artifact contents within the specified region. - Snippet *ArtifactContent `json:"snippet,omitempty"` - - // Specifies the source language, if any, of the portion of the artifact specified by the region object. - SourceLanguage string `json:"sourceLanguage,omitempty"` - - // The column number of the first character in the region. - StartColumn int `json:"startColumn,omitempty"` - - // The line number of the first character in the region. - StartLine int `json:"startLine,omitempty"` -} - -// Replacement The replacement of a single region of an artifact. -type Replacement struct { - - // The region of the artifact to delete. - DeletedRegion *Region `json:"deletedRegion"` - - // The content to insert at the location specified by the 'deletedRegion' property. - InsertedContent *ArtifactContent `json:"insertedContent,omitempty"` - - // Key/value pairs that provide additional information about the replacement. - Properties *PropertyBag `json:"properties,omitempty"` -} - -// ReportingConfiguration Information about a rule or notification that can be configured at runtime. -type ReportingConfiguration struct { - - // Specifies whether the report may be produced during the scan. - Enabled bool `json:"enabled,omitempty"` - - // Specifies the failure level for the report. - Level interface{} `json:"level,omitempty"` - - // Contains configuration information specific to a report. - Parameters *PropertyBag `json:"parameters,omitempty"` - - // Key/value pairs that provide additional information about the reporting configuration. - Properties *PropertyBag `json:"properties,omitempty"` - - // Specifies the relative priority of the report. Used for analysis output only. - Rank float64 `json:"rank,omitempty"` -} - -// ReportingDescriptor Metadata that describes a specific report produced by the tool, as part of the analysis it provides or its runtime reporting. -type ReportingDescriptor struct { - - // Default reporting configuration information. - DefaultConfiguration *ReportingConfiguration `json:"defaultConfiguration,omitempty"` - - // An array of unique identifies in the form of a GUID by which this report was known in some previous version of the analysis tool. - DeprecatedGuids []string `json:"deprecatedGuids,omitempty"` - - // An array of stable, opaque identifiers by which this report was known in some previous version of the analysis tool. - DeprecatedIds []string `json:"deprecatedIds,omitempty"` - - // An array of readable identifiers by which this report was known in some previous version of the analysis tool. - DeprecatedNames []string `json:"deprecatedNames,omitempty"` - - // A description of the report. Should, as far as possible, provide details sufficient to enable resolution of any problem indicated by the result. - FullDescription *MultiformatMessageString `json:"fullDescription,omitempty"` - - // A unique identifer for the reporting descriptor in the form of a GUID. - Guid string `json:"guid,omitempty"` - - // Provides the primary documentation for the report, useful when there is no online documentation. - Help *MultiformatMessageString `json:"help,omitempty"` - - // A URI where the primary documentation for the report can be found. - HelpUri string `json:"helpUri,omitempty"` - - // A stable, opaque identifier for the report. - Id string `json:"id"` - - // A set of name/value pairs with arbitrary names. Each value is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in combination with an arbitrary number of additional string arguments. - MessageStrings map[string]*MultiformatMessageString `json:"messageStrings,omitempty"` - - // A report identifier that is understandable to an end user. - Name string `json:"name,omitempty"` - - // Key/value pairs that provide additional information about the report. - Properties *PropertyBag `json:"properties,omitempty"` - - // An array of objects that describe relationships between this reporting descriptor and others. - Relationships []*ReportingDescriptorRelationship `json:"relationships,omitempty"` - - // A concise description of the report. Should be a single sentence that is understandable when visible space is limited to a single line of text. - ShortDescription *MultiformatMessageString `json:"shortDescription,omitempty"` -} - -// ReportingDescriptorReference Information about how to locate a relevant reporting descriptor. -type ReportingDescriptorReference struct { - - // A guid that uniquely identifies the descriptor. - Guid string `json:"guid,omitempty"` - - // The id of the descriptor. - Id string `json:"id,omitempty"` - - // The index into an array of descriptors in toolComponent.ruleDescriptors, toolComponent.notificationDescriptors, or toolComponent.taxonomyDescriptors, depending on context. - Index int `json:"index,omitempty"` - - // Key/value pairs that provide additional information about the reporting descriptor reference. - Properties *PropertyBag `json:"properties,omitempty"` - - // A reference used to locate the toolComponent associated with the descriptor. - ToolComponent *ToolComponentReference `json:"toolComponent,omitempty"` -} - -// ReportingDescriptorRelationship Information about the relation of one reporting descriptor to another. -type ReportingDescriptorRelationship struct { - - // A description of the reporting descriptor relationship. - Description *Message `json:"description,omitempty"` - - // A set of distinct strings that categorize the relationship. Well-known kinds include 'canPrecede', 'canFollow', 'willPrecede', 'willFollow', 'superset', 'subset', 'equal', 'disjoint', 'relevant', and 'incomparable'. - Kinds []string `json:"kinds,omitempty"` - - // Key/value pairs that provide additional information about the reporting descriptor reference. - Properties *PropertyBag `json:"properties,omitempty"` - - // A reference to the related reporting descriptor. - Target *ReportingDescriptorReference `json:"target"` -} - -// Result A result produced by an analysis tool. -type Result struct { - - // Identifies the artifact that the analysis tool was instructed to scan. This need not be the same as the artifact where the result actually occurred. - AnalysisTarget *ArtifactLocation `json:"analysisTarget,omitempty"` - - // A set of artifacts relevant to the result. - Attachments []*Attachment `json:"attachments,omitempty"` - - // The state of a result relative to a baseline of a previous run. - BaselineState interface{} `json:"baselineState,omitempty"` - - // An array of 'codeFlow' objects relevant to the result. - CodeFlows []*CodeFlow `json:"codeFlows,omitempty"` - - // A stable, unique identifier for the equivalence class of logically identical results to which this result belongs, in the form of a GUID. - CorrelationGuid string `json:"correlationGuid,omitempty"` - - // A set of strings each of which individually defines a stable, unique identity for the result. - Fingerprints map[string]string `json:"fingerprints,omitempty"` - - // An array of 'fix' objects, each of which represents a proposed fix to the problem indicated by the result. - Fixes []*Fix `json:"fixes,omitempty"` - - // An array of one or more unique 'graphTraversal' objects. - GraphTraversals []*GraphTraversal `json:"graphTraversals,omitempty"` - - // An array of zero or more unique graph objects associated with the result. - Graphs []*Graph `json:"graphs,omitempty"` - - // A stable, unique identifer for the result in the form of a GUID. - Guid string `json:"guid,omitempty"` - - // An absolute URI at which the result can be viewed. - HostedViewerUri string `json:"hostedViewerUri,omitempty"` - - // A value that categorizes results by evaluation state. - Kind ResultKind `json:"kind,omitempty"` - - // A value specifying the severity level of the result. - Level ResultLevel `json:"level,omitempty"` - - // The set of locations where the result was detected. Specify only one location unless the problem indicated by the result can only be corrected by making a change at every specified location. - Locations []*Location `json:"locations,omitempty"` - - // A message that describes the result. The first sentence of the message only will be displayed when visible space is limited. - Message *Message `json:"message"` - - // A positive integer specifying the number of times this logically unique result was observed in this run. - OccurrenceCount int `json:"occurrenceCount,omitempty"` - - // A set of strings that contribute to the stable, unique identity of the result. - PartialFingerprints map[string]string `json:"partialFingerprints,omitempty"` - - // Key/value pairs that provide additional information about the result. - Properties *PropertyBag `json:"properties,omitempty"` - - // Information about how and when the result was detected. - Provenance *ResultProvenance `json:"provenance,omitempty"` - - // A number representing the priority or importance of the result. - Rank float64 `json:"rank,omitempty"` - - // A set of locations relevant to this result. - RelatedLocations []*Location `json:"relatedLocations,omitempty"` - - // A reference used to locate the rule descriptor relevant to this result. - Rule *ReportingDescriptorReference `json:"rule,omitempty"` - - // The stable, unique identifier of the rule, if any, to which this result is relevant. - RuleId string `json:"ruleId,omitempty"` - - // The index within the tool component rules array of the rule object associated with this result. - RuleIndex int `json:"ruleIndex,omitempty"` - - // An array of 'stack' objects relevant to the result. - Stacks []*Stack `json:"stacks,omitempty"` - - // A set of suppressions relevant to this result. - Suppressions []*Suppression `json:"suppressions,omitempty"` - - // An array of references to taxonomy reporting descriptors that are applicable to the result. - Taxa []*ReportingDescriptorReference `json:"taxa,omitempty"` - - // A web request associated with this result. - WebRequest *WebRequest `json:"webRequest,omitempty"` - - // A web response associated with this result. - WebResponse *WebResponse `json:"webResponse,omitempty"` - - // The URIs of the work items associated with this result. - WorkItemUris []string `json:"workItemUris,omitempty"` -} - -// ResultProvenance Contains information about how and when a result was detected. -type ResultProvenance struct { - - // An array of physicalLocation objects which specify the portions of an analysis tool's output that a converter transformed into the result. - ConversionSources []*PhysicalLocation `json:"conversionSources,omitempty"` - - // A GUID-valued string equal to the automationDetails.guid property of the run in which the result was first detected. - FirstDetectionRunGuid string `json:"firstDetectionRunGuid,omitempty"` - - // The Coordinated Universal Time (UTC) date and time at which the result was first detected. See "Date/time properties" in the SARIF spec for the required format. - FirstDetectionTimeUtc string `json:"firstDetectionTimeUtc,omitempty"` - - // The index within the run.invocations array of the invocation object which describes the tool invocation that detected the result. - InvocationIndex int `json:"invocationIndex,omitempty"` - - // A GUID-valued string equal to the automationDetails.guid property of the run in which the result was most recently detected. - LastDetectionRunGuid string `json:"lastDetectionRunGuid,omitempty"` - - // The Coordinated Universal Time (UTC) date and time at which the result was most recently detected. See "Date/time properties" in the SARIF spec for the required format. - LastDetectionTimeUtc string `json:"lastDetectionTimeUtc,omitempty"` - - // Key/value pairs that provide additional information about the result. - Properties *PropertyBag `json:"properties,omitempty"` -} - -// Run Describes a single run of an analysis tool, and contains the reported output of that run. -type Run struct { - - // Addresses associated with this run instance, if any. - Addresses []*Address `json:"addresses,omitempty"` - - // An array of artifact objects relevant to the run. - Artifacts []*Artifact `json:"artifacts,omitempty"` - - // Automation details that describe this run. - AutomationDetails *RunAutomationDetails `json:"automationDetails,omitempty"` - - // The 'guid' property of a previous SARIF 'run' that comprises the baseline that was used to compute result 'baselineState' properties for the run. - BaselineGuid string `json:"baselineGuid,omitempty"` - - // Specifies the unit in which the tool measures columns. - ColumnKind interface{} `json:"columnKind,omitempty"` - - // A conversion object that describes how a converter transformed an analysis tool's native reporting format into the SARIF format. - Conversion *Conversion `json:"conversion,omitempty"` - - // Specifies the default encoding for any artifact object that refers to a text file. - DefaultEncoding string `json:"defaultEncoding,omitempty"` - - // Specifies the default source language for any artifact object that refers to a text file that contains source code. - DefaultSourceLanguage string `json:"defaultSourceLanguage,omitempty"` - - // References to external property files that should be inlined with the content of a root log file. - ExternalPropertyFileReferences *ExternalPropertyFileReferences `json:"externalPropertyFileReferences,omitempty"` - - // An array of zero or more unique graph objects associated with the run. - Graphs []*Graph `json:"graphs,omitempty"` - - // Describes the invocation of the analysis tool. - Invocations []*Invocation `json:"invocations,omitempty"` - - // The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase culture code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to RFC5646). - Language string `json:"language,omitempty"` - - // An array of logical locations such as namespaces, types or functions. - LogicalLocations []*LogicalLocation `json:"logicalLocations,omitempty"` - - // An ordered list of character sequences that were treated as line breaks when computing region information for the run. - NewlineSequences []string `json:"newlineSequences,omitempty"` - - // The artifact location specified by each uriBaseId symbol on the machine where the tool originally ran. - OriginalUriBaseIds map[string]*ArtifactLocation `json:"originalUriBaseIds,omitempty"` - - // Contains configurations that may potentially override both reportingDescriptor.defaultConfiguration (the tool's default severities) and invocation.configurationOverrides (severities established at run-time from the command line). - Policies []*ToolComponent `json:"policies,omitempty"` - - // Key/value pairs that provide additional information about the run. - Properties *PropertyBag `json:"properties,omitempty"` - - // An array of strings used to replace sensitive information in a redaction-aware property. - RedactionTokens []string `json:"redactionTokens,omitempty"` - - // The set of results contained in an SARIF log. The results array can be omitted when a run is solely exporting rules metadata. It must be present (but may be empty) if a log file represents an actual scan. - Results []*Result `json:"results,omitempty"` - - // Automation details that describe the aggregate of runs to which this run belongs. - RunAggregates []*RunAutomationDetails `json:"runAggregates,omitempty"` - - // A specialLocations object that defines locations of special significance to SARIF consumers. - SpecialLocations *SpecialLocations `json:"specialLocations,omitempty"` - - // An array of toolComponent objects relevant to a taxonomy in which results are categorized. - Taxonomies []*ToolComponent `json:"taxonomies,omitempty"` - - // An array of threadFlowLocation objects cached at run level. - ThreadFlowLocations []*ThreadFlowLocation `json:"threadFlowLocations,omitempty"` - - // Information about the tool or tool pipeline that generated the results in this run. A run can only contain results produced by a single tool or tool pipeline. A run can aggregate results from multiple log files, as long as context around the tool run (tool command-line arguments and the like) is identical for all aggregated files. - Tool *Tool `json:"tool"` - - // The set of available translations of the localized data provided by the tool. - Translations []*ToolComponent `json:"translations,omitempty"` - - // Specifies the revision in version control of the artifacts that were scanned. - VersionControlProvenance []*VersionControlDetails `json:"versionControlProvenance,omitempty"` - - // An array of request objects cached at run level. - WebRequests []*WebRequest `json:"webRequests,omitempty"` - - // An array of response objects cached at run level. - WebResponses []*WebResponse `json:"webResponses,omitempty"` -} - -// RunAutomationDetails Information that describes a run's identity and role within an engineering system process. -type RunAutomationDetails struct { - - // A stable, unique identifier for the equivalence class of runs to which this object's containing run object belongs in the form of a GUID. - CorrelationGuid string `json:"correlationGuid,omitempty"` - - // A description of the identity and role played within the engineering system by this object's containing run object. - Description *Message `json:"description,omitempty"` - - // A stable, unique identifer for this object's containing run object in the form of a GUID. - Guid string `json:"guid,omitempty"` - - // A hierarchical string that uniquely identifies this object's containing run object. - Id string `json:"id,omitempty"` - - // Key/value pairs that provide additional information about the run automation details. - Properties *PropertyBag `json:"properties,omitempty"` -} - -// SpecialLocations Defines locations of special significance to SARIF consumers. -type SpecialLocations struct { - - // Provides a suggestion to SARIF consumers to display file paths relative to the specified location. - DisplayBase *ArtifactLocation `json:"displayBase,omitempty"` - - // Key/value pairs that provide additional information about the special locations. - Properties *PropertyBag `json:"properties,omitempty"` -} - -// Stack A call stack that is relevant to a result. -type Stack struct { - - // An array of stack frames that represents a sequence of calls, rendered in reverse chronological order, that comprise the call stack. - Frames []*StackFrame `json:"frames"` - - // A message relevant to this call stack. - Message *Message `json:"message,omitempty"` - - // Key/value pairs that provide additional information about the stack. - Properties *PropertyBag `json:"properties,omitempty"` -} - -// StackFrame A function call within a stack trace. -type StackFrame struct { - - // The location to which this stack frame refers. - Location *Location `json:"location,omitempty"` - - // The name of the module that contains the code of this stack frame. - Module string `json:"module,omitempty"` - - // The parameters of the call that is executing. - Parameters []string `json:"parameters,omitempty"` - - // Key/value pairs that provide additional information about the stack frame. - Properties *PropertyBag `json:"properties,omitempty"` - - // The thread identifier of the stack frame. - ThreadId int `json:"threadId,omitempty"` -} - -// Suppression A suppression that is relevant to a result. -type Suppression struct { - - // A stable, unique identifer for the supression in the form of a GUID. - Guid string `json:"guid,omitempty"` - - // A string representing the justification for the suppression. - Justification string `json:"justification,omitempty"` - - // A string that indicates where the suppression is persisted. - Kind string `json:"kind"` - - // Identifies the location associated with the suppression. - Location *Location `json:"location,omitempty"` - - // Key/value pairs that provide additional information about the suppression. - Properties *PropertyBag `json:"properties,omitempty"` - - // A string that indicates the review status of the suppression. - Status interface{} `json:"status,omitempty"` -} - -// ThreadFlow Describes a sequence of code locations that specify a path through a single thread of execution such as an operating system or fiber. -type ThreadFlow struct { - - // An string that uniquely identifies the threadFlow within the codeFlow in which it occurs. - Id string `json:"id,omitempty"` - - // Values of relevant expressions at the start of the thread flow that remain constant. - ImmutableState map[string]*MultiformatMessageString `json:"immutableState,omitempty"` - - // Values of relevant expressions at the start of the thread flow that may change during thread flow execution. - InitialState map[string]*MultiformatMessageString `json:"initialState,omitempty"` - - // A temporally ordered array of 'threadFlowLocation' objects, each of which describes a location visited by the tool while producing the result. - Locations []*ThreadFlowLocation `json:"locations"` - - // A message relevant to the thread flow. - Message *Message `json:"message,omitempty"` - - // Key/value pairs that provide additional information about the thread flow. - Properties *PropertyBag `json:"properties,omitempty"` -} - -// ThreadFlowLocation A location visited by an analysis tool while simulating or monitoring the execution of a program. -type ThreadFlowLocation struct { - - // An integer representing the temporal order in which execution reached this location. - ExecutionOrder int `json:"executionOrder,omitempty"` - - // The Coordinated Universal Time (UTC) date and time at which this location was executed. - ExecutionTimeUtc string `json:"executionTimeUtc,omitempty"` - - // Specifies the importance of this location in understanding the code flow in which it occurs. The order from most to least important is "essential", "important", "unimportant". Default: "important". - Importance interface{} `json:"importance,omitempty"` - - // The index within the run threadFlowLocations array. - Index int `json:"index,omitempty"` - - // A set of distinct strings that categorize the thread flow location. Well-known kinds include 'acquire', 'release', 'enter', 'exit', 'call', 'return', 'branch', 'implicit', 'false', 'true', 'caution', 'danger', 'unknown', 'unreachable', 'taint', 'function', 'handler', 'lock', 'memory', 'resource', 'scope' and 'value'. - Kinds []string `json:"kinds,omitempty"` - - // The code location. - Location *Location `json:"location,omitempty"` - - // The name of the module that contains the code that is executing. - Module string `json:"module,omitempty"` - - // An integer representing a containment hierarchy within the thread flow. - NestingLevel int `json:"nestingLevel,omitempty"` - - // Key/value pairs that provide additional information about the threadflow location. - Properties *PropertyBag `json:"properties,omitempty"` - - // The call stack leading to this location. - Stack *Stack `json:"stack,omitempty"` - - // A dictionary, each of whose keys specifies a variable or expression, the associated value of which represents the variable or expression value. For an annotation of kind 'continuation', for example, this dictionary might hold the current assumed values of a set of global variables. - State map[string]*MultiformatMessageString `json:"state,omitempty"` - - // An array of references to rule or taxonomy reporting descriptors that are applicable to the thread flow location. - Taxa []*ReportingDescriptorReference `json:"taxa,omitempty"` - - // A web request associated with this thread flow location. - WebRequest *WebRequest `json:"webRequest,omitempty"` - - // A web response associated with this thread flow location. - WebResponse *WebResponse `json:"webResponse,omitempty"` -} - -// Tool The analysis tool that was run. -type Tool struct { - - // The analysis tool that was run. - Driver *ToolComponent `json:"driver"` - - // Tool extensions that contributed to or reconfigured the analysis tool that was run. - Extensions []*ToolComponent `json:"extensions,omitempty"` - - // Key/value pairs that provide additional information about the tool. - Properties *PropertyBag `json:"properties,omitempty"` -} - -// ToolComponent A component, such as a plug-in or the driver, of the analysis tool that was run. -type ToolComponent struct { - - // The component which is strongly associated with this component. For a translation, this refers to the component which has been translated. For an extension, this is the driver that provides the extension's plugin model. - AssociatedComponent *ToolComponentReference `json:"associatedComponent,omitempty"` - - // The kinds of data contained in this object. - Contents []interface{} `json:"contents,omitempty"` - - // The binary version of the tool component's primary executable file expressed as four non-negative integers separated by a period (for operating systems that express file versions in this way). - DottedQuadFileVersion string `json:"dottedQuadFileVersion,omitempty"` - - // The absolute URI from which the tool component can be downloaded. - DownloadUri string `json:"downloadUri,omitempty"` - - // A comprehensive description of the tool component. - FullDescription *MultiformatMessageString `json:"fullDescription,omitempty"` - - // The name of the tool component along with its version and any other useful identifying information, such as its locale. - FullName string `json:"fullName,omitempty"` - - // A dictionary, each of whose keys is a resource identifier and each of whose values is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in combination with an arbitrary number of additional string arguments. - GlobalMessageStrings map[string]*MultiformatMessageString `json:"globalMessageStrings,omitempty"` - - // A unique identifer for the tool component in the form of a GUID. - Guid string `json:"guid,omitempty"` - - // The absolute URI at which information about this version of the tool component can be found. - InformationUri string `json:"informationUri,omitempty"` - - // Specifies whether this object contains a complete definition of the localizable and/or non-localizable data for this component, as opposed to including only data that is relevant to the results persisted to this log file. - IsComprehensive bool `json:"isComprehensive,omitempty"` - - // The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase language code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to RFC5646). - Language string `json:"language,omitempty"` - - // The semantic version of the localized strings defined in this component; maintained by components that provide translations. - LocalizedDataSemanticVersion string `json:"localizedDataSemanticVersion,omitempty"` - - // An array of the artifactLocation objects associated with the tool component. - Locations []*ArtifactLocation `json:"locations,omitempty"` - - // The minimum value of localizedDataSemanticVersion required in translations consumed by this component; used by components that consume translations. - MinimumRequiredLocalizedDataSemanticVersion string `json:"minimumRequiredLocalizedDataSemanticVersion,omitempty"` - - // The name of the tool component. - Name string `json:"name"` - - // An array of reportingDescriptor objects relevant to the notifications related to the configuration and runtime execution of the tool component. - Notifications []*ReportingDescriptor `json:"notifications,omitempty"` - - // The organization or company that produced the tool component. - Organization string `json:"organization,omitempty"` - - // A product suite to which the tool component belongs. - Product string `json:"product,omitempty"` - - // A localizable string containing the name of the suite of products to which the tool component belongs. - ProductSuite string `json:"productSuite,omitempty"` - - // Key/value pairs that provide additional information about the tool component. - Properties *PropertyBag `json:"properties,omitempty"` - - // A string specifying the UTC date (and optionally, the time) of the component's release. - ReleaseDateUtc string `json:"releaseDateUtc,omitempty"` - - // An array of reportingDescriptor objects relevant to the analysis performed by the tool component. - Rules []*ReportingDescriptor `json:"rules,omitempty"` - - // The tool component version in the format specified by Semantic Versioning 2.0. - SemanticVersion string `json:"semanticVersion,omitempty"` - - // A brief description of the tool component. - ShortDescription *MultiformatMessageString `json:"shortDescription,omitempty"` - - // An array of toolComponentReference objects to declare the taxonomies supported by the tool component. - SupportedTaxonomies []*ToolComponentReference `json:"supportedTaxonomies,omitempty"` - - // An array of reportingDescriptor objects relevant to the definitions of both standalone and tool-defined taxonomies. - Taxa []*ReportingDescriptor `json:"taxa,omitempty"` - - // Translation metadata, required for a translation, not populated by other component types. - TranslationMetadata *TranslationMetadata `json:"translationMetadata,omitempty"` - - // The tool component version, in whatever format the component natively provides. - Version string `json:"version,omitempty"` -} - -// ToolComponentReference Identifies a particular toolComponent object, either the driver or an extension. -type ToolComponentReference struct { - - // The 'guid' property of the referenced toolComponent. - Guid string `json:"guid,omitempty"` - - // An index into the referenced toolComponent in tool.extensions. - Index int `json:"index,omitempty"` - - // The 'name' property of the referenced toolComponent. - Name string `json:"name,omitempty"` - - // Key/value pairs that provide additional information about the toolComponentReference. - Properties *PropertyBag `json:"properties,omitempty"` -} - -// TranslationMetadata Provides additional metadata related to translation. -type TranslationMetadata struct { - - // The absolute URI from which the translation metadata can be downloaded. - DownloadUri string `json:"downloadUri,omitempty"` - - // A comprehensive description of the translation metadata. - FullDescription *MultiformatMessageString `json:"fullDescription,omitempty"` - - // The full name associated with the translation metadata. - FullName string `json:"fullName,omitempty"` - - // The absolute URI from which information related to the translation metadata can be downloaded. - InformationUri string `json:"informationUri,omitempty"` - - // The name associated with the translation metadata. - Name string `json:"name"` - - // Key/value pairs that provide additional information about the translation metadata. - Properties *PropertyBag `json:"properties,omitempty"` - - // A brief description of the translation metadata. - ShortDescription *MultiformatMessageString `json:"shortDescription,omitempty"` -} - -// VersionControlDetails Specifies the information necessary to retrieve a desired revision from a version control system. -type VersionControlDetails struct { - - // A Coordinated Universal Time (UTC) date and time that can be used to synchronize an enlistment to the state of the repository at that time. - AsOfTimeUtc string `json:"asOfTimeUtc,omitempty"` - - // The name of a branch containing the revision. - Branch string `json:"branch,omitempty"` - - // The location in the local file system to which the root of the repository was mapped at the time of the analysis. - MappedTo *ArtifactLocation `json:"mappedTo,omitempty"` - - // Key/value pairs that provide additional information about the version control details. - Properties *PropertyBag `json:"properties,omitempty"` - - // The absolute URI of the repository. - RepositoryUri string `json:"repositoryUri"` - - // A string that uniquely and permanently identifies the revision within the repository. - RevisionId string `json:"revisionId,omitempty"` - - // A tag that has been applied to the revision. - RevisionTag string `json:"revisionTag,omitempty"` -} - -// WebRequest Describes an HTTP request. -type WebRequest struct { - - // The body of the request. - Body *ArtifactContent `json:"body,omitempty"` - - // The request headers. - Headers map[string]string `json:"headers,omitempty"` - - // The index within the run.webRequests array of the request object associated with this result. - Index int `json:"index,omitempty"` - - // The HTTP method. Well-known values are 'GET', 'PUT', 'POST', 'DELETE', 'PATCH', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT'. - Method string `json:"method,omitempty"` - - // The request parameters. - Parameters map[string]string `json:"parameters,omitempty"` - - // Key/value pairs that provide additional information about the request. - Properties *PropertyBag `json:"properties,omitempty"` - - // The request protocol. Example: 'http'. - Protocol string `json:"protocol,omitempty"` - - // The target of the request. - Target string `json:"target,omitempty"` - - // The request version. Example: '1.1'. - Version string `json:"version,omitempty"` -} - -// WebResponse Describes the response to an HTTP request. -type WebResponse struct { - - // The body of the response. - Body *ArtifactContent `json:"body,omitempty"` - - // The response headers. - Headers map[string]string `json:"headers,omitempty"` - - // The index within the run.webResponses array of the response object associated with this result. - Index int `json:"index,omitempty"` - - // Specifies whether a response was received from the server. - NoResponseReceived bool `json:"noResponseReceived,omitempty"` - - // Key/value pairs that provide additional information about the response. - Properties *PropertyBag `json:"properties,omitempty"` - - // The response protocol. Example: 'http'. - Protocol string `json:"protocol,omitempty"` - - // The response reason. Example: 'Not found'. - ReasonPhrase string `json:"reasonPhrase,omitempty"` - - // The response status code. Example: 451. - StatusCode int `json:"statusCode,omitempty"` - - // The response version. Example: '1.1'. - Version string `json:"version,omitempty"` -} diff --git a/vendor/github.com/containers/storage/pkg/regexp/regexp_dontprecompile.go b/vendor/github.com/containers/storage/pkg/regexp/regexp_dontprecompile.go deleted file mode 100644 index 834dd943377..00000000000 --- a/vendor/github.com/containers/storage/pkg/regexp/regexp_dontprecompile.go +++ /dev/null @@ -1,6 +0,0 @@ -//go:build !regexp_precompile -// +build !regexp_precompile - -package regexp - -const precompile = false diff --git a/vendor/github.com/containers/storage/pkg/regexp/regexp_precompile.go b/vendor/github.com/containers/storage/pkg/regexp/regexp_precompile.go deleted file mode 100644 index a5fe0dbc49a..00000000000 --- a/vendor/github.com/containers/storage/pkg/regexp/regexp_precompile.go +++ /dev/null @@ -1,6 +0,0 @@ -//go:build regexp_precompile -// +build regexp_precompile - -package regexp - -const precompile = true diff --git a/vendor/github.com/coreos/go-systemd/v22/daemon/sdnotify_other.go b/vendor/github.com/coreos/go-systemd/v22/daemon/sdnotify_other.go new file mode 100644 index 00000000000..d6309495d4d --- /dev/null +++ b/vendor/github.com/coreos/go-systemd/v22/daemon/sdnotify_other.go @@ -0,0 +1,22 @@ +// Copyright 2025 +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build !unix + +package daemon + +// SdNotifyMonotonicUsec returns the empty string on unsupported platforms. +func SdNotifyMonotonicUsec() string { + return "" +} diff --git a/vendor/github.com/coreos/go-systemd/v22/daemon/sdnotify_unix.go b/vendor/github.com/coreos/go-systemd/v22/daemon/sdnotify_unix.go new file mode 100644 index 00000000000..bdbe6b0c281 --- /dev/null +++ b/vendor/github.com/coreos/go-systemd/v22/daemon/sdnotify_unix.go @@ -0,0 +1,36 @@ +// Copyright 2025 +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build unix + +package daemon + +import ( + "strconv" + + "golang.org/x/sys/unix" +) + +// SdNotifyMonotonicUsec returns a MONOTONIC_USEC=... assignment for the current time +// with a trailing newline included. This is typically used with [SdNotifyReloading]. +// +// If the monotonic clock is not available on the system, the empty string is returned. +func SdNotifyMonotonicUsec() string { + var ts unix.Timespec + if err := unix.ClockGettime(unix.CLOCK_MONOTONIC, &ts); err != nil { + // Monotonic clock is not available on this system. + return "" + } + return "MONOTONIC_USEC=" + strconv.FormatInt(ts.Nano()/1000, 10) + "\n" +} diff --git a/vendor/github.com/coreos/go-systemd/v22/daemon/watchdog.go b/vendor/github.com/coreos/go-systemd/v22/daemon/watchdog.go index 25d9c1aa938..a93314d0ab8 100644 --- a/vendor/github.com/coreos/go-systemd/v22/daemon/watchdog.go +++ b/vendor/github.com/coreos/go-systemd/v22/daemon/watchdog.go @@ -15,6 +15,7 @@ package daemon import ( + "errors" "fmt" "os" "strconv" @@ -51,10 +52,10 @@ func SdWatchdogEnabled(unsetEnvironment bool) (time.Duration, error) { } s, err := strconv.Atoi(wusec) if err != nil { - return 0, fmt.Errorf("error converting WATCHDOG_USEC: %s", err) + return 0, fmt.Errorf("error converting WATCHDOG_USEC: %w", err) } if s <= 0 { - return 0, fmt.Errorf("error WATCHDOG_USEC must be a positive number") + return 0, errors.New("error WATCHDOG_USEC must be a positive number") } interval := time.Duration(s) * time.Microsecond @@ -63,7 +64,7 @@ func SdWatchdogEnabled(unsetEnvironment bool) (time.Duration, error) { } p, err := strconv.Atoi(wpid) if err != nil { - return 0, fmt.Errorf("error converting WATCHDOG_PID: %s", err) + return 0, fmt.Errorf("error converting WATCHDOG_PID: %w", err) } if os.Getpid() != p { return 0, nil diff --git a/vendor/github.com/coreos/go-systemd/v22/journal/journal_unix.go b/vendor/github.com/coreos/go-systemd/v22/journal/journal_unix.go index 6266e16e573..55cb9eb26a1 100644 --- a/vendor/github.com/coreos/go-systemd/v22/journal/journal_unix.go +++ b/vendor/github.com/coreos/go-systemd/v22/journal/journal_unix.go @@ -106,7 +106,7 @@ func fdIsJournalStream(fd int) (bool, error) { var expectedStat syscall.Stat_t _, err := fmt.Sscanf(journalStream, "%d:%d", &expectedStat.Dev, &expectedStat.Ino) if err != nil { - return false, fmt.Errorf("failed to parse JOURNAL_STREAM=%q: %v", journalStream, err) + return false, fmt.Errorf("failed to parse JOURNAL_STREAM=%q: %w", journalStream, err) } var stat syscall.Stat_t diff --git a/vendor/github.com/coreos/go-systemd/v22/unit/deserialize.go b/vendor/github.com/coreos/go-systemd/v22/unit/deserialize.go index 74b9573f93f..7796e169563 100644 --- a/vendor/github.com/coreos/go-systemd/v22/unit/deserialize.go +++ b/vendor/github.com/coreos/go-systemd/v22/unit/deserialize.go @@ -54,8 +54,8 @@ func DeserializeSections(f io.Reader) ([]*UnitSection, error) { } // Deserialize parses a systemd unit file into a list of UnitOptions. -// Note: this function is deprecated in favor of DeserializeOptions -// and will be removed at a future date. +// +// Deprecated: use [DeserializeOptions] instead. func Deserialize(f io.Reader) (opts []*UnitOption, err error) { return DeserializeOptions(f) } @@ -94,8 +94,7 @@ func deserializeAll(f io.Reader) ([]*UnitSection, []*UnitOption, error) { // sanity check. "should not happen" as sectionKind is first in code flow. if len(sections) == 0 { - return nil, nil, fmt.Errorf( - "Unit file misparse: option before section") + return nil, nil, errors.New("unit file misparse: option before section") } // add to newest section entries. diff --git a/vendor/github.com/coreos/go-systemd/v22/unit/escape.go b/vendor/github.com/coreos/go-systemd/v22/unit/escape.go index 98e2044a717..df9c8cc13f8 100644 --- a/vendor/github.com/coreos/go-systemd/v22/unit/escape.go +++ b/vendor/github.com/coreos/go-systemd/v22/unit/escape.go @@ -57,7 +57,7 @@ func escape(unescaped string, isPath bool) string { if c == '/' { e = append(e, '-') } else if start && c == '.' || strings.IndexByte(allowed, c) == -1 { - e = append(e, []byte(fmt.Sprintf(`\x%x`, c))...) + e = fmt.Appendf(e, `\x%x`, c) } else { e = append(e, c) } diff --git a/vendor/github.com/emicklei/go-restful/v3/.travis.yml b/vendor/github.com/emicklei/go-restful/v3/.travis.yml deleted file mode 100644 index 3a0bf5ff1b8..00000000000 --- a/vendor/github.com/emicklei/go-restful/v3/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -language: go - -go: - - 1.x - -before_install: - - go test -v - -script: - - go test -race -coverprofile=coverage.txt -covermode=atomic - -after_success: - - bash <(curl -s https://codecov.io/bash) \ No newline at end of file diff --git a/vendor/github.com/emicklei/go-restful/v3/CHANGES.md b/vendor/github.com/emicklei/go-restful/v3/CHANGES.md index 6f24dfff562..4fcd920abea 100644 --- a/vendor/github.com/emicklei/go-restful/v3/CHANGES.md +++ b/vendor/github.com/emicklei/go-restful/v3/CHANGES.md @@ -1,5 +1,9 @@ # Change history of go-restful +## [v3.13.0] - 2025-08-14 + +- optimize performance of path matching in CurlyRouter ( thanks @wenhuang, Wen Huang) + ## [v3.12.2] - 2025-02-21 - allow empty payloads in post,put,patch, issue #580 ( thanks @liggitt, Jordan Liggitt) diff --git a/vendor/github.com/emicklei/go-restful/v3/README.md b/vendor/github.com/emicklei/go-restful/v3/README.md index 3fb40d19808..50a79ab692d 100644 --- a/vendor/github.com/emicklei/go-restful/v3/README.md +++ b/vendor/github.com/emicklei/go-restful/v3/README.md @@ -84,6 +84,7 @@ func (u UserResource) findUser(request *restful.Request, response *restful.Respo - Configurable (trace) logging - Customizable gzip/deflate readers and writers using CompressorProvider registration - Inject your own http.Handler using the `HttpMiddlewareHandlerToFilter` function +- Added `SetPathTokenCacheEnabled` and `SetCustomVerbCacheEnabled` to disable regexp caching (default=true) ## How to customize There are several hooks to customize the behavior of the go-restful package. diff --git a/vendor/github.com/emicklei/go-restful/v3/curly.go b/vendor/github.com/emicklei/go-restful/v3/curly.go index 6fd2bcd5a11..eec43bfd067 100644 --- a/vendor/github.com/emicklei/go-restful/v3/curly.go +++ b/vendor/github.com/emicklei/go-restful/v3/curly.go @@ -9,11 +9,35 @@ import ( "regexp" "sort" "strings" + "sync" ) // CurlyRouter expects Routes with paths that contain zero or more parameters in curly brackets. type CurlyRouter struct{} +var ( + regexCache sync.Map // Cache for compiled regex patterns + pathTokenCacheEnabled = true // Enable/disable path token regex caching +) + +// SetPathTokenCacheEnabled enables or disables path token regex caching for CurlyRouter. +// When disabled, regex patterns will be compiled on every request. +// When enabled (default), compiled regex patterns are cached for better performance. +func SetPathTokenCacheEnabled(enabled bool) { + pathTokenCacheEnabled = enabled +} + +// getCachedRegexp retrieves a compiled regex from the cache if found and valid. +// Returns the regex and true if found and valid, nil and false otherwise. +func getCachedRegexp(cache *sync.Map, pattern string) (*regexp.Regexp, bool) { + if cached, found := cache.Load(pattern); found { + if regex, ok := cached.(*regexp.Regexp); ok { + return regex, true + } + } + return nil, false +} + // SelectRoute is part of the Router interface and returns the best match // for the WebService and its Route for the given Request. func (c CurlyRouter) SelectRoute( @@ -113,8 +137,28 @@ func (c CurlyRouter) regularMatchesPathToken(routeToken string, colon int, reque } return true, true } - matched, err := regexp.MatchString(regPart, requestToken) - return (matched && err == nil), false + + // Check cache first (if enabled) + if pathTokenCacheEnabled { + if regex, found := getCachedRegexp(®exCache, regPart); found { + matched := regex.MatchString(requestToken) + return matched, false + } + } + + // Compile the regex + regex, err := regexp.Compile(regPart) + if err != nil { + return false, false + } + + // Cache the regex (if enabled) + if pathTokenCacheEnabled { + regexCache.Store(regPart, regex) + } + + matched := regex.MatchString(requestToken) + return matched, false } var jsr311Router = RouterJSR311{} @@ -168,7 +212,7 @@ func (c CurlyRouter) computeWebserviceScore(requestTokens []string, routeTokens if matchesToken { score++ // extra score for regex match } - } + } } else { // not a parameter if eachRequestToken != eachRouteToken { diff --git a/vendor/github.com/emicklei/go-restful/v3/custom_verb.go b/vendor/github.com/emicklei/go-restful/v3/custom_verb.go index bfc17efde80..0b98eeb091c 100644 --- a/vendor/github.com/emicklei/go-restful/v3/custom_verb.go +++ b/vendor/github.com/emicklei/go-restful/v3/custom_verb.go @@ -1,14 +1,28 @@ package restful +// Copyright 2025 Ernest Micklei. All rights reserved. +// Use of this source code is governed by a license +// that can be found in the LICENSE file. + import ( "fmt" "regexp" + "sync" ) var ( - customVerbReg = regexp.MustCompile(":([A-Za-z]+)$") + customVerbReg = regexp.MustCompile(":([A-Za-z]+)$") + customVerbCache sync.Map // Cache for compiled custom verb regexes + customVerbCacheEnabled = true // Enable/disable custom verb regex caching ) +// SetCustomVerbCacheEnabled enables or disables custom verb regex caching. +// When disabled, custom verb regex patterns will be compiled on every request. +// When enabled (default), compiled custom verb regex patterns are cached for better performance. +func SetCustomVerbCacheEnabled(enabled bool) { + customVerbCacheEnabled = enabled +} + func hasCustomVerb(routeToken string) bool { return customVerbReg.MatchString(routeToken) } @@ -20,7 +34,23 @@ func isMatchCustomVerb(routeToken string, pathToken string) bool { } customVerb := rs[1] - specificVerbReg := regexp.MustCompile(fmt.Sprintf(":%s$", customVerb)) + regexPattern := fmt.Sprintf(":%s$", customVerb) + + // Check cache first (if enabled) + if customVerbCacheEnabled { + if specificVerbReg, found := getCachedRegexp(&customVerbCache, regexPattern); found { + return specificVerbReg.MatchString(pathToken) + } + } + + // Compile the regex + specificVerbReg := regexp.MustCompile(regexPattern) + + // Cache the regex (if enabled) + if customVerbCacheEnabled { + customVerbCache.Store(regexPattern, specificVerbReg) + } + return specificVerbReg.MatchString(pathToken) } diff --git a/vendor/github.com/emicklei/go-restful/v3/doc.go b/vendor/github.com/emicklei/go-restful/v3/doc.go index 69b13057d01..80809225b8d 100644 --- a/vendor/github.com/emicklei/go-restful/v3/doc.go +++ b/vendor/github.com/emicklei/go-restful/v3/doc.go @@ -1,7 +1,7 @@ /* Package restful , a lean package for creating REST-style WebServices without magic. -WebServices and Routes +### WebServices and Routes A WebService has a collection of Route objects that dispatch incoming Http Requests to a function calls. Typically, a WebService has a root path (e.g. /users) and defines common MIME types for its routes. @@ -30,14 +30,14 @@ The (*Request, *Response) arguments provide functions for reading information fr See the example https://github.com/emicklei/go-restful/blob/v3/examples/user-resource/restful-user-resource.go with a full implementation. -Regular expression matching Routes +### Regular expression matching Routes A Route parameter can be specified using the format "uri/{var[:regexp]}" or the special version "uri/{var:*}" for matching the tail of the path. For example, /persons/{name:[A-Z][A-Z]} can be used to restrict values for the parameter "name" to only contain capital alphabetic characters. Regular expressions must use the standard Go syntax as described in the regexp package. (https://code.google.com/p/re2/wiki/Syntax) This feature requires the use of a CurlyRouter. -Containers +### Containers A Container holds a collection of WebServices, Filters and a http.ServeMux for multiplexing http requests. Using the statements "restful.Add(...) and restful.Filter(...)" will register WebServices and Filters to the Default Container. @@ -47,7 +47,7 @@ You can create your own Container and create a new http.Server for that particul container := restful.NewContainer() server := &http.Server{Addr: ":8081", Handler: container} -Filters +### Filters A filter dynamically intercepts requests and responses to transform or use the information contained in the requests or responses. You can use filters to perform generic logging, measurement, authentication, redirect, set response headers etc. @@ -60,22 +60,21 @@ Use the following statement to pass the request,response pair to the next filter chain.ProcessFilter(req, resp) -Container Filters +### Container Filters These are processed before any registered WebService. // install a (global) filter for the default container (processed before any webservice) restful.Filter(globalLogging) -WebService Filters +### WebService Filters These are processed before any Route of a WebService. // install a webservice filter (processed before any route) ws.Filter(webserviceLogging).Filter(measureTime) - -Route Filters +### Route Filters These are processed before calling the function associated with the Route. @@ -84,7 +83,7 @@ These are processed before calling the function associated with the Route. See the example https://github.com/emicklei/go-restful/blob/v3/examples/filters/restful-filters.go with full implementations. -Response Encoding +### Response Encoding Two encodings are supported: gzip and deflate. To enable this for all responses: @@ -95,20 +94,20 @@ Alternatively, you can create a Filter that performs the encoding and install it See the example https://github.com/emicklei/go-restful/blob/v3/examples/encoding/restful-encoding-filter.go -OPTIONS support +### OPTIONS support By installing a pre-defined container filter, your Webservice(s) can respond to the OPTIONS Http request. Filter(OPTIONSFilter()) -CORS +### CORS By installing the filter of a CrossOriginResourceSharing (CORS), your WebService(s) can handle CORS requests. cors := CrossOriginResourceSharing{ExposeHeaders: []string{"X-My-Header"}, CookiesAllowed: false, Container: DefaultContainer} Filter(cors.Filter) -Error Handling +### Error Handling Unexpected things happen. If a request cannot be processed because of a failure, your service needs to tell via the response what happened and why. For this reason HTTP status codes exist and it is important to use the correct code in every exceptional situation. @@ -137,11 +136,11 @@ The request does not have or has an unknown Accept Header set for this operation The request does not have or has an unknown Content-Type Header set for this operation. -ServiceError +### ServiceError In addition to setting the correct (error) Http status code, you can choose to write a ServiceError message on the response. -Performance options +### Performance options This package has several options that affect the performance of your service. It is important to understand them and how you can change it. @@ -156,30 +155,27 @@ Default value is true If content encoding is enabled then the default strategy for getting new gzip/zlib writers and readers is to use a sync.Pool. Because writers are expensive structures, performance is even more improved when using a preloaded cache. You can also inject your own implementation. -Trouble shooting +### Trouble shooting This package has the means to produce detail logging of the complete Http request matching process and filter invocation. Enabling this feature requires you to set an implementation of restful.StdLogger (e.g. log.Logger) instance such as: restful.TraceLogger(log.New(os.Stdout, "[restful] ", log.LstdFlags|log.Lshortfile)) -Logging +### Logging The restful.SetLogger() method allows you to override the logger used by the package. By default restful uses the standard library `log` package and logs to stdout. Different logging packages are supported as long as they conform to `StdLogger` interface defined in the `log` sub-package, writing an adapter for your preferred package is simple. -Resources +### Resources -[project]: https://github.com/emicklei/go-restful +(c) 2012-2025, http://ernestmicklei.com. MIT License +[project]: https://github.com/emicklei/go-restful [examples]: https://github.com/emicklei/go-restful/blob/master/examples - -[design]: http://ernestmicklei.com/2012/11/11/go-restful-api-design/ - +[design]: http://ernestmicklei.com/2012/11/11/go-restful-api-design/ [showcases]: https://github.com/emicklei/mora, https://github.com/emicklei/landskape - -(c) 2012-2015, http://ernestmicklei.com. MIT License */ package restful diff --git a/vendor/github.com/fatih/color/color.go b/vendor/github.com/fatih/color/color.go index ee39b408e95..d3906bfbd5a 100644 --- a/vendor/github.com/fatih/color/color.go +++ b/vendor/github.com/fatih/color/color.go @@ -19,15 +19,15 @@ var ( // set (regardless of its value). This is a global option and affects all // colors. For more control over each color block use the methods // DisableColor() individually. - NoColor = noColorIsSet() || os.Getenv("TERM") == "dumb" || - (!isatty.IsTerminal(os.Stdout.Fd()) && !isatty.IsCygwinTerminal(os.Stdout.Fd())) + NoColor = noColorIsSet() || os.Getenv("TERM") == "dumb" || !stdoutIsTerminal() // Output defines the standard output of the print functions. By default, - // os.Stdout is used. - Output = colorable.NewColorableStdout() + // stdOut() is used. + Output = stdOut() - // Error defines a color supporting writer for os.Stderr. - Error = colorable.NewColorableStderr() + // Error defines the standard error of the print functions. By default, + // stdErr() is used. + Error = stdErr() // colorsCache is used to reduce the count of created Color objects and // allows to reuse already created objects with required Attribute. @@ -40,6 +40,33 @@ func noColorIsSet() bool { return os.Getenv("NO_COLOR") != "" } +// stdoutIsTerminal returns true if os.Stdout is a terminal. +// Returns false if os.Stdout is nil (e.g., when running as a Windows service). +func stdoutIsTerminal() bool { + if os.Stdout == nil { + return false + } + return isatty.IsTerminal(os.Stdout.Fd()) || isatty.IsCygwinTerminal(os.Stdout.Fd()) +} + +// stdOut returns a writer for color output. +// Returns io.Discard if os.Stdout is nil (e.g., when running as a Windows service). +func stdOut() io.Writer { + if os.Stdout == nil { + return io.Discard + } + return colorable.NewColorableStdout() +} + +// stdErr returns a writer for color error output. +// Returns io.Discard if os.Stderr is nil (e.g., when running as a Windows service). +func stdErr() io.Writer { + if os.Stderr == nil { + return io.Discard + } + return colorable.NewColorableStderr() +} + // Color defines a custom color object which is defined by SGR parameters. type Color struct { params []Attribute @@ -220,26 +247,30 @@ func (c *Color) unset() { // a low-level function, and users should use the higher-level functions, such // as color.Fprint, color.Print, etc. func (c *Color) SetWriter(w io.Writer) *Color { + _, _ = c.setWriter(w) + return c +} + +func (c *Color) setWriter(w io.Writer) (int, error) { if c.isNoColorSet() { - return c + return 0, nil } - fmt.Fprint(w, c.format()) - return c + return fmt.Fprint(w, c.format()) } // UnsetWriter resets all escape attributes and clears the output with the give // io.Writer. Usually should be called after SetWriter(). func (c *Color) UnsetWriter(w io.Writer) { - if c.isNoColorSet() { - return - } + _, _ = c.unsetWriter(w) +} - if NoColor { - return +func (c *Color) unsetWriter(w io.Writer) (int, error) { + if c.isNoColorSet() { + return 0, nil } - fmt.Fprintf(w, "%s[%dm", escape, Reset) + return fmt.Fprintf(w, "%s[%dm", escape, Reset) } // Add is used to chain SGR parameters. Use as many as parameters to combine @@ -255,10 +286,20 @@ func (c *Color) Add(value ...Attribute) *Color { // On Windows, users should wrap w with colorable.NewColorable() if w is of // type *os.File. func (c *Color) Fprint(w io.Writer, a ...interface{}) (n int, err error) { - c.SetWriter(w) - defer c.UnsetWriter(w) + n, err = c.setWriter(w) + if err != nil { + return n, err + } + + nn, err := fmt.Fprint(w, a...) + n += nn + if err != nil { + return + } - return fmt.Fprint(w, a...) + nn, err = c.unsetWriter(w) + n += nn + return n, err } // Print formats using the default formats for its operands and writes to @@ -278,10 +319,20 @@ func (c *Color) Print(a ...interface{}) (n int, err error) { // On Windows, users should wrap w with colorable.NewColorable() if w is of // type *os.File. func (c *Color) Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error) { - c.SetWriter(w) - defer c.UnsetWriter(w) + n, err = c.setWriter(w) + if err != nil { + return n, err + } + + nn, err := fmt.Fprintf(w, format, a...) + n += nn + if err != nil { + return + } - return fmt.Fprintf(w, format, a...) + nn, err = c.unsetWriter(w) + n += nn + return n, err } // Printf formats according to a format specifier and writes to standard output. @@ -475,27 +526,24 @@ func (c *Color) Equals(c2 *Color) bool { if c == nil || c2 == nil { return false } + if len(c.params) != len(c2.params) { return false } + counts := make(map[Attribute]int, len(c.params)) for _, attr := range c.params { - if !c2.attrExists(attr) { - return false - } + counts[attr]++ } - return true -} - -func (c *Color) attrExists(a Attribute) bool { - for _, attr := range c.params { - if attr == a { - return true + for _, attr := range c2.params { + if counts[attr] == 0 { + return false } + counts[attr]-- } - return false + return true } func boolPtr(v bool) *bool { diff --git a/vendor/github.com/fatih/color/color_windows.go b/vendor/github.com/fatih/color/color_windows.go index be01c558e50..97e5a765a5e 100644 --- a/vendor/github.com/fatih/color/color_windows.go +++ b/vendor/github.com/fatih/color/color_windows.go @@ -9,6 +9,9 @@ import ( func init() { // Opt-in for ansi color support for current process. // https://learn.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences#output-sequences + if os.Stdout == nil { + return + } var outMode uint32 out := windows.Handle(os.Stdout.Fd()) if err := windows.GetConsoleMode(out, &outMode); err != nil { diff --git a/vendor/github.com/gabriel-vasile/mimetype/.git-blame-ignore-revs b/vendor/github.com/gabriel-vasile/mimetype/.git-blame-ignore-revs new file mode 100644 index 00000000000..3892826a749 --- /dev/null +++ b/vendor/github.com/gabriel-vasile/mimetype/.git-blame-ignore-revs @@ -0,0 +1,9 @@ +# Github is obeying this ignore file by default. +# Run this command on local to ignore formatting commits in `git blame` +# git config blame.ignoreRevsFile .git-blame-ignore-revs + +# Added a new column to supported_mimes.md +# The supported_mimes.md file was a nice way to find when a file format was +# introduced. However, when I changed to add a new column in the table, the +# whole git blame got poisoned for the file. +eb497f9bc5d31c6eab2929a112051218670137ba diff --git a/vendor/github.com/gabriel-vasile/mimetype/CODE_OF_CONDUCT.md b/vendor/github.com/gabriel-vasile/mimetype/CODE_OF_CONDUCT.md deleted file mode 100644 index 8479cd87d67..00000000000 --- a/vendor/github.com/gabriel-vasile/mimetype/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,76 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, sex characteristics, gender identity and expression, -level of experience, education, socio-economic status, nationality, personal -appearance, race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or - advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at vasile.gabriel@email.com. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html - -[homepage]: https://www.contributor-covenant.org - -For answers to common questions about this code of conduct, see -https://www.contributor-covenant.org/faq diff --git a/vendor/github.com/gabriel-vasile/mimetype/CONTRIBUTING.md b/vendor/github.com/gabriel-vasile/mimetype/CONTRIBUTING.md deleted file mode 100644 index 56ae4e57c6c..00000000000 --- a/vendor/github.com/gabriel-vasile/mimetype/CONTRIBUTING.md +++ /dev/null @@ -1,12 +0,0 @@ -## Contribute -Contributions to **mimetype** are welcome. If you find an issue and you consider -contributing, you can use the [Github issues tracker](https://github.com/gabriel-vasile/mimetype/issues) -in order to report it, or better yet, open a pull request. - -Code contributions must respect these rules: - - code must be test covered - - code must be formatted using gofmt tool - - exported names must be documented - -**Important**: By submitting a pull request, you agree to allow the project -owner to license your work under the same license as that used by the project. diff --git a/vendor/github.com/gabriel-vasile/mimetype/README.md b/vendor/github.com/gabriel-vasile/mimetype/README.md index aa88b4bda6c..ea5c89a945f 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/README.md +++ b/vendor/github.com/gabriel-vasile/mimetype/README.md @@ -27,6 +27,7 @@ - possibility to [extend](https://pkg.go.dev/github.com/gabriel-vasile/mimetype#example-package-Extend) with other file formats - common file formats are prioritized - [text vs. binary files differentiation](https://pkg.go.dev/github.com/gabriel-vasile/mimetype#example-package-TextVsBinary) +- no external dependencies - safe for concurrent usage ## Install @@ -45,8 +46,7 @@ fmt.Println(mtype.String(), mtype.Extension()) ``` See the [runnable Go Playground examples](https://pkg.go.dev/github.com/gabriel-vasile/mimetype#pkg-overview). -## Usage' -Only use libraries like **mimetype** as a last resort. Content type detection +Caution: only use libraries like **mimetype** as a last resort. Content type detection using magic numbers is slow, inaccurate, and non-standard. Most of the times protocols have methods for specifying such metadata; e.g., `Content-Type` header in HTTP and SMTP. @@ -67,6 +67,18 @@ mimetype.DetectFile("file.doc") If increasing the limit does not help, please [open an issue](https://github.com/gabriel-vasile/mimetype/issues/new?assignees=&labels=&template=mismatched-mime-type-detected.md&title=). +## Tests +In addition to unit tests, +[mimetype_tests](https://github.com/gabriel-vasile/mimetype_tests) compares the +library with the [Unix file utility](https://en.wikipedia.org/wiki/File_(command)) +for around 50 000 sample files. Check the latest comparison results +[here](https://github.com/gabriel-vasile/mimetype_tests/actions). + +## Benchmarks +Benchmarks for each file format are performed when a PR is open. The results can +be seen on the [workflows page](https://github.com/gabriel-vasile/mimetype/actions/workflows/benchmark.yml). +Performance improvements are welcome but correctness is prioritized. + ## Structure **mimetype** uses a hierarchical structure to keep the MIME type detection logic. This reduces the number of calls needed for detecting the file type. The reason @@ -84,19 +96,10 @@ or from a [file](https://pkg.go.dev/github.com/gabriel-vasile/mimetype#DetectFil how project is structured -## Performance -Thanks to the hierarchical structure, searching for common formats first, -and limiting itself to file headers, **mimetype** matches the performance of -stdlib `http.DetectContentType` while outperforming the alternative package. - -```bash - mimetype http.DetectContentType filetype -BenchmarkMatchTar-24 250 ns/op 400 ns/op 3778 ns/op -BenchmarkMatchZip-24 524 ns/op 351 ns/op 4884 ns/op -BenchmarkMatchJpeg-24 103 ns/op 228 ns/op 839 ns/op -BenchmarkMatchGif-24 139 ns/op 202 ns/op 751 ns/op -BenchmarkMatchPng-24 165 ns/op 221 ns/op 1176 ns/op -``` - ## Contributing -See [CONTRIBUTING.md](CONTRIBUTING.md). +Contributions are never expected but very much welcome. +[mimetype_tests](https://github.com/gabriel-vasile/mimetype_tests/actions/workflows/test.yml) +shows which file formats are most often misidentified and can help prioritise. +When submitting a PR for detection of a new file format, please make sure to +add a record to the list of testcases in [mimetype_test.go](mimetype_test.go). +For complex files a record can be added in the [testdata](testdata) directory. diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/charset/charset.go b/vendor/github.com/gabriel-vasile/mimetype/internal/charset/charset.go index 0647f730e53..3373274ad9d 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/internal/charset/charset.go +++ b/vendor/github.com/gabriel-vasile/mimetype/internal/charset/charset.go @@ -2,11 +2,11 @@ package charset import ( "bytes" - "encoding/xml" "strings" "unicode/utf8" - "golang.org/x/net/html" + "github.com/gabriel-vasile/mimetype/internal/markup" + "github.com/gabriel-vasile/mimetype/internal/scan" ) const ( @@ -141,20 +141,29 @@ func FromXML(content []byte) string { } return FromPlain(content) } -func fromXML(content []byte) string { - content = trimLWS(content) - dec := xml.NewDecoder(bytes.NewReader(content)) - rawT, err := dec.RawToken() - if err != nil { - return "" - } +func fromXML(s scan.Bytes) string { + xml := []byte(" 0 && line[n-1] == '\r' { + return line[:n-1], false // drop \r at end of line + } + + // This line is problematic. The logic from CountFields comes from + // encoding/csv.Reader which relies on mutating the input bytes. + // https://github.com/golang/go/blob/b3251514531123d7fd007682389bce7428d159a0/src/encoding/csv/reader.go#L275-L279 + // To avoid mutating the input, we return cutShort. #680 + if n >= 2 && line[n-2] == '\r' && line[n-1] == '\n' { + return line[:n-2], true + } + return line, false +} + +// CountFields reads one CSV line and counts how many records that line contained. +// hasMore reports whether there are more lines in the input. +// collectIndexes makes CountFields return a list of indexes where CSV fields +// start in the line. These indexes are used to test the correctness against the +// encoding/csv parser. +func (r *Parser) CountFields(collectIndexes bool) (fields int, fieldPos []int, hasMore bool) { + finished := false + var line scan.Bytes + cutShort := false + for { + line, cutShort = r.readLine() + if finished { + return 0, nil, false + } + finished = len(r.s) == 0 && len(line) == 0 + if len(line) == lengthNL(line) { + line = nil + continue // Skip empty lines. + } + if len(line) > 0 && line[0] == r.comment { + line = nil + continue + } + break + } + + indexes := []int{} + originalLine := line +parseField: + for { + if len(line) == 0 || line[0] != '"' { // non-quoted string field + fields++ + if collectIndexes { + indexes = append(indexes, len(originalLine)-len(line)) + } + i := bytes.IndexByte(line, r.comma) + if i >= 0 { + line.Advance(i + 1) // 1 to get over ending comma + continue parseField + } + break parseField + } else { // Quoted string field. + if collectIndexes { + indexes = append(indexes, len(originalLine)-len(line)) + } + line.Advance(1) // get over starting quote + for { + i := bytes.IndexByte(line, '"') + if i >= 0 { + line.Advance(i + 1) // 1 for ending quote + switch rn := line.Peek(); { + case rn == '"': + line.Advance(1) + case rn == r.comma: + line.Advance(1) + fields++ + continue parseField + case lengthNL(line) == len(line): + fields++ + break parseField + } + } else if len(line) > 0 || cutShort { + line, cutShort = r.readLine() + originalLine = line + } else { + fields++ + break parseField + } + } + } + } + + return fields, indexes, fields != 0 +} + +// lengthNL reports the number of bytes for the trailing \n. +func lengthNL(b []byte) int { + if len(b) > 0 && b[len(b)-1] == '\n' { + return 1 + } + return 0 +} diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/json/parser.go b/vendor/github.com/gabriel-vasile/mimetype/internal/json/parser.go index fd8dd520280..d11c0a883a9 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/internal/json/parser.go +++ b/vendor/github.com/gabriel-vasile/mimetype/internal/json/parser.go @@ -257,8 +257,11 @@ out: return 0 } +// openArray is used instead of an inline []byte{'['} to avoid mem alllocs. +var openArray = []byte{'['} + func (p *parserState) consumeArray(b []byte, qs []query, lvl int) (n int) { - p.currPath = append(p.currPath, []byte{'['}) + p.appendPath(openArray, qs) if len(b) == 0 { return 0 } @@ -270,7 +273,7 @@ func (p *parserState) consumeArray(b []byte, qs []query, lvl int) (n int) { } if b[n] == ']' { p.ib++ - p.currPath = p.currPath[:len(p.currPath)-1] + p.popLastPath(qs) return n + 1 } innerParsed := p.consumeAny(b[n:], qs, lvl) @@ -305,6 +308,20 @@ func queryPathMatch(qs []query, path [][]byte) int { return -1 } +// appendPath will append a path fragment if queries is not empty. +// If we don't need query functionality (just checking if a JSON is valid), +// then we can skip keeping track of the path we're currently in. +func (p *parserState) appendPath(path []byte, qs []query) { + if len(qs) != 0 { + p.currPath = append(p.currPath, path) + } +} +func (p *parserState) popLastPath(qs []query) { + if len(qs) != 0 { + p.currPath = p.currPath[:len(p.currPath)-1] + } +} + func (p *parserState) consumeObject(b []byte, qs []query, lvl int) (n int) { for n < len(b) { n += p.consumeSpace(b[n:]) @@ -326,7 +343,7 @@ func (p *parserState) consumeObject(b []byte, qs []query, lvl int) (n int) { if keyLen := p.consumeString(b[n:]); keyLen == 0 { return 0 } else { - p.currPath = append(p.currPath, b[n:n+keyLen-1]) + p.appendPath(b[n:n+keyLen-1], qs) if !p.querySatisfied { queryMatched = queryPathMatch(qs, p.currPath) } @@ -368,12 +385,12 @@ func (p *parserState) consumeObject(b []byte, qs []query, lvl int) (n int) { } switch b[n] { case ',': - p.currPath = p.currPath[:len(p.currPath)-1] + p.popLastPath(qs) n++ p.ib++ continue case '}': - p.currPath = p.currPath[:len(p.currPath)-1] + p.popLastPath(qs) p.ib++ return n + 1 default: @@ -388,6 +405,9 @@ func (p *parserState) consumeAny(b []byte, qs []query, lvl int) (n int) { if p.maxRecursion != 0 && lvl > p.maxRecursion { return 0 } + if len(qs) == 0 { + p.querySatisfied = true + } n += p.consumeSpace(b) if len(b[n:]) == 0 { return 0 @@ -426,9 +446,6 @@ func (p *parserState) consumeAny(b []byte, qs []query, lvl int) (n int) { if lvl == 0 { p.firstToken = t } - if len(qs) == 0 { - p.querySatisfied = true - } if rv <= 0 { return n } diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/archive.go b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/archive.go index dd7f2417c6e..8a0c8499776 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/archive.go +++ b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/archive.go @@ -5,43 +5,80 @@ import ( "encoding/binary" ) -var ( - // SevenZ matches a 7z archive. - SevenZ = prefix([]byte{0x37, 0x7A, 0xBC, 0xAF, 0x27, 0x1C}) - // Gzip matches gzip files based on http://www.zlib.org/rfc-gzip.html#header-trailer. - Gzip = prefix([]byte{0x1f, 0x8b}) - // Fits matches an Flexible Image Transport System file. - Fits = prefix([]byte{ +// SevenZ matches a 7z archive. +func SevenZ(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x37, 0x7A, 0xBC, 0xAF, 0x27, 0x1C}) +} + +// Gzip matches gzip files based on http://www.zlib.org/rfc-gzip.html#header-trailer. +func Gzip(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x1f, 0x8b}) +} + +// Fits matches an Flexible Image Transport System file. +func Fits(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{ 0x53, 0x49, 0x4D, 0x50, 0x4C, 0x45, 0x20, 0x20, 0x3D, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, }) - // Xar matches an eXtensible ARchive format file. - Xar = prefix([]byte{0x78, 0x61, 0x72, 0x21}) - // Bz2 matches a bzip2 file. - Bz2 = prefix([]byte{0x42, 0x5A, 0x68}) - // Ar matches an ar (Unix) archive file. - Ar = prefix([]byte{0x21, 0x3C, 0x61, 0x72, 0x63, 0x68, 0x3E}) - // Deb matches a Debian package file. - Deb = offset([]byte{ +} + +// Xar matches an eXtensible ARchive format file. +func Xar(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x78, 0x61, 0x72, 0x21}) +} + +// Bz2 matches a bzip2 file. +func Bz2(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x42, 0x5A, 0x68}) +} + +// Ar matches an ar (Unix) archive file. +func Ar(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x21, 0x3C, 0x61, 0x72, 0x63, 0x68, 0x3E}) +} + +// Deb matches a Debian package file. +func Deb(raw []byte, _ uint32) bool { + return offset(raw, []byte{ 0x64, 0x65, 0x62, 0x69, 0x61, 0x6E, 0x2D, 0x62, 0x69, 0x6E, 0x61, 0x72, 0x79, }, 8) - // Warc matches a Web ARChive file. - Warc = prefix([]byte("WARC/1.0"), []byte("WARC/1.1")) - // Cab matches a Microsoft Cabinet archive file. - Cab = prefix([]byte("MSCF\x00\x00\x00\x00")) - // Xz matches an xz compressed stream based on https://tukaani.org/xz/xz-file-format.txt. - Xz = prefix([]byte{0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00}) - // Lzip matches an Lzip compressed file. - Lzip = prefix([]byte{0x4c, 0x5a, 0x49, 0x50}) - // RPM matches an RPM or Delta RPM package file. - RPM = prefix([]byte{0xed, 0xab, 0xee, 0xdb}, []byte("drpm")) - // Cpio matches a cpio archive file. - Cpio = prefix([]byte("070707"), []byte("070701"), []byte("070702")) - // RAR matches a RAR archive file. - RAR = prefix([]byte("Rar!\x1A\x07\x00"), []byte("Rar!\x1A\x07\x01\x00")) -) +} + +// Warc matches a Web ARChive file. +func Warc(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("WARC/1.0")) || + bytes.HasPrefix(raw, []byte("WARC/1.1")) +} + +// Cab matches a Microsoft Cabinet archive file. +func Cab(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("MSCF\x00\x00\x00\x00")) +} + +// Xz matches an xz compressed stream based on https://tukaani.org/xz/xz-file-format.txt. +func Xz(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00}) +} + +// Lzip matches an Lzip compressed file. +func Lzip(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x4c, 0x5a, 0x49, 0x50}) +} + +// RPM matches an RPM or Delta RPM package file. +func RPM(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0xed, 0xab, 0xee, 0xdb}) || + bytes.HasPrefix(raw, []byte("drpm")) +} + +// RAR matches a RAR archive file. +func RAR(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("Rar!\x1A\x07\x00")) || + bytes.HasPrefix(raw, []byte("Rar!\x1A\x07\x01\x00")) +} // InstallShieldCab matches an InstallShield Cabinet archive file. func InstallShieldCab(raw []byte, _ uint32) bool { @@ -78,6 +115,17 @@ func CRX(raw []byte, limit uint32) bool { return Zip(raw[zipOffset:], limit) } +// Cpio matches a cpio archive file. +func Cpio(raw []byte, _ uint32) bool { + if len(raw) < 6 { + return false + } + return binary.LittleEndian.Uint16(raw) == 070707 || // binary cpio + bytes.HasPrefix(raw, []byte("070707")) || // portable ASCII cpios + bytes.HasPrefix(raw, []byte("070701")) || + bytes.HasPrefix(raw, []byte("070702")) +} + // Tar matches a (t)ape (ar)chive file. // Tar files are divided into 512 bytes records. First record contains a 257 // bytes header padded with NUL. diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/audio.go b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/audio.go index d17e32482c9..2b160711ff7 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/audio.go +++ b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/audio.go @@ -5,26 +5,50 @@ import ( "encoding/binary" ) -var ( - // Flac matches a Free Lossless Audio Codec file. - Flac = prefix([]byte("\x66\x4C\x61\x43\x00\x00\x00\x22")) - // Midi matches a Musical Instrument Digital Interface file. - Midi = prefix([]byte("\x4D\x54\x68\x64")) - // Ape matches a Monkey's Audio file. - Ape = prefix([]byte("\x4D\x41\x43\x20\x96\x0F\x00\x00\x34\x00\x00\x00\x18\x00\x00\x00\x90\xE3")) - // MusePack matches a Musepack file. - MusePack = prefix([]byte("MPCK")) - // Au matches a Sun Microsystems au file. - Au = prefix([]byte("\x2E\x73\x6E\x64")) - // Amr matches an Adaptive Multi-Rate file. - Amr = prefix([]byte("\x23\x21\x41\x4D\x52")) - // Voc matches a Creative Voice file. - Voc = prefix([]byte("Creative Voice File")) - // M3u matches a Playlist file. - M3u = prefix([]byte("#EXTM3U")) - // AAC matches an Advanced Audio Coding file. - AAC = prefix([]byte{0xFF, 0xF1}, []byte{0xFF, 0xF9}) -) +// Flac matches a Free Lossless Audio Codec file. +func Flac(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("\x66\x4C\x61\x43\x00\x00\x00\x22")) +} + +// Midi matches a Musical Instrument Digital Interface file. +func Midi(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("\x4D\x54\x68\x64")) +} + +// Ape matches a Monkey's Audio file. +func Ape(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("\x4D\x41\x43\x20\x96\x0F\x00\x00\x34\x00\x00\x00\x18\x00\x00\x00\x90\xE3")) +} + +// MusePack matches a Musepack file. +func MusePack(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("MPCK")) +} + +// Au matches a Sun Microsystems au file. +func Au(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("\x2E\x73\x6E\x64")) +} + +// Amr matches an Adaptive Multi-Rate file. +func Amr(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("\x23\x21\x41\x4D\x52")) +} + +// Voc matches a Creative Voice file. +func Voc(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("Creative Voice File")) +} + +// M3u matches a Playlist file. +func M3u(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("#EXTM3U")) +} + +// AAC matches an Advanced Audio Coding file. +func AAC(raw []byte, _ uint32) bool { + return len(raw) > 1 && ((raw[0] == 0xFF && raw[1] == 0xF1) || (raw[0] == 0xFF && raw[1] == 0xF9)) +} // Mp3 matches an mp3 file. func Mp3(raw []byte, limit uint32) bool { diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/binary.go b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/binary.go index 70599b34209..37ad6a9fb14 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/binary.go +++ b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/binary.go @@ -6,26 +6,52 @@ import ( "encoding/binary" ) -var ( - // Lnk matches Microsoft lnk binary format. - Lnk = prefix([]byte{0x4C, 0x00, 0x00, 0x00, 0x01, 0x14, 0x02, 0x00}) - // Wasm matches a web assembly File Format file. - Wasm = prefix([]byte{0x00, 0x61, 0x73, 0x6D}) - // Exe matches a Windows/DOS executable file. - Exe = prefix([]byte{0x4D, 0x5A}) - // Elf matches an Executable and Linkable Format file. - Elf = prefix([]byte{0x7F, 0x45, 0x4C, 0x46}) - // Nes matches a Nintendo Entertainment system ROM file. - Nes = prefix([]byte{0x4E, 0x45, 0x53, 0x1A}) - // SWF matches an Adobe Flash swf file. - SWF = prefix([]byte("CWS"), []byte("FWS"), []byte("ZWS")) - // Torrent has bencoded text in the beginning. - Torrent = prefix([]byte("d8:announce")) - // PAR1 matches a parquet file. - Par1 = prefix([]byte{0x50, 0x41, 0x52, 0x31}) - // CBOR matches a Concise Binary Object Representation https://cbor.io/ - CBOR = prefix([]byte{0xD9, 0xD9, 0xF7}) -) +// Lnk matches Microsoft lnk binary format. +func Lnk(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x4C, 0x00, 0x00, 0x00, 0x01, 0x14, 0x02, 0x00}) +} + +// Wasm matches a web assembly File Format file. +func Wasm(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x00, 0x61, 0x73, 0x6D}) +} + +// Exe matches a Windows/DOS executable file. +func Exe(raw []byte, _ uint32) bool { + return len(raw) > 1 && raw[0] == 0x4D && raw[1] == 0x5A +} + +// Elf matches an Executable and Linkable Format file. +func Elf(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x7F, 0x45, 0x4C, 0x46}) +} + +// Nes matches a Nintendo Entertainment system ROM file. +func Nes(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x4E, 0x45, 0x53, 0x1A}) +} + +// SWF matches an Adobe Flash swf file. +func SWF(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("CWS")) || + bytes.HasPrefix(raw, []byte("FWS")) || + bytes.HasPrefix(raw, []byte("ZWS")) +} + +// Torrent has bencoded text in the beginning. +func Torrent(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("d8:announce")) +} + +// PAR1 matches a parquet file. +func Par1(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x50, 0x41, 0x52, 0x31}) +} + +// CBOR matches a Concise Binary Object Representation https://cbor.io/ +func CBOR(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0xD9, 0xD9, 0xF7}) +} // Java bytecode and Mach-O binaries share the same magic number. // More info here https://github.com/threatstack/libmagic/blob/master/magic/Magdir/cafebabe @@ -168,8 +194,10 @@ func Marc(raw []byte, limit uint32) bool { // // [glTF specification]: https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html // [IANA glTF entry]: https://www.iana.org/assignments/media-types/model/gltf-binary -var GLB = prefix([]byte("\x67\x6C\x54\x46\x02\x00\x00\x00"), - []byte("\x67\x6C\x54\x46\x01\x00\x00\x00")) +func GLB(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("\x67\x6C\x54\x46\x02\x00\x00\x00")) || + bytes.HasPrefix(raw, []byte("\x67\x6C\x54\x46\x01\x00\x00\x00")) +} // TzIf matches a Time Zone Information Format (TZif) file. // See more: https://tools.ietf.org/id/draft-murchison-tzdist-tzif-00.html#rfc.section.3 diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/database.go b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/database.go index cb1fed12f7a..35c3f911eaa 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/database.go +++ b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/database.go @@ -1,13 +1,21 @@ package magic -var ( - // Sqlite matches an SQLite database file. - Sqlite = prefix([]byte{ +import "bytes" + +// Sqlite matches an SQLite database file. +func Sqlite(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{ 0x53, 0x51, 0x4c, 0x69, 0x74, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x20, 0x33, 0x00, }) - // MsAccessAce matches Microsoft Access dababase file. - MsAccessAce = offset([]byte("Standard ACE DB"), 4) - // MsAccessMdb matches legacy Microsoft Access database file (JET, 2003 and earlier). - MsAccessMdb = offset([]byte("Standard Jet DB"), 4) -) +} + +// MsAccessAce matches Microsoft Access dababase file. +func MsAccessAce(raw []byte, _ uint32) bool { + return offset(raw, []byte("Standard ACE DB"), 4) +} + +// MsAccessMdb matches legacy Microsoft Access database file (JET, 2003 and earlier). +func MsAccessMdb(raw []byte, _ uint32) bool { + return offset(raw, []byte("Standard Jet DB"), 4) +} diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/document.go b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/document.go index b3b26d5a12b..72080395807 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/document.go +++ b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/document.go @@ -1,28 +1,48 @@ package magic -import "bytes" - -var ( - // Pdf matches a Portable Document Format file. - // https://github.com/file/file/blob/11010cc805546a3e35597e67e1129a481aed40e8/magic/Magdir/pdf - Pdf = prefix( - // usual pdf signature - []byte("%PDF-"), +import ( + "bytes" + "encoding/binary" +) + +// Pdf matches a Portable Document Format file. +// https://github.com/file/file/blob/11010cc805546a3e35597e67e1129a481aed40e8/magic/Magdir/pdf +func Pdf(raw []byte, _ uint32) bool { + // usual pdf signature + return bytes.HasPrefix(raw, []byte("%PDF-")) || // new-line prefixed signature - []byte("\012%PDF-"), + bytes.HasPrefix(raw, []byte("\012%PDF-")) || // UTF-8 BOM prefixed signature - []byte("\xef\xbb\xbf%PDF-"), - ) - // Fdf matches a Forms Data Format file. - Fdf = prefix([]byte("%FDF")) - // Mobi matches a Mobi file. - Mobi = offset([]byte("BOOKMOBI"), 60) - // Lit matches a Microsoft Lit file. - Lit = prefix([]byte("ITOLITLS")) -) + bytes.HasPrefix(raw, []byte("\xef\xbb\xbf%PDF-")) +} + +// Fdf matches a Forms Data Format file. +func Fdf(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("%FDF")) +} + +// Mobi matches a Mobi file. +func Mobi(raw []byte, _ uint32) bool { + return offset(raw, []byte("BOOKMOBI"), 60) +} + +// Lit matches a Microsoft Lit file. +func Lit(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("ITOLITLS")) +} + +// PDF matches a Portable Document Format file. +// The %PDF- header should be the first thing inside the file but many +// implementations don't follow the rule. The PDF spec at Appendix H says the +// signature can be prepended by anything. +// https://bugs.astron.com/view.php?id=446 +func PDF(raw []byte, _ uint32) bool { + raw = raw[:min(len(raw), 1024)] + return bytes.Contains(raw, []byte("%PDF-")) +} // DjVu matches a DjVu file. -func DjVu(raw []byte, limit uint32) bool { +func DjVu(raw []byte, _ uint32) bool { if len(raw) < 12 { return false } @@ -36,7 +56,7 @@ func DjVu(raw []byte, limit uint32) bool { } // P7s matches an .p7s signature File (PEM, Base64). -func P7s(raw []byte, limit uint32) bool { +func P7s(raw []byte, _ uint32) bool { // Check for PEM Encoding. if bytes.HasPrefix(raw, []byte("-----BEGIN PKCS7")) { return true @@ -60,3 +80,21 @@ func P7s(raw []byte, limit uint32) bool { return false } + +// Lotus123 matches a Lotus 1-2-3 spreadsheet document. +func Lotus123(raw []byte, _ uint32) bool { + if len(raw) <= 20 { + return false + } + version := binary.BigEndian.Uint32(raw) + if version == 0x00000200 { + return raw[6] != 0 && raw[7] == 0 + } + + return version == 0x00001a00 && raw[20] > 0 && raw[20] < 32 +} + +// CHM matches a Microsoft Compiled HTML Help file. +func CHM(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("ITSF\003\000\000\000\x60\000\000\000")) +} diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/font.go b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/font.go index 43af28212e7..857cfcc552c 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/font.go +++ b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/font.go @@ -4,14 +4,20 @@ import ( "bytes" ) -var ( - // Woff matches a Web Open Font Format file. - Woff = prefix([]byte("wOFF")) - // Woff2 matches a Web Open Font Format version 2 file. - Woff2 = prefix([]byte("wOF2")) - // Otf matches an OpenType font file. - Otf = prefix([]byte{0x4F, 0x54, 0x54, 0x4F, 0x00}) -) +// Woff matches a Web Open Font Format file. +func Woff(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("wOFF")) +} + +// Woff2 matches a Web Open Font Format version 2 file. +func Woff2(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("wOF2")) +} + +// Otf matches an OpenType font file. +func Otf(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x4F, 0x54, 0x54, 0x4F, 0x00}) +} // Ttf matches a TrueType font file. func Ttf(raw []byte, limit uint32) bool { diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/ftyp.go b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/ftyp.go index ac727139ef2..fc642ef433c 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/ftyp.go +++ b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/ftyp.go @@ -4,24 +4,33 @@ import ( "bytes" ) -var ( - // AVIF matches an AV1 Image File Format still or animated. - // Wikipedia page seems outdated listing image/avif-sequence for animations. - // https://github.com/AOMediaCodec/av1-avif/issues/59 - AVIF = ftyp([]byte("avif"), []byte("avis")) - // ThreeGP matches a 3GPP file. - ThreeGP = ftyp( +// AVIF matches an AV1 Image File Format still or animated. +// Wikipedia page seems outdated listing image/avif-sequence for animations. +// https://github.com/AOMediaCodec/av1-avif/issues/59 +func AVIF(raw []byte, _ uint32) bool { + return ftyp(raw, []byte("avif"), []byte("avis")) +} + +// ThreeGP matches a 3GPP file. +func ThreeGP(raw []byte, _ uint32) bool { + return ftyp(raw, []byte("3gp1"), []byte("3gp2"), []byte("3gp3"), []byte("3gp4"), []byte("3gp5"), []byte("3gp6"), []byte("3gp7"), []byte("3gs7"), []byte("3ge6"), []byte("3ge7"), []byte("3gg6"), ) - // ThreeG2 matches a 3GPP2 file. - ThreeG2 = ftyp( +} + +// ThreeG2 matches a 3GPP2 file. +func ThreeG2(raw []byte, _ uint32) bool { + return ftyp(raw, []byte("3g24"), []byte("3g25"), []byte("3g26"), []byte("3g2a"), []byte("3g2b"), []byte("3g2c"), []byte("KDDI"), ) - // AMp4 matches an audio MP4 file. - AMp4 = ftyp( +} + +// AMp4 matches an audio MP4 file. +func AMp4(raw []byte, _ uint32) bool { + return ftyp(raw, // audio for Adobe Flash Player 9+ []byte("F4A "), []byte("F4B "), // Apple iTunes AAC-LC (.M4A) Audio @@ -31,33 +40,61 @@ var ( // Nero Digital AAC Audio []byte("NDAS"), ) - // Mqv matches a Sony / Mobile QuickTime file. - Mqv = ftyp([]byte("mqt ")) - // M4a matches an audio M4A file. - M4a = ftyp([]byte("M4A ")) - // M4v matches an Appl4 M4V video file. - M4v = ftyp([]byte("M4V "), []byte("M4VH"), []byte("M4VP")) - // Heic matches a High Efficiency Image Coding (HEIC) file. - Heic = ftyp([]byte("heic"), []byte("heix")) - // HeicSequence matches a High Efficiency Image Coding (HEIC) file sequence. - HeicSequence = ftyp([]byte("hevc"), []byte("hevx")) - // Heif matches a High Efficiency Image File Format (HEIF) file. - Heif = ftyp([]byte("mif1"), []byte("heim"), []byte("heis"), []byte("avic")) - // HeifSequence matches a High Efficiency Image File Format (HEIF) file sequence. - HeifSequence = ftyp([]byte("msf1"), []byte("hevm"), []byte("hevs"), []byte("avcs")) - // Mj2 matches a Motion JPEG 2000 file: https://en.wikipedia.org/wiki/Motion_JPEG_2000. - Mj2 = ftyp([]byte("mj2s"), []byte("mjp2"), []byte("MFSM"), []byte("MGSV")) - // Dvb matches a Digital Video Broadcasting file: https://dvb.org. - // https://cconcolato.github.io/mp4ra/filetype.html - // https://github.com/file/file/blob/512840337ead1076519332d24fefcaa8fac36e06/magic/Magdir/animation#L135-L154 - Dvb = ftyp( +} + +// Mqv matches a Sony / Mobile QuickTime file. +func Mqv(raw []byte, _ uint32) bool { + return ftyp(raw, []byte("mqt ")) +} + +// M4a matches an audio M4A file. +func M4a(raw []byte, _ uint32) bool { + return ftyp(raw, []byte("M4A ")) +} + +// M4v matches an Appl4 M4V video file. +func M4v(raw []byte, _ uint32) bool { + return ftyp(raw, []byte("M4V "), []byte("M4VH"), []byte("M4VP")) +} + +// Heic matches a High Efficiency Image Coding (HEIC) file. +func Heic(raw []byte, _ uint32) bool { + return ftyp(raw, []byte("heic"), []byte("heix")) +} + +// HeicSequence matches a High Efficiency Image Coding (HEIC) file sequence. +func HeicSequence(raw []byte, _ uint32) bool { + return ftyp(raw, []byte("hevc"), []byte("hevx")) +} + +// Heif matches a High Efficiency Image File Format (HEIF) file. +func Heif(raw []byte, _ uint32) bool { + return ftyp(raw, []byte("mif1"), []byte("heim"), []byte("heis"), []byte("avic")) +} + +// HeifSequence matches a High Efficiency Image File Format (HEIF) file sequence. +func HeifSequence(raw []byte, _ uint32) bool { + return ftyp(raw, []byte("msf1"), []byte("hevm"), []byte("hevs"), []byte("avcs")) +} + +// Mj2 matches a Motion JPEG 2000 file: https://en.wikipedia.org/wiki/Motion_JPEG_2000. +func Mj2(raw []byte, _ uint32) bool { + return ftyp(raw, []byte("mj2s"), []byte("mjp2"), []byte("MFSM"), []byte("MGSV")) +} + +// Dvb matches a Digital Video Broadcasting file: https://dvb.org. +// https://cconcolato.github.io/mp4ra/filetype.html +// https://github.com/file/file/blob/512840337ead1076519332d24fefcaa8fac36e06/magic/Magdir/animation#L135-L154 +func Dvb(raw []byte, _ uint32) bool { + return ftyp(raw, []byte("dby1"), []byte("dsms"), []byte("dts1"), []byte("dts2"), []byte("dts3"), []byte("dxo "), []byte("dmb1"), []byte("dmpf"), []byte("drc1"), []byte("dv1a"), []byte("dv1b"), []byte("dv2a"), []byte("dv2b"), []byte("dv3a"), []byte("dv3b"), []byte("dvr1"), []byte("dvt1"), []byte("emsg")) - // TODO: add support for remaining video formats at ftyps.com. -) +} + +// TODO: add support for remaining video formats at ftyps.com. // QuickTime matches a QuickTime File Format file. // https://www.loc.gov/preservation/digital/formats/fdd/fdd000052.shtml diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/image.go b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/image.go index 0eb7e95f375..788f5478b49 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/image.go +++ b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/image.go @@ -2,66 +2,127 @@ package magic import "bytes" -var ( - // Png matches a Portable Network Graphics file. - // https://www.w3.org/TR/PNG/ - Png = prefix([]byte{0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A}) - // Apng matches an Animated Portable Network Graphics file. - // https://wiki.mozilla.org/APNG_Specification - Apng = offset([]byte("acTL"), 37) - // Jpg matches a Joint Photographic Experts Group file. - Jpg = prefix([]byte{0xFF, 0xD8, 0xFF}) - // Jp2 matches a JPEG 2000 Image file (ISO 15444-1). - Jp2 = jpeg2k([]byte{0x6a, 0x70, 0x32, 0x20}) - // Jpx matches a JPEG 2000 Image file (ISO 15444-2). - Jpx = jpeg2k([]byte{0x6a, 0x70, 0x78, 0x20}) - // Jpm matches a JPEG 2000 Image file (ISO 15444-6). - Jpm = jpeg2k([]byte{0x6a, 0x70, 0x6D, 0x20}) - // Gif matches a Graphics Interchange Format file. - Gif = prefix([]byte("GIF87a"), []byte("GIF89a")) - // Bmp matches a bitmap image file. - Bmp = prefix([]byte{0x42, 0x4D}) - // Ps matches a PostScript file. - Ps = prefix([]byte("%!PS-Adobe-")) - // Psd matches a Photoshop Document file. - Psd = prefix([]byte("8BPS")) - // Ico matches an ICO file. - Ico = prefix([]byte{0x00, 0x00, 0x01, 0x00}, []byte{0x00, 0x00, 0x02, 0x00}) - // Icns matches an ICNS (Apple Icon Image format) file. - Icns = prefix([]byte("icns")) - // Tiff matches a Tagged Image File Format file. - Tiff = prefix([]byte{0x49, 0x49, 0x2A, 0x00}, []byte{0x4D, 0x4D, 0x00, 0x2A}) - // Bpg matches a Better Portable Graphics file. - Bpg = prefix([]byte{0x42, 0x50, 0x47, 0xFB}) - // Xcf matches GIMP image data. - Xcf = prefix([]byte("gimp xcf")) - // Pat matches GIMP pattern data. - Pat = offset([]byte("GPAT"), 20) - // Gbr matches GIMP brush data. - Gbr = offset([]byte("GIMP"), 20) - // Hdr matches Radiance HDR image. - // https://web.archive.org/web/20060913152809/http://local.wasp.uwa.edu.au/~pbourke/dataformats/pic/ - Hdr = prefix([]byte("#?RADIANCE\n")) - // Xpm matches X PixMap image data. - Xpm = prefix([]byte{0x2F, 0x2A, 0x20, 0x58, 0x50, 0x4D, 0x20, 0x2A, 0x2F}) - // Jxs matches a JPEG XS coded image file (ISO/IEC 21122-3). - Jxs = prefix([]byte{0x00, 0x00, 0x00, 0x0C, 0x4A, 0x58, 0x53, 0x20, 0x0D, 0x0A, 0x87, 0x0A}) - // Jxr matches Microsoft HD JXR photo file. - Jxr = prefix([]byte{0x49, 0x49, 0xBC, 0x01}) -) - -func jpeg2k(sig []byte) Detector { - return func(raw []byte, _ uint32) bool { - if len(raw) < 24 { - return false - } +// Png matches a Portable Network Graphics file. +// https://www.w3.org/TR/PNG/ +func Png(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A}) +} - if !bytes.Equal(raw[4:8], []byte{0x6A, 0x50, 0x20, 0x20}) && - !bytes.Equal(raw[4:8], []byte{0x6A, 0x50, 0x32, 0x20}) { - return false - } - return bytes.Equal(raw[20:24], sig) +// Apng matches an Animated Portable Network Graphics file. +// https://wiki.mozilla.org/APNG_Specification +func Apng(raw []byte, _ uint32) bool { + return offset(raw, []byte("acTL"), 37) +} + +// Jpg matches a Joint Photographic Experts Group file. +func Jpg(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0xFF, 0xD8, 0xFF}) +} + +// Jp2 matches a JPEG 2000 Image file (ISO 15444-1). +func Jp2(raw []byte, _ uint32) bool { + return jpeg2k(raw, []byte{0x6a, 0x70, 0x32, 0x20}) +} + +// Jpx matches a JPEG 2000 Image file (ISO 15444-2). +func Jpx(raw []byte, _ uint32) bool { + return jpeg2k(raw, []byte{0x6a, 0x70, 0x78, 0x20}) +} + +// Jpm matches a JPEG 2000 Image file (ISO 15444-6). +func Jpm(raw []byte, _ uint32) bool { + return jpeg2k(raw, []byte{0x6a, 0x70, 0x6D, 0x20}) +} + +// Gif matches a Graphics Interchange Format file. +func Gif(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("GIF87a")) || + bytes.HasPrefix(raw, []byte("GIF89a")) +} + +// Bmp matches a bitmap image file. +func Bmp(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x42, 0x4D}) +} + +// Ps matches a PostScript file. +func Ps(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("%!PS-Adobe-")) +} + +// Psd matches a Photoshop Document file. +func Psd(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("8BPS")) +} + +// Ico matches an ICO file. +func Ico(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x00, 0x00, 0x01, 0x00}) || + bytes.HasPrefix(raw, []byte{0x00, 0x00, 0x02, 0x00}) +} + +// Icns matches an ICNS (Apple Icon Image format) file. +func Icns(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("icns")) +} + +// Tiff matches a Tagged Image File Format file. +func Tiff(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x49, 0x49, 0x2A, 0x00}) || + bytes.HasPrefix(raw, []byte{0x4D, 0x4D, 0x00, 0x2A}) +} + +// Bpg matches a Better Portable Graphics file. +func Bpg(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x42, 0x50, 0x47, 0xFB}) +} + +// Xcf matches GIMP image data. +func Xcf(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("gimp xcf")) +} + +// Pat matches GIMP pattern data. +func Pat(raw []byte, _ uint32) bool { + return offset(raw, []byte("GPAT"), 20) +} + +// Gbr matches GIMP brush data. +func Gbr(raw []byte, _ uint32) bool { + return offset(raw, []byte("GIMP"), 20) +} + +// Hdr matches Radiance HDR image. +// https://web.archive.org/web/20060913152809/http://local.wasp.uwa.edu.au/~pbourke/dataformats/pic/ +func Hdr(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("#?RADIANCE\n")) +} + +// Xpm matches X PixMap image data. +func Xpm(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x2F, 0x2A, 0x20, 0x58, 0x50, 0x4D, 0x20, 0x2A, 0x2F}) +} + +// Jxs matches a JPEG XS coded image file (ISO/IEC 21122-3). +func Jxs(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x00, 0x00, 0x00, 0x0C, 0x4A, 0x58, 0x53, 0x20, 0x0D, 0x0A, 0x87, 0x0A}) +} + +// Jxr matches Microsoft HD JXR photo file. +func Jxr(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x49, 0x49, 0xBC, 0x01}) +} + +func jpeg2k(raw []byte, sig []byte) bool { + if len(raw) < 24 { + return false + } + + if !bytes.Equal(raw[4:8], []byte{0x6A, 0x50, 0x20, 0x20}) && + !bytes.Equal(raw[4:8], []byte{0x6A, 0x50, 0x32, 0x20}) { + return false } + return bytes.Equal(raw[20:24], sig) } // Webp matches a WebP file. @@ -108,3 +169,20 @@ func Jxl(raw []byte, _ uint32) bool { return bytes.HasPrefix(raw, []byte{0xFF, 0x0A}) || bytes.HasPrefix(raw, []byte("\x00\x00\x00\x0cJXL\x20\x0d\x0a\x87\x0a")) } + +// DXF matches Drawing Exchange Format AutoCAD file. +// There does not seem to be a clear specification and the files in the wild +// differ wildly. +// https://images.autodesk.com/adsk/files/autocad_2012_pdf_dxf-reference_enu.pdf +// +// I collected these signatures by downloading a few dozen files from +// http://cd.textfiles.com/amigaenv/DXF/OBJEKTE/ and +// https://sembiance.com/fileFormatSamples/poly/dxf/ and then +// xxd -l 16 {} | sort | uniq. +// These signatures are only for the ASCII version of DXF. There is a binary version too. +func DXF(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte(" 0\x0ASECTION\x0A")) || + bytes.HasPrefix(raw, []byte(" 0\x0D\x0ASECTION\x0D\x0A")) || + bytes.HasPrefix(raw, []byte("0\x0ASECTION\x0A")) || + bytes.HasPrefix(raw, []byte("0\x0D\x0ASECTION\x0D\x0A")) +} diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/magic.go b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/magic.go index a34c6098421..6103c12d364 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/magic.go +++ b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/magic.go @@ -3,7 +3,8 @@ package magic import ( "bytes" - "fmt" + + "github.com/gabriel-vasile/mimetype/internal/scan" ) type ( @@ -20,37 +21,20 @@ type ( } ) -// prefix creates a Detector which returns true if any of the provided signatures -// is the prefix of the raw input. -func prefix(sigs ...[]byte) Detector { - return func(raw []byte, limit uint32) bool { - for _, s := range sigs { - if bytes.HasPrefix(raw, s) { - return true - } - } - return false - } -} - -// offset creates a Detector which returns true if the provided signature can be +// offset returns true if the provided signature can be // found at offset in the raw input. -func offset(sig []byte, offset int) Detector { - return func(raw []byte, limit uint32) bool { - return len(raw) > offset && bytes.HasPrefix(raw[offset:], sig) - } +func offset(raw []byte, sig []byte, offset int) bool { + return len(raw) > offset && bytes.HasPrefix(raw[offset:], sig) } // ciPrefix is like prefix but the check is case insensitive. -func ciPrefix(sigs ...[]byte) Detector { - return func(raw []byte, limit uint32) bool { - for _, s := range sigs { - if ciCheck(s, raw) { - return true - } +func ciPrefix(raw []byte, sigs ...[]byte) bool { + for _, s := range sigs { + if ciCheck(s, raw) { + return true } - return false } + return false } func ciCheck(sig, raw []byte) bool { if len(raw) < len(sig)+1 { @@ -70,21 +54,18 @@ func ciCheck(sig, raw []byte) bool { return true } -// xml creates a Detector which returns true if any of the provided XML signatures -// matches the raw input. -func xml(sigs ...xmlSig) Detector { - return func(raw []byte, limit uint32) bool { - raw = trimLWS(raw) - if len(raw) == 0 { - return false - } - for _, s := range sigs { - if xmlCheck(s, raw) { - return true - } - } +// xml returns true if any of the provided XML signatures matches the raw input. +func xml(b scan.Bytes, sigs ...xmlSig) bool { + b.TrimLWS() + if len(b) == 0 { return false } + for _, s := range sigs { + if xmlCheck(s, b) { + return true + } + } + return false } func xmlCheck(sig xmlSig, raw []byte) bool { raw = raw[:min(len(raw), 512)] @@ -100,28 +81,24 @@ func xmlCheck(sig xmlSig, raw []byte) bool { return localNameIndex != -1 && localNameIndex < bytes.Index(raw, sig.xmlns) } -// markup creates a Detector which returns true is any of the HTML signatures -// matches the raw input. -func markup(sigs ...[]byte) Detector { - return func(raw []byte, limit uint32) bool { - if bytes.HasPrefix(raw, []byte{0xEF, 0xBB, 0xBF}) { - // We skip the UTF-8 BOM if present to ensure we correctly - // process any leading whitespace. The presence of the BOM - // is taken into account during charset detection in charset.go. - raw = trimLWS(raw[3:]) - } else { - raw = trimLWS(raw) - } - if len(raw) == 0 { - return false - } - for _, s := range sigs { - if markupCheck(s, raw) { - return true - } - } +// markup returns true is any of the HTML signatures matches the raw input. +func markup(b scan.Bytes, sigs ...[]byte) bool { + if bytes.HasPrefix(b, []byte{0xEF, 0xBB, 0xBF}) { + // We skip the UTF-8 BOM if present to ensure we correctly + // process any leading whitespace. The presence of the BOM + // is taken into account during charset detection in charset.go. + b.Advance(3) + } + b.TrimLWS() + if len(b) == 0 { return false } + for _, s := range sigs { + if markupCheck(s, b) { + return true + } + } + return false } func markupCheck(sig, raw []byte) bool { if len(raw) < len(sig)+1 { @@ -139,36 +116,24 @@ func markupCheck(sig, raw []byte) bool { } } // Next byte must be space or right angle bracket. - if db := raw[len(sig)]; db != ' ' && db != '>' { + if db := raw[len(sig)]; !scan.ByteIsWS(db) && db != '>' { return false } return true } -// ftyp creates a Detector which returns true if any of the FTYP signatures -// matches the raw input. -func ftyp(sigs ...[]byte) Detector { - return func(raw []byte, limit uint32) bool { - if len(raw) < 12 { - return false - } - for _, s := range sigs { - if bytes.Equal(raw[8:12], s) { - return true - } - } +// ftyp returns true if any of the FTYP signatures matches the raw input. +func ftyp(raw []byte, sigs ...[]byte) bool { + if len(raw) < 12 { return false } -} - -func newXMLSig(localName, xmlns string) xmlSig { - ret := xmlSig{xmlns: []byte(xmlns)} - if localName != "" { - ret.localName = []byte(fmt.Sprintf("<%s", localName)) + for _, s := range sigs { + if bytes.Equal(raw[8:12], s) { + return true + } } - - return ret + return false } // A valid shebang starts with the "#!" characters, @@ -181,71 +146,17 @@ func newXMLSig(localName, xmlns string) xmlSig { // #! /usr/bin/env php // // /usr/bin/env is the interpreter, php is the first and only argument. -func shebang(sigs ...[]byte) Detector { - return func(raw []byte, limit uint32) bool { - for _, s := range sigs { - if shebangCheck(s, firstLine(raw)) { - return true - } - } - return false - } -} - -func shebangCheck(sig, raw []byte) bool { - if len(raw) < len(sig)+2 { - return false - } - if raw[0] != '#' || raw[1] != '!' { +func shebang(b scan.Bytes, matchFlags scan.Flags, sigs ...[]byte) bool { + line := b.Line() + if len(line) < 2 || line[0] != '#' || line[1] != '!' { return false } - - return bytes.Equal(trimLWS(trimRWS(raw[2:])), sig) -} - -// trimLWS trims whitespace from beginning of the input. -func trimLWS(in []byte) []byte { - firstNonWS := 0 - for ; firstNonWS < len(in) && isWS(in[firstNonWS]); firstNonWS++ { - } - - return in[firstNonWS:] -} - -// trimRWS trims whitespace from the end of the input. -func trimRWS(in []byte) []byte { - lastNonWS := len(in) - 1 - for ; lastNonWS > 0 && isWS(in[lastNonWS]); lastNonWS-- { - } - - return in[:lastNonWS+1] -} - -func firstLine(in []byte) []byte { - lineEnd := 0 - for ; lineEnd < len(in) && in[lineEnd] != '\n'; lineEnd++ { - } - - return in[:lineEnd] -} - -func isWS(b byte) bool { - return b == '\t' || b == '\n' || b == '\x0c' || b == '\r' || b == ' ' -} - -func min(a, b int) int { - if a < b { - return a - } - return b -} - -type readBuf []byte - -func (b *readBuf) advance(n int) bool { - if n < 0 || len(*b) < n { - return false + line = line[2:] + line.TrimLWS() + for _, s := range sigs { + if line.Match(s, matchFlags) != -1 { + return true + } } - *b = (*b)[n:] - return true + return false } diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/ms_office.go b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/ms_office.go index 7d60e22e26e..bd4a0c36594 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/ms_office.go +++ b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/ms_office.go @@ -7,17 +7,34 @@ import ( // Xlsx matches a Microsoft Excel 2007 file. func Xlsx(raw []byte, limit uint32) bool { - return zipContains(raw, []byte("xl/"), true) + return msoxml(raw, zipEntries{{ + name: []byte("xl/"), + dir: true, + }}, 100) } // Docx matches a Microsoft Word 2007 file. func Docx(raw []byte, limit uint32) bool { - return zipContains(raw, []byte("word/"), true) + return msoxml(raw, zipEntries{{ + name: []byte("word/"), + dir: true, + }}, 100) } // Pptx matches a Microsoft PowerPoint 2007 file. func Pptx(raw []byte, limit uint32) bool { - return zipContains(raw, []byte("ppt/"), true) + return msoxml(raw, zipEntries{{ + name: []byte("ppt/"), + dir: true, + }}, 100) +} + +// Visio matches a Microsoft Visio 2013+ file. +func Visio(raw []byte, limit uint32) bool { + return msoxml(raw, zipEntries{{ + name: []byte("visio/"), + dir: true, + }}, 100) } // Ole matches an Open Linking and Embedding file. @@ -27,17 +44,6 @@ func Ole(raw []byte, limit uint32) bool { return bytes.HasPrefix(raw, []byte{0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1}) } -// Aaf matches an Advanced Authoring Format file. -// See: https://pyaaf.readthedocs.io/en/latest/about.html -// See: https://en.wikipedia.org/wiki/Advanced_Authoring_Format -func Aaf(raw []byte, limit uint32) bool { - if len(raw) < 31 { - return false - } - return bytes.HasPrefix(raw[8:], []byte{0x41, 0x41, 0x46, 0x42, 0x0D, 0x00, 0x4F, 0x4D}) && - (raw[30] == 0x09 || raw[30] == 0x0C) -} - // Doc matches a Microsoft Word 97-2003 file. // See: https://github.com/decalage2/oletools/blob/412ee36ae45e70f42123e835871bac956d958461/oletools/common/clsid.py func Doc(raw []byte, _ uint32) bool { @@ -157,6 +163,14 @@ func Msi(raw []byte, limit uint32) bool { }) } +// One matches a Microsoft OneNote file. +func One(raw []byte, limit uint32) bool { + return bytes.HasPrefix(raw, []byte{ + 0xe4, 0x52, 0x5c, 0x7b, 0x8c, 0xd8, 0xa7, 0x4d, + 0xae, 0xb1, 0x53, 0x78, 0xd0, 0x29, 0x96, 0xd3, + }) +} + // Helper to match by a specific CLSID of a compound file. // // http://fileformats.archiveteam.org/wiki/Microsoft_Compound_File @@ -184,3 +198,14 @@ func matchOleClsid(in []byte, clsid []byte) bool { return bytes.HasPrefix(in[clsidOffset:], clsid) } + +// WPD matches a WordPerfect document. +func WPD(raw []byte, _ uint32) bool { + if len(raw) < 10 { + return false + } + if !bytes.HasPrefix(raw, []byte("\xffWPC")) { + return false + } + return raw[8] == 1 && raw[9] == 10 +} diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/netpbm.go b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/netpbm.go new file mode 100644 index 00000000000..4baa25767fc --- /dev/null +++ b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/netpbm.go @@ -0,0 +1,111 @@ +package magic + +import ( + "bytes" + "strconv" + + "github.com/gabriel-vasile/mimetype/internal/scan" +) + +// NetPBM matches a Netpbm Portable BitMap ASCII/Binary file. +// +// See: https://en.wikipedia.org/wiki/Netpbm +func NetPBM(raw []byte, _ uint32) bool { + return netp(raw, "P1\n", "P4\n") +} + +// NetPGM matches a Netpbm Portable GrayMap ASCII/Binary file. +// +// See: https://en.wikipedia.org/wiki/Netpbm +func NetPGM(raw []byte, _ uint32) bool { + return netp(raw, "P2\n", "P5\n") +} + +// NetPPM matches a Netpbm Portable PixMap ASCII/Binary file. +// +// See: https://en.wikipedia.org/wiki/Netpbm +func NetPPM(raw []byte, _ uint32) bool { + return netp(raw, "P3\n", "P6\n") +} + +// NetPAM matches a Netpbm Portable Arbitrary Map file. +// +// See: https://en.wikipedia.org/wiki/Netpbm +func NetPAM(raw []byte, _ uint32) bool { + if !bytes.HasPrefix(raw, []byte("P7\n")) { + return false + } + w, h, d, m, e := false, false, false, false, false + s := scan.Bytes(raw) + var l scan.Bytes + // Read line by line. + for i := 0; i < 128; i++ { + l = s.Line() + // If the line is empty or a comment, skip. + if len(l) == 0 || l.Peek() == '#' { + if len(s) == 0 { + return false + } + continue + } else if bytes.HasPrefix(l, []byte("TUPLTYPE")) { + continue + } else if bytes.HasPrefix(l, []byte("WIDTH ")) { + w = true + } else if bytes.HasPrefix(l, []byte("HEIGHT ")) { + h = true + } else if bytes.HasPrefix(l, []byte("DEPTH ")) { + d = true + } else if bytes.HasPrefix(l, []byte("MAXVAL ")) { + m = true + } else if bytes.HasPrefix(l, []byte("ENDHDR")) { + e = true + } + // When we reached header, return true if we collected all four required headers. + // WIDTH, HEIGHT, DEPTH and MAXVAL. + if e { + return w && h && d && m + } + } + return false +} + +func netp(s scan.Bytes, prefixes ...string) bool { + foundPrefix := "" + for _, p := range prefixes { + if bytes.HasPrefix(s, []byte(p)) { + foundPrefix = p + } + } + if foundPrefix == "" { + return false + } + s.Advance(len(foundPrefix)) // jump over P1, P2, P3, etc. + + var l scan.Bytes + // Read line by line. + for i := 0; i < 128; i++ { + l = s.Line() + // If the line is a comment, skip. + if l.Peek() == '#' { + continue + } + // If line has leading whitespace, then skip over whitespace. + for scan.ByteIsWS(l.Peek()) { + l.Advance(1) + } + if len(s) == 0 || len(l) > 0 { + break + } + } + + // At this point l should be the two integers denoting the size of the matrix. + width := l.PopUntil(scan.ASCIISpaces...) + for scan.ByteIsWS(l.Peek()) { + l.Advance(1) + } + height := l.PopUntil(scan.ASCIISpaces...) + + w, errw := strconv.ParseInt(string(width), 10, 64) + h, errh := strconv.ParseInt(string(height), 10, 64) + return errw == nil && errh == nil && w > 0 && h > 0 +} diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/text.go b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/text.go index 8178e4707c7..fb84e8543d3 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/text.go +++ b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/text.go @@ -6,11 +6,13 @@ import ( "github.com/gabriel-vasile/mimetype/internal/charset" "github.com/gabriel-vasile/mimetype/internal/json" + mkup "github.com/gabriel-vasile/mimetype/internal/markup" + "github.com/gabriel-vasile/mimetype/internal/scan" ) -var ( - // HTML matches a Hypertext Markup Language file. - HTML = markup( +// HTML matches a Hypertext Markup Language file. +func HTML(raw []byte, _ uint32) bool { + return markup(raw, []byte(" +// +// +// +func svgWithoutXMLDeclaration(s scan.Bytes) bool { + for scan.ByteIsWS(s.Peek()) { + s.Advance(1) + } + for mkup.SkipAComment(&s) { + } + if !bytes.HasPrefix(s, []byte(" +// +// +// +func svgWithXMLDeclaration(s scan.Bytes) bool { + for scan.ByteIsWS(s.Peek()) { + s.Advance(1) + } + if !bytes.HasPrefix(s, []byte(" 4096 { + s = s[:4096] + } + return hasVersion && bytes.Contains(s, []byte(" 00:02:19,376) limits second line // length to exactly 29 characters. if len(line) != 29 { @@ -266,7 +507,7 @@ func Srt(raw []byte, _ uint32) bool { return false } - line, _ = scanLine(raw) + line = s.Line() // A third line must exist and not be empty. This is the actual subtitle text. return len(line) != 0 } @@ -295,15 +536,3 @@ func Vtt(raw []byte, limit uint32) bool { return bytes.Equal(raw, []byte{0xEF, 0xBB, 0xBF, 0x57, 0x45, 0x42, 0x56, 0x54, 0x54}) || // UTF-8 BOM and "WEBVTT" bytes.Equal(raw, []byte{0x57, 0x45, 0x42, 0x56, 0x54, 0x54}) // "WEBVTT" } - -// dropCR drops a terminal \r from the data. -func dropCR(data []byte) []byte { - if len(data) > 0 && data[len(data)-1] == '\r' { - return data[0 : len(data)-1] - } - return data -} -func scanLine(b []byte) (line, remainder []byte) { - line, remainder, _ = bytes.Cut(b, []byte("\n")) - return dropCR(line), remainder -} diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/text_csv.go b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/text_csv.go index 6083ba8c00c..020b5ee75bd 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/text_csv.go +++ b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/text_csv.go @@ -1,77 +1,43 @@ package magic import ( - "bufio" - "bytes" - "encoding/csv" - "errors" - "io" - "sync" + "github.com/gabriel-vasile/mimetype/internal/csv" + "github.com/gabriel-vasile/mimetype/internal/scan" ) -// A bufio.Reader pool to alleviate problems with memory allocations. -var readerPool = sync.Pool{ - New: func() any { - // Initiate with empty source reader. - return bufio.NewReader(nil) - }, -} - -func newReader(r io.Reader) *bufio.Reader { - br := readerPool.Get().(*bufio.Reader) - br.Reset(r) - return br -} - -// Csv matches a comma-separated values file. -func Csv(raw []byte, limit uint32) bool { +// CSV matches a comma-separated values file. +func CSV(raw []byte, limit uint32) bool { return sv(raw, ',', limit) } -// Tsv matches a tab-separated values file. -func Tsv(raw []byte, limit uint32) bool { +// TSV matches a tab-separated values file. +func TSV(raw []byte, limit uint32) bool { return sv(raw, '\t', limit) } -func sv(in []byte, comma rune, limit uint32) bool { - in = dropLastLine(in, limit) - - br := newReader(bytes.NewReader(in)) - defer readerPool.Put(br) - r := csv.NewReader(br) - r.Comma = comma - r.ReuseRecord = true - r.LazyQuotes = true - r.Comment = '#' +func sv(in []byte, comma byte, limit uint32) bool { + s := scan.Bytes(in) + s.DropLastLine(limit) + r := csv.NewParser(comma, '#', s) - lines := 0 + headerFields, _, hasMore := r.CountFields(false) + if headerFields < 2 || !hasMore { + return false + } + csvLines := 1 // 1 for header for { - _, err := r.Read() - if errors.Is(err, io.EOF) { + fields, _, hasMore := r.CountFields(false) + if !hasMore && fields == 0 { break } - if err != nil { + csvLines++ + if fields != headerFields { return false } - lines++ - } - - return r.FieldsPerRecord > 1 && lines > 1 -} - -// dropLastLine drops the last incomplete line from b. -// -// mimetype limits itself to ReadLimit bytes when performing a detection. -// This means, for file formats like CSV for NDJSON, the last line of the input -// can be an incomplete line. -func dropLastLine(b []byte, readLimit uint32) []byte { - if readLimit == 0 || uint32(len(b)) < readLimit { - return b - } - for i := len(b) - 1; i > 0; i-- { - if b[i] == '\n' { - return b[:i] + if csvLines >= 10 { + return true } } - return b + + return csvLines >= 2 } diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/video.go b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/video.go index 9caf55538a3..830c5ed2040 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/video.go +++ b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/video.go @@ -4,17 +4,23 @@ import ( "bytes" ) -var ( - // Flv matches a Flash video file. - Flv = prefix([]byte("\x46\x4C\x56\x01")) - // Asf matches an Advanced Systems Format file. - Asf = prefix([]byte{ +// Flv matches a Flash video file. +func Flv(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte("\x46\x4C\x56\x01")) +} + +// Asf matches an Advanced Systems Format file. +func Asf(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{ 0x30, 0x26, 0xB2, 0x75, 0x8E, 0x66, 0xCF, 0x11, 0xA6, 0xD9, 0x00, 0xAA, 0x00, 0x62, 0xCE, 0x6C, }) - // Rmvb matches a RealMedia Variable Bitrate file. - Rmvb = prefix([]byte{0x2E, 0x52, 0x4D, 0x46}) -) +} + +// Rmvb matches a RealMedia Variable Bitrate file. +func Rmvb(raw []byte, _ uint32) bool { + return bytes.HasPrefix(raw, []byte{0x2E, 0x52, 0x4D, 0x46}) +} // WebM matches a WebM file. func WebM(raw []byte, limit uint32) bool { diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/zip.go b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/zip.go index f6c64829d92..31f42482d99 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/internal/magic/zip.go +++ b/vendor/github.com/gabriel-vasile/mimetype/internal/magic/zip.go @@ -2,36 +2,70 @@ package magic import ( "bytes" - "encoding/binary" -) -var ( - // Odt matches an OpenDocument Text file. - Odt = offset([]byte("mimetypeapplication/vnd.oasis.opendocument.text"), 30) - // Ott matches an OpenDocument Text Template file. - Ott = offset([]byte("mimetypeapplication/vnd.oasis.opendocument.text-template"), 30) - // Ods matches an OpenDocument Spreadsheet file. - Ods = offset([]byte("mimetypeapplication/vnd.oasis.opendocument.spreadsheet"), 30) - // Ots matches an OpenDocument Spreadsheet Template file. - Ots = offset([]byte("mimetypeapplication/vnd.oasis.opendocument.spreadsheet-template"), 30) - // Odp matches an OpenDocument Presentation file. - Odp = offset([]byte("mimetypeapplication/vnd.oasis.opendocument.presentation"), 30) - // Otp matches an OpenDocument Presentation Template file. - Otp = offset([]byte("mimetypeapplication/vnd.oasis.opendocument.presentation-template"), 30) - // Odg matches an OpenDocument Drawing file. - Odg = offset([]byte("mimetypeapplication/vnd.oasis.opendocument.graphics"), 30) - // Otg matches an OpenDocument Drawing Template file. - Otg = offset([]byte("mimetypeapplication/vnd.oasis.opendocument.graphics-template"), 30) - // Odf matches an OpenDocument Formula file. - Odf = offset([]byte("mimetypeapplication/vnd.oasis.opendocument.formula"), 30) - // Odc matches an OpenDocument Chart file. - Odc = offset([]byte("mimetypeapplication/vnd.oasis.opendocument.chart"), 30) - // Epub matches an EPUB file. - Epub = offset([]byte("mimetypeapplication/epub+zip"), 30) - // Sxc matches an OpenOffice Spreadsheet file. - Sxc = offset([]byte("mimetypeapplication/vnd.sun.xml.calc"), 30) + "github.com/gabriel-vasile/mimetype/internal/scan" ) +// Odt matches an OpenDocument Text file. +func Odt(raw []byte, _ uint32) bool { + return offset(raw, []byte("mimetypeapplication/vnd.oasis.opendocument.text"), 30) +} + +// Ott matches an OpenDocument Text Template file. +func Ott(raw []byte, _ uint32) bool { + return offset(raw, []byte("mimetypeapplication/vnd.oasis.opendocument.text-template"), 30) +} + +// Ods matches an OpenDocument Spreadsheet file. +func Ods(raw []byte, _ uint32) bool { + return offset(raw, []byte("mimetypeapplication/vnd.oasis.opendocument.spreadsheet"), 30) +} + +// Ots matches an OpenDocument Spreadsheet Template file. +func Ots(raw []byte, _ uint32) bool { + return offset(raw, []byte("mimetypeapplication/vnd.oasis.opendocument.spreadsheet-template"), 30) +} + +// Odp matches an OpenDocument Presentation file. +func Odp(raw []byte, _ uint32) bool { + return offset(raw, []byte("mimetypeapplication/vnd.oasis.opendocument.presentation"), 30) +} + +// Otp matches an OpenDocument Presentation Template file. +func Otp(raw []byte, _ uint32) bool { + return offset(raw, []byte("mimetypeapplication/vnd.oasis.opendocument.presentation-template"), 30) +} + +// Odg matches an OpenDocument Drawing file. +func Odg(raw []byte, _ uint32) bool { + return offset(raw, []byte("mimetypeapplication/vnd.oasis.opendocument.graphics"), 30) +} + +// Otg matches an OpenDocument Drawing Template file. +func Otg(raw []byte, _ uint32) bool { + return offset(raw, []byte("mimetypeapplication/vnd.oasis.opendocument.graphics-template"), 30) +} + +// Odf matches an OpenDocument Formula file. +func Odf(raw []byte, _ uint32) bool { + return offset(raw, []byte("mimetypeapplication/vnd.oasis.opendocument.formula"), 30) +} + +// Odc matches an OpenDocument Chart file. +func Odc(raw []byte, _ uint32) bool { + return offset(raw, []byte("mimetypeapplication/vnd.oasis.opendocument.chart"), 30) +} + +// Epub matches an EPUB file. +func Epub(raw []byte, _ uint32) bool { + return offset(raw, []byte("mimetypeapplication/epub+zip"), 30) +} + +// Sxc matches an OpenOffice Spreadsheet file. +func Sxc(raw []byte, _ uint32) bool { + return offset(raw, []byte("mimetypeapplication/vnd.sun.xml.calc"), 30) +} + // Zip matches a zip archive. func Zip(raw []byte, limit uint32) bool { return len(raw) > 3 && @@ -40,92 +74,149 @@ func Zip(raw []byte, limit uint32) bool { (raw[3] == 0x4 || raw[3] == 0x6 || raw[3] == 0x8) } -// Jar matches a Java archive file. +// Jar matches a Java archive file. There are two types of Jar files: +// 1. the ones that can be opened with jexec and have 0xCAFE optional flag +// https://stackoverflow.com/tags/executable-jar/info +// 2. regular jars, same as above, just without the executable flag +// https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=262278#c0 +// There is an argument to only check for manifest, since it's the common nominator +// for both executable and non-executable versions. But the traversing zip entries +// is unreliable because it does linear search for signatures +// (instead of relying on offsets told by the file.) func Jar(raw []byte, limit uint32) bool { - return zipContains(raw, []byte("META-INF/MANIFEST.MF"), false) + return executableJar(raw) || + zipHas(raw, zipEntries{{ + name: []byte("META-INF/MANIFEST.MF"), + }, { + name: []byte("META-INF/"), + }}, 1) } -func zipContains(raw, sig []byte, msoCheck bool) bool { - b := readBuf(raw) - pk := []byte("PK\003\004") - if len(b) < 0x1E { - return false - } +// KMZ matches a zipped KML file, which is "doc.kml" by convention. +func KMZ(raw []byte, _ uint32) bool { + return zipHas(raw, zipEntries{{ + name: []byte("doc.kml"), + }}, 100) +} - if !b.advance(0x1E) { +// An executable Jar has a 0xCAFE flag enabled in the first zip entry. +// The rule from file/file is: +// >(26.s+30) leshort 0xcafe Java archive data (JAR) +func executableJar(b scan.Bytes) bool { + b.Advance(0x1A) + offset, ok := b.Uint16() + if !ok { return false } - if bytes.HasPrefix(b, sig) { - return true - } + b.Advance(int(offset) + 2) - if msoCheck { - skipFiles := [][]byte{ - []byte("[Content_Types].xml"), - []byte("_rels/.rels"), - []byte("docProps"), - []byte("customXml"), - []byte("[trash]"), - } + cafe, ok := b.Uint16() + return ok && cafe == 0xCAFE +} - hasSkipFile := false - for _, sf := range skipFiles { - if bytes.HasPrefix(b, sf) { - hasSkipFile = true - break - } +// zipIterator iterates over a zip file returning the name of the zip entries +// in that file. +type zipIterator struct { + b scan.Bytes +} + +type zipEntries []struct { + name []byte + dir bool // dir means checking just the prefix of the entry, not the whole path +} + +func (z zipEntries) match(file []byte) bool { + for i := range z { + if z[i].dir && bytes.HasPrefix(file, z[i].name) { + return true } - if !hasSkipFile { - return false + if bytes.Equal(file, z[i].name) { + return true } } + return false +} - searchOffset := binary.LittleEndian.Uint32(raw[18:]) + 49 - if !b.advance(int(searchOffset)) { - return false +func zipHas(raw scan.Bytes, searchFor zipEntries, stopAfter int) bool { + iter := zipIterator{raw} + for i := 0; i < stopAfter; i++ { + f := iter.next() + if len(f) == 0 { + break + } + if searchFor.match(f) { + return true + } } - nextHeader := bytes.Index(raw[searchOffset:], pk) - if !b.advance(nextHeader) { - return false - } - if bytes.HasPrefix(b, sig) { - return true - } + return false +} - for i := 0; i < 4; i++ { - if !b.advance(0x1A) { - return false - } - nextHeader = bytes.Index(b, pk) - if nextHeader == -1 { - return false +// msoxml behaves like zipHas, but it puts restrictions on what the first zip +// entry can be. +func msoxml(raw scan.Bytes, searchFor zipEntries, stopAfter int) bool { + iter := zipIterator{raw} + for i := 0; i < stopAfter; i++ { + f := iter.next() + if len(f) == 0 { + break } - if !b.advance(nextHeader + 0x1E) { - return false - } - if bytes.HasPrefix(b, sig) { + if searchFor.match(f) { return true } + // If the first is not one of the next usually expected entries, + // then abort this check. + if i == 0 { + if !bytes.Equal(f, []byte("[Content_Types].xml")) && // this is a file + !bytes.HasPrefix(f, []byte("_rels/")) && // these are directories + !bytes.HasPrefix(f, []byte("docProps/")) && + !bytes.HasPrefix(f, []byte("customXml/")) && + !bytes.HasPrefix(f, []byte("[trash]/")) { + return false + } + } } + return false } -// APK matches an Android Package Archive. -// The source of signatures is https://github.com/file/file/blob/1778642b8ba3d947a779a36fcd81f8e807220a19/magic/Magdir/archive#L1820-L1887 -func APK(raw []byte, _ uint32) bool { - apkSignatures := [][]byte{ - []byte("AndroidManifest.xml"), - []byte("META-INF/com/android/build/gradle/app-metadata.properties"), - []byte("classes.dex"), - []byte("resources.arsc"), - []byte("res/drawable"), +// next extracts the name of the next zip entry. +func (i *zipIterator) next() []byte { + pk := []byte("PK\003\004") + + n := bytes.Index(i.b, pk) + if n == -1 { + return nil } - for _, sig := range apkSignatures { - if zipContains(raw, sig, false) { - return true - } + i.b.Advance(n) + if !i.b.Advance(0x1A) { + return nil } + l, ok := i.b.Uint16() + if !ok { + return nil + } + if !i.b.Advance(0x02) { + return nil + } + if len(i.b) < int(l) { + return nil + } + return i.b[:l] +} - return false +// APK matches an Android Package Archive. +// The source of signatures is https://github.com/file/file/blob/1778642b8ba3d947a779a36fcd81f8e807220a19/magic/Magdir/archive#L1820-L1887 +func APK(raw []byte, _ uint32) bool { + return zipHas(raw, zipEntries{{ + name: []byte("AndroidManifest.xml"), + }, { + name: []byte("META-INF/com/android/build/gradle/app-metadata.properties"), + }, { + name: []byte("classes.dex"), + }, { + name: []byte("resources.arsc"), + }, { + name: []byte("res/drawable"), + }}, 100) } diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/markup/markup.go b/vendor/github.com/gabriel-vasile/mimetype/internal/markup/markup.go new file mode 100644 index 00000000000..b9abc6dab19 --- /dev/null +++ b/vendor/github.com/gabriel-vasile/mimetype/internal/markup/markup.go @@ -0,0 +1,105 @@ +// Package markup implements functions for extracting info from +// HTML and XML documents. +package markup + +import ( + "bytes" + + "github.com/gabriel-vasile/mimetype/internal/scan" +) + +// GetAnAttribute assumes we passed over an SGML tag and extracts first +// attribute and its value. +// +// Initially, this code existed inside charset/charset.go, because it was part of +// implementing the https://html.spec.whatwg.org/multipage/parsing.html#prescan-a-byte-stream-to-determine-its-encoding +// algorithm. But because extracting an attribute from a tag is the same for +// both HTML and XML, then the code was moved here. +func GetAnAttribute(s *scan.Bytes) (name, val []byte, hasMore bool) { + for scan.ByteIsWS(s.Peek()) || s.Peek() == '/' { + s.Advance(1) + } + if s.Peek() == '>' { + return nil, nil, false + } + origS, end := *s, 0 + // step 4 and 5 + for { + // bap means byte at position in the specification. + bap := s.Pop() + if bap == 0 { + return nil, nil, false + } + if bap == '=' && end > 0 { + val, hasMore := getAValue(s) + return origS[:end], val, hasMore + } else if scan.ByteIsWS(bap) { + for scan.ByteIsWS(s.Peek()) { + s.Advance(1) + } + if s.Peek() != '=' { + return origS[:end], nil, true + } + s.Advance(1) + for scan.ByteIsWS(s.Peek()) { + s.Advance(1) + } + val, hasMore := getAValue(s) + return origS[:end], val, hasMore + } else if bap == '/' || bap == '>' { + return origS[:end], nil, false + } else { // for any ASCII, non-ASCII, just advance + end++ + } + } +} + +func getAValue(s *scan.Bytes) (_ []byte, hasMore bool) { + for scan.ByteIsWS(s.Peek()) { + s.Advance(1) + } + origS, end := *s, 0 + bap := s.Pop() + if bap == 0 { + return nil, false + } + end++ + // Step 10 + switch bap { + case '"', '\'': + val := s.PopUntil(bap) + if s.Pop() != bap { + return nil, false + } + return val, s.Peek() != 0 && s.Peek() != '>' + case '>': + return nil, false + } + + // Step 11 + for { + bap = s.Pop() + if bap == 0 { + return nil, false + } + switch { + case scan.ByteIsWS(bap): + return origS[:end], true + case bap == '>': + return origS[:end], false + default: + end++ + } + } +} + +func SkipAComment(s *scan.Bytes) (skipped bool) { + if bytes.HasPrefix(*s, []byte("")); i != -1 { + s.Advance(i + 2 + 3) // 2 comes from len(). + return true + } + } + return false +} diff --git a/vendor/github.com/gabriel-vasile/mimetype/internal/scan/bytes.go b/vendor/github.com/gabriel-vasile/mimetype/internal/scan/bytes.go new file mode 100644 index 00000000000..b19a9492627 --- /dev/null +++ b/vendor/github.com/gabriel-vasile/mimetype/internal/scan/bytes.go @@ -0,0 +1,262 @@ +// Package scan has functions for scanning byte slices. +package scan + +import ( + "bytes" + "encoding/binary" +) + +// Bytes is a byte slice with helper methods for easier scanning. +type Bytes []byte + +func (b *Bytes) Advance(n int) bool { + if n < 0 || len(*b) < n { + return false + } + *b = (*b)[n:] + return true +} + +// TrimLWS trims whitespace from beginning of the bytes. +func (b *Bytes) TrimLWS() { + firstNonWS := 0 + for ; firstNonWS < len(*b) && ByteIsWS((*b)[firstNonWS]); firstNonWS++ { + } + + *b = (*b)[firstNonWS:] +} + +// TrimRWS trims whitespace from the end of the bytes. +func (b *Bytes) TrimRWS() { + lb := len(*b) + for lb > 0 && ByteIsWS((*b)[lb-1]) { + *b = (*b)[:lb-1] + lb-- + } +} + +// Peek one byte from b or 0x00 if b is empty. +func (b *Bytes) Peek() byte { + if len(*b) > 0 { + return (*b)[0] + } + return 0 +} + +// Pop one byte from b or 0x00 if b is empty. +func (b *Bytes) Pop() byte { + if len(*b) > 0 { + ret := (*b)[0] + *b = (*b)[1:] + return ret + } + return 0 +} + +// PopN pops n bytes from b or nil if b is empty. +func (b *Bytes) PopN(n int) []byte { + if len(*b) >= n { + ret := (*b)[:n] + *b = (*b)[n:] + return ret + } + return nil +} + +// PopUntil will advance b until, but not including, the first occurence of stopAt +// character. If no occurence is found, then it will advance until the end of b. +// The returned Bytes is a slice of all the bytes that we're advanced over. +func (b *Bytes) PopUntil(stopAt ...byte) Bytes { + if len(*b) == 0 { + return Bytes{} + } + i := bytes.IndexAny(*b, string(stopAt)) + if i == -1 { + i = len(*b) + } + + prefix := (*b)[:i] + *b = (*b)[i:] + return Bytes(prefix) +} + +// ReadSlice is the same as PopUntil, but the returned value includes stopAt as well. +func (b *Bytes) ReadSlice(stopAt byte) Bytes { + if len(*b) == 0 { + return Bytes{} + } + i := bytes.IndexByte(*b, stopAt) + if i == -1 { + i = len(*b) + } else { + i++ + } + + prefix := (*b)[:i] + *b = (*b)[i:] + return Bytes(prefix) +} + +// Line returns the first line from b and advances b with the length of the +// line. One new line character is trimmed after the line if it exists. +func (b *Bytes) Line() Bytes { + line := b.PopUntil('\n') + lline := len(line) + if lline > 0 && line[lline-1] == '\r' { + line = line[:lline-1] + } + b.Advance(1) + return line +} + +// DropLastLine drops the last incomplete line from b. +// +// mimetype limits itself to ReadLimit bytes when performing a detection. +// This means, for file formats like CSV for NDJSON, the last line of the input +// can be an incomplete line. +// If b length is less than readLimit, it means we received an incomplete file +// and proceed with dropping the last line. +func (b *Bytes) DropLastLine(readLimit uint32) { + if readLimit == 0 || uint32(len(*b)) < readLimit { + return + } + + for i := len(*b) - 1; i > 0; i-- { + if (*b)[i] == '\n' { + *b = (*b)[:i] + return + } + } +} + +func (b *Bytes) Uint16() (uint16, bool) { + if len(*b) < 2 { + return 0, false + } + v := binary.LittleEndian.Uint16(*b) + *b = (*b)[2:] + return v, true +} + +type Flags int + +const ( + // CompactWS will make one whitespace from pattern to match one or more spaces from input. + CompactWS Flags = 1 << iota + // IgnoreCase will match lower case from pattern with lower case from input. + // IgnoreCase will match upper case from pattern with both lower and upper case from input. + // This flag is not really well named, + IgnoreCase + // FullWord ensures the input ends with a full word (it's followed by spaces.) + FullWord +) + +// Search for occurences of pattern p inside b at any index. +// It returns the index where p was found in b and how many bytes were needed +// for matching the pattern. +func (b Bytes) Search(p []byte, flags Flags) (i int, l int) { + lb, lp := len(b), len(p) + if lp == 0 { + return 0, 0 + } + if lb == 0 { + return -1, 0 + } + if flags == 0 { + if i = bytes.Index(b, p); i == -1 { + return -1, 0 + } else { + return i, lp + } + } + + for i := range b { + if lb-i < lp { + return -1, 0 + } + if l = b[i:].Match(p, flags); l != -1 { + return i, l + } + } + + return -1, 0 +} + +// Match returns how many bytes were needed to match pattern p. +// It returns -1 if p does not match b. +func (b Bytes) Match(p []byte, flags Flags) int { + l := len(b) + if len(p) == 0 { + return 0 + } + if l == 0 { + return -1 + } + // If no flags, or scanning for full word at the end of pattern then + // do a fast HasPrefix check. + // For other flags it's not possible to use HasPrefix. + if flags == 0 || flags&FullWord > 0 { + if bytes.HasPrefix(b, p) { + b = b[len(p):] + p = p[len(p):] + goto out + } + return -1 + } + for len(b) > 0 { + // If we finished all we were looking for from p. + if len(p) == 0 { + goto out + } + if flags&IgnoreCase > 0 && isUpper(p[0]) { + if upper(b[0]) != p[0] { + return -1 + } + b, p = b[1:], p[1:] + } else if flags&CompactWS > 0 && ByteIsWS(p[0]) { + p = p[1:] + if !ByteIsWS(b[0]) { + return -1 + } + b = b[1:] + if !ByteIsWS(p[0]) { + b.TrimLWS() + } + } else { + if b[0] != p[0] { + return -1 + } + b, p = b[1:], p[1:] + } + } +out: + // If p still has leftover characters, it means it didn't fully match b. + if len(p) > 0 { + return -1 + } + if flags&FullWord > 0 { + if len(b) > 0 && !ByteIsWS(b[0]) { + return -1 + } + } + return l - len(b) +} + +func isUpper(c byte) bool { + return c >= 'A' && c <= 'Z' +} +func upper(c byte) byte { + if c >= 'a' && c <= 'z' { + return c - ('a' - 'A') + } + return c +} + +func ByteIsWS(b byte) bool { + return b == '\t' || b == '\n' || b == '\x0c' || b == '\r' || b == ' ' +} + +var ( + ASCIISpaces = []byte{' ', '\r', '\n', '\x0c', '\t'} + ASCIIDigits = []byte{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'} +) diff --git a/vendor/github.com/gabriel-vasile/mimetype/mime.go b/vendor/github.com/gabriel-vasile/mimetype/mime.go index 62cb15f5932..ec2bc5bf07f 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/mime.go +++ b/vendor/github.com/gabriel-vasile/mimetype/mime.go @@ -2,6 +2,7 @@ package mimetype import ( "mime" + "strings" "github.com/gabriel-vasile/mimetype/internal/charset" "github.com/gabriel-vasile/mimetype/internal/magic" @@ -103,15 +104,17 @@ func (m *MIME) match(in []byte, readLimit uint32) *MIME { "text/html": charset.FromHTML, "text/xml": charset.FromXML, } - // ps holds optional MIME parameters. - ps := map[string]string{} + charset := "" if f, ok := needsCharset[m.mime]; ok { - if cset := f(in); cset != "" { - ps["charset"] = cset - } + // The charset comes from BOM, from HTML headers, from XML headers. + // Limit the number of bytes searched for to 1024. + charset = f(in[:min(len(in), 1024)]) + } + if m == root || charset == "" { + return m } - return m.cloneHierarchy(ps) + return m.cloneHierarchy(charset) } // flatten transforms an hierarchy of MIMEs into a slice of MIMEs. @@ -124,11 +127,32 @@ func (m *MIME) flatten() []*MIME { return out } +// hierarchy returns an easy to read list of ancestors for m. +// For example, application/json would return json>txt>root. +func (m *MIME) hierarchy() string { + h := "" + for m := m; m != nil; m = m.Parent() { + e := strings.TrimPrefix(m.Extension(), ".") + if e == "" { + // There are some MIME without extensions. When generating the hierarchy, + // it would be confusing to use empty string as extension. + // Use the subtype instead; ex: application/x-executable -> x-executable. + e = strings.Split(m.String(), "/")[1] + if m.Is("application/octet-stream") { + // for octet-stream use root, because it's short and used in many places + e = "root" + } + } + h += ">" + e + } + return strings.TrimPrefix(h, ">") +} + // clone creates a new MIME with the provided optional MIME parameters. -func (m *MIME) clone(ps map[string]string) *MIME { +func (m *MIME) clone(charset string) *MIME { clonedMIME := m.mime - if len(ps) > 0 { - clonedMIME = mime.FormatMediaType(m.mime, ps) + if charset != "" { + clonedMIME = m.mime + "; charset=" + charset } return &MIME{ @@ -140,11 +164,11 @@ func (m *MIME) clone(ps map[string]string) *MIME { // cloneHierarchy creates a clone of m and all its ancestors. The optional MIME // parameters are set on the last child of the hierarchy. -func (m *MIME) cloneHierarchy(ps map[string]string) *MIME { - ret := m.clone(ps) +func (m *MIME) cloneHierarchy(charset string) *MIME { + ret := m.clone(charset) lastChild := ret for p := m.Parent(); p != nil; p = p.Parent() { - pClone := p.clone(nil) + pClone := p.clone("") lastChild.parent = pClone lastChild = pClone } @@ -153,7 +177,10 @@ func (m *MIME) cloneHierarchy(ps map[string]string) *MIME { } func (m *MIME) lookup(mime string) *MIME { - for _, n := range append(m.aliases, m.mime) { + if mime == m.mime { + return m + } + for _, n := range m.aliases { if n == mime { return m } diff --git a/vendor/github.com/gabriel-vasile/mimetype/mimetype.go b/vendor/github.com/gabriel-vasile/mimetype/mimetype.go index d8d512b8062..792741732b7 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/mimetype.go +++ b/vendor/github.com/gabriel-vasile/mimetype/mimetype.go @@ -12,7 +12,7 @@ import ( "sync/atomic" ) -var defaultLimit uint32 = 3072 +const defaultLimit uint32 = 3072 // readLimit is the maximum number of bytes from the input used when detecting. var readLimit uint32 = defaultLimit @@ -112,15 +112,18 @@ func SetLimit(limit uint32) { } // Extend adds detection for other file formats. -// It is equivalent to calling Extend() on the root mime type "application/octet-stream". +// It is equivalent to calling Extend() on the root MIME type "application/octet-stream". func Extend(detector func(raw []byte, limit uint32) bool, mime, extension string, aliases ...string) { root.Extend(detector, mime, extension, aliases...) } // Lookup finds a MIME object by its string representation. -// The representation can be the main mime type, or any of its aliases. -func Lookup(mime string) *MIME { +// The representation can be the main MIME type, or any of its aliases. +func Lookup(m string) *MIME { + // We store the MIME types without optional params, so + // perform parsing to extract the target MIME type without optional params. + m, _, _ = mime.ParseMediaType(m) mu.RLock() defer mu.RUnlock() - return root.lookup(mime) + return root.lookup(m) } diff --git a/vendor/github.com/gabriel-vasile/mimetype/supported_mimes.md b/vendor/github.com/gabriel-vasile/mimetype/supported_mimes.md index 6f45bfbb648..241a81f4af3 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/supported_mimes.md +++ b/vendor/github.com/gabriel-vasile/mimetype/supported_mimes.md @@ -1,184 +1,197 @@ -## 179 Supported MIME types +## 192 Supported MIME types This file is automatically generated when running tests. Do not edit manually. -Extension | MIME type | Aliases ---------- | --------- | ------- -**n/a** | application/octet-stream | - -**.xpm** | image/x-xpixmap | - -**.7z** | application/x-7z-compressed | - -**.zip** | application/zip | application/x-zip, application/x-zip-compressed -**.xlsx** | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | - -**.docx** | application/vnd.openxmlformats-officedocument.wordprocessingml.document | - -**.pptx** | application/vnd.openxmlformats-officedocument.presentationml.presentation | - -**.epub** | application/epub+zip | - -**.apk** | application/vnd.android.package-archive | - -**.jar** | application/jar | - -**.odt** | application/vnd.oasis.opendocument.text | application/x-vnd.oasis.opendocument.text -**.ott** | application/vnd.oasis.opendocument.text-template | application/x-vnd.oasis.opendocument.text-template -**.ods** | application/vnd.oasis.opendocument.spreadsheet | application/x-vnd.oasis.opendocument.spreadsheet -**.ots** | application/vnd.oasis.opendocument.spreadsheet-template | application/x-vnd.oasis.opendocument.spreadsheet-template -**.odp** | application/vnd.oasis.opendocument.presentation | application/x-vnd.oasis.opendocument.presentation -**.otp** | application/vnd.oasis.opendocument.presentation-template | application/x-vnd.oasis.opendocument.presentation-template -**.odg** | application/vnd.oasis.opendocument.graphics | application/x-vnd.oasis.opendocument.graphics -**.otg** | application/vnd.oasis.opendocument.graphics-template | application/x-vnd.oasis.opendocument.graphics-template -**.odf** | application/vnd.oasis.opendocument.formula | application/x-vnd.oasis.opendocument.formula -**.odc** | application/vnd.oasis.opendocument.chart | application/x-vnd.oasis.opendocument.chart -**.sxc** | application/vnd.sun.xml.calc | - -**.pdf** | application/pdf | application/x-pdf -**.fdf** | application/vnd.fdf | - -**n/a** | application/x-ole-storage | - -**.msi** | application/x-ms-installer | application/x-windows-installer, application/x-msi -**.aaf** | application/octet-stream | - -**.msg** | application/vnd.ms-outlook | - -**.xls** | application/vnd.ms-excel | application/msexcel -**.pub** | application/vnd.ms-publisher | - -**.ppt** | application/vnd.ms-powerpoint | application/mspowerpoint -**.doc** | application/msword | application/vnd.ms-word -**.ps** | application/postscript | - -**.psd** | image/vnd.adobe.photoshop | image/x-psd, application/photoshop -**.p7s** | application/pkcs7-signature | - -**.ogg** | application/ogg | application/x-ogg -**.oga** | audio/ogg | - -**.ogv** | video/ogg | - -**.png** | image/png | - -**.png** | image/vnd.mozilla.apng | - -**.jpg** | image/jpeg | - -**.jxl** | image/jxl | - -**.jp2** | image/jp2 | - -**.jpf** | image/jpx | - -**.jpm** | image/jpm | video/jpm -**.jxs** | image/jxs | - -**.gif** | image/gif | - -**.webp** | image/webp | - -**.exe** | application/vnd.microsoft.portable-executable | - -**n/a** | application/x-elf | - -**n/a** | application/x-object | - -**n/a** | application/x-executable | - -**.so** | application/x-sharedlib | - -**n/a** | application/x-coredump | - -**.a** | application/x-archive | application/x-unix-archive -**.deb** | application/vnd.debian.binary-package | - -**.tar** | application/x-tar | - -**.xar** | application/x-xar | - -**.bz2** | application/x-bzip2 | - -**.fits** | application/fits | - -**.tiff** | image/tiff | - -**.bmp** | image/bmp | image/x-bmp, image/x-ms-bmp -**.ico** | image/x-icon | - -**.mp3** | audio/mpeg | audio/x-mpeg, audio/mp3 -**.flac** | audio/flac | - -**.midi** | audio/midi | audio/mid, audio/sp-midi, audio/x-mid, audio/x-midi -**.ape** | audio/ape | - -**.mpc** | audio/musepack | - -**.amr** | audio/amr | audio/amr-nb -**.wav** | audio/wav | audio/x-wav, audio/vnd.wave, audio/wave -**.aiff** | audio/aiff | audio/x-aiff -**.au** | audio/basic | - -**.mpeg** | video/mpeg | - -**.mov** | video/quicktime | - -**.mp4** | video/mp4 | - -**.avif** | image/avif | - -**.3gp** | video/3gpp | video/3gp, audio/3gpp -**.3g2** | video/3gpp2 | video/3g2, audio/3gpp2 -**.mp4** | audio/mp4 | audio/x-mp4a -**.mqv** | video/quicktime | - -**.m4a** | audio/x-m4a | - -**.m4v** | video/x-m4v | - -**.heic** | image/heic | - -**.heic** | image/heic-sequence | - -**.heif** | image/heif | - -**.heif** | image/heif-sequence | - -**.mj2** | video/mj2 | - -**.dvb** | video/vnd.dvb.file | - -**.webm** | video/webm | audio/webm -**.avi** | video/x-msvideo | video/avi, video/msvideo -**.flv** | video/x-flv | - -**.mkv** | video/x-matroska | - -**.asf** | video/x-ms-asf | video/asf, video/x-ms-wmv -**.aac** | audio/aac | - -**.voc** | audio/x-unknown | - -**.m3u** | application/vnd.apple.mpegurl | audio/mpegurl -**.rmvb** | application/vnd.rn-realmedia-vbr | - -**.gz** | application/gzip | application/x-gzip, application/x-gunzip, application/gzipped, application/gzip-compressed, application/x-gzip-compressed, gzip/document -**.class** | application/x-java-applet | - -**.swf** | application/x-shockwave-flash | - -**.crx** | application/x-chrome-extension | - -**.ttf** | font/ttf | font/sfnt, application/x-font-ttf, application/font-sfnt -**.woff** | font/woff | - -**.woff2** | font/woff2 | - -**.otf** | font/otf | - -**.ttc** | font/collection | - -**.eot** | application/vnd.ms-fontobject | - -**.wasm** | application/wasm | - -**.shx** | application/vnd.shx | - -**.shp** | application/vnd.shp | - -**.dbf** | application/x-dbf | - -**.dcm** | application/dicom | - -**.rar** | application/x-rar-compressed | application/x-rar -**.djvu** | image/vnd.djvu | - -**.mobi** | application/x-mobipocket-ebook | - -**.lit** | application/x-ms-reader | - -**.bpg** | image/bpg | - -**.cbor** | application/cbor | - -**.sqlite** | application/vnd.sqlite3 | application/x-sqlite3 -**.dwg** | image/vnd.dwg | image/x-dwg, application/acad, application/x-acad, application/autocad_dwg, application/dwg, application/x-dwg, application/x-autocad, drawing/dwg -**.nes** | application/vnd.nintendo.snes.rom | - -**.lnk** | application/x-ms-shortcut | - -**.macho** | application/x-mach-binary | - -**.qcp** | audio/qcelp | - -**.icns** | image/x-icns | - -**.hdr** | image/vnd.radiance | - -**.mrc** | application/marc | - -**.mdb** | application/x-msaccess | - -**.accdb** | application/x-msaccess | - -**.zst** | application/zstd | - -**.cab** | application/vnd.ms-cab-compressed | - -**.rpm** | application/x-rpm | - -**.xz** | application/x-xz | - -**.lz** | application/lzip | application/x-lzip -**.torrent** | application/x-bittorrent | - -**.cpio** | application/x-cpio | - -**n/a** | application/tzif | - -**.xcf** | image/x-xcf | - -**.pat** | image/x-gimp-pat | - -**.gbr** | image/x-gimp-gbr | - -**.glb** | model/gltf-binary | - -**.cab** | application/x-installshield | - -**.jxr** | image/jxr | image/vnd.ms-photo -**.parquet** | application/vnd.apache.parquet | application/x-parquet -**.txt** | text/plain | - -**.html** | text/html | - -**.svg** | image/svg+xml | - -**.xml** | text/xml | application/xml -**.rss** | application/rss+xml | text/rss -**.atom** | application/atom+xml | - -**.x3d** | model/x3d+xml | - -**.kml** | application/vnd.google-earth.kml+xml | - -**.xlf** | application/x-xliff+xml | - -**.dae** | model/vnd.collada+xml | - -**.gml** | application/gml+xml | - -**.gpx** | application/gpx+xml | - -**.tcx** | application/vnd.garmin.tcx+xml | - -**.amf** | application/x-amf | - -**.3mf** | application/vnd.ms-package.3dmanufacturing-3dmodel+xml | - -**.xfdf** | application/vnd.adobe.xfdf | - -**.owl** | application/owl+xml | - -**.php** | text/x-php | - -**.js** | text/javascript | application/x-javascript, application/javascript -**.lua** | text/x-lua | - -**.pl** | text/x-perl | - -**.py** | text/x-python | text/x-script.python, application/x-python -**.json** | application/json | - -**.geojson** | application/geo+json | - -**.har** | application/json | - -**.gltf** | model/gltf+json | - -**.ndjson** | application/x-ndjson | - -**.rtf** | text/rtf | application/rtf -**.srt** | application/x-subrip | application/x-srt, text/x-srt -**.tcl** | text/x-tcl | application/x-tcl -**.csv** | text/csv | - -**.tsv** | text/tab-separated-values | - -**.vcf** | text/vcard | - -**.ics** | text/calendar | - -**.warc** | application/warc | - -**.vtt** | text/vtt | - +Extension | MIME type
Aliases | Hierarchy +--------- | ---------------------- | --------- +**n/a** | **application/octet-stream** | root +**.xpm** | **image/x-xpixmap** | xpm>root +**.7z** | **application/x-7z-compressed** | 7z>root +**.zip** | **application/zip**
application/x-zip, application/x-zip-compressed | zip>root +**.docx** | **application/vnd.openxmlformats-officedocument.wordprocessingml.document** | docx>zip>root +**.pptx** | **application/vnd.openxmlformats-officedocument.presentationml.presentation** | pptx>zip>root +**.xlsx** | **application/vnd.openxmlformats-officedocument.spreadsheetml.sheet** | xlsx>zip>root +**.epub** | **application/epub+zip** | epub>zip>root +**.apk** | **application/vnd.android.package-archive** | apk>zip>root +**.jar** | **application/java-archive**
application/jar, application/jar-archive, application/x-java-archive | jar>zip>root +**.odt** | **application/vnd.oasis.opendocument.text**
application/x-vnd.oasis.opendocument.text | odt>zip>root +**.ott** | **application/vnd.oasis.opendocument.text-template**
application/x-vnd.oasis.opendocument.text-template | ott>odt>zip>root +**.ods** | **application/vnd.oasis.opendocument.spreadsheet**
application/x-vnd.oasis.opendocument.spreadsheet | ods>zip>root +**.ots** | **application/vnd.oasis.opendocument.spreadsheet-template**
application/x-vnd.oasis.opendocument.spreadsheet-template | ots>ods>zip>root +**.odp** | **application/vnd.oasis.opendocument.presentation**
application/x-vnd.oasis.opendocument.presentation | odp>zip>root +**.otp** | **application/vnd.oasis.opendocument.presentation-template**
application/x-vnd.oasis.opendocument.presentation-template | otp>odp>zip>root +**.odg** | **application/vnd.oasis.opendocument.graphics**
application/x-vnd.oasis.opendocument.graphics | odg>zip>root +**.otg** | **application/vnd.oasis.opendocument.graphics-template**
application/x-vnd.oasis.opendocument.graphics-template | otg>odg>zip>root +**.odf** | **application/vnd.oasis.opendocument.formula**
application/x-vnd.oasis.opendocument.formula | odf>zip>root +**.odc** | **application/vnd.oasis.opendocument.chart**
application/x-vnd.oasis.opendocument.chart | odc>zip>root +**.sxc** | **application/vnd.sun.xml.calc** | sxc>zip>root +**.kmz** | **application/vnd.google-earth.kmz** | kmz>zip>root +**.vsdx** | **application/vnd.ms-visio.drawing.main+xml** | vsdx>zip>root +**.pdf** | **application/pdf**
application/x-pdf | pdf>root +**.fdf** | **application/vnd.fdf** | fdf>root +**n/a** | **application/x-ole-storage** | x-ole-storage>root +**.msi** | **application/x-ms-installer**
application/x-windows-installer, application/x-msi | msi>x-ole-storage>root +**.msg** | **application/vnd.ms-outlook** | msg>x-ole-storage>root +**.xls** | **application/vnd.ms-excel**
application/msexcel | xls>x-ole-storage>root +**.pub** | **application/vnd.ms-publisher** | pub>x-ole-storage>root +**.ppt** | **application/vnd.ms-powerpoint**
application/mspowerpoint | ppt>x-ole-storage>root +**.doc** | **application/msword**
application/vnd.ms-word | doc>x-ole-storage>root +**.ps** | **application/postscript** | ps>root +**.psd** | **image/vnd.adobe.photoshop**
image/x-psd, application/photoshop | psd>root +**.p7s** | **application/pkcs7-signature** | p7s>root +**.ogg** | **application/ogg**
application/x-ogg | ogg>root +**.oga** | **audio/ogg** | oga>ogg>root +**.ogv** | **video/ogg** | ogv>ogg>root +**.png** | **image/png** | png>root +**.png** | **image/vnd.mozilla.apng** | png>png>root +**.jpg** | **image/jpeg** | jpg>root +**.jxl** | **image/jxl** | jxl>root +**.jp2** | **image/jp2** | jp2>root +**.jpf** | **image/jpx** | jpf>root +**.jpm** | **image/jpm**
video/jpm | jpm>root +**.jxs** | **image/jxs** | jxs>root +**.gif** | **image/gif** | gif>root +**.webp** | **image/webp** | webp>root +**.exe** | **application/vnd.microsoft.portable-executable** | exe>root +**n/a** | **application/x-elf** | x-elf>root +**n/a** | **application/x-object** | x-object>x-elf>root +**n/a** | **application/x-executable** | x-executable>x-elf>root +**.so** | **application/x-sharedlib** | so>x-elf>root +**n/a** | **application/x-coredump** | x-coredump>x-elf>root +**.a** | **application/x-archive**
application/x-unix-archive | a>root +**.deb** | **application/vnd.debian.binary-package** | deb>a>root +**.tar** | **application/x-tar** | tar>root +**.xar** | **application/x-xar** | xar>root +**.bz2** | **application/x-bzip2** | bz2>root +**.fits** | **application/fits**
image/fits | fits>root +**.tiff** | **image/tiff** | tiff>root +**.bmp** | **image/bmp**
image/x-bmp, image/x-ms-bmp | bmp>root +**.123** | **application/vnd.lotus-1-2-3** | 123>root +**.ico** | **image/x-icon** | ico>root +**.mp3** | **audio/mpeg**
audio/x-mpeg, audio/mp3 | mp3>root +**.flac** | **audio/flac** | flac>root +**.midi** | **audio/midi**
audio/mid, audio/sp-midi, audio/x-mid, audio/x-midi | midi>root +**.ape** | **audio/ape** | ape>root +**.mpc** | **audio/musepack** | mpc>root +**.amr** | **audio/amr**
audio/amr-nb | amr>root +**.wav** | **audio/wav**
audio/x-wav, audio/vnd.wave, audio/wave | wav>root +**.aiff** | **audio/aiff**
audio/x-aiff | aiff>root +**.au** | **audio/basic** | au>root +**.mpeg** | **video/mpeg** | mpeg>root +**.mov** | **video/quicktime** | mov>root +**.mp4** | **video/mp4** | mp4>root +**.avif** | **image/avif** | avif>mp4>root +**.3gp** | **video/3gpp**
video/3gp, audio/3gpp | 3gp>mp4>root +**.3g2** | **video/3gpp2**
video/3g2, audio/3gpp2 | 3g2>mp4>root +**.mp4** | **audio/mp4**
audio/x-mp4a | mp4>mp4>root +**.mqv** | **video/quicktime** | mqv>mp4>root +**.m4a** | **audio/x-m4a** | m4a>mp4>root +**.m4v** | **video/x-m4v** | m4v>mp4>root +**.heic** | **image/heic** | heic>mp4>root +**.heic** | **image/heic-sequence** | heic>mp4>root +**.heif** | **image/heif** | heif>mp4>root +**.heif** | **image/heif-sequence** | heif>mp4>root +**.mj2** | **video/mj2** | mj2>mp4>root +**.dvb** | **video/vnd.dvb.file** | dvb>mp4>root +**.webm** | **video/webm**
audio/webm | webm>root +**.avi** | **video/x-msvideo**
video/avi, video/msvideo | avi>root +**.flv** | **video/x-flv** | flv>root +**.mkv** | **video/x-matroska** | mkv>root +**.asf** | **video/x-ms-asf**
video/asf, video/x-ms-wmv | asf>root +**.aac** | **audio/aac** | aac>root +**.voc** | **audio/x-unknown** | voc>root +**.m3u** | **application/vnd.apple.mpegurl**
audio/mpegurl | m3u>root +**.rmvb** | **application/vnd.rn-realmedia-vbr** | rmvb>root +**.gz** | **application/gzip**
application/x-gzip, application/x-gunzip, application/gzipped, application/gzip-compressed, application/x-gzip-compressed, gzip/document | gz>root +**.class** | **application/x-java-applet** | class>root +**.swf** | **application/x-shockwave-flash** | swf>root +**.crx** | **application/x-chrome-extension** | crx>root +**.ttf** | **font/ttf**
font/sfnt, application/x-font-ttf, application/font-sfnt | ttf>root +**.woff** | **font/woff** | woff>root +**.woff2** | **font/woff2** | woff2>root +**.otf** | **font/otf** | otf>root +**.ttc** | **font/collection** | ttc>root +**.eot** | **application/vnd.ms-fontobject** | eot>root +**.wasm** | **application/wasm** | wasm>root +**.shx** | **application/vnd.shx** | shx>root +**.shp** | **application/vnd.shp** | shp>shx>root +**.dbf** | **application/x-dbf** | dbf>root +**.dcm** | **application/dicom** | dcm>root +**.rar** | **application/x-rar-compressed**
application/x-rar | rar>root +**.djvu** | **image/vnd.djvu** | djvu>root +**.mobi** | **application/x-mobipocket-ebook** | mobi>root +**.lit** | **application/x-ms-reader** | lit>root +**.bpg** | **image/bpg** | bpg>root +**.cbor** | **application/cbor** | cbor>root +**.sqlite** | **application/vnd.sqlite3**
application/x-sqlite3 | sqlite>root +**.dwg** | **image/vnd.dwg**
image/x-dwg, application/acad, application/x-acad, application/autocad_dwg, application/dwg, application/x-dwg, application/x-autocad, drawing/dwg | dwg>root +**.nes** | **application/vnd.nintendo.snes.rom** | nes>root +**.lnk** | **application/x-ms-shortcut** | lnk>root +**.macho** | **application/x-mach-binary** | macho>root +**.qcp** | **audio/qcelp** | qcp>root +**.icns** | **image/x-icns** | icns>root +**.hdr** | **image/vnd.radiance** | hdr>root +**.mrc** | **application/marc** | mrc>root +**.mdb** | **application/x-msaccess** | mdb>root +**.accdb** | **application/x-msaccess** | accdb>root +**.zst** | **application/zstd** | zst>root +**.cab** | **application/vnd.ms-cab-compressed** | cab>root +**.rpm** | **application/x-rpm** | rpm>root +**.xz** | **application/x-xz** | xz>root +**.lz** | **application/lzip**
application/x-lzip | lz>root +**.torrent** | **application/x-bittorrent** | torrent>root +**.cpio** | **application/x-cpio** | cpio>root +**n/a** | **application/tzif** | tzif>root +**.xcf** | **image/x-xcf** | xcf>root +**.pat** | **image/x-gimp-pat** | pat>root +**.gbr** | **image/x-gimp-gbr** | gbr>root +**.glb** | **model/gltf-binary** | glb>root +**.cab** | **application/x-installshield** | cab>root +**.jxr** | **image/jxr**
image/vnd.ms-photo | jxr>root +**.parquet** | **application/vnd.apache.parquet**
application/x-parquet | parquet>root +**.one** | **application/onenote** | one>root +**.chm** | **application/vnd.ms-htmlhelp** | chm>root +**.wpd** | **application/vnd.wordperfect** | wpd>root +**.dxf** | **image/vnd.dxf** | dxf>root +**.txt** | **text/plain** | txt>root +**.svg** | **image/svg+xml** | svg>txt>root +**.html** | **text/html** | html>txt>root +**.xml** | **text/xml**
application/xml | xml>txt>root +**.rss** | **application/rss+xml**
text/rss | rss>xml>txt>root +**.atom** | **application/atom+xml** | atom>xml>txt>root +**.x3d** | **model/x3d+xml** | x3d>xml>txt>root +**.kml** | **application/vnd.google-earth.kml+xml** | kml>xml>txt>root +**.xlf** | **application/x-xliff+xml** | xlf>xml>txt>root +**.dae** | **model/vnd.collada+xml** | dae>xml>txt>root +**.gml** | **application/gml+xml** | gml>xml>txt>root +**.gpx** | **application/gpx+xml** | gpx>xml>txt>root +**.tcx** | **application/vnd.garmin.tcx+xml** | tcx>xml>txt>root +**.amf** | **application/x-amf** | amf>xml>txt>root +**.3mf** | **application/vnd.ms-package.3dmanufacturing-3dmodel+xml** | 3mf>xml>txt>root +**.xfdf** | **application/vnd.adobe.xfdf** | xfdf>xml>txt>root +**.owl** | **application/owl+xml** | owl>xml>txt>root +**.html** | **application/xhtml+xml** | html>xml>txt>root +**.php** | **text/x-php** | php>txt>root +**.js** | **text/javascript**
application/x-javascript, application/javascript | js>txt>root +**.lua** | **text/x-lua** | lua>txt>root +**.pl** | **text/x-perl** | pl>txt>root +**.py** | **text/x-python**
text/x-script.python, application/x-python | py>txt>root +**.rb** | **text/x-ruby**
application/x-ruby | rb>txt>root +**.json** | **application/json** | json>txt>root +**.geojson** | **application/geo+json** | geojson>json>txt>root +**.har** | **application/json** | har>json>txt>root +**.gltf** | **model/gltf+json** | gltf>json>txt>root +**.ndjson** | **application/x-ndjson** | ndjson>txt>root +**.rtf** | **text/rtf**
application/rtf | rtf>txt>root +**.srt** | **application/x-subrip**
application/x-srt, text/x-srt | srt>txt>root +**.tcl** | **text/x-tcl**
application/x-tcl | tcl>txt>root +**.csv** | **text/csv** | csv>txt>root +**.tsv** | **text/tab-separated-values** | tsv>txt>root +**.vcf** | **text/vcard** | vcf>txt>root +**.ics** | **text/calendar** | ics>txt>root +**.warc** | **application/warc** | warc>txt>root +**.vtt** | **text/vtt** | vtt>txt>root +**.sh** | **text/x-shellscript**
text/x-sh, application/x-shellscript, application/x-sh | sh>txt>root +**.pbm** | **image/x-portable-bitmap** | pbm>txt>root +**.pgm** | **image/x-portable-graymap** | pgm>txt>root +**.ppm** | **image/x-portable-pixmap** | ppm>txt>root +**.pam** | **image/x-portable-arbitrarymap** | pam>txt>root diff --git a/vendor/github.com/gabriel-vasile/mimetype/tree.go b/vendor/github.com/gabriel-vasile/mimetype/tree.go index 63a2093a4b6..21b70d5c919 100644 --- a/vendor/github.com/gabriel-vasile/mimetype/tree.go +++ b/vendor/github.com/gabriel-vasile/mimetype/tree.go @@ -18,12 +18,13 @@ import ( var root = newMIME("application/octet-stream", "", func([]byte, uint32) bool { return true }, xpm, sevenZ, zip, pdf, fdf, ole, ps, psd, p7s, ogg, png, jpg, jxl, jp2, jpx, - jpm, jxs, gif, webp, exe, elf, ar, tar, xar, bz2, fits, tiff, bmp, ico, mp3, - flac, midi, ape, musePack, amr, wav, aiff, au, mpeg, quickTime, mp4, webM, + jpm, jxs, gif, webp, exe, elf, ar, tar, xar, bz2, fits, tiff, bmp, lotus, ico, + mp3, flac, midi, ape, musePack, amr, wav, aiff, au, mpeg, quickTime, mp4, webM, avi, flv, mkv, asf, aac, voc, m3u, rmvb, gzip, class, swf, crx, ttf, woff, woff2, otf, ttc, eot, wasm, shx, dbf, dcm, rar, djvu, mobi, lit, bpg, cbor, sqlite3, dwg, nes, lnk, macho, qcp, icns, hdr, mrc, mdb, accdb, zstd, cab, rpm, xz, lzip, torrent, cpio, tzif, xcf, pat, gbr, glb, cabIS, jxr, parquet, + oneNote, chm, wpd, dxf, // Keep text last because it is the slowest check. text, ) @@ -48,24 +49,25 @@ var ( // This means APK should be a child of JAR detector, but in practice, // the decisive signature for JAR might be located at the end of the file // and not reachable because of library readLimit. - zip = newMIME("application/zip", ".zip", magic.Zip, xlsx, docx, pptx, epub, apk, jar, odt, ods, odp, odg, odf, odc, sxc). + zip = newMIME("application/zip", ".zip", magic.Zip, docx, pptx, xlsx, epub, apk, jar, odt, ods, odp, odg, odf, odc, sxc, kmz, visio). alias("application/x-zip", "application/x-zip-compressed") tar = newMIME("application/x-tar", ".tar", magic.Tar) xar = newMIME("application/x-xar", ".xar", magic.Xar) bz2 = newMIME("application/x-bzip2", ".bz2", magic.Bz2) - pdf = newMIME("application/pdf", ".pdf", magic.Pdf). + pdf = newMIME("application/pdf", ".pdf", magic.PDF). alias("application/x-pdf") - fdf = newMIME("application/vnd.fdf", ".fdf", magic.Fdf) - xlsx = newMIME("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", ".xlsx", magic.Xlsx) - docx = newMIME("application/vnd.openxmlformats-officedocument.wordprocessingml.document", ".docx", magic.Docx) - pptx = newMIME("application/vnd.openxmlformats-officedocument.presentationml.presentation", ".pptx", magic.Pptx) - epub = newMIME("application/epub+zip", ".epub", magic.Epub) - jar = newMIME("application/jar", ".jar", magic.Jar) - apk = newMIME("application/vnd.android.package-archive", ".apk", magic.APK) - ole = newMIME("application/x-ole-storage", "", magic.Ole, msi, aaf, msg, xls, pub, ppt, doc) - msi = newMIME("application/x-ms-installer", ".msi", magic.Msi). + fdf = newMIME("application/vnd.fdf", ".fdf", magic.Fdf) + xlsx = newMIME("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", ".xlsx", magic.Xlsx) + docx = newMIME("application/vnd.openxmlformats-officedocument.wordprocessingml.document", ".docx", magic.Docx) + pptx = newMIME("application/vnd.openxmlformats-officedocument.presentationml.presentation", ".pptx", magic.Pptx) + visio = newMIME("application/vnd.ms-visio.drawing.main+xml", ".vsdx", magic.Visio) + epub = newMIME("application/epub+zip", ".epub", magic.Epub) + jar = newMIME("application/java-archive", ".jar", magic.Jar). + alias("application/jar", "application/jar-archive", "application/x-java-archive") + apk = newMIME("application/vnd.android.package-archive", ".apk", magic.APK) + ole = newMIME("application/x-ole-storage", "", magic.Ole, msi, msg, xls, pub, ppt, doc) + msi = newMIME("application/x-ms-installer", ".msi", magic.Msi). alias("application/x-windows-installer", "application/x-msi") - aaf = newMIME("application/octet-stream", ".aaf", magic.Aaf) doc = newMIME("application/msword", ".doc", magic.Doc). alias("application/vnd.ms-word") ppt = newMIME("application/vnd.ms-powerpoint", ".ppt", magic.Ppt). @@ -75,18 +77,19 @@ var ( alias("application/msexcel") msg = newMIME("application/vnd.ms-outlook", ".msg", magic.Msg) ps = newMIME("application/postscript", ".ps", magic.Ps) - fits = newMIME("application/fits", ".fits", magic.Fits) + fits = newMIME("application/fits", ".fits", magic.Fits).alias("image/fits") ogg = newMIME("application/ogg", ".ogg", magic.Ogg, oggAudio, oggVideo). alias("application/x-ogg") oggAudio = newMIME("audio/ogg", ".oga", magic.OggAudio) oggVideo = newMIME("video/ogg", ".ogv", magic.OggVideo) - text = newMIME("text/plain", ".txt", magic.Text, html, svg, xml, php, js, lua, perl, python, json, ndJSON, rtf, srt, tcl, csv, tsv, vCard, iCalendar, warc, vtt) - xml = newMIME("text/xml", ".xml", magic.XML, rss, atom, x3d, kml, xliff, collada, gml, gpx, tcx, amf, threemf, xfdf, owl2). + text = newMIME("text/plain", ".txt", magic.Text, svg, html, xml, php, js, lua, perl, python, ruby, json, ndJSON, rtf, srt, tcl, csv, tsv, vCard, iCalendar, warc, vtt, shell, netpbm, netpgm, netppm, netpam) + xml = newMIME("text/xml", ".xml", magic.XML, rss, atom, x3d, kml, xliff, collada, gml, gpx, tcx, amf, threemf, xfdf, owl2, xhtml). alias("application/xml") + xhtml = newMIME("application/xhtml+xml", ".html", magic.XHTML) json = newMIME("application/json", ".json", magic.JSON, geoJSON, har, gltf) har = newMIME("application/json", ".har", magic.HAR) - csv = newMIME("text/csv", ".csv", magic.Csv) - tsv = newMIME("text/tab-separated-values", ".tsv", magic.Tsv) + csv = newMIME("text/csv", ".csv", magic.CSV) + tsv = newMIME("text/tab-separated-values", ".tsv", magic.TSV) geoJSON = newMIME("application/geo+json", ".geojson", magic.GeoJSON) ndJSON = newMIME("application/x-ndjson", ".ndjson", magic.NdJSON) html = newMIME("text/html", ".html", magic.HTML) @@ -101,6 +104,10 @@ var ( perl = newMIME("text/x-perl", ".pl", magic.Perl) python = newMIME("text/x-python", ".py", magic.Python). alias("text/x-script.python", "application/x-python") + ruby = newMIME("text/x-ruby", ".rb", magic.Ruby). + alias("application/x-ruby") + shell = newMIME("text/x-shellscript", ".sh", magic.Shell). + alias("text/x-sh", "application/x-shellscript", "application/x-sh") tcl = newMIME("text/x-tcl", ".tcl", magic.Tcl). alias("application/x-tcl") vCard = newMIME("text/vcard", ".vcf", magic.VCard) @@ -112,6 +119,7 @@ var ( atom = newMIME("application/atom+xml", ".atom", magic.Atom) x3d = newMIME("model/x3d+xml", ".x3d", magic.X3d) kml = newMIME("application/vnd.google-earth.kml+xml", ".kml", magic.Kml) + kmz = newMIME("application/vnd.google-earth.kmz", ".kmz", magic.KMZ) xliff = newMIME("application/x-xliff+xml", ".xlf", magic.Xliff) collada = newMIME("model/vnd.collada+xml", ".dae", magic.Collada) gml = newMIME("application/gml+xml", ".gml", magic.Gml) @@ -135,9 +143,12 @@ var ( tiff = newMIME("image/tiff", ".tiff", magic.Tiff) bmp = newMIME("image/bmp", ".bmp", magic.Bmp). alias("image/x-bmp", "image/x-ms-bmp") - ico = newMIME("image/x-icon", ".ico", magic.Ico) - icns = newMIME("image/x-icns", ".icns", magic.Icns) - psd = newMIME("image/vnd.adobe.photoshop", ".psd", magic.Psd). + // lotus check must be done before ico because some ico detection is a bit + // relaxed and some lotus files are wrongfully identified as ico otherwise. + lotus = newMIME("application/vnd.lotus-1-2-3", ".123", magic.Lotus123) + ico = newMIME("image/x-icon", ".ico", magic.Ico) + icns = newMIME("image/x-icns", ".icns", magic.Icns) + psd = newMIME("image/vnd.adobe.photoshop", ".psd", magic.Psd). alias("image/x-psd", "application/photoshop") heic = newMIME("image/heic", ".heic", magic.Heic) heicSeq = newMIME("image/heic-sequence", ".heic", magic.HeicSequence) @@ -267,5 +278,13 @@ var ( jxr = newMIME("image/jxr", ".jxr", magic.Jxr).alias("image/vnd.ms-photo") parquet = newMIME("application/vnd.apache.parquet", ".parquet", magic.Par1). alias("application/x-parquet") - cbor = newMIME("application/cbor", ".cbor", magic.CBOR) + netpbm = newMIME("image/x-portable-bitmap", ".pbm", magic.NetPBM) + netpgm = newMIME("image/x-portable-graymap", ".pgm", magic.NetPGM) + netppm = newMIME("image/x-portable-pixmap", ".ppm", magic.NetPPM) + netpam = newMIME("image/x-portable-arbitrarymap", ".pam", magic.NetPAM) + cbor = newMIME("application/cbor", ".cbor", magic.CBOR) + oneNote = newMIME("application/onenote", ".one", magic.One) + chm = newMIME("application/vnd.ms-htmlhelp", ".chm", magic.CHM) + wpd = newMIME("application/vnd.wordperfect", ".wpd", magic.WPD) + dxf = newMIME("image/vnd.dxf", ".dxf", magic.DXF) ) diff --git a/vendor/github.com/go-openapi/errors/.golangci.yml b/vendor/github.com/go-openapi/errors/.golangci.yml index ee8b9bd1f14..5609b4fea9c 100644 --- a/vendor/github.com/go-openapi/errors/.golangci.yml +++ b/vendor/github.com/go-openapi/errors/.golangci.yml @@ -1,55 +1,75 @@ -linters-settings: - gocyclo: - min-complexity: 45 - dupl: - threshold: 200 - goconst: - min-len: 2 - min-occurrences: 3 - +version: "2" linters: - enable-all: true + default: all disable: - - unparam - - lll - - gochecknoinits - - gochecknoglobals + - cyclop + - depguard + - errchkjson + - errorlint + - exhaustruct + - forcetypeassert - funlen - - godox + - gochecknoglobals + - gochecknoinits - gocognit - - whitespace - - wsl - - wrapcheck - - testpackage - - nlreturn - - errorlint - - nestif - godot - - gofumpt + - godox + - gosmopolitan + - inamedparam + #- intrange # disabled while < go1.22 + - ireturn + - lll + - musttag + - nestif + - nlreturn + - noinlineerr + - nonamedreturns - paralleltest - - tparallel + - recvcheck + - testpackage - thelper - - exhaustruct + - tparallel + - unparam - varnamelen - - gci - - depguard - - errchkjson - - inamedparam - - nonamedreturns - - musttag - - ireturn - - forcetypeassert - - cyclop - # deprecated linters - #- deadcode - #- interfacer - #- scopelint - #- varcheck - #- structcheck - #- golint - #- nosnakecase - #- maligned - #- goerr113 - #- ifshort - #- gomnd - #- exhaustivestruct + - whitespace + - wrapcheck + - wsl + - wsl_v5 + settings: + dupl: + threshold: 200 + goconst: + min-len: 2 + min-occurrences: 3 + gocyclo: + min-complexity: 45 + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + paths: + - third_party$ + - builtin$ + - examples$ +formatters: + enable: + - gofmt + - goimports + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$ +issues: + # Maximum issues count per one linter. + # Set to 0 to disable. + # Default: 50 + max-issues-per-linter: 0 + # Maximum count of issues with the same text. + # Set to 0 to disable. + # Default: 3 + max-same-issues: 0 diff --git a/vendor/github.com/go-openapi/errors/README.md b/vendor/github.com/go-openapi/errors/README.md index 6d57ea55c7c..d7e3a18bcf5 100644 --- a/vendor/github.com/go-openapi/errors/README.md +++ b/vendor/github.com/go-openapi/errors/README.md @@ -6,3 +6,7 @@ [![Go Report Card](https://goreportcard.com/badge/github.com/go-openapi/errors)](https://goreportcard.com/report/github.com/go-openapi/errors) Shared errors and error interface used throughout the various libraries found in the go-openapi toolkit. + +## Licensing + +This library ships under the [SPDX-License-Identifier: Apache-2.0](./LICENSE). diff --git a/vendor/github.com/go-openapi/errors/api.go b/vendor/github.com/go-openapi/errors/api.go index d6f507f42de..d39233bafe4 100644 --- a/vendor/github.com/go-openapi/errors/api.go +++ b/vendor/github.com/go-openapi/errors/api.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package errors @@ -46,14 +35,14 @@ func (a *apiError) Code() int32 { // MarshalJSON implements the JSON encoding interface func (a apiError) MarshalJSON() ([]byte, error) { - return json.Marshal(map[string]interface{}{ + return json.Marshal(map[string]any{ "code": a.code, "message": a.message, }) } // New creates a new API error with a code and a message -func New(code int32, message string, args ...interface{}) Error { +func New(code int32, message string, args ...any) Error { if len(args) > 0 { return &apiError{ code: code, @@ -67,16 +56,16 @@ func New(code int32, message string, args ...interface{}) Error { } // NotFound creates a new not found error -func NotFound(message string, args ...interface{}) Error { +func NotFound(message string, args ...any) Error { if message == "" { message = "Not found" } - return New(http.StatusNotFound, fmt.Sprintf(message, args...)) + return New(http.StatusNotFound, message, args...) } // NotImplemented creates a new not implemented error func NotImplemented(message string) Error { - return New(http.StatusNotImplemented, message) + return New(http.StatusNotImplemented, "%s", message) } // MethodNotAllowedError represents an error for when the path matches but the method doesn't @@ -97,7 +86,7 @@ func (m *MethodNotAllowedError) Code() int32 { // MarshalJSON implements the JSON encoding interface func (m MethodNotAllowedError) MarshalJSON() ([]byte, error) { - return json.Marshal(map[string]interface{}{ + return json.Marshal(map[string]any{ "code": m.code, "message": m.message, "allowed": m.Allowed, @@ -179,7 +168,7 @@ func ServeError(rw http.ResponseWriter, r *http.Request, err error) { default: rw.WriteHeader(http.StatusInternalServerError) if r == nil || r.Method != http.MethodHead { - _, _ = rw.Write(errorAsJSON(New(http.StatusInternalServerError, err.Error()))) + _, _ = rw.Write(errorAsJSON(New(http.StatusInternalServerError, "%v", err))) } } } diff --git a/vendor/github.com/go-openapi/errors/auth.go b/vendor/github.com/go-openapi/errors/auth.go index 0545b501bd7..08de582e5db 100644 --- a/vendor/github.com/go-openapi/errors/auth.go +++ b/vendor/github.com/go-openapi/errors/auth.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package errors diff --git a/vendor/github.com/go-openapi/errors/doc.go b/vendor/github.com/go-openapi/errors/doc.go index af01190ce61..b4627f30f4c 100644 --- a/vendor/github.com/go-openapi/errors/doc.go +++ b/vendor/github.com/go-openapi/errors/doc.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 /* Package errors provides an Error interface and several concrete types diff --git a/vendor/github.com/go-openapi/errors/headers.go b/vendor/github.com/go-openapi/errors/headers.go index 6ea1151f415..2d837c34ac4 100644 --- a/vendor/github.com/go-openapi/errors/headers.go +++ b/vendor/github.com/go-openapi/errors/headers.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package errors @@ -25,9 +14,9 @@ type Validation struct { //nolint: errname code int32 Name string In string - Value interface{} + Value any message string - Values []interface{} + Values []any } func (e *Validation) Error() string { @@ -41,7 +30,7 @@ func (e *Validation) Code() int32 { // MarshalJSON implements the JSON encoding interface func (e Validation) MarshalJSON() ([]byte, error) { - return json.Marshal(map[string]interface{}{ + return json.Marshal(map[string]any{ "code": e.code, "message": e.message, "in": e.In, @@ -72,7 +61,7 @@ const ( // InvalidContentType error for an invalid content type func InvalidContentType(value string, allowed []string) *Validation { - values := make([]interface{}, 0, len(allowed)) + values := make([]any, 0, len(allowed)) for _, v := range allowed { values = append(values, v) } @@ -88,7 +77,7 @@ func InvalidContentType(value string, allowed []string) *Validation { // InvalidResponseFormat error for an unacceptable response format request func InvalidResponseFormat(value string, allowed []string) *Validation { - values := make([]interface{}, 0, len(allowed)) + values := make([]any, 0, len(allowed)) for _, v := range allowed { values = append(values, v) } diff --git a/vendor/github.com/go-openapi/errors/middleware.go b/vendor/github.com/go-openapi/errors/middleware.go index 67f80386a2e..c434e59a6fa 100644 --- a/vendor/github.com/go-openapi/errors/middleware.go +++ b/vendor/github.com/go-openapi/errors/middleware.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package errors @@ -35,7 +24,7 @@ func (v *APIVerificationFailed) Error() string { hasSpecMissing := len(v.MissingSpecification) > 0 if hasRegMissing { - buf.WriteString(fmt.Sprintf("missing [%s] %s registrations", strings.Join(v.MissingRegistration, ", "), v.Section)) + fmt.Fprintf(buf, "missing [%s] %s registrations", strings.Join(v.MissingRegistration, ", "), v.Section) } if hasRegMissing && hasSpecMissing { @@ -43,7 +32,7 @@ func (v *APIVerificationFailed) Error() string { } if hasSpecMissing { - buf.WriteString(fmt.Sprintf("missing from spec file [%s] %s", strings.Join(v.MissingSpecification, ", "), v.Section)) + fmt.Fprintf(buf, "missing from spec file [%s] %s", strings.Join(v.MissingSpecification, ", "), v.Section) } return buf.String() diff --git a/vendor/github.com/go-openapi/errors/parsing.go b/vendor/github.com/go-openapi/errors/parsing.go index ce1ef9cb675..ea2a7c60377 100644 --- a/vendor/github.com/go-openapi/errors/parsing.go +++ b/vendor/github.com/go-openapi/errors/parsing.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package errors @@ -30,6 +19,24 @@ type ParseError struct { message string } +// NewParseError creates a new parse error +func NewParseError(name, in, value string, reason error) *ParseError { + var msg string + if in == "" { + msg = fmt.Sprintf(parseErrorTemplContentNoIn, name, value, reason) + } else { + msg = fmt.Sprintf(parseErrorTemplContent, name, in, value, reason) + } + return &ParseError{ + code: http.StatusBadRequest, + Name: name, + In: in, + Value: value, + Reason: reason, + message: msg, + } +} + func (e *ParseError) Error() string { return e.message } @@ -45,7 +52,7 @@ func (e ParseError) MarshalJSON() ([]byte, error) { if e.Reason != nil { reason = e.Reason.Error() } - return json.Marshal(map[string]interface{}{ + return json.Marshal(map[string]any{ "code": e.code, "message": e.message, "in": e.In, @@ -59,21 +66,3 @@ const ( parseErrorTemplContent = `parsing %s %s from %q failed, because %s` parseErrorTemplContentNoIn = `parsing %s from %q failed, because %s` ) - -// NewParseError creates a new parse error -func NewParseError(name, in, value string, reason error) *ParseError { - var msg string - if in == "" { - msg = fmt.Sprintf(parseErrorTemplContentNoIn, name, value, reason) - } else { - msg = fmt.Sprintf(parseErrorTemplContent, name, in, value, reason) - } - return &ParseError{ - code: http.StatusBadRequest, - Name: name, - In: in, - Value: value, - Reason: reason, - message: msg, - } -} diff --git a/vendor/github.com/go-openapi/errors/schema.go b/vendor/github.com/go-openapi/errors/schema.go index 8f3239dfd9b..e59ca4f863f 100644 --- a/vendor/github.com/go-openapi/errors/schema.go +++ b/vendor/github.com/go-openapi/errors/schema.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package errors @@ -130,7 +119,7 @@ func (c *CompositeError) Unwrap() []error { // MarshalJSON implements the JSON encoding interface func (c CompositeError) MarshalJSON() ([]byte, error) { - return json.Marshal(map[string]interface{}{ + return json.Marshal(map[string]any{ "code": c.code, "message": c.message, "errors": c.Errors, @@ -254,7 +243,7 @@ func InvalidTypeName(typeName string) *Validation { } // InvalidType creates an error for when the type is invalid -func InvalidType(name, in, typeName string, value interface{}) *Validation { +func InvalidType(name, in, typeName string, value any) *Validation { var message string if in != "" { @@ -302,7 +291,7 @@ func DuplicateItems(name, in string) *Validation { } // TooManyItems error for when an array contains too many items -func TooManyItems(name, in string, maximum int64, value interface{}) *Validation { +func TooManyItems(name, in string, maximum int64, value any) *Validation { msg := fmt.Sprintf(maximumItemsFail, name, in, maximum) if in == "" { msg = fmt.Sprintf(maximumItemsFailNoIn, name, maximum) @@ -318,7 +307,7 @@ func TooManyItems(name, in string, maximum int64, value interface{}) *Validation } // TooFewItems error for when an array contains too few items -func TooFewItems(name, in string, minimum int64, value interface{}) *Validation { +func TooFewItems(name, in string, minimum int64, value any) *Validation { msg := fmt.Sprintf(minItemsFail, name, in, minimum) if in == "" { msg = fmt.Sprintf(minItemsFailNoIn, name, minimum) @@ -333,7 +322,7 @@ func TooFewItems(name, in string, minimum int64, value interface{}) *Validation } // ExceedsMaximumInt error for when maximumimum validation fails -func ExceedsMaximumInt(name, in string, maximum int64, exclusive bool, value interface{}) *Validation { +func ExceedsMaximumInt(name, in string, maximum int64, exclusive bool, value any) *Validation { var message string if in == "" { m := maximumIncFailNoIn @@ -358,7 +347,7 @@ func ExceedsMaximumInt(name, in string, maximum int64, exclusive bool, value int } // ExceedsMaximumUint error for when maximumimum validation fails -func ExceedsMaximumUint(name, in string, maximum uint64, exclusive bool, value interface{}) *Validation { +func ExceedsMaximumUint(name, in string, maximum uint64, exclusive bool, value any) *Validation { var message string if in == "" { m := maximumIncFailNoIn @@ -383,7 +372,7 @@ func ExceedsMaximumUint(name, in string, maximum uint64, exclusive bool, value i } // ExceedsMaximum error for when maximumimum validation fails -func ExceedsMaximum(name, in string, maximum float64, exclusive bool, value interface{}) *Validation { +func ExceedsMaximum(name, in string, maximum float64, exclusive bool, value any) *Validation { var message string if in == "" { m := maximumIncFailNoIn @@ -408,7 +397,7 @@ func ExceedsMaximum(name, in string, maximum float64, exclusive bool, value inte } // ExceedsMinimumInt error for when minimum validation fails -func ExceedsMinimumInt(name, in string, minimum int64, exclusive bool, value interface{}) *Validation { +func ExceedsMinimumInt(name, in string, minimum int64, exclusive bool, value any) *Validation { var message string if in == "" { m := minIncFailNoIn @@ -433,7 +422,7 @@ func ExceedsMinimumInt(name, in string, minimum int64, exclusive bool, value int } // ExceedsMinimumUint error for when minimum validation fails -func ExceedsMinimumUint(name, in string, minimum uint64, exclusive bool, value interface{}) *Validation { +func ExceedsMinimumUint(name, in string, minimum uint64, exclusive bool, value any) *Validation { var message string if in == "" { m := minIncFailNoIn @@ -458,7 +447,7 @@ func ExceedsMinimumUint(name, in string, minimum uint64, exclusive bool, value i } // ExceedsMinimum error for when minimum validation fails -func ExceedsMinimum(name, in string, minimum float64, exclusive bool, value interface{}) *Validation { +func ExceedsMinimum(name, in string, minimum float64, exclusive bool, value any) *Validation { var message string if in == "" { m := minIncFailNoIn @@ -483,7 +472,7 @@ func ExceedsMinimum(name, in string, minimum float64, exclusive bool, value inte } // NotMultipleOf error for when multiple of validation fails -func NotMultipleOf(name, in string, multiple, value interface{}) *Validation { +func NotMultipleOf(name, in string, multiple, value any) *Validation { var msg string if in == "" { msg = fmt.Sprintf(multipleOfFailNoIn, name, multiple) @@ -500,7 +489,7 @@ func NotMultipleOf(name, in string, multiple, value interface{}) *Validation { } // EnumFail error for when an enum validation fails -func EnumFail(name, in string, value interface{}, values []interface{}) *Validation { +func EnumFail(name, in string, value any, values []any) *Validation { var msg string if in == "" { msg = fmt.Sprintf(enumFailNoIn, name, values) @@ -519,7 +508,7 @@ func EnumFail(name, in string, value interface{}, values []interface{}) *Validat } // Required error for when a value is missing -func Required(name, in string, value interface{}) *Validation { +func Required(name, in string, value any) *Validation { var msg string if in == "" { msg = fmt.Sprintf(requiredFailNoIn, name) @@ -536,7 +525,7 @@ func Required(name, in string, value interface{}) *Validation { } // ReadOnly error for when a value is present in request -func ReadOnly(name, in string, value interface{}) *Validation { +func ReadOnly(name, in string, value any) *Validation { var msg string if in == "" { msg = fmt.Sprintf(readOnlyFailNoIn, name) @@ -553,7 +542,7 @@ func ReadOnly(name, in string, value interface{}) *Validation { } // TooLong error for when a string is too long -func TooLong(name, in string, maximum int64, value interface{}) *Validation { +func TooLong(name, in string, maximum int64, value any) *Validation { var msg string if in == "" { msg = fmt.Sprintf(tooLongMessageNoIn, name, maximum) @@ -570,7 +559,7 @@ func TooLong(name, in string, maximum int64, value interface{}) *Validation { } // TooShort error for when a string is too short -func TooShort(name, in string, minimum int64, value interface{}) *Validation { +func TooShort(name, in string, minimum int64, value any) *Validation { var msg string if in == "" { msg = fmt.Sprintf(tooShortMessageNoIn, name, minimum) @@ -589,7 +578,7 @@ func TooShort(name, in string, minimum int64, value interface{}) *Validation { // FailedPattern error for when a string fails a regex pattern match // the pattern that is returned is the ECMA syntax version of the pattern not the golang version. -func FailedPattern(name, in, pattern string, value interface{}) *Validation { +func FailedPattern(name, in, pattern string, value any) *Validation { var msg string if in == "" { msg = fmt.Sprintf(patternFailNoIn, name, pattern) @@ -608,7 +597,7 @@ func FailedPattern(name, in, pattern string, value interface{}) *Validation { // MultipleOfMustBePositive error for when a // multipleOf factor is negative -func MultipleOfMustBePositive(name, in string, factor interface{}) *Validation { +func MultipleOfMustBePositive(name, in string, factor any) *Validation { return &Validation{ code: MultipleOfMustBePositiveCode, Name: name, diff --git a/vendor/github.com/go-openapi/strfmt/.golangci.yml b/vendor/github.com/go-openapi/strfmt/.golangci.yml index 22f8d21cca1..1ad5adf47e6 100644 --- a/vendor/github.com/go-openapi/strfmt/.golangci.yml +++ b/vendor/github.com/go-openapi/strfmt/.golangci.yml @@ -1,61 +1,75 @@ -linters-settings: - govet: - check-shadowing: true - golint: - min-confidence: 0 - gocyclo: - min-complexity: 45 - maligned: - suggest-new: true - dupl: - threshold: 200 - goconst: - min-len: 2 - min-occurrences: 3 - +version: "2" linters: - enable-all: true + default: all disable: - - maligned - - unparam - - lll - - gochecknoinits - - gochecknoglobals + - cyclop + - depguard + - errchkjson + - errorlint + - exhaustruct + - forcetypeassert - funlen - - godox + - gochecknoglobals + - gochecknoinits - gocognit - - whitespace - - wsl - - wrapcheck - - testpackage - - nlreturn - - gomnd - - exhaustivestruct - - goerr113 - - errorlint - - nestif - godot - - gofumpt + - godox + - gosmopolitan + - inamedparam + - intrange + - ireturn + - lll + - musttag + - nestif + - nlreturn + - nonamedreturns + - noinlineerr - paralleltest - - tparallel + - recvcheck + - testpackage - thelper - - ifshort - - exhaustruct + - tparallel + - unparam - varnamelen - - gci - - depguard - - errchkjson - - inamedparam - - nonamedreturns - - musttag - - ireturn - - forcetypeassert - - cyclop - # deprecated linters - - deadcode - - interfacer - - scopelint - - varcheck - - structcheck - - golint - - nosnakecase + - whitespace + - wrapcheck + - wsl + - wsl_v5 + settings: + dupl: + threshold: 200 + goconst: + min-len: 2 + min-occurrences: 3 + gocyclo: + min-complexity: 45 + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + paths: + - third_party$ + - builtin$ + - examples$ +formatters: + enable: + - gofmt + - goimports + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$ +issues: + # Maximum issues count per one linter. + # Set to 0 to disable. + # Default: 50 + max-issues-per-linter: 0 + # Maximum count of issues with the same text. + # Set to 0 to disable. + # Default: 3 + max-same-issues: 0 diff --git a/vendor/github.com/go-openapi/strfmt/README.md b/vendor/github.com/go-openapi/strfmt/README.md index f6b39c6c56c..de5afe13760 100644 --- a/vendor/github.com/go-openapi/strfmt/README.md +++ b/vendor/github.com/go-openapi/strfmt/README.md @@ -35,7 +35,7 @@ It also provides convenient extensions to go-openapi users. - mac (e.g "01:02:03:04:05:06") - rgbcolor (e.g. "rgb(100,100,100)") - ssn - - uuid, uuid3, uuid4, uuid5 + - uuid, uuid3, uuid4, uuid5, uuid7 - cidr (e.g. "192.0.2.1/24", "2001:db8:a0b:12f0::1/32") - ulid (e.g. "00000PP9HGSBSSDZ1JTEXBJ0PW", [spec](https://github.com/ulid/spec)) @@ -81,7 +81,12 @@ List of defined types: - SSN - URI - UUID -- UUID3 -- UUID4 -- UUID5 +- [UUID3](https://www.rfc-editor.org/rfc/rfc9562.html#name-uuid-version-3) +- [UUID4](https://www.rfc-editor.org/rfc/rfc9562.html#name-uuid-version-4) +- [UUID5](https://www.rfc-editor.org/rfc/rfc9562.html#name-uuid-version-5) +- [UUID7](https://www.rfc-editor.org/rfc/rfc9562.html#name-uuid-version-7) - [ULID](https://github.com/ulid/spec) + +## Licensing + +This library ships under the [SPDX-License-Identifier: Apache-2.0](./LICENSE). diff --git a/vendor/github.com/go-openapi/strfmt/bson.go b/vendor/github.com/go-openapi/strfmt/bson.go index cfa9a526feb..0eec8f6432c 100644 --- a/vendor/github.com/go-openapi/strfmt/bson.go +++ b/vendor/github.com/go-openapi/strfmt/bson.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package strfmt @@ -18,9 +7,6 @@ import ( "database/sql/driver" "fmt" - "go.mongodb.org/mongo-driver/bson" - - "go.mongodb.org/mongo-driver/bson/bsontype" bsonprim "go.mongodb.org/mongo-driver/bson/primitive" ) @@ -39,10 +25,10 @@ func IsBSONObjectID(str string) bool { // ObjectId represents a BSON object ID (alias to go.mongodb.org/mongo-driver/bson/primitive.ObjectID) // // swagger:strfmt bsonobjectid -type ObjectId bsonprim.ObjectID //nolint:revive,stylecheck +type ObjectId bsonprim.ObjectID //nolint:revive // NewObjectId creates a ObjectId from a Hex String -func NewObjectId(hex string) ObjectId { //nolint:revive,stylecheck +func NewObjectId(hex string) ObjectId { //nolint:revive oid, err := bsonprim.ObjectIDFromHex(hex) if err != nil { panic(err) @@ -75,7 +61,7 @@ func (id *ObjectId) UnmarshalText(data []byte) error { // validation is performe } // Scan read a value from a database driver -func (id *ObjectId) Scan(raw interface{}) error { +func (id *ObjectId) Scan(raw any) error { var data []byte switch v := raw.(type) { case []byte: @@ -83,7 +69,7 @@ func (id *ObjectId) Scan(raw interface{}) error { case string: data = []byte(v) default: - return fmt.Errorf("cannot sql.Scan() strfmt.URI from: %#v", v) + return fmt.Errorf("cannot sql.Scan() strfmt.URI from: %#v: %w", v, ErrFormat) } return id.UnmarshalText(data) @@ -113,42 +99,6 @@ func (id *ObjectId) UnmarshalJSON(data []byte) error { return nil } -// MarshalBSON renders the object id as a BSON document -func (id ObjectId) MarshalBSON() ([]byte, error) { - return bson.Marshal(bson.M{"data": bsonprim.ObjectID(id)}) -} - -// UnmarshalBSON reads the objectId from a BSON document -func (id *ObjectId) UnmarshalBSON(data []byte) error { - var obj struct { - Data bsonprim.ObjectID - } - if err := bson.Unmarshal(data, &obj); err != nil { - return err - } - *id = ObjectId(obj.Data) - return nil -} - -// MarshalBSONValue is an interface implemented by types that can marshal themselves -// into a BSON document represented as bytes. The bytes returned must be a valid -// BSON document if the error is nil. -func (id ObjectId) MarshalBSONValue() (bsontype.Type, []byte, error) { - oid := bsonprim.ObjectID(id) - return bson.TypeObjectID, oid[:], nil -} - -// UnmarshalBSONValue is an interface implemented by types that can unmarshal a -// BSON value representation of themselves. The BSON bytes and type can be -// assumed to be valid. UnmarshalBSONValue must copy the BSON value bytes if it -// wishes to retain the data after returning. -func (id *ObjectId) UnmarshalBSONValue(_ bsontype.Type, data []byte) error { - var oid bsonprim.ObjectID - copy(oid[:], data) - *id = ObjectId(oid) - return nil -} - // DeepCopyInto copies the receiver and writes its value into out. func (id *ObjectId) DeepCopyInto(out *ObjectId) { *out = *id diff --git a/vendor/github.com/go-openapi/strfmt/date.go b/vendor/github.com/go-openapi/strfmt/date.go index 3c93381c7cc..8aa17b8ea55 100644 --- a/vendor/github.com/go-openapi/strfmt/date.go +++ b/vendor/github.com/go-openapi/strfmt/date.go @@ -1,27 +1,13 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package strfmt import ( "database/sql/driver" "encoding/json" - "errors" "fmt" "time" - - "go.mongodb.org/mongo-driver/bson" ) func init() { @@ -71,7 +57,7 @@ func (d Date) MarshalText() ([]byte, error) { } // Scan scans a Date value from database driver type. -func (d *Date) Scan(raw interface{}) error { +func (d *Date) Scan(raw any) error { switch v := raw.(type) { case []byte: return d.UnmarshalText(v) @@ -84,7 +70,7 @@ func (d *Date) Scan(raw interface{}) error { *d = Date{} return nil default: - return fmt.Errorf("cannot sql.Scan() strfmt.Date from: %#v", v) + return fmt.Errorf("cannot sql.Scan() strfmt.Date from: %#v: %w", v, ErrFormat) } } @@ -115,28 +101,6 @@ func (d *Date) UnmarshalJSON(data []byte) error { return nil } -func (d Date) MarshalBSON() ([]byte, error) { - return bson.Marshal(bson.M{"data": d.String()}) -} - -func (d *Date) UnmarshalBSON(data []byte) error { - var m bson.M - if err := bson.Unmarshal(data, &m); err != nil { - return err - } - - if data, ok := m["data"].(string); ok { - rd, err := time.ParseInLocation(RFC3339FullDate, data, DefaultTimeLocation) - if err != nil { - return err - } - *d = Date(rd) - return nil - } - - return errors.New("couldn't unmarshal bson bytes value as Date") -} - // DeepCopyInto copies the receiver and writes its value into out. func (d *Date) DeepCopyInto(out *Date) { *out = *d diff --git a/vendor/github.com/go-openapi/strfmt/default.go b/vendor/github.com/go-openapi/strfmt/default.go index 2813714060e..8a80cfbdb8a 100644 --- a/vendor/github.com/go-openapi/strfmt/default.go +++ b/vendor/github.com/go-openapi/strfmt/default.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package strfmt @@ -18,46 +7,24 @@ import ( "database/sql/driver" "encoding/base64" "encoding/json" - "errors" "fmt" + "net" "net/mail" + "net/netip" + "net/url" "regexp" + "strconv" "strings" - "github.com/asaskevich/govalidator" "github.com/google/uuid" - "go.mongodb.org/mongo-driver/bson" + "golang.org/x/net/idna" ) const ( - // HostnamePattern http://json-schema.org/latest/json-schema-validation.html#anchor114 - // A string instance is valid against this attribute if it is a valid - // representation for an Internet host name, as defined by RFC 1034, section 3.1 [RFC1034]. - // http://tools.ietf.org/html/rfc1034#section-3.5 - // ::= any one of the ten digits 0 through 9 - // var digit = /[0-9]/; - // ::= any one of the 52 alphabetic characters A through Z in upper case and a through z in lower case - // var letter = /[a-zA-Z]/; - // ::= | - // var letDig = /[0-9a-zA-Z]/; - // ::= | "-" - // var letDigHyp = /[-0-9a-zA-Z]/; - // ::= | - // var ldhStr = /[-0-9a-zA-Z]+/; - //